Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
ActWait.cs
Go to the documentation of this file.
1public class ActWait : Act
2{
3 public override bool CanPressRepeat => true;
4
6
7 public override bool Perform()
8 {
9 if (!Act.CC.IsPCParty)
10 {
11 return true;
12 }
13 if (Act.CC.IsPC)
14 {
15 Search(Act.CC, manual: true);
16 }
17 return true;
18 }
19
20 public static bool SearchMedal(Chara c, Point p)
21 {
22 if (c.isBlind)
23 {
24 return false;
25 }
26 if (p.detail == null || !c.CanSeeSimple(p))
27 {
28 return false;
29 }
30 foreach (Thing thing in p.detail.things)
31 {
32 if (thing.isHidden && thing.id == "medal" && !EClass._zone.IsUserZone)
33 {
34 thing.SetHidden(hide: false);
35 c.PlaySound("medal");
36 Msg.Say("spotMedal", c, thing);
37 return true;
38 }
39 }
40 return false;
41 }
42
43 public static void Search(Chara c, bool manual = false)
44 {
45 if (c.isBlind)
46 {
47 return;
48 }
49 int num = 2 + c.Evalue(402);
50 EClass._map.ForeachSphere(c.pos.x, c.pos.z, num, delegate(Point p)
51 {
52 if (p.detail == null || !c.CanSeeSimple(p))
53 {
54 return;
55 }
56 foreach (Thing thing in p.detail.things)
57 {
58 if (thing.isHidden)
59 {
60 int num2 = EClass.pc.Dist(p);
61 if (thing.id == "medal")
62 {
63 if (!manual || EClass._zone.IsUserZone)
64 {
65 continue;
66 }
67 if (num2 != 0)
68 {
69 Msg.Say("spotMedalNear");
70 continue;
71 }
72 }
73 else
74 {
75 if (EClass.rnd(c.Evalue(210) * 15 + 20 + c.PER) * ((!manual) ? 1 : 2) <= EClass.rnd(EClass._zone.DangerLv * 8 + 60))
76 {
77 continue;
78 }
79 c.ModExp(210, EClass._zone.DangerLv * 3 / 2 + 100);
80 }
81 bool flag = thing.trait is TraitTrap;
82 thing.SetHidden(hide: false);
83 if (thing.id == "medal")
84 {
85 c.PlaySound("medal");
86 Msg.Say("spotMedal", c, thing);
87 }
88 else
89 {
90 if (flag)
91 {
92 c.PlaySound("spot_trap");
93 if (EClass.core.config.game.haltOnSpotTrap)
94 {
95 EClass.player.haltMove = true;
96 }
97 }
98 else
99 {
100 c.PlaySound("spot");
101 }
102 Msg.Say("spotHidden", c, thing);
103 }
104 }
105 }
106 });
107 }
108}
static bool SearchMedal(Chara c, Point p)
Definition: ActWait.cs:20
override bool Perform()
Definition: ActWait.cs:7
override bool CanPressRepeat
Definition: ActWait.cs:3
override CursorInfo CursorIcon
Definition: ActWait.cs:5
static void Search(Chara c, bool manual=false)
Definition: ActWait.cs:43
Definition: ACT.cs:62
static Chara CC
Definition: ACT.cs:77
string id
Definition: Card.cs:31
void SetHidden(bool hide=true)
Definition: Card.cs:5111
Point pos
Definition: Card.cs:55
ThingContainer things
Definition: Card.cs:34
int Evalue(int ele)
Definition: Card.cs:2431
bool isHidden
Definition: Card.cs:502
List< Thing > things
Definition: CellDetail.cs:11
Definition: Chara.cs:10
override bool IsPC
Definition: Chara.cs:597
override bool IsPCParty
Definition: Chara.cs:600
bool isBlind
Definition: Chara.cs:125
bool CanSeeSimple(Point p)
Definition: Chara.cs:1010
static CursorInfo Wait
Definition: CursorSystem.cs:94
Definition: EClass.cs:5
static Zone _zone
Definition: EClass.cs:20
static Map _map
Definition: EClass.cs:18
void ForeachSphere(int _x, int _z, float r, Action< Point > action)
Definition: Map.cs:2358
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: Point.cs:9
CellDetail detail
Definition: Point.cs:71
int x
Definition: Point.cs:36
int z
Definition: Point.cs:39
Definition: Thing.cs:8
virtual bool IsUserZone
Definition: Zone.cs:264