Elin Decompiled Documentation EA 23.153 Nightly
Loading...
Searching...
No Matches
Thing Class Reference
Inheritance diagram for Thing:
Card BaseCard IReservable ICardParent IRenderSource IGlobalValue IInspect EClass

Public Member Functions

bool CanAutoFire (Chara c, Card tg, bool reloading=false)
 
int GetEfficiency ()
 
override void SetSource ()
 
override void OnCreate (int genLv)
 
override void ApplyMaterialElements (bool remove)
 
override void ApplyMaterial (bool remove=false)
 
override string GetName (NameStyle style, int _num=-1)
 
override string GetHoverText ()
 
override string GetExtraName ()
 
List< ElementListLimitedValidTraits (bool limit)
 
List< ElementListValidTraits (bool isCraft, bool limit)
 
override void WriteNote (UINote n, Action< UINote > onWriteNote=null, IInspect.NoteMode mode=IInspect.NoteMode.Default, Recipe recipe=null)
 
override void SetRenderParam (RenderParam p)
 
override SubPassData GetSubPassData ()
 
override bool CanStackTo (Thing to)
 
void GetIngredients (Recipe.Ingredient ing, List< Thing > list)
 
bool IsValidIngredient (Recipe.Ingredient ing)
 
void GetRecipes (HashSet< Recipe > recipes)
 
void GetDisassembles (List< Thing > list)
 
void Disassemble ()
 
void ShowSplitMenu (ButtonGrid button, InvOwner.Transaction trans=null)
 
void ShowSplitMenu2 (ButtonGrid button, string lang, Action< int > onSplit=null)
 
void DoAct (Act act)
 
void TryLickEnchant (Chara c, bool msg=true, Chara tg=null, BodySlot slot=null)
 
Element AddEnchant (int lv=-1)
 
void RemoveEnchant ()
 
Thing Identify (bool show=true, IDTSource idtSource=IDTSource.Identify)
 
override bool MatchEncSearch (string s)
 
- Public Member Functions inherited from Card
override string ToString ()
 
bool CanReserve (AIAct act)
 
bool TryReserve (AIAct act)
 
void Mod ()
 
Window.SaveData GetWindowSaveData ()
 
bool IsExcludeFromCraft ()
 
void SetDirtyWeight ()
 
void ChangeWeight (int a)
 
int Evalue (int ele)
 
int Evalue (int ele, bool ignoreGlobalElement)
 
int EvalueMax (int ele, int min=0)
 
int Evalue (string alias)
 
bool HasTag (CTAG tag)
 
bool HasEditorTag (EditorTag tag)
 
void AddEditorTag (EditorTag tag)
 
void RemoveEditorTag (EditorTag tag)
 
virtual string GetName (NameStyle style, int num=-1)
 
virtual string GetExtraName ()
 
virtual string GetDetail ()
 
int GetBestAttribute ()
 
void ModExp (string alias, int a)
 
void ModExp (int ele, int a)
 
bool IsChildOf (Card c)
 
FindTool< T > ()
 
string ReferenceId ()
 
void Create (string _id, int _idMat=-1, int genLv=-1)
 
virtual void OnBeforeCreate ()
 
virtual void OnCreate (int genLv)
 
virtual void SetSource ()
 
virtual void ApplyEditorTags (EditorTag tag)
 
void ApplyTrait ()
 
Card SetLv (int a)
 
void ClampInitialSkill ()
 
void AddExp (int a)
 
int GetExpMtp ()
 
int GetAffinityExpBonus ()
 
int GetDaysTogetherBonus ()
 
void LevelUp ()
 
virtual void ApplyMaterialElements (bool remove)
 
virtual void ApplyMaterial (bool remove=false)
 
Card ChangeMaterial (int idNew, bool ignoreFixedMaterial=false)
 
Card ChangeMaterial (string idNew, bool ignoreFixedMaterial=false)
 
Card ChangeMaterial (SourceMaterial.Row row, bool ignoreFixedMaterial=false)
 
void SetReplica (bool on)
 
Thing Add (string id, int num=1, int lv=1)
 
Card AddCard (Card c)
 
void RemoveCard (Card c)
 
void NotifyAddThing (Thing t, int num)
 
Thing AddThing (string id, int lv=-1)
 
Thing AddThing (Thing t, bool tryStack=true, int destInvX=-1, int destInvY=-1)
 
void PurgeDuplicateArtifact (Thing af)
 
void RemoveThings ()
 
void RemoveThing (Thing thing)
 
bool ShouldTrySetDirtyInventory ()
 
virtual bool CanStackTo (Thing to)
 
bool TryStackTo (Thing to)
 
ICardParent GetRoot ()
 
Card GetRootCard ()
 
bool IsStackable (Thing tg)
 
Thing Duplicate (int num)
 
Thing Split (int a)
 
Thing SetNum (int a)
 
Thing SetNoSell ()
 
void ModNum (int a, bool notify=true)
 
void AddSocket ()
 
void ApplySocket (Thing t)
 
void ApplySocket (int id, int lv, Card mod=null)
 
void EjectSockets ()
 
SocketData AddRune (Card rune)
 
SocketData AddRune (int idEle, int v)
 
SocketData GetRuneEnc (int idEle)
 
int CountRune ()
 
int MaxRune ()
 
bool CanAddRune (SourceElement.Row row)
 
bool HasRune ()
 
void OnChildNumChange (Card c)
 
Card Install ()
 
void SetPlaceState (PlaceState newState, bool byPlayer=false)
 
int GetTotalQuality (bool applyBonus=true)
 
void ModEncLv (int a)
 
void SetEncLv (int a)
 
void SetTier (int a, bool setTraits=true)
 
virtual void SetBlessedState (BlessedState s)
 
virtual void ChangeRarity (Rarity q)
 
bool TryPay (int a, string id="money")
 
void SetCharge (int a)
 
void ModCharge (int a, bool destroy=false)
 
void ModCurrency (int a, string id="money")
 
int GetCurrency (string id="money")
 
virtual void HealHPHost (int a, HealSource origin=HealSource.None)
 
virtual void HealHP (int a, HealSource origin=HealSource.None)
 
virtual int GetArmorSkill ()
 
virtual int ApplyProtection (int dmg, int mod=100)
 
