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":
117 idSong =
"guitar_dusk";
120 idSong =
"guitar_air";
123 idSong =
"harp_komori";
127 idSong =
"guitar_sad";
143 idSong =
"tambourine";
146 idSong =
"mic_rachmaninoff";
149 idSong =
"cello_prelude";
154 case "instrument_violin":
156 idSong =
"violin_chaconne";
159 idSong =
"violin_furusato";
184 EClass.player.playingSong =
playing;
196 List<Chara> reacted =
new List<Chara>();
200 cancelWhenMoved =
false,
201 showProgress =
false,
203 onProgressBegin = delegate
215 if (
playing.
mistakes == 0 && (
bool)playing.source && playing.source.isPlaying && playing.source.data.name == idSong)
218 if (Mathf.Abs(soundSource.source.time - (soundSource.data as BGMData).song.parts[
playing.
index].start) < 2f && playing.source.source.volume >= 0.1f)
220 soundSource.KeepPlay();
222 Debug.Log(
"keep:" + soundSource.source.time);
235 playing.bgm = playing.source.data as BGMData;
253 SoundManager.jingleTimer = part.duration / playing.bgm.pitch + playing.bgm.song.fadeIn + 2f;
262 if (
tool.
id ==
"tambourine")
287 if (
item.conSleep !=
null &&
item.ResistLv(957) <= 0)
289 item.conSleep.Kill();
296 foreach (
Chara item2
in list)
302 if (!reacted.Contains(item2) &&
EClass.
rnd(5) == 0)
312 if (value.
source.categorySub ==
"eleAttack")
329 item2.
Talk(
"musicBored");
334 if (
EClass.
rnd(num2 * num2) <= 30 && item2.pos.FirstChara == item2)
337 p.cancelWhenDamaged =
false;
343 score -= item2.LV / 2 - 10;
347 item2.
Talk(
"musicBad");
351 item2.
Say(
"musicBad", item2,
owner);
370 item2.
Talk(
"musicGood");
374 item2.
Say(
"musicGood", item2,
owner);
385 p.cancelWhenDamaged =
true;
395 onProgressComplete = delegate
404 playing.mistakes = 0;
414 yield
return Do(progress);
415 if (progress.status ==
Status.Fail)
419 void LevelSong(
int a)
434 if (owner ==
null || !owner.IsPC)
440 score = score * 110 / 100;
444 score = score / 2 - 20;
446 int num = Mathf.Clamp(score / 20 + 1, 0, 9);
450 owner.Say(
"music_reward", owner, gold.ToString() ??
"");
454 owner.stamina.Mod(-1);
457 if (questMusic !=
null)
459 questMusic.score += score;
460 questMusic.sumMoney += gold;
461 int num2 = num / 2 - 1;
464 SE.Play(
"clap" + num2);
477 text = ((
EClass.
rnd(5) == 0) ?
"rock" :
"pebble");
480 text = ((
EClass.
rnd(3) == 0) ?
"water_dirty" :
"water");
504 text =
"casino_coin";
510 text =
"piano_killkill";
517 text =
"piano_gould";
526 num = (
EClass.
rnd(c.
LV * 2 + 1) + 1) * (100 + toolLv * 2 + owner.Evalue(1405) * 10) / 100;
557 if (!owner.IsPCParty && !punish && text !=
"money")
567 ignoreDamage =
false;
572 if (!owner.IsPC && owner.things.IsFull())
578 if (!owner.IsAliveInCurrentZone)
586 if (thing.
id ==
"money" && !owner.IsPC)
588 int? obj = ((owner.Evalue(241) +
tool?.Evalue(241)) * 10 + 100) / ((owner.IsPCFaction && owner.memberType ==
FactionMemberType.Default) ? 1 : 10);
589 if (owner.GetCurrency() - obj > 0)
591 owner.c_allowance += num;
592 owner.ModCurrency(-num);
600 if (playing !=
null && (
bool)playing.
bgm)
607 playing.source =
null;
608 SoundManager.jingleTimer = 1f;
610 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)