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";
110 case "guitar_efrond":
111 idSong =
"guitar_dusk";
114 idSong =
"guitar_air";
117 idSong =
"harp_komori";
121 idSong =
"guitar_sad";
137 idSong =
"tambourine";
140 idSong =
"mic_rachmaninoff";
143 idSong =
"cello_prelude";
148 case "instrument_violin":
150 idSong =
"violin_chaconne";
153 idSong =
"violin_furusato";
156 idSong =
"violin_chaconne";
178 EClass.player.playingSong =
playing;
190 List<Chara> reacted =
new List<Chara>();
194 cancelWhenMoved =
false,
195 showProgress =
false,
197 onProgressBegin = delegate
209 if (
playing.
mistakes == 0 && (
bool)playing.source && playing.source.isPlaying && playing.source.data.name == idSong)
212 if (Mathf.Abs(soundSource.source.time - (soundSource.data as BGMData).song.parts[
playing.
index].start) < 2f && playing.source.source.volume >= 0.1f)
214 soundSource.KeepPlay();
216 Debug.Log(
"keep:" + soundSource.source.time);
229 playing.bgm = playing.source.data as BGMData;
247 SoundManager.jingleTimer = part.duration / playing.bgm.pitch + playing.bgm.song.fadeIn + 2f;
256 if (
tool.
id ==
"tambourine")
281 if (
item.conSleep !=
null &&
item.ResistLv(957) <= 0)
283 item.conSleep.Kill();
290 foreach (
Chara item2
in list)
296 if (!reacted.Contains(item2) &&
EClass.
rnd(5) == 0)
306 if (value.
source.categorySub ==
"eleAttack")
323 item2.
Talk(
"musicBored");
328 if (
EClass.
rnd(num2 * num2) <= 30 && item2.pos.FirstChara == item2)
331 p.cancelWhenDamaged =
false;
337 score -= item2.LV / 2 - 10;
341 item2.
Talk(
"musicBad");
345 item2.
Say(
"musicBad", item2,
owner);
364 item2.
Talk(
"musicGood");
368 item2.
Say(
"musicGood", item2,
owner);
379 p.cancelWhenDamaged =
true;
389 onProgressComplete = delegate
398 playing.mistakes = 0;
408 yield
return Do(progress);
409 if (progress.status ==
Status.Fail)
413 void LevelSong(
int a)
428 if (owner ==
null || !owner.IsPC)
434 score = score * 110 / 100;
438 score = score / 2 - 20;
440 int num = Mathf.Clamp(score / 20 + 1, 0, 9);
444 owner.Say(
"music_reward", owner, gold.ToString() ??
"");
448 owner.stamina.Mod(-1);
451 if (questMusic !=
null)
453 questMusic.score += score;
454 questMusic.sumMoney += gold;
455 int num2 = num / 2 - 1;
458 SE.Play(
"clap" + num2);
471 text = ((
EClass.
rnd(5) == 0) ?
"rock" :
"pebble");
474 text = ((
EClass.
rnd(3) == 0) ?
"water_dirty" :
"water");
498 text =
"casino_coin";
504 text =
"piano_killkill";
511 text =
"piano_gould";
520 num = (
EClass.
rnd(c.
LV * 2 + 1) + 1) * (100 + toolLv * 2 + owner.Evalue(1405) * 10) / 100;
551 if (!owner.IsPCParty && !punish && text !=
"money")
561 ignoreDamage =
false;
566 if (!owner.IsPC && owner.things.IsFull())
572 if (!owner.IsAliveInCurrentZone)
580 if (thing.
id ==
"money" && !owner.IsPC)
582 int? obj = ((owner.Evalue(241) +
tool?.Evalue(241)) * 10 + 100) / ((owner.IsPCFaction && owner.memberType ==
FactionMemberType.Default) ? 1 : 10);
583 if (owner.GetCurrency() - obj > 0)
585 owner.c_allowance += num;
586 owner.ModCurrency(-num);
594 if (playing !=
null && (
bool)playing.
bgm)
601 playing.source =
null;
602 SoundManager.jingleTimer = 1f;
604 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)