Elin Decompiled Documentation EA 23.240 Nightly
Loading...
Searching...
No Matches
ZoneEventRaid.cs
Go to the documentation of this file.
1using UnityEngine;
2
4{
5 public override void OnInit()
6 {
7 lv = Mathf.Max(1, EClass.game.survival.flags.raidLv);
8 max = 5 + lv / 4;
9 base.OnInit();
10 }
11
12 public override Point GetSpawnPos()
13 {
15 if (trait != null)
16 {
17 trait.Toggle(on: true, silent: true);
18 }
19 else
20 {
22 }
23 Point point = ((trait != null) ? trait.owner.pos : EClass.pc.pos);
24 return point.GetNearestPoint(allowBlock: false, allowChara: false) ?? point;
25 }
26
27 public override void OnKill()
28 {
29 base.OnKill();
31 EClass.game.survival.flags.raidLv += 5;
32 EClass.game.survival.flags.dateNextRaid = EClass.world.date.GetRaw(168);
35 string item = EClass.game.survival.listReward.RandomItem();
37 EClass.game.survival.MeteorThing(pos, item, install: true);
38 }
39}
Point pos
Definition: Card.cs:59
int GetRaw(int offsetHours=0)
Definition: Date.cs:326
Definition: EClass.cs:6
static Game game
Definition: EClass.cs:9
static World world
Definition: EClass.cs:41
static Map _map
Definition: EClass.cs:19
static Chara pc
Definition: EClass.cs:15
SurvivalManager survival
Definition: Game.cs:227
Thing FindThing(Func< Thing, bool > func)
Definition: Map.cs:2592
Definition: Point.cs:9
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false, int minRadius=0)
Definition: Point.cs:619
List< string > listReward
void MeteorThing(Point pos, string id, bool install=false)
Definition: Trait.cs:7
virtual void Toggle(bool on, bool silent=false)
Definition: Trait.cs:1155
Card owner
Definition: Trait.cs:27
GameDate date
Definition: World.cs:6
override Point GetSpawnPos()
override void OnKill()
override void OnInit()
Definition: ZoneEventRaid.cs:5