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

Public Member Functions

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

Static Public Member Functions

static void AddAttackEvaluation (UINote n, Chara chara, Thing current=null)
 
static Tuple< SourceElement.Row, int > GetEnchant (long lv, Func< SourceElement.Row, bool > func, bool neg)
 
- Static Public Member Functions inherited from Card
static string ApplyTone (Chara c, ref string text, string _tones, int gender, bool stripPun=false)
 
static int GetTilePrice (TileRow row, SourceMaterial.Row mat)
 
- Static Public Member Functions inherited from EClass
static int rndSeed (int a, int seed)
 
static int rnd (long a)
 
static int rnd (int a)
 
static int curve (int _a, int start, int step, int rate=75)
 
static int sqrt (int a)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 

Public Attributes

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

Static Public Attributes

const int MaxFurnitureEnc = 12
 
- Static Public Attributes inherited from Card
const int MaxWeight = 10000000
 
const int SocketDiv = 1000
 
const int DamageLimit = 99999999
 
- 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]
 
override RenderRow TileRow [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 genLv [get, set]
 
int refVal [get, set]
 
int decay [get, set]
 
int altitude [get, set]
 
int hp [get, set]
 
float fx [get, set]
 
float fy [get, set]
 
BlessedState blessedState [get, set]
 
PlaceState _placeState [get, set]
 
int rarityLv [get, set]
 
Rarity rarity [get, set]
 
int encLV [get, set]
 
int posInvX [get, set]
 
int posInvY [get, set]
 
int idSkin [get, set]
 
int feat [get, set]
 
int LV [get, set]
 
int exp [get, set]
 
int tier [get, set]
 
int version [get, set]
 
bool isCensored [get, set]
 
bool isDeconstructing [get, set]
 
bool isDyed [get, set]
 
bool isModified [get, set]
 
bool isNew [get, set]
 
bool isPlayerCreation [get, set]
 
bool ignoreAutoPick [get, set]
 
bool freePos [get, set]
 
bool isHidden [get, set]
 
bool isOn [get, set]
 
bool isNPCProperty [get, set]
 
bool isRestrained [get, set]
 
bool isRoofItem [get, set]
 
bool isMasked [get, set]
 
bool disableAutoToggle [get, set]
 
bool isImported [get, set]
 
bool autoRefuel [get, set]
 
bool ignoreStackHeight [get, set]
 
bool isFloating [get, set]
 
bool isWeightChanged [get, set]
 
bool isFireproof [get, set]
 
bool isAcidproof [get, set]
 
bool isReplica [get, set]
 
bool isSummon [get, set]
 
bool isElemental [get, set]
 
bool isBroken [get, set]
 
bool isSubsetCard [get, set]
 
bool noSnow [get, set]
 
bool noMove [get, set]
 
bool isGifted [get, set]
 
bool isCrafted [get, set]
 
bool isLostProperty [get, set]
 
bool noShadow [get, set]
 
bool noSell [get, set]
 
bool isLeashed [get, set]
 
bool isStolen [get, set]
 
bool isSale [get, set]
 
bool isCopy [get, set]
 
bool isRestocking [get, set]
 
bool hasSpawned [get, set]
 
bool isScaled [get, set]
 
bool isBackerContent [get]
 
SourceBacker.Row sourceBacker [get]
 
BedType c_bedType [get, set]
 
int c_equippedSlot [get, set]
 
int c_lockLv [get, set]
 
Hostility c_originalHostility [get, set]
 
MinionType c_minionType [get, set]
 
int c_vomit [get, set]
 
bool c_wasInPcParty [get, set]
 
bool c_isImportant [get, set]
 
bool c_lockedHard [get, set]
 
bool c_revealLock [get, set]
 
bool c_isTrained [get, set]
 
bool c_isPrayed [get, set]
 
bool c_isDisableStockUse [get, set]
 
int c_lightColor [get, set]
 
Color LightColor [get]
 
int c_uidZone [get, set]
 
int c_uidRefCard [get, set]
 
int c_priceFix [get, set]
 
int c_priceAdd [get, set]
 
int c_priceCopy [get, set]
 
int c_fixedValue [get, set]
 
int c_dyeMat [get, set]
 
VisitorState visitorState [get, set]
 
RescueState c_rescueState [get, set]
 
BossType c_bossType [get, set]
 
int c_dateStockExpire [get, set]
 
int c_dateDeathLock [get, set]
 
int c_IDTState [get, set]
 
int c_charges [get, set]
 
int c_bill [get, set]
 
int c_invest [get, set]
 
int c_seed [get, set]
 
int c_allowance [get, set]
 
int c_fur [get, set]
 
int c_dateCooked [get, set]
 
int c_lockedAge [get, set]
 
int c_containerSize [get, set]
 
int c_weight [get, set]
 
int c_diceDim [get, set]
 
int c_indexContainerIcon [get, set]
 
int c_idMainElement [get, set]
 
int c_summonDuration [get, set]
 
int c_idBacker [get, set]
 
int c_uidMaster [get, set]
 
int c_ammo [get, set]
 
int c_daysWithGod [get, set]
 
int c_daysWithPC [get, set]
 
string c_idPortrait [get, set]
 
string c_idRace [get, set]
 
string c_idJob [get, set]
 
string c_idTone [get, set]
 
string c_color [get, set]
 
string c_idSpriteReplacer [get, set]
 
string c_idTalk [get, set]
 
string c_idDeity [get, set]
 
string c_altName [get, set]
 
string c_altName2 [get, set]
 
string c_extraNameRef [get, set]
 
string c_refText [get, set]
 
string c_idRefName [get, set]
 
string c_idRidePCC [get, set]
 
string c_idAbility [get, set]
 
string c_context [get, set]
 
string c_idEditor [get, set]
 
string c_editorTags [get, set]
 
string c_editorTraitVal [get, set]
 
string c_idTrait [get, set]
 
string c_idRefCard [get, set]
 
string c_idRefCard2 [get, set]
 
string c_note [get, set]
 
UniqueData c_uniqueData [get, set]
 
Thing ammoData [get, set]
 
List< SocketDatasocketList [get, set]
 
Thing c_copyContainer [get, set]
 
Window.SaveData c_windowSaveData [get, set]
 
CharaUpgrade c_upgrades [get, set]
 
CharaGenes c_genes [get, set]
 
List< int > c_corruptionHistory [get, set]
 
ContainerUpgrade c_containerUpgrade [get, set]
 
DNA c_DNA [get, set]
 
CharaList c_charaList [get, set]
 
MixedFoodData c_mixedFoodData [get, set]
 
Thing c_bloodData [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]
 
virtual RenderRow TileRow [get]
 
TileType TileType [get]
 
string Name [get]
 
string NameSimple [get]
 
string NameOne [get]
 
virtual bool IsPC [get]
 
bool _IsPC [get]
 
virtual bool IsPCC [get]
 
virtual bool IsPCParty [get]
 
virtual bool IsMinion [get]
 
virtual bool IsPCPartyMinion [get]
 
virtual bool IsPCFactionMinion [get]
 
virtual bool IsMultisize [get]
 
bool IsToolbelt [get]
 
bool IsLightsource [get]
 
bool IsEquipment [get]
 
bool IsFood [get]
 
bool IsInheritFoodTraits [get]
 
bool ShowFoodEnc [get]
 
bool IsWeapon [get]
 
bool IsEquipmentOrRanged [get]
 
bool IsEquipmentOrRangedOrAmmo [get]
 
bool IsMeleeWeapon [get]
 
bool IsRangedWeapon [get]
 
bool IsThrownWeapon [get]
 
bool IsAmmo [get]
 
bool IsAgent [get]
 
bool IsFurniture [get]
 
bool IsBlessed [get]
 
bool IsCursed [get]
 
bool IsRestrainedResident [get]
 
virtual bool IsPCFaction [get]
 
bool IsPCFactionOrMinion [get]
 
virtual bool IsGlobal [get]
 
virtual int MaxDecay [get]
 
bool IsDecayed [get]
 
bool IsRotting [get]
 
bool IsFresn [get]
 
virtual int MaxHP [get]
 
virtual int Power [get]
 
int FameLv [get]
 
virtual int[] Tiles [get]
 
virtual int PrefIndex [get]
 
bool IsVariation [get]
 
virtual int DV [get]
 
virtual int PV [get]
 
int HIT [get]
 
int DMG [get]
 
int STR [get]
 
int DEX [get]
 
int END [get]
 
int PER [get]
 
int LER [get]
 
int WIL [get]
 
int MAG [get]
 
int CHA [get]
 
int INT [get]
 
int LUC [get]
 
int W [get]
 
int H [get]
 
bool IsIdentified [get]
 
string TextRarity [get]
 
bool IsInstalled [get]
 
bool IsMale [get]
 
bool IsNegativeGift [get]
 
bool HasContainerSize [get]
 
Thing Tool [get]
 
virtual SourceMaterial.Row DefaultMaterial [get]
 
virtual bool HasHost [get]
 
int Quality [get]
 
int QualityLv [get]
 
LightData LightData [get]
 
CardRenderer HostRenderer [get]
 
bool ShouldShowMsg [get]
 
bool CanInspect [get]
 
string InspectName [get]
 
Point InspectPoint [get]
 
Vector3 InspectPosition [get]
 
- Properties inherited from EClass
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Faction Wilds [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 
- Properties inherited from IInspect
bool CanInspect [get]
 
string InspectName [get]
 
Point InspectPoint [get]
 
Vector3 InspectPosition [get]
 

Additional Inherited Members

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

Detailed Description

Definition at line 7 of file Thing.cs.

Member Function Documentation

◆ AddAttackEvaluation()

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

Definition at line 1465 of file Thing.cs.

1466 {
1467 n.AddHeader("headerAttackEval");
1468 int num = 0;
1469 foreach (BodySlot slot in chara.body.slots)
1470 {
1471 if (slot.thing == null || slot.elementId != 35 || slot.thing.source.offense.Length < 2)
1472 {
1473 continue;
1474 }
1475 AttackProcess.Current.Prepare(chara, slot.thing, null, null, num);
1476 string text = AttackProcess.Current.GetText();
1477 if (slot.thing == current)
1478 {
1479 text = text.TagColor(() => true);
1480 }
1481 n.AddText(text);
1482 num++;
1483 }
1484 AttackProcess.Current.Prepare(chara, null);
1485 string text2 = AttackProcess.Current.GetText();
1486 if (num == 0)
1487 {
1488 text2 = text2.TagColor(() => true);
1489 }
1490 n.AddText(text2);
1491 }
void Prepare(Chara _CC, Thing _weapon, Card _TC=null, Point _TP=null, int _attackIndex=0, bool _isThrow=false)
static AttackProcess Current
Definition: AttackProcess.cs:8
string GetText()
int elementId
Definition: BodySlot.cs:6
Thing thing
Definition: BodySlot.cs:8
List< BodySlot > slots
Definition: CharaBody.cs:8
CharaBody body
Definition: Chara.cs:94
SourceThing.Row source
Definition: Thing.cs:11
UIItem AddHeader(string text, Sprite sprite=null)
Definition: UINote.cs:79
UIItem AddText(string text, FontColor color=FontColor.DontChange)
Definition: UINote.cs:113

References UINote.AddHeader(), Chara.body, AttackProcess.Current, BodySlot.elementId, AttackProcess.GetText(), AttackProcess.Prepare(), CharaBody.slots, source, and BodySlot.thing.

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

◆ AddEnchant()

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

Definition at line 2065 of file Thing.cs.

2066 {
2067 if (base.IsToolbelt || base.IsLightsource)
2068 {
2069 return null;
2070 }
2071 Tuple<SourceElement.Row, int> enchant = GetEnchant(lv, (SourceElement.Row r) => r.IsEncAppliable(base.category), base.IsCursed);
2072 if (enchant == null)
2073 {
2074 return null;
2075 }
2076 return elements.ModBase(enchant.Item1.id, enchant.Item2);
2077 }
ElementContainerCard elements
Definition: Card.cs:41
Element ModBase(int ele, int v)
static Tuple< SourceElement.Row, int > GetEnchant(long lv, Func< SourceElement.Row, bool > func, bool neg)
Definition: Thing.cs:1978

Referenced by OnCreate().

◆ ApplyMaterial()

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

Reimplemented from Card.

Definition at line 358 of file Thing.cs.

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

341 {
342 Chara chara = null;
344 {
345 chara = GetRootCard()?.Chara;
346 if (chara != null)
347 {
349 }
350 }
351 elements.ApplyMaterialElementMap(this, remove);
352 if (chara != null)
353 {
354 elements.SetParent(chara);
355 }
356 }
virtual Chara Chara
Definition: Card.cs:2070
Card GetRootCard()
Definition: Card.cs:3428
Definition: Chara.cs:10
bool IsGameStarted
Definition: Core.cs:84
static Core core
Definition: EClass.cs:7
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 129 of file Thing.cs.

130 {
131 if (GetRootCard() != c)
132 {
133 return false;
134 }
135 if (HasTag(CTAG.throwWeapon))
136 {
137 return true;
138 }
139 if (!trait.CanAutofire)
140 {
141 return false;
142 }
143 if (trait is TraitToolRange)
144 {
145 if ((c.IsPCFaction && c.body.IsTooHeavyToEquip(this)) || reloading)
146 {
147 return false;
148 }
149 }
150 else if (trait is TraitAbility && c.IsPC)
151 {
152 Act act = (trait as TraitAbility).act;
153 Element element = c.elements.GetElement(act.id);
154 if (act is Spell && (element == null || element.vPotential == 0))
155 {
156 return false;
157 }
158 }
159 return true;
160 }
Definition: ACT.cs:62
bool HasTag(CTAG tag)
Definition: Card.cs:2597
Trait trait
Definition: Card.cs:53
bool IsTooHeavyToEquip(Thing thing)
Definition: CharaBody.cs:160
override bool IsPC
Definition: Chara.cs:612
override bool IsPCFaction
Definition: Chara.cs:671
Element GetElement(string alias)
int id
Definition: ELEMENT.cs:250
int vPotential
Definition: ELEMENT.cs:256
Definition: SPELL.cs:620
virtual bool CanAutofire
Definition: Trait.cs:145

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

1659 {
1660 if (trait.HasCharges || to.isEquipped || base.isModified || to.isModified || to.id != id || to.idMaterial != base.idMaterial || to.refVal != base.refVal || to.blessedState != base.blessedState || to.rarityLv != base.rarityLv || to.tier != base.tier || to.idSkin != base.idSkin || to.isGifted != base.isGifted)
1661 {
1662 return false;
1663 }
1664 if ((to.isDyed || base.isDyed) && to.c_dyeMat != base.c_dyeMat)
1665 {
1666 return false;
1667 }
1668 if (base.c_idRefCard != to.c_idRefCard || base.c_idRefCard2 != to.c_idRefCard2)
1669 {
1670 return false;
1671 }
1672 if (base.IsDecayed != to.IsDecayed)
1673 {
1674 return false;
1675 }
1676 if (!trait.CanStackTo(to))
1677 {
1678 return false;
1679 }
1680 if (base.noSell != to.noSell || base.isCopy != to.isCopy)
1681 {
1682 return false;
1683 }
1684 if (base.isStolen != to.isStolen)
1685 {
1686 return false;
1687 }
1688 if (base.isCrafted != to.isCrafted)
1689 {
1690 return false;
1691 }
1692 if ((to.isWeightChanged || base.isWeightChanged) && to.SelfWeight != SelfWeight)
1693 {
1694 return false;
1695 }
1696 if (to.c_IDTState != base.c_IDTState)
1697 {
1698 return false;
1699 }
1700 if (to.c_priceAdd != base.c_priceAdd || to.c_priceFix != base.c_priceFix || to.c_priceCopy != base.c_priceCopy)
1701 {
1702 return false;
1703 }
1704 if (to.ChildrenAndSelfWeight + base.ChildrenAndSelfWeight > 1000000000)
1705 {
1706 return false;
1707 }
1708 if (trait.IsRequireFuel && base.c_charges != to.c_charges)
1709 {
1710 return false;
1711 }
1712 if (base.c_altName != to.c_altName)
1713 {
1714 return false;
1715 }
1716 if (base.Num + to.Num <= 0)
1717 {
1718 return false;
1719 }
1720 bool flag = false;
1721 if (to.parent is Card)
1722 {
1723 Window.SaveData windowSaveData = (to.parent as Card).GetWindowSaveData();
1724 if (windowSaveData != null && windowSaveData.compress)
1725 {
1726 flag = true;
1727 }
1728 }
1729 if (flag)
1730 {
1731 if (base.encLV != to.encLV && !base.IsFood)
1732 {
1733 return false;
1734 }
1735 if (elements.dict.Count() != to.elements.dict.Count())
1736 {
1737 return false;
1738 }
1739 foreach (Element value in elements.dict.Values)
1740 {
1741 if (to.elements.GetElement(value.id) == null)
1742 {
1743 return false;
1744 }
1745 }
1746 int num2 = (to.encLV = Mathf.CeilToInt(1f * (float)(base.encLV * base.Num + to.encLV * to.Num) / (float)(base.Num + to.Num)));
1747 base.encLV = num2;
1748 foreach (Element value2 in elements.dict.Values)
1749 {
1750 Element element = to.elements.GetElement(value2.id);
1751 value2.vBase = (element.vBase = (value2.vBase * base.Num + element.vBase * to.Num) / (base.Num + to.Num));
1752 }
1753 return true;
1754 }
1755 if (base.encLV != to.encLV)
1756 {
1757 return false;
1758 }
1759 if (elements.dict.Count() != to.elements.dict.Count())
1760 {
1761 return false;
1762 }
1763 foreach (Element value3 in elements.dict.Values)
1764 {
1765 Element element2 = to.elements.GetElement(value3.id);
1766 if (element2 == null || value3.vBase / 10 * 10 != element2.vBase / 10 * 10)
1767 {
1768 return false;
1769 }
1770 }
1771 return true;
1772 }
Definition: Card.cs:11
int c_priceFix
Definition: Card.cs:1137
bool isCrafted
Definition: Card.cs:794
int tier
Definition: Card.cs:410
bool IsDecayed
Definition: Card.cs:2289
int idMaterial
Definition: Card.cs:134
string id
Definition: Card.cs:35
bool noSell
Definition: Card.cs:830
bool isCopy
Definition: Card.cs:878
string c_altName
Definition: Card.cs:1593
int c_priceAdd
Definition: Card.cs:1149
int c_dyeMat
Definition: Card.cs:1185
ICardParent parent
Definition: Card.cs:55
int c_priceCopy
Definition: Card.cs:1161
int c_IDTState
Definition: Card.cs:1257
string c_idRefCard2
Definition: Card.cs:1749
int refVal
Definition: Card.cs:206
Window.SaveData GetWindowSaveData()
Definition: Card.cs:2518
int encLV
Definition: Card.cs:326
bool isDyed
Definition: Card.cs:458
bool isWeightChanged
Definition: Card.cs:662
int rarityLv
Definition: Card.cs:302
int idSkin
Definition: Card.cs:362
bool isGifted
Definition: Card.cs:782
BlessedState blessedState
Definition: Card.cs:278
bool isStolen
Definition: Card.cs:854
int ChildrenAndSelfWeight
Definition: Card.cs:2041
bool isModified
Definition: Card.cs:470
int Num
Definition: Card.cs:158
int c_charges
Definition: Card.cs:1269
string c_idRefCard
Definition: Card.cs:1737
Dictionary< int, Element > dict
int vBase
Definition: ELEMENT.cs:252
override int SelfWeight
Definition: Thing.cs:67
virtual bool CanStackTo(Thing to)
Definition: Trait.cs:605
virtual bool HasCharges
Definition: Trait.cs:331
bool IsRequireFuel
Definition: Trait.cs:467
bool compress
Definition: Window.cs:415

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

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

◆ Disassemble()

void Thing.Disassemble ( )
inline

Definition at line 1811 of file Thing.cs.

1812 {
1813 }

Referenced by LayerCraftFloat.RefreshDisassemble().

◆ DoAct()

void Thing.DoAct ( Act  act)
inline

Definition at line 1960 of file Thing.cs.

1961 {
1962 if (!EClass.pc.HasNoGoal || (act.LocalAct && EClass._zone.IsRegion))
1963 {
1964 SE.Beep();
1965 return;
1966 }
1967 EClass.player.hotItemToRestore = EClass.player.currentHotItem;
1968 if (act.IsAct)
1969 {
1970 act.Perform(EClass.pc);
1971 return;
1972 }
1973 AIAct aI = act as AIAct;
1974 EClass.pc.SetAI(aI);
1976 }
Definition: AIAct.cs:6
void SetTurbo(int mtp=-1)
Definition: AM_Adv.cs:1040
virtual bool Perform()
Definition: ACT.cs:266
virtual bool LocalAct
Definition: ACT.cs:171
virtual bool IsAct
Definition: ACT.cs:101
static AM_Adv Adv
Definition: ActionMode.cs:15
AIAct SetAI(AIAct g)
Definition: Chara.cs:8880
bool HasNoGoal
Definition: Chara.cs:1000
static Zone _zone
Definition: EClass.cs:21
static Player player
Definition: EClass.cs:13
static Chara pc
Definition: EClass.cs:15
HotItem currentHotItem
Definition: Player.cs:1100
virtual bool IsRegion
Definition: Spatial.cs:515

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

1808 {
1809 }

Referenced by RecipeUpdater.RunDisassemble().

◆ GetEfficiency()

int Thing.GetEfficiency ( )
inline

Definition at line 162 of file Thing.cs.

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

Referenced by AIWork.GetSession().

◆ GetEnchant()

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

Definition at line 1978 of file Thing.cs.

1979 {
1980 List<SourceElement.Row> list = new List<SourceElement.Row>();
1981 int num = 0;
1982 long num2 = lv + 5 + EClass.rndSqrt(10);
1983 foreach (SourceElement.Row row in EClass.sources.elements.rows)
1984 {
1985 if ((!neg || !row.tag.Contains("flag")) && func(row) && row.LV < num2)
1986 {
1987 list.Add(row);
1988 num += row.chance;
1989 }
1990 }
1991 if (num == 0)
1992 {
1993 return null;
1994 }
1995 int num3 = EClass.rnd(num);
1996 int num4 = 0;
1997 foreach (SourceElement.Row item in list)
1998 {
1999 num4 += item.chance;
2000 if (num3 < num4)
2001 {
2002 string text = EClass.sources.elements.map[item.id].category;
2003 bool flag = text == "skill" || text == "attribute" || text == "resist";
2004 float num5 = 3f + Mathf.Min(lv / 10, 15f) + Mathf.Sqrt(lv * item.encFactor / 100);
2005 int num6 = (item.mtp + EClass.rnd(item.mtp + (int)num5)) / item.mtp * ((!(flag && neg)) ? 1 : (-1));
2006 if (item.encFactor == 0 && num6 > 25)
2007 {
2008 num6 = 25;
2009 }
2010 return new Tuple<SourceElement.Row, int>(item, num6);
2011 }
2012 }
2013 return null;
2014 }
static int rndSqrt(int a)
Definition: EClass.cs:107
static SourceManager sources
Definition: EClass.cs:43
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 807 of file Thing.cs.

808 {
809 string text = "";
810 if (trait.ShowChildrenNumber && base.c_lockLv == 0 && EClass._zone.IsPCFactionOrTent)
811 {
812 if (things.Count > 0)
813 {
814 text += "childCount".lang(things.Count.ToString() ?? "");
815 }
816 else if (trait.CanOpenContainer)
817 {
818 text += "empty".lang();
819 }
820 }
822 {
823 Room room = pos.cell.room;
824 if (EClass.debug.enable && room != null && room.data.group != 0)
825 {
826 text = text + " #" + room.data.group;
827 }
828 }
829 return text;
830 }
int group
Definition: AreaData.cs:18
AreaData data
Definition: BaseArea.cs:29
Point pos
Definition: Card.cs:59
ThingContainer things
Definition: Card.cs:38
Room room
Definition: Cell.cs:102
bool enable
Definition: CoreDebug.cs:286
static CoreDebug debug
Definition: EClass.cs:49
bool IsValid
Definition: Point.cs:88
Cell cell
Definition: Point.cs:51
Definition: Room.cs:4
virtual bool ShowChildrenNumber
Definition: Trait.cs:335
virtual bool CanOpenContainer
Definition: Trait.cs:236
bool IsPCFactionOrTent
Definition: Zone.cs:476

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

◆ GetHoverText()

override string Thing.GetHoverText ( )
inlinevirtual

Reimplemented from Card.

Definition at line 790 of file Thing.cs.

791 {
792 string text = "";
793 text = text + " <size=14>(" + Lang._weight(base.ChildrenAndSelfWeight) + ")</size> ";
795 {
796 text += Environment.NewLine;
797 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;
798 }
799 string hoverText = trait.GetHoverText();
800 if (!hoverText.IsEmpty())
801 {
802 text = text + Environment.NewLine + hoverText;
803 }
804 return base.GetHoverText() + text;
805 }
bool showExtra
Definition: CoreDebug.cs:168
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:610

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

◆ GetIngredients()

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

Definition at line 1774 of file Thing.cs.

1775 {
1776 if (ing.CanSetThing(this))
1777 {
1778 list.Add(this);
1779 }
1780 if (things.Count <= 0 || base.c_lockLv != 0 || base.isNPCProperty)
1781 {
1782 return;
1783 }
1784 foreach (Thing thing in things)
1785 {
1786 thing.GetIngredients(ing, list);
1787 }
1788 }
void Add(Act a, string s="")
Definition: ActPlan.cs:11
bool CanSetThing(Thing t)
Definition: Recipe.cs:89
Definition: Thing.cs:8
void GetIngredients(Recipe.Ingredient ing, List< Thing > list)
Definition: Thing.cs:1774

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

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

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

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

◆ GetRecipes()

void Thing.GetRecipes ( HashSet< Recipe recipes)
inline

Definition at line 1803 of file Thing.cs.

1804 {
1805 }

Referenced by RecipeUpdater.RunRecipe().

◆ GetSubPassData()

override SubPassData Thing.GetSubPassData ( )
inlinevirtual

Reimplemented from Card.

Definition at line 1644 of file Thing.cs.

1645 {
1646 Chara chara = GetRootCard() as Chara;
1647 if ((!trait.ShowAsTool || (chara == EClass.pc && HotItemHeld.disableTool)) && (chara?.held == this || (!base.isRoofItem && placeState != PlaceState.installed && renderer.data.subCrate.enable && parent is Zone)))
1648 {
1650 {
1651 return EClass.setting.pass.subCrate;
1652 }
1653 return renderer.data.subCrate;
1654 }
1655 return SubPassData.Default;
1656 }
PlaceState
Definition: PlaceState.cs:2
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
bool isRoofItem
Definition: Card.cs:578
PlaceState placeState
Definition: Card.cs:83
CardRenderer renderer
Definition: Card.cs:61
static GameSetting setting
Definition: EClass.cs:35
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 2083 of file Thing.cs.

2084 {
2085 if (base.IsIdentified)
2086 {
2087 return this;
2088 }
2089 string @ref = "";
2090 string text = "";
2091 if (show)
2092 {
2093 @ref = GetName(NameStyle.Full, base.Num);
2094 }
2095 Rarity rarity = idtSource switch
2096 {
2097 IDTSource.SkillHigh => Rarity.Legendary,
2098 IDTSource.Skill => Rarity.Superior,
2099 _ => Rarity.Normal,
2100 };
2101 if (rarity != 0 && ((base.IsEquipmentOrRangedOrAmmo && base.rarity >= rarity) || base.rarity >= Rarity.Mythical))
2102 {
2103 base.c_IDTState = 3;
2104 }
2105 else if (base.rarity >= Rarity.Mythical && idtSource != IDTSource.SuperiorIdentify)
2106 {
2107 base.c_IDTState = 1;
2108 }
2109 else
2110 {
2111 base.c_IDTState = 0;
2112 }
2113 if (show)
2114 {
2115 text = GetName(NameStyle.Full, base.Num);
2116 if (base.c_IDTState == 0)
2117 {
2118 Msg.Say("identified", @ref, text);
2119 }
2120 else
2121 {
2122 Msg.Say((idtSource == IDTSource.Skill) ? "identified3" : "identified2", @ref, text, base.TextRarity);
2123 }
2124 }
2125 if (base.IsIdentified)
2126 {
2127 GetRootCard()?.TryStack(this);
2128 }
2130 return this;
2131 }
IDTSource
Definition: IDTSource.cs:2
Rarity rarity
Definition: Card.cs:314
void TryStack(Thing t)
Definition: Card.cs:7024
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:535

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

1791 {
1792 if (isDestroyed)
1793 {
1794 return false;
1795 }
1796 if (GetRootCard().Dist(EClass.pc) > 1 || !ing.CanSetThing(this))
1797 {
1798 return false;
1799 }
1800 return true;
1801 }
bool isDestroyed
Definition: Card.cs:75
int Dist(Card c)
Definition: Card.cs:7712

References EClass.pc.

Referenced by DropdownGrid.BuildIngredients().

◆ ListLimitedValidTraits()

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

Definition at line 832 of file Thing.cs.

833 {
834 List<Element> list = new List<Element>();
835 if (base.ShowFoodEnc)
836 {
837 foreach (Element value in elements.dict.Values)
838 {
839 if (value.IsFoodTraitMain && value.Value > 0)
840 {
841 list.Add(value);
842 }
843 }
845 if (limit && list.Count > 5)
846 {
847 int num = list.Count - 5;
848 for (int i = 0; i < num; i++)
849 {
850 list.RemoveAt(list.Count - 1);
851 }
852 }
853 }
854 return list;
855 }
static int GetSortVal(Element a)
int Value
Definition: ELEMENT.cs:292
bool IsFoodTraitMain
Definition: ELEMENT.cs:367

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

◆ ListValidTraits()

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

Definition at line 857 of file Thing.cs.

858 {
859 List<Element> list = ListLimitedValidTraits(limit);
860 bool showFoodEnc = base.ShowFoodEnc;
861 bool flag = EClass.debug.enable || EClass.pc.HasElement(1650);
862 if (showFoodEnc)
863 {
864 foreach (Element value in elements.dict.Values)
865 {
866 if (value.IsFoodTrait && !list.Contains(value) && (isCraft || flag || value.IsFoodTraitMain) && (!value.IsFoodTraitMain || value.Value < 0))
867 {
868 list.Add(value);
869 }
870 }
871 }
872 foreach (Element value2 in elements.dict.Values)
873 {
874 if ((isCraft || flag || ((!value2.IsFoodTrait || value2.IsFoodTraitMain) && (!showFoodEnc || !value2.IsTrait || value2.Value >= 0))) && !list.Contains(value2) && (value2.IsTrait || (value2.IsFoodTrait && !value2.IsFoodTraitMain)))
875 {
876 list.Add(value2);
877 }
878 }
879 return list;
880 }
bool HasElement(int ele, bool includeNagative=false)
Definition: Card.cs:5935
bool IsFoodTrait
Definition: ELEMENT.cs:364
bool IsTrait
Definition: ELEMENT.cs:362
List< Element > ListLimitedValidTraits(bool limit)
Definition: Thing.cs:832

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

2134 {
2135 if (trait is TraitGene)
2136 {
2137 DNA dNA = base.c_DNA;
2138 if (dNA == null || dNA.type == DNA.Type.Brain || dNA.type == DNA.Type.Inferior)
2139 {
2140 return false;
2141 }
2142 for (int i = 0; i < dNA.vals.Count; i += 2)
2143 {
2144 SourceElement.Row row = EClass.sources.elements.map.TryGetValue(dNA.vals[i]);
2145 if (row.name.ToLower().Contains(s))
2146 {
2147 return true;
2148 }
2149 if (row.GetName().ToLower().Contains(s))
2150 {
2151 return true;
2152 }
2153 }
2154 }
2155 else
2156 {
2157 if (!base.IsIdentified)
2158 {
2159 return false;
2160 }
2161 foreach (Element value in elements.dict.Values)
2162 {
2163 if (value.Value != 0)
2164 {
2165 if (value.source.name.ToLower().Contains(s))
2166 {
2167 return true;
2168 }
2169 if (value.source.GetName().ToLower().Contains(s))
2170 {
2171 return true;
2172 }
2173 }
2174 }
2175 }
2176 return false;
2177 }
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:273
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 183 of file Thing.cs.

184 {
185 if (bp.blesstedState.HasValue)
186 {
187 SetBlessedState(bp.blesstedState.GetValueOrDefault());
188 }
189 else if (base.category.ignoreBless == 0 && bp.rarity == Rarity.Random && base.rarity != Rarity.Artifact)
190 {
191 if (EClass.rnd(25) == 0)
192 {
194 }
195 else if (EClass.rnd(25) == 0)
196 {
198 }
199 else if (EClass.rnd(50) == 0 && base.category.slot != 0)
200 {
202 }
203 }
204 if (!EClass.debug.autoIdentify && (!source.unknown_JP.IsEmpty() || (base.category.slot != 0 && base.rarity >= Rarity.Superior)))
205 {
206 base.c_IDTState = 5;
207 }
208 string text = id;
209 if (text == "bill_tax" || text == "bill")
210 {
211 base.c_bill = 100 + EClass.rnd(100);
212 }
213 if (base.category.slot != 0)
214 {
215 int num = 0;
216 if (base.rarity == Rarity.Superior)
217 {
218 num = EClass.rnd(3);
219 }
220 else if (base.rarity == Rarity.Legendary)
221 {
222 num = EClass.rnd(4) + 2;
223 }
224 else if (base.rarity == Rarity.Mythical)
225 {
226 num = EClass.rnd(3) + 5;
227 }
228 else if (base.rarity >= Rarity.Artifact)
229 {
230 num = EClass.rnd(2) + 1;
231 }
232 if (num > 0 && !HasTag(CTAG.godArtifact) && !HasTag(CTAG.noRandomEnc))
233 {
234 for (int i = 0; i < num; i++)
235 {
237 }
238 }
239 }
240 if (base.IsRangedWeapon && !IsMeleeWithAmmo)
241 {
242 if (HasTag(CTAG.godArtifact))
243 {
244 AddSocket();
245 AddSocket();
246 }
247 else
248 {
249 int num2 = 1;
250 int num3 = ((EClass.rnd(10) == 0) ? 1 : 0);
251 if (base.rarity == Rarity.Superior)
252 {
253 num2 = 2 + num3;
254 }
255 else if (base.rarity == Rarity.Legendary)
256 {
257 num2 = EClass.rnd(2) + 3 + num3;
258 }
259 else if (base.rarity == Rarity.Mythical)
260 {
261 num2 = EClass.rnd(2) + 4 + num3;
262 }
263 else if (base.rarity >= Rarity.Artifact)
264 {
265 num2 = EClass.rnd(2) + 1;
266 }
267 if (id == "bow_vindale")
268 {
269 num2 = 4;
270 }
271 if (num2 > 0)
272 {
273 for (int j = 0; j < num2; j++)
274 {
275 AddSocket();
276 }
277 if (!bp.isCraft)
278 {
279 for (int k = 0; k < EClass.rnd(num2 + 1); k++)
280 {
281 Tuple<SourceElement.Row, int> enchant = GetEnchant(genLv, (SourceElement.Row r) => r.tag.Contains("modRanged"), neg: false);
282 if (enchant != null && InvOwnerMod.IsValidRangedMod(this, enchant.Item1))
283 {
284 ApplySocket(enchant.Item1.id, enchant.Item2);
285 }
286 }
287 }
288 }
289 }
290 }
291 if (id == "shield_flower")
292 {
294 elements.SetBase(randomElement.alias.Replace("ele", "miasma_"), 20);
295 }
296 if ((bp.rarity != 0 || bp.qualityBonus != 0) && base.rarity < Rarity.Artifact && base.category.tag.Contains("enc"))
297 {
298 int num4 = 0;
299 if (EClass.rnd(6) == 0)
300 {
301 if (bp.qualityBonus == 0)
302 {
303 num4 = EClass.rnd(EClass.rnd(14) + 1);
304 if (num4 == 1 && EClass.rnd(3) != 0)
305 {
306 num4 = 0;
307 }
308 if (num4 > 0)
309 {
311 }
312 }
313 else if (bp.qualityBonus < 0)
314 {
315 if (EClass.rnd(3) == 0)
316 {
317 num4 = 1;
318 }
319 }
320 else if (bp.qualityBonus >= 10)
321 {
322 num4 = Mathf.Min(bp.qualityBonus / 10 + 2, 8) + EClass.rnd(EClass.rnd(5) + 1);
323 }
324 }
325 if (num4 > 0)
326 {
327 if (num4 > 12)
328 {
329 num4 = 12;
330 }
331 SetEncLv(num4);
332 }
333 }
334 if (HasTag(CTAG.randomSkin))
335 {
336 base.idSkin = EClass.rnd(source.skins.Length + 1);
337 }
338 }
BlessedState? blesstedState
void AddSocket()
Definition: Card.cs:3543
CardBlueprint bp
Definition: Card.cs:77
void ApplySocket(Thing t)
Definition: Card.cs:3552
virtual void SetBlessedState(BlessedState s)
Definition: Card.cs:3897
void SetEncLv(int a)
Definition: Card.cs:3866
int genLv
Definition: Card.cs:194
bool autoIdentify
Definition: CoreDebug.cs:189
static SourceElement.Row GetRandomElement(int lv=1, bool useWeight=true)
Definition: ELEMENT.cs:556
int FurnitureBonus()
Definition: GuildThief.cs:26
Definition: Guild.cs:2
static GuildThief Thief
Definition: Guild.cs:60
static bool IsValidRangedMod(Thing t, SourceElement.Row row)
Definition: InvOwnerMod.cs:9
Element AddEnchant(int lv=-1)
Definition: Thing.cs:2065
bool IsMeleeWithAmmo
Definition: Thing.cs:20

References AddEnchant(), Card.AddSocket(), SourceElement.Row.alias, Card.ApplySocket(), CoreDebug.autoIdentify, CardBlueprint.blesstedState, Card.bp, EClass.debug, Card.elements, GuildThief.FurnitureBonus(), Card.genLv, GetEnchant(), Element.GetRandomElement(), Card.HasTag(), Card.id, CardBlueprint.isCraft, IsMeleeWithAmmo, InvOwnerMod.IsValidRangedMod(), neg, CardBlueprint.qualityBonus, CardBlueprint.rarity, EClass.rnd(), ElementContainer.SetBase(), Card.SetBlessedState(), Card.SetEncLv(), source, and Guild.Thief.

◆ RemoveEnchant()

void Thing.RemoveEnchant ( )
inline

Definition at line 2079 of file Thing.cs.

2080 {
2081 }

◆ SetRenderParam()

override void Thing.SetRenderParam ( RenderParam  p)
inlinevirtual

Reimplemented from Card.

Definition at line 1493 of file Thing.cs.

1494 {
1495 p.matColor = base.colorInt;
1496 p.mat = base.material;
1497 if (!renderer.usePass)
1498 {
1499 return;
1500 }
1501 switch (trait.tileMode)
1502 {
1503 case Trait.TileMode.DefaultNoAnime:
1504 if (source._altTiles.Length != 0 && trait.UseAltTiles)
1505 {
1506 p.tile = source._altTiles[base.dir % source._altTiles.Length] * ((!flipX) ? 1 : (-1));
1507 }
1508 else
1509 {
1510 p.tile = sourceCard._tiles[base.dir % sourceCard._tiles.Length] * ((!flipX) ? 1 : (-1));
1511 }
1512 break;
1513 case Trait.TileMode.FakeBlock:
1514 {
1515 SourceBlock.Row row2 = EClass.sources.blocks.map[base.refVal];
1516 p.tile = row2._tiles[base.dir % row2._tiles.Length];
1517 if (row2.tileType.IsFullBlock)
1518 {
1519 p.color += 1572864f;
1520 }
1521 break;
1522 }
1523 case Trait.TileMode.FakeObj:
1524 {
1525 SourceObj.Row row = EClass.sources.objs.map[base.refVal];
1526 p.tile = row._tiles[base.dir % row._tiles.Length];
1527 break;
1528 }
1529 case Trait.TileMode.SignalAnime:
1530 if (source._altTiles.Length != 0 && trait.UseAltTiles)
1531 {
1532 p.tile = source._altTiles[base.dir % source._altTiles.Length] * ((!flipX) ? 1 : (-1));
1533 }
1534 else
1535 {
1536 p.tile = sourceCard._tiles[base.dir % sourceCard._tiles.Length] * ((!flipX) ? 1 : (-1));
1537 }
1538 if (animeCounter > 0f && source.anime.Length != 0)
1539 {
1540 animeCounter += Time.deltaTime;
1541 int num3 = (int)(animeCounter / (0.001f * (float)source.anime[1]));
1542 if (num3 > ((source.anime.Length > 2) ? source.anime[2] : source.anime[0]))
1543 {
1544 animeCounter = 0f;
1545 }
1546 else
1547 {
1548 p.tile += num3 % source.anime[0] * ((!flipX) ? 1 : (-1));
1549 }
1550 }
1551 break;
1552 case Trait.TileMode.Illumination:
1553 if (base.isOn || base.isRoofItem)
1554 {
1555 int num4 = (int)((float)base.uid + Time.realtimeSinceStartup * 5f);
1556 int num5 = (int)(Time.realtimeSinceStartup * 5f);
1557 p.tile = (sourceCard._tiles[base.dir % sourceCard._tiles.Length] + num4 % 3 + 1) * ((!flipX) ? 1 : (-1));
1558 if (num5 % 16 == 0)
1559 {
1560 p.color = 5242880f;
1561 }
1562 else if (num5 % 11 == 0)
1563 {
1564 p.color = 7864320f;
1565 }
1566 else
1567 {
1568 p.color = 13107200f;
1569 }
1570 }
1571 else
1572 {
1573 p.tile = sourceCard._tiles[base.dir % sourceCard._tiles.Length] * ((!flipX) ? 1 : (-1));
1574 }
1575 break;
1576 case Trait.TileMode.Door:
1577 if (source._altTiles.Length != 0 && trait.UseAltTiles)
1578 {
1579 p.tile = source._altTiles[base.dir % source._altTiles.Length] * ((!flipX) ? 1 : (-1));
1580 }
1581 else
1582 {
1583 p.tile = sourceCard._tiles[base.dir % sourceCard._tiles.Length] * ((!flipX) ? 1 : (-1));
1584 }
1585 if (parent is Zone && pos.cell.HasFullBlock)
1586 {
1587 p.tile += ((p.tile < 0f) ? (-64) : 64);
1588 }
1589 if (trait is TraitDoorSwing traitDoorSwing && traitDoorSwing.IsOpen())
1590 {
1591 p.tile += ((!(p.tile < 0f)) ? 1 : (-1));
1592 }
1593 break;
1594 default:
1595 {
1596 if (source._altTiles.Length != 0 && trait.UseAltTiles)
1597 {
1598 p.tile = source._altTiles[base.dir % source._altTiles.Length] * ((!flipX) ? 1 : (-1));
1599 }
1600 else
1601 {
1602 p.tile = sourceCard._tiles[base.dir % sourceCard._tiles.Length] * ((!flipX) ? 1 : (-1));
1603 }
1604 float time = Time.realtimeSinceStartup;
1605 if (source.animeNoSync)
1606 {
1607 Rand.UseSeed(base.uid, delegate
1608 {
1609 time += EClass.rnd(1000);
1610 });
1611 }
1612 if (source.anime.Length == 0 || !trait.IsAnimeOn)
1613 {
1614 break;
1615 }
1616 if (source.anime.Length > 2)
1617 {
1618 int num = (int)(time * 1000f / (float)source.anime[1] % (float)source.anime[2]);
1619 if (num == source.anime[0] - 1 && source.anime.Length > 3)
1620 {
1621 PlaySound("anime_sound" + source.anime[3]);
1622 }
1623 if (num < source.anime[0])
1624 {
1625 p.tile += num * ((!(p.tile < 0f)) ? 1 : (-1));
1626 }
1627 }
1628 else
1629 {
1630 int num2 = (int)(time * 1000f / (float)source.anime[1] % (float)source.anime[0]);
1631 p.tile += num2 * ((!(p.tile < 0f)) ? 1 : (-1));
1632 }
1633 break;
1634 }
1635 }
1636 if (trait.IdSkin != 0 && sourceCard.skins.Length != 0)
1637 {
1638 int num6 = sourceCard.skins.TryGet(trait.IdSkin - 1);
1639 num6 = num6 / 100 * (int)source.renderData.pass.pmesh.tiling.x + num6 % 100;
1640 p.tile += ((p.tile < 0f) ? (-num6) : num6);
1641 }
1642 }
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:6188
float animeCounter
Definition: Card.cs:73
virtual bool flipX
Definition: Card.cs:2116
bool HasFullBlock
Definition: Cell.cs:817
TileType tileType
Definition: RenderRow.cs:77
int[] skins
Definition: RenderRow.cs:14
int[] _tiles
Definition: RenderRow.cs:12
SourceObj objs
SourceBlock blocks
virtual bool IsFullBlock
Definition: TileType.cs:169
override bool IsOpen()
Definition: Trait.cs:7
virtual TileMode tileMode
Definition: Trait.cs:439
virtual bool UseAltTiles
Definition: Trait.cs:441
TileMode
Definition: Trait.cs:9
virtual int IdSkin
Definition: Trait.cs:46
virtual bool IsAnimeOn
Definition: Trait.cs:378

References SourceThing.Row._altTiles, RenderRow._tiles, SourceThing.Row.anime, SourceThing.Row.animeNoSync, SourceManager.blocks, TileType.IsFullBlock, TraitDoorSwing.IsOpen(), SourceManager.objs, EClass.rnd(), EClass.sources, RenderRow.tileType, and Rand.UseSeed().

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

◆ SetSource()

override void Thing.SetSource ( )
inlinevirtual

Reimplemented from Card.

Definition at line 167 of file Thing.cs.

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

1816 {
1817 int count = 1;
1818 UIContextMenu i = EClass.ui.CreateContextMenuInteraction();
1819 bool buy = trans != null;
1820 UIButton buttonBuy = null;
1821 UIItem itemSlider = null;
1822 itemSlider = i.AddSlider("sliderSplitMenu", "adjustmentNum", (float a) => (!EClass.core.IsGameStarted) ? "" : ("/" + base.Num), count, delegate(float b)
1823 {
1824 count = (int)b;
1825 if (trans != null)
1826 {
1827 trans.num = count;
1828 }
1829 UpdateButton();
1830 }, 1f, base.Num, isInt: true, hideOther: false, useInput: true).GetComponent<UIItem>();
1831 if (buy)
1832 {
1833 buttonBuy = i.AddButton("invBuy", delegate
1834 {
1835 Process();
1836 });
1837 }
1838 i.onDestroy = delegate
1839 {
1840 if ((!buy || Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter)) && !i.wasCanceled)
1841 {
1842 Process();
1843 }
1844 };
1845 i.Show();
1846 if ((bool)buttonBuy)
1847 {
1848 buttonBuy.gameObject.AddComponent<CanvasGroup>();
1849 }
1850 UpdateButton();
1851 void Process()
1852 {
1853 if (!EClass.core.IsGameStarted || button == null || button.card == null)
1854 {
1855 Debug.Log("Split bug1");
1856 }
1857 else if (button.card.isDestroyed || button.card.Num < count)
1858 {
1859 Debug.Log("Split bug2");
1860 }
1861 else if (EClass.pc.isDead)
1862 {
1863 Debug.Log("Split bug3");
1864 }
1865 else if (count != 0 && !Input.GetMouseButton(1))
1866 {
1867 if (trans != null)
1868 {
1869 trans.Process(startTransaction: true);
1870 }
1871 else
1872 {
1873 DragItemCard dragItemCard = new DragItemCard(button);
1874 if (count != base.Num)
1875 {
1876 Thing thing = button.card.Split(base.Num - count);
1877 button.invOwner.Container.AddThing(thing, tryStack: false);
1878 thing.invX = dragItemCard.from.invX;
1879 thing.invY = dragItemCard.from.invY;
1880 thing.posInvX = button.card.Thing.posInvX;
1881 thing.posInvY = button.card.Thing.posInvY;
1882 }
1883 EClass.ui.StartDrag(dragItemCard);
1884 }
1885 }
1886 }
1887 void UpdateButton()
1888 {
1889 itemSlider.text1.text = GetName(NameStyle.FullNoArticle, 1);
1890 itemSlider.text2.text = Lang._weight(SelfWeight * count);
1891 if ((bool)buttonBuy)
1892 {
1893 buttonBuy.mainText.SetText(trans.GetTextDetail());
1894 buttonBuy.mainText.RebuildLayoutTo<UIButton>();
1895 buttonBuy.interactable = trans.IsValid();
1896 buttonBuy.RebuildLayout(recursive: true);
1897 buttonBuy.gameObject.GetComponent<CanvasGroup>().alpha = (trans.IsValid() ? 1f : 0.9f);
1898 }
1899 }
1900 }
Card card
Definition: ButtonGrid.cs:24
InvOwner invOwner
Definition: ButtonGrid.cs:28
int posInvY
Definition: Card.cs:350
Thing Split(int a)
Definition: Card.cs:3486
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:3106
virtual Thing Thing
Definition: Card.cs:2058
int posInvX
Definition: Card.cs:338
bool isDead
Definition: Chara.cs:389
DragInfo from
Definition: DragItemCard.cs:54
static UI ui
Definition: EClass.cs:17
string GetTextDetail()
Definition: InvOwner.cs:447
bool Process(bool startTransaction=false)
Definition: InvOwner.cs:135
Card Container
Definition: InvOwner.cs:535
void Show(UIItem i)
UIContextMenuItem AddSlider(string text, Func< float, string > textFunc, float value, Action< float > action, float min=0f, float max=1f, bool isInt=false, bool hideOther=true, bool useInput=false)
void AddButton(Func< string > funcText, UnityAction action=null)
Definition: UIItem.cs:5

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

Referenced by InvOwner.OnCtrlClick().

◆ ShowSplitMenu2()

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

Definition at line 1902 of file Thing.cs.

1903 {
1904 int count = 1;
1905 UIContextMenu i = EClass.ui.CreateContextMenuInteraction();
1906 UIButton buttonBuy = null;
1907 UIItem itemSlider = null;
1908 itemSlider = i.AddSlider("sliderSplitMenu", "adjustmentNum", (float a) => (!EClass.core.IsGameStarted) ? "" : ("/" + base.Num), count, delegate(float b)
1909 {
1910 count = (int)b;
1911 UpdateButton();
1912 }, 1f, base.Num, isInt: true, hideOther: false, useInput: true).GetComponent<UIItem>();
1913 buttonBuy = i.AddButton("invBuy", delegate
1914 {
1915 Process();
1916 });
1917 i.onDestroy = delegate
1918 {
1919 if ((Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter)) && !i.wasCanceled)
1920 {
1921 Process();
1922 }
1923 };
1924 i.Show();
1925 if ((bool)buttonBuy)
1926 {
1927 buttonBuy.gameObject.AddComponent<CanvasGroup>();
1928 }
1929 UpdateButton();
1930 void Process()
1931 {
1932 if (!EClass.core.IsGameStarted || button == null || button.card == null)
1933 {
1934 Debug.Log("Split bug1");
1935 }
1936 else if (button.card.isDestroyed || button.card.Num < count)
1937 {
1938 Debug.Log("Split bug2");
1939 }
1940 else if (EClass.pc.isDead)
1941 {
1942 Debug.Log("Split bug3");
1943 }
1944 else if (count != 0 && !Input.GetMouseButton(1))
1945 {
1946 onSplit?.Invoke(count);
1947 }
1948 }
1949 void UpdateButton()
1950 {
1951 itemSlider.text1.text = GetName(NameStyle.FullNoArticle, 1);
1952 itemSlider.text2.text = Lang._weight(SelfWeight * count);
1953 buttonBuy.mainText.SetText(lang.lang(count.ToString() ?? ""));
1954 buttonBuy.mainText.RebuildLayoutTo<UIButton>();
1955 buttonBuy.interactable = true;
1956 buttonBuy.RebuildLayout(recursive: true);
1957 }
1958 }

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(), EClass.ui, and UIContextMenu.wasCanceled.

Referenced by UIDragGridIngredients.Update().

◆ TryLickEnchant()

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

Definition at line 2016 of file Thing.cs.

2017 {
2018 if (!base.IsEquipment || base.IsCursed || base.rarity <= Rarity.Normal || GetInt(107) > 0)
2019 {
2020 return;
2021 }
2022 SetInt(107, 1);
2023 if (tg == null)
2024 {
2025 Rand.SetSeed(EClass.world.date.day + source._index + c.uid);
2026 if (msg)
2027 {
2028 c.Say("lick", c, this);
2029 PlaySound("offering");
2030 PlayEffect("mutation");
2031 }
2032 Element element = AddEnchant(base.LV);
2033 if (element != null)
2034 {
2035 SetInt(107, element.id);
2036 }
2037 }
2038 else
2039 {
2040 Rand.SetSeed(base.uid);
2041 List<Element> list = new List<Element>();
2042 foreach (Element value in elements.dict.Values)
2043 {
2044 if (value.id != 67 && value.id != 66 && value.id != 64 && value.id != 65)
2045 {
2046 list.Add(value);
2047 }
2048 }
2049 if (list.Count > 0)
2050 {
2051 Element element2 = list.RandomItem();
2052 elements.ModBase(element2.id, Mathf.Max(EClass.rnd(Mathf.Abs(element2.vBase / 5)), 1));
2053 SetInt(107, element2.id);
2054 }
2055 if (msg)
2056 {
2057 c.Say("lick2", c, tg, slot.name.ToLower());
2058 tg.PlaySound("offering");
2059 tg.PlayEffect("mutation");
2060 }
2061 }
2062 Rand.SetSeed();
2063 }
void SetInt(int id, int value=0)
Definition: BaseCard.cs:39
string name
Definition: BodySlot.cs:14
int uid
Definition: Card.cs:122
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:6222
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:6865
int day
Definition: Date.cs:62
static World world
Definition: EClass.cs:41
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 882 of file Thing.cs.

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

References CardRow._origin, Element._WriteNote(), UINote.AddHeaderCard(), UINote.AddText(), Card.Chara, 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(), AttackProcess.GetTwoHandEncBonus(), Lang.Has(), Element.HasTag(), CoreRef.icons, Element.id, if(), UIItem.image2, LayerCraft.Instance, Card.isChara, Element.IsGlobalElement, FoodEffect.IsLeftoverable(), Element.IsTrait, CoreRef.Icons.Enc.mat, EClass.pc, Core.refs, religion, Game.religions, CoreRef.Icons.Enc.rune, UIText.SetText(), CoreDebug.showExtra, Element.source, TraitBookSkill.source, EClass.sources, UINote.Space(), UIItem.text2, RenderRow.tiles, Element.Value, Element.vBase, and Element.vExp.

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

Member Data Documentation

◆ MaxFurnitureEnc

const int Thing.MaxFurnitureEnc = 12
static

Definition at line 9 of file Thing.cs.

◆ source

◆ stackOrder

int Thing.stackOrder

Definition at line 13 of file Thing.cs.

Referenced by Map.Save().

◆ tempName

string Thing.tempName

Definition at line 15 of file Thing.cs.

Referenced by ThingContainer.RefreshGrid().

Property Documentation

◆ CanSearchContents

