Elin Decompiled Documentation EA 23.200 Stable
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 thing.PlayAnime(AnimeID.Hop);
36 c.PlaySound("medal");
37 Msg.Say("spotMedal", c, thing);
38 return true;
39 }
40 }
41 return false;
42 }
43
44 public static void Search(Chara c, bool manual = false)
45 {
46 if (c.isBlind)
47 {
48 return;
49 }
50 int num = 2 + c.Evalue(402);
51 EClass._map.ForeachSphere(c.pos.x, c.pos.z, num, delegate(Point p)
52 {
53 if (p.detail == null || !c.CanSeeSimple(p))
54 {
55 return;
56 }
57 foreach (Thing thing in p.detail.things)
58 {
59 if (thing.isHidden)
60 {
61 int num2 = EClass.pc.Dist(p);
62 if (thing.id == "medal")
63 {
64 if (!manual || EClass._zone.IsUserZone)
65 {
66 continue;
67 }
68 if (num2 != 0)
69 {
70 Msg.Say("spotMedalNear");
71 continue;
72 }
73 }
74 else
75 {
76 if (EClass.rnd(c.Evalue(210) * 15 + 20 + c.PER) * ((!manual) ? 1 : 2) <= EClass.rnd(EClass._zone.DangerLv * 8 + 60))
77 {
78 continue;
79 }
80 c.ModExp(210, EClass._zone.DangerLv * 3 / 2 + 100);
81 }
82 bool flag = thing.trait is TraitTrap;
83 thing.SetHidden(hide: false);
84 if (thing.id == "medal")
85 {
86 thing.PlayAnime(AnimeID.Hop);
87 c.PlaySound("medal");
88 Msg.Say("spotMedal", c, thing);
89 }
90 else
91 {
92 if (flag)
93 {
94 c.PlaySound("spot_trap");
95 if (EClass.core.config.game.haltOnSpotTrap)
96 {
97 EClass.player.haltMove = true;
98 }
99 }
100 else
101 {
102 c.PlaySound("spot");
103 }
104 Msg.Say("spotHidden", c, thing);
105 }
106 }
107 }
108 });
109 }
110}
AnimeID
Definition: AnimeID.cs:2
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:44
Definition: ACT.cs:62
static Chara CC
Definition: ACT.cs:77
string id
Definition: Card.cs:33
Point pos
Definition: Card.cs:57
ThingContainer things
Definition: Card.cs:36
Card SetHidden(bool hide=true)
Definition: Card.cs:5621
int Evalue(int ele)
Definition: Card.cs:2533
bool isHidden
Definition: Card.cs:516
void PlayAnime(AnimeID id, bool force=false)
Definition: Card.cs:5958
List< Thing > things
Definition: CellDetail.cs:11
Definition: Chara.cs:10
override bool IsPC
Definition: Chara.cs:610
override bool IsPCParty
Definition: Chara.cs:613
bool isBlind
Definition: Chara.cs:130
bool CanSeeSimple(Point p)
Definition: Chara.cs:1183
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:2380
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:266