Elin Decompiled Documentation EA 23.102 Nightly
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Pages
InvOwnerCraft.cs
Go to the documentation of this file.
2{
4
5 public override bool CanTargetAlly
6 {
7 get
8 {
10 {
11 return crafter is TraitRuneMold;
12 }
13 return true;
14 }
15 }
16
17 public override bool ShowFuel => crafter.IsRequireFuel;
18
19 public override string langTransfer => crafter.CrafterTitle;
20
21 public override int numDragGrid => crafter.numIng;
22
23 public override bool DenyImportant => false;
24
25 public override bool AllowStockIngredients
26 {
27 get
28 {
30 {
31 return EClass._zone is Zone_Tent;
32 }
33 return true;
34 }
35 }
36
37 public InvOwnerCraft(Card owner = null, Card container = null, CurrencyType _currency = CurrencyType.None)
38 : base(owner, container, _currency)
39 {
40 }
41
42 public override bool ShouldShowGuide(Thing t)
43 {
44 return crafter.IsCraftIngredient(t, base.dragGrid.currentIndex);
45 }
46
47 public override void _OnProcess(Thing t)
48 {
49 t.PlaySoundDrop(spatial: false);
51 }
52
53 public override void OnAfterRefuel()
54 {
56 }
57
58 public void TryStartCraft()
59 {
60 for (int i = 0; i < numDragGrid; i++)
61 {
62 if (base.dragGrid.buttons[i].Card == null)
63 {
64 return;
65 }
66 }
67 if (!owner.trait.IsFuelEnough(1, base.dragGrid.GetTargets()))
68 {
69 Msg.Say("notEnoughFuel");
70 return;
71 }
73 {
75 layer = base.dragGrid
76 });
77 }
78}
CurrencyType
Definition: CurrencyType.cs:2
Definition: Card.cs:11
Trait trait
Definition: Card.cs:49
void PlaySoundDrop(bool spatial=true)
Definition: Card.cs:5389
AIAct SetAI(AIAct g)
Definition: Chara.cs:8045
Definition: EClass.cs:5
static Zone _zone
Definition: EClass.cs:20
static Chara pc
Definition: EClass.cs:14
override string langTransfer
override void _OnProcess(Thing t)
TraitCrafter crafter
Definition: InvOwnerCraft.cs:3
void TryStartCraft()
override int numDragGrid
override void OnAfterRefuel()
override bool ShouldShowGuide(Thing t)
override bool ShowFuel
override bool AllowStockIngredients
override bool CanTargetAlly
Definition: InvOwnerCraft.cs:6
override bool DenyImportant
InvOwnerCraft(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
virtual string CrafterTitle
Definition: TraitCrafter.cs:55
virtual int numIng
Definition: TraitCrafter.cs:33
virtual bool IsCraftIngredient(Card c, int idx)
Definition: TraitCrafter.cs:72
bool IsRequireFuel
Definition: Trait.cs:451
bool IsFuelEnough(int num=1, List< Thing > excludes=null, bool tryRefuel=true)
Definition: Trait.cs:1269
bool IsPCFaction
Definition: Zone.cs:464