20 public bool CanRetreat
24 return this.rounds >= 100 && this.hornTimer <= 0;
30 public bool CanCallAlly
34 return this.allyCall == 0 && this.rounds >= 50;
40 public override string TextWidgetDate
44 return "defenseWave".lang(this.wave.ToString() ??
"",
this.kills.ToString() ??
"",
null,
null,
null) + ((this.instance !=
null && this.retreated) ?
"defenseRetreating" : (this.CanRetreat ?
"defenseRetreat" :
"")).lang() + (this.CanCallAlly ?
"defenseAlly" :
"").lang();
49 public virtual Chara CreateChara()
51 return CharaGen.CreateFromFilter(
"c_wilds", -1, -1);
55 public override void OnVisit()
61 EClass._zone._dangerLv = 5;
62 Point nearestPoint =
EClass._map.GetCenterPos().GetNearestPoint(
false,
false,
true,
false);
63 EClass._zone.AddCard(
ThingGen.Create(
"stone_defense", -1, -1), nearestPoint).Install().isNPCProperty =
true;
64 EClass._zone.AddCard(
ThingGen.Create(
"core_defense", -1, -1), nearestPoint).Install().isNPCProperty =
false;
65 EClass._zone.SetBGM(107,
true);
66 Msg.Say(
"defense_start");
71 public void NextWave()
75 EClass._zone._dangerLv += ((this.wave >= 20) ? 10 : 5);
77 Msg.Say(
"defense_wave", this.wave.ToString() ??
"",
EClass._zone.DangerLv.ToString() ??
"",
null,
null);
78 base.Spawn(2 + base.quest.difficulty);
83 public override void _OnTickRound()
85 QuestDefenseGame.lastWave = this.wave;
86 Debug.Log(
string.Concat(
new string[]
91 this.turns.ToString(),
93 this.rounds.ToString()
96 if (this.hornTimer > 0)
100 if (this.turns <= 3 + base.quest.difficulty)
104 if (this.turns == 10 && this.wave % 5 == 0)
108 if (this.turns == 20)
112 base.AggroEnemy(100);
113 if (this.allyTimer > 0)
116 if (this.allyTimer == 0)
124 public void Horn_Next()
126 Msg.Say(
"defense_start");
128 this.hornTimer += 10;
132 public void Horn_Retreat()
135 Msg.Say(
"defense_retreat");
136 this.retreated =
true;
142 public void Horn_Ally()
150 this.allyTimer += 100;
154 public override void OnCharaDie(
Chara c)
156 if (c.IsPCParty || c.IsPCPartyMinion)
173 public int hornTimer;
185 public int allyTimer;
189 public bool retreated;