2using System.Collections.Generic;
50 public override IEnumerable<Status>
Run()
91 idSong =
"trumpet_practice";
94 idSong =
"piano_gould";
96 case "piano_killkill":
98 idSong =
"piano_neko";
101 idSong =
"piano_kanon";
104 idSong =
"harpsichord_goldberg";
107 idSong =
"guitar_caccini";
109 case "guitar_efrond":
110 idSong =
"guitar_dusk";
113 idSong =
"guitar_air";
116 idSong =
"harp_komori";
120 idSong =
"guitar_sad";
135 idSong =
"tambourine";
138 idSong =
"mic_rachmaninoff";
141 idSong =
"cello_prelude";
143 case "instrument_violin":
145 idSong =
"violin_chaconne";
148 idSong =
"violin_furusato";
151 idSong =
"violin_chaconne";
173 EClass.player.playingSong =
playing;
185 List<Chara> reacted =
new List<Chara>();
189 cancelWhenMoved =
false,
190 showProgress =
false,
192 onProgressBegin = delegate
204 if (
playing.
mistakes == 0 && (
bool)playing.source && playing.source.isPlaying && playing.source.data.name == idSong)
207 if (Mathf.Abs(soundSource.source.time - (soundSource.data as BGMData).song.parts[
playing.
index].start) < 2f && playing.source.source.volume >= 0.1f)
209 soundSource.KeepPlay();
211 Debug.Log(
"keep:" + soundSource.source.time);
224 playing.bgm = playing.source.data as BGMData;
242 SoundManager.jingleTimer = part.duration / playing.bgm.pitch + playing.bgm.song.fadeIn + 2f;
251 if (
tool.
id ==
"tambourine")
276 if (
item.conSleep !=
null &&
item.ResistLv(957) <= 0)
278 item.conSleep.Kill();
285 foreach (
Chara item2
in list)
291 if (!reacted.Contains(item2) &&
EClass.
rnd(5) == 0)
301 if (value.
source.categorySub ==
"eleAttack")
318 item2.
Talk(
"musicBored");
323 if (
EClass.
rnd(num2 * num2) <= 30 && item2.pos.FirstChara == item2)
326 p.cancelWhenDamaged =
false;
332 score -= item2.LV / 2 - 10;
336 item2.
Talk(
"musicBad");
340 item2.
Say(
"musicBad", item2,
owner);
359 item2.
Talk(
"musicGood");
363 item2.
Say(
"musicGood", item2,
owner);
374 p.cancelWhenDamaged =
true;
384 onProgressComplete = delegate
393 playing.mistakes = 0;
403 yield
return Do(progress);
404 if (progress.status ==
Status.Fail)
408 void LevelSong(
int a)
423 if (owner ==
null || !owner.IsPC)
429 score = score * 110 / 100;
433 score = score / 2 - 20;
435 int num = Mathf.Clamp(score / 20 + 1, 0, 9);
439 owner.Say(
"music_reward", owner, gold.ToString() ??
"");
443 owner.stamina.Mod(-1);
446 if (questMusic !=
null)
448 questMusic.score += score;
449 questMusic.sumMoney += gold;
450 int num2 = num / 2 - 1;
453 SE.Play(
"clap" + num2);
466 text = ((
EClass.
rnd(5) == 0) ?
"rock" :
"pebble");
469 text = ((
EClass.
rnd(3) == 0) ?
"water_dirty" :
"water");
493 text =
"casino_coin";
499 text =
"piano_killkill";
506 text =
"piano_gould";
515 num = (
EClass.
rnd(c.
LV * 2 + 1) + 1) * (100 + toolLv * 2 + owner.Evalue(1405) * 10) / 100;
546 if (!owner.IsPCParty && !punish && text !=
"money")
556 ignoreDamage =
false;
561 if (!owner.IsPC && owner.things.IsFull())
567 if (!owner.IsAliveInCurrentZone)
575 if (thing.
id ==
"money" && !owner.IsPC)
577 int num2 = (owner.Evalue(241) * 10 + 100) / ((owner.IsPCFaction && owner.memberType ==
FactionMemberType.Default) ? 1 : 10);
578 if (owner.GetCurrency() - num2 > 0)
580 owner.c_allowance += num;
581 owner.ModCurrency(-num);
589 if (playing !=
null && (
bool)playing.
bgm)
596 playing.source =
null;
597 SoundManager.jingleTimer = 1f;
599 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 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)