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

Public Member Functions

bool CanAutoFire (Chara c, Card tg, bool reloading=false)
 
int GetEfficiency ()
 
override void SetSource ()
 
override void OnCreate (int genLv)
 
override void ApplyMaterialElements (bool remove)
 
override void ApplyMaterial (bool remove=false)
 
override string GetName (NameStyle style, int _num=-1)
 
override string GetHoverText ()
 
override string GetExtraName ()
 
override int GetPrice (CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
 
List< Element > ListLimitedValidTraits (bool limit)
 
List< Element > ListValidTraits (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 ()
 
void Attune (Chara c)
 
Thing Identify (bool show=true, IDTSource idtSource=IDTSource.Identify)
 
override bool MatchEncSearch (string s)
 
- Public Member Functions inherited from Card
bool GetBool (string id)
 
void SetBool (string id, bool enable)
 
int GetInt (string id, int? defaultInt=null)
 
void AddInt (string id, int value)
 
void SetInt (string id, int value=0)
 
string GetStr (string id, string defaultStr=null)
 
void SetStr (string id, string value=null)
 
T GetObj< T > (string id)
 
void SetObj (string id, object o)
 
T SetObj< T > (string id, object o)
 
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)
 
void ModExpParty (int ele, int a)
 
bool IsChildOf (Card c)
 
T 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 (long a, HealSource origin=HealSource.None)
 
virtual void HealHP (long a, HealSource origin=HealSource.None)
 
virtual int GetArmorSkill ()
 
virtual long ApplyProtection (long dmg, int mod=100)
 
int GetResistPenetrationLevel (int idEle, AttackSource attackSource, Card origin=null)
 
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, int resistPenetrationLevel=0)
 
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, bool makeRef=true)
 
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, bool simple=false)
 
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 ()
 
MoveResult TryMoveFrom (Point p)
 
virtual MoveResult TryMove (Point newPoint, bool allowDestroyPath=true)
 
void Kick (Point p, bool ignoreSelf=false, bool checkWall=true)
 
void Kick (Chara t, bool ignoreSelf=false, bool karmaLoss=true, bool show=true, bool checkWall=true)
 
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)
 
int 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 StripTalkSpecialCharacters (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< Element > ListCraftBonusTraits ()
 
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 > ()
 
virtual T GetCondition< 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)
 
T GetObj< T > (int id)
 
void SetObj (int id, object o)
 
