Elin Decompiled Documentation EA 23.102 Nightly
Loading...
Searching...
No Matches
InvOwnerDeliver Class Reference
Inheritance diagram for InvOwnerDeliver:
InvOwnerDraglet InvOwner EClass

Public Types

enum  Mode { Default , Tax , Bank , Crop }
 
- Public Types inherited from InvOwnerDraglet
enum  ProcessType { None , Consume }
 

Public Member Functions

 InvOwnerDeliver (Card owner=null, Card container=null, CurrencyType _currency=CurrencyType.Money)
 
override bool ShouldShowGuide (Thing t)
 
override void _OnProcess (Thing t)
 
- Public Member Functions inherited from InvOwnerDraglet
override bool AllowHold (Thing t)
 
 InvOwnerDraglet (Card owner=null, Card container=null, CurrencyType _currency=CurrencyType.Money)
 
override void OnInit ()
 
override void OnClick (ButtonGrid button)
 
override void OnRightClick (ButtonGrid button)
 
override int GetPrice (Thing t, CurrencyType currency, int num, bool sell)
 
override string GetTextDetail (Thing t, CurrencyType currency, int num, bool sell)
 
virtual void OnWriteNote (Thing t, UINote n)
 
sealed override void OnProcess (Thing t)
 
virtual void _OnProcess (Thing t)
 
virtual void OnAfterRefuel ()
 
void RedrawButton ()
 
override void BuildUICurrency (UICurrency uiCurrency, bool canReroll=false)
 
- Public Member Functions inherited from InvOwner
virtual bool AllowHold (Thing t)
 
virtual bool AllowMoved (Thing t)
 
virtual bool ShouldShowGuide (Thing t)
 
virtual bool AllowDrop (Thing t)
 
virtual Thing CreateDefaultContainer ()
 
virtual void BuildUICurrency (UICurrency uiCurrency, bool canReroll=false)
 
bool IsWeightOver (Thing t)
 
 InvOwner (Card owner, Card container=null, CurrencyType _currency=CurrencyType.None, PriceType _price=PriceType.Default)
 
void Init ()
 
virtual void OnInit ()
 
virtual void OnClick (ButtonGrid button)
 
virtual void OnRightClick (ButtonGrid button)
 
virtual void OnRightPressed (ButtonGrid button)
 
InvOwner GetShitDestOwner (ButtonGrid b, bool rightMouse=false)
 
virtual void OnShiftClick (ButtonGrid b, bool rightMouse=false)
 
virtual bool CanShiftClick (ButtonGrid b, bool rightMouse=false)
 
virtual string GetTextShiftClick (ButtonGrid b)
 
virtual void OnCtrlClick (ButtonGrid button)
 
virtual bool CanCtrlClick (ButtonGrid b)
 
virtual string GetTextCtrlClick (ButtonGrid b)
 
virtual void OnAltClick (ButtonGrid button)
 
virtual bool CanAltClick (ButtonGrid b)
 
virtual string GetTextAltClick (ButtonGrid b)
 
void Grab (DragItemCard.DragInfo from)
 
Thing PutBack (DragItemCard.DragInfo from)
 
void OnStartDrag (DragItemCard.DragInfo from)
 
virtual bool OnCancelDrag (DragItemCard.DragInfo from)
 
virtual bool OnDrag (DragItemCard.DragInfo from, DragItemCard.DragInfo to, bool execute, bool cancel=false)
 
virtual void OnProcess (Thing t)
 
bool CanOpenContainer (Thing t)
 
ListInteraction ListInteractions (ButtonGrid b, bool context)
 
bool TryHold (Thing t)
 
virtual void ListInteractions (ListInteraction list, Thing t, Trait trait, ButtonGrid b, bool context)
 
virtual string GetAutoUseLang (ButtonGrid button)
 
void AutoUse (ButtonGrid button, bool repeat=false)
 
void ShowContextMenu (ButtonGrid button)
 
virtual int GetPrice (Thing t, CurrencyType currency, int num, bool sell)
 
virtual string GetTextDetail (Thing t, CurrencyType currency, int num, bool sell)
 
virtual void OnWriteNote (ButtonGrid button, UINote n)
 
virtual string IDCostIcon (Thing t)
 
virtual bool IsFailByCurse (Thing t)
 

Static Public Member Functions

static void PayBill (Thing t, bool fromBank=false)
 
- Static Public Member Functions inherited from EClass
static int rnd (int a)
 
static int curve (int a, int start, int step, int rate=75)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 

Public Attributes

Mode mode
 
- Public Attributes inherited from InvOwnerDraglet
int count = -1
 
BlessedState state
 
int price
 
- Public Attributes inherited from InvOwner
bool includeChildren
 
CurrencyType currency
 
PriceType priceType
 
HomeResource homeResource
 
Card owner
 
Card Container
 
