Elin Decompiled Documentation EA 23.185 Nightly Patch 1
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 (Recipe.Ingredient ing)
 
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, bool free)
 
SocketData GetRuneEnc (int idEle)
 
int CountRune (bool countFree=true)
 
int MaxRune ()
 
bool CanAddRune (TraitMod mod)
 
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, Chara originalTarget=null)
 
virtual void Die (Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None, Chara originalTarget=null)
 
void Explode (Point p, Card origin)
 
void Deconstruct ()
 
void Destroy ()
 
void SpawnLoot (Card origin)
 
Thing TryMakeRandomItem (int lv=-1, TryMakeRandomItemSource itemSource=TryMakeRandomItemSource.Default, Chara crafter=null)
 
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 (long a)
 
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
 
const int SocketDiv = 1000
 
- 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_lockedAge [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]
 
MixedFoodData c_mixedFoodData [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 1430 of file Thing.cs.

1431 {
1432 n.AddHeader("headerAttackEval");
1433 int num = 0;
1434 foreach (BodySlot slot in chara.body.slots)
1435 {
1436 if (slot.thing == null || slot.elementId != 35 || slot.thing.source.offense.Length < 2)
1437 {
1438 continue;
1439 }
1440 AttackProcess.Current.Prepare(chara, slot.thing, null, null, num);
1441 string text = AttackProcess.Current.GetText();
1442 if (slot.thing == current)
1443 {
1444 text = text.TagColor(() => true);
1445 }
1446 n.AddText(text);
1447 num++;
1448 }
1449 AttackProcess.Current.Prepare(chara, null);
1450 string text2 = AttackProcess.Current.GetText();
1451 if (num == 0)
1452 {
1453 text2 = text2.TagColor(() => true);
1454 }
1455 n.AddText(text2);
1456 }
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 2007 of file Thing.cs.

2008 {
2009 if (base.IsToolbelt || base.IsLightsource)
2010 {
2011 return null;
2012 }
2013 Tuple<SourceElement.Row, int> enchant = GetEnchant(lv, (SourceElement.Row r) => r.IsEncAppliable(base.category), base.IsCursed);
2014 if (enchant == null)
2015 {
2016 return null;
2017 }
2018 return elements.ModBase(enchant.Item1.id, enchant.Item2);
2019 }
ElementContainerCard elements
Definition: Card.cs:39
Element ModBase(int ele, int v)
static Tuple< SourceElement.Row, int > GetEnchant(int lv, Func< SourceElement.Row, bool > func, bool neg)
Definition: Thing.cs:1920

Referenced by OnCreate().

◆ ApplyMaterial()

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

Reimplemented from Card.

Definition at line 341 of file Thing.cs.

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

324 {
325 Chara chara = null;
327 {
328 chara = GetRootCard()?.Chara;
329 if (chara != null)
330 {
332 }
333 }
334 elements.ApplyMaterialElementMap(this, remove);
335 if (chara != null)
336 {
337 elements.SetParent(chara);
338 }
339 }
virtual Chara Chara
Definition: Card.cs:2032
Card GetRootCard()
Definition: Card.cs:3324
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 128 of file Thing.cs.

129 {
130 if (GetRootCard() != c)
131 {
132 return false;
133 }
134 if (HasTag(CTAG.throwWeapon))
135 {
136 return true;
137 }
138 if (!trait.CanAutofire)
139 {
140 return false;
141 }
142 if (trait is TraitToolRange)
143 {
144 if ((c.IsPCFaction && c.body.IsTooHeavyToEquip(this)) || reloading)
145 {
146 return false;
147 }
148 }
149 else if (trait is TraitAbility && c.IsPC)
150 {
151 Act act = (trait as TraitAbility).act;
152 Element element = c.elements.GetElement(act.id);
153 if (act is Spell && (element == null || element.vPotential == 0))
154 {
155 return false;
156 }
157 }
158 return true;
159 }
Definition: ACT.cs:62
bool HasTag(CTAG tag)
Definition: Card.cs:2557
Trait trait
Definition: Card.cs:51
bool IsTooHeavyToEquip(Thing thing)
Definition: CharaBody.cs:156
override bool IsPC
Definition: Chara.cs:610
override bool IsPCFaction
Definition: Chara.cs:669
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:142

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 1604 of file Thing.cs.

1605 {
1606 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)
1607 {
1608 return false;
1609 }
1610 if ((to.isDyed || base.isDyed) && to.c_dyeMat != base.c_dyeMat)
1611 {
1612 return false;
1613 }
1614 if (base.c_idRefCard != to.c_idRefCard || base.c_idRefCard2 != to.c_idRefCard2)
1615 {
1616 return false;
1617 }
1618 if (base.IsDecayed != to.IsDecayed)
1619 {
1620 return false;
1621 }
1622 if (!trait.CanStackTo(to))
1623 {
1624 return false;
1625 }
1626 if (base.noSell != to.noSell || base.isCopy != to.isCopy)
1627 {
1628 return false;
1629 }
1630 if (base.isStolen != to.isStolen)
1631 {
1632 return false;
1633 }
1634 if (base.isCrafted != to.isCrafted)
1635 {
1636 return false;
1637 }
1638 if ((to.isWeightChanged || base.isWeightChanged) && to.SelfWeight != SelfWeight)
1639 {
1640 return false;
1641 }
1642 if (to.c_IDTState != base.c_IDTState)
1643 {
1644 return false;
1645 }
1646 if (to.c_priceAdd != base.c_priceAdd || to.c_priceFix != base.c_priceFix || to.c_priceCopy != base.c_priceCopy)
1647 {
1648 return false;
1649 }
1650 if (to.ChildrenAndSelfWeight + base.ChildrenAndSelfWeight > 1000000000)
1651 {
1652 return false;
1653 }
1654 if (trait.IsRequireFuel && base.c_charges != to.c_charges)
1655 {
1656 return false;
1657 }
1658 if (base.c_altName != to.c_altName)
1659 {
1660 return false;
1661 }
1662 if (base.Num + to.Num <= 0)
1663 {
1664 return false;
1665 }
1666 bool flag = false;
1667 if (to.parent is Card)
1668 {
1669 Window.SaveData windowSaveData = (to.parent as Card).GetWindowSaveData();
1670 if (windowSaveData != null && windowSaveData.compress)
1671 {
1672 flag = true;
1673 }
1674 }
1675 if (flag)
1676 {
1677 if (base.encLV != to.encLV && !base.IsFood)
1678 {
1679 return false;
1680 }
1681 if (elements.dict.Count() != to.elements.dict.Count())
1682 {
1683 return false;
1684 }
1685 foreach (Element value in elements.dict.Values)
1686 {
1687 if (to.elements.GetElement(value.id) == null)
1688 {
1689 return false;
1690 }
1691 }
1692 int num2 = (to.encLV = Mathf.CeilToInt(1f * (float)(base.encLV * base.Num + to.encLV * to.Num) / (float)(base.Num + to.Num)));
1693 base.encLV = num2;
1694 foreach (Element value2 in elements.dict.Values)
1695 {
1696 Element element = to.elements.GetElement(value2.id);
1697 value2.vBase = (element.vBase = (value2.vBase * base.Num + element.vBase * to.Num) / (base.Num + to.Num));
1698 }
1699 return true;
1700 }
1701 if (base.encLV != to.encLV)
1702 {
1703 return false;
1704 }
1705 if (elements.dict.Count() != to.elements.dict.Count())
1706 {
1707 return false;
1708 }
1709 foreach (Element value3 in elements.dict.Values)
1710 {
1711 Element element2 = to.elements.GetElement(value3.id);
1712 if (element2 == null || value3.vBase / 10 * 10 != element2.vBase / 10 * 10)
1713 {
1714 return false;
1715 }
1716 }
1717 return true;
1718 }
Definition: Card.cs:11
int c_priceFix
Definition: Card.cs:1111
bool isCrafted
Definition: Card.cs:780
int tier
Definition: Card.cs:396
bool IsDecayed
Definition: Card.cs:2249
int idMaterial
Definition: Card.cs:132
string id
Definition: Card.cs:33
bool noSell
Definition: Card.cs:816
bool isCopy
Definition: Card.cs:864
string c_altName
Definition: Card.cs:1567
int c_priceAdd
Definition: Card.cs:1123
int c_dyeMat
Definition: Card.cs:1159
ICardParent parent
Definition: Card.cs:53
int c_priceCopy
Definition: Card.cs:1135
int c_IDTState
Definition: Card.cs:1231
string c_idRefCard2
Definition: Card.cs:1723
int refVal
Definition: Card.cs:192
Window.SaveData GetWindowSaveData()
Definition: Card.cs:2478
int encLV
Definition: Card.cs:312
bool isDyed
Definition: Card.cs:444
bool isWeightChanged
Definition: Card.cs:648
int rarityLv
Definition: Card.cs:288
int idSkin
Definition: Card.cs:348
bool isGifted
Definition: Card.cs:768
BlessedState blessedState
Definition: Card.cs:264
bool isStolen
Definition: Card.cs:840
int ChildrenAndSelfWeight
Definition: Card.cs:2003
bool isModified
Definition: Card.cs:456
int Num
Definition: Card.cs:156
int c_charges
Definition: Card.cs:1243
string c_idRefCard
Definition: Card.cs:1711
Dictionary< int, Element > dict
int vBase
Definition: ELEMENT.cs:250
override int SelfWeight
Definition: Thing.cs:82
virtual bool CanStackTo(Thing to)
Definition: Trait.cs:584
virtual bool HasCharges
Definition: Trait.cs:326
bool IsRequireFuel
Definition: Trait.cs:460
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 1757 of file Thing.cs.

