Elin Modding Docs Doc
Loading...
Searching...
No Matches
ZonePreEnterEncounter.cs
1using System;
2using UnityEngine;
3
4// Token: 0x0200074E RID: 1870
6{
7 // Token: 0x0600363F RID: 13887 RVA: 0x00126860 File Offset: 0x00124A60
8 public override void Execute()
9 {
10 bool flag = EClass.pc.HasCondition<ConDrawMetal>();
11 int lv = Mathf.Max(EClass._zone.DangerLv, EClass.pc.FameLv * Math.Min(this.roadDist * 20, 100) / 100);
12 for (int i = 0; i < this.enemies; i++)
13 {
14 Point nearestPoint = (EClass.pc.pos.GetRandomPoint(4, true, true, false, 100) ?? EClass.pc.pos).GetNearestPoint(false, false, true, false);
15 Chara chara = EClass._zone.SpawnMob(nearestPoint, SpawnSetting.Encounter(lv));
16 chara.hostility = (chara.c_originalHostility = Hostility.Enemy);
17 chara.enemy = EClass.pc.party.members.RandomItem<Chara>();
18 }
19 if (flag && EClass.rnd(EClass.debug.enable ? 1 : 3) == 0)
20 {
21 Point nearestPoint2 = (EClass.pc.pos.GetRandomPoint(4, true, true, false, 100) ?? EClass.pc.pos).GetNearestPoint(false, false, true, false);
22 SpawnList list = SpawnListChara.Get("c_metal", (SourceChara.Row s) => s.race == "metal");
23 EClass._zone.AddCard(CharaGen.CreateFromFilter(list, EClass._zone.DangerLv, -1), nearestPoint2);
24 }
25 if ((EClass._zone.Tile.isRoad || EClass._zone.Tile.IsNeighborRoad) && EClass.rnd(2) == 0)
26 {
27 Point nearestPoint3 = (EClass.pc.pos.GetRandomPoint(4, true, true, false, 100) ?? EClass.pc.pos).GetNearestPoint(false, false, true, false);
28 EClass._zone.AddCard(CharaGen.Create("guard", -1), nearestPoint3);
29 }
30 }
31
32 // Token: 0x04001CA4 RID: 7332
33 public int enemies;
34
35 // Token: 0x04001CA5 RID: 7333
36 public int roadDist;
37}
Definition Chara.cs:12
Definition Point.cs:11