Elin Decompiled Documentation EA 23.182 Nightly
Loading...
Searching...
No Matches
ZoneEventDefenseGame Class Reference
Inheritance diagram for ZoneEventDefenseGame:
ZoneEventQuest ZoneEvent EClass

Public Member Functions

virtual Chara CreateChara ()
 
override void OnVisit ()
 
void NextWave (int add=0)
 
override void _OnTickRound ()
 
void Horn_Next ()
 
void Horn_Retreat ()
 
void Horn_Ally ()
 
override void OnCharaDie (Chara c)
 
- Public Member Functions inherited from ZoneEventQuest
void Spawn (int num=1)
 
void SpawnBoss (bool evolve=false)
 
void AggroEnemy (int chance=100)
 
sealed override void OnTickRound ()
 
virtual void _OnTickRound ()
 
virtual ZoneInstance.Status OnReachTimeLimit ()
 
- Public Member Functions inherited from ZoneEvent
virtual string GetText ()
 
void Tick (float delta)
 
void Init ()
 
void OnSimulateHour ()
 
virtual void OnVisit ()
 
virtual void OnInit ()
 
virtual void OnFirstTick ()
 
virtual void OnTick ()
 
virtual void OnTickRound ()
 
virtual void OnKill ()
 
virtual void OnCharaDie (Chara c)
 
virtual void OnLeaveZone ()
 
void OnLoad (Zone _zone)
 
void Kill ()
 

Public Attributes

int wave
 
int turns
 
int hornTimer
 
int kills
 
int allyCall
 
int allyTimer
 
int bonus
 
bool retreated
 
- Public Attributes inherited from ZoneEventQuest
int uidQuest
 
List< int > enemies = new List<int>()
 
- Public Attributes inherited from ZoneEvent
float time
 
int rounds
 
int hoursElapsed
 
int minElapsed
 
Zone zone
 
bool firstTick = true
 

Properties

ZoneInstanceRandomQuest instance [get]
 
bool CanRetreat [get]
 
bool CanCallAlly [get]
 
override string TextWidgetDate [get]
 
- Properties inherited from ZoneEventQuest
Quest quest [get]
 
virtual bool WarnBoss [get]
 
virtual bool CountEnemy [get]
 
virtual int TimeLimit [get]
 
- Properties inherited from ZoneEvent
SourceQuest.Row source [get]
 
virtual string id [get]
 
virtual string TextWidgetDate [get]
 
virtual float roundInterval [get]
 
virtual Playlist playlist [get]
 
virtual bool debugSkip [get]
 
virtual string RefStr2 [get]
 
virtual string RefStr3 [get]
 
virtual int hoursToKill [get]
 
virtual bool HasReport [get]
 
string Name [get]
 