1758 {
1759 }

Referenced by LayerCraftFloat.RefreshDisassemble().

◆ DoAct()

void Thing.DoAct ( Act  act)
inline

Definition at line 1902 of file Thing.cs.

1903 {
1904 if (!EClass.pc.HasNoGoal || (act.LocalAct && EClass._zone.IsRegion))
1905 {
1906 SE.Beep();
1907 return;
1908 }
1909 EClass.player.hotItemToRestore = EClass.player.currentHotItem;
1910 if (act.IsAct)
1911 {
1912 act.Perform(EClass.pc);
1913 return;
1914 }
1915 AIAct aI = act as AIAct;
1916 EClass.pc.SetAI(aI);
1918 }
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:8426
bool HasNoGoal
Definition: Chara.cs:986
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:1020
virtual bool IsRegion
Definition: Spatial.cs:503

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 1753 of file Thing.cs.

1754 {
1755 }

Referenced by RecipeUpdater.RunDisassemble().

◆ GetEfficiency()

int Thing.GetEfficiency ( )
inline

Definition at line 161 of file Thing.cs.

162 {
163 return 50 + base.LV * 10 + base.encLV * 10 + (int)base.rarity * 10 + (int)base.blessedState * 10;
164 }

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 1920 of file Thing.cs.

1921 {
1922 List<SourceElement.Row> list = new List<SourceElement.Row>();
1923 int num = 0;
1924 int num2 = lv + 5 + EClass.rndSqrt(10);
1925 foreach (SourceElement.Row row in EClass.sources.elements.rows)
1926 {
1927 if ((!neg || !row.tag.Contains("flag")) && func(row) && row.LV < num2)
1928 {
1929 list.Add(row);
1930 num += row.chance;
1931 }
1932 }
1933 if (num == 0)
1934 {
1935 return null;
1936 }
1937 int num3 = EClass.rnd(num);
1938 int num4 = 0;
1939 foreach (SourceElement.Row item in list)
1940 {
1941 num4 += item.chance;
1942 if (num3 < num4)
1943 {
1944 string text = EClass.sources.elements.map[item.id].category;
1945 bool flag = text == "skill" || text == "attribute" || text == "resist";
1946 float num5 = (float)(3 + Mathf.Min(lv / 10, 15)) + Mathf.Sqrt(lv * item.encFactor / 100);
1947 int num6 = (item.mtp + EClass.rnd(item.mtp + (int)num5)) / item.mtp * ((!(flag && neg)) ? 1 : (-1));
1948 if (item.encFactor == 0 && num6 > 25)
1949 {
1950 num6 = 25;
1951 }
1952 return new Tuple<SourceElement.Row, int>(item, num6);
1953 }
1954 }
1955 return null;
1956 }
static int rndSqrt(int a)
Definition: EClass.cs:97
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 790 of file Thing.cs.

