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";
133 idSong =
"tambourine";
136 idSong =
"mic_rachmaninoff";
139 idSong =
"cello_prelude";
141 case "instrument_violin":
143 idSong =
"violin_chaconne";
146 idSong =
"violin_furusato";
149 idSong =
"violin_chaconne";
171 EClass.player.playingSong =
playing;
183 List<Chara> reacted =
new List<Chara>();
187 cancelWhenMoved =
false,
188 showProgress =
false,
190 onProgressBegin = delegate
202 if (
playing.
mistakes == 0 && (
bool)playing.source && playing.source.isPlaying && playing.source.data.name == idSong)
205 if (Mathf.Abs(soundSource.source.time - (soundSource.data as BGMData).song.parts[
playing.
index].start) < 2f && playing.source.source.volume >= 0.1f)
207 soundSource.KeepPlay();
209 Debug.Log(
"keep:" + soundSource.source.time);
222 playing.bgm = playing.source.data as BGMData;
240 SoundManager.jingleTimer = part.duration / playing.bgm.pitch + playing.bgm.song.fadeIn + 2f;
249 if (
tool.
id ==
"tambourine")
274 if (
item.conSleep !=
null &&
item.ResistLv(957) <= 0)
276 item.conSleep.Kill();
283 foreach (
Chara item2
in list)
289 if (!reacted.Contains(item2) &&
EClass.
rnd(5) == 0)
300 item2.
Talk(
"musicBored");
304 if (
EClass.
rnd(num2 * num2) <= 30 && item2.pos.FirstChara == item2)
312 score -= item2.LV / 2 - 10;
316 item2.
Talk(
"musicBad");
320 item2.
Say(
"musicBad", item2,
owner);
339 item2.
Talk(
"musicGood");
343 item2.
Say(
"musicGood", item2,
owner);
363 onProgressComplete = delegate
372 playing.mistakes = 0;
382 yield
return Do(seq);
383 void LevelSong(
int a)
398 if (owner ==
null || !owner.IsPC)
404 score = score * 110 / 100;
408 score = score / 2 - 20;
410 int num = Mathf.Clamp(score / 20 + 1, 0, 9);
414 owner.Say(
"music_reward", owner, gold.ToString() ??
"");
418 owner.stamina.Mod(-1);
421 if (questMusic !=
null)
423 questMusic.score += score;
424 questMusic.sumMoney += gold;
425 int num2 = num / 2 - 1;
428 SE.Play(
"clap" + num2);
440 text = ((
EClass.
rnd(5) == 0) ?
"rock" :
"pebble");
443 text = ((
EClass.
rnd(3) == 0) ?
"water_dirty" :
"water");
467 text =
"casino_coin";
472 num = (
EClass.
rnd(c.
LV * 2 + 1) + 1) * (100 + toolLv * 2 + owner.Evalue(1405) * 10) / 100;
503 if (!owner.IsPCParty && !punish && text !=
"money")
513 ignoreDamage =
false;
518 if (!owner.IsPC && owner.things.IsFull())
524 if (thing.
id ==
"money" && !owner.IsPC)
526 int num2 = (owner.Evalue(241) * 10 + 100) / ((owner.IsPCFaction && owner.memberType ==
FactionMemberType.Default) ? 1 : 10);
527 if (owner.GetCurrency() - num2 > 0)
529 owner.c_allowance += num;
530 owner.ModCurrency(-num);
537 if (playing !=
null && (
bool)playing.
bgm)
544 playing.source =
null;
545 SoundManager.jingleTimer = 1f;
547 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)