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

Public Member Functions

 InvOwnerGene (Card owner=null, Chara _tg=null)
 
override bool ShouldShowGuide (Thing t)
 
override void _OnProcess (Thing t)
 
override void OnWriteNote (Thing t, UINote n)
 
- 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)
 

Public Attributes

Chara tg
 
- 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 ProcessType processType [get]
 
override string langTransfer [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

- Public Types inherited from InvOwnerDraglet
enum  ProcessType { None , Consume }
 
- 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)
 
- 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 InvOwnerGene.cs.

Constructor & Destructor Documentation

◆ InvOwnerGene()

InvOwnerGene.InvOwnerGene ( Card  owner = null,
Chara  _tg = null 
)
inline

Definition at line 9 of file InvOwnerGene.cs.

10 : base(owner, null, CurrencyType.None)
11 {
12 tg = _tg;
13 count = 1;
14 }
CurrencyType
Definition: CurrencyType.cs:2
Card owner
Definition: InvOwner.cs:538

References InvOwnerDraglet.count, and tg.

Member Function Documentation

◆ _OnProcess()

override void InvOwnerGene._OnProcess ( Thing  t)
inlinevirtual

Reimplemented from InvOwnerDraglet.

Definition at line 25 of file InvOwnerGene.cs.

26 {
27 DNA.Type type = t.c_DNA.type;
28 if (type != 0 && tg.c_genes != null)
29 {
30 int num = t.c_DNA.slot;
31 if (num > 1 && tg.HasElement(1237))
32 {
33 num--;
34 }
35 if (tg.CurrentGeneSlot + num > tg.MaxGeneSlot)
36 {
37 SE.Beep();
38 Msg.Say("tooManyGene", tg);
39 return;
40 }
41 }
42 if (type == DNA.Type.Brain)
43 {
44 if (tg.c_genes != null)
45 {
46 foreach (DNA item in tg.c_genes.items)
47 {
48 if (item.type == DNA.Type.Brain)
49 {
50 SE.Beep();
51 Msg.Say("invalidGeneBrain", tg);
52 return;
53 }
54 }
55 }
56 }
57 else
58 {
59 Element invalidFeat = t.c_DNA.GetInvalidFeat(tg);
60 if (invalidFeat != null)
61 {
62 SE.Beep();
63 Msg.Say("invalidGeneFeat", tg, invalidFeat.Name.ToTitleCase());
64 return;
65 }
66 Element invalidAction = t.c_DNA.GetInvalidAction(tg);
67 if (invalidAction != null)
68 {
69 SE.Beep();
70 Msg.Say("invalidGeneAction", tg, invalidAction.Name.ToTitleCase());
71 return;
72 }
73 }
74 SE.Play("mutation");
75 tg.PlayEffect("identify");
76 Msg.Say("gene_modify", tg, t);
77 tg.AddCard(t);
78 ConSuspend condition = tg.GetCondition<ConSuspend>();
79 condition.gene = t;
80 condition.duration = t.c_DNA.GetDurationHour();
81 condition.dateFinish = EClass.world.date.GetRaw(condition.duration);
82 }
bool HasElement(int ele, int req=1)
Definition: Card.cs:5214
Card AddCard(Card c)
Definition: Card.cs:2887
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:5438
CharaGenes c_genes
Definition: Card.cs:1745
DNA c_DNA
Definition: Card.cs:1781
List< DNA > items
Definition: CharaGenes.cs:7
int MaxGeneSlot
Definition: Chara.cs:891
int CurrentGeneSlot
Definition: Chara.cs:894
int duration
Definition: ConSuspend.cs:9
Definition: DNA.cs:8
Type type
Definition: DNA.cs:29
Element GetInvalidFeat(Chara c)
Definition: DNA.cs:604
Type
Definition: DNA.cs:10
int slot
Definition: DNA.cs:77
int GetDurationHour()
Definition: DNA.cs:516
Element GetInvalidAction(Chara c)
Definition: DNA.cs:617
int GetRaw(int offsetHours=0)
Definition: Date.cs:322
Definition: EClass.cs:5
static World world
Definition: EClass.cs:40
virtual string Name
Definition: ELEMENT.cs:294
Definition: Msg.cs:5
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
GameDate date
Definition: World.cs:6