791 {
792 string text = "";
793 if (trait.ShowChildrenNumber && base.c_lockLv == 0)
794 {
795 if (things.Count > 0)
796 {
797 text += "childCount".lang(things.Count.ToString() ?? "");
798 }
799 else if (trait.CanOpenContainer)
800 {
801 text += "empty".lang();
802 }
803 }
805 {
806 Room room = pos.cell.room;
807 if (EClass.debug.enable && room != null && room.data.group != 0)
808 {
809 text = text + " #" + room.data.group;
810 }
811 }
812 return text;
813 }
int group
Definition: AreaData.cs:18
AreaData data
Definition: BaseArea.cs:29
Point pos
Definition: Card.cs:57
ThingContainer things
Definition: Card.cs:36
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:330
virtual bool CanOpenContainer
Definition: Trait.cs:233

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

◆ GetHoverText()

override string Thing.GetHoverText ( )
inlinevirtual

Reimplemented from Card.

Definition at line 773 of file Thing.cs.

774 {
775 string text = "";
776 text = text + " <size=14>(" + Lang._weight(base.ChildrenAndSelfWeight) + ")</size> ";
778 {
779 text += Environment.NewLine;
780 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;
781 }
782 string hoverText = trait.GetHoverText();
783 if (!hoverText.IsEmpty())
784 {
785 text = text + Environment.NewLine + hoverText;
786 }
787 return base.GetHoverText() + text;
788 }
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:589

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

◆ GetIngredients()

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

Definition at line 1720 of file Thing.cs.

1721 {
1722 if (ing.CanSetThing(this))
1723 {
1724 list.Add(this);
1725 }
1726 if (things.Count <= 0 || base.c_lockLv != 0 || base.isNPCProperty)
1727 {
1728 return;
1729 }
1730 foreach (Thing thing in things)
1731 {
1732 thing.GetIngredients(ing, list);
1733 }
1734 }
void Add(Act a, string s="")
Definition: ActPlan.cs:11
bool CanSetThing(Thing t)
Definition: Recipe.cs:89
Definition: Thing.cs:8
void GetIngredients(Recipe.Ingredient ing, List< Thing > list)
Definition: Thing.cs:1720

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 518 of file Thing.cs.

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

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.GetBool(), 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 1749 of file Thing.cs.

1750 {
1751 }

Referenced by RecipeUpdater.RunRecipe().

◆ GetSubPassData()

override SubPassData Thing.GetSubPassData ( )
inlinevirtual

Reimplemented from Card.

Definition at line 1590 of file Thing.cs.

1591 {
1592 Chara chara = GetRootCard() as Chara;
1593 if ((!trait.ShowAsTool || (chara == EClass.pc && HotItemHeld.disableTool)) && (chara?.held == this || (!base.isRoofItem && placeState != PlaceState.installed && renderer.data.subCrate.enable && parent is Zone)))
1594 {
1596 {
1597 return EClass.setting.pass.subCrate;
1598 }
1599 return renderer.data.subCrate;
1600 }
1601 return SubPassData.Default;
1602 }
PlaceState
Definition: PlaceState.cs:2
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
bool isRoofItem
Definition: Card.cs:564
PlaceState placeState
Definition: Card.cs:81
CardRenderer renderer
Definition: Card.cs:59
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 2025 of file Thing.cs.