- Properties inherited from EClass
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Faction Wilds [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 

Additional Inherited Members

- Static Public Member Functions inherited from EClass
static int rndSeed (int a, int seed)
 
static int rnd (long a)
 
static int rnd (int a)
 
static int curve (int a, int start, int step, int rate=75)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 
- Static Public Attributes inherited from EClass
static Core core
 

Detailed Description

Definition at line 4 of file ZoneEventDefenseGame.cs.

Member Function Documentation

◆ _OnTickRound()

override void ZoneEventDefenseGame._OnTickRound ( )
inlinevirtual

Reimplemented from ZoneEventQuest.

Definition at line 94 of file ZoneEventDefenseGame.cs.

95 {
96 QuestDefenseGame.lastWave = wave;
97 QuestDefenseGame.bonus = bonus;
98 Debug.Log("wave:" + wave + " turns:" + turns + " rounds:" + rounds);
99 turns++;
100 if (hornTimer > 0)
101 {
102 hornTimer--;
103 }
104 if (turns <= 3 + base.quest.difficulty)
105 {
106 Spawn();
107 }
108 if (turns == 10 && wave % 5 == 0)
109 {
110 Rand.SetSeed(wave + base.quest.uid);
111 SpawnBoss(((wave >= 10) ? (wave * 2) : 0) > EClass.rnd(100));
112 Rand.SetSeed();
113 }
114 if (turns == 20)
115 {
116 NextWave();
117 }
118 AggroEnemy();
119 if (allyTimer > 0)
120 {
121 allyTimer--;
122 if (allyTimer == 0)
123 {
124 allyCall--;
125 }
126 }
127 }
Definition: EClass.cs:5
static int rnd(long a)
Definition: EClass.cs:58
Definition: Rand.cs:4
static void SetSeed(int a=-1)
Definition: Rand.cs:37
void AggroEnemy(int chance=100)
void SpawnBoss(bool evolve=false)
void Spawn(int num=1)
int rounds
Definition: ZoneEvent.cs:9

References ZoneEventQuest.AggroEnemy(), allyCall, allyTimer, bonus, Debug, hornTimer, NextWave(), EClass.rnd(), ZoneEvent.rounds, Rand.SetSeed(), ZoneEventQuest.Spawn(), ZoneEventQuest.SpawnBoss(), turns, and wave.

◆ CreateChara()

virtual Chara ZoneEventDefenseGame.CreateChara ( )
inlinevirtual

Definition at line 58 of file ZoneEventDefenseGame.cs.

59 {
60 return CharaGen.CreateFromFilter("c_wilds");
61 }
static Chara CreateFromFilter(string id, int lv=-1, int levelRange=-1)
Definition: CharaGen.cs:22

References CharaGen.CreateFromFilter().

◆ Horn_Ally()

void ZoneEventDefenseGame.Horn_Ally ( )
inline

Definition at line 157 of file ZoneEventDefenseGame.cs.

158 {
159 SE.Play("warhorn");
160 Msg.Say("warhorn");
161 ActEffect.ProcAt(EffectId.Summon, 100, BlessedState.Normal, EClass.pc, EClass.pc, EClass.pc.pos, isNeg: false, new ActRef
162 {
163 n1 = "special_force"
164 });
165 allyCall++;
166 allyTimer += 100;
167 }
BlessedState
Definition: BlessedState.cs:2
EffectId
Definition: EffectId.cs:2
static void ProcAt(EffectId id, int power, BlessedState state, Card cc, Card tc, Point tp, bool isNeg, ActRef actRef=default(ActRef))
Definition: ActEffect.cs:411
Point pos
Definition: Card.cs:57
static Chara pc
Definition: EClass.cs:14
Definition: Msg.cs:5
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
Definition: ActRef.cs:2

References allyCall, allyTimer, EClass.pc, Card.pos, ActEffect.ProcAt(), and Msg.Say().

Referenced by TraitCoreDefense.TrySetAct().

◆ Horn_Next()

void ZoneEventDefenseGame.Horn_Next ( )
inline

Definition at line 129 of file ZoneEventDefenseGame.cs.

130 {
131 Msg.Say("defense_start");
132 int add = 0;
133 if (turns <= 3)
134 {
135 Msg.Say("defense_bonus", bonus.ToString() ?? "");
136 bonus++;
137 add = 1 + base.quest.difficulty;
138 }
139 NextWave(add);
140 hornTimer += 10;
141 if (hornTimer > 100)
142 {
143 hornTimer = 100;
144 }
145 }

References bonus, hornTimer, NextWave(), Msg.Say(), and turns.

Referenced by TraitCoreDefense.TrySetAct().

◆ Horn_Retreat()

void ZoneEventDefenseGame.Horn_Retreat ( )
inline

Definition at line 147 of file ZoneEventDefenseGame.cs.

148 {
149 SE.Play("warhorn");
150 Msg.Say("warhorn");
151 Msg.Say("defense_retreat");
152 retreated = true;
153 instance.status = ZoneInstance.Status.Success;
155 }
static void Proc(EffectId id, Card cc, Card tc=null, int power=100, ActRef actRef=default(ActRef))
Definition: ActEffect.cs:901

References EClass.pc, ActEffect.Proc(), retreated, and Msg.Say().

Referenced by TraitCoreDefense.TrySetAct().

◆ NextWave()

void ZoneEventDefenseGame.NextWave ( int  add = 0)
inline

Definition at line 82 of file ZoneEventDefenseGame.cs.

83 {
84 wave++;
85 turns = 0;
86 EClass._zone._dangerLv += ((EClass._zone.DangerLv >= 100) ? (EClass._zone.DangerLv / 100 * 5 + 5) : 5);
87 SE.Play("warhorn");
88 Msg.Say("warhorn");
89 Msg.Say("defense_wave", wave.ToString() ?? "", EClass._zone.DangerLv.ToString() ?? "");
90 Spawn(2 + base.quest.difficulty + add);
91 AggroEnemy();
92 }
static Zone _zone
Definition: EClass.cs:20
override int DangerLv
Definition: Zone.cs:107

References EClass._zone, ZoneEventQuest.AggroEnemy(), Zone.DangerLv, Msg.Say(), ZoneEventQuest.Spawn(), turns, and wave.

Referenced by _OnTickRound(), Horn_Next(), and OnVisit().

◆ OnCharaDie()

override void ZoneEventDefenseGame.OnCharaDie ( Chara  c)
inlinevirtual

Reimplemented from ZoneEvent.

Definition at line 169 of file ZoneEventDefenseGame.cs.

170 {
171 if (!c.IsPCParty && !c.IsPCPartyMinion)
172 {
173 kills++;
174 }
175 }
override bool IsPCParty
Definition: Chara.cs:613
override bool IsPCPartyMinion
Definition: Chara.cs:637

References Chara.IsPCParty, Chara.IsPCPartyMinion, and kills.

◆ OnVisit()

override void ZoneEventDefenseGame.OnVisit ( )
inlinevirtual

Reimplemented from ZoneEvent.

Definition at line 63 of file ZoneEventDefenseGame.cs.

64 {
66 {
67 QuestDefenseGame.lastWave = wave;
68 QuestDefenseGame.bonus = bonus;
69 return;
70 }
71 int num = (base.quest.FameContent ? (EClass.pc.FameLv / 100 * 50) : 0);
72 EClass._zone._dangerLv = 5 + num;
73 bonus += num / 10;
74 Point nearestPoint = EClass._map.GetCenterPos().GetNearestPoint(allowBlock: false, allowChara: false);
75 EClass._zone.AddCard(ThingGen.Create("stone_defense"), nearestPoint).Install().isNPCProperty = true;
76 EClass._zone.AddCard(ThingGen.Create("core_defense"), nearestPoint).Install().isNPCProperty = false;
77 EClass._zone.SetBGM(107);
78 Msg.Say("defense_start");
79 NextWave();
80 }
bool isNPCProperty
Definition: Card.cs:540
static Game game
Definition: EClass.cs:8
static Map _map
Definition: EClass.cs:18
bool isLoading
Definition: Game.cs:235
Point GetCenterPos()
Definition: MapBounds.cs:52
Definition: Point.cs:9
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false)
Definition: Point.cs:607
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53
void SetBGM(List< int > ids, bool refresh=true)
Definition: Zone.cs:2829
Card AddCard(Card t, Point point)
Definition: Zone.cs:1925