List< ButtonGridbuttons = new List<ButtonGrid>()
 

Properties

override bool SingleTarget [get]
 
override string langTransfer [get]
 
override ProcessType processType [get]
 
- Properties inherited from InvOwnerDraglet
virtual ProcessType processType [get]
 
virtual bool ShowFuel [get]
 
virtual bool CanTargetAlly [get]
 
virtual string langWhat [get]
 
virtual bool AllowStockIngredients [get]
 
override bool AllowTransfer [get]
 
override bool AllowAutouse [get]
 
override bool AllowContext [get]
 
override bool UseGuide [get]
 
override bool CopyOnTransfer [get]
 
override bool InvertSell [get]
 
override bool DenyImportant [get]
 
LayerDragGrid dragGrid [get]
 
- Properties inherited from InvOwner
static bool HasTrader [get]
 
static bool FreeTransfer [get]
 
virtual bool AllowAutouse [get]
 
virtual bool AllowContext [get]
 
virtual bool AllowSell [get]
 
virtual bool AlwaysShowTooltip [get]
 
virtual bool UseGuide [get]
 
virtual bool AllowTransfer [get]
 
virtual bool AllowDropOnDrag [get]
 
virtual string langTransfer [get]
 
virtual int destInvY [get]
 
virtual bool HasTransaction [get]
 
virtual bool CopyOnTransfer [get]
 
virtual bool SingleTarget [get]
 
bool UseHomeResource [get]
 
bool IsMagicChest [get]
 
List< ThingThings [get]
 
Chara Chara [get]
 
ContainerType ContainerType [get]
 
virtual bool InvertSell [get]
 
virtual int numDragGrid [get]
 
virtual bool ShowNew [get]
 
virtual bool DenyImportant [get]
 
InvOwner destInvOwner [get]
 
string IDCurrency [get]
 