2026 {
2027 if (base.IsIdentified)
2028 {
2029 return this;
2030 }
2031 string @ref = "";
2032 string text = "";
2033 if (show)
2034 {
2035 @ref = GetName(NameStyle.Full, base.Num);
2036 }
2037 Rarity rarity = idtSource switch
2038 {
2039 IDTSource.SkillHigh => Rarity.Legendary,
2040 IDTSource.Skill => Rarity.Superior,
2041 _ => Rarity.Normal,
2042 };
2043 if (rarity != 0 && ((base.IsEquipmentOrRangedOrAmmo && base.rarity >= rarity) || base.rarity >= Rarity.Mythical))
2044 {
2045 base.c_IDTState = 3;
2046 }
2047 else if (base.rarity >= Rarity.Mythical && idtSource != IDTSource.SuperiorIdentify)
2048 {
2049 base.c_IDTState = 1;
2050 }
2051 else
2052 {
2053 base.c_IDTState = 0;
2054 }
2055 if (show)
2056 {
2057 text = GetName(NameStyle.Full, base.Num);
2058 if (base.c_IDTState == 0)
2059 {
2060 Msg.Say("identified", @ref, text);
2061 }
2062 else
2063 {
2064 Msg.Say((idtSource == IDTSource.Skill) ? "identified3" : "identified2", @ref, text, base.TextRarity);
2065 }
2066 }
2067 if (base.IsIdentified)
2068 {
2069 GetRootCard()?.TryStack(this);
2070 }
2072 return this;
2073 }
IDTSource
Definition: IDTSource.cs:2
Rarity rarity
Definition: Card.cs:300
void TryStack(Thing t)
Definition: Card.cs:6658
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:518

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 1736 of file Thing.cs.

1737 {
1738 if (isDestroyed)
1739 {
1740 return false;
1741 }
1742 if (GetRootCard().Dist(EClass.pc) > 1 || !ing.CanSetThing(this))
1743 {
1744 return false;
1745 }
1746 return true;
1747 }
bool isDestroyed
Definition: Card.cs:73
int Dist(Card c)
Definition: Card.cs:7315

References EClass.pc.

Referenced by DropdownGrid.BuildIngredients().

◆ ListLimitedValidTraits()

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

Definition at line 815 of file Thing.cs.

816 {
817 List<Element> list = new List<Element>();
818 if (base.ShowFoodEnc)
819 {
820 foreach (Element value in elements.dict.Values)
821 {
822 if (value.IsFoodTraitMain && value.Value > 0)
823 {
824 list.Add(value);
825 }
826 }
828 if (limit && list.Count > 5)
829 {
830 int num = list.Count - 5;
831 for (int i = 0; i < num; i++)
832 {
833 list.RemoveAt(list.Count - 1);
834 }
835 }
836 }
837 return list;
838 }
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 840 of file Thing.cs.

841 {
842 List<Element> list = ListLimitedValidTraits(limit);
843 bool showFoodEnc = base.ShowFoodEnc;
844 bool flag = EClass.debug.enable || EClass.pc.HasElement(1650);
845 if (showFoodEnc)
846 {
847 foreach (Element value in elements.dict.Values)
848 {
849 if (value.IsFoodTrait && !list.Contains(value) && (isCraft || flag || value.IsFoodTraitMain) && (!value.IsFoodTraitMain || value.Value < 0))
850 {
851 list.Add(value);
852 }
853 }
854 }
855 foreach (Element value2 in elements.dict.Values)
856 {
857 if ((isCraft || flag || ((!value2.IsFoodTrait || value2.IsFoodTraitMain) && (!showFoodEnc || !value2.IsTrait || value2.Value >= 0))) && !list.Contains(value2) && (value2.IsTrait || (value2.IsFoodTrait && !value2.IsFoodTraitMain)))
858 {
859 list.Add(value2);
860 }
861 }
862 return list;
863 }
bool HasElement(int ele, int req=1)
Definition: Card.cs:5638
bool IsFoodTrait
Definition: ELEMENT.cs:362
bool IsTrait
Definition: ELEMENT.cs:360
List< Element > ListLimitedValidTraits(bool limit)
Definition: Thing.cs:815

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 2075 of file Thing.cs.

2076 {
2077 if (trait is TraitGene)
2078 {
2079 DNA dNA = base.c_DNA;
2080 if (dNA == null || dNA.type == DNA.Type.Brain || dNA.type == DNA.Type.Inferior)
2081 {
2082 return false;
2083 }
2084 for (int i = 0; i < dNA.vals.Count; i += 2)
2085 {
2086 SourceElement.Row row = EClass.sources.elements.map.TryGetValue(dNA.vals[i]);
2087 if (row.name.ToLower().Contains(s))
2088 {
2089 return true;
2090 }
2091 if (row.GetName().ToLower().Contains(s))
2092 {
2093 return true;
2094 }
2095 }
2096 }
2097 else
2098 {
2099 if (!base.IsIdentified)
2100 {
2101 return false;
2102 }
2103 foreach (Element value in elements.dict.Values)
2104 {
2105 if (value.Value != 0)
2106 {
2107 if (value.source.name.ToLower().Contains(s))
2108 {
2109 return true;
2110 }
2111 if (value.source.GetName().ToLower().Contains(s))
2112 {
2113 return true;
2114 }
2115 }
2116 }
2117 }
2118 return false;
2119 }
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 182 of file Thing.cs.

