2using System.Collections.Generic;
50 public override IEnumerable<Status>
Run()
91 idSong =
"trumpet_practice";
94 idSong =
"piano_gould";
97 idSong =
"piano_neko";
100 idSong =
"piano_kanon";
103 idSong =
"harpsichord_goldberg";
106 idSong =
"guitar_caccini";
108 case "guitar_efrond":
109 idSong =
"guitar_dusk";
112 idSong =
"guitar_air";
115 idSong =
"harp_komori";
118 idSong =
"guitar_sad";
127 idSong =
"mic_rachmaninoff";
130 idSong =
"cello_prelude";
132 case "instrument_violin":
134 idSong =
"violin_chaconne";
137 idSong =
"violin_furusato";
140 idSong =
"violin_chaconne";
162 EClass.player.playingSong =
playing;
174 List<Chara> reacted =
new List<Chara>();
178 cancelWhenMoved =
false,
179 showProgress =
false,
181 onProgressBegin = delegate
193 if (
playing.
mistakes == 0 && (
bool)playing.source && playing.source.isPlaying && playing.source.data.name == idSong)
196 if (Mathf.Abs(soundSource.source.time - (soundSource.data as BGMData).song.parts[
playing.
index].start) < 2f && playing.source.source.volume >= 0.1f)
198 soundSource.KeepPlay();
200 Debug.Log(
"keep:" + soundSource.source.time);
213 playing.bgm = playing.source.data as BGMData;
231 SoundManager.jingleTimer = part.duration / playing.bgm.pitch + playing.bgm.song.fadeIn + 2f;
261 if (
item.conSleep !=
null &&
item.ResistLv(957) <= 0)
263 item.conSleep.Kill();
270 foreach (
Chara item2
in list)
276 if (!reacted.Contains(item2) &&
EClass.
rnd(5) == 0)
287 item2.
Talk(
"musicBored");
291 if (
EClass.
rnd(num2 * num2) <= 30 && item2.pos.FirstChara == item2)
299 score -= item2.LV / 2 - 10;
303 item2.
Talk(
"musicBad");
307 item2.
Say(
"musicBad", item2,
owner);
326 item2.
Talk(
"musicGood");
330 item2.
Say(
"musicGood", item2,
owner);
350 onProgressComplete = delegate
359 playing.mistakes = 0;
369 yield
return Do(seq);
370 void LevelSong(
int a)
385 if (owner ==
null || !owner.IsPC)
391 score = score * 110 / 100;
395 score = score / 2 - 20;
397 int num = Mathf.Clamp(score / 20 + 1, 0, 9);
401 owner.Say(
"music_reward", owner, gold.ToString() ??
"");
405 owner.stamina.Mod(-1);
408 if (questMusic !=
null)
410 questMusic.score += score;
411 questMusic.sumMoney += gold;
412 int num2 = num / 2 - 1;
415 SE.Play(
"clap" + num2);
427 text = ((
EClass.
rnd(5) == 0) ?
"rock" :
"pebble");
430 text = ((
EClass.
rnd(3) == 0) ?
"water_dirty" :
"water");
454 text =
"casino_coin";
459 num = (
EClass.
rnd(c.
LV * 2 + 1) + 1) * (100 + toolLv * 2 + owner.Evalue(1405) * 10) / 100;
490 if (!owner.IsPCParty && !punish && text !=
"money")
500 ignoreDamage =
false;
505 if (!owner.IsPC && owner.things.IsFull())
511 if (thing.
id ==
"money" && !owner.IsPC)
513 int num2 = (owner.Evalue(241) * 10 + 100) / ((owner.IsPCFaction && owner.memberType ==
FactionMemberType.Default) ? 1 : 10);
514 if (owner.GetCurrency() - num2 > 0)
516 owner.c_allowance += num;
517 owner.ModCurrency(-num);
524 if (playing !=
null && (
bool)playing.
bgm)
531 playing.source =
null;
532 SoundManager.jingleTimer = 1f;
534 Evaluate(success:
false);
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Status Do(AIAct _seq, Func< Status > _onChildFail=null)
Status DoGoto(Point pos, int dist=0, bool ignoreConnection=false, Func< Status > _onChildFail=null)
override bool CancelWhenDamaged
override bool ShowProgress
override IEnumerable< Status > Run()
void ThrowReward(Chara c, bool punish)
static void CancelKeepPlaying()
void Evaluate(bool success)
static EffectIRenderer Throw(Card c, Point p, Thing t, ThrowMethod method=ThrowMethod.Default, float failChance=0f)
void PlayAnime(AnimeID id, bool force)
ElementContainerCard elements
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Thing AddThing(string id, int lv=-1)
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
void ShowEmo(Emo _emo=Emo.none, float duration=0f, bool skipSame=true)
void PlayAnime(AnimeID id, bool force=false)
void Say(string lang, string ref1=null, string ref2=null)
override bool IsPCFaction
override bool IsPCFactionMinion
override void LookAt(Card c)
static SoundManager Sound
void ModExp(int ele, int a, bool chain=false)
ConfigPreference preference
static string[] GetList(string id)
List< Chara > ListCharasInCircle(Point center, float radius, bool los=true)
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Dictionary< string, KnownSong > knownSongs
List< Chara > ListWitnesses(Chara criminal, int radius=4, WitnessType type=WitnessType.crime, Chara target=null)
static TargetTypeSelf Self
static Thing Create(string id, int idMat=-1, int lv=-1)
void SetSong(SoundSource _source, BGMData _bgm, BGMData.Part _part)