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

Public Member Functions

bool CanAutoFire (Chara c, Card tg, bool reloading=false)
 
int GetEfficiency ()
 
override void SetSource ()
 
override void OnCreate (int genLv)
 
override void ApplyMaterialElements (bool remove)
 
override void ApplyMaterial (bool remove=false)
 
override string GetName (NameStyle style, int _num=-1)
 
override string GetHoverText ()
 
override string GetExtraName ()
 
List< ElementListLimitedValidTraits (bool limit)
 
List< ElementListValidTraits (bool isCraft, bool limit)
 
override void WriteNote (UINote n, Action< UINote > onWriteNote=null, IInspect.NoteMode mode=IInspect.NoteMode.Default, Recipe recipe=null)
 
override void SetRenderParam (RenderParam p)
 
override SubPassData GetSubPassData ()
 
override bool CanStackTo (Thing to)
 
void GetIngredients (Recipe.Ingredient ing, List< Thing > list)
 
bool IsValidIngredient (Recipe.Ingredient ing)
 
void GetRecipes (HashSet< Recipe > recipes)
 
void GetDisassembles (List< Thing > list)
 
void Disassemble ()
 
void ShowSplitMenu (ButtonGrid button, InvOwner.Transaction trans=null)
 
void ShowSplitMenu2 (ButtonGrid button, string lang, Action< int > onSplit=null)
 
void DoAct (Act act)
 
void TryLickEnchant (Chara c, bool msg=true, Chara tg=null, BodySlot slot=null)
 
Element AddEnchant (int lv=-1)
 
void RemoveEnchant ()
 
Thing Identify (bool show=true, IDTSource idtSource=IDTSource.Identify)
 
override bool MatchEncSearch (string s)
 
- Public Member Functions inherited from Card
override string ToString ()
 
bool CanReserve (AIAct act)
 
bool TryReserve (AIAct act)
 
void Mod ()
 
Window.SaveData GetWindowSaveData ()
 
bool IsExcludeFromCraft ()
 
void SetDirtyWeight ()
 
void ChangeWeight (int a)
 
int Evalue (int ele)
 
int Evalue (int ele, bool ignoreGlobalElement)
 
int EvalueMax (int ele, int min=0)
 
int Evalue (string alias)
 
bool HasTag (CTAG tag)
 
bool HasEditorTag (EditorTag tag)
 
void AddEditorTag (EditorTag tag)
 
void RemoveEditorTag (EditorTag tag)
 
virtual string GetName (NameStyle style, int num=-1)
 
virtual string GetExtraName ()
 
virtual string GetDetail ()
 
int GetBestAttribute ()
 
void ModExp (string alias, int a)
 
void ModExp (int ele, int a)
 
bool IsChildOf (Card c)
 
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 AddExp (int a)
 
void LevelUp ()
 
virtual void ApplyMaterialElements (bool remove)
 
virtual void ApplyMaterial (bool remove=false)
 
Card ChangeMaterial (int idNew, bool ignoreFixedMaterial=false)
 
Card ChangeMaterial (string idNew, bool ignoreFixedMaterial=false)
 
Card ChangeMaterial (SourceMaterial.Row row, bool ignoreFixedMaterial=false)
 
void SetReplica (bool on)
 
Thing Add (string id, int num=1, int lv=1)
 
Card AddCard (Card c)
 
void RemoveCard (Card c)
 
void NotifyAddThing (Thing t, int num)
 
Thing AddThing (string id, int lv=-1)
 
Thing AddThing (Thing t, bool tryStack=true, int destInvX=-1, int destInvY=-1)
 
void PurgeDuplicateArtifact (Thing af)
 
void RemoveThings ()
 
void RemoveThing (Thing thing)
 
bool ShouldTrySetDirtyInventory ()
 
virtual bool CanStackTo (Thing to)
 
bool TryStackTo (Thing to)
 
ICardParent GetRoot ()
 
Card GetRootCard ()
 
bool IsStackable (Thing tg)
 
Thing Duplicate (int num)
 
Thing Split (int a)
 
Thing SetNum (int a)
 
Thing SetNoSell ()
 
void ModNum (int a, bool notify=true)
 
void AddSocket ()
 
void ApplySocket (Thing t)
 
void ApplySocket (int id, int lv, Card mod=null)
 
void EjectSockets ()
 
SocketData AddRune (Card rune)
 
SocketData AddRune (int idEle, int v)
 
SocketData GetRuneEnc (int idEle)
 
int CountRune ()
 
int MaxRune ()
 
bool CanAddRune (SourceElement.Row row)
 
bool HasRune ()
 
void OnChildNumChange (Card c)
 
Card Install ()
 
void SetPlaceState (PlaceState newState, bool byPlayer=false)
 
int GetTotalQuality (bool applyBonus=true)
 
void ModEncLv (int a)
 
void SetEncLv (int a)
 
virtual void SetBlessedState (BlessedState s)
 
virtual void ChangeRarity (Rarity q)
 
bool TryPay (int a, string id="money")
 
void SetCharge (int a)
 
void ModCharge (int a, bool destroy=false)
 
void ModCurrency (int a, string id="money")
 
int GetCurrency (string id="money")
 
virtual void HealHPHost (int a, HealSource origin=HealSource.None)
 
virtual void HealHP (int a, HealSource origin=HealSource.None)
 
virtual int GetArmorSkill ()
 
virtual int ApplyProtection (int dmg, int mod=100)
 
void DamageHP (int dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
 
void DamageHP (int dmg, int ele, int eleP=100, AttackSource attackSource=AttackSource.None, Card origin=null, bool showEffect=true, Thing weapon=null)
 
virtual void Die (Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None)
 
void Explode (Point p, Card origin)
 
void Deconstruct ()
 
void Destroy ()
 
void SpawnLoot (Card origin)
 
Thing TryMakeRandomItem (int lv=-1)
 
Card MakeFoodFrom (string _id)
 
Card MakeFoodFrom (Card c)
 
void MakeFoodRef (Card c1, Card c2=null)
 
string TryGetFoodName (Card c)
 
string GetFoodName (string s)
 
void MakeFigureFrom (string id)
 
void MakeRefFrom (string id)
 
void MakeRefFrom (Card c1, Card c2=null)
 
void 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)
 
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)
 
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 ()
 
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 (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 rnd (int a)
 
static int curve (int a, int start, int step, int rate=75)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 

Public Attributes

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

Static Public Attributes

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

Properties

bool isEquipped [get]
 
bool IsMeleeWithAmmo [get]
 
int range [get]
 
int Penetration [get]
 
override bool isThing [get]
 
override CardRow sourceCard [get]
 
override SourcePref Pref [get]
 
override int SelfWeight [get]
 
override int[] Tiles [get]
 
bool CanSearchContents [get]
 
bool IsSharedContainer [get]
 
- Properties inherited from Card
Card parentCard [get]
 
Thing parentThing [get]
 
int colorInt [get]
 
bool IsHotItem [get]
 
int uid [get, set]
 
int idMaterial [get, set]
 
int dir [get, set]
 
int Num [get, set]
 
int _x [get, set]
 
int _z [get, set]
 
int refVal [get, set]
 
int decay [get, set]
 
int altitude [get, set]
 
int hp [get, set]
 
float fx [get, set]
 
float fy [get, set]
 
BlessedState blessedState [get, set]
 
PlaceState _placeState [get, set]
 
int rarityLv [get, set]
 
Rarity rarity [get, set]
 
int encLV [get, set]
 
int posInvX [get, set]
 
int posInvY [get, set]
 
int idSkin [get, set]
 
int feat [get, set]
 
int LV [get, set]
 
int exp [get, set]
 
int qualityTier [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_dyeMat [get, set]
 
VisitorState visitorState [get, set]
 
RescueState c_rescueState [get, set]
 
BossType c_bossType [get, set]
 
int c_dateStockExpire [get, set]
 
int c_dateDeathLock [get, set]
 
int c_IDTState [get, set]
 
int c_charges [get, set]
 
int c_bill [get, set]
 
int c_invest [get, set]
 
int c_seed [get, set]
 
int c_allowance [get, set]
 
int c_fur [get, set]
 
int c_dateCooked [get, set]
 
int c_containerSize [get, set]
 
int c_weight [get, set]
 
int c_diceDim [get, set]
 
int c_indexContainerIcon [get, set]
 
int c_idMainElement [get, set]
 
int c_summonDuration [get, set]
 
int c_idBacker [get, set]
 
int c_uidMaster [get, set]
 
int c_ammo [get, set]
 
int c_daysWithGod [get, set]
 
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_idTalk [get, set]
 
string c_idDeity [get, set]
 
string c_altName [get, set]
 
string c_altName2 [get, set]
 
string c_extraNameRef [get, set]
 
string c_refText [get, set]
 
string c_idRefName [get, set]
 
string c_idRidePCC [get, set]
 
string c_idAbility [get, set]
 
string c_context [get, set]
 
string c_idEditor [get, set]
 
string c_editorTags [get, set]
 
string c_editorTraitVal [get, set]
 
string c_idTrait [get, set]
 
string c_idRefCard [get, set]
 
string c_idRefCard2 [get, set]
 
string c_note [get, set]
 
UniqueData c_uniqueData [get, set]
 
Thing ammoData [get, set]
 
List< SocketDatasocketList [get, set]
 
Thing c_copyContainer [get, set]
 
Window.SaveData c_windowSaveData [get, set]
 
CharaUpgrade c_upgrades [get, set]
 
CharaGenes c_genes [get, set]
 
List< int > c_corruptionHistory [get, set]
 
ContainerUpgrade c_containerUpgrade [get, set]
 
DNA c_DNA [get, set]
 
CharaList c_charaList [get, set]
 
byte[] c_textureData [get, set]
 
SourceMaterial.Row DyeMat [get]
 
int invX [get, set]
 
int invY [get, set]
 
CardRow refCard [get]
 
CardRow refCard2 [get]
 
int ExpToNext [get]
 
int DefaultLV [get]
 
int ChildrenWeight [get]
 
int ChildrenAndSelfWeight [get]
 
int ChildrenAndSelfWeightSingle [get]
 
virtual int SelfWeight [get]
 
virtual int WeightLimit [get]
 
SourceCategory.Row category [get]
 
SourceMaterial.Row material [get]
 
virtual string AliasMaterialOnCreate [get]
 
Cell Cell [get]
 
virtual Thing Thing [get]
 
virtual Chara Chara [get]
 
virtual bool isThing [get]
 
virtual bool isChara [get]
 
bool ExistsOnMap [get]
 
virtual bool isSynced [get]
 
bool IsContainer [get]
 
bool IsUnique [get]
 
bool IsPowerful [get]
 
bool IsImportant [get]
 
virtual SourcePref Pref [get]
 
virtual bool IsDeadOrSleeping [get]
 
virtual bool IsDisabled [get]
 
virtual bool IsMoving [get]
 
virtual bool flipX [get]
 
virtual bool IsAliveInCurrentZone [get]
 
virtual string actorPrefab [get]
 
virtual CardRow sourceCard [get]
 
virtual CardRow sourceRenderCard [get]
 
TileType TileType [get]
 
string Name [get]
 
string NameSimple [get]
 
string NameOne [get]
 
virtual bool IsPC [get]
 
bool _IsPC [get]
 
virtual bool IsPCC [get]
 
virtual bool IsPCParty [get]
 
virtual bool IsMinion [get]
 
virtual bool IsPCPartyMinion [get]
 
virtual bool IsPCFactionMinion [get]
 
virtual bool IsMultisize [get]
 
bool IsToolbelt [get]
 
bool IsLightsource [get]
 
bool IsEquipment [get]
 
bool IsFood [get]
 
bool 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 1373 of file Thing.cs.

1374 {
1375 n.AddHeader("headerAttackEval");
1376 int num = 0;
1377 foreach (BodySlot slot in chara.body.slots)
1378 {
1379 if (slot.thing == null || slot.elementId != 35 || slot.thing.source.offense.Length < 2)
1380 {
1381 continue;
1382 }
1383 AttackProcess.Current.Prepare(chara, slot.thing, null, null, num);
1384 string text = AttackProcess.Current.GetText();
1385 if (slot.thing == current)
1386 {
1387 text = text.TagColor(() => true);
1388 }
1389 n.AddText(text);
1390 num++;
1391 }
1392 AttackProcess.Current.Prepare(chara, null);
1393 string text2 = AttackProcess.Current.GetText();
1394 if (num == 0)
1395 {
1396 text2 = text2.TagColor(() => true);
1397 }
1398 n.AddText(text2);
1399 }
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:91
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 1941 of file Thing.cs.

1942 {
1943 if (base.IsToolbelt || base.IsLightsource)
1944 {
1945 return null;
1946 }
1947 Tuple<SourceElement.Row, int> enchant = GetEnchant(lv, (SourceElement.Row r) => r.IsEncAppliable(base.category), base.IsCursed);
1948 if (enchant == null)
1949 {
1950 return null;
1951 }
1952 return elements.ModBase(enchant.Item1.id, enchant.Item2);
1953 }
ElementContainerCard elements
Definition: Card.cs:37
Element ModBase(int ele, int v)
static Tuple< SourceElement.Row, int > GetEnchant(int lv, Func< SourceElement.Row, bool > func, bool neg)
Definition: Thing.cs:1854

Referenced by OnCreate().

◆ ApplyMaterial()

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

Reimplemented from Card.

Definition at line 317 of file Thing.cs.

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

300 {
301 Chara chara = null;
303 {
304 chara = GetRootCard()?.Chara;
305 if (chara != null)
306 {
308 }
309 }
310 elements.ApplyMaterialElementMap(this, remove);
311 if (chara != null)
312 {
313 elements.SetParent(chara);
314 }
315 }
virtual Chara Chara
Definition: Card.cs:1946
Card GetRootCard()
Definition: Card.cs:3173
Definition: Chara.cs:10
bool IsGameStarted
Definition: Core.cs:84
static Core core
Definition: EClass.cs:6
void SetParent(Card c)
void ApplyMaterialElementMap(Thing t, bool invert=false)
bool isEquipped
Definition: Thing.cs:17

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

Referenced by ApplyMaterial().

◆ CanAutoFire()

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

Definition at line 108 of file Thing.cs.

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

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

1543 {
1544 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.qualityTier != base.qualityTier || to.idSkin != base.idSkin || to.isGifted != base.isGifted)
1545 {
1546 return false;
1547 }
1548 if ((to.isDyed || base.isDyed) && to.c_dyeMat != base.c_dyeMat)
1549 {
1550 return false;
1551 }
1552 if (base.c_idRefCard != to.c_idRefCard || base.c_idRefCard2 != to.c_idRefCard2)
1553 {
1554 return false;
1555 }
1556 if (base.IsDecayed != to.IsDecayed)
1557 {
1558 return false;
1559 }
1560 if (!trait.CanStackTo(to))
1561 {
1562 return false;
1563 }
1564 if (base.noSell != to.noSell || base.isCopy != to.isCopy)
1565 {
1566 return false;
1567 }
1568 if (base.isStolen != to.isStolen)
1569 {
1570 return false;
1571 }
1572 if (base.isCrafted != to.isCrafted)
1573 {
1574 return false;
1575 }
1576 if ((to.isWeightChanged || base.isWeightChanged) && to.SelfWeight != SelfWeight)
1577 {
1578 return false;
1579 }
1580 if (to.c_IDTState != base.c_IDTState)
1581 {
1582 return false;
1583 }
1584 if (to.c_priceAdd != base.c_priceAdd || to.c_priceFix != base.c_priceFix)
1585 {
1586 return false;
1587 }
1588 if (to.ChildrenAndSelfWeight + base.ChildrenAndSelfWeight > 1000000000)
1589 {
1590 return false;
1591 }
1592 if (trait.IsRequireFuel && base.c_charges != to.c_charges)
1593 {
1594 return false;
1595 }
1596 if (base.c_altName != to.c_altName)
1597 {
1598 return false;
1599 }
1600 bool flag = false;
1601 if (to.parent is Card)
1602 {
1603 Window.SaveData windowSaveData = (to.parent as Card).GetWindowSaveData();
1604 if (windowSaveData != null && windowSaveData.compress)
1605 {
1606 flag = true;
1607 }
1608 }
1609 if (flag)
1610 {
1611 if (base.encLV != to.encLV && !base.IsFood)
1612 {
1613 return false;
1614 }
1615 if (elements.dict.Count() != to.elements.dict.Count())
1616 {
1617 return false;
1618 }
1619 foreach (Element value in elements.dict.Values)
1620 {
1621 if (to.elements.GetElement(value.id) == null)
1622 {
1623 return false;
1624 }
1625 }
1626 int num2 = (to.encLV = Mathf.CeilToInt(1f * (float)(base.encLV * base.Num + to.encLV * to.Num) / (float)(base.Num + to.Num)));
1627 base.encLV = num2;
1628 foreach (Element value2 in elements.dict.Values)
1629 {
1630 Element element = to.elements.GetElement(value2.id);
1631 value2.vBase = (element.vBase = (value2.vBase * base.Num + element.vBase * to.Num) / (base.Num + to.Num));
1632 }
1633 return true;
1634 }
1635 if (base.encLV != to.encLV)
1636 {
1637 return false;
1638 }
1639 if (elements.dict.Count() != to.elements.dict.Count())
1640 {
1641 return false;
1642 }
1643 foreach (Element value3 in elements.dict.Values)
1644 {
1645 Element element2 = to.elements.GetElement(value3.id);
1646 if (element2 == null || value3.vBase / 10 * 10 != element2.vBase / 10 * 10)
1647 {
1648 return false;
1649 }
1650 }
1651 return true;
1652 }
Definition: Card.cs:11
int c_priceFix
Definition: Card.cs:1097
bool isCrafted
Definition: Card.cs:766
bool IsDecayed
Definition: Card.cs:2147
int idMaterial
Definition: Card.cs:130
string id
Definition: Card.cs:31
bool noSell
Definition: Card.cs:802
bool isCopy
Definition: Card.cs:850
string c_altName
Definition: Card.cs:1493
int qualityTier
Definition: Card.cs:394
int c_priceAdd
Definition: Card.cs:1109
int c_dyeMat
Definition: Card.cs:1121
ICardParent parent
Definition: Card.cs:51
int c_IDTState
Definition: Card.cs:1193
string c_idRefCard2
Definition: Card.cs:1649
int refVal
Definition: Card.cs:190
Window.SaveData GetWindowSaveData()
Definition: Card.cs:2376
int encLV
Definition: Card.cs:310
bool isDyed
Definition: Card.cs:430
bool isWeightChanged
Definition: Card.cs:634
int rarityLv
Definition: Card.cs:286
int idSkin
Definition: Card.cs:346
bool isGifted
Definition: Card.cs:754
BlessedState blessedState
Definition: Card.cs:262
bool isStolen
Definition: Card.cs:826
int ChildrenAndSelfWeight
Definition: Card.cs:1917
bool isModified
Definition: Card.cs:442
int Num
Definition: Card.cs:154
int c_charges
Definition: Card.cs:1205
string c_idRefCard
Definition: Card.cs:1637
Dictionary< int, Element > dict
int vBase
Definition: ELEMENT.cs:242
override int SelfWeight
Definition: Thing.cs:62
virtual bool CanStackTo(Thing to)
Definition: Trait.cs:543
virtual bool HasCharges
Definition: Trait.cs:317
bool IsRequireFuel
Definition: Trait.cs:451
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_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.qualityTier, Card.rarityLv, Card.refVal, SelfWeight, and Element.vBase.

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

◆ Disassemble()

void Thing.Disassemble ( )
inline

Definition at line 1691 of file Thing.cs.

1692 {
1693 }

Referenced by LayerCraftFloat.RefreshDisassemble().

◆ DoAct()

void Thing.DoAct ( Act  act)
inline

Definition at line 1836 of file Thing.cs.

1837 {
1838 if (!EClass.pc.HasNoGoal || (act.LocalAct && EClass._zone.IsRegion))
1839 {
1840 SE.Beep();
1841 return;
1842 }
1843 EClass.player.hotItemToRestore = EClass.player.currentHotItem;
1844 if (act.IsAct)
1845 {
1846 act.Perform(EClass.pc);
1847 return;
1848 }
1849 AIAct aI = act as AIAct;
1850 EClass.pc.SetAI(aI);
1852 }
Definition: AIAct.cs:6
void SetTurbo(int mtp=-1)
Definition: AM_Adv.cs:1040
virtual bool Perform()
Definition: ACT.cs:264
virtual bool LocalAct
Definition: ACT.cs:169
virtual bool IsAct
Definition: ACT.cs:99
static AM_Adv Adv
Definition: ActionMode.cs:15
AIAct SetAI(AIAct g)
Definition: Chara.cs:8045
bool HasNoGoal
Definition: Chara.cs:821
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:901
virtual bool IsRegion
Definition: Spatial.cs:501

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

◆ GetDisassembles()

void Thing.GetDisassembles ( List< Thing list)
inline

Definition at line 1687 of file Thing.cs.

1688 {
1689 }

Referenced by RecipeUpdater.RunDisassemble().

◆ GetEfficiency()

int Thing.GetEfficiency ( )
inline

Definition at line 141 of file Thing.cs.

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

Referenced by AIWork.GetSession().

◆ GetEnchant()

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

Definition at line 1854 of file Thing.cs.

1855 {
1856 List<SourceElement.Row> list = new List<SourceElement.Row>();
1857 int num = 0;
1858 int num2 = lv + 5 + EClass.rndSqrt(10);
1859 foreach (SourceElement.Row row in EClass.sources.elements.rows)
1860 {
1861 if ((!neg || !row.tag.Contains("flag")) && func(row) && row.LV < num2)
1862 {
1863 list.Add(row);
1864 num += row.chance;
1865 }
1866 }
1867 if (num == 0)
1868 {
1869 return null;
1870 }
1871 int num3 = EClass.rnd(num);
1872 int num4 = 0;
1873 foreach (SourceElement.Row item in list)
1874 {
1875 num4 += item.chance;
1876 if (num3 < num4)
1877 {
1878 string text = EClass.sources.elements.map[item.id].category;
1879 bool flag = text == "skill" || text == "attribute" || text == "resist";
1880 float num5 = (float)(3 + Mathf.Min(lv / 10, 15)) + Mathf.Sqrt(lv * item.encFactor / 100);
1881 int num6 = (item.mtp + EClass.rnd(item.mtp + (int)num5)) / item.mtp * ((!(flag && neg)) ? 1 : (-1));
1882 if (item.encFactor == 0 && num6 > 25)
1883 {
1884 num6 = 25;
1885 }
1886 return new Tuple<SourceElement.Row, int>(item, num6);
1887 }
1888 }
1889 return null;
1890 }
static int rndSqrt(int a)
Definition: EClass.cs:84
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 762 of file Thing.cs.

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

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

◆ GetHoverText()

override string Thing.GetHoverText ( )
inlinevirtual

Reimplemented from Card.

Definition at line 745 of file Thing.cs.

746 {
747 string text = "";
748 text = text + " <size=14>(" + Lang._weight(base.ChildrenAndSelfWeight) + ")</size> ";
750 {
751 text += Environment.NewLine;
752 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;
753 }
754 string hoverText = trait.GetHoverText();
755 if (!hoverText.IsEmpty())
756 {
757 text = text + Environment.NewLine + hoverText;
758 }
759 return base.GetHoverText() + text;
760 }
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:548

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

◆ GetIngredients()

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

Definition at line 1654 of file Thing.cs.

1655 {
1656 if (ing.CanSetThing(this))
1657 {
1658 list.Add(this);
1659 }
1660 if (things.Count <= 0 || base.c_lockLv != 0 || base.isNPCProperty)
1661 {
1662 return;
1663 }
1664 foreach (Thing thing in things)
1665 {
1666 thing.GetIngredients(ing, list);
1667 }
1668 }
void Add(Act a, string s="")
Definition: ActPlan.cs:11
bool CanSetThing(Thing t)
Definition: Recipe.cs:80
Definition: Thing.cs:8
void GetIngredients(Recipe.Ingredient ing, List< Thing > list)
Definition: Thing.cs:1654

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

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

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

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

◆ GetRecipes()

void Thing.GetRecipes ( HashSet< Recipe recipes)
inline

Definition at line 1683 of file Thing.cs.

1684 {
1685 }

Referenced by RecipeUpdater.RunRecipe().

◆ GetSubPassData()

override SubPassData Thing.GetSubPassData ( )
inlinevirtual

Reimplemented from Card.

Definition at line 1528 of file Thing.cs.

1529 {
1530 Chara chara = GetRootCard() as Chara;
1531 if ((!trait.ShowAsTool || (chara == EClass.pc && HotItemHeld.disableTool)) && (chara?.held == this || (!base.isRoofItem && placeState != PlaceState.installed && renderer.data.subCrate.enable && parent is Zone)))
1532 {
1534 {
1535 return EClass.setting.pass.subCrate;
1536 }
1537 return renderer.data.subCrate;
1538 }
1539 return SubPassData.Default;
1540 }
PlaceState
Definition: PlaceState.cs:2
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
bool isRoofItem
Definition: Card.cs:550
PlaceState placeState
Definition: Card.cs:79
CardRenderer renderer
Definition: Card.cs:57
static GameSetting setting
Definition: EClass.cs:34
PassSetting pass
Definition: GameSetting.cs:303
SubPassData subCrate
Definition: RenderData.cs:46
RenderData data
Definition: RenderObject.cs:34
static SubPassData Default
Definition: SubPassData.cs:7
Definition: Zone.cs:12

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

◆ Identify()

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

Definition at line 1959 of file Thing.cs.

1960 {
1961 if (base.IsIdentified)
1962 {
1963 return this;
1964 }
1965 string @ref = "";
1966 string text = "";
1967 if (show)
1968 {
1969 @ref = GetName(NameStyle.Full, base.Num);
1970 }
1971 Rarity rarity = idtSource switch
1972 {
1973 IDTSource.SkillHigh => Rarity.Legendary,
1974 IDTSource.Skill => Rarity.Superior,
1975 _ => Rarity.Normal,
1976 };
1977 if (rarity != 0 && ((base.IsEquipmentOrRangedOrAmmo && base.rarity >= rarity) || base.rarity >= Rarity.Mythical))
1978 {
1979 base.c_IDTState = 3;
1980 }
1981 else if (base.rarity >= Rarity.Mythical && idtSource != IDTSource.SuperiorIdentify)
1982 {
1983 base.c_IDTState = 1;
1984 }
1985 else
1986 {
1987 base.c_IDTState = 0;
1988 }
1989 if (show)
1990 {
1991 text = GetName(NameStyle.Full, base.Num);
1992 if (base.c_IDTState == 0)
1993 {
1994 Msg.Say("identified", @ref, text);
1995 }
1996 else
1997 {
1998 Msg.Say((idtSource == IDTSource.Skill) ? "identified3" : "identified2", @ref, text, base.TextRarity);
1999 }
2000 }
2001 if (base.IsIdentified)
2002 {
2003 GetRootCard()?.TryStack(this);
2004 }
2006 return this;
2007 }
IDTSource
Definition: IDTSource.cs:2
Rarity rarity
Definition: Card.cs:298
void TryStack(Thing t)
Definition: Card.cs:6176
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:494

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

1671 {
1672 if (isDestroyed)
1673 {
1674 return false;
1675 }
1676 if (GetRootCard().Dist(EClass.pc) > 1 || !ing.CanSetThing(this))
1677 {
1678 return false;
1679 }
1680 return true;
1681 }
bool isDestroyed
Definition: Card.cs:71
int Dist(Card c)
Definition: Card.cs:6777

References EClass.pc.

Referenced by DropdownGrid.BuildIngredients().

◆ ListLimitedValidTraits()

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

Definition at line 787 of file Thing.cs.

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

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

◆ ListValidTraits()

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

Definition at line 812 of file Thing.cs.

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

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

2010 {
2011 if (trait is TraitGene)
2012 {
2013 DNA dNA = base.c_DNA;
2014 if (dNA == null || dNA.type == DNA.Type.Brain || dNA.type == DNA.Type.Inferior)
2015 {
2016 return false;
2017 }
2018 for (int i = 0; i < dNA.vals.Count; i += 2)
2019 {
2020 SourceElement.Row row = EClass.sources.elements.map.TryGetValue(dNA.vals[i]);
2021 if (row.name.ToLower().Contains(s))
2022 {
2023 return true;
2024 }
2025 if (row.GetName().ToLower().Contains(s))
2026 {
2027 return true;
2028 }
2029 }
2030 }
2031 else
2032 {
2033 if (!base.IsIdentified)
2034 {
2035 return false;
2036 }
2037 foreach (Element value in elements.dict.Values)
2038 {
2039 if (value.Value != 0)
2040 {
2041 if (value.source.name.ToLower().Contains(s))
2042 {
2043 return true;
2044 }
2045 if (value.source.GetName().ToLower().Contains(s))
2046 {
2047 return true;
2048 }
2049 }
2050 }
2051 }
2052 return false;
2053 }
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:263
override string GetName()

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

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

◆ OnCreate()

override void Thing.OnCreate ( int  genLv)
inlinevirtual

Reimplemented from Card.

Definition at line 162 of file Thing.cs.

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

1956 {
1957 }

◆ SetRenderParam()

override void Thing.SetRenderParam ( RenderParam  p)
inlinevirtual

Reimplemented from Card.

Definition at line 1401 of file Thing.cs.

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

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

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

◆ SetSource()

override void Thing.SetSource ( )
inlinevirtual

Reimplemented from Card.

Definition at line 146 of file Thing.cs.

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

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

◆ ShowSplitMenu()

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

Definition at line 1695 of file Thing.cs.

1696 {
1697 int count = 1;
1698 UIContextMenu i = EClass.ui.CreateContextMenuInteraction();
1699 bool buy = trans != null;
1700 UIButton buttonBuy = null;
1701 UIItem itemSlider = null;
1702 itemSlider = i.AddSlider("sliderSplitMenu", "adjustmentNum", (float a) => (!EClass.core.IsGameStarted) ? "" : ("/" + base.Num), count, delegate(float b)
1703 {
1704 count = (int)b;
1705 if (trans != null)
1706 {
1707 trans.num = count;
1708 }
1709 UpdateButton();
1710 }, 1f, base.Num, isInt: true, hideOther: false, useInput: true).GetComponent<UIItem>();
1711 if (buy)
1712 {
1713 buttonBuy = i.AddButton("invBuy", delegate
1714 {
1715 Process();
1716 });
1717 }
1718 i.onDestroy = delegate
1719 {
1720 if (!buy && !i.wasCanceled)
1721 {
1722 Process();
1723 }
1724 };
1725 i.Show();
1726 if ((bool)buttonBuy)
1727 {
1728 buttonBuy.gameObject.AddComponent<CanvasGroup>();
1729 }
1730 UpdateButton();
1731 void Process()
1732 {
1733 if (!EClass.core.IsGameStarted || button == null || button.card == null)
1734 {
1735 Debug.Log("Split bug1");
1736 }
1737 else if (button.card.isDestroyed || button.card.Num < count)
1738 {
1739 Debug.Log("Split bug2");
1740 }
1741 else if (EClass.pc.isDead)
1742 {
1743 Debug.Log("Split bug3");
1744 }
1745 else if (count != 0 && !Input.GetMouseButton(1))
1746 {
1747 if (trans != null)
1748 {
1749 trans.Process(startTransaction: true);
1750 }
1751 else
1752 {
1753 DragItemCard dragItemCard = new DragItemCard(button);
1754 if (count != base.Num)
1755 {
1756 Thing thing = button.card.Split(base.Num - count);
1757 button.invOwner.Container.AddThing(thing, tryStack: false);
1758 thing.invX = dragItemCard.from.invX;
1759 thing.invY = dragItemCard.from.invY;
1760 thing.posInvX = button.card.Thing.posInvX;
1761 thing.posInvY = button.card.Thing.posInvY;
1762 }
1763 EClass.ui.StartDrag(dragItemCard);
1764 }
1765 }
1766 }
1767 void UpdateButton()
1768 {
1769 itemSlider.text1.text = GetName(NameStyle.FullNoArticle, 1);
1770 itemSlider.text2.text = Lang._weight(SelfWeight * count);
1771 if ((bool)buttonBuy)
1772 {
1773 buttonBuy.mainText.SetText(trans.GetTextDetail());
1774 buttonBuy.mainText.RebuildLayoutTo<UIButton>();
1775 buttonBuy.interactable = trans.IsValid();
1776 buttonBuy.RebuildLayout(recursive: true);
1777 buttonBuy.gameObject.GetComponent<CanvasGroup>().alpha = (trans.IsValid() ? 1f : 0.9f);
1778 }
1779 }
1780 }
Card card
Definition: ButtonGrid.cs:24
InvOwner invOwner
Definition: ButtonGrid.cs:28
int posInvY
Definition: Card.cs:334
Thing Split(int a)
Definition: Card.cs:3231
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:2901
virtual Thing Thing
Definition: Card.cs:1934
int posInvX
Definition: Card.cs:322
bool isDead
Definition: Chara.cs:374
DragInfo from
Definition: DragItemCard.cs:54
static UI ui
Definition: EClass.cs:16
string GetTextDetail()
Definition: InvOwner.cs:452
bool Process(bool startTransaction=false)
Definition: InvOwner.cs:135
Card Container
Definition: InvOwner.cs:540
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 1782 of file Thing.cs.

1783 {
1784 int count = 1;
1785 UIContextMenu uIContextMenu = EClass.ui.CreateContextMenuInteraction();
1786 UIButton buttonBuy = null;
1787 UIItem itemSlider = null;
1788 itemSlider = uIContextMenu.AddSlider("sliderSplitMenu", "adjustmentNum", (float a) => (!EClass.core.IsGameStarted) ? "" : ("/" + base.Num), count, delegate(float b)
1789 {
1790 count = (int)b;
1791 UpdateButton();
1792 }, 1f, base.Num, isInt: true, hideOther: false, useInput: true).GetComponent<UIItem>();
1793 buttonBuy = uIContextMenu.AddButton("invBuy", delegate
1794 {
1795 Process();
1796 });
1797 uIContextMenu.onDestroy = delegate
1798 {
1799 };
1800 uIContextMenu.Show();
1801 if ((bool)buttonBuy)
1802 {
1803 buttonBuy.gameObject.AddComponent<CanvasGroup>();
1804 }
1805 UpdateButton();
1806 void Process()
1807 {
1808 if (!EClass.core.IsGameStarted || button == null || button.card == null)
1809 {
1810 Debug.Log("Split bug1");
1811 }
1812 else if (button.card.isDestroyed || button.card.Num < count)
1813 {
1814 Debug.Log("Split bug2");
1815 }
1816 else if (EClass.pc.isDead)
1817 {
1818 Debug.Log("Split bug3");
1819 }
1820 else if (count != 0 && !Input.GetMouseButton(1))
1821 {
1822 onSplit?.Invoke(count);
1823 }
1824 }
1825 void UpdateButton()
1826 {
1827 itemSlider.text1.text = GetName(NameStyle.FullNoArticle, 1);
1828 itemSlider.text2.text = Lang._weight(SelfWeight * count);
1829 buttonBuy.mainText.SetText(lang.lang(count.ToString() ?? ""));
1830 buttonBuy.mainText.RebuildLayoutTo<UIButton>();
1831 buttonBuy.interactable = true;
1832 buttonBuy.RebuildLayout(recursive: true);
1833 }
1834 }
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 1892 of file Thing.cs.

1893 {
1894 if (!base.IsEquipment || base.IsCursed || base.rarity <= Rarity.Normal || GetInt(107) > 0)
1895 {
1896 return;
1897 }
1898 SetInt(107, 1);
1899 if (tg == null)
1900 {
1901 Rand.SetSeed(EClass.world.date.day + source._index + c.uid);
1902 if (msg)
1903 {
1904 c.Say("lick", c, this);
1905 PlaySound("offering");
1906 PlayEffect("mutation");
1907 }
1908 Element element = AddEnchant(base.LV);
1909 if (element != null)
1910 {
1911 SetInt(107, element.id);
1912 }
1913 }
1914 else
1915 {
1916 Rand.SetSeed(base.uid);
1917 List<Element> list = new List<Element>();
1918 foreach (Element value in elements.dict.Values)
1919 {
1920 if (value.id != 67 && value.id != 66 && value.id != 64 && value.id != 65)
1921 {
1922 list.Add(value);
1923 }
1924 }
1925 if (list.Count > 0)
1926 {
1927 Element element2 = list.RandomItem();
1928 elements.ModBase(element2.id, Mathf.Max(EClass.rnd(Mathf.Abs(element2.vBase / 5)), 1));
1929 SetInt(107, element2.id);
1930 }
1931 if (msg)
1932 {
1933 c.Say("lick2", c, tg, slot.name.ToLower());
1934 tg.PlaySound("offering");
1935 tg.PlayEffect("mutation");
1936 }
1937 }
1938 Rand.SetSeed();
1939 }
void SetInt(int id, int value=0)
Definition: BaseCard.cs:39
string name
Definition: BodySlot.cs:14
int uid
Definition: Card.cs:118
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:5438
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:6046
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 837 of file Thing.cs.

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

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

Member Data Documentation

◆ MaxFurnitureEnc

const int Thing.MaxFurnitureEnc = 12
static

Definition at line 9 of file Thing.cs.

◆ source

◆ stackOrder

int Thing.stackOrder

Definition at line 13 of file Thing.cs.

Referenced by Map.Save().

◆ tempName

string Thing.tempName

Definition at line 15 of file Thing.cs.

Referenced by ThingContainer.RefreshGrid().

Property Documentation

◆ CanSearchContents

bool Thing.CanSearchContents
get

Definition at line 79 of file Thing.cs.

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

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

◆ isEquipped

◆ IsMeleeWithAmmo

bool Thing.IsMeleeWithAmmo
get

Definition at line 19 of file Thing.cs.

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

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

◆ IsSharedContainer

bool Thing.IsSharedContainer
get

Definition at line 91 of file Thing.cs.

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

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

◆ isThing

override bool Thing.isThing
get

Definition at line 45 of file Thing.cs.

◆ Penetration

int Thing.Penetration
get

Definition at line 33 of file Thing.cs.

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

Referenced by AttackProcess.Prepare().

◆ Pref

override SourcePref Thing.Pref
get

Definition at line 49 of file Thing.cs.

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

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

◆ range

int Thing.range
get

Definition at line 31 of file Thing.cs.

Referenced by TraitTrainingDummy.IdleUse().

◆ SelfWeight

override int Thing.SelfWeight
get

Definition at line 61 of file Thing.cs.

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

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

◆ sourceCard

◆ Tiles

override int [] Thing.Tiles
get

Definition at line 77 of file Thing.cs.


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