- Properties inherited from EClass
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Faction Wilds [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 

Additional Inherited Members

- Static Public Attributes inherited from InvOwner
static ForceGiveData forceGive = new ForceGiveData()
 
static InvOwner Trader
 
static InvOwner Main
 
static float clickTimer
 
- Static Public Attributes inherited from EClass
static Core core
 

Detailed Description

Definition at line 1 of file InvOwnerDeliver.cs.

Member Enumeration Documentation

◆ Mode

Enumerator
Default 
Tax 
Bank 
Crop 

Definition at line 3 of file InvOwnerDeliver.cs.

Constructor & Destructor Documentation

◆ InvOwnerDeliver()

InvOwnerDeliver.InvOwnerDeliver ( Card  owner = null,
Card  container = null,
CurrencyType  _currency = CurrencyType::Money 
)
inline

Definition at line 29 of file InvOwnerDeliver.cs.

30 : base(owner, container, _currency)
31 {
32 }
Card owner
Definition: InvOwner.cs:538

Member Function Documentation

◆ _OnProcess()

override void InvOwnerDeliver._OnProcess ( Thing  t)
inlinevirtual

Reimplemented from InvOwnerDraglet.

Definition at line 109 of file InvOwnerDeliver.cs.

110 {
111 switch (mode)
112 {
113 case Mode.Tax:
114 PayBill(t);
115 break;
116 case Mode.Bank:
117 SE.Pay();
118 Msg.Say("depositMoney", t, owner);
119 owner.AddThing(t);
120 break;
121 case Mode.Crop:
122 {
123 Msg.Say("farm_chest", t, Lang._weight(t.SelfWeight * t.Num));
124 QuestHarvest questHarvest = EClass.game.quests.Get<QuestHarvest>();
125 if (questHarvest != null)
126 {
127 questHarvest.weightDelivered += t.SelfWeight * t.Num;
128 }
129 SE.Pick();
130 t.Destroy();
131 break;
132 }
133 }
134 }
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:2901
void Destroy()
Definition: Card.cs:4538
int Num
Definition: Card.cs:154
Definition: EClass.cs:5
static Game game
Definition: EClass.cs:8
QuestManager quests
Definition: Game.cs:179
static void PayBill(Thing t, bool fromBank=false)
Definition: Lang.cs:6
static string _weight(int a, int b, bool showUnit=true, int unitSize=0)
Definition: Lang.cs:172
Definition: Msg.cs:5
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
Quest Get(string id)
override int SelfWeight
Definition: Thing.cs:62

References Lang._weight(), Card.AddThing(), Card.Destroy(), EClass.game, QuestManager.Get(), mode, Card.Num, InvOwner.owner, PayBill(), Game.quests, Msg.Say(), and Thing.SelfWeight.

◆ PayBill()

static void InvOwnerDeliver.PayBill ( Thing  t,
bool  fromBank = false 
)
inlinestatic

Definition at line 53 of file InvOwnerDeliver.cs.

54 {
55 bool flag = t.id == "bill_tax";
56 bool flag2 = t.id == "bill_debt";
57 QuestDebt questDebt = EClass.game.quests.Get<QuestDebt>();
58 bool flag3 = flag2 && questDebt != null && !questDebt.paid && questDebt.IsValidBill(t);
59 if ((flag && EClass.player.taxBills <= 0) || (flag2 && !flag3))
60 {
61 SE.Beep();
62 Msg.Say("badidea");
63 EClass.pc.Pick(t, msg: false);
64 return;
65 }
66 if (fromBank)
67 {
69 }
70 else if (!EClass.pc.TryPay(t.c_bill))
71 {
72 return;
73 }
74 if (flag2)
75 {
76 EClass.player.debt -= t.c_bill;
77 if (EClass.player.debt < 0)
78 {
79 EClass.player.debt = 0;
80 }
81 questDebt.paid = true;
82 questDebt.UpdateJournal();
83 }
84 else if (flag)
85 {
86 EClass.player.stats.taxBillsPaid += t.c_bill;
88 if (EClass.player.taxBills < 0)
89 {
90 EClass.player.taxBills = 0;
91 }
92 int num = t.GetInt(35) / 1000;
93 if (num > 0)
94 {
95 Thing thing = ThingGen.Create("money2", "copper").SetNum(num);
96 Thing p = ThingGen.CreateParcel("parcel_mysiliaGift", thing);
97 Msg.Say("getSalary", thing);
99 }
100 }
101 else
102 {
103 EClass.player.unpaidBill -= t.c_bill;
104 }
105 Msg.Say("payBill", t);
106 t.Destroy();
107 }
int GetInt(int id, int? defaultInt=null)
Definition: BaseCard.cs:25
Thing container_deposit
Definition: CardManager.cs:58
Thing SetNum(int a)
Definition: Card.cs:3242
void ModCurrency(int a, string id="money")
Definition: Card.cs:3638
bool TryPay(int a, string id="money")
Definition: Card.cs:3602
int c_bill
Definition: Card.cs:1217
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
Definition: Chara.cs:3920
static World world
Definition: EClass.cs:40
static Player player
Definition: EClass.cs:12
static Chara pc
Definition: EClass.cs:14
CardManager cards
Definition: Game.cs:155
int debt
Definition: Player.cs:754
int taxBills
Definition: Player.cs:715
bool IsValidBill(Thing t)
Definition: QuestDebt.cs:52
void UpdateJournal()
Definition: Quest.cs:685
static Thing CreateParcel(string idLang=null, params Thing[] things)
Definition: ThingGen.cs:42
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53
Definition: Thing.cs:8
void SendPackage(Thing p)
Definition: World.cs:68

References Card.c_bill, Game.cards, CardManager.container_deposit, ThingGen.Create(), ThingGen.CreateParcel(), Player.debt, Card.Destroy(), EClass.game, QuestManager.Get(), BaseCard.GetInt(), QuestDebt.IsValidBill(), Card.ModCurrency(), EClass.pc, Chara.Pick(), EClass.player, Game.quests, Msg.Say(), World.SendPackage(), Card.SetNum(), Player.taxBills, Card.TryPay(), Quest.UpdateJournal(), and EClass.world.

Referenced by _OnProcess(), and Faction.TryPayBill().

◆ ShouldShowGuide()

override bool InvOwnerDeliver.ShouldShowGuide ( Thing  t)
inlinevirtual

Reimplemented from InvOwner.

Definition at line 34 of file InvOwnerDeliver.cs.

35 {
36 switch (mode)
37 {
38 case Mode.Tax:
39 return t.c_bill != 0;
40 case Mode.Bank:
41 return t.id == "money";
42 case Mode.Crop:
43 if (!(t.category.id == "vegi") && !(t.category.id == "fruit"))
44 {
45 return t.category.id == "mushroom";
46 }
47 return true;
48 default:
49 return false;
50 }
51 }
SourceCategory.Row category
Definition: Card.cs:1925

References Card.category, and mode.

Member Data Documentation

◆ mode

Mode InvOwnerDeliver.mode

Definition at line 11 of file InvOwnerDeliver.cs.

Referenced by _OnProcess(), and ShouldShowGuide().

Property Documentation

◆ langTransfer

override string InvOwnerDeliver.langTransfer
get

Definition at line 15 of file InvOwnerDeliver.cs.

16 {
17 get
18 {
19 if (mode != Mode.Bank)
20 {
21 return "invDeliver";
22 }
23 return "invBank";
24 }
25 }

◆ processType

override ProcessType InvOwnerDeliver.processType
get

Definition at line 27 of file InvOwnerDeliver.cs.

◆ SingleTarget

override bool InvOwnerDeliver.SingleTarget
get

Definition at line 13 of file InvOwnerDeliver.cs.


The documentation for this class was generated from the following file: