Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
ActDrawWater.cs
Go to the documentation of this file.
1public class ActDrawWater : Act
2{
4
6
8
9 public override bool CanPerform()
10 {
11 if (HasWaterSource(Act.TP) && waterCan != null)
12 {
13 return waterCan.owner.c_charges < waterCan.MaxCharge;
14 }
15 return false;
16 }
17
18 public override bool Perform()
19 {
20 Act.CC.PlaySound("water_draw");
22 Act.CC.Say("water_draw", Act.CC, waterCan.owner);
23 return true;
24 }
25
26 public static bool HasWaterSource(Point p)
27 {
28 foreach (Thing thing in p.Things)
29 {
30 if ((thing.trait is TraitWell && thing.c_charges > 0) || thing.trait is TraitBath || thing.id == "387" || thing.id == "486" || thing.id == "876" || thing.id == "867" || thing.id == "1158")
31 {
32 return true;
33 }
34 }
35 return p.cell.IsTopWaterAndNoSnow;
36 }
37}
override bool Perform()
Definition: ActDrawWater.cs:18
static bool HasWaterSource(Point p)
Definition: ActDrawWater.cs:26
override bool CanPerform()
Definition: ActDrawWater.cs:9
override CursorInfo CursorIcon
Definition: ActDrawWater.cs:7
TraitToolWaterCan waterCan
Definition: ActDrawWater.cs:3
Definition: ACT.cs:62
static Point TP
Definition: ACT.cs:81
static Chara CC
Definition: ACT.cs:77
string id
Definition: Card.cs:31
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:5404
void SetCharge(int a)
Definition: Card.cs:3621
Trait trait
Definition: Card.cs:49
int c_charges
Definition: Card.cs:1205
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:6046
static CursorInfo Hand
Definition: CursorSystem.cs:60
Definition: Point.cs:9
static TargetTypeGround Ground
Definition: TargetType.cs:15
Definition: Thing.cs:8
Card owner
Definition: Trait.cs:26