void DamageHP (int dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
 
void DamageHP (int dmg, int ele, int eleP=100, AttackSource attackSource=AttackSource.None, Card origin=null, bool showEffect=true, Thing weapon=null)
 
virtual void Die (Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None)
 
void Explode (Point p, Card origin)
 
void Deconstruct ()
 
void Destroy ()
 
void SpawnLoot (Card origin)
 
Thing TryMakeRandomItem (int lv=-1)
 
Card MakeFoodFrom (string _id)
 
Card MakeFoodFrom (Card c)
 
void MakeFoodRef (Card c1, Card c2=null)
 
string TryGetFoodName (Card c)
 
string GetFoodName (string s)
 
void MakeFigureFrom (string id)
 
void MakeRefFrom (string id)
 
void MakeRefFrom (Card c1, Card c2=null)
 
Thing MakeEgg (bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
 
Thing MakeMilk (bool effect=true, int num=1, bool addToZone=true, BlessedState? state=null)
 
Thing GiveBirth (Thing t, bool effect)
 
Card SetHidden (bool hide=true)
 
virtual MoveResult _Move (Point p, MoveType type=MoveType.Walk)
 
void MoveImmediate (Point p, bool focus=true, bool cancelAI=true)
 
void Teleport (Point point, bool silent=false, bool force=false)
 
virtual void OnLand ()
 
int ResistLvFrom (int ele)
 
int ResistLv (int res)
 
bool HasElement (int ele, int req=1)
 
bool HasElement (string id, int req=1)
 
bool HasGlobalElement (int ele)
 
bool HasElementNoCopy ()
 
virtual CardRenderer _CreateRenderer ()
 
void AddBlood (int a=1, int id=-1)
 
RenderParam GetRenderParam ()
 
virtual void SetRenderParam (RenderParam p)
 
void DyeRandom ()
 
void Dye (string idMat)
 
void Dye (SourceMaterial.Row mat)
 
void RefreshColor ()
 
ref Color GetRandomColor ()
 
virtual Sprite GetSprite (int dir=0)
 
virtual Sprite GetImageSprite ()
 
void SetImage (Image image, int dir, int idSkin=0)
 
virtual void SetImage (Image image)
 
void ShowEmo (Emo _emo=Emo.none, float duration=0f, bool skipSame=true)
 
void PlaySoundHold (bool spatial=true)
 
void PlaySoundDrop (bool spatial=true)
 
void PlaySoundImpact (bool spatial=true)
 
void PlaySoundDead (bool spatial=true)
 
SoundSource PlaySound (string id, float v=1f, bool spatial=true)
 
void KillAnime ()
 
void PlayAnime (AnimeID id, bool force=false)
 
void PlayAnime (AnimeID id, Point dest, bool force=false)
 
void PlayAnimeLoot ()
 
Effect PlayEffect (string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
 
void PlayEffect (int ele, bool useRenderPos=true, float range=0f)
 
virtual void SetDir (int d)
 
void SetRandomDir ()
 
virtual void LookAt (Card c)
 
virtual void LookAt (Point p)
 
virtual void Rotate (bool reverse=false)
 
void ChangeAltitude (int a)
 
virtual SubPassData GetSubPassData ()
 
void SetFreePos (Point point)
 
void RenderMarker (Point point, bool active, HitResult result, bool main, int dir, bool useCurrentPosition=false)
 
void RecalculateFOV ()
 
bool HasLight ()
 
float GetLightPower ()
 
int GetSightRadius ()
 
int GetLightRadius ()
 
void CalculateFOV ()
 
void SetRandomLightColors ()
 
Fov CreateFov ()
 
void ClearFOV ()
 
virtual void OnSimulateHour (VirtualDate date)
 
void DecayNatural (int hour=1)
 
void CheckJustCooked ()
 
void Decay (int a=10)
 
bool HasTalk (string idTopic)
 
void Talk (string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
 
void TalkRaw (string text, string ref1=null, string ref2=null, bool forceSync=false)
 
string ApplyNewLine (string text)
 
void SayRaw (string text, string ref1=null, string ref2=null)
 
void SayNothingHappans ()
 
void Say (string lang, string ref1=null, string ref2=null)
 
void Say (string lang, Card c1, Card c2, string ref1=null, string ref2=null)
 
void Say (string lang, Card c1, string ref1=null, string ref2=null)
 
string GetTalkText (string idTopic, bool stripPun=false, bool useDefault=true)
 
string ApplyTone (string text, bool stripPun=false)
 
void SetRandomTalk ()
 
void SetRandomTone ()
 
bool HasCraftBonusTrait ()
 
List< ElementListCraftBonusTraits ()
 
void TryStack (Thing t)
 
void ApplyBacker (int bid)
 
void RemoveBacker ()
 
void SetPaintData ()
 
byte[] GetPaintData ()
 
void ClearPaintSprite ()
 
Sprite GetPaintSprite ()
 
void TryUnrestrain (bool force=false, Chara c=null)
 
TraitShackle GetRestrainer ()
 
virtual void Tick ()
 
Thing SetPriceFix (int a)
 
int GetEquipValue ()
 
void SetSale (bool sale)
 
int GetValue (PriceType priceType=PriceType.Default, bool sell=false)
 
virtual int GetPrice (CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
 
virtual string GetHoverText ()
 
virtual string GetHoverText2 ()
 
int Dist (Card c)
 
int Dist (Point p)
 
bool IsInMutterDistance (int d=10)
 
void SetCensored (bool enable)
 
void SetDeconstruct (bool deconstruct)
 
virtual bool MatchEncSearch (string s)
 
virtual void SetSortVal (UIList.SortMode m, CurrencyType currency=CurrencyType.Money)
 
virtual int SecondaryCompare (UIList.SortMode m, Card c)
 
void ForeachFOV (Func< Point, bool > func)
 
void ForeachPoint (Action< Point, bool > action)
 
void OnInspect ()
 
virtual void WriteNote (UINote n, Action< UINote > onWriteNote=null, IInspect.NoteMode mode=IInspect.NoteMode.Default, Recipe recipe=null)
 
void Inspect ()
 
virtual bool HasCondition< T > ()
 
bool HaveFur ()
 
bool CanBeSheared ()
 
- Public Member Functions inherited from BaseCard
bool GetBool (int id)
 
void SetBool (int id, bool enable)
 
int GetInt (int id, int? defaultInt=null)
 
void AddInt (int id, int value)
 
void SetInt (int id, int value=0)
 
string GetStr (int id, string defaultStr=null)
 
void SetStr (int id, string value=null)
 
GetObj< T > (int id)
 
void SetObj (int id, object o)
 
SetObj< T > (int id, object o)
 
ICardParent GetRoot ()
 
void RemoveCard (Card c)
 
void OnChildNumChange (Card c)
 
string ReferenceId ()
 
void WriteNote (UINote n, Action< UINote > onWriteNote=null, NoteMode mode=NoteMode.Default, Recipe recipe=null)
 
void OnInspect ()
 

Static Public Member Functions

static void AddAttackEvaluation (UINote n, Chara chara, Thing current=null)
 
static Tuple< SourceElement.Row, int > GetEnchant (int lv, Func< SourceElement.Row, bool > func, bool neg)
 
- Static Public Member Functions inherited from Card
static string ApplyTone (Chara c, ref string text, string _tones, int gender, bool stripPun=false)
 
static int GetTilePrice (TileRow row, SourceMaterial.Row mat)
 
- Static Public Member Functions inherited from EClass
static int rndSeed (int a, int seed)
 
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

SourceThing.Row source
 
int stackOrder
 
string tempName
 
- Public Attributes inherited from Card
int[] _ints = new int[30]
 
string id = ""
 
ThingContainer things = new ThingContainer()
 
ElementContainerCard elements = new ElementContainerCard()
 
Biography bio
 
List< int > sockets
 
AIAct reservedAct
 
Props props
 
Trait trait
 
ICardParent parent
 
Fov fov
 
Point pos = new Point()
 
CardRenderer renderer
 
CardRow hat
 
int turn
 
int _colorInt
 
float roundTimer
 
float angle = 180f
 
float animeCounter
 
bool isDestroyed
 
CardBlueprint bp
 
BitArray32 _bits1
 
BitArray32 _bits2
 
PlaceState placeState
 
bool dirtyWeight = true
 
SourceMaterial.Row _material
 
Emo lastEmo
 
int sortVal
 
- Public Attributes inherited from BaseCard
Dictionary< int, object > mapObj = new Dictionary<int, object>()
 
Dictionary< int, int > mapInt = new Dictionary<int, int>()
 
Dictionary< int, string > mapStr = new Dictionary<int, string>()
 

Static Public Attributes

const int MaxFurnitureEnc = 12
 
- Static Public Attributes inherited from Card
const int MaxWeight = 10000000
 
- Static Public Attributes inherited from EClass
static Core core
 

Properties

bool isEquipped [get]
 
bool IsMeleeWithAmmo [get]
 
int range [get]
 
int Penetration [get]
 
override bool isThing [get]
 
override CardRow sourceCard [get]
 
override SourcePref Pref [get]
 
override int SelfWeight [get]
 
override int[] Tiles [get]
 
bool CanSearchContents [get]
 
bool IsSharedContainer [get]
 
- Properties inherited from Card
Card parentCard [get]
 
Thing parentThing [get]
 
int colorInt [get]
 
bool IsHotItem [get]
 
int uid [get, set]
 
int idMaterial [get, set]
 
int dir [get, set]
 
int Num [get, set]
 
int _x [get, set]
 
int _z [get, set]
 
int refVal [get, set]
 
int decay [get, set]
 
int altitude [get, set]
 
int hp [get, set]
 
float fx [get, set]
 
float fy [get, set]
 
BlessedState blessedState [get, set]
 
PlaceState _placeState [get, set]
 
int rarityLv [get, set]
 
Rarity rarity [get, set]
 
int encLV [get, set]
 
int posInvX [get, set]
 
int posInvY [get, set]
 
int idSkin [get, set]
 
int feat [get, set]
 
int LV [get, set]
 
int exp [get, set]
 
int tier [get, set]
 
int version [get, set]
 
bool isCensored [get, set]
 
bool isDeconstructing [get, set]
 
bool isDyed [get, set]
 
bool isModified [get, set]
 
bool isNew [get, set]
 
bool isPlayerCreation [get, set]
 
bool ignoreAutoPick [get, set]
 
bool freePos [get, set]
 
bool isHidden [get, set]
 
bool isOn [get, set]
 
bool isNPCProperty [get, set]
 
bool isRestrained [get, set]
 
bool isRoofItem [get, set]
 
bool isMasked [get, set]
 
bool disableAutoToggle [get, set]
 
bool isImported [get, set]
 
bool autoRefuel [get, set]
 
bool ignoreStackHeight [get, set]
 
bool isFloating [get, set]
 
bool isWeightChanged [get, set]
 
bool isFireproof [get, set]
 
bool isAcidproof [get, set]
 
bool isReplica [get, set]
 
bool isSummon [get, set]
 
bool isElemental [get, set]
 
bool isBroken [get, set]
 
bool isSubsetCard [get, set]
 
bool noSnow [get, set]
 
bool noMove [get, set]
 
bool isGifted [get, set]
 
bool isCrafted [get, set]
 
bool isLostProperty [get, set]
 
bool noShadow [get, set]
 
bool noSell [get, set]
 
bool isLeashed [get, set]
 
bool isStolen [get, set]
 
bool isSale [get, set]
 
bool isCopy [get, set]
 
bool isRestocking [get, set]
 
bool hasSpawned [get, set]
 
bool isBackerContent [get]
 
SourceBacker.Row sourceBacker [get]
 
BedType c_bedType [get, set]
 
int c_equippedSlot [get, set]
 
int c_lockLv [get, set]
 
Hostility c_originalHostility [get, set]
 
MinionType c_minionType [get, set]
 
int c_vomit [get, set]
 
bool c_wasInPcParty [get, set]
 
bool c_isImportant [get, set]
 
bool c_lockedHard [get, set]
 
bool c_revealLock [get, set]
 
bool c_isTrained [get, set]
 
bool c_isPrayed [get, set]
 
bool c_isDisableStockUse [get, set]
 
int c_lightColor [get, set]
 
Color LightColor [get]
 
int c_uidZone [get, set]
 
int c_uidRefCard [get, set]
 
int c_priceFix [get, set]
 
int c_priceAdd [get, set]
 
int c_priceCopy [get, set]
 
int c_fixedValue [get, set]
 
int c_dyeMat [get, set]
 
VisitorState visitorState [get, set]
 
RescueState c_rescueState [get, set]
 
BossType c_bossType [get, set]
 
int c_dateStockExpire [get, set]
 
int c_dateDeathLock [get, set]
 
int c_IDTState [get, set]
 
int c_charges [get, set]
 
int c_bill [get, set]
 
int c_invest [get, set]
 
int c_seed [get, set]
 
int c_allowance [get, set]
 
int c_fur [get, set]
 
int c_dateCooked [get, set]
 
int c_containerSize [get, set]
 
int c_weight [get, set]
 
int c_diceDim [get, set]
 
int c_indexContainerIcon [get, set]
 
int c_idMainElement [get, set]
 
int c_summonDuration [get, set]
 
int c_idBacker [get, set]
 
int c_uidMaster [get, set]
 
int c_ammo [get, set]
 
int c_daysWithGod [get, set]
 
int c_daysWithPC [get, set]
 
string c_idPortrait [get, set]
 
string c_idRace [get, set]
 
string c_idJob [get, set]
 
string c_idTone [get, set]
 
string c_color [get, set]
 
string c_idSpriteReplacer [get, set]
 
string c_idTalk [get, set]
 
string c_idDeity [get, set]
 
string c_altName [get, set]
 
string c_altName2 [get, set]
 
string c_extraNameRef [get, set]
 
string c_refText [get, set]
 
string c_idRefName [get, set]
 
string c_idRidePCC [get, set]
 
string c_idAbility [get, set]
 
string c_context [get, set]
 
string c_idEditor [get, set]
 
string c_editorTags [get, set]
 
string c_editorTraitVal [get, set]
 
string c_idTrait [get, set]
 
string c_idRefCard [get, set]
 
string c_idRefCard2 [get, set]
 
string c_note [get, set]
 
UniqueData c_uniqueData [get, set]
 
Thing ammoData [get, set]
 
List< SocketDatasocketList [get, set]
 
Thing c_copyContainer [get, set]
 
Window.SaveData c_windowSaveData [get, set]
 
CharaUpgrade c_upgrades [get, set]
 
CharaGenes c_genes [get, set]
 
List< int > c_corruptionHistory [get, set]
 
ContainerUpgrade c_containerUpgrade [get, set]
 
DNA c_DNA [get, set]
 
CharaList c_charaList [get, set]
 
byte[] c_textureData [get, set]
 
SourceMaterial.Row DyeMat [get]
 
int invX [get, set]
 
int invY [get, set]
 
CardRow refCard [get]
 
CardRow refCard2 [get]
 
int ExpToNext [get]
 
int DefaultLV [get]
 
int ChildrenWeight [get]
 
int ChildrenAndSelfWeight [get]
 
int ChildrenAndSelfWeightSingle [get]
 
virtual int SelfWeight [get]
 
virtual int WeightLimit [get]
 
SourceCategory.Row category [get]
 
SourceMaterial.Row material [get]
 
virtual string AliasMaterialOnCreate [get]
 
Cell Cell [get]
 
virtual Thing Thing [get]
 
virtual Chara Chara [get]
 
virtual bool isThing [get]
 
virtual bool isChara [get]
 
bool ExistsOnMap [get]
 
virtual bool isSynced [get]
 
bool IsContainer [get]
 
bool IsUnique [get]
 
bool IsPowerful [get]
 
bool IsImportant [get]
 
virtual SourcePref Pref [get]
 
virtual bool IsDeadOrSleeping [get]
 
virtual bool IsDisabled [get]
 
virtual bool IsMoving [get]
 
virtual bool flipX [get]
 
virtual bool IsAliveInCurrentZone [get]
 
virtual string actorPrefab [get]
 
virtual CardRow sourceCard [get]
 
virtual CardRow sourceRenderCard [get]
 
TileType TileType [get]
 
string Name [get]
 
string NameSimple [get]
 
string NameOne [get]
 
virtual bool IsPC [get]
 
bool _IsPC [get]
 
virtual bool IsPCC [get]
 
virtual bool IsPCParty [get]
 
virtual bool IsMinion [get]
 
virtual bool IsPCPartyMinion [get]
 
virtual bool IsPCFactionMinion [get]
 
virtual bool IsMultisize [get]
 
bool IsToolbelt [get]
 
bool IsLightsource [get]
 
bool IsEquipment [get]
 
bool IsFood [get]
 
bool IsInheritFoodTraits [get]
 
bool ShowFoodEnc [get]
 
bool IsWeapon [get]
 
bool IsEquipmentOrRanged [get]
 
bool IsEquipmentOrRangedOrAmmo [get]
 
bool IsMeleeWeapon [get]
 
bool IsRangedWeapon [get]
 
bool IsThrownWeapon [get]
 
bool IsAmmo [get]
 
bool IsAgent [get]
 
bool IsFurniture [get]
 
bool IsBlessed [get]
 
bool IsCursed [get]
 
bool IsRestrainedResident [get]
 
virtual bool IsPCFaction [get]
 
bool IsPCFactionOrMinion [get]
 
virtual bool IsGlobal [get]
 
virtual int MaxDecay [get]
 
bool IsDecayed [get]
 
bool IsRotting [get]
 
bool IsFresn [get]
 
virtual int MaxHP [get]
 
virtual int Power [get]
 
int FameLv [get]
 
virtual int[] Tiles [get]
 
virtual int PrefIndex [get]
 
bool IsVariation [get]
 
virtual int DV [get]
 
virtual int PV [get]
 
int HIT [get]
 
int DMG [get]
 
int STR [get]
 
int DEX [get]
 
int END [get]
 
int PER [get]
 
int LER [get]
 
int WIL [get]
 
int MAG [get]
 
int CHA [get]
 
int INT [get]
 
int LUC [get]
 
int W [get]
 
int H [get]
 
bool IsIdentified [get]
 
string TextRarity [get]
 
bool IsInstalled [get]
 
bool IsMale [get]
 
bool IsNegativeGift [get]
 
bool HasContainerSize [get]
 
Thing Tool [get]
 
virtual SourceMaterial.Row DefaultMaterial [get]
 
virtual bool HasHost [get]
 
int Quality [get]
 
int QualityLv [get]
 
LightData LightData [get]
 
CardRenderer HostRenderer [get]
 
bool ShouldShowMsg [get]
 
bool CanInspect [get]
 
string InspectName [get]
 
Point InspectPoint [get]
 
Vector3 InspectPosition [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]
 
- Properties inherited from IInspect
bool CanInspect [get]
 
string InspectName [get]
 
Point InspectPoint [get]
 
Vector3 InspectPosition [get]
 

Additional Inherited Members

- Public Types inherited from Card
enum  MoveResult { Fail , Success , Door }
 
enum  MoveType { Walk , Force }
 
- Public Types inherited from IInspect
enum  NoteMode { Default , Recipe , Product , Info }
 
- Protected Member Functions inherited from Card
virtual void OnSerializing ()
 
virtual void OnDeserialized ()
 

Detailed Description

Definition at line 7 of file Thing.cs.

Member Function Documentation

◆ AddAttackEvaluation()

static void Thing.AddAttackEvaluation ( UINote  n,
Chara  chara,
Thing  current = null 
)
inlinestatic

Definition at line 1390 of file Thing.cs.

1391 {
1392 n.AddHeader("headerAttackEval");
1393 int num = 0;
1394 foreach (BodySlot slot in chara.body.slots)
1395 {
1396 if (slot.thing == null || slot.elementId != 35 || slot.thing.source.offense.Length < 2)
1397 {
1398 continue;
1399 }
1400 AttackProcess.Current.Prepare(chara, slot.thing, null, null, num);
1401 string text = AttackProcess.Current.GetText();
1402 if (slot.thing == current)
1403 {
1404 text = text.TagColor(() => true);
1405 }
1406 n.AddText(text);
1407 num++;
1408 }
1409 AttackProcess.Current.Prepare(chara, null);
1410 string text2 = AttackProcess.Current.GetText();
1411 if (num == 0)
1412 {
1413 text2 = text2.TagColor(() => true);
1414 }
1415 n.AddText(text2);
1416 }
void Prepare(Chara _CC, Thing _weapon, Card _TC=null, Point _TP=null, int _attackIndex=0, bool _isThrow=false)
static AttackProcess Current
Definition: AttackProcess.cs:8
string GetText()
int elementId
Definition: BodySlot.cs:6
Thing thing
Definition: BodySlot.cs:8
List< BodySlot > slots
Definition: CharaBody.cs:8
CharaBody body
Definition: Chara.cs:94
SourceThing.Row source
Definition: Thing.cs:11
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(), Chara.body, AttackProcess.Current, BodySlot.elementId, AttackProcess.GetText(), AttackProcess.Prepare(), CharaBody.slots, source, and BodySlot.thing.

Referenced by InvOwnerEquip.OnWriteNote(), WindowCharaMini.RefreshEquipment(), and WindowChara.RefreshEquipment().

◆ AddEnchant()

Element Thing.AddEnchant ( int  lv = -1)
inline

Definition at line 1962 of file Thing.cs.

1963 {
1964 if (base.IsToolbelt || base.IsLightsource)
1965 {
1966 return null;
1967 }
1968 Tuple<SourceElement.Row, int> enchant = GetEnchant(lv, (SourceElement.Row r) => r.IsEncAppliable(base.category), base.IsCursed);
1969 if (enchant == null)
1970 {
1971 return null;
1972 }
1973 return elements.ModBase(enchant.Item1.id, enchant.Item2);
1974 }
ElementContainerCard elements
Definition: Card.cs:37
Element ModBase(int ele, int v)
static Tuple< SourceElement.Row, int > GetEnchant(int lv, Func< SourceElement.Row, bool > func, bool neg)
Definition: Thing.cs:1875

Referenced by OnCreate().

◆ ApplyMaterial()

override void Thing.ApplyMaterial ( bool  remove = false)
inlinevirtual

Reimplemented from Card.

Definition at line 321 of file Thing.cs.

322 {
323 if (source.HasTag(CTAG.replica))
324 {
325 base.isReplica = true;
326 }
327 if (remove)
328 {
329 ApplyMaterialElements(remove: true);
330 bool flag2 = (base.isFireproof = false);
331 base.isAcidproof = flag2;
332 return;
333 }
334 bool pvSet = false;
335 bool dmgSet = false;
336 bool hitSet = false;
337 if (sourceCard.quality == 4)
338 {
339 if (source.offense.Length != 0)
340 {
341 base.c_diceDim = source.offense[1];
342 }
343 if (source.offense.Length > 2)
344 {
345 SetBase(66, source.offense[2]);
346 }
347 if (source.offense.Length > 3)
348 {
349 SetBase(67, source.offense[3]);
350 }
351 if (source.defense.Length != 0)
352 {
353 SetBase(64, source.defense[0]);
354 }
355 if (source.defense.Length > 1)
356 {
357 SetBase(65, source.defense[1]);
358 }
359 }
360 else
361 {
362 int num = 120;
363 bool flag3 = !base.IsAmmo;
364 if (base.rarity <= Rarity.Crude)
365 {
366 num = 150;
367 }
368 else if (base.rarity == Rarity.Superior)
369 {
370 num = 100;
371 }
372 else if (base.rarity >= Rarity.Legendary)
373 {
374 num = 80;
375 }
376 if (source.offense.Length != 0)
377 {
378 base.c_diceDim = source.offense[1] * base.material.dice / (num + (flag3 ? EClass.rnd(25) : 0));
379 }
380 if (source.offense.Length > 2)
381 {
382 SetBase(66, source.offense[2] * base.material.atk * 9 / (num - (flag3 ? EClass.rnd(30) : 0)));
383 }
384 if (source.offense.Length > 3)
385 {
386 SetBase(67, source.offense[3] * base.material.dmg * 5 / (num - (flag3 ? EClass.rnd(30) : 0)));
387 }
388 if (source.defense.Length != 0)
389 {
390 SetBase(64, source.defense[0] * base.material.dv * 7 / (num - (flag3 ? EClass.rnd(30) : 0)));
391 }
392 if (source.defense.Length > 1)
393 {
394 SetBase(65, source.defense[1] * base.material.pv * 9 / (num - (flag3 ? EClass.rnd(30) : 0)));
395 }
396 }
397 if (base.isReplica)
398 {
399 if (source.offense.Length != 0)
400 {
401 base.c_diceDim = Mathf.Max(source.offense[1] / 3, 1);
402 }
403 if (source.offense.Length > 2)
404 {
405 SetBase(66, source.offense[2] / 3);
406 }
407 if (source.offense.Length > 3)
408 {
409 SetBase(67, source.offense[3] / 3);
410 }
411 if (source.defense.Length != 0)
412 {
413 SetBase(64, source.defense[0] / 3);
414 }
415 if (source.defense.Length > 1)
416 {
417 SetBase(65, source.defense[1] / 3);
418 }
419 }
420 if (base.IsEquipmentOrRangedOrAmmo)
421 {
422 if (base.IsWeapon || base.IsAmmo)
423 {
424 if (dmgSet)
425 {
426 elements.ModBase(67, base.encLV + ((base.blessedState == BlessedState.Blessed) ? 1 : 0));
427 }
428 }
429 else if (pvSet)
430 {
431 elements.ModBase(65, (base.encLV + ((base.blessedState == BlessedState.Blessed) ? 1 : 0)) * 2);
432 }
433 }
434 if (sockets != null)
435 {
436 for (int i = 0; i < sockets.Count; i++)
437 {
438 int num2 = sockets[i];
439 int num3 = num2 / 100;
440 if (num3 == 67 && dmgSet)
441 {
442 elements.ModBase(67, num2 % 100);
443 }
444 if (num3 == 66 && hitSet)
445 {
446 elements.ModBase(66, num2 % 100);
447 }
448 if (num3 == 65 && pvSet)
449 {
450 elements.ModBase(65, num2 % 100);
451 }
452 }
453 }
454 if (base.material == null || base.material.elements == null)
455 {
456 Debug.Log(base.idMaterial + "/" + base.material?.name + "/" + base.material?.elements);
457 }
458 ApplyMaterialElements(remove: false);
459 string[] bits = base.material.bits;
460 foreach (string text in bits)
461 {
462 if (!(text == "fire"))
463 {
464 if (text == "acid")
465 {
466 base.isAcidproof = true;
467 }
468 }
469 else
470 {
471 base.isFireproof = true;
472 }
473 }
474 if (base.rarity >= Rarity.Artifact)
475 {
476 bool flag2 = (base.isFireproof = true);
477 base.isAcidproof = flag2;
478 }
479 _colorInt = 0;
480 void SetBase(int ele, int a)
481 {
482 elements.SetBase(ele, a);
483 if (ele == 67)
484 {
485 dmgSet = true;
486 }
487 if (ele == 65)
488 {
489 pvSet = true;
490 }
491 if (ele == 66)
492 {
493 hitSet = true;
494 }
495 }
496 }
BlessedState
Definition: BlessedState.cs:2
CTAG
Definition: CTAG.cs:2
Rarity
Definition: Rarity.cs:2
int quality
Definition: CardRow.cs:19
int _colorInt
Definition: Card.cs:63
List< int > sockets
Definition: Card.cs:43
Definition: EClass.cs:5
static int rnd(int a)
Definition: EClass.cs:58
Element SetBase(string alias, int v, int potential=0)
override void ApplyMaterialElements(bool remove)
Definition: Thing.cs:303
override CardRow sourceCard
Definition: Thing.cs:47

References Card._colorInt, ApplyMaterialElements(), Debug, Card.elements, ElementContainer.ModBase(), CardRow.quality, EClass.rnd(), ElementContainer.SetBase(), Card.sockets, source, and sourceCard.

◆ ApplyMaterialElements()

override void Thing.ApplyMaterialElements ( bool  remove)
inlinevirtual

Reimplemented from Card.

Definition at line 303 of file Thing.cs.

304 {
305 Chara chara = null;
307 {
308 chara = GetRootCard()?.Chara;
309 if (chara != null)
310 {
312 }
313 }
314 elements.ApplyMaterialElementMap(this, remove);
315 if (chara != null)
316 {
317 elements.SetParent(chara);
318 }
319 }
virtual Chara Chara
Definition: Card.cs:2006
Card GetRootCard()
Definition: Card.cs:3287
Definition: Chara.cs:10
bool IsGameStarted
Definition: Core.cs:84
static Core core
Definition: EClass.cs:6
void SetParent(Card c)
void ApplyMaterialElementMap(Thing t, bool invert=false)
bool isEquipped
Definition: Thing.cs:17

References ElementContainer.ApplyMaterialElementMap(), Card.Chara, EClass.core, Card.elements, Card.GetRootCard(), isEquipped, Core.IsGameStarted, and ElementContainer.SetParent().

Referenced by ApplyMaterial().

◆ CanAutoFire()

bool Thing.CanAutoFire ( Chara  c,
Card  tg,
bool  reloading = false 
)
inline

Definition at line 108 of file Thing.cs.

109 {
110 if (GetRootCard() != c)
111 {
112 return false;
113 }
114 if (HasTag(CTAG.throwWeapon))
115 {
116 return true;
117 }
118 if (!trait.CanAutofire)
119 {
120 return false;
121 }
122 if (trait is TraitToolRange)
123 {
124 if ((c.IsPCFaction && c.body.IsTooHeavyToEquip(this)) || reloading)
125 {
126 return false;
127 }
128 }
129 else if (trait is TraitAbility && c.IsPC)
130 {
131 Act act = (trait as TraitAbility).act;
132 Element element = c.elements.GetElement(act.id);
133 if (act is Spell && (element == null || element.vPotential == 0))
134 {
135 return false;
136 }
137 }
138 return true;
139 }
Definition: ACT.cs:62
bool HasTag(CTAG tag)
Definition: Card.cs:2531
Trait trait
Definition: Card.cs:49
bool IsTooHeavyToEquip(Thing thing)
Definition: CharaBody.cs:156
override bool IsPC
Definition: Chara.cs:608
override bool IsPCFaction
Definition: Chara.cs:667
Element GetElement(string alias)
int id
Definition: ELEMENT.cs:248
int vPotential
Definition: ELEMENT.cs:254
Definition: SPELL.cs:527
virtual bool CanAutofire
Definition: Trait.cs:141

References Chara.body, Trait.CanAutofire, Card.elements, ElementContainer.GetElement(), Card.GetRootCard(), Card.HasTag(), Element.id, Chara.IsPC, Chara.IsPCFaction, CharaBody.IsTooHeavyToEquip(), Card.trait, and Element.vPotential.

Referenced by AM_Adv._OnUpdateInput().

◆ CanStackTo()

override bool Thing.CanStackTo ( Thing  to)
inlinevirtual

Reimplemented from Card.

Definition at line 1559 of file Thing.cs.

1560 {
1561 if (trait.HasCharges || to.isEquipped || base.isModified || to.isModified || to.id != id || to.idMaterial != base.idMaterial || to.refVal != base.refVal || to.blessedState != base.blessedState || to.rarityLv != base.rarityLv || to.tier != base.tier || to.idSkin != base.idSkin || to.isGifted != base.isGifted)
1562 {
1563 return false;
1564 }
1565 if ((to.isDyed || base.isDyed) && to.c_dyeMat != base.c_dyeMat)
1566 {
1567 return false;
1568 }
1569 if (base.c_idRefCard != to.c_idRefCard || base.c_idRefCard2 != to.c_idRefCard2)
1570 {
1571 return false;
1572 }
1573 if (base.IsDecayed != to.IsDecayed)
1574 {
1575 return false;
1576 }
1577 if (!trait.CanStackTo(to))
1578 {
1579 return false;
1580 }
1581 if (base.noSell != to.noSell || base.isCopy != to.isCopy)
1582 {
1583 return false;
1584 }
1585 if (base.isStolen != to.isStolen)
1586 {
1587 return false;
1588 }
1589 if (base.isCrafted != to.isCrafted)
1590 {
1591 return false;
1592 }
1593 if ((to.isWeightChanged || base.isWeightChanged) && to.SelfWeight != SelfWeight)
1594 {
1595 return false;
1596 }
1597 if (to.c_IDTState != base.c_IDTState)
1598 {
1599 return false;
1600 }
1601 if (to.c_priceAdd != base.c_priceAdd || to.c_priceFix != base.c_priceFix || to.c_priceCopy != base.c_priceCopy)
1602 {
1603 return false;
1604 }
1605 if (to.ChildrenAndSelfWeight + base.ChildrenAndSelfWeight > 1000000000)
1606 {
1607 return false;
1608 }
1609 if (trait.IsRequireFuel && base.c_charges != to.c_charges)
1610 {
1611 return false;
1612 }
1613 if (base.c_altName != to.c_altName)
1614 {
1615 return false;
1616 }
1617 if (base.Num + to.Num <= 0)
1618 {
1619 return false;
1620 }
1621 bool flag = false;
1622 if (to.parent is Card)
1623 {
1624 Window.SaveData windowSaveData = (to.parent as Card).GetWindowSaveData();
1625 if (windowSaveData != null && windowSaveData.compress)
1626 {
1627 flag = true;
1628 }
1629 }
1630 if (flag)
1631 {
1632 if (base.encLV != to.encLV && !base.IsFood)
1633 {
1634 return false;
1635 }
1636 if (elements.dict.Count() != to.elements.dict.Count())
1637 {
1638 return false;
1639 }
1640 foreach (Element value in elements.dict.Values)
1641 {
1642 if (to.elements.GetElement(value.id) == null)
1643 {
1644 return false;
1645 }
1646 }
1647 int num2 = (to.encLV = Mathf.CeilToInt(1f * (float)(base.encLV * base.Num + to.encLV * to.Num) / (float)(base.Num + to.Num)));
1648 base.encLV = num2;
1649 foreach (Element value2 in elements.dict.Values)
1650 {
1651 Element element = to.elements.GetElement(value2.id);
1652 value2.vBase = (element.vBase = (value2.vBase * base.Num + element.vBase * to.Num) / (base.Num + to.Num));
1653 }
1654 return true;
1655 }
1656 if (base.encLV != to.encLV)
1657 {
1658 return false;
1659 }
1660 if (elements.dict.Count() != to.elements.dict.Count())
1661 {
1662 return false;
1663 }
1664 foreach (Element value3 in elements.dict.Values)
1665 {
1666 Element element2 = to.elements.GetElement(value3.id);
1667 if (element2 == null || value3.vBase / 10 * 10 != element2.vBase / 10 * 10)
1668 {
1669 return false;
1670 }
1671 }
1672 return true;
1673 }
Definition: Card.cs:11
int c_priceFix
Definition: Card.cs:1109
bool isCrafted
Definition: Card.cs:778
int tier
Definition: Card.cs:394
bool IsDecayed
Definition: Card.cs:2223
int idMaterial
Definition: Card.cs:130
string id
Definition: Card.cs:31
bool noSell
Definition: Card.cs:814
bool isCopy
Definition: Card.cs:862
string c_altName
Definition: Card.cs:1553
int c_priceAdd
Definition: Card.cs:1121
int c_dyeMat
Definition: Card.cs:1157
ICardParent parent
Definition: Card.cs:51
int c_priceCopy
Definition: Card.cs:1133
int c_IDTState
Definition: Card.cs:1229
string c_idRefCard2
Definition: Card.cs:1709
int refVal
Definition: Card.cs:190
Window.SaveData GetWindowSaveData()
Definition: Card.cs:2452
int encLV
Definition: Card.cs:310
bool isDyed
Definition: Card.cs:442
bool isWeightChanged
Definition: Card.cs:646
int rarityLv
Definition: Card.cs:286
int idSkin
Definition: Card.cs:346
bool isGifted
Definition: Card.cs:766
BlessedState blessedState
Definition: Card.cs:262
bool isStolen
Definition: Card.cs:838
int ChildrenAndSelfWeight
Definition: Card.cs:1977
bool isModified
Definition: Card.cs:454
int Num
Definition: Card.cs:154
int c_charges
Definition: Card.cs:1241
string c_idRefCard
Definition: Card.cs:1697
Dictionary< int, Element > dict
int vBase
Definition: ELEMENT.cs:250
override int SelfWeight
Definition: Thing.cs:62
virtual bool CanStackTo(Thing to)
Definition: Trait.cs:581
virtual bool HasCharges
Definition: Trait.cs:323
bool IsRequireFuel
Definition: Trait.cs:457
bool compress
Definition: Window.cs:415

References Card.blessedState, Card.c_altName, Card.c_charges, Card.c_dyeMat, Card.c_idRefCard, Card.c_idRefCard2, Card.c_IDTState, Card.c_priceAdd, Card.c_priceCopy, Card.c_priceFix, Card.ChildrenAndSelfWeight, Window.SaveData.compress, ElementContainer.dict, Card.elements, Card.encLV, ElementContainer.GetElement(), Card.id, Element.id, Card.idMaterial, Card.idSkin, Card.isCopy, Card.isCrafted, Card.IsDecayed, Card.isDyed, isEquipped, Card.isGifted, Card.isModified, Card.isStolen, Card.isWeightChanged, Card.noSell, Card.Num, Card.parent, Card.rarityLv, Card.refVal, SelfWeight, Card.tier, and Element.vBase.

Referenced by ThingContainer.CanStack(), InvOwner.OnDrag(), and DragItemCard.OnDragSpecial().

◆ Disassemble()

void Thing.Disassemble ( )
inline

Definition at line 1712 of file Thing.cs.

1713 {
1714 }

Referenced by LayerCraftFloat.RefreshDisassemble().

◆ DoAct()

void Thing.DoAct ( Act  act)
inline

Definition at line 1857 of file Thing.cs.

1858 {
1859 if (!EClass.pc.HasNoGoal || (act.LocalAct && EClass._zone.IsRegion))
1860 {
1861 SE.Beep();
1862 return;
1863 }
1864 EClass.player.hotItemToRestore = EClass.player.currentHotItem;
1865 if (act.IsAct)
1866 {
1867 act.Perform(EClass.pc);
1868 return;
1869 }
1870 AIAct aI = act as AIAct;
1871 EClass.pc.SetAI(aI);
1873 }
Definition: AIAct.cs:6
void SetTurbo(int mtp=-1)
Definition: AM_Adv.cs:1040
virtual bool Perform()
Definition: ACT.cs:266
virtual bool LocalAct
Definition: ACT.cs:171
virtual bool IsAct
Definition: ACT.cs:101
static AM_Adv Adv
Definition: ActionMode.cs:15
AIAct SetAI(AIAct g)
Definition: Chara.cs:8189
bool HasNoGoal
Definition: Chara.cs:864
static Zone _zone
Definition: EClass.cs:20
static Player player
Definition: EClass.cs:12
static Chara pc
Definition: EClass.cs:14
HotItem currentHotItem
Definition: Player.cs:916
virtual bool IsRegion
Definition: Spatial.cs:501

References EClass._zone, ActionMode.Adv, Player.currentHotItem, Chara.HasNoGoal, Act.IsAct, Spatial.IsRegion, Act.LocalAct, EClass.pc, Act.Perform(), EClass.player, Chara.SetAI(), and AM_Adv.SetTurbo().

◆ GetDisassembles()

void Thing.GetDisassembles ( List< Thing list)
inline

Definition at line 1708 of file Thing.cs.

1709 {
1710 }

Referenced by RecipeUpdater.RunDisassemble().

◆ GetEfficiency()

int Thing.GetEfficiency ( )
inline

Definition at line 141 of file Thing.cs.

142 {
143 return 50 + base.LV * 10 + base.encLV * 10 + (int)base.rarity * 10 + (int)base.blessedState * 10;
144 }

Referenced by AIWork.GetSession().

◆ GetEnchant()

static Tuple< SourceElement.Row, int > Thing.GetEnchant ( int  lv,
Func< SourceElement::Row, bool >  func,
bool  neg 
)
inlinestatic

Definition at line 1875 of file Thing.cs.

1876 {
1877 List<SourceElement.Row> list = new List<SourceElement.Row>();
1878 int num = 0;
1879 int num2 = lv + 5 + EClass.rndSqrt(10);
1880 foreach (SourceElement.Row row in EClass.sources.elements.rows)
1881 {
1882 if ((!neg || !row.tag.Contains("flag")) && func(row) && row.LV < num2)
1883 {
1884 list.Add(row);
1885 num += row.chance;
1886 }
1887 }
1888 if (num == 0)
1889 {
1890 return null;
1891 }
1892 int num3 = EClass.rnd(num);
1893 int num4 = 0;
1894 foreach (SourceElement.Row item in list)
1895 {
1896 num4 += item.chance;
1897 if (num3 < num4)
1898 {
1899 string text = EClass.sources.elements.map[item.id].category;
1900 bool flag = text == "skill" || text == "attribute" || text == "resist";
1901 float num5 = (float)(3 + Mathf.Min(lv / 10, 15)) + Mathf.Sqrt(lv * item.encFactor / 100);
1902 int num6 = (item.mtp + EClass.rnd(item.mtp + (int)num5)) / item.mtp * ((!(flag && neg)) ? 1 : (-1));
1903 if (item.encFactor == 0 && num6 > 25)
1904 {
1905 num6 = 25;
1906 }
1907 return new Tuple<SourceElement.Row, int>(item, num6);
1908 }
1909 }
1910 return null;
1911 }
static int rndSqrt(int a)
Definition: EClass.cs:92
static SourceManager sources
Definition: EClass.cs:42
SourceElement elements

References SourceManager.elements, item, neg, EClass.rnd(), EClass.rndSqrt(), and EClass.sources.

Referenced by OnCreate(), and TraitMod.OnCreate().

◆ GetExtraName()

override string Thing.GetExtraName ( )
inlinevirtual

Reimplemented from Card.

Definition at line 766 of file Thing.cs.

767 {
768 string text = "";
769 if (trait.ShowChildrenNumber && base.c_lockLv == 0)
770 {
771 if (things.Count > 0)
772 {
773 text += "childCount".lang(things.Count.ToString() ?? "");
774 }
775 else if (trait.CanOpenContainer)
776 {
777 text += "empty".lang();
778 }
779 }
781 {
782 Room room = pos.cell.room;
783 if (EClass.debug.enable && room != null && room.data.group != 0)
784 {
785 text = text + " #" + room.data.group;
786 }
787 }
788 return text;
789 }
int group
Definition: AreaData.cs:18
AreaData data
Definition: BaseArea.cs:29
Point pos
Definition: Card.cs:55
ThingContainer things
Definition: Card.cs:34
Room room
Definition: Cell.cs:102
bool enable
Definition: CoreDebug.cs:285
static CoreDebug debug
Definition: EClass.cs:48
bool IsValid
Definition: Point.cs:88
Cell cell
Definition: Point.cs:51
Definition: Room.cs:4
virtual bool ShowChildrenNumber
Definition: Trait.cs:327
virtual bool CanOpenContainer
Definition: Trait.cs:230

References BaseArea.data, EClass.debug, CoreDebug.enable, and AreaData.group.

◆ GetHoverText()

override string Thing.GetHoverText ( )
inlinevirtual

Reimplemented from Card.

Definition at line 749 of file Thing.cs.

750 {
751 string text = "";
752 text = text + " <size=14>(" + Lang._weight(base.ChildrenAndSelfWeight) + ")</size> ";
754 {
755 text += Environment.NewLine;
756 text = text + "id:" + id + " tile:" + source.idRenderData + "/" + ((source.tiles.Length != 0) ? ((object)source.tiles[0]) : "-")?.ToString() + " num:" + base.Num + " lv:" + base.LV + " enc:" + base.encLV + " / " + base.material.alias;
757 }
758 string hoverText = trait.GetHoverText();
759 if (!hoverText.IsEmpty())
760 {
761 text = text + Environment.NewLine + hoverText;
762 }
763 return base.GetHoverText() + text;
764 }
bool showExtra
Definition: CoreDebug.cs:167
Definition: Lang.cs:6
static string _weight(int a, int b, bool showUnit=true, int unitSize=0)
Definition: Lang.cs:172
virtual string GetHoverText()
Definition: Trait.cs:586

References Lang._weight(), EClass.debug, CoreDebug.showExtra, and RenderRow.tiles.

◆ GetIngredients()

void Thing.GetIngredients ( Recipe::Ingredient  ing,
List< Thing list 
)
inline

Definition at line 1675 of file Thing.cs.

1676 {
1677 if (ing.CanSetThing(this))
1678 {
1679 list.Add(this);
1680 }
1681 if (things.Count <= 0 || base.c_lockLv != 0 || base.isNPCProperty)
1682 {
1683 return;
1684 }
1685 foreach (Thing thing in things)
1686 {
1687 thing.GetIngredients(ing, list);
1688 }
1689 }
void Add(Act a, string s="")
Definition: ActPlan.cs:11
bool CanSetThing(Thing t)
Definition: Recipe.cs:80
Definition: Thing.cs:8
void GetIngredients(Recipe.Ingredient ing, List< Thing > list)
Definition: Thing.cs:1675

References GetIngredients().

Referenced by GetIngredients(), and LayerCraftFloat.ShowContextMenu().

◆ GetName()

override string Thing.GetName ( NameStyle  style,
int  _num = -1 
)
inlinevirtual

Reimplemented from Card.

Definition at line 498 of file Thing.cs.

499 {
500 int num = ((_num == -1) ? base.Num : _num);
501 string text = "";
502 string text2 = "";
503 string text3 = "";
504 string text4 = "";
505 string sig = "";
506 string text5 = "";
507 string text6 = source.GetText("unit");
508 ArticleStyle style2 = ((style == NameStyle.FullNoArticle) ? ArticleStyle.None : ArticleStyle.Default);
509 bool num2 = base.IsIdentified || source.unknown.IsEmpty();
510 bool isEquipmentOrRangedOrAmmo = base.IsEquipmentOrRangedOrAmmo;
511 bool flag = Lang.setting.nameStyle == 0;
512 if (num2)
513 {
514 if (base.c_idRefCard.IsEmpty() && !base.c_altName.IsEmpty())
515 {
516 text = base.c_altName;
517 }
518 else
519 {
520 string[] array = trait.GetName().Split(',');
521 text = array[0];
522 if (array.Length > 1)
523 {
524 text6 = array[1];
525 }
526 }
527 if (text.IsEmpty())
528 {
529 text = id;
530 }
531 if (!isEquipmentOrRangedOrAmmo || !base.IsIdentified || base.rarity < Rarity.Legendary)
532 {
533 if (source.naming == "m" || (source.naming == "ms" && base.material != source.DefaultMaterial))
534 {
535 if (isEquipmentOrRangedOrAmmo)
536 {
537 string[] textArray = base.material.GetTextArray("altName");
538 if (textArray != null && textArray.Length >= 2)
539 {
540 text = base.material.GetTextArray("altName")[1] + Lang.space + text;
541 goto IL_01f2;
542 }
543 }
544 text = "_of2".lang(base.material.GetName(), text);
545 }
546 goto IL_01f2;
547 }
548 if (base.rarity != Rarity.Artifact && !base.material.GetTextArray("altName").IsEmpty())
549 {
550 text = base.material.GetTextArray("altName")[0] + Lang.space + text;
551 }
552 }
553 else
554 {
555 text = "unknown";
556 string idUnknown = source.GetText("unknown");
557 if (idUnknown.StartsWith("#"))
558 {
559 Rand.UseSeed(EClass.game.seed + (trait.CanStack ? sourceCard._index : base.uid) + base.refVal, delegate
560 {
561 idUnknown = Lang.GetList(idUnknown.Remove(0, 1)).RandomItem();
562 });
563 }
564 text = idUnknown;
565 }
566 goto IL_02a1;
567 IL_02a1:
568 if (!base.c_idRefCard.IsEmpty() && trait.RefCardName != RefCardName.None)
569 {
570 string text7 = base.c_altName.IsEmpty(base.refCard.GetName());
571 if (!base.c_idRefCard2.IsEmpty())
572 {
573 text7 = "_and".lang(text7, base.c_altName2.IsEmpty(base.refCard2.GetName()));
574 }
575 if (!(text7 == "*r"))
576 {
577 text = ((!source.name2.IsEmpty()) ? source.GetTextArray("name2")[0].Replace("#1b", base.c_extraNameRef.IsEmpty((base.refCard == null) ? text7 : (base.refCard.isChara ? base.refCard.GetName() : base.refCard.GetText()))).Replace("#1", base.c_extraNameRef.IsEmpty(text7)) : (source.naming.Contains("last") ? (text + Lang.space + text7) : (source.naming.Contains("first") ? (text7 + Lang.space + text) : ((!source.naming.Contains("of")) ? (text6.IsEmpty() ? "_of3" : "_of2").lang(text7, text) : "_of".lang(text7, text)))));
578 }
579 else
580 {
581 string text8 = base.refCard.GetText("aka");
582 if (!text8.IsEmpty())
583 {
584 text = "_of".lang(text8, text);
585 }
586 }
587 }
588 if (base.c_bill != 0)
589 {
590 text = "_of".lang(Lang._currency(base.c_bill, showUnit: true, 0), text);
591 }
592 trait.SetName(ref text);
593 if (base.tier > 0)
594 {
595 text = Lang.GetList((base.category.id == "fish") ? "quality_fish" : "quality_general")[Mathf.Clamp(base.tier, 0, 3)] + text;
596 }
597 switch (style)
598 {
599 case NameStyle.Simple:
600 return text;
601 case NameStyle.Ref:
602 return text;
603 default:
604 {
605 if (!base.c_refText.IsEmpty())
606 {
607 text = "_named".lang(base.c_refText, text);
608 }
609 if (base.IsIdentified)
610 {
611 int hIT = base.HIT;
612 int dMG = base.DMG;
613 if ((base.IsMeleeWeapon || base.IsRangedWeapon || base.IsAmmo || hIT != 0 || dMG != 0) && source.offense.Length != 0)
614 {
615 string text9 = "";
616 if (source.offense[0] != 0)
617 {
618 text9 = text9 + source.offense[0] + "d" + base.c_diceDim;
619 }
620 if (dMG != 0)
621 {
622 text9 += ((base.IsMeleeWeapon || base.IsRangedWeapon || base.IsAmmo) ? dMG.ToText() : (dMG.ToString() ?? ""));
623 }
624 if (hIT != 0)
625 {
626 text9 = text9 + ((dMG != 0 || source.offense[0] != 0) ? ", " : "") + hIT;
627 }
628 text2 = text2 + " (" + text9.IsEmpty(" - ") + ") ";
629 }
630 int dV = DV;
631 int pV = PV;
632 if (dV != 0 || pV != 0)
633 {
634 text2 += " [";
635 text2 = text2 + dV + ", " + pV;
636 text2 += "] ";
637 }
639 {
640 text2 = text2 + " " + "itemCharges".lang(base.c_charges.ToString() ?? "");
641 }
642 }
643 else if (base.c_IDTState == 3 || base.c_IDTState == 1)
644 {
645 text2 = "(" + base.TextRarity.ToTitleCase() + ")";
646 }
647 if (base.IsDecayed)
648 {
649 text = "rotten".lang() + text;
650 }
651 else if (base.IsRotting)
652 {
653 text = "rotting".lang() + text;
654 }
655 if (base.IsIdentified)
656 {
657 if (base.blessedState != 0)
658 {
659 text4 = ("bs" + base.blessedState).lang();
660 }
661 switch (base.rarity)
662 {
663 case Rarity.Artifact:
664 style2 = ArticleStyle.None;
665 text3 = "★";
666 text = (isEquipmentOrRangedOrAmmo ? text.Bracket(3) : text);
667 break;
668 case Rarity.Legendary:
669 case Rarity.Mythical:
670 style2 = ArticleStyle.The;
671 text3 = "☆";
672 if (isEquipmentOrRangedOrAmmo)
673 {
674 Rand.UseSeed(base.uid + EClass.game.seed, delegate
675 {
676 sig = AliasGen.GetRandomAlias().Bracket((base.rarity == Rarity.Mythical) ? 3 : 2);
677 });
678 sig = Lang.space + sig;
679 }
680 break;
681 }
682 }
683 if (base.encLV != 0)
684 {
685 if (base.category.tag.Contains("enc"))
686 {
687 if (base.c_altName.IsEmpty())
688 {
689 string[] list = Lang.GetList("quality_furniture");
690 text = "_qualityFurniture".lang(list[Mathf.Clamp(base.encLV - 1, 0, list.Length - 1)], text);
691 }
692 }
693 else
694 {
695 sig = sig + Lang.space + ((base.encLV > 0) ? ("+" + base.encLV) : (base.encLV.ToString() ?? ""));
696 }
697 }
698 if (base.c_lockLv != 0 && base.c_revealLock)
699 {
700 sig = sig + Lang.space + "+" + base.c_lockLv;
701 }
702 if (base.isLostProperty)
703 {
704 text = "_lostproperty".lang(text);
705 }
707 {
708 text5 += "equippedItem".lang();
709 }
710 if (!base.c_note.IsEmpty() && (!base.isBackerContent || EClass.core.config.backer.Show(base.c_note)))
711 {
712 string text10 = base.c_note;
713 if (text10.StartsWith('@'))
714 {
715 text10 = Lang.Note.map.TryGetValue(text10.TrimStart('@'))?.GetText("text") ?? base.c_note;
716 }
717 string text11 = (base.category.IsChildOf("book") ? "_written" : "_engraved");
718 if (id == "grave_dagger1" || id == "grave_dagger2")
719 {
720 text11 = "_daggerGrave";
721 }
722 text = ((!text10.Contains("_bracketLeft".lang())) ? text11.lang(text10, text) : (text11 + "Alt").lang(text10, text));
723 }
724 text = (flag ? ((num <= 1) ? (text4 + text) : "_unit".lang(num.ToFormat() ?? "", text4 + text, text6)) : ((trait is TraitAbility) ? text.ToTitleCase(wholeText: true) : ((!text6.IsEmpty() && (base.IsIdentified || source.unknown.IsEmpty())) ? "_unit".lang((num == 1) ? "" : (num.ToFormat() ?? ""), text, (text4 + text6).AddArticle(num, style2, source.unit)) : (text4 + text).AddArticle(num, style2, source.name))));
725 if (base.rarity >= Rarity.Legendary)
726 {
727 text = text.ToTitleCase(wholeText: true);
728 }
729 string text12 = ((base.isSale && things.Count > 0) ? "forSale2".lang() : ((base.isSale || (base.parentThing != null && base.parentThing.isSale && TraitSalesTag.CanTagSale(this, insideContainer: true))) ? "forSale".lang(Lang._currency(GetPrice(CurrencyType.Money, sell: true, PriceType.PlayerShop), "money")) : ""));
730 if (trait is TraitSalesTag && base.isOn && !GetStr(11).IsEmpty())
731 {
732 text12 += "soldOut".lang(EClass.sources.categories.map[GetStr(11)].GetName());
733 }
734 if (GetInt(101) != 0)
735 {
736 text5 = "_limitedStock".lang(text5);
737 }
738 return text5 + text3 + text + sig + text2 + text12;
739 }
740 }
741 IL_01f2:
742 if (source.naming == "ma")
743 {
744 text = base.material.GetName();
745 }
746 goto IL_02a1;
747 }
ArticleStyle
Definition: ArticleStyle.cs:2
CurrencyType
Definition: CurrencyType.cs:2
NameStyle
Definition: NameStyle.cs:2
PriceType
Definition: PriceType.cs:2
RefCardName
Definition: RefCardName.cs:2
string GetStr(int id, string defaultStr=null)
Definition: BaseCard.cs:54
int GetInt(int id, int? defaultInt=null)
Definition: BaseCard.cs:25
virtual int PV
Definition: Card.cs:2263
virtual int GetPrice(CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
Definition: Card.cs:6875
virtual int DV
Definition: Card.cs:2261
override string ToString()
Definition: Card.cs:2423
bool IsIdentified
Definition: Card.cs:2313
BackerContentConfig backer
Definition: CoreConfig.cs:604
CoreConfig config
Definition: Core.cs:70
static Game game
Definition: EClass.cs:8
int seed
Definition: Game.cs:197
static LangNote Note
Definition: Lang.cs:50
static string[] GetList(string id)
Definition: Lang.cs:114
static string _currency(object a, string IDCurrency)
Definition: Lang.cs:162
Thing eqBait
Definition: Player.cs:922
Definition: Rand.cs:4
static void UseSeed(int seed, Action action)
Definition: Rand.cs:22
SourceCategory categories
static bool CanTagSale(Card t, bool insideContainer=false)
Definition: TraitSalesTag.cs:9
virtual string GetName()
Definition: Trait.cs:684
virtual bool ShowCharges
Definition: Trait.cs:325
virtual bool CanStack
Definition: Trait.cs:149
virtual void SetName(ref string s)
Definition: Trait.cs:689

References Lang._currency(), SourceData< T, T2 >.BaseRow._index, CoreConfig.backer, Trait.CanStack, TraitSalesTag.CanTagSale(), SourceManager.categories, Core.config, EClass.core, Card.DV, Player.eqBait, EClass.game, BaseCard.GetInt(), Lang.GetList(), Trait.GetName(), Card.GetPrice(), Card.GetRootCard(), BaseCard.GetStr(), Trait.HasCharges, Card.id, Lang.Note, EClass.pc, EClass.player, Card.PV, Game.seed, Trait.SetName(), CoreConfig.BackerContentConfig.Show(), Trait.ShowCharges, source, sourceCard, EClass.sources, Card.trait, and Rand.UseSeed().

Referenced by WidgetPopText._SayPick(), DramaCustomSequence.Build(), QuestDeliver.IsDestThing(), ThingContainer.RefreshGrid(), AI_OpenGambleChest.Run(), UIMagicChest.Search(), CoreExtension.Sort(), ActThrow.Throw(), Zone.TryAddThingInSharedContainer(), and Chara.TryUse().

◆ GetRecipes()

void Thing.GetRecipes ( HashSet< Recipe recipes)
inline

Definition at line 1704 of file Thing.cs.

1705 {
1706 }

Referenced by RecipeUpdater.RunRecipe().

◆ GetSubPassData()

override SubPassData Thing.GetSubPassData ( )
inlinevirtual

Reimplemented from Card.

Definition at line 1545 of file Thing.cs.

1546 {
1547 Chara chara = GetRootCard() as Chara;
1548 if ((!trait.ShowAsTool || (chara == EClass.pc && HotItemHeld.disableTool)) && (chara?.held == this || (!base.isRoofItem && placeState != PlaceState.installed && renderer.data.subCrate.enable && parent is Zone)))
1549 {
1551 {
1552 return EClass.setting.pass.subCrate;
1553 }
1554 return renderer.data.subCrate;
1555 }
1556 return SubPassData.Default;
1557 }
PlaceState
Definition: PlaceState.cs:2
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
bool isRoofItem
Definition: Card.cs:562
PlaceState placeState
Definition: Card.cs:79
CardRenderer renderer
Definition: Card.cs:57
static GameSetting setting
Definition: EClass.cs:34
PassSetting pass
Definition: GameSetting.cs:303
SubPassData subCrate
Definition: RenderData.cs:46
RenderData data
Definition: RenderObject.cs:34
static SubPassData Default
Definition: SubPassData.cs:7
Definition: Zone.cs:12

References SubPassData.Default, HotItemHeld.disableTool, Chara.held, GameSetting.pass, EClass.pc, EClass.setting, and GameSetting.PassSetting.subCrate.

◆ Identify()

Thing Thing.Identify ( bool  show = true,
IDTSource  idtSource = IDTSource::Identify 
)
inline

Definition at line 1980 of file Thing.cs.

1981 {
1982 if (base.IsIdentified)
1983 {
1984 return this;
1985 }
1986 string @ref = "";
1987 string text = "";
1988 if (show)
1989 {
1990 @ref = GetName(NameStyle.Full, base.Num);
1991 }
1992 Rarity rarity = idtSource switch
1993 {
1994 IDTSource.SkillHigh => Rarity.Legendary,
1995 IDTSource.Skill => Rarity.Superior,
1996 _ => Rarity.Normal,
1997 };
1998 if (rarity != 0 && ((base.IsEquipmentOrRangedOrAmmo && base.rarity >= rarity) || base.rarity >= Rarity.Mythical))
1999 {
2000 base.c_IDTState = 3;
2001 }
2002 else if (base.rarity >= Rarity.Mythical && idtSource != IDTSource.SuperiorIdentify)
2003 {
2004 base.c_IDTState = 1;
2005 }
2006 else
2007 {
2008 base.c_IDTState = 0;
2009 }
2010 if (show)
2011 {
2012 text = GetName(NameStyle.Full, base.Num);
2013 if (base.c_IDTState == 0)
2014 {
2015 Msg.Say("identified", @ref, text);
2016 }
2017 else
2018 {
2019 Msg.Say((idtSource == IDTSource.Skill) ? "identified3" : "identified2", @ref, text, base.TextRarity);
2020 }
2021 }
2022 if (base.IsIdentified)
2023 {
2024 GetRootCard()?.TryStack(this);
2025 }
2027 return this;
2028 }
IDTSource
Definition: IDTSource.cs:2
Rarity rarity
Definition: Card.cs:298
void TryStack(Thing t)
Definition: Card.cs:6582
static void SetDirty(Thing t)
Definition: Msg.cs:5
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
override string GetName(NameStyle style, int _num=-1)
Definition: Thing.cs:498

References Msg.Say(), and LayerInventory.SetDirty().

Referenced by RecipeCard.Craft(), TraitAltar.OnOffer(), TraitBaseSpellbook.OnRead(), AI_Read.OnSetOwner(), QuestDeliver.OnStart(), ActZap.Perform(), ActEffect.Proc(), InvOwner.Transaction.Process(), DramaOutcome.QuestExploration_AfterCrystal(), AI_UseCrafter.Run(), and Chara.TryIdentify().

◆ IsValidIngredient()

bool Thing.IsValidIngredient ( Recipe::Ingredient  ing)
inline

Definition at line 1691 of file Thing.cs.

1692 {
1693 if (isDestroyed)
1694 {
1695 return false;
1696 }
1697 if (GetRootCard().Dist(EClass.pc) > 1 || !ing.CanSetThing(this))
1698 {
1699 return false;
1700 }
1701 return true;
1702 }
bool isDestroyed
Definition: Card.cs:71
int Dist(Card c)
Definition: Card.cs:7235

References EClass.pc.

Referenced by DropdownGrid.BuildIngredients().

◆ ListLimitedValidTraits()

List< Element > Thing.ListLimitedValidTraits ( bool  limit)
inline

Definition at line 791 of file Thing.cs.

792 {
793 List<Element> list = new List<Element>();
794 if (base.ShowFoodEnc)
795 {
796 foreach (Element value in elements.dict.Values)
797 {
798 if (value.IsFoodTraitMain && value.Value > 0)
799 {
800 list.Add(value);
801 }
802 }
804 if (limit && list.Count > 5)
805 {
806 int num = list.Count - 5;
807 for (int i = 0; i < num; i++)
808 {
809 list.RemoveAt(list.Count - 1);
810 }
811 }
812 }
813 return list;
814 }
static int GetSortVal(Element a)
int Value
Definition: ELEMENT.cs:290
bool IsFoodTraitMain
Definition: ELEMENT.cs:365

References ElementContainer.GetSortVal(), Element.IsFoodTraitMain, and Element.Value.

◆ ListValidTraits()

List< Element > Thing.ListValidTraits ( bool  isCraft,
bool  limit 
)
inline

Definition at line 816 of file Thing.cs.

817 {
818 List<Element> list = ListLimitedValidTraits(limit);
819 bool showFoodEnc = base.ShowFoodEnc;
820 bool flag = EClass.pc.HasElement(1650);
821 if (showFoodEnc)
822 {
823 foreach (Element value in elements.dict.Values)
824 {
825 if (value.IsFoodTrait && !list.Contains(value) && (isCraft || flag || value.IsFoodTraitMain) && (!value.IsFoodTraitMain || value.Value < 0))
826 {
827 list.Add(value);
828 }
829 }
830 }
831 foreach (Element value2 in elements.dict.Values)
832 {
833 if ((isCraft || flag || ((!value2.IsFoodTrait || value2.IsFoodTraitMain) && (!showFoodEnc || !value2.IsTrait || value2.Value >= 0))) && !list.Contains(value2) && (value2.IsTrait || (value2.IsFoodTrait && !value2.IsFoodTraitMain)))
834 {
835 list.Add(value2);
836 }
837 }
838 return list;
839 }
bool HasElement(int ele, int req=1)
Definition: Card.cs:5566
bool IsFoodTrait
Definition: ELEMENT.cs:362
bool IsTrait
Definition: ELEMENT.cs:360
List< Element > ListLimitedValidTraits(bool limit)
Definition: Thing.cs:791

References Card.HasElement(), Element.IsFoodTrait, Element.IsFoodTraitMain, Element.IsTrait, EClass.pc, and Element.Value.

◆ MatchEncSearch()

override bool Thing.MatchEncSearch ( string  s)
inlinevirtual

Reimplemented from Card.

Definition at line 2030 of file Thing.cs.

2031 {
2032 if (trait is TraitGene)
2033 {
2034 DNA dNA = base.c_DNA;
2035 if (dNA == null || dNA.type == DNA.Type.Brain || dNA.type == DNA.Type.Inferior)
2036 {
2037 return false;
2038 }
2039 for (int i = 0; i < dNA.vals.Count; i += 2)
2040 {
2041 SourceElement.Row row = EClass.sources.elements.map.TryGetValue(dNA.vals[i]);
2042 if (row.name.ToLower().Contains(s))
2043 {
2044 return true;
2045 }
2046 if (row.GetName().ToLower().Contains(s))
2047 {
2048 return true;
2049 }
2050 }
2051 }
2052 else
2053 {
2054 if (!base.IsIdentified)
2055 {
2056 return false;
2057 }
2058 foreach (Element value in elements.dict.Values)
2059 {
2060 if (value.Value != 0)
2061 {
2062 if (value.source.name.ToLower().Contains(s))
2063 {
2064 return true;
2065 }
2066 if (value.source.GetName().ToLower().Contains(s))
2067 {
2068 return true;
2069 }
2070 }
2071 }
2072 }
2073 return false;
2074 }
Definition: DNA.cs:8
Type type
Definition: DNA.cs:29
Type
Definition: DNA.cs:10
List< int > vals
Definition: DNA.cs:24
SourceElement.Row source
Definition: ELEMENT.cs:271
override string GetName()

References SourceManager.elements, SourceElement.Row.GetName(), SourceElement.Row.name, Element.source, EClass.sources, DNA.type, DNA.vals, and Element.Value.

Referenced by ThingContainer.RefreshGrid(), and WidgetSearch.Search().

◆ OnCreate()

override void Thing.OnCreate ( int  genLv)
inlinevirtual

Reimplemented from Card.

Definition at line 162 of file Thing.cs.

163 {
164 if (bp.blesstedState.HasValue)
165 {
166 SetBlessedState(bp.blesstedState.GetValueOrDefault());
167 }
168 else if (base.category.ignoreBless == 0 && bp.rarity == Rarity.Random && base.rarity != Rarity.Artifact)
169 {
170 if (EClass.rnd(25) == 0)
171 {
173 }
174 else if (EClass.rnd(25) == 0)
175 {
177 }
178 else if (EClass.rnd(50) == 0 && base.category.slot != 0)
179 {
181 }
182 }
183 if (!EClass.debug.autoIdentify && (!source.unknown_JP.IsEmpty() || (base.category.slot != 0 && base.rarity >= Rarity.Superior)))
184 {
185 base.c_IDTState = 5;
186 }
187 string text = id;
188 if (text == "bill_tax" || text == "bill")
189 {
190 base.c_bill = 100 + EClass.rnd(100);
191 }
192 if (base.category.slot != 0)
193 {
194 int num = 0;
195 if (base.rarity == Rarity.Superior)
196 {
197 num = EClass.rnd(3);
198 }
199 else if (base.rarity == Rarity.Legendary)
200 {
201 num = EClass.rnd(4) + 2;
202 }
203 else if (base.rarity == Rarity.Mythical)
204 {
205 num = EClass.rnd(3) + 5;
206 }
207 else if (base.rarity >= Rarity.Artifact)
208 {
209 num = EClass.rnd(2) + 1;
210 }
211 if (num > 0 && !HasTag(CTAG.godArtifact) && !HasTag(CTAG.noRandomEnc))
212 {
213 for (int i = 0; i < num; i++)
214 {
215 AddEnchant(genLv);
216 }
217 }
218 }
219 if (base.IsRangedWeapon && !IsMeleeWithAmmo)
220 {
221 if (HasTag(CTAG.godArtifact))
222 {
223 AddSocket();
224 AddSocket();
225 }
226 else
227 {
228 int num2 = 1;
229 int num3 = ((EClass.rnd(10) == 0) ? 1 : 0);
230 if (base.rarity == Rarity.Superior)
231 {
232 num2 = 2 + num3;
233 }
234 else if (base.rarity == Rarity.Legendary)
235 {
236 num2 = EClass.rnd(2) + 3 + num3;
237 }
238 else if (base.rarity == Rarity.Mythical)
239 {
240 num2 = EClass.rnd(2) + 4 + num3;
241 }
242 else if (base.rarity >= Rarity.Artifact)
243 {
244 num2 = EClass.rnd(2) + 1;
245 }
246 if (num2 > 0)
247 {
248 for (int j = 0; j < num2; j++)
249 {
250 AddSocket();
251 }
252 for (int k = 0; k < EClass.rnd(num2 + 1); k++)
253 {
254 Tuple<SourceElement.Row, int> enchant = GetEnchant(genLv, (SourceElement.Row r) => r.tag.Contains("modRanged"), neg: false);
255 if (enchant != null && InvOwnerMod.IsValidRangedMod(this, enchant.Item1))
256 {
257 ApplySocket(enchant.Item1.id, enchant.Item2);
258 }
259 }
260 }
261 }
262 }
263 if ((bp.rarity != 0 || bp.qualityBonus != 0) && base.rarity < Rarity.Artifact && base.category.tag.Contains("enc"))
264 {
265 int num4 = 0;
266 if (EClass.rnd(6) == 0)
267 {
268 if (bp.qualityBonus == 0)
269 {
270 num4 = EClass.rnd(EClass.rnd(12) + 1);
271 if (num4 == 1 && EClass.rnd(3) != 0)
272 {
273 num4 = 0;
274 }
275 }
276 else if (bp.qualityBonus < 0)
277 {
278 if (EClass.rnd(3) == 0)
279 {
280 num4 = 1;
281 }
282 }
283 else if (bp.qualityBonus >= 10)
284 {
285 num4 = Mathf.Min(bp.qualityBonus / 10 + 2, 7) + EClass.rnd(EClass.rnd(5) + 1);
286 }
287 }
288 if (num4 > 0)
289 {
290 if (num4 > 12)
291 {
292 num4 = 12;
293 }
294 SetEncLv(num4);
295 }
296 }
297 if (HasTag(CTAG.randomSkin))
298 {
299 base.idSkin = EClass.rnd(source.skins.Length + 1);
300 }
301 }
BlessedState? blesstedState
void AddSocket()
Definition: Card.cs:3402
CardBlueprint bp
Definition: Card.cs:73
void ApplySocket(Thing t)
Definition: Card.cs:3411
virtual void SetBlessedState(BlessedState s)
Definition: Card.cs:3740
void SetEncLv(int a)
Definition: Card.cs:3709
bool autoIdentify
Definition: CoreDebug.cs:188
static bool IsValidRangedMod(Thing t, SourceElement.Row row)
Definition: InvOwnerMod.cs:9
Element AddEnchant(int lv=-1)
Definition: Thing.cs:1962
bool IsMeleeWithAmmo
Definition: Thing.cs:20

References AddEnchant(), Card.AddSocket(), Card.ApplySocket(), CoreDebug.autoIdentify, CardBlueprint.blesstedState, Card.bp, EClass.debug, GetEnchant(), Card.HasTag(), Card.id, IsMeleeWithAmmo, InvOwnerMod.IsValidRangedMod(), neg, CardBlueprint.qualityBonus, CardBlueprint.rarity, EClass.rnd(), Card.SetBlessedState(), Card.SetEncLv(), and source.

◆ RemoveEnchant()

void Thing.RemoveEnchant ( )
inline

Definition at line 1976 of file Thing.cs.

1977 {
1978 }

◆ SetRenderParam()

override void Thing.SetRenderParam ( RenderParam  p)
inlinevirtual

Reimplemented from Card.

Definition at line 1418 of file Thing.cs.

1419 {
1420 p.matColor = base.colorInt;
1421 p.mat = base.material;
1422 if (!renderer.usePass)
1423 {
1424 return;
1425 }
1426 switch (trait.tileMode)
1427 {
1428 case Trait.TileMode.DefaultNoAnime:
1429 if (source._altTiles.Length != 0 && trait.UseAltTiles)
1430 {
1431 p.tile = source._altTiles[base.dir % source._altTiles.Length] * ((!flipX) ? 1 : (-1));
1432 }
1433 else
1434 {
1435 p.tile = sourceCard._tiles[base.dir % sourceCard._tiles.Length] * ((!flipX) ? 1 : (-1));
1436 }
1437 break;
1438 case Trait.TileMode.Default:
1439 if (source._altTiles.Length != 0 && trait.UseAltTiles)
1440 {
1441 p.tile = source._altTiles[base.dir % source._altTiles.Length] * ((!flipX) ? 1 : (-1));
1442 }
1443 else
1444 {
1445 p.tile = sourceCard._tiles[base.dir % sourceCard._tiles.Length] * ((!flipX) ? 1 : (-1));
1446 }
1447 if (source.anime.Length == 0 || !trait.IsAnimeOn)
1448 {
1449 break;
1450 }
1451 if (source.anime.Length > 2)
1452 {
1453 float num = Time.realtimeSinceStartup * 1000f / (float)source.anime[1] % (float)source.anime[2];
1454 if ((int)num == source.anime[0] - 1 && source.anime.Length > 3)
1455 {
1456 PlaySound("anime_sound" + source.anime[3]);
1457 }
1458 if (!(num >= (float)source.anime[0]))
1459 {
1460 p.tile += num * (float)((!flipX) ? 1 : (-1));
1461 }
1462 }
1463 else
1464 {
1465 float num2 = Time.realtimeSinceStartup * 1000f / (float)source.anime[1] % (float)source.anime[0];
1466 p.tile += num2 * (float)((!flipX) ? 1 : (-1));
1467 }
1468 break;
1469 case Trait.TileMode.SignalAnime:
1470 if (source._altTiles.Length != 0 && trait.UseAltTiles)
1471 {
1472 p.tile = source._altTiles[base.dir % source._altTiles.Length] * ((!flipX) ? 1 : (-1));
1473 }
1474 else
1475 {
1476 p.tile = sourceCard._tiles[base.dir % sourceCard._tiles.Length] * ((!flipX) ? 1 : (-1));
1477 }
1478 if (animeCounter > 0f && source.anime.Length != 0)
1479 {
1480 animeCounter += Time.deltaTime;
1481 int num3 = (int)(animeCounter / (0.001f * (float)source.anime[1]));
1482 if (num3 > ((source.anime.Length > 2) ? source.anime[2] : source.anime[0]))
1483 {
1484 animeCounter = 0f;
1485 }
1486 else
1487 {
1488 p.tile += num3 % source.anime[0] * ((!flipX) ? 1 : (-1));
1489 }
1490 }
1491 break;
1492 case Trait.TileMode.Illumination:
1493 if (base.isOn || base.isRoofItem)
1494 {
1495 int num4 = (int)((float)base.uid + Time.realtimeSinceStartup * 5f);
1496 int num5 = (int)(Time.realtimeSinceStartup * 5f);
1497 p.tile = (sourceCard._tiles[base.dir % sourceCard._tiles.Length] + num4 % 3 + 1) * ((!flipX) ? 1 : (-1));
1498 if (num5 % 16 == 0)
1499 {
1500 p.color = 5242880f;
1501 }
1502 else if (num5 % 11 == 0)
1503 {
1504 p.color = 7864320f;
1505 }
1506 else
1507 {
1508 p.color = 13107200f;
1509 }
1510 }
1511 else
1512 {
1513 p.tile = sourceCard._tiles[base.dir % sourceCard._tiles.Length] * ((!flipX) ? 1 : (-1));
1514 }
1515 break;
1516 case Trait.TileMode.Door:
1517 if (source._altTiles.Length != 0 && trait.UseAltTiles)
1518 {
1519 p.tile = source._altTiles[base.dir % source._altTiles.Length] * ((!flipX) ? 1 : (-1));
1520 }
1521 else
1522 {
1523 p.tile = sourceCard._tiles[base.dir % sourceCard._tiles.Length] * ((!flipX) ? 1 : (-1));
1524 }
1525 if (parent is Zone && pos.cell.HasFullBlock)
1526 {
1527 p.tile += ((p.tile < 0f) ? (-64) : 64);
1528 }
1529 if (trait is TraitDoorSwing traitDoorSwing && traitDoorSwing.IsOpen())
1530 {
1531 p.tile += ((!(p.tile < 0f)) ? 1 : (-1));
1532 }
1533 break;
1534 }
1535 if (trait.IdSkin != 0)
1536 {
1537 int index = trait.IdSkin - 1;
1538 if (sourceCard.skins.Length != 0)
1539 {
1540 p.tile += ((p.tile < 0f) ? (-sourceCard.skins.TryGet(index)) : sourceCard.skins.TryGet(index));
1541 }
1542 }
1543 }
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:5776
float animeCounter
Definition: Card.cs:69
virtual bool flipX
Definition: Card.cs:2052
bool HasFullBlock
Definition: Cell.cs:817
int[] skins
Definition: RenderRow.cs:14
int[] _tiles
Definition: RenderRow.cs:12
override bool IsOpen()
Definition: Trait.cs:7
virtual TileMode tileMode
Definition: Trait.cs:429
virtual bool UseAltTiles
Definition: Trait.cs:431
TileMode
Definition: Trait.cs:9
virtual int IdSkin
Definition: Trait.cs:44
virtual bool IsAnimeOn
Definition: Trait.cs:368

References SourceThing.Row._altTiles, RenderRow._tiles, SourceThing.Row.anime, TraitDoorSwing.IsOpen(), and RenderRow.skins.

Referenced by BaseTileMap.DrawTile(), TileMapElona.DrawTile(), and CharaActorPCC.OnRender().

◆ SetSource()

override void Thing.SetSource ( )
inlinevirtual

Reimplemented from Card.

Definition at line 146 of file Thing.cs.

147 {
148 source = EClass.sources.things.map.TryGetValue(id);
149 if (source != null && source.isOrigin)
150 {
152 id = source.id;
153 }
154 if (source == null)
155 {
156 Debug.LogWarning("Thing " + id + " not found");
157 id = "ash3";
159 }
160 }
Dictionary< string, CardRow > firstVariations
Definition: SourceCard.cs:10
SourceCard cards
SourceThing things

References SourceManager.cards, Debug, SourceCard.firstVariations, Card.id, source, EClass.sources, and SourceManager.things.

◆ ShowSplitMenu()

void Thing.ShowSplitMenu ( ButtonGrid  button,
InvOwner::Transaction  trans = null 
)
inline

Definition at line 1716 of file Thing.cs.

1717 {
1718 int count = 1;
1719 UIContextMenu i = EClass.ui.CreateContextMenuInteraction();
1720 bool buy = trans != null;
1721 UIButton buttonBuy = null;
1722 UIItem itemSlider = null;
1723 itemSlider = i.AddSlider("sliderSplitMenu", "adjustmentNum", (float a) => (!EClass.core.IsGameStarted) ? "" : ("/" + base.Num), count, delegate(float b)
1724 {
1725 count = (int)b;
1726 if (trans != null)
1727 {
1728 trans.num = count;
1729 }
1730 UpdateButton();
1731 }, 1f, base.Num, isInt: true, hideOther: false, useInput: true).GetComponent<UIItem>();
1732 if (buy)
1733 {
1734 buttonBuy = i.AddButton("invBuy", delegate
1735 {
1736 Process();
1737 });
1738 }
1739 i.onDestroy = delegate
1740 {
1741 if (!buy && !i.wasCanceled)
1742 {
1743 Process();
1744 }
1745 };
1746 i.Show();
1747 if ((bool)buttonBuy)
1748 {
1749 buttonBuy.gameObject.AddComponent<CanvasGroup>();
1750 }
1751 UpdateButton();
1752 void Process()
1753 {
1754 if (!EClass.core.IsGameStarted || button == null || button.card == null)
1755 {
1756 Debug.Log("Split bug1");
1757 }
1758 else if (button.card.isDestroyed || button.card.Num < count)
1759 {
1760 Debug.Log("Split bug2");
1761 }
1762 else if (EClass.pc.isDead)
1763 {
1764 Debug.Log("Split bug3");
1765 }
1766 else if (count != 0 && !Input.GetMouseButton(1))
1767 {
1768 if (trans != null)
1769 {
1770 trans.Process(startTransaction: true);
1771 }
1772 else
1773 {
1774 DragItemCard dragItemCard = new DragItemCard(button);
1775 if (count != base.Num)
1776 {
1777 Thing thing = button.card.Split(base.Num - count);
1778 button.invOwner.Container.AddThing(thing, tryStack: false);
1779 thing.invX = dragItemCard.from.invX;
1780 thing.invY = dragItemCard.from.invY;
1781 thing.posInvX = button.card.Thing.posInvX;
1782 thing.posInvY = button.card.Thing.posInvY;
1783 }
1784 EClass.ui.StartDrag(dragItemCard);
1785 }
1786 }
1787 }
1788 void UpdateButton()
1789 {
1790 itemSlider.text1.text = GetName(NameStyle.FullNoArticle, 1);
1791 itemSlider.text2.text = Lang._weight(SelfWeight * count);
1792 if ((bool)buttonBuy)
1793 {
1794 buttonBuy.mainText.SetText(trans.GetTextDetail());
1795 buttonBuy.mainText.RebuildLayoutTo<UIButton>();
1796 buttonBuy.interactable = trans.IsValid();
1797 buttonBuy.RebuildLayout(recursive: true);
1798 buttonBuy.gameObject.GetComponent<CanvasGroup>().alpha = (trans.IsValid() ? 1f : 0.9f);
1799 }
1800 }
1801 }
Card card
Definition: ButtonGrid.cs:24
InvOwner invOwner
Definition: ButtonGrid.cs:28
int posInvY
Definition: Card.cs:334
Thing Split(int a)
Definition: Card.cs:3345
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:3020
virtual Thing Thing
Definition: Card.cs:1994
int posInvX
Definition: Card.cs:322
bool isDead
Definition: Chara.cs:385
DragInfo from
Definition: DragItemCard.cs:54
static UI ui
Definition: EClass.cs:16
string GetTextDetail()
Definition: InvOwner.cs:447
bool Process(bool startTransaction=false)
Definition: InvOwner.cs:135
Card Container
Definition: InvOwner.cs:535
void Show(UIItem i)
UIContextMenuItem AddSlider(string text, Func< float, string > textFunc, float value, Action< float > action, float min=0f, float max=1f, bool isInt=false, bool hideOther=true, bool useInput=false)
void AddButton(Func< string > funcText, UnityAction action=null)
Definition: UIItem.cs:5

References Lang._weight(), UIContextMenu.AddButton(), UIContextMenu.AddSlider(), Card.AddThing(), ButtonGrid.card, InvOwner.Container, EClass.core, Debug, DragItemCard.from, ButtonGrid.invOwner, DragItemCard.DragInfo.invX, DragItemCard.DragInfo.invY, Chara.isDead, Card.isDestroyed, Core.IsGameStarted, Card.Num, EClass.pc, Card.posInvX, Card.posInvY, UIContextMenu.Show(), Card.Split(), Card.Thing, EClass.ui, and UIContextMenu.wasCanceled.

Referenced by InvOwner.OnCtrlClick().

◆ ShowSplitMenu2()

void Thing.ShowSplitMenu2 ( ButtonGrid  button,
string  lang,
Action< int >  onSplit = null 
)
inline

Definition at line 1803 of file Thing.cs.

1804 {
1805 int count = 1;
1806 UIContextMenu uIContextMenu = EClass.ui.CreateContextMenuInteraction();
1807 UIButton buttonBuy = null;
1808 UIItem itemSlider = null;
1809 itemSlider = uIContextMenu.AddSlider("sliderSplitMenu", "adjustmentNum", (float a) => (!EClass.core.IsGameStarted) ? "" : ("/" + base.Num), count, delegate(float b)
1810 {
1811 count = (int)b;
1812 UpdateButton();
1813 }, 1f, base.Num, isInt: true, hideOther: false, useInput: true).GetComponent<UIItem>();
1814 buttonBuy = uIContextMenu.AddButton("invBuy", delegate
1815 {
1816 Process();
1817 });
1818 uIContextMenu.onDestroy = delegate
1819 {
1820 };
1821 uIContextMenu.Show();
1822 if ((bool)buttonBuy)
1823 {
1824 buttonBuy.gameObject.AddComponent<CanvasGroup>();
1825 }
1826 UpdateButton();
1827 void Process()
1828 {
1829 if (!EClass.core.IsGameStarted || button == null || button.card == null)
1830 {
1831 Debug.Log("Split bug1");
1832 }
1833 else if (button.card.isDestroyed || button.card.Num < count)
1834 {
1835 Debug.Log("Split bug2");
1836 }
1837 else if (EClass.pc.isDead)
1838 {
1839 Debug.Log("Split bug3");
1840 }
1841 else if (count != 0 && !Input.GetMouseButton(1))
1842 {
1843 onSplit?.Invoke(count);
1844 }
1845 }
1846 void UpdateButton()
1847 {
1848 itemSlider.text1.text = GetName(NameStyle.FullNoArticle, 1);
1849 itemSlider.text2.text = Lang._weight(SelfWeight * count);
1850 buttonBuy.mainText.SetText(lang.lang(count.ToString() ?? ""));
1851 buttonBuy.mainText.RebuildLayoutTo<UIButton>();
1852 buttonBuy.interactable = true;
1853 buttonBuy.RebuildLayout(recursive: true);
1854 }
1855 }
UIText mainText
Definition: UIButton.cs:102
void SetText(string s)
Definition: UIText.cs:159

References Lang._weight(), UIContextMenu.AddButton(), UIContextMenu.AddSlider(), ButtonGrid.card, EClass.core, Debug, Chara.isDead, Card.isDestroyed, Core.IsGameStarted, UIButton.mainText, Card.Num, EClass.pc, UIText.SetText(), UIContextMenu.Show(), and EClass.ui.

Referenced by UIDragGridIngredients.Update().

◆ TryLickEnchant()

void Thing.TryLickEnchant ( Chara  c,
bool  msg = true,
Chara  tg = null,
BodySlot  slot = null 
)
inline

Definition at line 1913 of file Thing.cs.

1914 {
1915 if (!base.IsEquipment || base.IsCursed || base.rarity <= Rarity.Normal || GetInt(107) > 0)
1916 {
1917 return;
1918 }
1919 SetInt(107, 1);
1920 if (tg == null)
1921 {
1922 Rand.SetSeed(EClass.world.date.day + source._index + c.uid);
1923 if (msg)
1924 {
1925 c.Say("lick", c, this);
1926 PlaySound("offering");
1927 PlayEffect("mutation");
1928 }
1929 Element element = AddEnchant(base.LV);
1930 if (element != null)
1931 {
1932 SetInt(107, element.id);
1933 }
1934 }
1935 else
1936 {
1937 Rand.SetSeed(base.uid);
1938 List<Element> list = new List<Element>();
1939 foreach (Element value in elements.dict.Values)
1940 {
1941 if (value.id != 67 && value.id != 66 && value.id != 64 && value.id != 65)
1942 {
1943 list.Add(value);
1944 }
1945 }
1946 if (list.Count > 0)
1947 {
1948 Element element2 = list.RandomItem();
1949 elements.ModBase(element2.id, Mathf.Max(EClass.rnd(Mathf.Abs(element2.vBase / 5)), 1));
1950 SetInt(107, element2.id);
1951 }
1952 if (msg)
1953 {
1954 c.Say("lick2", c, tg, slot.name.ToLower());
1955 tg.PlaySound("offering");
1956 tg.PlayEffect("mutation");
1957 }
1958 }
1959 Rand.SetSeed();
1960 }
void SetInt(int id, int value=0)
Definition: BaseCard.cs:39
string name
Definition: BodySlot.cs:14
int uid
Definition: Card.cs:118
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:5810
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:6423
int day
Definition: Date.cs:62
static World world
Definition: EClass.cs:40
static void SetSeed(int a=-1)
Definition: Rand.cs:37
GameDate date
Definition: World.cs:6

References SourceData< T, T2 >.BaseRow._index, World.date, Date.day, Element.id, BodySlot.name, EClass.rnd(), Card.Say(), Rand.SetSeed(), Card.uid, Element.vBase, and EClass.world.

Referenced by Card.SpawnLoot(), and ThingGen.TryLickChest().

◆ WriteNote()

override void Thing.WriteNote ( UINote  n,
Action< UINote onWriteNote = null,
IInspect::NoteMode  mode = IInspect::NoteMode::Default,
Recipe  recipe = null 
)
inlinevirtual

Reimplemented from Card.

Definition at line 841 of file Thing.cs.

842 {
843 if (sourceCard._origin == "dish")
844 {
846 }
847 n.Clear();
848 string text2 = "";
849 TraitAbility traitAbility = trait as TraitAbility;
850 bool showEQStats = base.IsEquipmentOrRangedOrAmmo;
851 bool flag = mode == IInspect.NoteMode.Product;
852 bool flag2 = base.IsIdentified || flag;
853 text2 = base.Name;
854 if (base.rarity == Rarity.Legendary || base.rarity == Rarity.Mythical)
855 {
856 string text3 = (text2.Contains("『") ? "『" : (text2.Contains("《") ? "《" : ""));
857 if (text3 != "")
858 {
859 string[] array = text2.Split(text3);
860 text2 = array[0] + Environment.NewLine + text3 + array[1];
861 }
862 }
863 if (flag)
864 {
865 if (!(trait is TraitPotionAlchemy))
866 {
867 text2 = recipe.GetName();
868 }
869 if (trait.CraftNum > 1)
870 {
871 text2 = text2 + " x " + trait.CraftNum;
872 }
873 }
874 if (mode != IInspect.NoteMode.Recipe)
875 {
876 if (trait is TraitAbility)
877 {
878 EClass.pc.elements.GetOrCreateElement((trait as TraitAbility).act.id).AddHeaderAbility(n);
879 }
880 else
881 {
882 UIItem uIItem = n.AddHeaderCard(text2);
883 SetImage(uIItem.image2);
884 uIItem.image2.Rect().pivot = new Vector2(0.5f, 0.5f);
885 string text4 = base.Num.ToFormat() ?? "";
886 string text5 = (Mathf.Ceil(0.01f * (float)base.ChildrenAndSelfWeight) * 0.1f).ToString("F1") + "s";
887 if (things.Count > 0)
888 {
889 text4 = text4 + " (" + things.Count + ")";
890 }
891 if (base.ChildrenAndSelfWeight != SelfWeight)
892 {
893 text5 = text5 + " (" + (Mathf.Ceil(0.01f * (float)SelfWeight) * 0.1f).ToString("F1") + "s)";
894 }
895 text2 = "_quantity".lang(text4 ?? "", text5);
896 if (flag && recipe != null && (bool)LayerCraft.Instance)
897 {
898 text2 = text2 + " " + "_recipe_lv".lang(recipe.RecipeLv.ToString() ?? "");
899 }
900 uIItem.text2.SetText(text2);
901 if (showEQStats && flag2)
902 {
903 text2 = "";
904 if (DV != 0 || PV != 0 || base.HIT != 0 || base.DMG != 0 || Penetration != 0)
905 {
906 if (base.DMG != 0)
907 {
908 text2 = text2 + "DMG".lang() + ((base.DMG > 0) ? "+" : "") + base.DMG + ", ";
909 }
910 if (base.HIT != 0)
911 {
912 text2 = text2 + "HIT".lang() + ((base.HIT > 0) ? "+" : "") + base.HIT + ", ";
913 }
914 if (DV != 0)
915 {
916 text2 = text2 + "DV".lang() + ((DV > 0) ? "+" : "") + DV + ", ";
917 }
918 if (PV != 0)
919 {
920 text2 = text2 + "PV".lang() + ((PV > 0) ? "+" : "") + PV + ", ";
921 }
922 if (Penetration != 0)
923 {
924 text2 = text2 + "PEN".lang() + ((Penetration > 0) ? "+" : "") + Penetration + "%, ";
925 }
926 text2 = text2.TrimEnd(' ').TrimEnd(',');
927 }
928 if (!text2.IsEmpty())
929 {
930 n.AddText("NoteText_eqstats", text2);
931 }
932 if (trait is TraitToolRange traitToolRange)
933 {
934 n.AddText("NoteText_eqstats", "tip_range".lang(traitToolRange.BestDist.ToString() ?? ""));
935 }
936 }
937 else
938 {
939 string text6 = "";
941 {
942 int totalQuality = GetTotalQuality();
943 int totalQuality2 = GetTotalQuality(applyBonus: false);
944 text6 = text6 + "Lv. " + base.LV + " TQ. " + GetTotalQuality() + ((totalQuality == totalQuality2) ? "" : (" (" + totalQuality2 + ")"));
945 }
946 if (HasElement(10))
947 {
948 text6 = text6 + (text6.IsEmpty() ? "" : " ") + "_nutrition".lang(Evalue(10).ToFormat() ?? "");
949 }
950 if ((base.category.IsChildOf("throw") || base.category.IsChildOf("resource") || trait.IsTool) && !(trait is TraitAbility))
951 {
952 text6 = text6 + (text6.IsEmpty() ? "" : " ") + "_hardness".lang(base.material.hardness.ToString() ?? "");
953 }
954 if (flag && recipe != null && (bool)LayerCraft.Instance)
955 {
956 text6 = text6 + (text6.IsEmpty() ? "" : " ") + "_max_quality".lang(recipe.GetQualityBonus().ToString() ?? "");
957 }
958 if (!text6.IsEmpty())
959 {
960 n.AddText("NoteText_eqstats", text6);
961 }
962 }
963 }
964 string detail = GetDetail();
965 if (!detail.IsEmpty())
966 {
967 LayoutElement component = n.AddText("NoteText_flavor", detail).GetComponent<LayoutElement>();
968 if (flag)
969 {
970 component.preferredWidth = 400f;
971 }
972 n.Space(8);
973 }
974 }
975 if (trait is TraitBookPlan)
976 {
977 TraitBookPlan traitBookPlan = trait as TraitBookPlan;
978 n.AddText("NoteText_flavor", traitBookPlan.source.GetDetail());
979 n.Space(8);
980 }
981 if (traitAbility != null)
982 {
983 n.Space(8);
984 Act act = traitAbility.CreateAct();
985 Element orCreateElement = EClass.pc.elements.GetOrCreateElement(act.source.id);
986 orCreateElement._WriteNote(n, EClass.pc.elements, null, isRef: false, addHeader: false);
987 orCreateElement._WriteNote(n, EClass.pc, act);
988 return;
989 }
991 {
992 n.AddText("(id:" + id + " tile:" + (source.tiles.IsEmpty() ? "-" : ((object)source.tiles[0]))?.ToString() + ") lv:" + base.LV + " price:" + GetPrice());
993 }
994 Card rootCard = GetRootCard();
995 if (rootCard != null && rootCard != EClass.pc && rootCard != this && rootCard.ExistsOnMap && !((parent as Thing)?.trait is TraitChestMerchant))
996 {
997 n.AddText("isChildOf".lang(GetRootCard().Name), FontColor.ItemName);
998 }
999 if (flag2)
1000 {
1001 AddTextWithIcon("isMadeOf".lang(base.material.GetText(), base.material.hardness.ToString() ?? ""), EClass.core.refs.icons.enc.mat, FontColor.Default);
1002 }
1003 AddText("isCategorized".lang(base.category.GetText()), FontColor.Default);
1004 if (base.category.skill != 0)
1005 {
1006 int key = base.category.skill;
1007 int key2 = 132;
1008 if (base.IsRangedWeapon && !base.IsMeleeWeapon)
1009 {
1010 key2 = 133;
1011 }
1013 {
1014 key2 = 304;
1015 }
1016 if (Evalue(482) > 0)
1017 {
1018 key = 305;
1019 key2 = 304;
1020 }
1021 AddText("isUseSkill".lang(EClass.sources.elements.map[key].GetName().ToTitleCase(wholeText: true), EClass.sources.elements.map[key2].GetName().ToTitleCase(wholeText: true)), FontColor.Default);
1022 }
1023 if (base.IsContainer)
1024 {
1025 AddText("isContainer".lang(things.MaxCapacity.ToString() ?? ""), FontColor.Default);
1026 }
1027 if (base.c_lockLv != 0)
1028 {
1029 AddText((base.c_lockedHard ? "isLockedHard" : "isLocked").lang(base.c_lockLv.ToString() ?? ""), FontColor.Warning);
1030 }
1031 if (base.isCrafted && recipe == null)
1032 {
1033 AddText("isCrafted".lang(), FontColor.Default);
1034 }
1035 if (trait.Decay > 0)
1036 {
1037 string text7 = "";
1038 text7 = (base.IsDecayed ? "isRotten" : (base.IsRotting ? "isRotting" : ((!base.IsFresn) ? "isNotFresh" : "isFresh")));
1039 AddText(text7.lang(), FontColor.Default);
1040 }
1041 if (base.isDyed)
1042 {
1043 AddText("isDyed".lang(base.DyeMat.GetName() ?? ""), FontColor.Default);
1044 }
1045 if (base.IsEquipment)
1046 {
1047 text2 = "isEquipable".lang(Element.Get(base.category.slot).GetText());
1048 AddText(text2, FontColor.Default);
1049 }
1050 if (base.isFireproof)
1051 {
1052 AddText("isFreproof", FontColor.Default);
1053 }
1054 if (base.isAcidproof)
1055 {
1056 AddText("isAcidproof", FontColor.Default);
1057 }
1058 if (trait.Electricity > 0)
1059 {
1060 AddText("isGenerateElectricity".lang(trait.Electricity.ToString() ?? ""), FontColor.Default);
1061 }
1062 if (trait.Electricity < 0)
1063 {
1064 AddText("isConsumeElectricity".lang(Mathf.Abs(trait.Electricity).ToString() ?? ""), FontColor.Default);
1065 }
1066 if (base.IsUnique)
1067 {
1068 AddText("isPrecious", FontColor.Default);
1069 }
1070 if (base.isCopy)
1071 {
1072 AddText("isCopy", FontColor.Default);
1073 }
1074 if (flag && HasTag(CTAG.noMix))
1075 {
1076 AddText("isNoMix", FontColor.Default);
1077 }
1079 {
1080 AddText("isNoProcessIng", FontColor.Default);
1081 }
1082 if (!trait.CanBeDestroyed)
1083 {
1084 AddText("isIndestructable", FontColor.Default);
1085 }
1086 if (GetInt(107) > 0)
1087 {
1088 AddText("isLicked", FontColor.Great);
1089 }
1090 if (HasRune())
1091 {
1092 AddTextWithIcon("isRuneAdded", EClass.core.refs.icons.enc.rune, FontColor.Great);
1093 }
1094 if (!base.c_idDeity.IsEmpty())
1095 {
1097 AddText("isDeity".lang(religion.Name), FontColor.Myth);
1098 }
1099 if (base.isGifted && GetRoot() != EClass.pc)
1100 {
1101 AddText("isGifted", FontColor.Ether);
1102 }
1103 if (base.isNPCProperty)
1104 {
1105 AddText("isNPCProperty", FontColor.Ether);
1106 }
1107 if (base.c_priceFix != 0)
1108 {
1109 AddText(((base.c_priceFix > 0) ? "isPriceUp" : "isPriceDown").lang(Mathf.Abs(base.c_priceFix).ToString() ?? ""), FontColor.Ether);
1110 }
1111 if (base.noSell)
1112 {
1113 AddText("isNoSell", FontColor.Ether);
1114 }
1116 {
1117 AddText("isOnlyUsableByPC", FontColor.Ether);
1118 }
1119 if (base.isStolen)
1120 {
1121 AddText("isStolen", FontColor.Ether);
1122 }
1123 if (base.c_isImportant)
1124 {
1125 AddText("isMarkedImportant", FontColor.Ether);
1126 }
1127 if (GetInt(25) != 0)
1128 {
1129 AddText("isDangerLv".lang((GetInt(25) + 1).ToString() ?? "", (EClass.pc.FameLv + 10).ToString() ?? ""), FontColor.Default);
1130 }
1131 FontColor col2 = FontColor.Util;
1132 if (trait is TraitTool && !(trait is TraitToolRange))
1133 {
1134 if (HasElement(220))
1135 {
1136 AddText("canMine".lang(), col2);
1137 }
1138 if (HasElement(225))
1139 {
1140 AddText("canLumberjack".lang(), col2);
1141 AddText("canLumberjack2".lang(), col2);
1142 }
1143 if (HasElement(230))
1144 {
1145 AddText("canDig", col2);
1146 }
1147 if (HasElement(286))
1148 {
1149 AddText("canFarm", col2);
1150 }
1151 if (HasElement(245))
1152 {
1153 AddText("canFish", col2);
1154 }
1155 if (HasElement(237))
1156 {
1157 AddText("canTame", col2);
1158 }
1159 }
1160 if (trait is TraitToolMusic)
1161 {
1162 AddText("canPlayMusic".lang(), col2);
1163 }
1164 if (Lang.Has("hint_" + trait.ToString()))
1165 {
1166 AddText("hint_" + trait.ToString(), FontColor.Util);
1167 }
1168 if (Lang.Has("hint_" + trait.ToString() + "2"))
1169 {
1170 AddText("hint_" + trait.ToString() + "2", FontColor.Util);
1171 }
1172 if (HasTag(CTAG.tourism))
1173 {
1174 AddText("isTourism", FontColor.Util);
1175 }
1176 string langPlaceType = base.TileType.LangPlaceType;
1177 if (langPlaceType == "place_Door" || langPlaceType == "place_WallMount")
1178 {
1179 AddText(base.TileType.LangPlaceType + "_hint".lang(), FontColor.Util);
1180 }
1181 if (trait.IsHomeItem)
1182 {
1183 AddText("isHomeItem".lang(), FontColor.Util);
1184 }
1185 if (HasTag(CTAG.throwWeapon))
1186 {
1187 AddText("isThrowWeapon", FontColor.Default);
1188 }
1189 if (EClass.debug.showExtra && HasTag(CTAG.throwWeaponEnemy))
1190 {
1191 AddText("isThrowWeaponEnemy", FontColor.Default);
1192 }
1193 if (HasElement(10))
1194 {
1195 AddText("isEdible", FontColor.Default);
1196 }
1197 if (HasTag(CTAG.rareResource))
1198 {
1199 AddText("isRareResource", FontColor.Great);
1200 }
1201 if (trait is TraitBed traitBed)
1202 {
1203 AddText("isBed".lang(traitBed.MaxHolders.ToString() ?? ""), FontColor.Default);
1204 }
1205 bool flag3 = base.IsEquipmentOrRangedOrAmmo || base.IsThrownWeapon;
1206 bool showTraits = !flag3 || base.ShowFoodEnc;
1207 bool infoMode = mode == IInspect.NoteMode.Info;
1208 List<Element> listTrait = ListValidTraits(isCraft: false, !infoMode);
1209 List<Element> list = ListValidTraits(isCraft: false, limit: false);
1210 if (list.Count - listTrait.Count <= 1)
1211 {
1212 listTrait = list;
1213 }
1214 if (flag2)
1215 {
1216 Element element = elements.GetElement(653);
1217 if (element != null)
1218 {
1219 AddText("isAlive".lang(element.vBase.ToString() ?? "", (element.vExp / 10).ToString() ?? "", (element.ExpToNext / 10).ToString() ?? ""), FontColor.Great);
1220 }
1221 if (flag3)
1222 {
1223 string[] rangedSubCats = new string[2] { "eleConvert", "eleAttack" };
1224 elements.AddNote(n, delegate(Element e)
1225 {
1226 if (trait is TraitToolRange && base.category.slot == 0 && !(e is Ability) && !rangedSubCats.Contains(e.source.categorySub) && !e.HasTag("modRanged"))
1227 {
1228 return false;
1229 }
1230 if (e.IsTrait || (showTraits && listTrait.Contains(e)))
1231 {
1232 return false;
1233 }
1234 if (e.source.categorySub == "eleAttack" && !base.IsWeapon && !base.IsRangedWeapon && !base.IsAmmo && !base.IsThrownWeapon)
1235 {
1236 return false;
1237 }
1238 return (!showEQStats || (e.id != 64 && e.id != 65 && e.id != 66 && e.id != 67)) ? true : false;
1239 }, null, ElementContainer.NoteMode.Default, addRaceFeat: false, (Element e, string s) => (mode != IInspect.NoteMode.Info) ? s : (s + " (" + e.Value + ")"));
1240 }
1241 if (sockets != null)
1242 {
1243 foreach (int socket in sockets)
1244 {
1245 AddText((socket == 0) ? "emptySocket".lang() : "socket".lang(EClass.sources.elements.map[socket / 100].GetName(), (socket % 100).ToString() ?? ""), FontColor.Gray);
1246 }
1247 }
1248 }
1249 trait.WriteNote(n, flag2);
1250 if (flag2 && showTraits)
1251 {
1252 elements.AddNote(n, (Element e) => listTrait.Contains(e), null, ElementContainer.NoteMode.BonusTrait, addRaceFeat: false, delegate(Element e, string s)
1253 {
1254 string text12 = s;
1255 string text13 = e.source.GetText("textExtra");
1256 if (!text13.IsEmpty())
1257 {
1258 string text14 = "";
1259 if (e.id == 2 && mode == IInspect.NoteMode.Product)
1260 {
1261 int num2 = recipe.GetQualityBonus() / 10;
1262 if (num2 >= 0)
1263 {
1264 num2++;
1265 }
1266 text14 = "qualityLimit".lang(num2.ToString() ?? "");
1267 }
1268 int num3 = e.Value / 10;
1269 num3 = ((e.Value < 0) ? (num3 - 1) : (num3 + 1));
1270 text13 = "Lv." + num3 + text14 + " " + text13;
1271 if (infoMode && e.IsFoodTraitMain)
1272 {
1273 text13 += "traitAdditive".lang();
1274 }
1275 text12 += (" <size=12>" + text13 + "</size>").TagColor(FontColor.Passive);
1276 }
1277 return text12;
1278 }, delegate
1279 {
1280 });
1281 if (listTrait.Count != list.Count)
1282 {
1283 AddText("traitOther".lang((list.Count - listTrait.Count).ToString() ?? ""), FontColor.Default);
1284 }
1285 }
1286 if (!flag2)
1287 {
1288 AddText("isUnidentified".lang(), FontColor.Flavor);
1289 if (base.c_IDTState == 1)
1290 {
1291 AddText("isUnidentified2".lang(), FontColor.Flavor);
1292 }
1293 }
1294 if (mode == IInspect.NoteMode.Product && HasCraftBonusTrait())
1295 {
1296 n.AddHeader("HeaderAdditionalTrait", "additional_trait");
1297 foreach (Element item in ListCraftBonusTraits())
1298 {
1299 item.AddEncNote(n, this, ElementContainer.NoteMode.BonusTrait, delegate(Element e, string s)
1300 {
1301 string text9 = s;
1302 string text10 = e.source.GetText("textExtra");
1303 if (!text10.IsEmpty())
1304 {
1305 string text11 = "";
1306 int num = e.Value / 10;
1307 num = ((e.Value < 0) ? (num - 1) : (num + 1));
1308 text10 = "Lv." + num + text11 + " " + text10;
1309 if (infoMode && e.IsFoodTraitMain)
1310 {
1311 text10 += "traitAdditive".lang();
1312 }
1313 text9 += (" <size=12>" + text10 + "</size>").TagColor(FontColor.Passive);
1314 }
1315 return text9;
1316 });
1317 }
1318 }
1320 {
1321 n.AddText("decay:" + base.decay);
1322 n.AddText(base.isDyed + "/" + id + "/" + base.refVal + "/" + base.LV + "/" + trait);
1323 if (source.origin != null)
1324 {
1325 n.AddText(source.origin.id);
1326 }
1327 }
1328 if (id == "statue_weird")
1329 {
1330 AddText("weirdStatue", FontColor.Default);
1331 }
1332 if (base.isReplica)
1333 {
1334 AddText("isReplica", FontColor.Passive);
1335 }
1336 if (flag2 && mode != IInspect.NoteMode.Product)
1337 {
1338 Chara chara = GetRootCard() as Chara;
1340 {
1341 chara = null;
1342 }
1343 if (base.c_equippedSlot != 0 && base.category.slot == 35 && chara != null)
1344 {
1345 AddAttackEvaluation(n, chara, this);
1346 }
1347 if (base.IsThrownWeapon || base.IsRangedWeapon || (base.IsMeleeWeapon && base.c_equippedSlot == 0))
1348 {
1349 n.AddHeader("headerAttackEval");
1350 AttackProcess.Current.Prepare(chara ?? EClass.pc, this, null, null, 0, base.IsThrownWeapon);
1351 string text8 = AttackProcess.Current.GetText();
1352 text8 = text8.TagColor(() => true);
1353 n.AddText(text8);
1354 }
1355 }
1356 if (base.ammoData != null)
1357 {
1358 n.AddHeader("headerAttackAmmo");
1359 n.AddText(base.ammoData.Name);
1360 }
1361 onWriteNote?.Invoke(n);
1362 if (mode == IInspect.NoteMode.Product && base.IsEquipmentOrRangedOrAmmo)
1363 {
1364 AddText("isProductWarning", FontColor.Default);
1365 }
1366 if ((bool)LayerDragGrid.Instance)
1367 {
1369 }
1371 {
1372 foreach (Element value in elements.dict.Values)
1373 {
1374 n.AddText(value.source.alias + "/" + value.Value + "/" + value.vBase + "/" + value.vSource);
1375 }
1376 }
1377 n.Build();
1378 void AddText(string text, FontColor col)
1379 {
1380 n.AddText("NoteText_enc", text, col);
1381 }
1382 void AddTextWithIcon(string text, Sprite sprite, FontColor col)
1383 {
1384 UIItem uIItem2 = n.AddText("NoteText_enc", text, col);
1385 uIItem2.image1.SetActive(enable: true);
1386 uIItem2.image1.sprite = sprite;
1387 }
1388 }
FontColor
Definition: FontColor.cs:2
string _origin
Definition: CardRow.cs:15
int FameLv
Definition: Card.cs:2234
bool HasRune()
Definition: Card.cs:3576
ICardParent GetRoot()
Definition: Card.cs:3278
bool IsThrownWeapon
Definition: Card.cs:2181
virtual string GetDetail()
Definition: Card.cs:2561
string Name
Definition: Card.cs:2073
bool ExistsOnMap
Definition: Card.cs:2021
bool HasCraftBonusTrait()
Definition: Card.cs:6561
int Evalue(int ele)
Definition: Card.cs:2507
void CheckJustCooked()
Definition: Card.cs:6229
Card parentCard
Definition: Card.cs:99
void SetImage(Image image, int dir, int idSkin=0)
Definition: Card.cs:5727
List< Element > ListCraftBonusTraits()
Definition: Card.cs:6566
int GetTotalQuality(bool applyBonus=true)
Definition: Card.cs:3681
Icons icons
Definition: CoreRef.cs:345
CoreRef refs
Definition: Core.cs:51
void AddNote(UINote n, Func< Element, bool > isValid=null, Action onAdd=null, NoteMode mode=NoteMode.Default, bool addRaceFeat=false, Func< Element, string, string > funcText=null, Action< UINote, Element > onAddNote=null)
Element GetOrCreateElement(Element ele)
int vExp
Definition: ELEMENT.cs:252
void _WriteNote(UINote n, Chara c, Act act)
Definition: ELEMENT.cs:604
static SourceElement.Row Get(int id)
Definition: ELEMENT.cs:399
bool HasTag(string tag)
Definition: ELEMENT.cs:471
int vSource
Definition: ELEMENT.cs:260
virtual int ExpToNext
Definition: ELEMENT.cs:306
ReligionManager religions
Definition: Game.cs:158
virtual void OnWriteNote(Thing t, UINote n)
static bool Has(string id)
Definition: Lang.cs:100
static LayerCraft Instance
Definition: LayerCraft.cs:8
InvOwnerDraglet owner
static LayerDragGrid Instance
int RecipeLv
Definition: Recipe.cs:223
int GetQualityBonus()
Definition: Recipe.cs:380
string GetName()
Definition: Recipe.cs:760
Religion Find(string id)
ReligionEyth Eyth
int Penetration
Definition: Thing.cs:34
static void AddAttackEvaluation(UINote n, Chara chara, Thing current=null)
Definition: Thing.cs:1390
List< Element > ListValidTraits(bool isCraft, bool limit)
Definition: Thing.cs:816
override Act CreateAct()
Definition: TraitAbility.cs:13
override SourceElement.Row source
virtual bool Contains(RecipeSource r)
Definition: Trait.cs:571
virtual void WriteNote(UINote n, bool identified)
Definition: Trait.cs:942
virtual bool IsTool
Definition: Trait.cs:361
virtual bool CanBeDestroyed
Definition: Trait.cs:289
virtual int CraftNum
Definition: Trait.cs:131
virtual bool IsOnlyUsableByPc
Definition: Trait.cs:68
virtual bool IsHomeItem
Definition: Trait.cs:249
virtual int Electricity
Definition: Trait.cs:101
virtual int Decay
Definition: Trait.cs:119
Image image2
Definition: UIItem.cs:16
Image image1
Definition: UIItem.cs:14
UIText text2
Definition: UIItem.cs:8
UIItem AddHeaderCard(string text, Sprite sprite=null)
Definition: UINote.cs:84
void Clear()
Definition: UINote.cs:35
void Space(int sizeY=0, int sizeX=1)
Definition: UINote.cs:62
void Build()
Definition: UINote.cs:49
NoteMode
Definition: IInspect.cs:7

References CardRow._origin, Element._WriteNote(), UINote.AddHeaderCard(), UINote.AddText(), UINote.Clear(), Trait.Contains(), EClass.core, TraitAbility.CreateAct(), EClass.debug, Card.elements, SourceManager.elements, CoreRef.Icons.enc, Card.ExistsOnMap, Element.ExpToNext, ReligionManager.Eyth, Card.FameLv, ReligionManager.Find(), EClass.game, Element.Get(), ElementContainer.GetOrCreateElement(), Lang.Has(), Element.HasTag(), CoreRef.icons, Element.id, if(), UIItem.image2, LayerCraft.Instance, Element.IsFoodTraitMain, Element.IsTrait, CoreRef.Icons.Enc.mat, EClass.pc, Core.refs, religion, Game.religions, CoreRef.Icons.Enc.rune, UIText.SetText(), CoreDebug.showExtra, Element.source, TraitBookSkill.source, EClass.sources, UINote.Space(), UIItem.text2, RenderRow.tiles, Element.Value, Element.vBase, and Element.vExp.

Referenced by DramaCustomSequence.Build(), WindowCharaMini.RefreshEquipment(), WindowChara.RefreshEquipment(), LayerCraft.RefreshProduct(), GridItemCardSource.SetButton(), and UICardInfo.SetThing().

Member Data Documentation

◆ MaxFurnitureEnc

const int Thing.MaxFurnitureEnc = 12
static

Definition at line 9 of file Thing.cs.

◆ source

◆ stackOrder

int Thing.stackOrder

Definition at line 13 of file Thing.cs.

Referenced by Map.Save().

◆ tempName

string Thing.tempName

Definition at line 15 of file Thing.cs.

Referenced by ThingContainer.RefreshGrid().

Property Documentation

◆ CanSearchContents

bool Thing.CanSearchContents
get

Definition at line 79 of file Thing.cs.

80 {
81 get
82 {
83 if (base.IsContainer && base.c_lockLv == 0 && !base.isNPCProperty)
84 {
86 }
87 return false;
88 }
89 }
virtual bool CanSearchContent
Definition: Trait.cs:214

Referenced by ThingContainer._ListCurrency(), ThingContainer.AddFactory(), Card.AddThing(), ThingContainer.Find(), ThingContainer.Find< T >(), ThingContainer.Foreach(), ThingContainer.GetCurrency(), ThingContainer.GetDest(), ThingContainer.GetThingStack(), TaskDump.IsValidContainer(), LayerInventory.TryShowGuide(), and ThingContainer.TryStack().

◆ isEquipped

◆ IsMeleeWithAmmo

bool Thing.IsMeleeWithAmmo
get

Definition at line 19 of file Thing.cs.

20 {
21 get
22 {
23 if (trait is TraitToolRange)
24 {
25 return isEquipped;
26 }
27 return false;
28 }
29 }

Referenced by ActMelee.Attack(), and OnCreate().

◆ IsSharedContainer

bool Thing.IsSharedContainer
get

Definition at line 91 of file Thing.cs.

92 {
93 get
94 {
95 if (base.IsContainer && base.c_lockLv == 0 && !base.isNPCProperty)
96 {
97 Window.SaveData obj = GetObj<Window.SaveData>(2);
98 if (obj == null)
99 {
100 return false;
101 }
102 return obj.sharedType == ContainerSharedType.Shared;
103 }
104 return false;
105 }
106 }
ContainerSharedType
Definition: Window.cs:13

Referenced by AI_Shopping.Buy(), QuestSharedContainer.CanUpdateOnTalk(), AI_Idle.Run(), TraitBaseContainer.SetName(), Zone.TryAddThingInSharedContainer(), Zone.TryGetThingFromSharedContainer(), and Chara.TryTakeSharedItems().

◆ isThing

override bool Thing.isThing
get

Definition at line 45 of file Thing.cs.

◆ Penetration

int Thing.Penetration
get

Definition at line 33 of file Thing.cs.

34 {
35 get
36 {
37 if (source.substats.Length == 0)
38 {
39 return 0;
40 }
41 return source.substats[0];
42 }
43 }

Referenced by AttackProcess.Prepare().

◆ Pref

override SourcePref Thing.Pref
get

Definition at line 49 of file Thing.cs.

50 {
51 get
52 {
53 if (source.origin == null || source.pref.UsePref)
54 {
55 return source.pref;
56 }
57 return source.origin.pref;
58 }
59 }

Referenced by Chara._Move(), BaseTileMap.DrawTile(), Cell.GetSurfaceHeight(), BaseTileMap.GetThingPosition(), and CoreDebug.UpdateInput().

◆ range

int Thing.range
get

Definition at line 31 of file Thing.cs.

Referenced by TraitTrainingDummy.IdleUse().

◆ SelfWeight

override int Thing.SelfWeight
get

Definition at line 61 of file Thing.cs.

62 {
63 get
64 {
65 if (!base.IsUnique)
66 {
67 return (int)((long)(base.isWeightChanged ? base.c_weight : source.weight) * (long)base.material.weight / 100);
68 }
69 if (!base.isWeightChanged)
70 {
71 return source.weight;
72 }
73 return base.c_weight;
74 }
75 }

Referenced by InvOwnerDeliver._OnProcess(), CanStackTo(), RecipeCard.Craft(), ThingGen.CreateTreasureContent(), Religion.GetOfferingValue(), CraftUtil.MixIngredients(), TraitBrewery.OnChildDecay(), AttackProcess.Prepare(), and Chara.Revive().

◆ sourceCard

◆ Tiles

override int [] Thing.Tiles
get

Definition at line 77 of file Thing.cs.


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