183 {
184 if (bp.blesstedState.HasValue)
185 {
186 SetBlessedState(bp.blesstedState.GetValueOrDefault());
187 }
188 else if (base.category.ignoreBless == 0 && bp.rarity == Rarity.Random && base.rarity != Rarity.Artifact)
189 {
190 if (EClass.rnd(25) == 0)
191 {
193 }
194 else if (EClass.rnd(25) == 0)
195 {
197 }
198 else if (EClass.rnd(50) == 0 && base.category.slot != 0)
199 {
201 }
202 }
203 if (!EClass.debug.autoIdentify && (!source.unknown_JP.IsEmpty() || (base.category.slot != 0 && base.rarity >= Rarity.Superior)))
204 {
205 base.c_IDTState = 5;
206 }
207 string text = id;
208 if (text == "bill_tax" || text == "bill")
209 {
210 base.c_bill = 100 + EClass.rnd(100);
211 }
212 if (base.category.slot != 0)
213 {
214 int num = 0;
215 if (base.rarity == Rarity.Superior)
216 {
217 num = EClass.rnd(3);
218 }
219 else if (base.rarity == Rarity.Legendary)
220 {
221 num = EClass.rnd(4) + 2;
222 }
223 else if (base.rarity == Rarity.Mythical)
224 {
225 num = EClass.rnd(3) + 5;
226 }
227 else if (base.rarity >= Rarity.Artifact)
228 {
229 num = EClass.rnd(2) + 1;
230 }
231 if (num > 0 && !HasTag(CTAG.godArtifact) && !HasTag(CTAG.noRandomEnc))
232 {
233 for (int i = 0; i < num; i++)
234 {
235 AddEnchant(genLv);
236 }
237 }
238 }
239 if (base.IsRangedWeapon && !IsMeleeWithAmmo)
240 {
241 if (HasTag(CTAG.godArtifact))
242 {
243 AddSocket();
244 AddSocket();
245 }
246 else
247 {
248 int num2 = 1;
249 int num3 = ((EClass.rnd(10) == 0) ? 1 : 0);
250 if (base.rarity == Rarity.Superior)
251 {
252 num2 = 2 + num3;
253 }
254 else if (base.rarity == Rarity.Legendary)
255 {
256 num2 = EClass.rnd(2) + 3 + num3;
257 }
258 else if (base.rarity == Rarity.Mythical)
259 {
260 num2 = EClass.rnd(2) + 4 + num3;
261 }
262 else if (base.rarity >= Rarity.Artifact)
263 {
264 num2 = EClass.rnd(2) + 1;
265 }
266 if (num2 > 0)
267 {
268 for (int j = 0; j < num2; j++)
269 {
270 AddSocket();
271 }
272 for (int k = 0; k < EClass.rnd(num2 + 1); k++)
273 {
274 Tuple<SourceElement.Row, int> enchant = GetEnchant(genLv, (SourceElement.Row r) => r.tag.Contains("modRanged"), neg: false);
275 if (enchant != null && InvOwnerMod.IsValidRangedMod(this, enchant.Item1))
276 {
277 ApplySocket(enchant.Item1.id, enchant.Item2);
278 }
279 }
280 }
281 }
282 }
283 if ((bp.rarity != 0 || bp.qualityBonus != 0) && base.rarity < Rarity.Artifact && base.category.tag.Contains("enc"))
284 {
285 int num4 = 0;
286 if (EClass.rnd(6) == 0)
287 {
288 if (bp.qualityBonus == 0)
289 {
290 num4 = EClass.rnd(EClass.rnd(14) + 1);
291 if (num4 == 1 && EClass.rnd(3) != 0)
292 {
293 num4 = 0;
294 }
295 }
296 else if (bp.qualityBonus < 0)
297 {
298 if (EClass.rnd(3) == 0)
299 {
300 num4 = 1;
301 }
302 }
303 else if (bp.qualityBonus >= 10)
304 {
305 num4 = Mathf.Min(bp.qualityBonus / 10 + 2, 8) + EClass.rnd(EClass.rnd(5) + 1);
306 }
307 }
308 if (num4 > 0)
309 {
310 if (num4 > 12)
311 {
312 num4 = 12;
313 }
314 SetEncLv(num4);
315 }
316 }
317 if (HasTag(CTAG.randomSkin))
318 {
319 base.idSkin = EClass.rnd(source.skins.Length + 1);
320 }
321 }
BlessedState? blesstedState
void AddSocket()
Definition: Card.cs:3439
CardBlueprint bp
Definition: Card.cs:75
void ApplySocket(Thing t)
Definition: Card.cs:3448
virtual void SetBlessedState(BlessedState s)
Definition: Card.cs:3787
void SetEncLv(int a)
Definition: Card.cs:3756
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:2007
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 2021 of file Thing.cs.

2022 {
2023 }

◆ SetRenderParam()

override void Thing.SetRenderParam ( RenderParam  p)
inlinevirtual

Reimplemented from Card.

Definition at line 1458 of file Thing.cs.