References EClass._map, EClass._zone, Zone.AddCard(), bonus, ThingGen.Create(), EClass.game, MapBounds.GetCenterPos(), Point.GetNearestPoint(), Game.isLoading, Card.isNPCProperty, NextWave(), Msg.Say(), Zone.SetBGM(), and wave.

Member Data Documentation

◆ allyCall

int ZoneEventDefenseGame.allyCall

Definition at line 19 of file ZoneEventDefenseGame.cs.

Referenced by _OnTickRound(), and Horn_Ally().

◆ allyTimer

int ZoneEventDefenseGame.allyTimer

Definition at line 22 of file ZoneEventDefenseGame.cs.

Referenced by _OnTickRound(), and Horn_Ally().

◆ bonus

int ZoneEventDefenseGame.bonus

Definition at line 25 of file ZoneEventDefenseGame.cs.

Referenced by _OnTickRound(), Horn_Next(), and OnVisit().

◆ hornTimer

int ZoneEventDefenseGame.hornTimer

Definition at line 13 of file ZoneEventDefenseGame.cs.

Referenced by _OnTickRound(), and Horn_Next().

◆ kills

int ZoneEventDefenseGame.kills

Definition at line 16 of file ZoneEventDefenseGame.cs.

Referenced by OnCharaDie().

◆ retreated

bool ZoneEventDefenseGame.retreated

Definition at line 28 of file ZoneEventDefenseGame.cs.

Referenced by Horn_Retreat(), and TraitCoreDefense.TrySetAct().

◆ turns

int ZoneEventDefenseGame.turns

Definition at line 10 of file ZoneEventDefenseGame.cs.

Referenced by _OnTickRound(), Horn_Next(), and NextWave().

◆ wave

int ZoneEventDefenseGame.wave

Definition at line 7 of file ZoneEventDefenseGame.cs.

Referenced by _OnTickRound(), NextWave(), OnVisit(), and TraitCoreDefense.TrySetAct().

Property Documentation

◆ CanCallAlly

bool ZoneEventDefenseGame.CanCallAlly
get

Definition at line 44 of file ZoneEventDefenseGame.cs.

45 {
46 get
47 {
48 if (allyCall == 0)
49 {
50 return rounds >= 50;
51 }
52 return false;
53 }
54 }

Referenced by TraitCoreDefense.TrySetAct().

◆ CanRetreat

bool ZoneEventDefenseGame.CanRetreat
get

Definition at line 32 of file ZoneEventDefenseGame.cs.

33 {
34 get
35 {
36 if (rounds >= 100)
37 {
38 return hornTimer <= 0;
39 }
40 return false;
41 }
42 }

Referenced by TraitCoreDefense.TrySetAct().

◆ instance

ZoneInstanceRandomQuest ZoneEventDefenseGame.instance
get

Definition at line 30 of file ZoneEventDefenseGame.cs.

◆ TextWidgetDate

override string ZoneEventDefenseGame.TextWidgetDate
get

Definition at line 56 of file ZoneEventDefenseGame.cs.


The documentation for this class was generated from the following file: