2using System.Collections.Generic;
50 public override IEnumerable<Status>
Run()
92 idSong =
"trumpet_practice";
95 idSong =
"piano_gould";
97 case "piano_killkill":
99 idSong =
"piano_neko";
102 idSong =
"piano_kanon";
105 idSong =
"harpsichord_goldberg";
108 idSong =
"guitar_caccini";
111 idSong =
"ocarina_lulu";
114 idSong =
"harmonica_kumi";
116 case "guitar_efrond":
118 idSong =
"guitar_dusk";
121 idSong =
"guitar_air";
124 idSong =
"harp_komori";
128 idSong =
"guitar_sad";
144 idSong =
"tambourine";
147 idSong =
"mic_rachmaninoff";
150 idSong =
"cello_prelude";
155 case "instrument_violin":
157 idSong =
"violin_chaconne";
160 idSong =
"violin_furusato";
185 EClass.player.playingSong =
playing;
197 List<Chara> reacted =
new List<Chara>();
201 cancelWhenMoved =
false,
202 showProgress =
false,
204 onProgressBegin = delegate
216 if (
playing.
mistakes == 0 && (
bool)playing.source && playing.source.isPlaying && playing.source.data.name == idSong)
219 if (Mathf.Abs(soundSource.source.time - (soundSource.data as BGMData).song.parts[
playing.
index].start) < 2f && playing.source.source.volume >= 0.1f)
221 soundSource.KeepPlay();
223 Debug.Log(
"keep:" + soundSource.source.time);
236 playing.bgm = playing.source.data as BGMData;
254 SoundManager.jingleTimer = part.duration / playing.bgm.pitch + playing.bgm.song.fadeIn + 2f;
263 if (
tool.
id ==
"tambourine")
288 if (
item.conSleep !=
null &&
item.ResistLv(957) <= 0)
290 item.conSleep.Kill();
297 foreach (
Chara item2
in list)
303 if (!reacted.Contains(item2) &&
EClass.
rnd(5) == 0)
313 if (value.
source.categorySub ==
"eleAttack")
330 item2.
Talk(
"musicBored");
335 if (
EClass.
rnd(num2 * num2) <= 30 && item2.pos.FirstChara == item2)
338 p.cancelWhenDamaged =
false;
344 score -= item2.LV / 2 - 10;
348 item2.
Talk(
"musicBad");
352 item2.
Say(
"musicBad", item2,
owner);
371 item2.
Talk(
"musicGood");
375 item2.
Say(
"musicGood", item2,
owner);
386 p.cancelWhenDamaged =
true;
396 onProgressComplete = delegate
405 playing.mistakes = 0;
415 yield
return Do(progress);
416 if (progress.status ==
Status.Fail)
420 void LevelSong(
int a)
435 if (owner ==
null || !owner.IsPC)
441 score = score * 110 / 100;
445 score = score / 2 - 20;
447 int num = Mathf.Clamp(score / 20 + 1, 0, 9);
451 owner.Say(
"music_reward", owner, gold.ToString() ??
"");
455 owner.stamina.Mod(-1);
458 if (questMusic !=
null)
460 questMusic.score += score;
461 questMusic.sumMoney += gold;
462 int num2 = num / 2 - 1;
465 SE.Play(
"clap" + num2);
478 text = ((
EClass.
rnd(5) == 0) ?
"rock" :
"pebble");
481 text = ((
EClass.
rnd(3) == 0) ?
"water_dirty" :
"water");
505 text =
"casino_coin";
511 text =
"piano_killkill";
518 text =
"piano_gould";
527 num = (
EClass.
rnd(c.
LV * 2 + 1) + 1) * (100 + toolLv * 2 + owner.Evalue(1405) * 10) / 100;
558 if (!owner.IsPCParty && !punish && text !=
"money")
568 ignoreDamage =
false;
573 if (!owner.IsPC && owner.things.IsFull())
579 if (!owner.IsAliveInCurrentZone)
587 if (thing.
id ==
"money" && !owner.IsPC)
589 int? obj = ((owner.Evalue(241) +
tool?.Evalue(241)) * 10 + 100) / ((owner.IsPCFaction && owner.memberType ==
FactionMemberType.Default) ? 1 : 10);
590 if (owner.GetCurrency() - obj > 0)
592 owner.c_allowance += num;
593 owner.ModCurrency(-num);
601 if (playing !=
null && (
bool)playing.
bgm)
608 playing.source =
null;
609 SoundManager.jingleTimer = 1f;
611 Evaluate(success:
false);
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 ApplyElementEffect(Element e, int eleP, Card origin, bool checkHostileAct=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)
Condition AddCondition(string id, int p=100, bool force=false)
override bool IsPCFaction
override bool IsPCFactionMinion
override void LookAt(Card c)
static SoundManager Sound
void ModExp(int ele, float a, bool chain=false)
Dictionary< int, Element > dict
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)