1459 {
1460 p.matColor = base.colorInt;
1461 p.mat = base.material;
1462 if (!renderer.usePass)
1463 {
1464 return;
1465 }
1466 switch (trait.tileMode)
1467 {
1468 case Trait.TileMode.DefaultNoAnime:
1469 if (source._altTiles.Length != 0 && trait.UseAltTiles)
1470 {
1471 p.tile = source._altTiles[base.dir % source._altTiles.Length] * ((!flipX) ? 1 : (-1));
1472 }
1473 else
1474 {
1475 p.tile = sourceCard._tiles[base.dir % sourceCard._tiles.Length] * ((!flipX) ? 1 : (-1));
1476 }
1477 break;
1478 case Trait.TileMode.FakeBlock:
1479 {
1480 p.color += 1572864f;
1481 SourceBlock.Row row = EClass.sources.blocks.map[base.refVal];
1482 p.tile = row._tiles[base.dir % row._tiles.Length];
1483 break;
1484 }
1485 case Trait.TileMode.SignalAnime:
1486 if (source._altTiles.Length != 0 && trait.UseAltTiles)
1487 {
1488 p.tile = source._altTiles[base.dir % source._altTiles.Length] * ((!flipX) ? 1 : (-1));
1489 }
1490 else
1491 {
1492 p.tile = sourceCard._tiles[base.dir % sourceCard._tiles.Length] * ((!flipX) ? 1 : (-1));
1493 }
1494 if (animeCounter > 0f && source.anime.Length != 0)
1495 {
1496 animeCounter += Time.deltaTime;
1497 int num3 = (int)(animeCounter / (0.001f * (float)source.anime[1]));
1498 if (num3 > ((source.anime.Length > 2) ? source.anime[2] : source.anime[0]))
1499 {
1500 animeCounter = 0f;
1501 }
1502 else
1503 {
1504 p.tile += num3 % source.anime[0] * ((!flipX) ? 1 : (-1));
1505 }
1506 }
1507 break;
1508 case Trait.TileMode.Illumination:
1509 if (base.isOn || base.isRoofItem)
1510 {
1511 int num4 = (int)((float)base.uid + Time.realtimeSinceStartup * 5f);
1512 int num5 = (int)(Time.realtimeSinceStartup * 5f);
1513 p.tile = (sourceCard._tiles[base.dir % sourceCard._tiles.Length] + num4 % 3 + 1) * ((!flipX) ? 1 : (-1));
1514 if (num5 % 16 == 0)
1515 {
1516 p.color = 5242880f;
1517 }
1518 else if (num5 % 11 == 0)
1519 {
1520 p.color = 7864320f;
1521 }
1522 else
1523 {
1524 p.color = 13107200f;
1525 }
1526 }
1527 else
1528 {
1529 p.tile = sourceCard._tiles[base.dir % sourceCard._tiles.Length] * ((!flipX) ? 1 : (-1));
1530 }
1531 break;
1532 case Trait.TileMode.Door:
1533 if (source._altTiles.Length != 0 && trait.UseAltTiles)
1534 {
1535 p.tile = source._altTiles[base.dir % source._altTiles.Length] * ((!flipX) ? 1 : (-1));
1536 }
1537 else
1538 {
1539 p.tile = sourceCard._tiles[base.dir % sourceCard._tiles.Length] * ((!flipX) ? 1 : (-1));
1540 }
1541 if (parent is Zone && pos.cell.HasFullBlock)
1542 {
1543 p.tile += ((p.tile < 0f) ? (-64) : 64);
1544 }
1545 if (trait is TraitDoorSwing traitDoorSwing && traitDoorSwing.IsOpen())
1546 {
1547 p.tile += ((!(p.tile < 0f)) ? 1 : (-1));
1548 }
1549 break;
1550 default:
1551 if (source._altTiles.Length != 0 && trait.UseAltTiles)
1552 {
1553 p.tile = source._altTiles[base.dir % source._altTiles.Length] * ((!flipX) ? 1 : (-1));
1554 }
1555 else
1556 {
1557 p.tile = sourceCard._tiles[base.dir % sourceCard._tiles.Length] * ((!flipX) ? 1 : (-1));
1558 }
1559 if (source.anime.Length == 0 || !trait.IsAnimeOn)
1560 {
1561 break;
1562 }
1563 if (source.anime.Length > 2)
1564 {
1565 float num = Time.realtimeSinceStartup * 1000f / (float)source.anime[1] % (float)source.anime[2];
1566 if ((int)num == source.anime[0] - 1 && source.anime.Length > 3)
1567 {
1568 PlaySound("anime_sound" + source.anime[3]);
1569 }
1570 if (!(num >= (float)source.anime[0]))
1571 {
1572 p.tile += num * (float)((!flipX) ? 1 : (-1));
1573 }
1574 }
1575 else
1576 {
1577 float num2 = Time.realtimeSinceStartup * 1000f / (float)source.anime[1] % (float)source.anime[0];
1578 p.tile += num2 * (float)((!flipX) ? 1 : (-1));
1579 }
1580 break;
1581 }
1582 if (trait.IdSkin != 0 && sourceCard.skins.Length != 0)
1583 {
1584 int num6 = sourceCard.skins.TryGet(trait.IdSkin - 1);
1585 num6 = num6 / 100 * (int)source.renderData.pass.pmesh.tiling.x + num6 % 100;
1586 p.tile += ((p.tile < 0f) ? (-num6) : num6);
1587 }
1588 }
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:5852
float animeCounter
Definition: Card.cs:71
virtual bool flipX
Definition: Card.cs:2078
bool HasFullBlock
Definition: Cell.cs:817
int[] skins
Definition: RenderRow.cs:14
int[] _tiles
Definition: RenderRow.cs:12
SourceBlock blocks
override bool IsOpen()
Definition: Trait.cs:7
virtual TileMode tileMode
Definition: Trait.cs:432
virtual bool UseAltTiles
Definition: Trait.cs:434
TileMode
Definition: Trait.cs:9
virtual int IdSkin
Definition: Trait.cs:45
virtual bool IsAnimeOn
Definition: Trait.cs:371

References SourceThing.Row._altTiles, RenderRow._tiles, SourceThing.Row.anime, SourceManager.blocks, TraitDoorSwing.IsOpen(), RenderData.pass, MeshPass.pmesh, RenderRow.renderData, RenderRow.skins, EClass.sources, MeshPassParam.tile, and ProceduralMesh.tiling.

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

◆ SetSource()

override void Thing.SetSource ( )
inlinevirtual

Reimplemented from Card.

Definition at line 166 of file Thing.cs.

167 {
168 source = EClass.sources.things.map.TryGetValue(id);
169 if (source != null && source.isOrigin)
170 {
172 id = source.id;
173 }
174 if (source == null)
175 {
176 Debug.LogWarning("Thing " + id + " not found");
177 id = "ash3";
179 }
180 }
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 1761 of file Thing.cs.

1762 {
1763 int count = 1;
1764 UIContextMenu i = EClass.ui.CreateContextMenuInteraction();
1765 bool buy = trans != null;
1766 UIButton buttonBuy = null;
1767 UIItem itemSlider = null;
1768 itemSlider = i.AddSlider("sliderSplitMenu", "adjustmentNum", (float a) => (!EClass.core.IsGameStarted) ? "" : ("/" + base.Num), count, delegate(float b)
1769 {
1770 count = (int)b;
1771 if (trans != null)
1772 {
1773 trans.num = count;
1774 }
1775 UpdateButton();
1776 }, 1f, base.Num, isInt: true, hideOther: false, useInput: true).GetComponent<UIItem>();
1777 if (buy)
1778 {
1779 buttonBuy = i.AddButton("invBuy", delegate
1780 {
1781 Process();
1782 });
1783 }
1784 i.onDestroy = delegate
1785 {
1786 if (!buy && !i.wasCanceled)
1787 {
1788 Process();
1789 }
1790 };
1791 i.Show();
1792 if ((bool)buttonBuy)
1793 {
1794 buttonBuy.gameObject.AddComponent<CanvasGroup>();
1795 }
1796 UpdateButton();
1797 void Process()
1798 {
1799 if (!EClass.core.IsGameStarted || button == null || button.card == null)
1800 {
1801 Debug.Log("Split bug1");
1802 }
1803 else if (button.card.isDestroyed || button.card.Num < count)
1804 {
1805 Debug.Log("Split bug2");
1806 }
1807 else if (EClass.pc.isDead)
1808 {
1809 Debug.Log("Split bug3");
1810 }
1811 else if (count != 0 && !Input.GetMouseButton(1))
1812 {
1813 if (trans != null)
1814 {
1815 trans.Process(startTransaction: true);
1816 }
1817 else
1818 {
1819 DragItemCard dragItemCard = new DragItemCard(button);
1820 if (count != base.Num)
1821 {
1822 Thing thing = button.card.Split(base.Num - count);
1823 button.invOwner.Container.AddThing(thing, tryStack: false);
1824 thing.invX = dragItemCard.from.invX;
1825 thing.invY = dragItemCard.from.invY;
1826 thing.posInvX = button.card.Thing.posInvX;
1827 thing.posInvY = button.card.Thing.posInvY;
1828 }
1829 EClass.ui.StartDrag(dragItemCard);
1830 }
1831 }
1832 }
1833 void UpdateButton()
1834 {
1835 itemSlider.text1.text = GetName(NameStyle.FullNoArticle, 1);
1836 itemSlider.text2.text = Lang._weight(SelfWeight * count);
1837 if ((bool)buttonBuy)
1838 {
1839 buttonBuy.mainText.SetText(trans.GetTextDetail());
1840 buttonBuy.mainText.RebuildLayoutTo<UIButton>();
1841 buttonBuy.interactable = trans.IsValid();
1842 buttonBuy.RebuildLayout(recursive: true);
1843 buttonBuy.gameObject.GetComponent<CanvasGroup>().alpha = (trans.IsValid() ? 1f : 0.9f);
1844 }
1845 }
1846 }
Card card
Definition: ButtonGrid.cs:24
InvOwner invOwner
Definition: ButtonGrid.cs:28
int posInvY
Definition: Card.cs:336
Thing Split(int a)
Definition: Card.cs:3382
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:3057
virtual Thing Thing
Definition: Card.cs:2020
int posInvX
Definition: Card.cs:324
bool isDead
Definition: Chara.cs:387
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 1848 of file Thing.cs.

1849 {
1850 int count = 1;
1851 UIContextMenu uIContextMenu = EClass.ui.CreateContextMenuInteraction();
1852 UIButton buttonBuy = null;
1853 UIItem itemSlider = null;
1854 itemSlider = uIContextMenu.AddSlider("sliderSplitMenu", "adjustmentNum", (float a) => (!EClass.core.IsGameStarted) ? "" : ("/" + base.Num), count, delegate(float b)
1855 {
1856 count = (int)b;
1857 UpdateButton();
1858 }, 1f, base.Num, isInt: true, hideOther: false, useInput: true).GetComponent<UIItem>();
1859 buttonBuy = uIContextMenu.AddButton("invBuy", delegate
1860 {
1861 Process();
1862 });
1863 uIContextMenu.onDestroy = delegate
1864 {
1865 };
1866 uIContextMenu.Show();
1867 if ((bool)buttonBuy)
1868 {
1869 buttonBuy.gameObject.AddComponent<CanvasGroup>();
1870 }
1871 UpdateButton();
1872 void Process()
1873 {
1874 if (!EClass.core.IsGameStarted || button == null || button.card == null)
1875 {
1876 Debug.Log("Split bug1");
1877 }
1878 else if (button.card.isDestroyed || button.card.Num < count)
1879 {
1880 Debug.Log("Split bug2");
1881 }
1882 else if (EClass.pc.isDead)
1883 {
1884 Debug.Log("Split bug3");
1885 }
1886 else if (count != 0 && !Input.GetMouseButton(1))
1887 {
1888 onSplit?.Invoke(count);
1889 }
1890 }
1891 void UpdateButton()
1892 {
1893 itemSlider.text1.text = GetName(NameStyle.FullNoArticle, 1);
1894 itemSlider.text2.text = Lang._weight(SelfWeight * count);
1895 buttonBuy.mainText.SetText(lang.lang(count.ToString() ?? ""));
1896 buttonBuy.mainText.RebuildLayoutTo<UIButton>();
1897 buttonBuy.interactable = true;
1898 buttonBuy.RebuildLayout(recursive: true);
1899 }
1900 }
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 1958 of file Thing.cs.

1959 {
1960 if (!base.IsEquipment || base.IsCursed || base.rarity <= Rarity.Normal || GetInt(107) > 0)
1961 {
1962 return;
1963 }
1964 SetInt(107, 1);
1965 if (tg == null)
1966 {
1967 Rand.SetSeed(EClass.world.date.day + source._index + c.uid);
1968 if (msg)
1969 {
1970 c.Say("lick", c, this);
1971 PlaySound("offering");
1972 PlayEffect("mutation");
1973 }
1974 Element element = AddEnchant(base.LV);
1975 if (element != null)
1976 {
1977 SetInt(107, element.id);
1978 }
1979 }
1980 else
1981 {
1982 Rand.SetSeed(base.uid);
1983 List<Element> list = new List<Element>();
1984 foreach (Element value in elements.dict.Values)
1985 {
1986 if (value.id != 67 && value.id != 66 && value.id != 64 && value.id != 65)
1987 {
1988 list.Add(value);
1989 }
1990 }
1991 if (list.Count > 0)
1992 {
1993 Element element2 = list.RandomItem();
1994 elements.ModBase(element2.id, Mathf.Max(EClass.rnd(Mathf.Abs(element2.vBase / 5)), 1));
1995 SetInt(107, element2.id);
1996 }
1997 if (msg)
1998 {
1999 c.Say("lick2", c, tg, slot.name.ToLower());
2000 tg.PlaySound("offering");
2001 tg.PlayEffect("mutation");
2002 }
2003 }
2004 Rand.SetSeed();
2005 }
void SetInt(int id, int value=0)
Definition: BaseCard.cs:39
string name
Definition: BodySlot.cs:14
int uid
Definition: Card.cs:120
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:5886
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:6499
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 865 of file Thing.cs.

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

100 {
101 get
102 {
103 if (base.IsContainer && base.c_lockLv == 0 && !base.isNPCProperty)
104 {
105 return trait.CanSearchContent;
106 }
107 return false;
108 }
109 }
virtual bool CanSearchContent
Definition: Trait.cs:217

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 111 of file Thing.cs.

112 {
113 get
114 {
115 if (base.IsContainer && base.c_lockLv == 0 && !base.isNPCProperty)
116 {
117 Window.SaveData obj = GetObj<Window.SaveData>(2);
118 if (obj == null)
119 {
120 return false;
121 }
122 return obj.sharedType == ContainerSharedType.Shared;
123 }
124 return false;
125 }
126 }
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 (trait is TraitFakeBlock)
54 {
55 TileType tileType = EClass.sources.blocks.map[base.refVal].tileType;
56 if (tileType is TileTypePillar)
57 {
59 }
60 if (tileType is TileTypeFence)
61 {
63 }
64 if (tileType is TileTypeStairs)
65 {
67 }
68 if (tileType is TileTypeWall)
69 {
71 }
72 }
73 if (source.origin == null || source.pref.UsePref)
74 {
75 return source.pref;
76 }
77 return source.origin.pref;
78 }
79 }
SourcePref blockWall
Definition: CoreRef.cs:334
SourcePref blockPillar
Definition: CoreRef.cs:336
SourcePref blockFence
Definition: CoreRef.cs:330
SourcePref blockStairs
Definition: CoreRef.cs:332
PrefData prefs
Definition: CoreRef.cs:413

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 81 of file Thing.cs.

82 {
83 get
84 {
85 if (!base.IsUnique)
86 {
87 return (int)((long)(base.isWeightChanged ? base.c_weight : source.weight) * (long)base.material.weight / 100);
88 }
89 if (!base.isWeightChanged)
90 {
91 return source.weight;
92 }
93 return base.c_weight;
94 }
95 }

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 97 of file Thing.cs.


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