bool Thing.CanSearchContents
get

Definition at line 100 of file Thing.cs.

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

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

113 {
114 get
115 {
116 if (base.IsContainer && base.c_lockLv == 0 && !base.isNPCProperty)
117 {
118 Window.SaveData obj = GetObj<Window.SaveData>(2);
119 if (obj == null)
120 {
121 return false;
122 }
123 return obj.sharedType == ContainerSharedType.Shared;
124 }
125 return false;
126 }
127 }
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 SourcePref pref = trait.GetPref();
54 if (pref == null)
55 {
56 if (source.origin == null || source.pref.UsePref)
57 {
58 return source.pref;
59 }
60 pref = source.origin.pref;
61 }
62 return pref;
63 }
64 }
virtual SourcePref GetPref()
Definition: Trait.cs:585

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

67 {
68 get
69 {
70 if (!base.IsUnique)
71 {
72 return (int)((long)(base.isWeightChanged ? base.c_weight : source.weight) * (long)base.material.weight / 100);
73 }
74 if (!base.isWeightChanged)
75 {
76 return source.weight;
77 }
78 return base.c_weight;
79 }
80 }

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

◆ sourceCard

◆ TileRow

override RenderRow Thing.TileRow
get

Definition at line 84 of file Thing.cs.

85 {
86 get
87 {
88 if (trait is TraitFakeTile)
89 {
90 if (trait is TraitFakeBlock)
91 {
92 return EClass.sources.blocks.map[base.refVal];
93 }
94 return EClass.sources.objs.map[base.refVal];
95 }
96 return base.TileRow;
97 }
98 }

◆ Tiles

override int [] Thing.Tiles
get

Definition at line 82 of file Thing.cs.


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