Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
InvOwnerRefuel.cs
Go to the documentation of this file.
2{
3 public override ProcessType processType => ProcessType.Consume;
4
5 public override string langTransfer => "invRefuel";
6
7 public override bool DenyImportant => true;
8
9 public override bool AllowStockIngredients
10 {
11 get
12 {
14 {
15 return EClass._zone is Zone_Tent;
16 }
17 return true;
18 }
19 }
20
21 public InvOwnerRefuel(Card owner = null, Card container = null, CurrencyType _currency = CurrencyType.None)
22 : base(owner, container, _currency)
23 {
24 }
25
26 public override bool ShouldShowGuide(Thing t)
27 {
28 return owner.trait.IsFuel(t);
29 }
30
31 public override void _OnProcess(Thing t)
32 {
33 int fuelValue = owner.trait.GetFuelValue(t);
34 int num = (owner.trait.MaxFuel - owner.c_charges) / fuelValue;
35 if (num == 0)
36 {
37 SE.BeepSmall();
38 Msg.Say("fuelFull");
39 return;
40 }
41 if (t.Num < num)
42 {
43 num = t.Num;
44 }
45 Thing t2 = t.Split(num);
46 owner.trait.Refuel(t2);
47 }
48}
CurrencyType
Definition: CurrencyType.cs:2
Definition: Card.cs:11
Thing Split(int a)
Definition: Card.cs:3231
Trait trait
Definition: Card.cs:49
int Num
Definition: Card.cs:154
int c_charges
Definition: Card.cs:1205
Definition: EClass.cs:5
static Zone _zone
Definition: EClass.cs:20
override bool AllowStockIngredients
override bool ShouldShowGuide(Thing t)
override bool DenyImportant
override string langTransfer
override void _OnProcess(Thing t)
override ProcessType processType
InvOwnerRefuel(Card owner=null, Card container=null, CurrencyType _currency=CurrencyType.None)
Card owner
Definition: InvOwner.cs:538
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: Thing.cs:8
bool IsFuel(string s)
Definition: Trait.cs:1286
void Refuel(Thing t)
Definition: Trait.cs:1328
int GetFuelValue(Thing t)
Definition: Trait.cs:1296
bool IsPCFaction
Definition: Zone.cs:464