T 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 (long _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()
 
Point lastPos = 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 isFav [get, set]
 
bool isHatchling [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_uidAttune [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< SocketData > socketList [get, set]
 
Thing c_copyContainer [get, set]
 
Window.SaveData c_windowSaveData [get, set]
 
CharaUpgrade c_upgrades [get, set]
 
LoveData c_love [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 IsSlimeEvolvable [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 , Event }
 
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 1529 of file Thing.cs.

1530 {
1531 n.AddHeader("headerAttackEval");
1532 int num = 0;
1533 foreach (BodySlot slot in chara.body.slots)
1534 {
1535 if (slot.thing == null || slot.elementId != 35 || slot.thing.source.offense.Length < 2)
1536 {
1537 continue;
1538 }
1539 AttackProcess.Current.Prepare(chara, slot.thing, null, null, num);
1540 string text = AttackProcess.Current.GetText();
1541 if (slot.thing == current)
1542 {
1543 text = text.TagColor(() => true);
1544 }
1545 n.AddText(text);
1546 num++;
1547 }
1548 AttackProcess.Current.Prepare(chara, null);
1549 string text2 = AttackProcess.Current.GetText();
1550 if (num == 0)
1551 {
1552 text2 = text2.TagColor(() => true);
1553 }
1554 n.AddText(text2);
1555 }
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:96
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(), AttackProcess.Current, BodySlot.elementId, AttackProcess.GetText(), AttackProcess.Prepare(), source, and BodySlot.thing.

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

◆ AddEnchant()

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

Definition at line 2135 of file Thing.cs.

2136 {
2137 if (base.IsToolbelt || base.IsLightsource)
2138 {
2139 return null;
2140 }
2141 Tuple<SourceElement.Row, int> enchant = GetEnchant(lv, (SourceElement.Row r) => r.IsEncAppliable(base.category), base.IsCursed);
2142 if (enchant == null)
2143 {
2144 return null;
2145 }
2146 return elements.ModBase(enchant.Item1.id, enchant.Item2);
2147 }
ElementContainerCard elements
Definition: Card.cs:42
Element ModBase(int ele, int v)
static Tuple< SourceElement.Row, int > GetEnchant(long lv, Func< SourceElement.Row, bool > func, bool neg)
Definition: Thing.cs:2048

Referenced by OnCreate().

◆ ApplyMaterial()

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

Reimplemented from Card.

Definition at line 359 of file Thing.cs.

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

342 {
343 Chara chara = null;
345 {
346 chara = GetRootCard()?.Chara;
347 if (chara != null)
348 {
350 }
351 }
352 elements.ApplyMaterialElementMap(this, remove);
353 if (chara != null)
354 {
355 elements.SetParent(chara);
356 }
357 }
virtual Chara Chara
Definition: Card.cs:2122
Card GetRootCard()
Definition: Card.cs:3607
Definition: Chara.cs:10
bool IsGameStarted
Definition: Core.cs:87
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().

◆ Attune()

void Thing.Attune ( Chara  c)
inline

Definition at line 2153 of file Thing.cs.

2154 {
2155 Msg.Say("attuned", this, c);
2156 base.c_uidAttune = c.uid;
2157 }
int uid
Definition: Card.cs:125
Definition: Msg.cs:5
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58

References Msg.Say(), and Card.uid.

◆ CanAutoFire()

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

Definition at line 126 of file Thing.cs.

127 {
128 if (GetRootCard() != c)
129 {
130 return false;
131 }
132 if (HasTag(CTAG.throwWeapon))
133 {
134 return true;
135 }
136 if (!trait.CanAutofire)
137 {
138 return false;
139 }
140 if (trait is TraitToolRange)
141 {
142 if ((c.IsPCFaction && c.body.IsTooHeavyToEquip(this)) || reloading)
143 {
144 return false;
145 }
146 }
147 else if (trait is TraitAbility && c.IsPC)
148 {
149 Act act = (trait as TraitAbility).act;
150 Element element = c.elements.GetElement(act.id);
151 if (act is Spell && (element == null || (element.vPotential == 0 && !EClass.pc.ability.Has(element.id))))
152 {
153 return false;
154 }
155 }
156 return true;
157 }
Definition: ACT.cs:62
bool HasTag(CTAG tag)
Definition: Card.cs:2728
Trait trait
Definition: Card.cs:54
bool Has(int id)
bool IsTooHeavyToEquip(Thing thing)
Definition: CharaBody.cs:187
override bool IsPC
Definition: Chara.cs:632
override bool IsPCFaction
Definition: Chara.cs:691
CharaAbility ability
Definition: Chara.cs:430
static Chara pc
Definition: EClass.cs:15
Element GetElement(string alias)
int id
Definition: ELEMENT.cs:259
int vPotential
Definition: ELEMENT.cs:265
Definition: SPELL.cs:710
virtual bool CanAutofire
Definition: Trait.cs:145

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

Referenced by AM_Adv._OnUpdateInput().

◆ CanStackTo()

override bool Thing.CanStackTo ( Thing  to)
inlinevirtual

Reimplemented from Card.

Definition at line 1722 of file Thing.cs.

1723 {
1724 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)
1725 {
1726 return false;
1727 }
1728 if ((to.isDyed || base.isDyed) && to.c_dyeMat != base.c_dyeMat)
1729 {
1730 return false;
1731 }
1732 if (base.c_idRefCard != to.c_idRefCard || base.c_idRefCard2 != to.c_idRefCard2)
1733 {
1734 return false;
1735 }
1736 if (base.IsDecayed != to.IsDecayed)
1737 {
1738 return false;
1739 }
1740 if (!trait.CanStackTo(to))
1741 {
1742 return false;
1743 }
1744 if (base.noSell != to.noSell || base.isCopy != to.isCopy)
1745 {
1746 return false;
1747 }
1748 if (base.isStolen != to.isStolen)
1749 {
1750 return false;
1751 }
1752 if (base.isCrafted != to.isCrafted)
1753 {
1754 return false;
1755 }
1756 if ((to.isWeightChanged || base.isWeightChanged) && to.SelfWeight != SelfWeight)
1757 {
1758 return false;
1759 }
1760 if (to.c_IDTState != base.c_IDTState)
1761 {
1762 return false;
1763 }
1764 if (to.c_priceAdd != base.c_priceAdd || to.c_priceFix != base.c_priceFix || to.c_priceCopy != base.c_priceCopy)
1765 {
1766 return false;
1767 }
1768 if (to.ChildrenAndSelfWeight + base.ChildrenAndSelfWeight > 1000000000)
1769 {
1770 return false;
1771 }
1772 if (trait.IsRequireFuel && base.c_charges != to.c_charges)
1773 {
1774 return false;
1775 }
1776 if (base.c_altName != to.c_altName)
1777 {
1778 return false;
1779 }
1780 if (base.Num + to.Num <= 0)
1781 {
1782 return false;
1783 }
1784 bool flag = false;
1785 if (to.parent is Card)
1786 {
1787 Window.SaveData windowSaveData = (to.parent as Card).GetWindowSaveData();
1788 if (windowSaveData != null && windowSaveData.compress)
1789 {
1790 flag = true;
1791 }
1792 }
1793 if (flag)
1794 {
1795 if (base.encLV != to.encLV && !base.IsFood)
1796 {
1797 return false;
1798 }
1799 if (elements.dict.Count() != to.elements.dict.Count())
1800 {
1801 return false;
1802 }
1803 foreach (Element value in elements.dict.Values)
1804 {
1805 Element element = to.elements.GetElement(value.id);
1806 if (element == null)
1807 {
1808 return false;
1809 }
1810 if (element.Value != value.Value)
1811 {
1812 _ = value.id;
1813 _ = 770;
1814 }
1815 }
1816 int num = (to.encLV = Mathf.CeilToInt(MathEx.ClampToInt(((long)base.encLV * (long)base.Num + (long)to.encLV * (long)to.Num) / ((long)base.Num + (long)to.Num))));
1817 base.encLV = num;
1818 foreach (Element value2 in elements.dict.Values)
1819 {
1820 Element element2 = to.elements.GetElement(value2.id);
1821 value2.vBase = (element2.vBase = MathEx.ClampToInt(((long)value2.vBase * (long)base.Num + (long)element2.vBase * (long)to.Num) / ((long)base.Num + (long)to.Num)));
1822 }
1823 return true;
1824 }
1825 if (base.encLV != to.encLV)
1826 {
1827 return false;
1828 }
1829 if (elements.dict.Count() != to.elements.dict.Count())
1830 {
1831 return false;
1832 }
1833 foreach (Element value3 in elements.dict.Values)
1834 {
1835 Element element3 = to.elements.GetElement(value3.id);
1836 if (element3 == null || value3.vBase / 10 * 10 != element3.vBase / 10 * 10)
1837 {
1838 return false;
1839 }
1840 }
1841 return true;
1842 }
Definition: Card.cs:11
int c_priceFix
Definition: Card.cs:1164
bool isCrafted
Definition: Card.cs:797
int tier
Definition: Card.cs:413
bool IsDecayed
Definition: Card.cs:2357
int idMaterial
Definition: Card.cs:137
string id
Definition: Card.cs:36
bool noSell
Definition: Card.cs:833
bool isCopy
Definition: Card.cs:881
string c_altName
Definition: Card.cs:1633
int c_priceAdd
Definition: Card.cs:1176
int c_dyeMat
Definition: Card.cs:1225
ICardParent parent
Definition: Card.cs:56
int c_priceCopy
Definition: Card.cs:1188
int c_IDTState
Definition: Card.cs:1297
string c_idRefCard2
Definition: Card.cs:1789
int refVal
Definition: Card.cs:209
Window.SaveData GetWindowSaveData()
Definition: Card.cs:2649
int encLV
Definition: Card.cs:329
bool isDyed
Definition: Card.cs:461
bool isWeightChanged
Definition: Card.cs:665
int rarityLv
Definition: Card.cs:305
int idSkin
Definition: Card.cs:365
bool isGifted
Definition: Card.cs:785
BlessedState blessedState
Definition: Card.cs:281
bool isStolen
Definition: Card.cs:857
int ChildrenAndSelfWeight
Definition: Card.cs:2093
bool isModified
Definition: Card.cs:473
int Num
Definition: Card.cs:161
int c_charges
Definition: Card.cs:1309
string c_idRefCard
Definition: Card.cs:1777
Dictionary< int, Element > dict
int vBase
Definition: ELEMENT.cs:261
int Value
Definition: ELEMENT.cs:301
Definition: MathEx.cs:2
static int ClampToInt(long a)
Definition: MathEx.cs:25
override int SelfWeight
Definition: Thing.cs:64
virtual bool CanStackTo(Thing to)
Definition: Trait.cs:629
virtual bool HasCharges
Definition: Trait.cs:341
bool IsRequireFuel
Definition: Trait.cs:479
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, MathEx.ClampToInt(), 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, Element.Value, and Element.vBase.

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

◆ Disassemble()

void Thing.Disassemble ( )
inline

Definition at line 1881 of file Thing.cs.

1882 {
1883 }

Referenced by LayerCraftFloat.RefreshDisassemble().

◆ DoAct()

void Thing.DoAct ( Act  act)
inline

Definition at line 2030 of file Thing.cs.

2031 {
2032 if (!EClass.pc.HasNoGoal || (act.LocalAct && EClass._zone.IsRegion))
2033 {
2034 SE.Beep();
2035 return;
2036 }
2037 EClass.player.hotItemToRestore = EClass.player.currentHotItem;
2038 if (act.IsAct)
2039 {
2040 act.Perform(EClass.pc);
2041 return;
2042 }
2043 AIAct aI = act as AIAct;
2044 EClass.pc.SetAI(aI);
2046 }
Definition: AIAct.cs:6
void SetTurbo(int mtp=-1)
Definition: AM_Adv.cs:1091
virtual bool Perform()
Definition: ACT.cs:266
virtual bool LocalAct
Definition: ACT.cs:173
virtual bool IsAct
Definition: ACT.cs:101
static AM_Adv Adv
Definition: ActionMode.cs:15
AIAct SetAI(AIAct g)
Definition: Chara.cs:9496
bool HasNoGoal
Definition: Chara.cs:1049
static Zone _zone
Definition: EClass.cs:21
static Player player
Definition: EClass.cs:13
HotItem currentHotItem
Definition: Player.cs:1170
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().

Referenced by Trait.OnListInteraction().

◆ GetDisassembles()

void Thing.GetDisassembles ( List< Thing >  list)
inline

Definition at line 1877 of file Thing.cs.

1878 {
1879 }

Referenced by RecipeUpdater.RunDisassemble().

◆ GetEfficiency()

int Thing.GetEfficiency ( )
inline

Definition at line 159 of file Thing.cs.

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

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

2049 {
2050 List<SourceElement.Row> list = new List<SourceElement.Row>();
2051 int num = 0;
2052 long num2 = lv + 5 + EClass.rndSqrt(10);
2053 foreach (SourceElement.Row row in EClass.sources.elements.rows)
2054 {
2055 if ((!neg || !row.tag.Contains("flag")) && func(row) && row.LV < num2)
2056 {
2057 list.Add(row);
2058 num += row.chance;
2059 }
2060 }
2061 if (num == 0)
2062 {
2063 return null;
2064 }
2065 int num3 = EClass.rnd(num);
2066 int num4 = 0;
2067 foreach (SourceElement.Row item in list)
2068 {
2069 num4 += item.chance;
2070 if (num3 < num4)
2071 {
2072 string text = EClass.sources.elements.map[item.id].category;
2073 bool flag = text == "skill" || text == "attribute" || text == "resist";
2074 float num5 = 3f + Mathf.Min(lv / 10, 15f) + Mathf.Sqrt(lv * item.encFactor / 100);
2075 int num6 = (item.mtp + EClass.rnd(item.mtp + (int)num5)) / item.mtp * ((!(flag && neg)) ? 1 : (-1));
2076 if (item.encFactor == 0 && num6 > 25)
2077 {
2078 num6 = 25;
2079 }
2080 return new Tuple<SourceElement.Row, int>(item, num6);
2081 }
2082 }
2083 return null;
2084 }
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 808 of file Thing.cs.

809 {
810 string text = "";
811 if (trait.ShowChildrenNumber && base.c_lockLv == 0 && EClass._zone.IsPCFactionOrTent)
812 {
813 if (things.Count > 0)
814 {
815 text += "childCount".lang(things.Count.ToString() ?? "");
816 }
817 else if (trait.CanOpenContainer)
818 {
819 text = text + " " + "empty".lang();
820 }
821 }
823 {
824 Room room = pos.cell.room;
825 if (EClass.debug.enable && room != null && room.data.group != 0)
826 {
827 text = text + " #" + room.data.group;
828 }
829 }
830 return text;
831 }
int group
Definition: AreaData.cs:18
AreaData data
Definition: BaseArea.cs:29
Point pos
Definition: Card.cs:60
ThingContainer things
Definition: Card.cs:39
Room room
Definition: Cell.cs:122
bool enable
Definition: CoreDebug.cs:302
static CoreDebug debug
Definition: EClass.cs:49
bool IsValid
Definition: Point.cs:84
Cell cell
Definition: Point.cs:47
Definition: Room.cs:4
virtual bool ShowChildrenNumber
Definition: Trait.cs:345
virtual bool CanOpenContainer
Definition: Trait.cs:246
bool IsPCFactionOrTent
Definition: Zone.cs:483

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

792 {
793 string text = "";
794 text = text + " <size=14>(" + Lang._weight(base.ChildrenAndSelfWeight) + ")</size> ";
796 {
797 text += Environment.NewLine;
798 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;
799 }
800 string hoverText = trait.GetHoverText();
801 if (!hoverText.IsEmpty())
802 {
803 text = text + Environment.NewLine + hoverText;
804 }
805 return base.GetHoverText() + text;
806 }
bool showExtra
Definition: CoreDebug.cs:184
Definition: Lang.cs:7
static string _weight(int a, int b, bool showUnit=true, int unitSize=0)
Definition: Lang.cs:171
virtual string GetHoverText()
Definition: Trait.cs:634

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

◆ GetIngredients()

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

Definition at line 1844 of file Thing.cs.

1845 {
1846 if (ing.CanSetThing(this))
1847 {
1848 list.Add(this);
1849 }
1850 if (things.Count <= 0 || base.c_lockLv != 0 || base.isNPCProperty)
1851 {
1852 return;
1853 }
1854 foreach (Thing thing in things)
1855 {
1856 thing.GetIngredients(ing, list);
1857 }
1858 }
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:1844

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

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

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, Card.GetBool(), Card.GetInt(), Lang.GetList(), Trait.GetName(), GetPrice(), Card.GetRootCard(), Card.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(), FactionBranch.AutoClean(), DramaCustomSequence.Build(), Zone.FindSharedContainer(), QuestDeliver.IsDestThing(), ActMoneySlap.Perform(), ThingContainer.RefreshGrid(), AI_OpenGambleChest.Run(), UIMagicChest.Search(), CoreExtension.Sort(), ActThrow.Throw(), Zone.TryAddThingInSharedContainer(), and Chara.TryUse().

◆ GetPrice()

override int Thing.GetPrice ( CurrencyType  currency = CurrencyType::Money,
bool  sell = false,
PriceType  priceType = PriceType::Default,
Chara  c = null 
)
inlinevirtual

Reimplemented from Card.

Definition at line 833 of file Thing.cs.

834 {
835 int price = base.GetPrice(currency, sell, priceType, c);
836 string str = GetStr("price_calc_override");
837 if (!str.IsEmpty())
838 {
839 var args = new
840 {
841 @base = price,
842 lv = base.LV,
843 rarity = base.rarityLv
844 };
845 if (str.TryEvaluateAsCalc(out int result, (object)args))
846 {
847 return result;
848 }
849 }
850 return price;
851 }
@ currency
Rarity rarity
Definition: Card.cs:317

References currency.

Referenced by InvOwnerRecycle._OnProcess(), Chara.ClearInventory(), ZonePreEnterBoutWin.Execute(), QuestSupply.GetBonus(), QuestSupplySpecific.GetBonus(), GetName(), TraitTicketFurniture.GetPrice(), HomeResourceWorth.GetPrice(), ShopTransaction.GetPrice(), InvOwner.ListInteractions(), Trait.OnBarter(), Affinity.OnGift(), ShopTransaction.Process(), UIInventory.RefreshList(), PartialMap.Save(), GameDate.ShipGoods(), and ActEffect.Wish().

◆ GetRecipes()

void Thing.GetRecipes ( HashSet< Recipe >  recipes)
inline

Definition at line 1873 of file Thing.cs.

1874 {
1875 }

Referenced by RecipeUpdater.RunRecipe().

◆ GetSubPassData()

override SubPassData Thing.GetSubPassData ( )
inlinevirtual

Reimplemented from Card.

Definition at line 1708 of file Thing.cs.

1709 {
1710 Chara chara = GetRootCard() as Chara;
1711 if ((!trait.ShowAsTool || (chara == EClass.pc && HotItemHeld.disableTool)) && (chara?.held == this || (!base.isRoofItem && placeState != PlaceState.installed && renderer.data.subCrate.enable && parent is Zone)))
1712 {
1714 {
1715 return EClass.setting.pass.subCrate;
1716 }
1717 return renderer.data.subCrate;
1718 }
1719 return SubPassData.Default;
1720 }
if(!match.Success)
PlaceState
Definition: PlaceState.cs:2
bool isRoofItem
Definition: Card.cs:581
PlaceState placeState
Definition: Card.cs:86
CardRenderer renderer
Definition: Card.cs:64
static GameSetting setting
Definition: EClass.cs:35
PassSetting pass
Definition: GameSetting.cs:350
SubPassData subCrate
Definition: RenderData.cs:47
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 2159 of file Thing.cs.

2160 {
2161 if (base.IsIdentified)
2162 {
2163 return this;
2164 }
2165 string @ref = "";
2166 string text = "";
2167 if (show)
2168 {
2169 @ref = GetName(NameStyle.Full, base.Num);
2170 }
2171 Rarity rarity = idtSource switch
2172 {
2173 IDTSource.SkillHigh => Rarity.Legendary,
2174 IDTSource.Skill => Rarity.Superior,
2175 _ => Rarity.Normal,
2176 };
2177 if (rarity != Rarity.Normal && ((base.IsEquipmentOrRangedOrAmmo && base.rarity >= rarity) || base.rarity >= Rarity.Mythical))
2178 {
2179 base.c_IDTState = 3;
2180 }
2181 else if (base.rarity >= Rarity.Mythical && idtSource != IDTSource.SuperiorIdentify)
2182 {
2183 base.c_IDTState = 1;
2184 }
2185 else
2186 {
2187 base.c_IDTState = 0;
2188 }
2189 if (show)
2190 {
2191 text = GetName(NameStyle.Full, base.Num);
2192 if (base.c_IDTState == 0)
2193 {
2194 Msg.Say("identified", @ref, text);
2195 }
2196 else
2197 {
2198 Msg.Say((idtSource == IDTSource.Skill) ? "identified3" : "identified2", @ref, text, base.TextRarity);
2199 }
2200 }
2201 if (base.IsIdentified)
2202 {
2203 GetRootCard()?.TryStack(this);
2204 }
2206 return this;
2207 }
IDTSource
Definition: IDTSource.cs:2
void TryStack(Thing t)
Definition: Card.cs:7484
static void SetDirty(Thing t)
override string GetName(NameStyle style, int _num=-1)
Definition: Thing.cs:536

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

1861 {
1862 if (isDestroyed)
1863 {
1864 return false;
1865 }
1866 if (GetRootCard().Dist(EClass.pc) > 1 || !ing.CanSetThing(this))
1867 {
1868 return false;
1869 }
1870 return true;
1871 }
bool isDestroyed
Definition: Card.cs:78
int Dist(Card c)
Definition: Card.cs:8241

References EClass.pc.

Referenced by DropdownGrid.BuildIngredients().

◆ ListLimitedValidTraits()

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

Definition at line 853 of file Thing.cs.

854 {
855 List<Element> list = new List<Element>();
856 if (base.ShowFoodEnc)
857 {
858 foreach (Element value in elements.dict.Values)
859 {
860 if (value.IsFoodTraitMain && value.Value > 0)
861 {
862 list.Add(value);
863 }
864 }
866 if (limit && list.Count > 5)
867 {
868 int num = list.Count - 5;
869 for (int num2 = 0; num2 < num; num2++)
870 {
871 list.RemoveAt(list.Count - 1);
872 }
873 }
874 }
875 return list;
876 }
static int GetSortVal(Element a)
bool IsFoodTraitMain
Definition: ELEMENT.cs:376

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

◆ ListValidTraits()

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

Definition at line 878 of file Thing.cs.

879 {
880 List<Element> list = ListLimitedValidTraits(limit);
881 bool showFoodEnc = base.ShowFoodEnc;
882 bool flag = EClass.debug.enable || EClass.pc.HasElement(1650);
883 if (showFoodEnc)
884 {
885 foreach (Element value in elements.dict.Values)
886 {
887 if (value.IsFoodTrait && !list.Contains(value) && (isCraft || flag || value.IsFoodTraitMain) && (!value.IsFoodTraitMain || value.Value < 0))
888 {
889 list.Add(value);
890 }
891 }
892 }
893 foreach (Element value2 in elements.dict.Values)
894 {
895 if ((isCraft || flag || ((!value2.IsFoodTrait || value2.IsFoodTraitMain) && (!showFoodEnc || !value2.IsTrait || value2.Value >= 0))) && !list.Contains(value2) && (value2.IsTrait || (value2.IsFoodTrait && !value2.IsFoodTraitMain)))
896 {
897 list.Add(value2);
898 }
899 }
900 return list;
901 }
bool HasElement(int ele, bool includeNagative=false)
Definition: Card.cs:6383
bool IsFoodTrait
Definition: ELEMENT.cs:373
bool IsTrait
Definition: ELEMENT.cs:371
List< Element > ListLimitedValidTraits(bool limit)
Definition: Thing.cs:853

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

2210 {
2211 if (trait is TraitGene)
2212 {
2213 DNA dNA = base.c_DNA;
2214 if (dNA == null || dNA.type == DNA.Type.Brain || dNA.type == DNA.Type.Inferior)
2215 {
2216 return false;
2217 }
2218 for (int i = 0; i < dNA.vals.Count; i += 2)
2219 {
2220 SourceElement.Row row = EClass.sources.elements.map.TryGetValue(dNA.vals[i]);
2221 if (row.name.ToLower().Contains(s))
2222 {
2223 return true;
2224 }
2225 if (row.GetName().ToLower().Contains(s))
2226 {
2227 return true;
2228 }
2229 }
2230 }
2231 else
2232 {
2233 if (!base.IsIdentified)
2234 {
2235 return false;
2236 }
2237 foreach (Element value in elements.dict.Values)
2238 {
2239 if (value.Value != 0)
2240 {
2241 if (value.source.name.ToLower().Contains(s))
2242 {
2243 return true;
2244 }
2245 if (value.source.GetName().ToLower().Contains(s))
2246 {
2247 return true;
2248 }
2249 }
2250 }
2251 }
2252 return false;
2253 }
Definition: DNA.cs:9
Type type
Definition: DNA.cs:31
Type
Definition: DNA.cs:11
List< int > vals
Definition: DNA.cs:26
SourceElement.Row source
Definition: ELEMENT.cs:282
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 180 of file Thing.cs.

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

References AddEnchant(), Card.AddSocket(), SourceElement.Row.alias, Card.ApplySocket(), CoreDebug.autoIdentify, CardBlueprint.blesstedState, Card.bp, EClass.debug, Dye, 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 2149 of file Thing.cs.

2150 {
2151 }

◆ SetRenderParam()

override void Thing.SetRenderParam ( RenderParam  p)
inlinevirtual

Reimplemented from Card.

Definition at line 1557 of file Thing.cs.

1558 {
1559 p.matColor = base.colorInt;
1560 p.mat = base.material;
1561 if (!renderer.usePass)
1562 {
1563 return;
1564 }
1565 switch (trait.tileMode)
1566 {
1567 case Trait.TileMode.DefaultNoAnime:
1568 if (source._altTiles.Length != 0 && trait.UseAltTiles)
1569 {
1570 p.tile = source._altTiles[base.dir % source._altTiles.Length] * ((!flipX) ? 1 : (-1));
1571 }
1572 else
1573 {
1574 p.tile = sourceCard._tiles[base.dir % sourceCard._tiles.Length] * ((!flipX) ? 1 : (-1));
1575 }
1576 break;
1577 case Trait.TileMode.FakeBlock:
1578 {
1579 SourceBlock.Row row2 = EClass.sources.blocks[base.refVal];
1580 p.tile = row2._tiles[base.dir % row2._tiles.Length];
1581 if (row2.tileType.IsFullBlock)
1582 {
1583 p.color += 1572864f;
1584 }
1585 break;
1586 }
1587 case Trait.TileMode.FakeObj:
1588 {
1589 SourceObj.Row row = EClass.sources.objs[base.refVal];
1590 p.tile = row._tiles[base.dir % row._tiles.Length];
1591 break;
1592 }
1593 case Trait.TileMode.SignalAnime:
1594 if (source._altTiles.Length != 0 && trait.UseAltTiles)
1595 {
1596 p.tile = source._altTiles[base.dir % source._altTiles.Length] * ((!flipX) ? 1 : (-1));
1597 }
1598 else
1599 {
1600 p.tile = sourceCard._tiles[base.dir % sourceCard._tiles.Length] * ((!flipX) ? 1 : (-1));
1601 }
1602 if (animeCounter > 0f && source.anime.Length != 0)
1603 {
1604 animeCounter += Time.deltaTime;
1605 int num3 = (int)(animeCounter / (0.001f * (float)source.anime[1]));
1606 if (num3 > ((source.anime.Length > 2) ? source.anime[2] : source.anime[0]))
1607 {
1608 animeCounter = 0f;
1609 }
1610 else
1611 {
1612 p.tile += num3 % source.anime[0] * ((!flipX) ? 1 : (-1));
1613 }
1614 }
1615 break;
1616 case Trait.TileMode.Illumination:
1617 if (base.isOn || base.isRoofItem)
1618 {
1619 int num4 = (int)((float)base.uid + Time.realtimeSinceStartup * 5f);
1620 int num5 = (int)(Time.realtimeSinceStartup * 5f);
1621 p.tile = (sourceCard._tiles[base.dir % sourceCard._tiles.Length] + num4 % 3 + 1) * ((!flipX) ? 1 : (-1));
1622 if (num5 % 16 == 0)
1623 {
1624 p.color = 5242880f;
1625 }
1626 else if (num5 % 11 == 0)
1627 {
1628 p.color = 7864320f;
1629 }
1630 else
1631 {
1632 p.color = 13107200f;
1633 }
1634 }
1635 else
1636 {
1637 p.tile = sourceCard._tiles[base.dir % sourceCard._tiles.Length] * ((!flipX) ? 1 : (-1));
1638 }
1639 break;
1640 case Trait.TileMode.Door:
1641 if (source._altTiles.Length != 0 && trait.UseAltTiles)
1642 {
1643 p.tile = source._altTiles[base.dir % source._altTiles.Length] * ((!flipX) ? 1 : (-1));
1644 }
1645 else
1646 {
1647 p.tile = sourceCard._tiles[base.dir % sourceCard._tiles.Length] * ((!flipX) ? 1 : (-1));
1648 }
1649 if (parent is Zone && pos.cell.HasFullBlock)
1650 {
1651 p.tile += ((p.tile < 0f) ? (-64) : 64);
1652 }
1653 if (trait is TraitDoorSwing traitDoorSwing && traitDoorSwing.IsOpen())
1654 {
1655 p.tile += ((!(p.tile < 0f)) ? 1 : (-1));
1656 }
1657 break;
1658 default:
1659 {
1660 if (source._altTiles.Length != 0 && trait.UseAltTiles)
1661 {
1662 p.tile = source._altTiles[base.dir % source._altTiles.Length] * ((!flipX) ? 1 : (-1));
1663 }
1664 else
1665 {
1666 p.tile = sourceCard._tiles[base.dir % sourceCard._tiles.Length] * ((!flipX) ? 1 : (-1));
1667 }
1668 float time = Time.realtimeSinceStartup;
1669 if (source.animeNoSync)
1670 {
1671 Rand.UseSeed(base.uid, delegate
1672 {
1673 time += EClass.rnd(1000);
1674 });
1675 }
1676 if (source.anime.Length == 0 || !trait.IsAnimeOn)
1677 {
1678 break;
1679 }
1680 if (source.anime.Length > 2)
1681 {
1682 int num = (int)(time * 1000f / (float)source.anime[1] % (float)source.anime[2]);
1683 if (num == source.anime[0] - 1 && source.anime.Length > 3)
1684 {
1685 PlaySound("anime_sound" + source.anime[3]);
1686 }
1687 if (num < source.anime[0])
1688 {
1689 p.tile += num * ((!(p.tile < 0f)) ? 1 : (-1));
1690 }
1691 }
1692 else
1693 {
1694 int num2 = (int)(time * 1000f / (float)source.anime[1] % (float)source.anime[0]);
1695 p.tile += num2 * ((!(p.tile < 0f)) ? 1 : (-1));
1696 }
1697 break;
1698 }
1699 }
1700 if (trait.IdSkin != 0 && sourceCard.skins.Length != 0)
1701 {
1702 int num6 = sourceCard.skins.TryGet(trait.IdSkin - 1);
1703 num6 = num6 / 100 * (int)source.renderData.pass.pmesh.tiling.x + num6 % 100;
1704 p.tile += ((p.tile < 0f) ? (-num6) : num6);
1705 }
1706 }
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:6645
float animeCounter
Definition: Card.cs:76
virtual bool flipX
Definition: Card.cs:2168
bool HasFullBlock
Definition: Cell.cs:853
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:177
override bool IsOpen()
Definition: Trait.cs:7
virtual TileMode tileMode
Definition: Trait.cs:449
virtual bool UseAltTiles
Definition: Trait.cs:451
TileMode
Definition: Trait.cs:9
virtual int IdSkin
Definition: Trait.cs:46
virtual bool IsAnimeOn
Definition: Trait.cs:388

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

165 {
166 source = EClass.sources.things.map.TryGetValue(id);
167 if (source != null && source.isOrigin)
168 {
170 id = source.id;
171 }
172 if (source == null)
173 {
174 Debug.LogWarning("Thing " + id + " not found");
175 id = "ash3";
177 }
178 }
Dictionary< string, CardRow > firstVariations
Definition: SourceCard.cs:11
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 1885 of file Thing.cs.

1886 {
1887 int count = 1;
1888 UIContextMenu m = EClass.ui.CreateContextMenuInteraction();
1889 bool buy = trans != null;
1890 UIButton buttonBuy = null;
1891 UIItem itemSlider = null;
1892 itemSlider = m.AddSlider("sliderSplitMenu", "adjustmentNum", (float a) => (!EClass.core.IsGameStarted) ? "" : ("/" + base.Num), count, delegate(float b)
1893 {
1894 count = (int)b;
1895 if (trans != null)
1896 {
1897 trans.num = count;
1898 }
1899 UpdateButton();
1900 }, 1f, base.Num, isInt: true, hideOther: false, useInput: true).GetComponent<UIItem>();
1901 if (buy)
1902 {
1903 buttonBuy = m.AddButton("invBuy", delegate
1904 {
1905 Process();
1906 });
1907 }
1908 m.onDestroy = delegate
1909 {
1910 if ((!buy || Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter)) && !m.wasCanceled)
1911 {
1912 Process();
1913 }
1914 };
1915 m.Show();
1916 if ((bool)buttonBuy)
1917 {
1918 buttonBuy.gameObject.AddComponent<CanvasGroup>();
1919 }
1920 UpdateButton();
1921 void Process()
1922 {
1923 if (!EClass.core.IsGameStarted || button == null || button.card == null)
1924 {
1925 Debug.Log("Split bug1");
1926 }
1927 else if (button.card.isDestroyed || button.card.Num < count)
1928 {
1929 Debug.Log("Split bug2");
1930 }
1931 else if (EClass.pc.isDead)
1932 {
1933 Debug.Log("Split bug3");
1934 }
1935 else if (count != 0 && !Input.GetMouseButton(1))
1936 {
1937 if (trans != null)
1938 {
1939 trans.Process(startTransaction: true);
1940 }
1941 else
1942 {
1943 DragItemCard dragItemCard = new DragItemCard(button);
1944 if (count != base.Num)
1945 {
1946 Thing thing = button.card.Split(base.Num - count);
1947 button.invOwner.Container.AddThing(thing, tryStack: false);
1948 thing.invX = dragItemCard.from.invX;
1949 thing.invY = dragItemCard.from.invY;
1950 thing.posInvX = button.card.Thing.posInvX;
1951 thing.posInvY = button.card.Thing.posInvY;
1952 }
1953 EClass.ui.StartDrag(dragItemCard);
1954 }
1955 }
1956 }
1957 void UpdateButton()
1958 {
1959 itemSlider.text1.text = GetName(NameStyle.FullNoArticle, 1);
1960 itemSlider.text2.text = Lang._weight(SelfWeight * count);
1961 if ((bool)buttonBuy)
1962 {
1963 buttonBuy.mainText.SetText(trans.GetTextDetail());
1964 buttonBuy.mainText.RebuildLayoutTo<UIButton>();
1965 buttonBuy.interactable = trans.IsValid();
1966 buttonBuy.RebuildLayout(recursive: true);
1967 buttonBuy.gameObject.GetComponent<CanvasGroup>().alpha = (trans.IsValid() ? 1f : 0.9f);
1968 }
1969 }
1970 }
Card card
Definition: ButtonGrid.cs:24
InvOwner invOwner
Definition: ButtonGrid.cs:28
int posInvY
Definition: Card.cs:353
Thing Split(int a)
Definition: Card.cs:3665
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:3280
virtual Thing Thing
Definition: Card.cs:2110
int posInvX
Definition: Card.cs:341
bool isDead
Definition: Chara.cs:395
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 1972 of file Thing.cs.

1973 {
1974 int count = 1;
1975 UIContextMenu m = EClass.ui.CreateContextMenuInteraction();
1976 UIButton buttonBuy = null;
1977 UIItem itemSlider = null;
1978 itemSlider = m.AddSlider("sliderSplitMenu", "adjustmentNum", (float a) => (!EClass.core.IsGameStarted) ? "" : ("/" + base.Num), count, delegate(float b)
1979 {
1980 count = (int)b;
1981 UpdateButton();
1982 }, 1f, base.Num, isInt: true, hideOther: false, useInput: true).GetComponent<UIItem>();
1983 buttonBuy = m.AddButton("invBuy", delegate
1984 {
1985 Process();
1986 });
1987 m.onDestroy = delegate
1988 {
1989 if ((Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter)) && !m.wasCanceled)
1990 {
1991 Process();
1992 }
1993 };
1994 m.Show();
1995 if ((bool)buttonBuy)
1996 {
1997 buttonBuy.gameObject.AddComponent<CanvasGroup>();
1998 }
1999 UpdateButton();
2000 void Process()
2001 {
2002 if (!EClass.core.IsGameStarted || button == null || button.card == null)
2003 {
2004 Debug.Log("Split bug1");
2005 }
2006 else if (button.card.isDestroyed || button.card.Num < count)
2007 {
2008 Debug.Log("Split bug2");
2009 }
2010 else if (EClass.pc.isDead)
2011 {
2012 Debug.Log("Split bug3");
2013 }
2014 else if (count != 0 && !Input.GetMouseButton(1))
2015 {
2016 onSplit?.Invoke(count);
2017 }
2018 }
2019 void UpdateButton()
2020 {
2021 itemSlider.text1.text = GetName(NameStyle.FullNoArticle, 1);
2022 itemSlider.text2.text = Lang._weight(SelfWeight * count);
2023 buttonBuy.mainText.SetText(lang.lang(count.ToString() ?? ""));
2024 buttonBuy.mainText.RebuildLayoutTo<UIButton>();
2025 buttonBuy.interactable = true;
2026 buttonBuy.RebuildLayout(recursive: true);
2027 }
2028 }

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

2087 {
2088 if (!base.IsEquipment || base.IsCursed || base.rarity <= Rarity.Normal || GetInt(107) > 0)
2089 {
2090 return;
2091 }
2092 SetInt(107, 1);
2093 if (tg == null)
2094 {
2095 Rand.SetSeed(EClass.world.date.day + source._index + c.uid);
2096 if (msg)
2097 {
2098 c.Say("lick", c, this);
2099 PlaySound("offering");
2100 PlayEffect("mutation");
2101 }
2102 Element element = AddEnchant(base.LV);
2103 if (element != null)
2104 {
2105 SetInt(107, element.id);
2106 }
2107 }
2108 else
2109 {
2110 Rand.SetSeed(base.uid);
2111 List<Element> list = new List<Element>();
2112 foreach (Element value in elements.dict.Values)
2113 {
2114 if (value.id != 67 && value.id != 66 && value.id != 64 && value.id != 65)
2115 {
2116 list.Add(value);
2117 }
2118 }
2119 if (list.Count > 0)
2120 {
2121 Element element2 = list.RandomItem();
2122 elements.ModBase(element2.id, Mathf.Max(EClass.rnd(Mathf.Abs(element2.vBase / 5)), 1));
2123 SetInt(107, element2.id);
2124 }
2125 if (msg)
2126 {
2127 c.Say("lick2", c, tg, slot.name.ToLower());
2128 tg.PlaySound("offering");
2129 tg.PlayEffect("mutation");
2130 }
2131 }
2132 Rand.SetSeed();
2133 }
string name
Definition: BodySlot.cs:14
void SetInt(string id, int value=0)
Definition: Card.cs:2586
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:6679
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:7324
int day
Definition: Date.cs:62
static World world
Definition: EClass.cs:41
static void SetSeed(int a=-1)
Definition: Rand.cs:44
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 903 of file Thing.cs.

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

References CardRow._origin, Element._WriteNote(), UINote.AddHeaderCard(), UINote.AddText(), Game.cards, 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, CardManager.GlobalCharaList.Find(), ReligionManager.Find(), EClass.game, Element.Get(), ElementContainer.GetOrCreateElement(), AttackProcess.GetTwoHandEncBonus(), CardManager.globalCharas, 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, Card.NameSimple, 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 97 of file Thing.cs.

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

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

110 {
111 get
112 {
113 if (base.IsContainer && base.c_lockLv == 0 && !base.isNPCProperty)
114 {
115 Window.SaveData obj = GetObj<Window.SaveData>(2);
116 if (obj == null)
117 {
118 return false;
119 }
120 return obj.sharedType == ContainerSharedType.Shared;
121 }
122 return false;
123 }
124 }
ContainerSharedType
Definition: Window.cs:13

Referenced by AI_Shopping.Buy(), QuestSharedContainer.CanUpdateOnTalk(), Zone.FindSharedContainer(), AI_Idle.Run(), TraitBaseContainer.SetName(), 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 return pref;
57 }
58 CardRow cardRow = ((source.origin != null && !source.pref.UsePref) ? source.origin : source);
59 return cardRow.replacer.data?.pref ?? cardRow.pref;
60 }
61 }
SpriteReplacer replacer
Definition: RenderRow.cs:92
SourcePref pref
Definition: RenderRow.cs:68
SourcePref pref
Definition: SpriteData.cs:32
SpriteData data
virtual SourcePref GetPref()
Definition: Trait.cs:609

Referenced by Chara._Move(), BaseTileMap.DrawTile(), Cell.GetSurfaceHeight(), BaseTileMap.GetThingPosition(), CharaActorPCC.OnRender(), HotItemHeld.OnSetCurrentItem(), TCOrbitThing.OnSetOwner(), 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 63 of file Thing.cs.

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

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

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

◆ Tiles

override int [] Thing.Tiles
get

Definition at line 79 of file Thing.cs.


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