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