Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
ActItem.cs
Go to the documentation of this file.
1using System;
2
3public class ActItem : Act
4{
5 public Act _act;
6
7 public override bool CanPerform()
8 {
9 return _act != null;
10 }
11
12 public int BuildAct(Chara c)
13 {
14 _act = null;
15 int p = 110 - 110 * c.hp / c.MaxHP;
16 if (c.hp < c.MaxHP * 2 / 3)
17 {
18 foreach (Thing thing in c.things)
19 {
20 if (thing.IsIdentified)
21 {
22 Action healAction = thing.trait.GetHealAction(c);
23 if (healAction != null)
24 {
25 return ReturnAct(healAction, p);
26 }
27 }
28 }
29 }
30 return 0;
31 }
32
33 public int ReturnAct(Action a, int p)
34 {
35 _act = new DynamicAct("ActItem", delegate
36 {
37 a();
38 return true;
39 });
40 return p;
41 }
42
43 public override bool Perform()
44 {
45 return _act.Perform(Act.CC);
46 }
47}
Act _act
Definition: ActItem.cs:5
int ReturnAct(Action a, int p)
Definition: ActItem.cs:33
int BuildAct(Chara c)
Definition: ActItem.cs:12
override bool CanPerform()
Definition: ActItem.cs:7
override bool Perform()
Definition: ActItem.cs:43
Definition: ACT.cs:62
virtual bool Perform()
Definition: ACT.cs:264
static Chara CC
Definition: ACT.cs:77
int hp
Definition: Card.cs:226
Trait trait
Definition: Card.cs:49
ThingContainer things
Definition: Card.cs:34
bool IsIdentified
Definition: Card.cs:2237
Definition: Chara.cs:10
override int MaxHP
Definition: Chara.cs:693
Definition: Thing.cs:8
virtual Action GetHealAction(Chara c)
Definition: Trait.cs:553