References Card.AddCard(), Card.c_DNA, Card.c_genes, Chara.CurrentGeneSlot, World.date, ConSuspend.duration, DNA.GetDurationHour(), DNA.GetInvalidAction(), DNA.GetInvalidFeat(), Date.GetRaw(), Card.HasElement(), item, CharaGenes.items, Chara.MaxGeneSlot, Element.Name, Card.PlayEffect(), Msg.Say(), DNA.slot, tg, DNA.type, and EClass.world.

◆ OnWriteNote()

override void InvOwnerGene.OnWriteNote ( Thing  t,
UINote  n 
)
inlinevirtual

Reimplemented from InvOwnerDraglet.

Definition at line 84 of file InvOwnerGene.cs.

85 {
86 if (ShouldShowGuide(t))
87 {
88 n.AddHeader("HeaderAdditionalTrait", "gene_hint");
89 _ = tg.c_genes;
90 int num = t.c_DNA.slot;
91 if (num > 1 && tg.HasElement(1237))
92 {
93 num--;
94 }
95 int num2 = tg.MaxGeneSlot - tg.CurrentGeneSlot;
96 int num3 = num2 - num;
97 int maxGeneSlot = tg.MaxGeneSlot;
98 n.AddText("gene_hint_slot".lang(num2.ToString() ?? "", num3.ToString() ?? "", maxGeneSlot.ToString() ?? ""), (num3 >= 0) ? FontColor.Good : FontColor.Bad);
99 int cost = t.c_DNA.cost;
100 int num4 = tg.feat - cost;
101 n.AddText("gene_hint_cost".lang(tg.feat.ToString() ?? "", cost + ((cost == t.c_DNA.cost) ? "" : ("(" + t.c_DNA.cost + ")")), num4.ToString() ?? ""), (num4 >= 0) ? FontColor.Good : FontColor.Bad);
102 }
103 }
FontColor
Definition: FontColor.cs:2
int feat
Definition: Card.cs:358
int cost
Definition: DNA.cs:41
override bool ShouldShowGuide(Thing t)
Definition: InvOwnerGene.cs:16
UIItem AddHeader(string text, Sprite sprite=null)
Definition: UINote.cs:79
UIItem AddText(string text, FontColor color=FontColor.DontChange)
Definition: UINote.cs:113

References UINote.AddHeader(), UINote.AddText(), Card.c_DNA, Card.c_genes, DNA.cost, Chara.CurrentGeneSlot, Card.feat, Card.HasElement(), Chara.MaxGeneSlot, ShouldShowGuide(), DNA.slot, and tg.

◆ ShouldShowGuide()

override bool InvOwnerGene.ShouldShowGuide ( Thing  t)
inlinevirtual

Reimplemented from InvOwner.

Definition at line 16 of file InvOwnerGene.cs.

17 {
18 if (t.c_DNA != null)
19 {
20 return tg.feat >= t.c_DNA.cost;
21 }
22 return false;
23 }

References Card.c_DNA, and DNA.cost.

Referenced by OnWriteNote().

Member Data Documentation

◆ tg

Chara InvOwnerGene.tg

Definition at line 3 of file InvOwnerGene.cs.

Referenced by _OnProcess(), InvOwnerGene(), and OnWriteNote().

Property Documentation

◆ langTransfer

override string InvOwnerGene.langTransfer
get

Definition at line 7 of file InvOwnerGene.cs.

◆ processType

override ProcessType InvOwnerGene.processType
get

Definition at line 5 of file InvOwnerGene.cs.


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