Elin Decompiled Documentation EA 23.271 Nightly Patch 1
Loading...
Searching...
No Matches
Chara Class Reference
Inheritance diagram for Chara:
Card IPathfindWalker BaseCard IReservable ICardParent IRenderSource IGlobalValue IInspect EClass

Public Member Functions

override string ToString ()
 
bool IsCriticallyWounded (bool includeRide=false)
 
bool HasHigherGround (Card c)
 
bool CanSeeSimple (Point p)
 
bool CanSee (Card c)
 
bool CanSeeLos (Card c, int dist=-1)
 
bool CanSeeLos (Point p, int dist=-1)
 
bool HasAccess (Card c)
 
bool HasAccess (Point p)
 
bool CanSleep ()
 
override string GetName (NameStyle style, int num=-1)
 
override void ChangeRarity (Rarity r)
 
Chara SetFaction (Faction f)
 
Chara SetHomeZone (Zone zone)
 
Chara SetHostility (Hostility h)
 
void OnBanish ()
 
Chara SetGlobal (Zone _home, int x, int z)
 
Chara SetGlobal ()
 
void RemoveGlobal ()
 
override void OnBeforeCreate ()
 
override void OnCreate (int genLv)
 
Chara ScaleByPrincipal ()
 
void SetFaith (string id)
 
void SetFaith (Religion r)
 
void HealAll ()
 
void Refresh (bool calledRecursive=false)
 
bool CanDuplicate ()
 
Chara Duplicate ()
 
int GetBurden (Card t=null, int num=-1)
 
void CalcBurden ()
 
void Stumble (int mtp=100)
 
void SetDirtySpeed ()
 
void RefreshSpeed (Element.BonusInfo info=null)
 
void CalculateMaxStamina ()
 
override void ApplyEditorTags (EditorTag tag)
 
override void SetSource ()
 
void SetMainElement (string id, int v=0, bool elemental=false)
 
void SetMainElement (int id, int v=0, bool elemental=false)
 
void ApplyJob (bool remove=false)
 
void ChangeJob (string idNew)
 
void AddRandomBodyPart (bool msg=false)
 
void RemoveLastBodyPart (bool msg=false)
 
void ResetBody ()
 
void ApplyRace (bool remove=false)
 
void ChangeRace (string idNew)
 
void MakePartyMemeber ()
 
void MakeAlly (bool msg=true)
 
void _MakeAlly ()
 
bool CanBeTempAlly (Chara c)
 
void Banish (Chara owner)
 
void MakeMinion (Chara _master, MinionType type=MinionType.Default)
 
bool HasMinion (string id)
 
void ReleaseMinion ()
 
void SetSummon (int duration)
 
Chara FindMaster ()
 
bool IsEscorted ()
 
bool CanDestroyPath ()
 
bool CanMoveTo (Point p, bool allowDestroyPath=true)
 
bool IsEnemyOnPath (Point p, bool cancelAI=true)
 
bool CanInteractTo (Card c)
 
bool CanInteractTo (Point p)
 
Point GetFirstStep (Point newPoint, PathManager.MoveType moveType=PathManager.MoveType.Default)
 
bool MoveRandom ()
 
bool MoveNeighborDefinitely ()
 
void MoveByForce (Point newPoint, Card c=null, bool checkWall=false)
 
MoveResult TryMoveTowards (Point p)
 
override MoveResult TryMove (Point newPoint, bool allowDestroyPath=true)
 
override MoveResult _Move (Point newPoint, MoveType type=MoveType.Walk)
 
void DestroyPath (Point pos)
 
void TryPush (Point point)
 
bool CanReplace (Chara c)
 
void MoveZone (string alias)
 
void MoveZone (Zone z, ZoneTransition.EnterState state=ZoneTransition.EnterState.Auto)
 
void MoveZone (Zone z, ZoneTransition transition)
 
void MoveHome (string id, int x=-1, int z=-1)
 
void MoveHome (Zone zone, int x=-1, int z=-1)
 
void FallFromZone ()
 
override void SetDir (int d)
 
override void Rotate (bool reverse=false)
 
override void LookAt (Card c)
 
override void LookAt (Point p)
 
void UpdateAngle ()
 
int GetCurrentDir ()
 
void UpdateSight ()
 
bool WillConsumeTurn ()
 
void TickConditions ()
 
void SyncRide ()
 
void SyncRide (Chara c)
 
override void Tick ()
 
bool CanLift (Card c)
 
bool CanAutoPick (Card c)
 
bool CanPick (Card c)
 
void PickOrDrop (Point p, string idThing, int idMat=-1, int num=1, bool msg=true)
 
void PickOrDrop (Point p, Thing t, bool msg=true)
 
Thing Pick (Thing t, bool msg=true, bool tryStack=true)
 
Thing TryPoisonPotion (Thing t)
 
void TryAbsorbRod (Thing t)
 
void TryReservePickupTutorial (Thing t)
 
void TryPickGroundItem (Func< Card, bool > func=null)
 
void TryPutShared (Thing t, List< Thing > containers=null, bool dropIfFail=true)
 
bool TryHoldCard (Card t, int num=-1, bool pickHeld=false)
 
void HoldCard (Card t, int num=-1)
 
void PickHeld (bool msg=false)
 
Card SplitHeld (int a)
 
void TryDropCarryOnly ()
 
Card DropHeld (Point dropPos=null)
 
void DropThing (Thing t, int num=-1)
 
AttackStyle GetFavAttackStyle ()
 
Element GetFavWeaponSkill ()
 
Element GetFavArmorSkill ()
 
void TryRestock (bool onCreate)
 
void RestockEquip (bool onCreate)
 
void RestockInventory (bool onCreate)
 
Thing EQ_ID (string s, int mat=-1, Rarity r=Rarity.Random)
 
void EQ_CAT (string s)
 
void EQ_Item (string s, int num=1)
 
void Drink (Card t)
 
bool CanRevive ()
 
void GetRevived ()
 
void Revive (Point p=null, bool msg=false)
 
void SaiyanRevive ()
 
void MakeGrave (string lastword)
 
void ApplyDeathPenalty ()
 
void Vomit ()
 
override void Die (Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None, Chara originalTarget=null)
 
void TryDropBossLoot ()
 
bool UseAbility (int idAct, Card tc=null, Point pos=null, bool pt=false)
 
bool UseAbility (string idAct, Card tc=null, Point pos=null, bool pt=false)
 
bool UseAbility (Act a, Card tc=null, Point pos=null, bool pt=false)
 
int EvalueRiding ()
 
int CalcCastingChance (Element e, int num=1)
 
void DoAI (int wait, Action onPerform)
 
void Cuddle (Chara c, bool headpat=false)
 
Chara SetEnemy (Chara c=null)
 
void TrySetEnemy (Chara c)
 
void DoHostileAction (Card _tg, bool immediate=false)
 
void CallHelp (Chara tg, bool fanatic=false)
 
bool FindNewEnemy ()
 
bool FindNearestNewEnemy ()
 
bool IsHostile ()
 
bool IsHostile (Chara c)
 
bool IsNeutral ()
 
bool IsNeutralOrAbove ()
 
bool IsBranchMember ()
 
bool IsHomeMember ()
 
bool IsInHomeZone ()
 
bool IsInSpot< T > ()
 
bool IsGuest ()
 
bool IsFriendOrAbove ()
 
bool IsFriendOrAbove (Chara c)
 
override CardRenderer _CreateRenderer ()
 
void SetPCCState (PCCState state)
 
override Sprite GetSprite (int dir=0)
 
void SetTempHand (int right=0, int left=0)
 
override SubPassData GetSubPassData ()
 
override void SetRenderParam (RenderParam p)
 
override string GetHoverText ()
 
override string GetHoverText2 ()
 
string GetTopicText (string topic="calm")
 
string TalkTopic (string topic="calm")
 
override Sprite GetImageSprite ()
 
void ChangeMemberType (FactionMemberType type)
 
void ShowDialog ()
 
LayerDrama ShowDialog (string book, string step="main", string tag="")
 
Point GetDestination ()
 
int GetHireCost ()
 
int GetHappiness ()
 
string GetTextHappiness ()
 
string GetActionText ()
 
override void WriteNote (UINote n, Action< UINote > onWriteNote=null, IInspect.NoteMode mode=IInspect.NoteMode.Default, Recipe recipe=null)
 
override void SetSortVal (UIList.SortMode m, CurrencyType currency=CurrencyType.Money)
 
void ClearBed (Map map=null)
 
TraitBed FindBed ()
 
TraitBed TryAssignBed ()
 
void TryPutSharedItems (IEnumerable< Thing > containers, bool msg=true)
 
void TryPutSharedItems (bool msg=true)
 
void TryTakeSharedItems (bool msg=true)
 
void TryTakeSharedItems (IEnumerable< Thing > containers, bool msg=true, bool shouldEat=true)
 
Thing FindBestFoodToEat ()
 
void InstantEat (Thing t=null, bool sound=true)
 
bool CanEat (Thing t, bool shouldEat=false)
 
bool ShouldEquip (Thing t, bool useFav=false)
 
bool TryEquip (Thing t, bool useFav=false)
 
bool CanEquipRanged (Thing t)
 
Thing TryGetThrowable ()
 
Thing FindAmmo (Thing weapon)
 
Thing GetBestRangedWeapon ()
 
bool TryEquipRanged ()
 
override int GetArmorSkill ()
 
bool TryUse (Thing t)
 
Room FindRoom ()
 
void ModAffinity (Chara c, int a, bool show=true, bool showOnlyEmo=false)
 
bool TryIdentify (Thing t, int count=1, bool show=true)
 
Chara CreateReplacement ()
 
SourceThing.Row GetFavFood ()
 
SourceCategory.Row GetFavCat ()
 
Chara GetNearbyCatToSniff ()
 
void Sniff (Chara c)
 
int GetTotalFeat ()
 
bool CanInsult ()
 
string GetIdPortraitCat ()
 
string GetIdPortrait ()
 
Thing MakeGene (DNA.Type? type=null)
 
Thing MakeBraineCell ()
 
void OnInsulted ()
 
bool IsValidGiftWeight (Card t, int num=-1)
 
bool CanAcceptItem (Card t, int num=-1, bool skipImportantCheck=false)
 
bool CanAcceptGift (Chara c, Card t)
 
void GiveGift (Chara c, Thing t)
 
void OnGiveErohon (Thing t)
 
void GiveLovePotion (Chara c, Thing t)
 
bool RequestProtection (Chara attacker, Action< Chara > action)
 
bool ShouldThrowAway (Thing t, ClearInventoryType type)
 
void ClearInventory (ClearInventoryType type)
 
void ResetUpgrade ()
 
void TryUpgrade (bool msg=true)
 
bool CanBloom ()
 
void AddCooldown (int idEle, int turns=0)
 
void SetCooldown (int idEle, int turns=0)
 
bool HasCooldown (int idEle)
 
int GetCooldown (int idEle)
 
void TickCooldown ()
 
void ChooseNewGoal ()
 
Goal GetGoalFromTimeTable (int hour)
 
Goal GetGoalWork ()
 
Goal GetGoalHobby ()
 
bool HasHobbyOrWork (string alias)
 
void SetAIIdle ()
 
void SetAIAggro ()
 
AIAct SetNoGoal ()
 
AIAct SetAI (AIAct g)
 
void SetAIImmediate (AIAct g)
 
BaseArea GetRoomWork ()
 
List< HobbyListWorks (bool useMemberType=true)
 
List< HobbyListHobbies (bool useMemberType=true)
 
Hobby GetWork (string id)
 
void RefreshWorkElements (ElementContainer parent=null)
 
string GetTextHobby (bool simple=false)
 
string GetTextWork (bool simple=false)
 
void AddHobby (int id)
 
void AddWork (int id)
 
void RerollHobby (bool extraSlotChance=true)
 
WorkSummary GetWorkSummary ()
 
void TickWork (VirtualDate date)
 
bool TryWorkOutside (SourceHobby.Row sourceWork)
 
void PerformWork (WorkSession session, bool isHobby=false, bool IsRealTime=false)
 
void ValidateWorks ()
 
void InitStats (bool onDeserialize=false)
 
Condition AddCondition< T > (int p=100, bool force=false)
 
Condition AddCondition (string id, int p=100, bool force=false)
 
Condition AddCondition (Condition c, bool force=false)
 
override bool HasCondition< T > ()
 
bool HasCondition (string alias)
 
Element GetBuffStats (string alias)
 
Element GetBuffStats (int ele)
 
int CountDebuff ()
 
void CureCondition< T > (int v=99999)
 
override T GetCondition< T > ()
 
void RemoveCondition< T > ()
 
void CureHost (CureType type, int p=100, BlessedState state=BlessedState.Normal)
 
void Cure (CureType type, int p=100, BlessedState state=BlessedState.Normal)
 
void RemoveAllStances ()
 
bool TryNeckHunt (Chara TC, int power, bool harvest=false)
 
void AddResistCon (Condition con)
 
void ResistCon (Condition con)
 
void Sleep (Thing bed=null, Thing pillow=null, bool pickup=false, ItemPosition posBed=null, ItemPosition posPillow=null)
 
void OnSleep (Thing bed=null, int days=1)
 
void OnSleep (int power, int days=1, bool isSunLit=false)
 
void ModHeight (int a)
 
void ModWeight (int a, bool ignoreLimit=false)
 
void ModCorruption (int a)
 
List< ElementListAvailabeFeats (bool pet=false, bool showAll=false)
 
void SetFeat (int id, int value=1, bool msg=false)
 
void SetMutation (int idEle, int a=0)
 
bool MutateRandom (int vec=0, int tries=100, bool ether=false, BlessedState state=BlessedState.Normal)
 
void GainAbility (int ele, int mtp=100, Thing origin=null)
 
bool TryNullifyCurse ()
 
void OnAdvanceDay ()
 
void AddFoodHistory (Thing food)
 
int CountNumEaten (Thing food)
 
int GetPietyValue ()
 
void RefreshFaithElement ()
 
void ModTempElement (int ele, int a, bool naturalDecay=false, bool onlyRenew=false)
 
void DamageTempElements (int p, bool body, bool mind, bool onlyRenew=false)
 
void DamageTempElement (int ele, int p, bool onlyRenew=false)
 
void EnhanceTempElements (int p, bool body, bool mind, bool onlyRenew=false)
 
void EnhanceTempElement (int ele, int p, bool onlyRenew=false)
 
void DiminishTempElements (int a=1)
 
void CureTempElements (int p, bool body, bool mind)
 
void ClearTempElements ()
 
- Public Member Functions inherited from Card
override string ToString ()
 
bool CanReserve (AIAct act)
 
bool TryReserve (AIAct act)
 
void Mod ()
 
Window.SaveData GetWindowSaveData ()
 
bool IsExcludeFromCraft (Recipe.Ingredient ing)
 
void SetDirtyWeight ()
 
void ChangeWeight (int a)
 
int Evalue (int ele)
 
int Evalue (int ele, bool ignoreGlobalElement)
 
int EvalueMax (int ele, int min=0)
 
int Evalue (string alias)
 
bool HasTag (CTAG tag)
 
bool HasEditorTag (EditorTag tag)
 
void AddEditorTag (EditorTag tag)
 
void RemoveEditorTag (EditorTag tag)
 
virtual string GetName (NameStyle style, int num=-1)
 
virtual string GetExtraName ()
 
virtual string GetDetail ()
 
int GetBestAttribute ()
 
void ModExp (string alias, int a)
 
void ModExp (int ele, int a)
 
bool IsChildOf (Card c)
 
FindTool< T > ()
 
string ReferenceId ()
 
void Create (string _id, int _idMat=-1, int genLv=-1)
 
virtual void OnBeforeCreate ()
 
virtual void OnCreate (int genLv)
 
virtual void SetSource ()
 
virtual void ApplyEditorTags (EditorTag tag)
 
void ApplyTrait ()
 
Card SetLv (int a)
 
void ClampInitialSkill ()
 
void AddExp (int a, bool applyMod=true)
 
int GetExpMtp ()
 
int GetAffinityExpBonus ()
 
int GetDaysTogetherBonus ()
 
void LevelUp ()
 
virtual void ApplyMaterialElements (bool remove)
 
virtual void ApplyMaterial (bool remove=false)
 
Card ChangeMaterial (int idNew, bool ignoreFixedMaterial=false)
 
Card ChangeMaterial (string idNew, bool ignoreFixedMaterial=false)
 
Card ChangeMaterial (SourceMaterial.Row row, bool ignoreFixedMaterial=false)
 
void SetReplica (bool on)
 
Thing Add (string id, int num=1, int lv=1)
 
Card AddCard (Card c)
 
void RemoveCard (Card c)
 
void NotifyAddThing (Thing t, int num)
 
Thing AddThing (string id, int lv=-1)
 
Thing AddThing (Thing t, bool tryStack=true, int destInvX=-1, int destInvY=-1)
 
void PurgeDuplicateArtifact (Thing af)
 
void PurgeEythArtifact ()
 
void RemoveThings ()
 
void RemoveThing (Thing thing)
 
bool ShouldTrySetDirtyInventory ()
 
virtual bool CanStackTo (Thing to)
 
bool TryStackTo (Thing to)
 
ICardParent GetRoot ()
 
Card GetRootCard ()
 
bool IsStackable (Thing tg)
 
Thing Duplicate (int num)
 
Thing Split (int a)
 
Thing SetNum (int a)
 
Thing SetNoSell ()
 
void ModNum (int a, bool notify=true)
 
void AddSocket ()
 
void ApplySocket (Thing t)
 
void ApplySocket (int id, int lv, Card mod=null)
 
void EjectSockets ()
 
SocketData AddRune (Card rune)
 
SocketData AddRune (int idEle, int v, bool free)
 
SocketData GetRuneEnc (int idEle)
 
int CountRune (bool countFree=true)
 
int MaxRune ()
 
bool CanAddRune (TraitMod mod)
 
bool HasRune ()
 
void OnChildNumChange (Card c)
 
Card Install ()
 
void SetPlaceState (PlaceState newState, bool byPlayer=false)
 
int GetTotalQuality (bool applyBonus=true)
 
void ModEncLv (int a)
 
void SetEncLv (int a)
 
void SetTier (int a, bool setTraits=true)
 
virtual void SetBlessedState (BlessedState s)
 
virtual void ChangeRarity (Rarity q)
 
bool TryPay (int a, string id="money")
 
void SetCharge (int a)
 
void ModCharge (int a, bool destroy=false)
 
void ModCurrency (int a, string id="money")
 
int GetCurrency (string id="money")
 
virtual void HealHPHost (int a, HealSource origin=HealSource.None)
 
virtual void HealHP (int a, HealSource origin=HealSource.None)
 
virtual int GetArmorSkill ()
 
virtual long ApplyProtection (long dmg, int mod=100)
 
void DamageHP (long dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
 
void DamageHP (long dmg, int ele, int eleP=100, AttackSource attackSource=AttackSource.None, Card origin=null, bool showEffect=true, Thing weapon=null, Chara originalTarget=null)
 
void ApplyElementEffect (Element e, int eleP, Card origin, bool checkHostileAct=false)
 
virtual void Die (Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None, Chara originalTarget=null)
 
void Explode (Point p, Card origin)
 
void Deconstruct ()
 
void Destroy ()
 
void SpawnLoot (Card origin)
 
Thing TryMakeRandomItem (int lv=-1, TryMakeRandomItemSource itemSource=TryMakeRandomItemSource.Default, Chara crafter=null)
 
Card MakeFoodFrom (string _id)
 
Card MakeFoodFrom (Card c)
 
void MakeFoodRef (Card c1, Card c2=null)
 
string TryGetFoodName (Card c)
 
string GetFoodName (string s)
 
void MakeFigureFrom (string id)
 
Card MakeRefFrom (string id)
 
void MakeRefFrom (Card c1, Card c2=null)
 
Thing MakeEgg (bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
 
Thing MakeMilk (bool effect=true, int num=1, bool addToZone=true, BlessedState? state=null)
 
Thing GiveBirth (Thing t, bool effect)
 
void HatchEgg ()
 
Card SetHidden (bool hide=true)
 
virtual MoveResult _Move (Point p, MoveType type=MoveType.Walk)
 
void MoveImmediate (Point p, bool focus=true, bool cancelAI=true)
 
void Teleport (Point point, bool silent=false, bool force=false)
 
virtual void OnLand ()
 
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)
 
void RefreshColor ()
 
ref Color GetRandomColor ()
 
virtual Sprite GetSprite (int dir=0)
 
virtual Sprite GetImageSprite ()
 
void SetImage (Image image, int dir, int idSkin=0)
 
virtual void SetImage (Image image)
 
void ShowEmo (Emo _emo=Emo.none, float duration=0f, bool skipSame=true)
 
void PlaySoundHold (bool spatial=true)
 
void PlaySoundDrop (bool spatial=true)
 
void PlaySoundImpact (bool spatial=true)
 
void PlaySoundDead (bool spatial=true)
 
SoundSource PlaySound (string id, float v=1f, bool spatial=true)
 
void KillAnime ()
 
void PlayAnime (AnimeID id, bool force=false)
 
void PlayAnime (AnimeID id, Point dest, bool force=false)
 
void PlayAnimeLoot ()
 
Effect PlayEffect (string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
 
void PlayEffect (int ele, bool useRenderPos=true, float range=0f)
 
virtual void SetDir (int d)
 
void SetRandomDir ()
 
virtual void LookAt (Card c)
 
virtual void LookAt (Point p)
 
virtual void Rotate (bool reverse=false)
 
void ChangeAltitude (int a)
 
virtual SubPassData GetSubPassData ()
 
void SetFreePos (Point point)
 
void RenderMarker (Point point, bool active, HitResult result, bool main, int dir, bool useCurrentPosition=false)
 
void RecalculateFOV ()
 
bool HasLight ()
 
float GetLightPower ()
 
int GetHearingRadius ()
 
int GetSightRadius ()
 
int GetLightRadius ()
 
void CalculateFOV ()
 
void SetRandomLightColors ()
 
Fov CreateFov ()
 
void ClearFOV ()
 
virtual void OnSimulateHour (VirtualDate date)
 
void DecayNatural (int hour=1)
 
void CheckJustCooked ()
 
void Decay (int a=10)
 
bool HasTalk (string idTopic)
 
void Talk (string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
 
void TalkRaw (string text, string ref1=null, string ref2=null, bool forceSync=false)
 
string StripTalkSpeiclaCharacters (string text)
 
string ApplyNewLine (string text)
 
void SayRaw (string text, string ref1=null, string ref2=null)
 
void SayNothingHappans ()
 
void Say (string lang, string ref1=null, string ref2=null)
 
void Say (string lang, Card c1, Card c2, string ref1=null, string ref2=null)
 
void Say (string lang, Card c1, string ref1=null, string ref2=null)
 
string GetTalkText (string idTopic, bool stripPun=false, bool useDefault=true)
 
string ApplyTone (string text, bool stripPun=false)
 
void SetRandomTalk ()
 
void SetRandomTone ()
 
bool HasCraftBonusTrait ()
 
List< ElementListCraftBonusTraits ()
 
void TryStack (Thing t)
 
void ApplyBacker (int bid)
 
void RemoveBacker ()
 
void SetPaintData ()
 
byte[] GetPaintData ()
 
void ClearPaintSprite ()
 
Sprite GetPaintSprite ()
 
void TryUnrestrain (bool force=false, Chara c=null)
 
TraitShackle GetRestrainer ()
 
virtual void Tick ()
 
Thing SetPriceFix (int a)
 
int GetEquipValue ()
 
void SetSale (bool sale)
 
int GetValue (PriceType priceType=PriceType.Default, bool sell=false)
 
virtual int GetPrice (CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
 
virtual string GetHoverText ()
 
virtual string GetHoverText2 ()
 
int Dist (Card c)
 
int Dist (Point p)
 
bool IsInMutterDistance (int d=10)
 
void SetCensored (bool enable)
 
void SetDeconstruct (bool deconstruct)
 
virtual bool MatchEncSearch (string s)
 
virtual void SetSortVal (UIList.SortMode m, CurrencyType currency=CurrencyType.Money)
 
virtual int SecondaryCompare (UIList.SortMode m, Card c)
 
void ForeachFOV (Func< Point, bool > func)
 
void ForeachPoint (Action< Point, bool > action)
 
void OnInspect ()
 
virtual void WriteNote (UINote n, Action< UINote > onWriteNote=null, IInspect.NoteMode mode=IInspect.NoteMode.Default, Recipe recipe=null)
 
void Inspect ()
 
virtual bool HasCondition< T > ()
 
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)
 
GetObj< T > (int id)
 
void SetObj (int id, object o)
 
SetObj< T > (int id, object o)
 
ICardParent GetRoot ()
 
void RemoveCard (Card c)
 
void OnChildNumChange (Card c)
 
string ReferenceId ()
 
void WriteNote (UINote n, Action< UINote > onWriteNote=null, NoteMode mode=NoteMode.Default, Recipe recipe=null)
 
void OnInspect ()
 

Public Attributes

int contribution
 
Point orgPos
 
Quest quest
 
Chara ride
 
Chara parasite
 
Chara host
 
ElementContainer tempElements
 
ElementContainer faithElements
 
ElementContainer workElements
 
Party party
 
FactionMemberType memberType
 
List< int > _hobbies
 
List< int > _works
 
WorkSummary _workSummary
 
List< int > _cooldowns
 
List< int > _listAbility
 
List< List< string > > _historyFood
 
PCCData pccData
 
Card held
 
int[] rawSlots
 
GlobalData global
 
string[] _strs = new string[5]
 
int[] _cints = new int[30]
 
BitArray32 _cbits1
 
Chara enemy
 
Chara master
 
Point lastPos = new Point()
 
PathProgress path = new PathProgress()
 
CharaBody body = new CharaBody()
 
CharaAbility _ability
 
Thing ranged
 
Thing nextUse
 
ConSleep conSleep
 
ConSuspend conSuspend
 
ConTransmuteMimic mimicry
 
Emo2 emoIcon
 
int happiness
 
int turnLastSeen = -100
 
int idleActTimer
 
int combatCount
 
int calmCheckTurn
 
int sharedCheckTurn
 
float idleTimer
 
bool isBerserk
 
bool isDrunk
 
bool isConfused
 
bool isFainted
 
bool isBlind
 
bool isParalyzed
 
bool _isLevitating
 
bool isCreated
 
bool canSeeInvisible
 
bool hasTelepathy
 
bool isWet
 
bool bossText
 
bool ignoreSPAbsorb
 
bool wasInWater
 
bool visibleWithTelepathy
 
bool isWeakToSunlight
 
SpriteReplacer spriteReplacer
 
SourceChara.Row source
 
SourceRace.Row _race
 
SourceJob.Row _job
 
Tactics _tactics
 
bool dirtySpeed = true
 
float actTime = 0.3f
 
int stealthSeen
 
GoalList goalList = new GoalList()
 
AIAct ai = new NoGoal()
 
ElementContainer _baseWorkElements
 
List< Conditionconditions = new List<Condition>()
 
Dictionary< int, int > resistCon
 
- Public Attributes inherited from Card
int[] _ints = new int[30]
 
string id = ""
 
ThingContainer things = new ThingContainer()
 
ElementContainerCard elements = new ElementContainerCard()
 
Biography bio
 
List< int > sockets
 
AIAct reservedAct
 
Props props
 
Trait trait
 
ICardParent parent
 
Fov fov
 
Point pos = new Point()
 
CardRenderer renderer
 
CardRow hat
 
int turn
 
int _colorInt
 
float roundTimer
 
float angle = 180f
 
float animeCounter
 
bool isDestroyed
 
CardBlueprint bp
 
BitArray32 _bits1
 
BitArray32 _bits2
 
PlaceState placeState
 
bool dirtyWeight = true
 
SourceMaterial.Row _material
 
Emo lastEmo
 
int sortVal
 
- Public Attributes inherited from BaseCard
Dictionary< int, object > mapObj = new Dictionary<int, object>()
 
Dictionary< int, int > mapInt = new Dictionary<int, int>()
 
Dictionary< int, string > mapStr = new Dictionary<int, string>()
 

Static Public Attributes

static string[] IDTimeTable = new string[2] { "default", "owl" }
 
static List< SourceRace.RowListAdvRace = new List<SourceRace.Row>()
 
static List< SourceJob.RowListAdvJob = new List<SourceJob.Row>()
 
static bool consumeTurn
 
static bool preventRegen
 
static bool isOnCreate
 
static NoGoal _NoGoalPC = new NoGoal()
 
static NoGoal _NoGoalRepeat = new NoGoal()
 
- 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
 

Protected Member Functions

override void OnSerializing ()
 
override void OnDeserialized ()
 
virtual void OnSerializing ()
 
virtual void OnDeserialized ()
 

Properties

string Aka [get]
 
string _alias [get, set]
 
string idFaith [get, set]
 
string idFaction [get, set]
 
Zone currentZone [get, set]
 
Zone homeZone [get, set]
 
GoalListType goalListType [get, set]
 
Hostility hostility [get, set]
 
int _affinity [get, set]
 
Affinity affinity [get]
 
int interest [get, set]
 
int daysStarved [get, set]
 
int _idTimeTable [get, set]
 
int uidEditor [get, set]
 
int _maxStamina [get, set]
 
int corruption [get, set]
 
bool isDead [get, set]
 
bool isAlawysVisible [get, set]
 
bool knowFav [get, set]
 
CharaAbility ability [get]
 
Faction faction [get, set]
 
Religion faith [get, set]
 
override CardRow sourceCard [get]
 
override CardRow sourceRenderCard [get]
 
SourceRace.Row race [get]
 
SourceJob.Row job [get]
 
string idTimeTable [get]
 
Hostility OriginalHostility [get]
 
string IDPCCBodySet [get]
 
new TraitChara trait [get, set]
 
string NameBraced [get]
 
string NameTitled [get]
 
override string actorPrefab [get]
 
override int PrefIndex [get]
 
override bool flipX [get]
 
override string AliasMaterialOnCreate [get]
 
override bool IsAliveInCurrentZone [get]
 
override bool IsDeadOrSleeping [get]
 
override bool IsDisabled [get]
 
bool IsLevitating [get]
 
override bool IsMoving [get]
 
override bool IsGlobal [get]
 
override bool IsPC [get]
 
override bool IsPCParty [get]
 
override bool IsMinion [get]
 
override bool IsPCPartyMinion [get]
 
override bool IsPCFactionMinion [get]
 
override bool IsPCFaction [get]
 
override bool IsPCC [get]
 
override bool isThing [get]
 
override bool isChara [get]
 
override bool HasHost [get]
 
override bool isSynced [get]
 
override bool IsMultisize [get]
 
override int MaxHP [get]
 
override int WeightLimit [get]
 
override int SelfWeight [get]
 
int MaxSummon [get]
 
Element MainElement [get]
 
override int DV [get]
 
override int PV [get]
 
override SourcePref Pref [get]
 
bool CanOpenDoor [get]
 
Tactics tactics [get]
 
TimeTable.Span CurrentSpan [get]
 
bool IsInActiveZone [get]
 
bool IsLocalChara [get]
 
bool IsIdle [get]
 
bool IsInCombat [get]
 
bool IsAnimal [get]
 
bool IsHuman [get]
 
bool IsUndead [get]
 
bool IsMachine [get]
 
bool IsHorror [get]
 
bool IsFish [get]
 
bool IsFairy [get]
 
bool IsGod [get]
 
bool IsDragon [get]
 
bool IsPlant [get]
 
bool IsCat [get]
 
int DestDist [get]
 
bool HasNoGoal [get]
 
bool CanWitness [get]
 
bool IsHumanSpeak [get]
 
bool IsMaid [get]
 
bool IsPrisoner [get]
 
bool IsAdventurer [get]
 
bool IsEyth [get]
 
bool IsWealthy [get]
 
FactionBranch homeBranch [get]
 
int MaxGeneSlot [get]
 
int GeneCostMTP [get]
 
int CurrentGeneSlot [get]
 
int Speed [get]
 
bool IsMofuable [get]
 
ElementContainer baseWorkElements [get]
 
Stats hunger [get]
 
Stats burden [get]
 
Stats stamina [get]
 
Stats depression [get]
 
Stats bladder [get]
 
Stats hygiene [get]
 
Stats mana [get]
 
Stats sleepiness [get]
 
Stats SAN [get]
 
bool CanGainConResist [get]
 
- Properties inherited from Card
Card parentCard [get]
 
Thing parentThing [get]
 
int colorInt [get]
 
bool IsHotItem [get]
 
int uid [get, set]
 
int idMaterial [get, set]
 
int dir [get, set]
 
int Num [get, set]
 
int _x [get, set]
 
int _z [get, set]
 
int genLv [get, set]
 
int refVal [get, set]
 
int decay [get, set]
 
int altitude [get, set]
 
int hp [get, set]
 
float fx [get, set]
 
float fy [get, set]
 
BlessedState blessedState [get, set]
 
PlaceState _placeState [get, set]
 
int rarityLv [get, set]
 
Rarity rarity [get, set]
 
int encLV [get, set]
 
int posInvX [get, set]
 
int posInvY [get, set]
 
int idSkin [get, set]
 
int feat [get, set]
 
int LV [get, set]
 
int exp [get, set]
 
int tier [get, set]
 
int version [get, set]
 
bool isCensored [get, set]
 
bool isDeconstructing [get, set]
 
bool isDyed [get, set]
 
bool isModified [get, set]
 
bool isNew [get, set]
 
bool isPlayerCreation [get, set]
 
bool ignoreAutoPick [get, set]
 
bool freePos [get, set]
 
bool isHidden [get, set]
 
bool isOn [get, set]
 
bool isNPCProperty [get, set]
 
bool isRestrained [get, set]
 
bool isRoofItem [get, set]
 
bool isMasked [get, set]
 
bool disableAutoToggle [get, set]
 
bool isImported [get, set]
 
bool autoRefuel [get, set]
 
bool ignoreStackHeight [get, set]
 
bool isFloating [get, set]
 
bool isWeightChanged [get, set]
 
bool isFireproof [get, set]
 
bool isAcidproof [get, set]
 
bool isReplica [get, set]
 
bool isSummon [get, set]
 
bool isElemental [get, set]
 
bool isBroken [get, set]
 
bool isSubsetCard [get, set]
 
bool noSnow [get, set]
 
bool noMove [get, set]
 
bool isGifted [get, set]
 
bool isCrafted [get, set]
 
bool isLostProperty [get, set]
 
bool noShadow [get, set]
 
bool noSell [get, set]
 
bool isLeashed [get, set]
 
bool isStolen [get, set]
 
bool isSale [get, set]
 
bool isCopy [get, set]
 
bool isRestocking [get, set]
 
bool hasSpawned [get, set]
 
bool isScaled [get, set]
 
bool isBackerContent [get]
 
SourceBacker.Row sourceBacker [get]
 
BedType c_bedType [get, set]
 
int c_equippedSlot [get, set]
 
int c_lockLv [get, set]
 
Hostility c_originalHostility [get, set]
 
MinionType c_minionType [get, set]
 
int c_vomit [get, set]
 
bool c_wasInPcParty [get, set]
 
bool c_isImportant [get, set]
 
bool c_lockedHard [get, set]
 
bool c_revealLock [get, set]
 
bool c_isTrained [get, set]
 
bool c_isPrayed [get, set]
 
bool c_isDisableStockUse [get, set]
 
int c_lightColor [get, set]
 
Color LightColor [get]
 
int c_uidZone [get, set]
 
int c_uidRefCard [get, set]
 
int c_priceFix [get, set]
 
int c_priceAdd [get, set]
 
int c_priceCopy [get, set]
 
int c_fixedValue [get, set]
 
int c_dyeMat [get, set]
 
VisitorState visitorState [get, set]
 
RescueState c_rescueState [get, set]
 
BossType c_bossType [get, set]
 
int c_dateStockExpire [get, set]
 
int c_dateDeathLock [get, set]
 
int c_IDTState [get, set]
 
int c_charges [get, set]
 
int c_bill [get, set]
 
int c_invest [get, set]
 
int c_seed [get, set]
 
int c_allowance [get, set]
 
int c_fur [get, set]
 
int c_dateCooked [get, set]
 
int c_lockedAge [get, set]
 
int c_containerSize [get, set]
 
int c_weight [get, set]
 
int c_diceDim [get, set]
 
int c_indexContainerIcon [get, set]
 
int c_idMainElement [get, set]
 
int c_summonDuration [get, set]
 
int c_idBacker [get, set]
 
int c_uidMaster [get, set]
 
int c_ammo [get, set]
 
int c_daysWithGod [get, set]
 
int c_daysWithPC [get, set]
 
string c_idPortrait [get, set]
 
string c_idRace [get, set]
 
string c_idJob [get, set]
 
string c_idTone [get, set]
 
string c_color [get, set]
 
string c_idSpriteReplacer [get, set]
 
string c_idTalk [get, set]
 
string c_idDeity [get, set]
 
string c_altName [get, set]
 
string c_altName2 [get, set]
 
string c_extraNameRef [get, set]
 
string c_refText [get, set]
 
string c_idRefName [get, set]
 
string c_idRidePCC [get, set]
 
string c_idAbility [get, set]
 
string c_context [get, set]
 
string c_idEditor [get, set]
 
string c_editorTags [get, set]
 
string c_editorTraitVal [get, set]
 
string c_idTrait [get, set]
 
string c_idRefCard [get, set]
 
string c_idRefCard2 [get, set]
 
string c_note [get, set]
 
UniqueData c_uniqueData [get, set]
 
Thing ammoData [get, set]
 
List< SocketDatasocketList [get, set]
 
Thing c_copyContainer [get, set]
 
Window.SaveData c_windowSaveData [get, set]
 
CharaUpgrade c_upgrades [get, set]
 
CharaGenes c_genes [get, set]
 
List< int > c_corruptionHistory [get, set]
 
ContainerUpgrade c_containerUpgrade [get, set]
 
DNA c_DNA [get, set]
 
CharaList c_charaList [get, set]
 
MixedFoodData c_mixedFoodData [get, set]
 
Thing c_bloodData [get, set]
 
byte[] c_textureData [get, set]
 
SourceMaterial.Row DyeMat [get]
 
int invX [get, set]
 
int invY [get, set]
 
CardRow refCard [get]
 
CardRow refCard2 [get]
 
int ExpToNext [get]
 
int DefaultLV [get]
 
int ChildrenWeight [get]
 
int ChildrenAndSelfWeight [get]
 
int ChildrenAndSelfWeightSingle [get]
 
virtual int SelfWeight [get]
 
virtual int WeightLimit [get]
 
SourceCategory.Row category [get]
 
SourceMaterial.Row material [get]
 
virtual string AliasMaterialOnCreate [get]
 
Cell Cell [get]
 
virtual Thing Thing [get]
 
virtual Chara Chara [get]
 
virtual bool isThing [get]
 
virtual bool isChara [get]
 
bool ExistsOnMap [get]
 
virtual bool isSynced [get]
 
bool IsContainer [get]
 
bool IsUnique [get]
 
bool IsPowerful [get]
 
bool IsImportant [get]
 
virtual SourcePref Pref [get]
 
virtual bool IsDeadOrSleeping [get]
 
virtual bool IsDisabled [get]
 
virtual bool IsMoving [get]
 
virtual bool flipX [get]
 
virtual bool IsAliveInCurrentZone [get]
 
virtual string actorPrefab [get]
 
virtual CardRow sourceCard [get]
 
virtual CardRow sourceRenderCard [get]
 
virtual RenderRow TileRow [get]
 
TileType TileType [get]
 
string Name [get]
 
string NameSimple [get]
 
string NameOne [get]
 
virtual bool IsPC [get]
 
bool _IsPC [get]
 
virtual bool IsPCC [get]
 
virtual bool IsPCParty [get]
 
virtual bool IsMinion [get]
 
virtual bool IsPCPartyMinion [get]
 
virtual bool IsPCFactionMinion [get]
 
virtual bool IsMultisize [get]
 
bool IsToolbelt [get]
 
bool IsLightsource [get]
 
bool IsEquipment [get]
 
bool IsFood [get]
 
bool IsInheritFoodTraits [get]
 
bool ShowFoodEnc [get]
 
bool IsWeapon [get]
 
bool IsEquipmentOrRanged [get]
 
bool IsEquipmentOrRangedOrAmmo [get]
 
bool IsMeleeWeapon [get]
 
bool IsRangedWeapon [get]
 
bool IsThrownWeapon [get]
 
bool IsAmmo [get]
 
bool IsAgent [get]
 
bool IsFurniture [get]
 
bool IsBlessed [get]
 
bool IsCursed [get]
 
bool IsRestrainedResident [get]
 
virtual bool IsPCFaction [get]
 
bool IsPCFactionOrMinion [get]
 
virtual bool IsGlobal [get]
 
virtual int MaxDecay [get]
 
bool IsDecayed [get]
 
bool IsRotting [get]
 
bool IsFresn [get]
 
virtual int MaxHP [get]
 
virtual int Power [get]
 
int FameLv [get]
 
virtual int[] Tiles [get]
 
virtual int PrefIndex [get]
 
bool IsVariation [get]
 
virtual int DV [get]
 
virtual int PV [get]
 
int HIT [get]
 
int DMG [get]
 
int STR [get]
 
int DEX [get]
 
int END [get]
 
int PER [get]
 
int LER [get]
 
int WIL [get]
 
int MAG [get]
 
int CHA [get]
 
int INT [get]
 
int LUC [get]
 
int W [get]
 
int H [get]
 
bool IsIdentified [get]
 
string TextRarity [get]
 
bool IsInstalled [get]
 
bool IsMale [get]
 
bool IsNegativeGift [get]
 
bool HasContainerSize [get]
 
Thing Tool [get]
 
virtual SourceMaterial.Row DefaultMaterial [get]
 
virtual bool HasHost [get]
 
int Quality [get]
 
int QualityLv [get]
 
LightData LightData [get]
 
CardRenderer HostRenderer [get]
 
bool ShouldShowMsg [get]
 
bool CanInspect [get]
 
string InspectName [get]
 
Point InspectPoint [get]
 
Vector3 InspectPosition [get]
 
- Properties inherited from EClass
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Faction Wilds [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 
- Properties inherited from IInspect
bool CanInspect [get]
 
string InspectName [get]
 
Point InspectPoint [get]
 
Vector3 InspectPosition [get]
 

Private Member Functions

int ParseBodySlot (string s)
 
void SetEQQuality ()
 
void GoHostile (Card _tg)
 
LayerDrama _ShowDialog (string book, string sheet, string step="main", string tag="")
 

Private Attributes

Faction _faction
 
long _Speed
 
bool hasMovedThisTurn
 

Static Private Attributes

static Point shared = new Point()
 
static List< HobbylistHobby = new List<Hobby>()
 
static Point _sharedPos = new Point()
 
static List< Chara_pts = new List<Chara>()
 
static List< Thing_ListItems = new List<Thing>()
 
static List< SourceThing.Row_listFavFood = new List<SourceThing.Row>()
 
static List< SourceCategory.Row_listFavCat = new List<SourceCategory.Row>()
 
static GoalWork _goalWork = new GoalWork()
 
static GoalHobby _goalHobby = new GoalHobby()
 

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 }
 
- 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)
 

Detailed Description

Definition at line 9 of file Chara.cs.

Member Function Documentation

◆ _CreateRenderer()

override CardRenderer Chara._CreateRenderer ( )
inlinevirtual

Reimplemented from Card.

Definition at line 6650 of file Chara.cs.

6651 {
6652 CardRenderer cardRenderer = renderer;
6653 CharaRenderer charaRenderer = new CharaRenderer();
6654 if (source.skinAntiSpider != 0 && EClass.core.config.game.antiSpider)
6655 {
6656 base.idSkin = source.skinAntiSpider;
6657 }
6658 if (host != null)
6659 {
6660 charaRenderer.pccData = PCCData.Create("ride");
6661 string idPart = base.c_idRidePCC.IsEmpty(EClass.core.pccs.sets["ride"].map["body"].map.Keys.First());
6662 charaRenderer.pccData.SetPart("body", "ride", idPart);
6663 charaRenderer.pccData.ride = EClass.core.pccs.GetRideData(idPart);
6664 }
6665 else
6666 {
6667 foreach (Condition condition in conditions)
6668 {
6669 RendererReplacer rendererReplacer = condition.GetRendererReplacer();
6670 if (rendererReplacer != null)
6671 {
6672 charaRenderer.replacer = rendererReplacer;
6673 charaRenderer.data = rendererReplacer.data;
6674 break;
6675 }
6676 }
6677 if (charaRenderer.replacer == null)
6678 {
6679 charaRenderer.pccData = pccData;
6680 }
6681 }
6682 renderer = charaRenderer;
6683 renderer.SetOwner(this);
6684 if (cardRenderer != null)
6685 {
6686 renderer.SetFirst(first: false, cardRenderer.position);
6687 }
6688 return charaRenderer;
6689 }
virtual RendererReplacer GetRendererReplacer()
RendererReplacer replacer
Definition: CardRenderer.cs:29
Vector3 position
Definition: CardRenderer.cs:21
virtual void SetOwner(Card c)
Definition: CardRenderer.cs:38
virtual void SetFirst(bool first, Vector3 pos)
CardRenderer renderer
Definition: Card.cs:62
PCCData pccData
Chara host
Definition: Chara.cs:33
List< Condition > conditions
Definition: Chara.cs:213
SourceChara.Row source
Definition: Chara.cs:160
PCCData pccData
Definition: Chara.cs:67
new GameConfig game
Definition: CoreConfig.cs:609
PCCManager pccs
Definition: Core.cs:41
CoreConfig config
Definition: Core.cs:70
Definition: EClass.cs:6
static Core core
Definition: EClass.cs:7

References CoreConfig.GameConfig.antiSpider, Core.config, EClass.core, RendererReplacer.data, CoreConfig.game, BaseCondition.GetRendererReplacer(), CharaRenderer.pccData, Core.pccs, CardRenderer.position, CardRenderer.replacer, CharaRenderer.SetOwner(), and SourceChara.Row.skinAntiSpider.

Referenced by ActPlan._Update(), BaseListPeople.OnClick(), LayerEditSkin.OnClickClear(), Player.OnCreateGame(), ConBoost.OnRemoved(), ConTransmute.OnRemoved(), ConBoost.OnStart(), ConTransmute.OnStart(), LayerEditSkin.RefreshList(), ActRide.Ride(), and ActRide.Unride().

◆ _MakeAlly()

void Chara._MakeAlly ( )
inline

Definition at line 2330 of file Chara.cs.

2331 {
2332 if (EClass.pc.homeBranch != null)
2333 {
2335 }
2336 else
2337 {
2338 SetGlobal();
2340 }
2341 Hostility hostility2 = (base.c_originalHostility = Hostility.Ally);
2342 this.hostility = hostility2;
2343 orgPos = null;
2344 base.c_summonDuration = 0;
2345 base.isSummon = false;
2346 ReleaseMinion();
2347 SetInt(32);
2348 Refresh();
2349 }
Hostility
Definition: Hostility.cs:2
list. Refresh()
void SetInt(int id, int value=0)
Definition: BaseCard.cs:39
void ReleaseMinion()
Definition: Chara.cs:2396
Chara SetFaction(Faction f)
Definition: Chara.cs:1441
Point orgPos
Definition: Chara.cs:21
FactionBranch homeBranch
Definition: Chara.cs:1068
Chara SetGlobal()
Definition: Chara.cs:1508
static Faction Home
Definition: EClass.cs:27
static Chara pc
Definition: EClass.cs:15
void AddMemeber(Chara c)

References FactionBranch.AddMemeber(), EClass.Home, homeBranch, orgPos, EClass.pc, Refresh(), ReleaseMinion(), SetFaction(), SetGlobal(), and BaseCard.SetInt().

Referenced by MakeAlly(), and MakePartyMemeber().

◆ _Move()

override MoveResult Chara._Move ( Point  newPoint,
MoveType  type = MoveType::Walk 
)
inlinevirtual

Reimplemented from Card.

Definition at line 2736 of file Chara.cs.

2737 {
2738 if (isDead)
2739 {
2740 return MoveResult.Fail;
2741 }
2742 if (IsPC)
2743 {
2744 float num = EClass.setting.defaultActPace;
2745 switch (burden.GetPhase())
2746 {
2747 case 3:
2748 num *= 1.5f;
2749 break;
2750 case 4:
2751 num *= 2f;
2752 break;
2753 }
2755 {
2756 int num2 = 30;
2757 if (!EClass.pc.HasElement(408))
2758 {
2760 {
2761 case Weather.Condition.Rain:
2762 num2 += 5;
2763 break;
2764 case Weather.Condition.RainHeavy:
2765 num2 += 10;
2766 num *= 1.5f;
2767 break;
2768 case Weather.Condition.Snow:
2769 num2 += 10;
2770 break;
2771 case Weather.Condition.SnowHeavy:
2772 num2 += 15;
2773 num *= 1.5f;
2774 break;
2775 }
2776 }
2777 if (newPoint.matFloor.id == 48)
2778 {
2779 num2 += 20;
2780 num *= 1.8f;
2781 }
2782 num2 = num2 * 100 / (100 + EClass.sqrt(EvalueMax(240, -20) * 10) + EvalueMax(407, -5) * 5);
2783 EClass.world.date.AdvanceMin(num2 * 6);
2784 EClass.player.lastZonePos = null;
2786 int num3 = base.hp;
2787 for (int i = 0; i < num2 * 4; i++)
2788 {
2789 EClass.pc.party.members.ForeachReverse(delegate(Chara m)
2790 {
2791 if (!m.isDead)
2792 {
2793 m.TickConditions();
2794 }
2795 });
2796 if (base.hp < MaxHP / 5 && base.hp < num3 && !EClass.player.regionMoveWarned)
2797 {
2798 EClass.player.regionMoveWarned = true;
2799 Msg.Say("regionAbortMove");
2800 EInput.Consume(consumeAxis: true);
2801 SetAI(new NoGoal());
2802 return MoveResult.Fail;
2803 }
2804 }
2805 if (newPoint.cell.CanSuffocate())
2806 {
2807 AddCondition<ConSuffocation>((EClass.pc.Evalue(200) != 0) ? (2000 / (100 + EvalueMax(200, -5) * 10)) : 30, force: true);
2808 int num4 = GetCondition<ConSuffocation>()?.GetPhase() ?? 0;
2809 if (num4 >= 2)
2810 {
2811 DamageHP(EClass.rndHalf(10 + MaxHP / 5), AttackSource.Condition);
2812 }
2813 if (!isDead && !HasElement(429))
2814 {
2815 ModExp(200, 1 + num4 * 12);
2816 }
2817 }
2818 EClass.player.regionMoveWarned = false;
2819 if (isDead)
2820 {
2821 return MoveResult.Fail;
2822 }
2823 }
2824 if (num > EClass.setting.defaultActPace * 3f)
2825 {
2826 num = EClass.setting.defaultActPace * 3f;
2827 }
2828 actTime = num;
2829 }
2830 if (IsPCFaction && EClass.rnd(5) == 0 && newPoint.cell.CanSuffocate())
2831 {
2832 int num5 = Mathf.Min(5 + EClass._zone.DangerLv / 10, 200);
2833 ModExp(200, EClass._zone.IsRegion ? 50 : num5);
2834 if (ride != null)
2835 {
2836 ride.ModExp(200, EClass._zone.IsRegion ? 50 : num5);
2837 }
2838 if (parasite != null)
2839 {
2840 parasite.ModExp(200, EClass._zone.IsRegion ? 50 : num5);
2841 }
2842 }
2843 Chara chara = ((ride == null) ? this : ride);
2844 if (!EClass._zone.IsRegion || chara.IsPC)
2845 {
2846 bool flag = (chara.isConfused && EClass.rnd(2) == 0) || (chara.isDrunk && EClass.rnd(IsIdle ? 2 : 8) == 0 && !chara.HasElement(1215));
2847 if (host != null && host.ride == this && ((host.isConfused && EClass.rnd(2) == 0) || (host.isDrunk && EClass.rnd(IsIdle ? 2 : 8) == 0 && !host.HasElement(1215))))
2848 {
2849 flag = true;
2850 }
2851 if (flag && newPoint.Distance(pos) <= 1)
2852 {
2853 Point randomNeighbor = pos.GetRandomNeighbor();
2854 if (CanMoveTo(randomNeighbor, allowDestroyPath: false))
2855 {
2856 newPoint = randomNeighbor;
2857 if (isDrunk)
2858 {
2859 Talk("drunk");
2860 }
2861 }
2862 }
2863 }
2864 if (newPoint.x != pos.x || newPoint.z != pos.z)
2865 {
2866 LookAt(newPoint);
2867 }
2868 CellEffect effect = base.Cell.effect;
2869 if (effect != null && effect.id == 7)
2870 {
2871 CellEffect effect2 = base.Cell.effect;
2872 if (race.height < 500 && !race.tag.Contains("webfree") && EClass.rnd(effect2.power + 25) > EClass.rnd(base.STR + base.DEX + 1))
2873 {
2874 Say("abWeb_caught", this);
2875 PlaySound("web");
2876 effect2.power = effect2.power * 3 / 4;
2877 renderer.PlayAnime(AnimeID.Shiver);
2878 return MoveResult.Fail;
2879 }
2880 Say("abWeb_pass", this);
2881 EClass._map.SetEffect(base.Cell.x, base.Cell.z);
2882 }
2883 if (IsPC)
2884 {
2885 EClass.player.renderExtraTime = 0f;
2886 if (EClass._zone.IsRegion)
2887 {
2889 }
2890 else if ((newPoint.x > pos.x && newPoint.z > pos.z) || (newPoint.x < pos.x && newPoint.z < pos.z))
2891 {
2892 EClass.player.renderExtraTime = actTime * EClass.setting.render.anime.diagonalSpeed;
2893 }
2894 }
2895 if (newPoint.HasChara)
2896 {
2897 foreach (Chara item in newPoint.ListCharas())
2898 {
2899 if (item.mimicry != null && item.IsHostile(this))
2900 {
2901 item.mimicry.RevealMimicry(this, surprise: true);
2902 return MoveResult.Event;
2903 }
2904 }
2905 }
2906 if (newPoint.cell.hasDoor)
2907 {
2908 foreach (Thing thing in pos.Things)
2909 {
2910 if (thing.trait is TraitDoor traitDoor && traitDoor.owner.c_lockLv > 0)
2911 {
2912 if (base.INT < 10)
2913 {
2914 return MoveResult.Fail;
2915 }
2916 traitDoor.TryOpenLock(this);
2917 return MoveResult.Door;
2918 }
2919 }
2920 }
2921 Cell cell = newPoint.cell;
2922 Cell cell2 = pos.cell;
2923 bool flag2 = cell.HasLiquid && !IsLevitating;
2924 bool hasBridge = cell.HasBridge;
2925 bool hasRamp = cell.HasRamp;
2926 bool flag3 = EClass._zone.IsSnowCovered && !cell.HasRoof && !cell.isClearSnow;
2927 TileRow tileRow = (hasRamp ? ((TileRow)cell.sourceBlock) : ((TileRow)(hasBridge ? cell.sourceBridge : cell.sourceFloor)));
2928 SourceMaterial.Row row = (hasRamp ? cell.matBlock : (hasBridge ? cell.matBridge : cell.matFloor));
2929 bool flag4 = cell.IsTopWater && !cell.isFloating;
2930 if (!EClass._zone.IsRegion)
2931 {
2932 if (cell.hasDoorBoat)
2933 {
2934 tileRow = FLOOR.sourceWood;
2935 row = MATERIAL.sourceOak;
2936 flag4 = false;
2937 }
2938 else if (flag3 && !tileRow.ignoreSnow)
2939 {
2940 if (tileRow.tileType.IsWater)
2941 {
2942 tileRow = FLOOR.sourceIce;
2943 row = MATERIAL.sourceIce;
2944 }
2945 else
2946 {
2947 tileRow = FLOOR.sourceSnow;
2948 row = MATERIAL.sourceSnow;
2949 }
2950 flag4 = false;
2951 }
2952 }
2953 if ((pos.sourceFloor.isBeach || cell2.IsSnowTile) && !pos.HasObj)
2954 {
2955 EClass._map.SetFoormark(pos, 1, (int)Util.GetAngle(pos.x - newPoint.x, pos.z - newPoint.z), cell2.IsSnowTile ? 312 : 304);
2956 }
2957 if (isSynced)
2958 {
2959 string text = ((flag2 || flag4) ? "water" : tileRow.soundFoot.IsEmpty(row.soundFoot.IsEmpty("default")));
2960 if (cell.obj != 0 && cell.sourceObj.tileType.IsPlayFootSound && !cell.matObj.soundFoot.IsEmpty())
2961 {
2962 text = cell.matObj.soundFoot;
2963 }
2964 if (IsPC)
2965 {
2966 foreach (Thing thing2 in newPoint.Things)
2967 {
2968 if (thing2.IsInstalled && (thing2.trait.IsChangeFloorHeight || thing2.Pref.Surface))
2969 {
2970 text = thing2.material.soundFoot;
2971 }
2972 }
2973 }
2974 if (!text.IsEmpty())
2975 {
2976 SoundManager.altLastData = IsPC;
2977 PlaySound("Footstep/" + text, IsPC ? 1f : 0.9f);
2978 }
2979 if (!flag4)
2980 {
2982 PCOrbit pcOrbit = EClass.screen.pcOrbit;
2983 bool flag5 = scene.actionMode.gameSpeed > 1f;
2984 scene.psFoot.transform.position = renderer.position + pcOrbit.footPos;
2985 scene.psFoot.startColor = row.matColor;
2986 scene.psFoot.Emit(pcOrbit.emitFoot * ((!flag5) ? 1 : 2));
2987 if (flag5 && IsPC)
2988 {
2989 scene.psSmoke.transform.position = renderer.position + pcOrbit.smokePos;
2990 scene.psSmoke.Emit(pcOrbit.emitSmoke);
2991 }
2992 }
2993 if (flag2 || flag4)
2994 {
2995 Effect.Get("ripple").Play(newPoint);
2996 }
2997 }
2998 lastPos.Set(pos);
2999 if (type != MoveType.Force)
3000 {
3001 if (newPoint.HasChara && ai.Current.PushChara)
3002 {
3003 TryPush(newPoint);
3004 }
3005 if (newPoint.HasChara && newPoint.Charas.Count == 1)
3006 {
3007 Chara chara2 = newPoint.Charas[0];
3008 if (CanReplace(chara2))
3009 {
3010 chara2.MoveByForce(lastPos, this);
3011 if (chara.IsPC)
3012 {
3013 Say("replace_pc", chara, chara2);
3014 }
3015 }
3016 }
3017 }
3018 if (cell.hasDoor)
3019 {
3020 foreach (Thing thing3 in newPoint.Things)
3021 {
3022 if (thing3.trait is TraitDoor traitDoor2)
3023 {
3024 traitDoor2.TryOpen(this);
3025 }
3026 }
3027 }
3028 EClass._zone.map.MoveCard(newPoint, this);
3029 SyncRide();
3031 {
3032 foreach (Chara member in EClass.pc.party.members)
3033 {
3034 if (member.isLeashed && !member.IsPC && member.host == null && !member.IsDisabled && !member.HasCondition<ConEntangle>() && !member.IsInCombat && member.Dist(EClass.pc) > 1)
3035 {
3036 member.TryMoveTowards(EClass.pc.pos);
3037 }
3038 }
3039 }
3041 {
3043 }
3044 if (IsPC)
3045 {
3046 PlaySound("Footstep/Extra/pcfootstep");
3047 if (pos.HasThing)
3048 {
3049 foreach (Card item2 in pos.ListCards())
3050 {
3051 if (!item2.isThing || item2.placeState != 0 || item2.ignoreAutoPick)
3052 {
3053 continue;
3054 }
3056 {
3058 ContainerFlag containerFlag = item2.category.GetRoot().id.ToEnum<ContainerFlag>();
3059 if (containerFlag == ContainerFlag.none)
3060 {
3061 containerFlag = ContainerFlag.other;
3062 }
3063 if ((dataPick.noRotten && item2.IsDecayed) || (dataPick.onlyRottable && item2.trait.Decay == 0))
3064 {
3065 continue;
3066 }
3067 if (dataPick.userFilter)
3068 {
3069 switch (dataPick.IsFilterPass(item2.GetName(NameStyle.Full, 1)))
3070 {
3071 case Window.SaveData.FilterResult.PassWithoutFurtherTest:
3072 Pick(item2.Thing);
3073 continue;
3074 case Window.SaveData.FilterResult.Block:
3075 continue;
3076 }
3077 }
3078 if (dataPick.advDistribution)
3079 {
3080 foreach (int cat in dataPick.cats)
3081 {
3082 if (item2.category.uid == cat)
3083 {
3084 Pick(item2.Thing);
3085 }
3086 }
3087 }
3088 else if (!dataPick.flag.HasFlag(containerFlag))
3089 {
3090 Pick(item2.Thing);
3091 }
3092 }
3093 else
3094 {
3095 Pick(item2.Thing);
3096 }
3097 }
3098 }
3099 if (EClass._zone.IsRegion)
3100 {
3102 if (cell3?.zone != null && !cell3.zone.HiddenInRegionMap && (!(cell3.zone is Zone_Field) || cell3.zone.children.Count > 0 || cell3.zone.IsPCFaction))
3103 {
3104 Msg.Say((!cell3.zone.source.GetText("textFlavor").IsEmpty()) ? cell3.zone.source.GetText("textFlavor") : (cell3.zone.ShowDangerLv ? "seeZoneDanger" : "seeZone"), cell3.zone.Name, cell3.zone.DangerLv.ToString() ?? "");
3105 }
3106 if (pos.matFloor.alias == "snow" && EClass.rnd(3) == 0)
3107 {
3109 Msg.Say(Lang.GetList("walk_snow").RandomItem());
3110 }
3111 else if (EClass.world.weather.CurrentCondition == Weather.Condition.RainHeavy && EClass.rnd(3) == 0)
3112 {
3114 Msg.Say(Lang.GetList("walk_storm").RandomItem());
3115 }
3116 }
3118 }
3119 if (IsPCC)
3120 {
3121 int num6 = Mathf.Abs(cell2.topHeight - cell.topHeight);
3122 if ((num6 >= 3 && lastPos.sourceBlock.tileType.slopeHeight == 0 && newPoint.sourceBlock.tileType.slopeHeight == 0) || cell2.hasDoorBoat || cell.hasDoorBoat)
3123 {
3124 renderer.PlayAnime((cell2.topHeight >= cell.topHeight) ? AnimeID.JumpDown : ((num6 >= 6) ? AnimeID.Jump : AnimeID.JumpSmall));
3125 }
3126 else
3127 {
3128 float surfaceHeight = cell2.GetSurfaceHeight();
3129 float surfaceHeight2 = cell.GetSurfaceHeight();
3130 num6 = (int)Mathf.Abs((surfaceHeight - surfaceHeight2) * 100f);
3131 if (num6 >= 15)
3132 {
3133 renderer.PlayAnime((surfaceHeight >= surfaceHeight2) ? AnimeID.JumpDown : ((num6 >= 40) ? AnimeID.Jump : AnimeID.JumpSmall));
3134 }
3135 }
3136 }
3137 lastPos.Things.ForeachReverse(delegate(Thing t)
3138 {
3139 t.trait.OnSteppedOut(this);
3140 });
3141 if (!IsPC)
3142 {
3143 pos.Things.ForeachReverse(delegate(Thing t)
3144 {
3145 t.trait.OnStepped(this);
3146 });
3147 }
3148 if (CanDestroyPath())
3149 {
3151 }
3152 if (IsPC)
3153 {
3154 if (renderer.anime == null && renderer.replacer != null)
3155 {
3157 }
3159 {
3160 if (!FLOOR.IsTatami(pos.cell.sourceSurface.id) && pos.cell.room == null)
3161 {
3162 EClass.player.flags.isShoesOff = false;
3163 EClass.pc.Say("shoes_on", EClass.pc);
3164 EClass.pc.SetPCCState(PCCState.Normal);
3165 }
3166 }
3167 else if (FLOOR.IsTatami(pos.cell.sourceSurface.id) && pos.cell.room != null)
3168 {
3169 EClass.player.flags.isShoesOff = true;
3170 EClass.pc.Say("shoes_off", EClass.pc);
3171 EClass.pc.SetPCCState(PCCState.ShoesOff);
3172 }
3173 }
3174 bool flag6 = flag4 || EClass._zone.IsUnderwater;
3175 if (wasInWater != flag6)
3176 {
3177 wasInWater = flag6;
3178 RefreshSpeed();
3179 }
3180 hasMovedThisTurn = true;
3181 return MoveResult.Success;
3182 }
AnimeID
Definition: AnimeID.cs:2
AttackSource
Definition: AttackSource.cs:2
ContainerFlag
Definition: ContainerFlag.cs:5
NameStyle
Definition: NameStyle.cs:2
AIAct Current
Definition: AIAct.cs:103
virtual bool PushChara
Definition: AIAct.cs:82
static void Search(Chara c, bool manual=false)
Definition: ActWait.cs:46
virtual bool isPCC
Definition: CardActor.cs:39
void PlayAnime(AnimeID id, bool force)
TransAnime anime
Definition: CardRenderer.cs:23
virtual void NextFrame()
CardActor actor
Definition: CardRenderer.cs:11
Definition: Card.cs:11
virtual string GetName(NameStyle style, int num=-1)
Definition: Card.cs:2618
bool IsDecayed
Definition: Card.cs:2290
virtual bool isThing
Definition: Card.cs:2082
int EvalueMax(int ele, int min=0)
Definition: Card.cs:2588
SourceMaterial.Row material
Definition: Card.cs:2052
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:6318
int c_lockLv
Definition: Card.cs:965
bool ignoreAutoPick
Definition: Card.cs:507
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
Definition: Card.cs:6878
PlaceState placeState
Definition: Card.cs:84
Point pos
Definition: Card.cs:60
Trait trait
Definition: Card.cs:54
MoveType
Definition: Card.cs:21
void DamageHP(long dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
Definition: Card.cs:4092
MoveResult
Definition: Card.cs:13
bool IsInstalled
Definition: Card.cs:2384
virtual Thing Thing
Definition: Card.cs:2059
int Evalue(int ele)
Definition: Card.cs:2574
int Dist(Card c)
Definition: Card.cs:7842
void ModExp(string alias, int a)
Definition: Card.cs:2651
SourceCategory.Row category
Definition: Card.cs:2050
virtual RenderRow TileRow
Definition: Card.cs:2136
bool isLeashed
Definition: Card.cs:843
bool HasElement(int ele, bool includeNagative=false)
Definition: Card.cs:6065
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:6995
Definition: Cell.cs:7
Room room
Definition: Cell.cs:102
SourceBlock.Row sourceBlock
Definition: Cell.cs:1052
bool IsSnowTile
Definition: Cell.cs:782
bool hasDoorBoat
Definition: Cell.cs:498
bool HasBridge
Definition: Cell.cs:671
bool isClearSnow
Definition: Cell.cs:450
bool isFloating
Definition: Cell.cs:474
SourceMaterial.Row matObj
Definition: Cell.cs:1036
byte topHeight
Definition: Cell.cs:78
SourceMaterial.Row matFloor
Definition: Cell.cs:1032
byte obj
Definition: Cell.cs:38
SourceObj.Row sourceObj
Definition: Cell.cs:1072
bool HasRamp
Definition: Cell.cs:837
bool hasDoor
Definition: Cell.cs:258
SourceFloor.Row sourceSurface
Definition: Cell.cs:1059
float GetSurfaceHeight()
Definition: Cell.cs:1688
bool CanSuffocate()
Definition: Cell.cs:1111
Definition: Chara.cs:10
void TickConditions()
Definition: Chara.cs:3686
bool wasInWater
Definition: Chara.cs:150
bool IsLevitating
Definition: Chara.cs:599
AIAct ai
Definition: Chara.cs:204
override bool IsPC
Definition: Chara.cs:614
bool isDrunk
Definition: Chara.cs:126
Party party
Definition: Chara.cs:43
bool CanDestroyPath()
Definition: Chara.cs:2444
bool IsInCombat
Definition: Chara.cs:866
bool HasCondition(string alias)
Definition: Chara.cs:9434
AIAct SetAI(AIAct g)
Definition: Chara.cs:8903
bool IsIdle
Definition: Chara.cs:855
override bool IsDisabled
Definition: Chara.cs:587
bool hasMovedThisTurn
Definition: Chara.cs:178
override bool isSynced
Definition: Chara.cs:693
bool CanMoveTo(Point p, bool allowDestroyPath=true)
Definition: Chara.cs:2457
void DestroyPath(Point pos)
Definition: Chara.cs:3184
override bool IsPCFaction
Definition: Chara.cs:673
float actTime
Definition: Chara.cs:180
override int MaxHP
Definition: Chara.cs:710
Zone currentZone
Definition: Chara.cs:257
bool CanReplace(Chara c)
Definition: Chara.cs:3295
Point lastPos
Definition: Chara.cs:90
void MoveByForce(Point newPoint, Card c=null, bool checkWall=false)
Definition: Chara.cs:2642
Stats burden
Definition: Chara.cs:1158
Chara parasite
Definition: Chara.cs:30
Chara ride
Definition: Chara.cs:27
void RefreshSpeed(Element.BonusInfo info=null)
Definition: Chara.cs:1890
MoveResult TryMoveTowards(Point p)
Definition: Chara.cs:2650
void SyncRide()
Definition: Chara.cs:3948
bool isDead
Definition: Chara.cs:391
override void LookAt(Card c)
Definition: Chara.cs:3550
bool isConfused
Definition: Chara.cs:128
override bool IsPCC
Definition: Chara.cs:684
void TryPush(Point point)
Definition: Chara.cs:3228
void SetPCCState(PCCState state)
Definition: Chara.cs:6691
SourceRace.Row race
Definition: Chara.cs:466
bool allyKeepDistance
Definition: ConfigTactics.cs:6
static Game game
Definition: EClass.cs:9
static Scene scene
Definition: EClass.cs:31
static Zone _zone
Definition: EClass.cs:21
static World world
Definition: EClass.cs:41
static Map _map
Definition: EClass.cs:19
static int rnd(long a)
Definition: EClass.cs:59
static BaseGameScreen screen
Definition: EClass.cs:33
static int rndHalf(int a)
Definition: EClass.cs:97
static Player player
Definition: EClass.cs:13
static int sqrt(int a)
Definition: EClass.cs:88
static GameSetting setting
Definition: EClass.cs:35
Definition: EInput.cs:8
static void Consume(int _skipFrame)
Definition: EInput.cs:656
Definition: Effect.cs:7
static Effect Get(Effect original)
Definition: Effect.cs:85
void Play(float delay, Point from, float fixY=0f, Point to=null, Sprite sprite=null)
Definition: Effect.cs:100
Zone zone
Definition: EloMap.cs:11
Cell GetCell(Point pos)
Definition: EloMap.cs:272
Definition: FLOOR.cs:2
static SourceFloor.Row sourceSnow
Definition: FLOOR.cs:31
static SourceFloor.Row sourceIce
Definition: FLOOR.cs:35
static bool IsTatami(int id)
Definition: FLOOR.cs:39
static SourceFloor.Row sourceWood
Definition: FLOOR.cs:37
void AdvanceMin(int a)
Definition: GameDate.cs:22
float defaultActPace
Definition: GameSetting.cs:327
RenderSetting render
Definition: GameSetting.cs:301
ConfigTactics tactics
Definition: Game.cs:91
Config config
Definition: Game.cs:219
Definition: Lang.cs:6
static string[] GetList(string id)
Definition: Lang.cs:114
static SourceMaterial.Row sourceOak
Definition: MATERIAL.cs:47
static SourceMaterial.Row sourceSnow
Definition: MATERIAL.cs:41
static SourceMaterial.Row sourceIce
Definition: MATERIAL.cs:43
void MoveCard(Point p, Card t)
Definition: Map.cs:841
void SetFoormark(Point pos, int id, int angle, int offset=0)
Definition: Map.cs:2060
void SetEffect(int x, int z, CellEffect effect=null)
Definition: Map.cs:1508
Color Ono
Definition: MsgColors.cs:13
Definition: Msg.cs:5
static MsgColors colors
Definition: Msg.cs:20
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
static void SetColor()
Definition: Msg.cs:22
Definition: NoGoal.cs:4
int emitFoot
Definition: PCOrbit.cs:9
int emitSmoke
Definition: PCOrbit.cs:11
Vector3 smokePos
Definition: PCOrbit.cs:15
Vector3 footPos
Definition: PCOrbit.cs:13
List< Chara > members
Definition: Party.cs:19
bool isShoesOff
Definition: Player.cs:347
int distanceTravel
Definition: Player.cs:893
Flags flags
Definition: Player.cs:1094
Window.SaveData dataPick
Definition: Player.cs:1034
bool regionMoveWarned
Definition: Player.cs:1157
Definition: Point.cs:9
SourceMaterial.Row matFloor
Definition: Point.cs:57
SourceBlock.Row sourceBlock
Definition: Point.cs:63
List< Card > ListCards(bool includeMasked=false)
Definition: Point.cs:1051
Point Set(int _x, int _z)
Definition: Point.cs:503
List< Thing > Things
Definition: Point.cs:338
int x
Definition: Point.cs:36
int z
Definition: Point.cs:39
List< Chara > Charas
Definition: Point.cs:340
bool HasThing
Definition: Point.cs:251
List< Chara > ListCharas()
Definition: Point.cs:1171
SourceFloor.Row sourceFloor
Definition: Point.cs:65
bool HasObj
Definition: Point.cs:137
int Distance(Point p)
Definition: Point.cs:989
Cell cell
Definition: Point.cs:51
Point GetRandomNeighbor()
Definition: Point.cs:759
bool HasChara
Definition: Point.cs:238
TileType tileType
Definition: RenderRow.cs:77
Definition: Scene.cs:8
ParticleSystem psSmoke
Definition: Scene.cs:113
ParticleSystem psFoot
Definition: Scene.cs:111
EloMap elomap
Definition: Scene.cs:149
bool Surface
Definition: SourcePref.cs:330
virtual bool ShowDangerLv
Definition: Spatial.cs:503
virtual bool IsRegion
Definition: Spatial.cs:515
virtual string Name
Definition: Spatial.cs:509
SourceZone.Row source
Definition: Spatial.cs:453
List< Spatial > children
Definition: Spatial.cs:37
override int GetPhase()
Definition: Stats.cs:117
Definition: Thing.cs:8
override SourcePref Pref
Definition: Thing.cs:50
bool ignoreSnow
Definition: TileRow.cs:6
string soundFoot
Definition: TileRow.cs:14
virtual bool IsWater
Definition: TileType.cs:165
virtual void OnSteppedOut(Chara c)
Definition: Trait.cs:1102
virtual bool IsChangeFloorHeight
Definition: Trait.cs:74
virtual void OnStepped(Chara c)
Definition: Trait.cs:1098
Card owner
Definition: Trait.cs:28
Definition: Util.cs:10
static float GetAngle(Vector3 self, Vector3 target)
Definition: Util.cs:121
Condition
Definition: Weather.cs:16
Condition CurrentCondition
Definition: Weather.cs:79
FilterResult IsFilterPass(string text)
Definition: Window.cs:498
ContainerFlag flag
Definition: Window.cs:267
HashSet< int > cats
Definition: Window.cs:119
bool userFilter
Definition: Window.cs:132
bool noRotten
Definition: Window.cs:439
bool advDistribution
Definition: Window.cs:427
Definition: Window.cs:13
GameDate date
Definition: World.cs:6
Weather weather
Definition: World.cs:12
virtual bool PetFollow
Definition: Zone.cs:287
override int DangerLv
Definition: Zone.cs:110
bool IsPCFaction
Definition: Zone.cs:473
virtual bool IsUnderwater
Definition: Zone.cs:269
virtual bool KeepAllyDistance
Definition: Zone.cs:302
virtual bool HiddenInRegionMap
Definition: Zone.cs:413
Map map
Definition: Zone.cs:63

References EClass._map, EClass._zone, CardRenderer.actor, actTime, CoreConfig.GameConfig.advancedMenu, GameDate.AdvanceMin(), Window.SaveData.advDistribution, ai, ConfigTactics.allyKeepDistance, CardRenderer.anime, GameSetting.RenderSetting.anime, CoreConfig.Test.animeFramePCC, burden, Card.c_lockLv, CanDestroyPath(), CanMoveTo(), CanReplace(), Cell.CanSuffocate(), Card.category, Window.SaveData.cats, Point.cell, Point.Charas, Spatial.children, Msg.colors, Core.config, Game.config, EInput.Consume(), EClass.core, AIAct.Current, Weather.CurrentCondition, currentZone, Card.DamageHP(), Zone.DangerLv, Player.dataPick, World.date, GameSetting.defaultActPace, DestroyPath(), GameSetting.RenderSetting.AnimeSetting.diagonalSpeed, Card.Dist(), Point.Distance(), Player.distanceTravel, Scene.elomap, PCOrbit.emitFoot, PCOrbit.emitSmoke, Card.Evalue(), Card.EvalueMax(), Window.SaveData.flag, Player.flags, PCOrbit.footPos, CoreConfig.game, EClass.game, Effect.Get(), EloMap.GetCell(), Lang.GetList(), Card.GetName(), Stats.GetPhase(), Point.GetRandomNeighbor(), Cell.GetSurfaceHeight(), CardRenderer.hasActor, Cell.HasBridge, Point.HasChara, HasCondition(), Cell.hasDoor, Cell.hasDoorBoat, Card.HasElement(), hasMovedThisTurn, Point.HasObj, Cell.HasRamp, Point.HasThing, Zone.HiddenInRegionMap, host, CellEffect.id, Card.ignoreAutoPick, TileRow.ignoreSnow, Trait.IsChangeFloorHeight, Cell.isClearSnow, isConfused, isDead, Card.IsDecayed, IsDisabled, isDrunk, Window.SaveData.IsFilterPass(), Cell.isFloating, IsIdle, IsInCombat, Card.IsInstalled, Card.isLeashed, IsLevitating, IsPC, CardActor.isPCC, IsPCC, IsPCFaction, Zone.IsPCFaction, Spatial.IsRegion, Player.Flags.isShoesOff, Cell.IsSnowTile, isSynced, FLOOR.IsTatami(), Card.isThing, Zone.IsUnderwater, TileType.IsWater, item, Zone.KeepAllyDistance, lastPos, Point.ListCards(), Point.ListCharas(), LookAt(), Zone.map, SourceMaterial.Row.matColor, Card.material, Cell.matFloor, Point.matFloor, Cell.matObj, MaxHP, Party.members, Card.ModExp(), MoveByForce(), Map.MoveCard(), Spatial.Name, CardRenderer.NextFrame(), Window.SaveData.noRotten, Cell.obj, MsgColors.Ono, Trait.OnStepped(), Trait.OnSteppedOut(), Trait.owner, parasite, party, EClass.pc, BaseGameScreen.pcOrbit, Zone.PetFollow, Pick, Card.placeState, Effect.Play(), CardRenderer.PlayAnime(), EClass.player, Card.PlaySound(), Card.pos, CellEffect.power, Thing.Pref, Scene.psFoot, Scene.psSmoke, AIAct.PushChara, race, RefreshSpeed(), Player.regionMoveWarned, GameSetting.RenderSetting.AnimeSetting.regionSpeed, GameSetting.render, Card.renderer, CardRenderer.replacer, ride, EClass.rnd(), EClass.rndHalf(), Cell.room, Msg.Say(), Card.Say(), EClass.scene, EClass.screen, ActWait.Search(), Point.Set(), SetAI(), Msg.SetColor(), Map.SetEffect(), Map.SetFoormark(), SetPCCState(), EClass.setting, Spatial.ShowDangerLv, PCOrbit.smokePos, SourceMaterial.Row.soundFoot, TileRow.soundFoot, Spatial.source, Cell.sourceBlock, Point.sourceBlock, Cell.sourceBridge, Cell.sourceFloor, Point.sourceFloor, FLOOR.sourceIce, MATERIAL.sourceIce, MATERIAL.sourceOak, Cell.sourceObj, FLOOR.sourceSnow, MATERIAL.sourceSnow, Cell.sourceSurface, FLOOR.sourceWood, EClass.sqrt(), SourcePref.Surface, SyncRide(), Game.Config.tactics, Card.Talk(), CoreConfig.test, Card.Thing, Point.Things, TickConditions(), Card.TileRow, RenderRow.tileType, Cell.topHeight, Card.trait, TryMoveTowards(), TryPush(), Window.SaveData.userFilter, Util, wasInWater, World.weather, EClass.world, Point.x, Point.z, and EloMap.Cell.zone.

Referenced by MoveByForce(), AI_Sleep.OnProgressComplete(), and TryMove().

◆ _ShowDialog()

LayerDrama Chara._ShowDialog ( string  book,
string  sheet,
string  step = "main",
string  tag = "" 
)
inlineprivate

Definition at line 7244 of file Chara.cs.

7245 {
7246 EClass.Sound.Play("pop_drama");
7247 if (book == "_chara" && IsPC)
7248 {
7249 step = "pc";
7250 }
7251 if (id == "lomias")
7252 {
7254 }
7255 return LayerDrama.Activate(book, sheet, step, this, null, tag);
7256 }
ID_Achievement
static SoundManager Sound
Definition: EClass.cs:47
static LayerDrama Activate(string book, string idSheet, string idStep, Chara target=null, Card ref1=null, string tag="")
Definition: LayerDrama.cs:66
Definition: Steam.cs:8
static void GetAchievement(ID_Achievement id)
Definition: Steam.cs:49

References LayerDrama.Activate(), book, Steam.GetAchievement(), and EClass.Sound.

◆ AddCondition() [1/2]

Condition Chara.AddCondition ( Condition  c,
bool  force = false 
)
inline

Definition at line 9278 of file Chara.cs.

9279 {
9280 c.owner = this;
9281 if (!(c is ConBurning))
9282 {
9283 if (c is ConBleed && ResistLv(964) >= 3)
9284 {
9285 return null;
9286 }
9287 }
9288 else if (ResistLv(950) >= 3)
9289 {
9290 return null;
9291 }
9293 {
9294 if (c.GainResistFactor >= 400)
9295 {
9296 c.power /= 2;
9297 }
9298 ResistCon(c);
9299 if (c.power <= 0)
9300 {
9301 return null;
9302 }
9303 }
9304 if (!force)
9305 {
9306 if (c.source.negate.Length != 0)
9307 {
9308 string[] negate = c.source.negate;
9309 foreach (string text in negate)
9310 {
9311 if (HasElement(text))
9312 {
9313 return null;
9314 }
9315 }
9316 }
9317 Element defenseAttribute = c.GetDefenseAttribute(this);
9318 if (defenseAttribute != null)
9319 {
9320 c.power = 100 * c.power / Mathf.Max(100 + defenseAttribute.Value, 1);
9321 }
9322 if (c.source.resistance.Length != 0)
9323 {
9324 int num = ResistLv(EClass.sources.elements.alias[c.source.resistance[0]].id);
9325 if (num > 0)
9326 {
9327 c.power /= num * num + 1;
9328 if (c.power <= 40)
9329 {
9330 return null;
9331 }
9332 }
9333 }
9334 c.power = c.EvaluatePower(c.power);
9335 if (c.power <= 0)
9336 {
9337 return null;
9338 }
9339 }
9340 int num2 = c.EvaluateTurn(c.power);
9341 if (num2 == 0)
9342 {
9343 return null;
9344 }
9345 for (int j = 0; j < conditions.Count; j++)
9346 {
9347 if (conditions[j].id != c.id)
9348 {
9349 continue;
9350 }
9351 if (c.Type == ConditionType.Stance || c.IsToggle)
9352 {
9353 conditions[j].Kill();
9354 return null;
9355 }
9356 if (conditions[j].CanStack(c))
9357 {
9358 if (conditions[j].ShouldOverride(c))
9359 {
9360 if (conditions[j].IsOverrideConditionMet(c, num2))
9361 {
9362 conditions[j].Kill(silent: true);
9363 continue;
9364 }
9365 return null;
9366 }
9367 if (CanGainConResist)
9368 {
9369 AddResistCon(c);
9370 }
9371 conditions[j].OnStacked(c.power);
9372 conditions[j].OnStartOrStack();
9373 conditions[j].PlayEffect();
9374 }
9375 if (!conditions[j].AllowMultipleInstance)
9376 {
9377 return null;
9378 }
9379 }
9380 foreach (Condition condition in conditions)
9381 {
9382 if (condition.TryNullify(c))
9383 {
9384 return null;
9385 }
9386 }
9387 c.value = num2;
9388 conditions.Add(c);
9389 if (CanGainConResist)
9390 {
9391 AddResistCon(c);
9392 }
9393 c.SetOwner(this);
9394 c.Start();
9395 SetDirtySpeed();
9396 if (c.ShouldRefresh)
9397 {
9398 Refresh();
9399 }
9400 if (c.CancelAI)
9401 {
9402 ai.Cancel();
9403 }
9404 if (IsPC && c.ConsumeTurn && !EClass.pc.isRestrained)
9405 {
9407 }
9408 if (c.SyncRide && (ride != null || parasite != null))
9409 {
9410 if (ride != null)
9411 {
9413 }
9414 if (parasite != null)
9415 {
9417 }
9418 }
9419 return c;
9420 }
ConditionType
Definition: ConditionType.cs:2
virtual Status Cancel()
Definition: AIAct.cs:295
virtual bool SyncRide
virtual bool IsToggle
virtual bool ShouldRefresh
virtual bool CancelAI
virtual int EvaluatePower(int p)
virtual int GainResistFactor
virtual bool ConsumeTurn
Element GetDefenseAttribute(Chara c=null)
virtual int EvaluateTurn(int p)
virtual void SetOwner(Chara _owner, bool onDeserialize=false)
virtual bool TryNullify(Condition c)
virtual ConditionType Type
Definition: BaseStats.cs:19
SourceStat.Row source
Definition: BaseStats.cs:15
int id
Definition: BaseStats.cs:11
bool isRestrained
Definition: Card.cs:567
int ResistLv(int res)
Definition: Card.cs:6060
void SetDirtySpeed()
Definition: Chara.cs:1881
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:9273
bool CanGainConResist
Definition: Chara.cs:1175
void AddResistCon(Condition con)
Definition: Chara.cs:9687
void ResistCon(Condition con)
Definition: Chara.cs:9707
static Condition Create(string alias, int power=100, Action< Condition > onCreate=null)
Definition: Condition.cs:46
static SourceManager sources
Definition: EClass.cs:43
int Value
Definition: ELEMENT.cs:297
void EndTurn(bool consume=true)
Definition: Player.cs:2083
SourceElement elements

References AddCondition(), AIAct.Cancel(), Condition.Create(), SourceManager.elements, Player.EndTurn(), BaseCondition.EvaluatePower(), BaseCondition.EvaluateTurn(), BaseCondition.GainResistFactor, BaseCondition.GetDefenseAttribute(), BaseStats.id, Card.isRestrained, BaseCondition.IsToggle, EClass.pc, EClass.player, BaseCondition.power, Refresh(), BaseStats.source, EClass.sources, BaseCondition.TryNullify(), BaseStats.Type, and Element.Value.

◆ AddCondition() [2/2]

◆ AddCondition< T >()

Condition Chara.AddCondition< T > ( int  p = 100,
bool  force = false 
)
inline
Type Constraints
T :Condition 

Definition at line 9268 of file Chara.cs.

9268 : Condition
9269 {
9270 return AddCondition(typeof(T).Name, p, force);
9271 }
string Name
Definition: Card.cs:2140

◆ AddCooldown()

void Chara.AddCooldown ( int  idEle,
int  turns = 0 
)
inline

Definition at line 8684 of file Chara.cs.

8685 {
8686 if (_cooldowns == null)
8687 {
8688 _cooldowns = new List<int>();
8689 }
8690 if (turns != 0)
8691 {
8692 _cooldowns.Add(idEle * 1000 + turns);
8693 return;
8694 }
8695 SourceElement.Row row = EClass.sources.elements.map[idEle];
8696 if (row.cooldown > 0)
8697 {
8698 _cooldowns.Add(idEle * 1000 + row.cooldown);
8699 }
8700 }
List< int > _cooldowns
Definition: Chara.cs:58

References SourceElement.Row.cooldown, SourceManager.elements, and EClass.sources.

Referenced by StatsMana.Mod(), ActEffect.Proc(), and RequestProtection().

◆ AddFoodHistory()

void Chara.AddFoodHistory ( Thing  food)
inline

Definition at line 10177 of file Chara.cs.

10178 {
10179 if (!IsPCFaction || !IsGlobal)
10180 {
10181 _historyFood = null;
10182 return;
10183 }
10184 if (_historyFood == null)
10185 {
10186 _historyFood = new List<List<string>>
10187 {
10188 new List<string>()
10189 };
10190 }
10191 if (_historyFood[0].Count < 5)
10192 {
10193 _historyFood[0].Add(food.id);
10194 }
10195 }
override bool IsGlobal
Definition: Chara.cs:612
List< List< string > > _historyFood
Definition: Chara.cs:64

References food.

Referenced by FoodEffect.Proc().

◆ AddHobby()

void Chara.AddHobby ( int  id)
inline

Definition at line 9103 of file Chara.cs.

9104 {
9105 foreach (int hobby in _hobbies)
9106 {
9107 if (hobby == id)
9108 {
9109 return;
9110 }
9111 }
9112 _hobbies.Add(id);
9113 }
List< int > _hobbies
Definition: Chara.cs:49

◆ AddRandomBodyPart()

void Chara.AddRandomBodyPart ( bool  msg = false)
inline

Definition at line 2221 of file Chara.cs.

2222 {
2223 int ele = new int[9] { 30, 31, 33, 35, 35, 36, 34, 37, 39 }.RandomItem();
2224 body.AddBodyPart(ele);
2225 if (msg)
2226 {
2227 Say("gain_bodyparts", this, Element.Get(ele).GetName().ToLower());
2228 PlaySound("offering");
2229 }
2230 }
void AddBodyPart(int ele, Thing thing=null)
Definition: CharaBody.cs:268
CharaBody body
Definition: Chara.cs:94
static SourceElement.Row Get(int id)
Definition: ELEMENT.cs:406

References CharaBody.AddBodyPart(), body, Element.Get(), Card.PlaySound(), and Card.Say().

Referenced by Feat.Apply().

◆ AddResistCon()

void Chara.AddResistCon ( Condition  con)
inline

Definition at line 9687 of file Chara.cs.

9688 {
9689 if (con.power > 0 && con.GainResistFactor > 0)
9690 {
9691 int key = con.id;
9692 if (resistCon == null)
9693 {
9694 resistCon = new Dictionary<int, int>();
9695 }
9696 if (resistCon.ContainsKey(key))
9697 {
9698 resistCon[key] += con.power * con.GainResistFactor / 100;
9699 }
9700 else
9701 {
9702 resistCon[key] = con.power * con.GainResistFactor / 100;
9703 }
9704 }
9705 }
Dictionary< int, int > resistCon
Definition: Chara.cs:216

References BaseCondition.GainResistFactor, BaseStats.id, and BaseCondition.power.

◆ AddWork()

void Chara.AddWork ( int  id)
inline

Definition at line 9115 of file Chara.cs.

9116 {
9117 foreach (int work in _works)
9118 {
9119 if (work == id)
9120 {
9121 return;
9122 }
9123 }
9124 _works.Add(id);
9125 }
List< int > _works
Definition: Chara.cs:52

◆ ApplyDeathPenalty()

void Chara.ApplyDeathPenalty ( )
inline

Definition at line 5285 of file Chara.cs.

5286 {
5287 if (!IsPC)
5288 {
5289 return;
5290 }
5291 int currency = GetCurrency();
5292 if (currency > 0)
5293 {
5294 int num = currency / 3 + EClass.rnd(currency / 3 + 1);
5295 if (num <= 0)
5296 {
5297 num = 1;
5298 }
5299 Msg.Say("panaltyMoney", this, Lang._currency(num));
5300 ModCurrency(-num);
5302 }
5303 foreach (Element value in EClass.pc.elements.dict.Values)
5304 {
5305 if (EClass.rnd(5) == 0 && value.IsMainAttribute)
5306 {
5307 EClass.pc.elements.ModExp(value.id, -500f);
5308 }
5309 }
5310 }
@ currency
ElementContainerCard elements
Definition: Card.cs:42
int GetCurrency(string id="money")
Definition: Card.cs:4004
void ModCurrency(int a, string id="money")
Definition: Card.cs:3990
void ModExp(int ele, float a, bool chain=false)
Dictionary< int, Element > dict
int id
Definition: ELEMENT.cs:255
bool IsMainAttribute
Definition: ELEMENT.cs:388
static string _currency(object a, string IDCurrency)
Definition: Lang.cs:162
static Thing CreateCurrency(int a, string id="money")
Definition: ThingGen.cs:37
Card AddCard(Card t, Point point)
Definition: Zone.cs:1992

References Lang._currency(), EClass._zone, Zone.AddCard(), ThingGen.CreateCurrency(), currency, ElementContainer.dict, Card.elements, Element.id, Element.IsMainAttribute, ElementContainer.ModExp(), EClass.pc, Card.pos, EClass.rnd(), and Msg.Say().

Referenced by Revive().

◆ ApplyEditorTags()

override void Chara.ApplyEditorTags ( EditorTag  tag)
inlinevirtual

Reimplemented from Card.

Definition at line 2056 of file Chara.cs.

2057 {
2058 switch (tag)
2059 {
2060 case EditorTag.HostilityNeutral:
2061 {
2062 Hostility hostility2 = (base.c_originalHostility = Hostility.Neutral);
2063 this.hostility = hostility2;
2064 break;
2065 }
2066 case EditorTag.HostilityEnemy:
2067 {
2068 Hostility hostility2 = (base.c_originalHostility = Hostility.Enemy);
2069 this.hostility = hostility2;
2070 break;
2071 }
2072 case EditorTag.HostilityFriend:
2073 {
2074 Hostility hostility2 = (base.c_originalHostility = Hostility.Friend);
2075 this.hostility = hostility2;
2076 break;
2077 }
2078 case EditorTag.Male:
2079 bio.SetGender(2);
2080 base.c_idPortrait = Portrait.GetRandomPortrait(2, GetIdPortraitCat());
2081 break;
2082 case EditorTag.Female:
2083 bio.SetGender(1);
2084 base.c_idPortrait = Portrait.GetRandomPortrait(1, GetIdPortraitCat());
2085 break;
2086 case EditorTag.baby:
2087 SetFeat(1232);
2088 break;
2089 }
2090 base.ApplyEditorTags(tag);
2091 }
EditorTag
Definition: EditorTag.cs:2
void SetGender(int g)
Definition: Biography.cs:473
Biography bio
Definition: Card.cs:45
void SetFeat(int id, int value=1, bool msg=false)
Definition: Chara.cs:9912
string GetIdPortraitCat()
Definition: Chara.cs:8147
static string GetRandomPortrait(string idDict)
Definition: Portrait.cs:105

References Card.bio, GetIdPortraitCat(), Portrait.GetRandomPortrait(), SetFeat(), and Biography.SetGender().

◆ ApplyJob()

void Chara.ApplyJob ( bool  remove = false)
inline

Definition at line 2183 of file Chara.cs.

2184 {
2185 elements.ApplyElementMap(base.uid, SourceValueType.Chara, job.elementMap, base.DefaultLV, remove, applyFeat: true);
2186 if (IsPCC)
2187 {
2188 EClass.game.uniforms.Apply(pccData, job.id, base.IsMale, canUseOtherGender: true);
2189 }
2190 }
SourceValueType
SourceJob.Row job
Definition: Chara.cs:468
void ApplyElementMap(int uid, SourceValueType type, Dictionary< int, int > map, int lv, bool invert=false, bool applyFeat=false)
PCCUniformManager uniforms
Definition: Game.cs:195

References ElementContainer.ApplyElementMap(), Card.elements, EClass.game, IsPCC, job, pccData, and Game.uniforms.

Referenced by ChangeJob(), and OnCreate().

◆ ApplyRace()

void Chara.ApplyRace ( bool  remove = false)
inline

Definition at line 2269 of file Chara.cs.

2270 {
2271 string[] array = race.figure.Split('|');
2272 foreach (string s in array)
2273 {
2274 int num = ParseBodySlot(s);
2275 if (num != -1)
2276 {
2277 if (remove)
2278 {
2279 body.RemoveBodyPart(num);
2280 }
2281 else
2282 {
2283 body.AddBodyPart(num);
2284 }
2285 }
2286 }
2288 elements.ApplyElementMap(base.uid, SourceValueType.Chara, race.elementMap, base.DefaultLV, remove, applyFeat: true);
2289 if (!remove && race.id == "bike" && id != "bike_cub")
2290 {
2291 SetFeat(1423, (id == "chara" || id == "player") ? 10 : (1 + EClass.rnd(10)));
2292 }
2293 }
void RefreshBodyParts()
Definition: CharaBody.cs:294
void RemoveBodyPart(int ele)
Definition: CharaBody.cs:323
int ParseBodySlot(string s)
Definition: Chara.cs:2204

References CharaBody.AddBodyPart(), ElementContainer.ApplyElementMap(), body, Card.elements, ParseBodySlot(), race, CharaBody.RefreshBodyParts(), CharaBody.RemoveBodyPart(), EClass.rnd(), and SetFeat().

Referenced by ChangeRace(), and OnCreate().

◆ Banish()

void Chara.Banish ( Chara  owner)
inline

Definition at line 2364 of file Chara.cs.

2365 {
2366 owner?.Say("summon_vanish", this);
2367 pos.PlayEffect("vanish");
2368 pos.PlaySound("vanish");
2369 pos.PlayEffect("teleport");
2370 Destroy();
2371 }
void Destroy()
Definition: Card.cs:5107
SoundSource PlaySound(string id, bool synced=true, float v=1f, bool spatial=true)
Definition: Point.cs:1253
Effect PlayEffect(string id)
Definition: Point.cs:1248

References Card.Destroy(), Point.PlayEffect(), Point.PlaySound(), Card.pos, and Card.Say().

Referenced by ActPlan._Update(), and AI_Idle.Run().

◆ CalcBurden()

void Chara.CalcBurden ( )
inline

Definition at line 1849 of file Chara.cs.

1850 {
1851 int num = base.ChildrenWeight * 100 / Mathf.Max(1, WeightLimit);
1852 if (num < 0)
1853 {
1854 num = 1000;
1855 }
1857 {
1858 num = 0;
1859 }
1860 burden.Set(num);
1861 SetDirtySpeed();
1862 }
override int WeightLimit
Definition: Chara.cs:712
bool ignoreWeight
Definition: CoreDebug.cs:187
static CoreDebug debug
Definition: EClass.cs:49
Stats Set(int[] _raw, int _rawIndex, Chara _CC)
Definition: Stats.cs:109

References burden, EClass.debug, CoreDebug.ignoreWeight, IsPC, Stats.Set(), SetDirtySpeed(), and WeightLimit.

Referenced by Scene.OnUpdate().

◆ CalcCastingChance()

int Chara.CalcCastingChance ( Element  e,
int  num = 1 
)
inline

Definition at line 6172 of file Chara.cs.

6173 {
6174 if (!(e is Spell))
6175 {
6176 return 100;
6177 }
6178 if (!IsPC)
6179 {
6180 int num2 = 95;
6181 if (host != null)
6182 {
6183 if (host.ride == this)
6184 {
6185 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.EvalueRiding()));
6186 }
6187 if (host.parasite == this)
6188 {
6189 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.Evalue(227)));
6190 }
6191 }
6192 return num2;
6193 }
6194 int num3 = Evalue(304);
6195 if (!IsPCFaction)
6196 {
6197 num3 = Mathf.Max(num3, base.LV + 5);
6198 }
6199 int num4 = 0;
6200 int num5 = 0;
6201 bool num6 = GetArmorSkill() == 122;
6202 AttackStyle attackStyle = body.GetAttackStyle();
6203 if (num6)
6204 {
6205 num4 = 20 - Evalue(122) / 5;
6206 num5 += 10 - Evalue(1654) * 4;
6207 }
6208 else
6209 {
6210 num4 = 10 - Evalue(120) / 5;
6211 }
6212 if (num4 < 5)
6213 {
6214 num4 = 5;
6215 }
6216 if (ride != null)
6217 {
6218 num4 += 5;
6219 }
6220 if (parasite != null)
6221 {
6222 num4 += 10;
6223 }
6224 if (attackStyle == AttackStyle.TwoWield)
6225 {
6226 num4 += 5;
6227 }
6228 if (attackStyle == AttackStyle.Shield)
6229 {
6230 num4 += 10;
6231 num5 += 20 - Evalue(1654) * 8;
6232 }
6233 if (isConfused)
6234 {
6235 num4 += 10000;
6236 }
6237 if (HasCondition<ConDim>())
6238 {
6239 num4 += ((Evalue(1654) >= 3) ? 1500 : 2500);
6240 }
6241 if (num > 1)
6242 {
6243 num4 += 5 * num;
6244 }
6245 if (num5 < 0)
6246 {
6247 num5 = 0;
6248 }
6249 return Mathf.Clamp(100 + e.Value - 10 - e.source.LV * e.source.cost[0] * num4 / Mathf.Max(10 + num3 * 10, 1), 0, 100 - num5);
6250 }
AttackStyle
Definition: AttackStyle.cs:2
AttackStyle GetAttackStyle()
Definition: CharaBody.cs:464
override int GetArmorSkill()
Definition: Chara.cs:7890
int EvalueRiding()
Definition: Chara.cs:6163
SourceElement.Row source
Definition: ELEMENT.cs:278
Definition: SPELL.cs:624

References Card.Evalue(), EvalueRiding(), CharaBody.GetAttackStyle(), parasite, ride, Element.source, and Element.Value.

Referenced by Element._WriteNote().

◆ CalculateMaxStamina()

void Chara.CalculateMaxStamina ( )
inline

Definition at line 2037 of file Chara.cs.

2038 {
2039 int num = base.END;
2040 int num2 = 0;
2041 foreach (Element value in elements.dict.Values)
2042 {
2043 if (value.source.category == "skill")
2044 {
2045 num = ((!IsPC) ? (num + Mathf.Max(value.ValueWithoutLink, 0)) : (num + Mathf.Max(value.vBase, 0)));
2046 }
2047 }
2048 num2 = EClass.curve(num, 30, 10, 60);
2049 if (num2 < 10)
2050 {
2051 num2 = 10;
2052 }
2053 _maxStamina = num2 + 15;
2054 }
int _maxStamina
Definition: Chara.cs:367
static int curve(long _a, int start, int step, int rate=75)
Definition: EClass.cs:69
int ValueWithoutLink
Definition: ELEMENT.cs:299
int vBase
Definition: ELEMENT.cs:257

References _maxStamina, EClass.curve(), ElementContainer.dict, Card.elements, IsPC, Element.source, Element.ValueWithoutLink, and Element.vBase.

Referenced by OnCreate(), ElementContainerCard.OnLevelDown(), ElementContainerCard.OnLevelUp(), Player.OnStartNewGame(), and Card.SetLv().

◆ CallHelp()

void Chara.CallHelp ( Chara  tg,
bool  fanatic = false 
)
inline

Definition at line 6434 of file Chara.cs.

6435 {
6436 foreach (Chara chara in EClass._map.charas)
6437 {
6438 if (!chara.IsPCFaction && chara.OriginalHostility == OriginalHostility && (fanatic || Dist(chara) <= 6) && (EClass.rnd(3) != 0 || fanatic))
6439 {
6440 chara.GoHostile(tg);
6441 }
6442 }
6443 }
Hostility OriginalHostility
Definition: Chara.cs:473
void GoHostile(Card _tg)
Definition: Chara.cs:6328
List< Chara > charas
Definition: Map.cs:81

References EClass._map, Map.charas, GoHostile(), IsPCFaction, OriginalHostility, and EClass.rnd().

Referenced by DoHostileAction().

◆ CanAcceptGift()

bool Chara.CanAcceptGift ( Chara  c,
Card  t 
)
inline

Definition at line 8235 of file Chara.cs.

8236 {
8237 if (things.IsFull())
8238 {
8239 return false;
8240 }
8241 if (t.c_isImportant)
8242 {
8243 return false;
8244 }
8245 if (t.id == "1084")
8246 {
8247 return true;
8248 }
8249 if (t.trait is TraitBookExp)
8250 {
8251 return true;
8252 }
8253 if (t.trait.CanOnlyCarry || !t.trait.CanBeDestroyed || t.trait.CanExtendBuild || t.rarity == Rarity.Artifact || t.IsContainer)
8254 {
8255 return false;
8256 }
8257 return true;
8258 }
Rarity
Definition: Rarity.cs:2
string id
Definition: Card.cs:36
Rarity rarity
Definition: Card.cs:315
bool c_isImportant
Definition: Card.cs:1025
ThingContainer things
Definition: Card.cs:39
bool IsContainer
Definition: Card.cs:2090
bool IsFull(int y=0)
virtual bool CanExtendBuild
Definition: Trait.cs:181
virtual bool CanBeDestroyed
Definition: Trait.cs:307
virtual bool CanOnlyCarry
Definition: Trait.cs:305

References Card.c_isImportant, Trait.CanBeDestroyed, Trait.CanExtendBuild, Trait.CanOnlyCarry, Card.id, Card.IsContainer, Card.rarity, and Card.trait.

Referenced by ActPlan._Update(), and HotItemHeld.TrySetAct().

◆ CanAcceptItem()

bool Chara.CanAcceptItem ( Card  t,
int  num = -1,
bool  skipImportantCheck = false 
)
inline

Definition at line 8214 of file Chara.cs.

8215 {
8217 {
8218 return true;
8219 }
8220 if (!IsValidGiftWeight(t, num))
8221 {
8222 return false;
8223 }
8224 if (!skipImportantCheck && t.c_isImportant)
8225 {
8226 return false;
8227 }
8228 if ((t.category.IsChildOf("furniture") || t.category.IsChildOf("junk")) && !HasElement(1411))
8229 {
8230 return false;
8231 }
8232 return true;
8233 }
bool IsValidGiftWeight(Card t, int num=-1)
Definition: Chara.cs:8204

References Card.c_isImportant, Card.category, EClass.debug, and CoreDebug.ignoreWeight.

Referenced by InvOwner.CanShiftClick(), and InvOwner.Transaction.Process().

◆ CanAutoPick()

bool Chara.CanAutoPick ( Card  c)
inline

Definition at line 4285 of file Chara.cs.

4286 {
4287 return true;
4288 }

◆ CanBeTempAlly()

bool Chara.CanBeTempAlly ( Chara  c)
inline

Definition at line 2351 of file Chara.cs.

2352 {
2353 if (IsPCFaction || IsGlobal || IsMinion || IsMultisize || EClass._zone.CountMinions(c) > c.MaxSummon || base.rarity >= Rarity.Legendary)
2354 {
2355 return false;
2356 }
2357 if (HasElement(1222))
2358 {
2359 return false;
2360 }
2361 return true;
2362 }
override bool IsMinion
Definition: Chara.cs:629
int MaxSummon
Definition: Chara.cs:716
override bool IsMultisize
Definition: Chara.cs:708
int CountMinions(Chara c)
Definition: Zone.cs:3766

References EClass._zone, Zone.CountMinions(), Card.HasElement(), IsGlobal, IsMinion, IsMultisize, IsPCFaction, and MaxSummon.

Referenced by GoalCombat.Run().

◆ CanBloom()

bool Chara.CanBloom ( )
inline

Definition at line 8667 of file Chara.cs.

8668 {
8669 if (IsPC || base.isScaled || HasElement(1273))
8670 {
8671 return false;
8672 }
8673 if (!EClass.debug.godMode)
8674 {
8675 if (base.c_daysWithPC > 360)
8676 {
8677 return affinity.CanSleepBeside();
8678 }
8679 return false;
8680 }
8681 return true;
8682 }
bool CanSleepBeside()
Definition: Affinity.cs:77
Affinity affinity
Definition: Chara.cs:316
bool godMode
Definition: CoreDebug.cs:173

References Affinity.CanSleepBeside(), EClass.debug, and CoreDebug.godMode.

Referenced by WindowCharaMini.Refresh().

◆ CanDestroyPath()

bool Chara.CanDestroyPath ( )
inline

Definition at line 2444 of file Chara.cs.

2445 {
2446 if (!IsMultisize)
2447 {
2448 if (base.rarity >= Rarity.Superior && !base.IsPCFactionOrMinion && ai is GoalCombat && !EClass._zone.IsPCFaction)
2449 {
2450 return !(EClass._zone is Zone_Town);
2451 }
2452 return false;
2453 }
2454 return true;
2455 }

References EClass._zone, ai, IsMultisize, and Zone.IsPCFaction.

Referenced by _Move(), CanMoveTo(), and TryMoveTowards().

◆ CanDuplicate()

bool Chara.CanDuplicate ( )
inline

Definition at line 1780 of file Chara.cs.

1781 {
1782 if (EClass._zone.IsRegion || HasCondition<ConPoison>() || HasCondition<ConConfuse>() || HasCondition<ConDim>() || HasCondition<ConParalyze>() || HasCondition<ConSleep>() || HasCondition<ConBurning>() || HasCondition<ConFreeze>() || HasCondition<ConMiasma>() || corruption >= 100)
1783 {
1784 return false;
1785 }
1787 {
1788 return false;
1789 }
1790 string text = id;
1791 if (!(text == "mech_scarab"))
1792 {
1793 if (text == "spider_queen" && (pos.cell.light > 0 || pos.IsSunLit))
1794 {
1795 return false;
1796 }
1797 }
1798 else if (isSynced || pos.cell.light > 0 || (!EClass._map.IsIndoor && !pos.cell.HasRoof && !EClass.world.date.IsNight))
1799 {
1800 return false;
1801 }
1802 return true;
1803 }
byte light
Definition: Cell.cs:60
bool HasRoof
Definition: Cell.cs:648
int corruption
Definition: Chara.cs:379
int CurrentGeneSlot
Definition: Chara.cs:1085
bool IsNight
Definition: Date.cs:112
GamePrincipal principal
Definition: Game.cs:225
bool IsIndoor
Definition: Map.cs:131
bool IsSunLit
Definition: Point.cs:182

References EClass._map, EClass._zone, Point.cell, corruption, CurrentGeneSlot, World.date, GamePrincipal.enableGeneDupe, EClass.game, Cell.HasRoof, Card.id, Map.IsIndoor, Date.IsNight, Spatial.IsRegion, Point.IsSunLit, isSynced, Cell.light, Card.pos, Game.principal, and EClass.world.

Referenced by ActEffect.Proc(), and AI_Idle.Run().

◆ CanEat()

bool Chara.CanEat ( Thing  t,
bool  shouldEat = false 
)
inline

Definition at line 7617 of file Chara.cs.

7618 {
7619 if (t.IsDecayed && !HasElement(480))
7620 {
7621 return false;
7622 }
7623 if (HasElement(1250) && !t.HasElement(710))
7624 {
7625 return false;
7626 }
7627 if (shouldEat && (!(t.trait is TraitFoodPrepared) || t.c_isImportant))
7628 {
7629 return false;
7630 }
7631 if (!t.IsNegativeGift && !t.HasTag(CTAG.ignoreUse) && !t.isEquipped)
7632 {
7633 return t.trait.CanEat(this);
7634 }
7635 return false;
7636 }
CTAG
Definition: CTAG.cs:2
bool IsNegativeGift
Definition: Card.cs:2399
bool HasTag(CTAG tag)
Definition: Card.cs:2598
bool isEquipped
Definition: Thing.cs:17
virtual bool CanEat(Chara c)
Definition: Trait.cs:1000

References Card.c_isImportant, Trait.CanEat(), Card.HasElement(), Card.HasTag(), Card.IsDecayed, Thing.isEquipped, Card.IsNegativeGift, and Card.trait.

Referenced by QuestDeliver.Deliver(), FactionBranch.GetMeal(), and AI_Idle.Run().

◆ CanEquipRanged()

bool Chara.CanEquipRanged ( Thing  t)
inline

Definition at line 7789 of file Chara.cs.

7790 {
7791 return !body.IsTooHeavyToEquip(t);
7792 }
bool IsTooHeavyToEquip(Thing thing)
Definition: CharaBody.cs:160

References CharaBody.IsTooHeavyToEquip().

Referenced by GoalAutoCombat.TryUseRanged().

◆ CanInsult()

bool Chara.CanInsult ( )
inline

Definition at line 8135 of file Chara.cs.

8136 {
8137 foreach (ActList.Item item in ability.list.items)
8138 {
8139 if (item.act.id == 6630)
8140 {
8141 return true;
8142 }
8143 }
8144 return false;
8145 }
List< Item > items
Definition: ActList.cs:14
ActList list
Definition: CharaAbility.cs:12
CharaAbility ability
Definition: Chara.cs:426

References item, ActList.items, and CharaAbility.list.

◆ CanInteractTo() [1/2]

bool Chara.CanInteractTo ( Card  c)
inline

Definition at line 2551 of file Chara.cs.

2552 {
2553 return CanInteractTo(c.pos);
2554 }
bool CanInteractTo(Card c)
Definition: Chara.cs:2551

References CanInteractTo(), and Card.pos.

Referenced by ActPlan._Update(), CanInteractTo(), ActMelee.CanPerform(), AI_Goto.IsDestinationReached(), and ActPlan.Item.Perform().

◆ CanInteractTo() [2/2]

bool Chara.CanInteractTo ( Point  p)
inline

Definition at line 2556 of file Chara.cs.

2557 {
2558 if (!p.IsValid)
2559 {
2560 return false;
2561 }
2562 if (EClass._map.cells[p.x, p.z].blocked)
2563 {
2564 return true;
2565 }
2566 if (!IsMultisize)
2567 {
2568 int num = ((p.z >= pos.z) ? ((p.x > pos.x) ? 1 : ((p.z > pos.z) ? 2 : 3)) : 0);
2569 if (EClass._map.cells[pos.x, pos.z].weights[num] == 0)
2570 {
2571 return false;
2572 }
2573 if (p.x != pos.x && p.z != pos.z)
2574 {
2575 Cell[,] cells = EClass._map.cells;
2576 int x = p.x;
2577 int z = pos.z;
2578 int num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2579 if (cells[pos.x, pos.z].weights[num2] == 0)
2580 {
2581 return false;
2582 }
2583 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2584 if (cells[p.x, p.z].weights[num2] == 0)
2585 {
2586 return false;
2587 }
2588 x = pos.x;
2589 z = p.z;
2590 num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2591 if (cells[pos.x, pos.z].weights[num2] == 0)
2592 {
2593 return false;
2594 }
2595 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2596 if (cells[p.x, p.z].weights[num2] == 0)
2597 {
2598 return false;
2599 }
2600 }
2601 }
2602 return true;
2603 }
Cell[,] cells
Definition: Map.cs:85
bool IsValid
Definition: Point.cs:88

References EClass._map, Algorithms.WeightCell.blocked, Map.cells, IsMultisize, Point.IsValid, Card.pos, Algorithms.WeightCell.weights, Point.x, and Point.z.

◆ CanLift()

bool Chara.CanLift ( Card  c)
inline

Definition at line 4280 of file Chara.cs.

4281 {
4282 return true;
4283 }

Referenced by HotItemNoItem._TrySetAct().

◆ CanMoveTo()

bool Chara.CanMoveTo ( Point  p,
bool  allowDestroyPath = true 
)
inline

Definition at line 2457 of file Chara.cs.

2458 {
2459 if (!p.IsValid)
2460 {
2461 return false;
2462 }
2463 int num = ((p.z >= pos.z) ? ((p.x > pos.x) ? 1 : ((p.z > pos.z) ? 2 : 3)) : 0);
2464 if (allowDestroyPath && CanDestroyPath())
2465 {
2466 if (!p.IsInBounds)
2467 {
2468 return false;
2469 }
2470 }
2471 else
2472 {
2473 if (EClass._map.cells[p.x, p.z].blocked || EClass._map.cells[pos.x, pos.z].weights[num] == 0)
2474 {
2475 return false;
2476 }
2477 if (p.x != pos.x && p.z != pos.z)
2478 {
2479 Cell[,] cells = EClass._map.cells;
2480 int x = p.x;
2481 int z = pos.z;
2482 int num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2483 if (cells[pos.x, pos.z].weights[num2] == 0)
2484 {
2485 return false;
2486 }
2487 if (cells[x, z].blocked)
2488 {
2489 return false;
2490 }
2491 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2492 if (cells[p.x, p.z].weights[num2] == 0)
2493 {
2494 return false;
2495 }
2496 x = pos.x;
2497 z = p.z;
2498 num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2499 if (cells[pos.x, pos.z].weights[num2] == 0)
2500 {
2501 return false;
2502 }
2503 if (cells[x, z].blocked)
2504 {
2505 return false;
2506 }
2507 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2508 if (cells[p.x, p.z].weights[num2] == 0)
2509 {
2510 return false;
2511 }
2512 }
2513 }
2514 if (IsPC)
2515 {
2516 if (IsEnemyOnPath(p))
2517 {
2518 return false;
2519 }
2520 }
2521 else if (p.HasChara && !IsMultisize && !CanReplace(p.FirstChara))
2522 {
2523 return false;
2524 }
2525 return true;
2526 }
bool IsEnemyOnPath(Point p, bool cancelAI=true)
Definition: Chara.cs:2528
Chara FirstChara
Definition: Point.cs:288
bool IsInBounds
Definition: Point.cs:104

References EClass._map, Algorithms.WeightCell.blocked, CanDestroyPath(), CanReplace(), Map.cells, Point.FirstChara, Point.HasChara, IsEnemyOnPath(), Point.IsInBounds, IsMultisize, IsPC, Point.IsValid, Card.pos, Algorithms.WeightCell.weights, Point.x, and Point.z.

Referenced by _Move(), MoveByForce(), TryMove(), and TryMoveTowards().

◆ CanPick()

bool Chara.CanPick ( Card  c)
inline

Definition at line 4290 of file Chara.cs.

4291 {
4292 if (c.isDestroyed)
4293 {
4294 return false;
4295 }
4296 Card rootCard = c.GetRootCard();
4297 if (rootCard.isDestroyed || (rootCard.ExistsOnMap && rootCard.pos.Distance(pos) > 1))
4298 {
4299 return false;
4300 }
4301 if (rootCard != this && things.IsFull(c.Thing))
4302 {
4303 return false;
4304 }
4305 return true;
4306 }
bool isDestroyed
Definition: Card.cs:76
bool ExistsOnMap
Definition: Card.cs:2086
Card GetRootCard()
Definition: Card.cs:3455

References Point.Distance(), Card.ExistsOnMap, Card.GetRootCard(), Card.isDestroyed, Card.pos, and Card.Thing.

Referenced by ActPlan._Update().

◆ CanReplace()

bool Chara.CanReplace ( Chara  c)
inline

Definition at line 3295 of file Chara.cs.

3296 {
3298 {
3299 return false;
3300 }
3301 if (IsPC)
3302 {
3303 return true;
3304 }
3305 if (c.IsPC || c.pos.Equals(EClass.pc.pos) || c.host != null)
3306 {
3307 return false;
3308 }
3309 if (!IsHostile(c))
3310 {
3311 if (c.c_uidMaster != 0 || c.isSummon || base.IsPowerful || IsEscorted())
3312 {
3313 return true;
3314 }
3315 if (DestDist < c.DestDist)
3316 {
3317 return true;
3318 }
3319 if (IsPCParty && !c.IsPCParty)
3320 {
3321 return true;
3322 }
3323 if (IsPCFaction && !c.IsPCParty)
3324 {
3325 return true;
3326 }
3327 }
3328 return false;
3329 }
bool IsPCFactionOrMinion
Definition: Card.cs:2275
bool isSummon
Definition: Card.cs:711
int c_uidMaster
Definition: Card.cs:1450
bool noMove
Definition: Card.cs:771
new TraitChara trait
Definition: Chara.cs:505
override bool IsPCParty
Definition: Chara.cs:617
int DestDist
Definition: Chara.cs:1000
bool IsHostile()
Definition: Chara.cs:6533
bool IsEscorted()
Definition: Chara.cs:2428
bool Equals(int _x, int _z)
Definition: Point.cs:960
virtual bool CanBePushed
Definition: TraitChara.cs:113

References EClass._zone, Card.c_uidMaster, TraitChara.CanBePushed, DestDist, Point.Equals(), host, IsMultisize, IsPC, Card.IsPCFactionOrMinion, IsPCParty, Spatial.IsRegion, Card.isRestrained, Card.isSummon, Card.noMove, EClass.pc, Card.pos, and trait.

Referenced by _Move(), and CanMoveTo().

◆ CanRevive()

bool Chara.CanRevive ( )
inline

Definition at line 5153 of file Chara.cs.

5154 {
5155 return EClass.world.date.IsExpired(base.c_dateDeathLock);
5156 }
bool IsExpired(int time)
Definition: Date.cs:336

References World.date, Date.IsExpired(), and EClass.world.

Referenced by FactionBranch.DailyOutcome(), and Zone.Revive().

◆ CanSee()

bool Chara.CanSee ( Card  c)
inline

Definition at line 1232 of file Chara.cs.

1233 {
1234 if (c == this)
1235 {
1236 return true;
1237 }
1238 if (!c.pos.IsValid)
1239 {
1240 return false;
1241 }
1242 if (c.isChara)
1243 {
1245 {
1246 return true;
1247 }
1248 if (c.isHidden && c != this && !canSeeInvisible)
1249 {
1250 return false;
1251 }
1252 }
1253 if (IsPC)
1254 {
1255 if (fov != null)
1256 {
1257 return fov.lastPoints.ContainsKey(c.pos.index);
1258 }
1259 return false;
1260 }
1261 return true;
1262 }
virtual Chara Chara
Definition: Card.cs:2071
Fov fov
Definition: Card.cs:58
virtual bool isChara
Definition: Card.cs:2084
bool isHidden
Definition: Card.cs:531
bool canSeeInvisible
Definition: Chara.cs:140
bool visibleWithTelepathy
Definition: Chara.cs:152
bool hasTelepathy
Definition: Chara.cs:142
Dictionary< int, byte > lastPoints
Definition: Fov.cs:36
int index
Definition: Point.cs:49

References canSeeInvisible, Card.Chara, Card.fov, hasTelepathy, Point.index, Card.isChara, Card.isHidden, IsPC, Point.IsValid, Fov.lastPoints, Card.pos, and visibleWithTelepathy.

Referenced by ActPlan._Update(), Act.CanPerform(), DoHostileAction(), AI_Idle.DoSomethingToCharaInRadius(), AI_Idle.DoSomethingToNearChara(), Point.FirstVisibleChara(), AI_Mofu.GetMofu(), Msg.GetName(), Player.HasValidRangedTarget(), ActMelee.HideHint(), Point.ListVisibleCards(), Point.ListVisibleCharas(), TCExtra.OnDraw(), AM_Adv.OnRenderTile(), TCOrbitChara.Refresh(), TCOrbitThing.Refresh(), AI_Idle.Run(), AI_Steal.Run(), GoalCombat.Run(), ThirstPersonInfo.Set(), Player.TargetRanged(), HotItemAct.TrySetAct(), TraitCatalyst.TrySetHeldAct(), TraitLeash.TrySetHeldAct(), TraitStethoscope.TrySetHeldAct(), TraitWhipEgg.TrySetHeldAct(), and TraitWhipLove.TrySetHeldAct().

◆ CanSeeLos() [1/2]

◆ CanSeeLos() [2/2]

bool Chara.CanSeeLos ( Point  p,
int  dist = -1 
)
inline

Definition at line 1273 of file Chara.cs.

1274 {
1275 if (dist == -1)
1276 {
1277 dist = pos.Distance(p);
1278 }
1279 if (dist > GetSightRadius())
1280 {
1281 return false;
1282 }
1283 if (IsPC)
1284 {
1285 if (fov != null)
1286 {
1287 return fov.lastPoints.ContainsKey(p.index);
1288 }
1289 return false;
1290 }
1291 return Los.IsVisible(pos, p);
1292 }
int GetSightRadius()
Definition: Card.cs:6572
Definition: Los.cs:5
static bool IsVisible(Point p1, Point p2, Action< Point, bool > _onVisit=null)
Definition: Los.cs:167

References Point.Distance(), Card.fov, Card.GetSightRadius(), Point.index, IsPC, Los.IsVisible(), Fov.lastPoints, and Card.pos.

◆ CanSeeSimple()

bool Chara.CanSeeSimple ( Point  p)
inline

Definition at line 1215 of file Chara.cs.

1216 {
1217 if (!p.IsValid || p.IsHidden)
1218 {
1219 return false;
1220 }
1221 if (IsPC)
1222 {
1223 if (fov != null)
1224 {
1225 return fov.lastPoints.ContainsKey(p.index);
1226 }
1227 return false;
1228 }
1229 return true;
1230 }
bool IsHidden
Definition: Point.cs:347

References Card.fov, Point.index, Point.IsHidden, IsPC, Point.IsValid, and Fov.lastPoints.

Referenced by ActWait.Search(), ActWait.SearchMedal(), and HotItemHeld.TrySetToolAct().

◆ CanSleep()

bool Chara.CanSleep ( )
inline

Definition at line 1313 of file Chara.cs.

1314 {
1315 if (EClass._zone.events.GetEvent<ZoneEventQuest>() != null)
1316 {
1317 return false;
1318 }
1319 if (!EClass.debug.godMode && sleepiness.GetPhase() == 0)
1320 {
1321 return stamina.GetPhase() <= 1;
1322 }
1323 return true;
1324 }
Stats sleepiness
Definition: Chara.cs:1170
Stats stamina
Definition: Chara.cs:1160
ZoneEventManager events
Definition: Zone.cs:40

References EClass._zone, EClass.debug, Zone.events, Stats.GetPhase(), CoreDebug.godMode, sleepiness, and stamina.

Referenced by AI_Sleep.OnProgressComplete(), HotItemActionSleep.Perform(), and AI_PassTime.Run().

◆ ChangeJob()

void Chara.ChangeJob ( string  idNew)
inline

Definition at line 2192 of file Chara.cs.

2193 {
2194 ApplyJob(remove: true);
2195 base.c_idJob = idNew;
2196 _job = null;
2197 ApplyJob();
2198 if (IsPCC)
2199 {
2200 PCC.Get(pccData).Build();
2201 }
2202 }
void ApplyJob(bool remove=false)
Definition: Chara.cs:2183
SourceJob.Row _job
Definition: Chara.cs:164

References _job, ApplyJob(), IsPCC, and pccData.

Referenced by CoreDebug.ChangeJob(), CoreDebug.Fix_EtherDisease(), UICharaMaker.ListJob(), CoreDebug.QuickStart(), and UICharaMaker.RerollJob().

◆ ChangeMemberType()

void Chara.ChangeMemberType ( FactionMemberType  type)
inline

Definition at line 7052 of file Chara.cs.

7053 {
7054 memberType = type;
7055 }
FactionMemberType memberType
Definition: Chara.cs:46

◆ ChangeRace()

void Chara.ChangeRace ( string  idNew)
inline

Definition at line 2295 of file Chara.cs.

2296 {
2297 ApplyRace(remove: true);
2298 base.c_idRace = idNew;
2299 _race = null;
2300 ApplyRace();
2301 ChangeMaterial(source.defMat.IsEmpty(race.material));
2302 }
@ ChangeMaterial
void ApplyRace(bool remove=false)
Definition: Chara.cs:2269
SourceRace.Row _race
Definition: Chara.cs:162

References _race, ApplyRace(), ChangeMaterial, race, and source.

Referenced by CoreDebug.ChangeRace(), CoreDebug.Fix_EtherDisease(), UICharaMaker.ListRace(), CoreDebug.QuickStart(), and UICharaMaker.RerollRace().

◆ ChangeRarity()

override void Chara.ChangeRarity ( Rarity  r)
inlinevirtual

Reimplemented from Card.

Definition at line 1428 of file Chara.cs.

1429 {
1430 if (r != base.rarity)
1431 {
1432 base.rarity = r;
1433 if (renderer != null && renderer.isSynced)
1434 {
1436 }
1437 base.hp = MaxHP;
1438 }
1439 }
void RefreshExtra()

References RenderObject.isSynced, MaxHP, CardRenderer.RefreshExtra(), and Card.renderer.

Referenced by ZonePreEnterBout.Execute().

◆ ChooseNewGoal()

void Chara.ChooseNewGoal ( )
inline

Definition at line 8774 of file Chara.cs.

8775 {
8776 if (IsPC && EClass.AdvMode)
8777 {
8778 SetNoGoal();
8779 return;
8780 }
8781 if (IsPCParty || base.noMove)
8782 {
8783 SetAI(new GoalIdle());
8784 return;
8785 }
8786 if ((IsHomeMember() && IsInHomeZone()) || IsGuest())
8787 {
8788 Goal goalFromTimeTable = GetGoalFromTimeTable(EClass.world.date.hour);
8789 if (goalFromTimeTable != null)
8790 {
8791 SetAI(goalFromTimeTable);
8792 if (goalFromTimeTable is GoalWork)
8793 {
8794 goalFromTimeTable.Tick();
8795 }
8796 return;
8797 }
8798 }
8799 if (goalList.index == -2)
8800 {
8802 }
8803 SetAI(goalList.Next());
8804 }
Status Tick()
Definition: AIAct.cs:356
Goal GetGoalFromTimeTable(int hour)
Definition: Chara.cs:8806
GoalListType goalListType
Definition: Chara.cs:281
AIAct SetNoGoal()
Definition: Chara.cs:8898
bool IsHomeMember()
Definition: Chara.cs:6599
bool IsGuest()
Definition: Chara.cs:6624
GoalList goalList
Definition: Chara.cs:202
bool IsInHomeZone()
Definition: Chara.cs:6604
int hour
Definition: Date.cs:74
static bool AdvMode
Definition: EClass.cs:11
int index
Definition: GoalList.cs:5
void Refresh(Chara owner, GoalListType type)
Definition: GoalList.cs:9
Goal Next()
Definition: GoalList.cs:39
Definition: Goal.cs:4

References EClass.AdvMode, World.date, Date.hour, GoalList.index, GoalList.Next(), GoalList.Refresh(), AIAct.Tick(), and EClass.world.

Referenced by Zone.Simulate().

◆ ClearBed()

void Chara.ClearBed ( Map  map = null)
inline

Definition at line 7324 of file Chara.cs.

7325 {
7326 if (map == null)
7327 {
7328 map = EClass._map;
7329 }
7330 foreach (Card item in map.props.installed.all)
7331 {
7332 if (item.trait is TraitBed traitBed && traitBed.IsHolder(this))
7333 {
7334 traitBed.RemoveHolder(this);
7335 }
7336 }
7337 }
PropsManager props
Definition: Map.cs:91
PropsInstalled installed
Definition: PropsManager.cs:8
PropSet all
Definition: Props.cs:8
bool IsHolder(Chara c)
Definition: TraitBed.cs:135

References EClass._map, TraitBed.IsHolder(), and item.

Referenced by FactionBranch.ChangeMemberType(), and FactionBranch.RemoveMemeber().

◆ ClearInventory()

void Chara.ClearInventory ( ClearInventoryType  type)
inline

Definition at line 8546 of file Chara.cs.

8547 {
8548 int num = 0;
8549 for (int num2 = things.Count - 1; num2 >= 0; num2--)
8550 {
8551 Thing thing = things[num2];
8552 if (ShouldThrowAway(thing, type))
8553 {
8554 num += thing.GetPrice(CurrencyType.Money, sell: true, PriceType.Default, this) * thing.Num;
8555 thing.Destroy();
8556 }
8557 }
8558 if (num > 0)
8559 {
8560 ModCurrency(num);
8561 if (type == ClearInventoryType.SellAtTown)
8562 {
8563 Msg.Say("party_sell", this, num.ToString() ?? "");
8564 PlaySound("pay");
8565 }
8566 }
8567 }
ClearInventoryType
CurrencyType
Definition: CurrencyType.cs:2
PriceType
Definition: PriceType.cs:2
virtual int GetPrice(CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
Definition: Card.cs:7447
int Num
Definition: Card.cs:159
bool ShouldThrowAway(Thing t, ClearInventoryType type)
Definition: Chara.cs:8475

References Card.Destroy(), Card.GetPrice(), Card.Num, and Msg.Say().

Referenced by AI_Fish.Run(), and AI_Idle.Run().

◆ ClearTempElements()

void Chara.ClearTempElements ( )
inline

Definition at line 10391 of file Chara.cs.

10392 {
10393 if (tempElements != null)
10394 {
10396 tempElements = null;
10397 }
10398 }
ElementContainer tempElements
Definition: Chara.cs:36
void SetParent(Card c)

References ElementContainer.SetParent().

◆ CountDebuff()

int Chara.CountDebuff ( )
inline

Definition at line 9463 of file Chara.cs.

9464 {
9465 int num = 0;
9466 foreach (Condition condition in conditions)
9467 {
9468 if (condition.Type == ConditionType.Debuff)
9469 {
9470 num++;
9471 }
9472 }
9473 return num;
9474 }

References BaseStats.Type.

Referenced by GoalCombat.TryUseAbility().

◆ CountNumEaten()

int Chara.CountNumEaten ( Thing  food)
inline

Definition at line 10197 of file Chara.cs.

10198 {
10199 if (_historyFood == null)
10200 {
10201 return -1;
10202 }
10203 int num = 0;
10204 foreach (List<string> item in _historyFood)
10205 {
10206 foreach (string item2 in item)
10207 {
10208 if (item2 == food.id)
10209 {
10210 num++;
10211 }
10212 }
10213 }
10214 return num;
10215 }

References food, and item.

Referenced by FoodEffect.Proc().

◆ CreateReplacement()

Chara Chara.CreateReplacement ( )
inline

Definition at line 8038 of file Chara.cs.

8039 {
8040 Chara chara = CharaGen.Create(id);
8041 chara.c_originalHostility = base.c_originalHostility;
8042 if (chara.c_originalHostility != 0)
8043 {
8044 chara.hostility = chara.c_originalHostility;
8045 }
8046 if (orgPos != null)
8047 {
8048 chara.orgPos = orgPos.Copy();
8049 }
8050 chara.pos = pos.Copy();
8051 chara.isImported = true;
8052 chara.c_editorTags = base.c_editorTags;
8053 chara.c_editorTraitVal = base.c_editorTraitVal;
8054 chara.c_idTrait = base.c_idTrait;
8055 chara.homeZone = homeZone;
8056 return chara;
8057 }
Hostility c_originalHostility
Definition: Card.cs:977
static Chara Create(string id, int lv=-1)
Definition: CharaGen.cs:17
Zone homeZone
Definition: Chara.cs:269
Point Copy()
Definition: Point.cs:491

References Card.c_originalHostility, Point.Copy(), and CharaGen.Create().

Referenced by MakeAlly(), and ActThrow.Throw().

◆ Cuddle()

void Chara.Cuddle ( Chara  c,
bool  headpat = false 
)
inline

Definition at line 6264 of file Chara.cs.

6265 {
6266 Talk("goodBoy");
6267 Say(headpat ? "headpat" : "cuddle", this, c);
6268 c.ShowEmo(Emo.love);
6269 if (EClass.rnd(IsPC ? 100 : 5000) == 0)
6270 {
6271 c.MakeEgg();
6272 }
6273 if (headpat && this != c)
6274 {
6275 if (c.interest > 0)
6276 {
6277 c.ModAffinity(EClass.pc, 1 + EClass.rnd(3));
6278 c.interest -= 20 + EClass.rnd(10);
6279 }
6281 {
6282 foreach (Chara member in party.members)
6283 {
6284 if (!member.IsPC && CanSeeLos(member))
6285 {
6286 member.AddCondition<ConEuphoric>(100 + Evalue(6904) * 5);
6287 }
6288 }
6289 }
6290 }
6291 if (c.Evalue(1221) > 0)
6292 {
6293 int ele = ((c.MainElement == Element.Void) ? 924 : c.MainElement.id);
6294 if (c.id == "hedgehog_ether")
6295 {
6296 ele = 922;
6297 }
6298 Say("reflect_thorne", this, c);
6299 DamageHP(10L, ele, Power, AttackSource.Condition);
6300 }
6301 }
Emo
Definition: Emo.cs:2
virtual int Power
Definition: Card.cs:2298
void ShowEmo(Emo _emo=Emo.none, float duration=0f, bool skipSame=true)
Definition: Card.cs:6286
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
Definition: Card.cs:5765
Element MainElement
Definition: Chara.cs:719
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Definition: Chara.cs:7960
int interest
Definition: Chara.cs:319
Religion faith
Definition: Chara.cs:441
static Element Void
Definition: ELEMENT.cs:243
ReligionManager religions
Definition: Game.cs:159
ReligionMoonShadow MoonShadow

References AddCondition(), Card.Evalue(), faith, EClass.game, Card.id, Element.id, interest, IsPC, IsPCParty, MainElement, Card.MakeEgg(), Party.members, ModAffinity(), ReligionManager.MoonShadow, EClass.pc, Game.religions, EClass.rnd(), Card.ShowEmo(), and Element.Void.

Referenced by ActPlan._Update(), ActEffect.Proc(), AI_Idle.Run(), and AI_Mofu.Run().

◆ Cure()

void Chara.Cure ( CureType  type,
int  p = 100,
BlessedState  state = BlessedState::Normal 
)
inline

Definition at line 9526 of file Chara.cs.

9527 {
9528 bool flag = state == BlessedState.Blessed;
9529 switch (type)
9530 {
9531 case CureType.Heal:
9532 case CureType.Prayer:
9533 CureCondition<ConFear>();
9534 CureCondition<ConBlind>(2 * p / 100 + 5);
9535 CureCondition<ConPoison>(5 * p / 100 + 5);
9536 CureCondition<ConConfuse>(10 * p / 100 + 10);
9537 CureCondition<ConDim>(p / 100 + 5);
9538 CureCondition<ConBleed>(2 * p / 100 + 10);
9539 if (flag)
9540 {
9541 SAN.Mod(-15);
9542 }
9543 break;
9544 case CureType.CureBody:
9545 CureCondition<ConBlind>(5 * p / 100 + 15);
9546 CureCondition<ConPoison>(10 * p / 100 + 15);
9547 CureCondition<ConBleed>(5 * p / 100 + 20);
9548 CureTempElements(p, body: true, mind: false);
9549 break;
9550 case CureType.CureMind:
9551 CureCondition<ConFear>();
9552 CureCondition<ConDim>(3 * p / 100 + 10);
9553 CureTempElements(p, body: false, mind: true);
9554 break;
9555 case CureType.Sleep:
9556 {
9557 for (int num2 = conditions.Count - 1; num2 >= 0; num2--)
9558 {
9559 Condition condition2 = conditions[num2];
9560 if (!(condition2 is ConSleep) && !(condition2 is ConFaint))
9561 {
9562 if (condition2.isPerfume)
9563 {
9564 condition2.Mod(-1, force: true);
9565 }
9566 else if (condition2.Type == ConditionType.Bad || condition2.Type == ConditionType.Debuff)
9567 {
9568 condition2.Kill();
9569 }
9570 }
9571 }
9572 CureCondition<ConWait>();
9573 CureCondition<ConDisease>((EClass.rnd(20) + 10) * p / 100);
9574 bool flag2 = HasCondition<ConAnorexia>();
9575 base.c_vomit -= (flag2 ? 3 : 2) * p / 100;
9576 if (base.c_vomit < 0)
9577 {
9578 base.c_vomit = 0;
9579 if (flag2)
9580 {
9581 RemoveCondition<ConAnorexia>();
9582 }
9583 }
9584 break;
9585 }
9586 case CureType.HealComplete:
9587 case CureType.Death:
9588 case CureType.Jure:
9589 case CureType.Boss:
9590 case CureType.Unicorn:
9591 {
9592 CureTempElements(p * 100, body: true, mind: true);
9593 for (int num = conditions.Count - 1; num >= 0; num--)
9594 {
9595 Condition condition = conditions[num];
9596 if (condition is ConAnorexia && type != CureType.Death && type != CureType.Unicorn && type != CureType.Jure)
9597 {
9598 continue;
9599 }
9600 switch (condition.Type)
9601 {
9602 case ConditionType.Bad:
9603 case ConditionType.Debuff:
9604 case ConditionType.Disease:
9605 condition.Kill();
9606 continue;
9607 case ConditionType.Stance:
9608 if (type == CureType.Death)
9609 {
9610 condition.Kill();
9611 continue;
9612 }
9613 break;
9614 }
9615 if (type == CureType.Death && condition.isPerfume)
9616 {
9617 condition.Kill();
9618 }
9619 }
9620 CureCondition<ConWait>();
9621 CureCondition<ConSleep>();
9622 switch (type)
9623 {
9624 case CureType.Death:
9625 case CureType.Boss:
9626 case CureType.Unicorn:
9627 SAN.Mod(-20);
9628 RemoveCondition<ConBrightnessOfLife>();
9629 RemoveCondition<ConDeathSentense>();
9630 break;
9631 case CureType.Jure:
9632 SAN.Mod(-999);
9633 if (HasElement(1206))
9634 {
9635 SetFeat(1206, 0, msg: true);
9636 }
9637 RemoveCondition<ConBrightnessOfLife>();
9638 RemoveCondition<ConDeathSentense>();
9639 break;
9640 case CureType.CureBody:
9641 case CureType.CureMind:
9642 case CureType.Prayer:
9643 break;
9644 }
9645 break;
9646 }
9647 }
9648 }
BlessedState
Definition: BlessedState.cs:2
CureType
Definition: CureType.cs:2
void Mod(int a, bool force=false)
void CureTempElements(int p, bool body, bool mind)
Definition: Chara.cs:10361
Stats SAN
Definition: Chara.cs:1172
void Kill(bool silent=false)
Definition: Condition.cs:91
virtual void Mod(int a)
Definition: Stats.cs:135

References BaseCondition.isPerfume, Condition.Kill(), Stats.Mod(), BaseCondition.Mod(), EClass.rnd(), and BaseStats.Type.

Referenced by CureHost(), HealAll(), StatsMana.Mod(), ActPray.Pray(), and Zone.Simulate().

◆ CureCondition< T >()

void Chara.CureCondition< T > ( int  v = 99999)
inline
Type Constraints
T :Condition 

Definition at line 9476 of file Chara.cs.

9476 : Condition
9477 {
9478 T condition = GetCondition<T>();
9479 if (condition != null)
9480 {
9481 condition.value -= v;
9482 if (condition.value <= 0)
9483 {
9484 condition.Kill();
9485 }
9486 }
9487 }
override T GetCondition< T >()
Definition: Chara.cs:9489

◆ CureHost()

void Chara.CureHost ( CureType  type,
int  p = 100,
BlessedState  state = BlessedState::Normal 
)
inline

Definition at line 9513 of file Chara.cs.

9514 {
9515 if (parasite != null)
9516 {
9517 parasite.Cure(type, p, state);
9518 }
9519 if (ride != null)
9520 {
9521 ride.Cure(type, p, state);
9522 }
9523 Cure(type, p, state);
9524 }
void Cure(CureType type, int p=100, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:9526

References Cure().

Referenced by FactionBranch.DailyOutcome().

◆ CureTempElements()

void Chara.CureTempElements ( int  p,
bool  body,
bool  mind 
)
inline

Definition at line 10361 of file Chara.cs.

10362 {
10363 if (tempElements != null)
10364 {
10365 if (body)
10366 {
10368 }
10369 if (mind)
10370 {
10372 }
10373 }
10374 void Cure(int[] eles)
10375 {
10376 foreach (int ele in eles)
10377 {
10378 if (tempElements == null)
10379 {
10380 break;
10381 }
10382 Element element = tempElements.GetElement(ele);
10383 if (element != null && element.vBase < 0)
10384 {
10385 ModTempElement(ele, Mathf.Clamp(p / 20 + EClass.rnd(p / 20), 1, -element.vBase));
10386 }
10387 }
10388 }
10389 }
void ModTempElement(int ele, int a, bool naturalDecay=false, bool onlyRenew=false)
Definition: Chara.cs:10269
Element GetElement(string alias)
static int[] List_Body
Definition: ELEMENT.cs:249
static int[] List_Mind
Definition: ELEMENT.cs:251

References ElementContainer.GetElement(), Element.List_Body, Element.List_Mind, EClass.rnd(), and Element.vBase.

◆ DamageTempElement()

void Chara.DamageTempElement ( int  ele,
int  p,
bool  onlyRenew = false 
)
inline

Definition at line 10327 of file Chara.cs.

10328 {
10329 ModTempElement(ele, onlyRenew ? (-p / 20) : (-(p / 100 + EClass.rnd(p / 100 + 1) + 1)), naturalDecay: false, onlyRenew);
10330 }

References EClass.rnd().

◆ DamageTempElements()

void Chara.DamageTempElements ( int  p,
bool  body,
bool  mind,
bool  onlyRenew = false 
)
inline

Definition at line 10315 of file Chara.cs.

10316 {
10317 if (body)
10318 {
10319 DamageTempElement(Element.List_Body.RandomItem(), p, onlyRenew);
10320 }
10321 if (mind)
10322 {
10323 DamageTempElement(Element.List_Mind.RandomItem(), p, onlyRenew);
10324 }
10325 }
void DamageTempElement(int ele, int p, bool onlyRenew=false)
Definition: Chara.cs:10327

References Element.List_Body, and Element.List_Mind.

◆ DestroyPath()

void Chara.DestroyPath ( Point  pos)
inline

Definition at line 3184 of file Chara.cs.

3185 {
3186 bool broke = false;
3187 pos.ForeachMultiSize(base.W, base.H, delegate(Point _p, bool main)
3188 {
3189 if (_p.IsValid)
3190 {
3191 if (_p.HasBlock)
3192 {
3193 EClass._map.MineBlock(_p, recoverBlock: false, this);
3194 if (_p.HasObj)
3195 {
3196 EClass._map.MineObj(_p, null, this);
3197 }
3198 broke = true;
3199 }
3200 if (_p.HasObj && _p.IsBlocked)
3201 {
3202 EClass._map.MineObj(_p, null, this);
3203 broke = true;
3204 }
3205 _p.Things.ForeachReverse(delegate(Thing t)
3206 {
3207 if (t.IsInstalled && (t.trait.IsBlockPath || t.trait.IsDoor))
3208 {
3209 if (t.isNPCProperty && t.trait.CanBeDestroyed)
3210 {
3211 t.Destroy();
3212 }
3213 else if (!t.IsUnique && !t.trait.CanBeDestroyed)
3214 {
3215 t.SetPlaceState(PlaceState.roaming);
3216 }
3217 }
3218 });
3219 }
3220 });
3221 if (broke)
3222 {
3223 Msg.Say("stomp");
3224 Shaker.ShakeCam("stomp");
3225 }
3226 }
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
bool IsUnique
Definition: Card.cs:2092
void ForeachMultiSize(int w, int h, Action< Point, bool > action)
Definition: Point.cs:1385
bool IsBlocked
Definition: Point.cs:363
Definition: Shaker.cs:5
static void ShakeCam(string id="default", float magnitude=1f)
Definition: Shaker.cs:25
virtual bool IsBlockPath
Definition: Trait.cs:54
virtual bool IsDoor
Definition: Trait.cs:58

References Trait.CanBeDestroyed, Point.ForeachMultiSize(), Point.HasObj, if(), Point.IsBlocked, Trait.IsBlockPath, Trait.IsDoor, Card.IsInstalled, Card.IsUnique, Point.IsValid, Card.pos, Point.Things, and Card.trait.

Referenced by _Move(), and ActThrow.Throw().

◆ Die()

override void Chara.Die ( Element  e = null,
Card  origin = null,
AttackSource  attackSource = AttackSource::None,
Chara  originalTarget = null 
)
inlinevirtual

Reimplemented from Card.

Definition at line 5348 of file Chara.cs.

5349 {
5350 combatCount = 0;
5351 if (isDead)
5352 {
5353 return;
5354 }
5355 if (host != null)
5356 {
5357 base.hp = -1;
5358 if ((uint)(attackSource - 17) > 1u)
5359 {
5360 AddCondition<ConFaint>(200, force: true);
5361 return;
5362 }
5363 ActRide.Unride(host, this);
5364 }
5365 bool isInActiveZone = IsInActiveZone;
5366 if (isInActiveZone)
5367 {
5368 if (IsPC)
5369 {
5371 }
5372 if (base.isSummon)
5373 {
5374 if (id == "tsunami")
5375 {
5376 pos.PlaySound("water");
5377 }
5378 else
5379 {
5380 Say("summon_vanish", this);
5381 pos.PlayEffect("vanish");
5382 pos.PlaySound("vanish");
5383 }
5384 Destroy();
5385 return;
5386 }
5387 if ((uint)(attackSource - 17) <= 1u)
5388 {
5389 if (attackSource == AttackSource.Euthanasia && trait is TraitLittleOne)
5390 {
5391 MakeEgg();
5392 if (IsPCFaction)
5393 {
5395 }
5396 }
5397 PlayEffect("revive");
5398 PlaySound("chime_angel");
5399 }
5400 else
5401 {
5402 Effect.Get("blood").Play((parent is Chara) ? (parent as Chara).pos : pos).SetParticleColor(EClass.Colors.matColors[base.material.alias].main)
5403 .Emit(50);
5404 AddBlood(AI_Slaughter.slaughtering ? 12 : (2 + EClass.rnd(2)));
5405 PlaySound(base.material.GetSoundDead(source));
5406 }
5409 ClearFOV();
5410 }
5411 string text = "";
5412 "dead_in".langGame(EClass._zone.Name);
5413 string text2 = ((origin == null) ? "" : origin.GetName(NameStyle.Full));
5414 if (LangGame.Has("dead_" + attackSource))
5415 {
5416 text = "dead_" + attackSource;
5417 }
5418 else
5419 {
5420 if (e != Element.Void && e != null)
5421 {
5422 text = "dead_" + e.source.alias;
5423 }
5424 if (text == "" || !LangGame.Has(text))
5425 {
5426 text = "dead";
5427 }
5428 }
5429 if (IsPC)
5430 {
5431 EClass._zone.isDeathLocation = true;
5432 string s = ((origin == null) ? text : "dead_by");
5434 if (attackSource == AttackSource.Wrath)
5435 {
5437 }
5438 EClass.player.deathMsg = GameLang.Parse(s.langGame(), thirdPerson: true, EClass.pc.NameBraced, "dead_in".langGame(EClass._zone.Name), text2);
5440 if (EClass._zone.instance is ZoneInstanceRandomQuest zoneInstanceRandomQuest)
5441 {
5442 zoneInstanceRandomQuest.status = ZoneInstance.Status.Fail;
5443 }
5444 AI_PlayMusic.keepPlaying = false;
5445 }
5446 if (isInActiveZone)
5447 {
5448 if (attackSource == AttackSource.DeathSentence || attackSource == AttackSource.Euthanasia)
5449 {
5450 Msg.Say("goto_heaven", this);
5451 }
5452 else
5453 {
5454 if (originalTarget != null || origin == null || !origin.isSynced || (attackSource != AttackSource.Melee && attackSource != AttackSource.Range))
5455 {
5456 Msg.Say(text, this, "", text2);
5457 }
5458 string text3 = TalkTopic("dead");
5459 if (!text3.IsEmpty())
5460 {
5461 text3 = text3.StripBrackets();
5462 }
5463 bool flag = base.rarity >= Rarity.Legendary && !IsPCFaction;
5464 if (!IsPC && flag)
5465 {
5466 MakeGrave(text3);
5467 }
5468 Msg.SetColor();
5469 SpawnLoot(origin);
5470 }
5471 if (IsPC)
5472 {
5474 }
5475 }
5476 if (IsPCFaction)
5477 {
5478 if (homeBranch != null)
5479 {
5480 homeBranch.Log(text, this, "");
5481 }
5482 WidgetPopText.Say("popDead".lang(base.Name), FontColor.Bad);
5483 if (!IsPC)
5484 {
5485 if (EClass.player.stats.allyDeath == 0)
5486 {
5487 Tutorial.Reserve("death_pet");
5488 }
5490 }
5491 }
5492 if (id == "mandrake" || HasElement(488))
5493 {
5494 Say("a_scream", this);
5495 ActEffect.ProcAt(EffectId.Scream, base.LV * 3 + 200, BlessedState.Normal, this, this, pos, isNeg: true);
5496 }
5497 daysStarved = 0;
5498 isDead = true;
5500 enemy = null;
5501 _cooldowns = null;
5502 base.isSale = false;
5503 SetInt(70);
5504 EClass._map.props.sales.Remove(this);
5505 Cure(CureType.Death);
5506 SetAI(new NoGoal());
5508 if (isInActiveZone && EClass._zone.HasLaw && IsHuman && OriginalHostility >= Hostility.Neutral)
5509 {
5510 pos.TalkWitnesses(origin?.Chara, "witness", 3, WitnessType.crime, (Chara c) => !c.IsPCParty && !c.IsUnique);
5511 }
5512 if (IsPC)
5513 {
5514 EClass.player.returnInfo = null;
5515 EClass.player.uidLastTravelZone = 0;
5516 foreach (Chara chara3 in EClass._map.charas)
5517 {
5518 if (chara3.IsHostile())
5519 {
5520 chara3.hostility = chara3.OriginalHostility;
5521 }
5522 if (chara3.enemy == EClass.pc)
5523 {
5524 chara3.enemy = null;
5525 }
5526 }
5527 if (EClass.pc.things.Find("letter_will") != null && EClass.rnd(10) == 0)
5528 {
5529 EClass.player.preventDeathPenalty = true;
5530 }
5531 }
5532 else
5533 {
5534 bool flag2 = currentZone.IsActiveZone && IsLocalChara && !currentZone.IsPCFaction;
5535 if (currentZone is Zone_LittleGarden && id == "littleOne")
5536 {
5537 flag2 = false;
5538 }
5539 if (flag2)
5540 {
5541 EClass._map.deadCharas.Add(this);
5542 }
5543 currentZone.RemoveCard(this);
5544 }
5545 if ((origin != null && origin.IsPCParty) || IsPCFaction)
5546 {
5547 int a = -10;
5548 if (IsPCFaction && !IsPCParty && (origin == null || !origin.IsPCParty))
5549 {
5550 a = -5;
5551 }
5552 ModAffinity(EClass.pc, a, show: false);
5553 string text4 = id;
5554 if (!(text4 == "quru"))
5555 {
5556 if (text4 == "corgon")
5557 {
5558 EClass.game.cards.globalCharas.Find("quru")?.ModAffinity(EClass.pc, -20, show: false);
5559 }
5560 }
5561 else
5562 {
5563 EClass.game.cards.globalCharas.Find("corgon")?.ModAffinity(EClass.pc, -20, show: false);
5564 }
5565 }
5566 if (origin != null)
5567 {
5568 if (origin.IsPCParty || origin.IsPCPartyMinion)
5569 {
5570 int num = 0;
5571 if (OriginalHostility >= Hostility.Friend && IsHuman && !base.IsPCFactionOrMinion)
5572 {
5573 num = -5;
5574 }
5575 else if (race.id == "cat" && OriginalHostility >= Hostility.Neutral)
5576 {
5577 EClass.pc.Say("killcat");
5578 num = -1;
5579 }
5580 if (EClass.pc.party.HasElement(1563) && num < 0)
5581 {
5582 num = num * 30 / 100;
5583 }
5584 if (num != 0)
5585 {
5586 EClass.player.ModKarma(num);
5587 }
5588 }
5589 if (origin == EClass.pc)
5590 {
5591 EClass.pc.faith.Revelation("kill", 10);
5592 }
5593 else if (origin.IsPCFaction)
5594 {
5595 origin.Chara.ModAffinity(EClass.pc, 1, show: false);
5596 origin.Chara.ShowEmo(Emo.love);
5597 }
5598 }
5599 if (base.sourceBacker != null && origin != null && origin.IsPCParty)
5600 {
5601 EClass.player.doneBackers.Add(base.sourceBacker.id);
5602 }
5603 if (base.IsPCFactionOrMinion)
5604 {
5606 {
5607 Msg.Say("abort_allyDead");
5608 }
5609 }
5611 {
5612 Msg.Say("abort_enemyDead");
5613 }
5614 if (IsPCParty && !IsPC)
5615 {
5617 base.c_wasInPcParty = true;
5618 EClass.pc.Say("allyDead");
5619 }
5620 switch (id)
5621 {
5622 case "littleOne":
5623 if (attackSource != AttackSource.Euthanasia && !IsPCFaction)
5624 {
5625 EClass.player.flags.little_killed = true;
5627 }
5628 break;
5629 case "big_daddy":
5630 if (!IsPCFaction)
5631 {
5632 Chara chara = CharaGen.Create("littleOne");
5633 EClass._zone.AddCard(chara, pos.Copy());
5634 Msg.Say("little_pop");
5636 }
5637 break;
5638 case "shark_sister":
5639 if (!IsPCFaction)
5640 {
5641 Chara t = CharaGen.Create("sister_shark");
5642 EClass._zone.AddCard(t, pos.Copy());
5643 Msg.Say("shark_pop");
5644 }
5645 break;
5646 }
5647 if (attackSource == AttackSource.Finish && origin != null && origin.Evalue(665) > 0)
5648 {
5649 Chara chara2 = CharaGen.CreateFromFilter("c_plant", base.LV);
5650 EClass._zone.AddCard(chara2, pos.Copy());
5651 if (chara2.LV < base.LV)
5652 {
5653 chara2.SetLv(base.LV);
5654 }
5655 chara2.MakeMinion((origin.IsPCParty || origin.IsPCPartyMinion) ? EClass.pc : origin.Chara, MinionType.Friend);
5656 Msg.Say("plant_pop", this, chara2);
5657 }
5660 }
EffectId
Definition: EffectId.cs:2
FontColor
Definition: FontColor.cs:2
MinionType
Definition: MinionType.cs:2
WitnessType
Definition: WitnessType.cs:2
static bool slaughtering
Definition: AI_Slaughter.cs:6
static void ProcAt(EffectId id, int power, BlessedState state, Card cc, Card tc, Point tp, bool isNeg, ActRef actRef=default(ActRef))
Definition: ActEffect.cs:492
static void Unride(Chara host, Chara mount, bool talk=true)
Definition: ActRide.cs:102
Chara Find(string id)
Definition: CardManager.cs:20
GlobalCharaList globalCharas
Definition: CardManager.cs:46
void RefreshSprite()
virtual void RefreshStateIcon()
void AddBlood(int a=1, int id=-1)
Definition: Card.cs:6125
virtual bool IsPCParty
Definition: Card.cs:2152
Card SetLv(int a)
Definition: Card.cs:2924
ICardParent parent
Definition: Card.cs:56
virtual bool IsPCPartyMinion
Definition: Card.cs:2156
void ClearFOV()
Definition: Card.cs:6741
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:6352
virtual bool IsPCFaction
Definition: Card.cs:2272
void SpawnLoot(Card origin)
Definition: Card.cs:5147
int LV
Definition: Card.cs:387
virtual bool isSynced
Definition: Card.cs:2088
static Chara CreateFromFilter(string id, int lv=-1, int levelRange=-1)
Definition: CharaGen.cs:22
int combatCount
Definition: Chara.cs:116
bool IsHuman
Definition: Chara.cs:881
int daysStarved
Definition: Chara.cs:331
void MakeMinion(Chara _master, MinionType type=MinionType.Default)
Definition: Chara.cs:2373
string NameBraced
Definition: Chara.cs:516
void ClearTempElements()
Definition: Chara.cs:10391
string TalkTopic(string topic="calm")
Definition: Chara.cs:6986
void TryDropBossLoot()
Definition: Chara.cs:5662
bool IsLocalChara
Definition: Chara.cs:843
Chara enemy
Definition: Chara.cs:86
bool IsInActiveZone
Definition: Chara.cs:840
void TryDropCarryOnly()
Definition: Chara.cs:4609
void MakeGrave(string lastword)
Definition: Chara.cs:5265
UD_String_MatData matColors
static ColorProfile Colors
Definition: EClass.cs:39
void RemoveMemeber(Chara c)
string Log(string idLang, string ref1=null, string ref2=null, string ref3=null, string ref4=null)
static string Parse(string text, bool thirdPerson, string val1, string val2=null, string val3=null, string val4=null)
Definition: GameLang.cs:141
ConfigAutoCombat autoCombat
Definition: Game.cs:94
CardManager cards
Definition: Game.cs:156
static bool Has(string id)
Definition: LangGame.cs:46
List< Chara > deadCharas
Definition: Map.cs:46
static ThirstPersonInfo thirdPerson1
Definition: Msg.cs:6
bool HasElement(int ele, bool excludePC=false)
Definition: Party.cs:194
void RemoveMember(Chara c)
Definition: Party.cs:102
int allyDeath
Definition: Player.cs:111
void ModKarma(int a)
Definition: Player.cs:2518
Stats stats
Definition: Player.cs:1016
int little_dead
Definition: Player.cs:926
HashSet< int > doneBackers
Definition: Player.cs:1073
bool TryAbortAutoCombat(bool immediate=true)
Definition: Player.cs:2412
string deathMsg
Definition: Player.cs:1185
void TalkWitnesses(Chara criminal, string idTalk, int radius=4, WitnessType type=WitnessType.everyone, Func< Chara, bool > talkIf=null, int chance=3)
Definition: Point.cs:815
List< Card > sales
Definition: PropsManager.cs:14
static Religion recentWrath
Definition: Religion.cs:22
void Revelation(string idTalk, int chance=100)
Definition: Religion.cs:145
string NameShort
Definition: Religion.cs:34
Thing Find(int uid)
void Set(string n)
static void Reserve(string idStep, Action onBeforePlay=null)
Definition: Tutorial.cs:55
static void Say(string text, FontColor fontColor=FontColor.Default, Sprite sprite=null)
void OnCharaDie(Chara c)
void RefreshDeathSentense()
Definition: Zone.cs:1113
virtual bool HasLaw
Definition: Zone.cs:229
void RemoveCard(Card t)
Definition: Zone.cs:2032
void ResetHostility()
Definition: Zone.cs:2711
ZoneInstance instance
Definition: Zone.cs:55

References EClass._map, EClass._zone, ConfigAutoCombat.abortOnAllyDead, ConfigAutoCombat.abortOnEnemyDead, Zone.AddCard(), AddCondition(), Player.Stats.allyDeath, Game.Config.autoCombat, Game.cards, Map.charas, EClass.Colors, Game.config, CharaGen.Create(), CharaGen.CreateFromFilter(), Map.deadCharas, Player.deathMsg, Debug, Player.doneBackers, enemy, Zone.events, faith, ThingContainer.Find(), CardManager.GlobalCharaList.Find(), EClass.game, Effect.Get(), CardManager.globalCharas, LangGame.Has(), Party.HasElement(), Zone.HasLaw, SourceRace.Row.id, Zone.instance, IsHostile(), IsPCParty, Card.IsUnique, Player.little_dead, FactionBranch.Log(), Card.LV, MakeMinion(), ColorProfile.matColors, ModAffinity(), Player.ModKarma(), Spatial.Name, NameBraced, Religion.NameShort, ZoneEventManager.OnCharaDie(), OriginalHostility, GameLang.Parse(), party, EClass.pc, Effect.Play(), EClass.player, ActEffect.ProcAt(), Map.props, Religion.recentWrath, Zone.RefreshDeathSentense(), Party.RemoveMember(), FactionBranch.RemoveMemeber(), Tutorial.Reserve(), Zone.ResetHostility(), Religion.Revelation(), EClass.rnd(), PropsManager.sales, Msg.Say(), Card.Say(), WidgetPopText.Say(), ThirstPersonInfo.Set(), Msg.SetColor(), Card.SetLv(), AI_Slaughter.slaughtering, CellEffect.source, Player.stats, Card.things, Msg.thirdPerson1, Player.TryAbortAutoCombat(), ActRide.Unride(), and Element.Void.

Referenced by ActMelee.Attack(), ActEffect.ProcAt(), TaskCullLife.Run(), and ConDeathSentense.Tick().

◆ DiminishTempElements()

void Chara.DiminishTempElements ( int  a = 1)
inline

Definition at line 10346 of file Chara.cs.

10347 {
10348 if (tempElements == null)
10349 {
10350 return;
10351 }
10352 foreach (Element item in tempElements.dict.Values.ToList())
10353 {
10354 if (item.vBase > 0)
10355 {
10356 ModTempElement(item.id, -Mathf.Min(item.vBase * 5 / 100 + 1, item.vBase), naturalDecay: true);
10357 }
10358 }
10359 }

References ElementContainer.dict, and item.

◆ DoAI()

void Chara.DoAI ( int  wait,
Action  onPerform 
)
inline

Definition at line 6252 of file Chara.cs.

6253 {
6254 SetAI(new DynamicAIAct("", delegate
6255 {
6256 onPerform();
6257 return true;
6258 })
6259 {
6260 wait = wait
6261 });
6262 }

◆ DoHostileAction()

void Chara.DoHostileAction ( Card  _tg,
bool  immediate = false 
)
inline

Definition at line 6352 of file Chara.cs.

6353 {
6354 if (_tg == null || !_tg.isChara)
6355 {
6356 return;
6357 }
6358 Chara chara = _tg.Chara;
6359 if (chara.IsPC)
6360 {
6361 EClass.pc.combatCount = 10;
6362 }
6363 if (!chara.IsAliveInCurrentZone || !IsAliveInCurrentZone || chara == this)
6364 {
6365 return;
6366 }
6367 if ((IsPCFaction || IsPCFactionMinion) && (chara.IsPCFaction || chara.IsPCFactionMinion))
6368 {
6369 chara.Say("frown", this, chara);
6370 }
6371 else
6372 {
6373 if (EClass._zone.IsRegion)
6374 {
6375 return;
6376 }
6377 if (IsPC)
6378 {
6379 if (chara.IsFriendOrAbove() && !immediate)
6380 {
6381 chara.Say("frown", this, chara);
6382 chara.ShowEmo(Emo.sad);
6383 chara.hostility = Hostility.Neutral;
6384 return;
6385 }
6386 if (!chara.IsPCFaction && chara.hostility >= Hostility.Neutral && !EClass._zone.IsPCFaction)
6387 {
6388 bool flag = chara.id == "fanatic";
6389 if (EClass.rnd(4) == 0 || flag)
6390 {
6391 chara.Say("callHelp", chara);
6392 chara.CallHelp(this, flag);
6393 }
6394 }
6395 if (chara.hostility <= Hostility.Enemy)
6396 {
6397 foreach (Chara member in EClass.pc.party.members)
6398 {
6399 if (member != EClass.pc && member.enemy == null && member.CanSee(chara))
6400 {
6401 member.SetEnemy(chara);
6402 }
6403 }
6404 }
6405 }
6406 else if (chara.IsPC && hostility <= Hostility.Enemy)
6407 {
6408 foreach (Chara member2 in EClass.pc.party.members)
6409 {
6410 if (member2 != EClass.pc && member2.enemy == null && member2.CanSee(this))
6411 {
6412 member2.SetEnemy(this);
6413 }
6414 }
6415 }
6416 if (chara.calmCheckTurn <= 0 || IsPC)
6417 {
6418 chara.calmCheckTurn = (IsPC ? (20 + EClass.rnd(30)) : (10 + EClass.rnd(10)));
6419 }
6420 if (hostility != Hostility.Enemy || chara.hostility != Hostility.Enemy)
6421 {
6422 GoHostile(chara);
6423 chara.GoHostile(this);
6424 if (base.isHidden && !chara.CanSee(this) && !chara.IsDisabled && !chara.IsPCParty && !chara.IsPCPartyMinion && EClass.rnd(10 + Dist(chara) * 10) == 0)
6425 {
6426 Thing t = ThingGen.Create("49");
6427 ActThrow.Throw(chara, pos, t);
6428 Act.TC = chara;
6429 }
6430 }
6431 }
6432 }
static EffectIRenderer Throw(Card c, Point p, Thing t, ThrowMethod method=ThrowMethod.Default, float failChance=0f)
Definition: ActThrow.cs:97
override bool IsAliveInCurrentZone
Definition: Chara.cs:563
override bool IsPCPartyMinion
Definition: Chara.cs:641
int calmCheckTurn
Definition: Chara.cs:118
bool CanSee(Card c)
Definition: Chara.cs:1232
override bool IsPCFactionMinion
Definition: Chara.cs:657
bool IsFriendOrAbove()
Definition: Chara.cs:6629
Chara SetEnemy(Chara c=null)
Definition: Chara.cs:6303
void CallHelp(Chara tg, bool fanatic=false)
Definition: Chara.cs:6434
Hostility hostility
Definition: Chara.cs:293
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53

References EClass._zone, CallHelp(), calmCheckTurn, CanSee(), Card.Chara, ThingGen.Create(), enemy, GoHostile(), hostility, IsAliveInCurrentZone, Card.isChara, IsDisabled, IsFriendOrAbove(), IsPC, IsPCFaction, Zone.IsPCFaction, IsPCFactionMinion, IsPCParty, IsPCPartyMinion, Spatial.IsRegion, Party.members, party, EClass.pc, EClass.rnd(), Card.Say(), SetEnemy(), Card.ShowEmo(), and ActThrow.Throw().

Referenced by Card.ApplyElementEffect(), ActMelee.Attack(), Point.CallGuard(), ActEffect.DamageEle(), ActTelekinesis.DoDamage(), DramaOutcome.event_az3(), DramaOutcome.fiama_starter_gift(), AI_Fuck.Finish(), ActRanged.Perform(), ActSummonGuard.Perform(), ActWater.Perform(), ActEffect.Proc(), ConTransmuteMimic.RevealMimicry(), AI_AttackHome.Run(), AI_Fuck.Run(), AI_Idle.Run(), GoalSiege.Run(), and ActThrow.Throw().

◆ Drink()

void Chara.Drink ( Card  t)
inline

Definition at line 5142 of file Chara.cs.

5143 {
5144 Say("drink", this, t.Duplicate(1));
5145 Say("quaff");
5146 PlaySound("drink");
5147 hunger.Mod(-2);
5148 t.ModNum(-1);
5149 t.trait.OnDrink(this);
5150 _ = IsPC;
5151 }
Thing Duplicate(int num)
Definition: Card.cs:3473
void ModNum(int a, bool notify=true)
Definition: Card.cs:3544
Stats hunger
Definition: Chara.cs:1156
virtual void OnDrink(Chara c)
Definition: Trait.cs:1014

References Card.Duplicate(), Stats.Mod(), Card.ModNum(), Trait.OnDrink(), and Card.trait.

Referenced by TraitDrink.GetHealAction(), AM_Adv.OnBecomeNoGoal(), AI_Drink.OnSetOwner(), AI_Drink.Run(), and AI_Idle.Run().

◆ DropHeld()

Card Chara.DropHeld ( Point  dropPos = null)
inline

Definition at line 4621 of file Chara.cs.

4622 {
4623 if (held == null)
4624 {
4625 return null;
4626 }
4627 if (IsPC)
4628 {
4629 WidgetHotbar.dirtyCurrentItem = true;
4631 }
4632 Card card = EClass._zone.AddCard(held, dropPos ?? pos);
4633 card.OnLand();
4634 if (card.trait.CanOnlyCarry)
4635 {
4636 card.SetPlaceState(PlaceState.installed);
4637 }
4638 return card;
4639 }
PlaceState
Definition: PlaceState.cs:2
Card held
Definition: Chara.cs:70
static void SetDirty(Thing t)

References EClass._zone, Zone.AddCard(), card, LayerInventory.SetDirty(), and Card.Thing.

Referenced by Card.Destroy(), TaskMoveInstalled.OnProgressComplete(), AI_Cook.Run(), AI_Offer.Run(), AI_ReleaseHeld.Run(), and AIAct.Start().

◆ DropThing()

void Chara.DropThing ( Thing  t,
int  num = -1 
)
inline

Definition at line 4641 of file Chara.cs.

4642 {
4643 if (t.c_isImportant)
4644 {
4645 Msg.Say("markedImportant");
4646 return;
4647 }
4648 if (!t.trait.CanBeDropped)
4649 {
4650 Msg.Say("cantDrop", t);
4651 return;
4652 }
4653 if (t.trait is TraitAbility)
4654 {
4655 SE.Trash();
4656 t.Destroy();
4657 return;
4658 }
4659 Msg.Say("dropItem", t.Name);
4660 t.ignoreAutoPick = true;
4661 PlaySound("drop");
4662 EClass._zone.AddCard(t, pos);
4663 if (t.trait.CanOnlyCarry)
4664 {
4665 t.Install();
4666 }
4667 }
Card Install()
Definition: Card.cs:3770
virtual bool CanBeDropped
Definition: Trait.cs:313

References EClass._zone, Zone.AddCard(), Card.c_isImportant, Trait.CanBeDropped, Trait.CanOnlyCarry, Card.Destroy(), Card.Install(), Card.Name, Msg.Say(), and Card.trait.

Referenced by ActPlan._Update(), InvOwner.OnAltClick(), and InvOwner.OnDrag().

◆ Duplicate()

Chara Chara.Duplicate ( )
inline

Definition at line 1805 of file Chara.cs.

1806 {
1807 Chara chara = CharaGen.Create(id);
1808 chara.mana.value = mana.value;
1809 chara.stamina.value = stamina.value;
1810 foreach (KeyValuePair<int, Element> item in elements.dict)
1811 {
1812 Element orCreateElement = chara.elements.GetOrCreateElement(item.Key);
1813 orCreateElement.vBase = item.Value.ValueWithoutLink - orCreateElement.vSource;
1814 }
1815 chara.SetFaith(faith);
1816 chara.bio = IO.DeepCopy(bio);
1817 chara.LV = base.LV;
1818 chara.c_daysWithGod = base.c_daysWithGod;
1819 chara.RefreshFaithElement();
1820 chara.hp = (int)Mathf.Clamp((float)chara.MaxHP * ((float)base.hp / (float)MaxHP) * 0.99f, 0f, chara.MaxHP);
1821 chara.isCopy = true;
1822 chara.isScaled = base.isScaled;
1823 if (HaveFur())
1824 {
1825 chara.c_fur = -1;
1826 }
1827 return chara;
1828 }
bool HaveFur()
Definition: Card.cs:8052
Stats mana
Definition: Chara.cs:1168
void RefreshFaithElement()
Definition: Chara.cs:10226
void SetFaith(string id)
Definition: Chara.cs:1727
Element GetOrCreateElement(Element ele)
int vSource
Definition: ELEMENT.cs:267
Definition: IO.cs:11
virtual int value
Definition: Stats.cs:56

References Card.bio, CharaGen.Create(), ElementContainer.dict, Card.elements, faith, Card.HaveFur(), item, mana, MaxHP, stamina, Stats.value, and Element.vSource.

Referenced by ActEffect.Proc(), and AI_Idle.Run().

◆ EnhanceTempElement()

void Chara.EnhanceTempElement ( int  ele,
int  p,
bool  onlyRenew = false 
)
inline

Definition at line 10341 of file Chara.cs.

10342 {
10343 ModTempElement(ele, onlyRenew ? (p / 20) : (p / 100 + EClass.rnd(p / 100 + 1)), naturalDecay: false, onlyRenew);
10344 }

References EClass.rnd().

◆ EnhanceTempElements()

void Chara.EnhanceTempElements ( int  p,
bool  body,
bool  mind,
bool  onlyRenew = false 
)
inline

Definition at line 10332 of file Chara.cs.

10333 {
10334 int[] array = (body ? Element.List_Body : Element.List_Mind);
10335 foreach (int ele in array)
10336 {
10337 EnhanceTempElement(ele, p, onlyRenew);
10338 }
10339 }
void EnhanceTempElement(int ele, int p, bool onlyRenew=false)
Definition: Chara.cs:10341

References Element.List_Mind.

◆ EQ_CAT()

void Chara.EQ_CAT ( string  s)
inline

Definition at line 5119 of file Chara.cs.

5120 {
5121 int slot = EClass.sources.categories.map[s].slot;
5122 BodySlot bodySlot = ((slot == 0) ? null : body.GetSlot(slot));
5123 if ((slot == 0 || bodySlot != null) && (slot != 37 || !HasElement(1209)))
5124 {
5125 SetEQQuality();
5126 Thing thing = ThingGen.CreateFromCategory(s, base.LV);
5127 AddThing(thing);
5128 if (bodySlot != null && !body.Equip(thing, bodySlot))
5129 {
5130 thing.Destroy();
5131 }
5132 }
5133 }
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:3127
bool Equip(Thing thing, BodySlot slot=null, bool msg=true)
Definition: CharaBody.cs:186
BodySlot GetSlot(Thing t, bool onlyEmpty=false, bool secondSlot=false)
Definition: CharaBody.cs:354
void SetEQQuality()
Definition: Chara.cs:5066
SourceCategory categories
static Thing CreateFromCategory(string idCat, int lv=-1)
Definition: ThingGen.cs:75

References SourceManager.categories, ThingGen.CreateFromCategory(), Card.Destroy(), CharaBody.Equip(), CharaBody.GetSlot(), and EClass.sources.

Referenced by ZonePreEnterBoutWin.Execute(), and CoreDebug.QuickStart().

◆ EQ_ID()

Thing Chara.EQ_ID ( string  s,
int  mat = -1,
Rarity  r = Rarity::Random 
)
inline

Definition at line 5099 of file Chara.cs.

5100 {
5101 SetEQQuality();
5102 if (r != Rarity.Random)
5103 {
5104 CardBlueprint.current.rarity = r;
5105 }
5106 Thing thing = ThingGen.Create(s, mat, base.LV);
5107 if (body.GetSlot(thing, onlyEmpty: true) == null)
5108 {
5109 return thing;
5110 }
5111 AddThing(thing);
5112 if (!body.Equip(thing))
5113 {
5114 thing.Destroy();
5115 }
5116 return thing;
5117 }

References ThingGen.Create(), Card.Destroy(), CharaBody.Equip(), and CharaBody.GetSlot().

Referenced by Card.ApplyBacker(), and Player.CreateEquip().

◆ EQ_Item()

void Chara.EQ_Item ( string  s,
int  num = 1 
)
inline

Definition at line 5135 of file Chara.cs.

5136 {
5137 SetEQQuality();
5138 Thing t = ThingGen.Create(s, -1, base.LV).SetNum(num);
5139 AddThing(t);
5140 }
Thing SetNum(int a)
Definition: Card.cs:3524

References ThingGen.Create(), and Card.SetNum().

◆ EvalueRiding()

int Chara.EvalueRiding ( )
inline

Definition at line 6163 of file Chara.cs.

6164 {
6165 if (ride != null && ride.HasCondition<ConTransmuteBroom>() && HasElement(1417))
6166 {
6167 return 25 + Evalue(226) * 125 / 100;
6168 }
6169 return Evalue(226);
6170 }

References HasCondition().

Referenced by CalcCastingChance(), AttackProcess.Prepare(), and RefreshSpeed().

◆ FallFromZone()

void Chara.FallFromZone ( )
inline

Definition at line 3516 of file Chara.cs.

3517 {
3518 Msg.Say("skyFall", EClass.pc, EClass._zone.Name);
3519 Zone zone = (EClass._zone.isExternalZone ? null : EClass._zone.GetTopZone().FindZone(EClass._zone.lv - 1));
3520 zone = zone ?? EClass.world.region;
3522 {
3523 state = ZoneTransition.EnterState.Fall,
3524 x = pos.x,
3525 z = pos.z
3526 });
3527 }
void MoveZone(string alias)
Definition: Chara.cs:3331
int lv
Definition: Spatial.cs:142
Zone FindZone(int lv)
Definition: Spatial.cs:728
Region region
Definition: World.cs:23
Definition: Zone.cs:12
Zone GetTopZone()
Definition: Zone.cs:1948

References EClass._zone, Spatial.FindZone(), Zone.GetTopZone(), Spatial.lv, Spatial.Name, EClass.pc, World.region, Msg.Say(), and EClass.world.

Referenced by ActPlan._Update(), and TaskDig.OnProgressComplete().

◆ FindAmmo()

Thing Chara.FindAmmo ( Thing  weapon)
inline

Definition at line 7840 of file Chara.cs.

7841 {
7842 TraitToolRange ranged = weapon.trait as TraitToolRange;
7843 Thing thing = (IsPC ? EClass.pc.things.Find<TraitQuiver>() : null);
7844 if (thing != null)
7845 {
7846 Thing thing2 = thing.things.Find((Thing t) => ranged.IsAmmo(t));
7847 if (thing2 != null)
7848 {
7849 return thing2;
7850 }
7851 }
7852 return things.Find((Thing t) => ranged.IsAmmo(t));
7853 }
bool IsAmmo
Definition: Card.cs:2250
Thing ranged
Definition: Chara.cs:98

References ThingContainer.Find(), TraitToolRange.IsAmmo(), EClass.pc, and Card.things.

Referenced by ActRanged.TryReload(), and GoalAutoCombat.TryUseRanged().

◆ FindBed()

TraitBed Chara.FindBed ( )
inline

Definition at line 7339 of file Chara.cs.

7340 {
7341 foreach (Card item in EClass._map.props.installed.all)
7342 {
7343 if (item.trait is TraitBed traitBed && traitBed.IsHolder(this))
7344 {
7345 return traitBed;
7346 }
7347 }
7348 return null;
7349 }

References EClass._map, Props.all, PropsManager.installed, TraitBed.IsHolder(), item, and Map.props.

Referenced by Hobby.GetEfficiency(), ListPeopleBed.OnClick(), BaseListPeople.OnInstantiate(), ListPeopleBed.OnInstantiate(), GoalSleep.OnSimulatePosition(), AI_Idle.Run(), GoalSleep.Run(), and GoalVisitorGuest.Run().

◆ FindBestFoodToEat()

Thing Chara.FindBestFoodToEat ( )
inline

Definition at line 7571 of file Chara.cs.

7572 {
7573 Thing result = null;
7574 int num = -1;
7575 if (IsPC)
7576 {
7577 return null;
7578 }
7579 foreach (Thing item in things.List((Thing t) => CanEat(t, shouldEat: true) && !t.c_isImportant, onlyAccessible: true))
7580 {
7581 int num2 = CountNumEaten(item);
7582 int num3 = 100 - num2 + (item.HasElement(757) ? 10 : 0);
7583 if (num3 > num)
7584 {
7585 result = item;
7586 num = num3;
7587 }
7588 }
7589 return result;
7590 }
bool CanEat(Thing t, bool shouldEat=false)
Definition: Chara.cs:7617
int CountNumEaten(Thing food)
Definition: Chara.cs:10197
List< Thing > List(Func< Thing, bool > func, bool onlyAccessible=false)

References Card.c_isImportant, and item.

Referenced by AI_Idle.Run().

◆ FindMaster()

Chara Chara.FindMaster ( )
inline

Definition at line 2419 of file Chara.cs.

2420 {
2421 if (IsMinion)
2422 {
2423 master = EClass._map.FindChara(base.c_uidMaster);
2424 }
2425 return master;
2426 }
Chara master
Definition: Chara.cs:88
Chara FindChara(string id)
Definition: Map.cs:2568

References EClass._map, Map.FindChara(), IsMinion, and master.

Referenced by MoveZone(), and AI_Idle.Run().

◆ FindNearestNewEnemy()

bool Chara.FindNearestNewEnemy ( )
inline

Definition at line 6518 of file Chara.cs.

6519 {
6520 for (int i = 0; i < EClass._map.charas.Count; i++)
6521 {
6522 Chara chara = EClass._map.charas[i];
6523 if (chara != this && chara != enemy && chara.mimicry == null && IsHostile(chara) && Dist(chara) <= 1 && CanInteractTo(chara.pos))
6524 {
6525 DoHostileAction(chara);
6526 enemy = chara;
6527 return true;
6528 }
6529 }
6530 return false;
6531 }
ConTransmuteMimic mimicry
Definition: Chara.cs:106
void DoHostileAction(Card _tg, bool immediate=false)
Definition: Chara.cs:6352

References EClass._map, Map.charas, mimicry, and Card.pos.

Referenced by AM_Adv._OnUpdateInput(), AI_Trolley.Run(), and GoalCombat.Run().

◆ FindNewEnemy()

bool Chara.FindNewEnemy ( )
inline

Definition at line 6445 of file Chara.cs.

6446 {
6447 if (EClass._zone.isPeace && base.IsPCFactionOrMinion && !IsPC)
6448 {
6449 return false;
6450 }
6451 if (enemy != null && !enemy.IsAliveInCurrentZone)
6452 {
6453 enemy = null;
6454 }
6455 if (enemy != null)
6456 {
6457 return false;
6458 }
6459 if (IsPCParty && EClass.pc.isHidden && base.isHidden)
6460 {
6461 return false;
6462 }
6463 if (mimicry != null)
6464 {
6465 return false;
6466 }
6467 bool flag = enemy != null || ai is GoalCombat;
6468 int num = (base.PER + Evalue(210) * 2) * ((!flag) ? 1 : 2);
6469 bool flag2 = IsPCParty && !IsPC && EClass.game.config.tactics.dontWander;
6470 bool flag3 = !IsPCParty;
6471 Chara chara = null;
6472 int num2 = 9999;
6473 for (int i = 0; i < EClass._map.charas.Count; i++)
6474 {
6475 Chara chara2 = EClass._map.charas[i];
6476 if (chara2 == this || !IsHostile(chara2) || !CanSee(chara2) || chara2.mimicry != null)
6477 {
6478 continue;
6479 }
6480 int num3 = Dist(chara2);
6481 int num4 = GetSightRadius() + (flag ? 1 : 0);
6482 if (num3 > num4)
6483 {
6484 continue;
6485 }
6486 if (flag3 && EClass.rnd(chara2.Evalue(152) + 5) * (100 + num3 * num3 * 10) / 100 > EClass.rnd(num))
6487 {
6488 if (this == pos.FirstChara)
6489 {
6490 chara2.ModExp(152, Mathf.Clamp((num - chara2.Evalue(152)) / 2, 1, Mathf.Max(30 - stealthSeen * 2, 1)));
6491 }
6492 stealthSeen++;
6493 }
6494 else if (CanSeeLos(chara2) && (!flag2 || EClass.pc.isBlind || EClass.pc.CanSeeLos(chara2)) && (!IsPCFaction || EClass.pc.ai.ShouldAllyAttack(chara2)))
6495 {
6496 if (!IsPCParty)
6497 {
6498 DoHostileAction(chara2);
6499 enemy = chara2;
6500 return true;
6501 }
6502 if (num3 < num2)
6503 {
6504 num2 = num3;
6505 chara = chara2;
6506 }
6507 }
6508 }
6509 if (chara != null)
6510 {
6511 DoHostileAction(chara);
6512 enemy = chara;
6513 return true;
6514 }
6515 return false;
6516 }
virtual bool ShouldAllyAttack(Chara tg)
Definition: AIAct.cs:134
int stealthSeen
Definition: Chara.cs:190
bool isPeace
Definition: Spatial.cs:406

References EClass._map, EClass._zone, ai, CanSeeLos(), Map.charas, Game.config, ConfigTactics.dontWander, Card.Evalue(), EClass.game, IsAliveInCurrentZone, Card.isHidden, Spatial.isPeace, Card.ModExp(), EClass.pc, EClass.rnd(), AIAct.ShouldAllyAttack(), and Game.Config.tactics.

Referenced by GoalCombat.Run().

◆ FindRoom()

Room Chara.FindRoom ( )
inline

Definition at line 7955 of file Chara.cs.

7956 {
7957 return FindBed()?.owner.pos.cell.room;
7958 }
TraitBed FindBed()
Definition: Chara.cs:7339

Referenced by GoalWork.FindWork(), BaseListPeople.OnInstantiate(), GoalWork.OnSimulatePosition(), AI_Idle.Run(), and GoalWork.ValidateHobby().

◆ GainAbility()

void Chara.GainAbility ( int  ele,
int  mtp = 100,
Thing  origin = null 
)
inline

Definition at line 10112 of file Chara.cs.

10113 {
10114 Element orCreateElement = elements.GetOrCreateElement(ele);
10115 if (orCreateElement.ValueWithoutLink == 0)
10116 {
10117 elements.ModBase(orCreateElement.id, 1);
10118 }
10119 if (orCreateElement is Spell)
10120 {
10121 int num = EClass.curve(Evalue(307), 50, 20) + (HasElement(307) ? 20 : 0);
10122 int num2 = origin?.Evalue(765) ?? 0;
10123 num = num * (100 - num2) / 100;
10124 int a = mtp * orCreateElement.source.charge * (100 + num) / 100 / 100;
10125 a = Mathf.Max(1, EClass.rndHalf(a));
10126 if (orCreateElement.source.charge == 1)
10127 {
10128 a = 1;
10129 }
10130 orCreateElement.vPotential += a;
10131 }
10132 Say("spell_gain", this, orCreateElement.Name);
10133 LayerAbility.SetDirty(orCreateElement);
10134 }
Element ModBase(int ele, int v)
virtual string Name
Definition: ELEMENT.cs:309
static void SetDirty(Element a)

References EClass.curve(), Element.id, Element.Name, EClass.rndHalf(), LayerAbility.SetDirty(), Element.source, and Element.ValueWithoutLink.

Referenced by Player.DreamSpell(), AI_Fuck.Finish(), and TraitBaseSpellbook.OnRead().

◆ GetActionText()

string Chara.GetActionText ( )
inline

Definition at line 7283 of file Chara.cs.

7284 {
7285 string result = "?????";
7286 if (ai != null)
7287 {
7288 result = ai.GetCurrentActionText();
7289 }
7290 return result;
7291 }
string GetCurrentActionText()
Definition: AIAct.cs:157

References AIAct.GetCurrentActionText().

Referenced by ListPeopleEmbark.OnInstantiate().

◆ GetArmorSkill()

override int Chara.GetArmorSkill ( )
inlinevirtual

Reimplemented from Card.

Definition at line 7890 of file Chara.cs.

7891 {
7892 if (body.GetWeight(armorOnly: true) <= (HasElement(1204) ? 6000 : 30000))
7893 {
7894 return 120;
7895 }
7896 return 122;
7897 }
int GetWeight(bool armorOnly=false)
Definition: CharaBody.cs:421

References CharaBody.GetWeight().

Referenced by WindowCharaMini.Refresh(), and WindowChara.RefreshProfile().

◆ GetBestRangedWeapon()

Thing Chara.GetBestRangedWeapon ( )
inline

Definition at line 7855 of file Chara.cs.

7856 {
7857 Thing result = null;
7858 int num = 0;
7859 foreach (Thing thing in things)
7860 {
7861 if (thing.IsRangedWeapon && CanEquipRanged(thing) && thing.GetEquipValue() > num)
7862 {
7863 num = thing.GetEquipValue();
7864 result = thing;
7865 }
7866 }
7867 return result;
7868 }
int GetEquipValue()
Definition: Card.cs:7348
bool IsRangedWeapon
Definition: Card.cs:2246
bool CanEquipRanged(Thing t)
Definition: Chara.cs:7789

References Card.GetEquipValue(), and Card.IsRangedWeapon.

◆ GetBuffStats() [1/2]

Element Chara.GetBuffStats ( int  ele)
inline

Definition at line 9451 of file Chara.cs.

9452 {
9453 for (int i = 0; i < conditions.Count; i++)
9454 {
9455 if (conditions[i] is ConBuffStats conBuffStats && conBuffStats.refVal == ele)
9456 {
9457 return conBuffStats.elements.GetElement(ele);
9458 }
9459 }
9460 return null;
9461 }

References BaseCondition.refVal.

◆ GetBuffStats() [2/2]

Element Chara.GetBuffStats ( string  alias)
inline

Definition at line 9446 of file Chara.cs.

9447 {
9448 return GetBuffStats(EClass.sources.elements.alias[alias].id);
9449 }
Element GetBuffStats(string alias)
Definition: Chara.cs:9446

References SourceManager.elements, and EClass.sources.

Referenced by GoalCombat.TryUseAbility().

◆ GetBurden()

int Chara.GetBurden ( Card  t = null,
int  num = -1 
)
inline

Definition at line 1830 of file Chara.cs.

1831 {
1832 int num2 = (base.ChildrenWeight + ((t != null) ? ((num == -1) ? t.ChildrenAndSelfWeight : (t.SelfWeight * num)) : 0)) * 100 / WeightLimit;
1833 if (num2 < 0)
1834 {
1835 num2 = 1000;
1836 }
1838 {
1839 num2 = 0;
1840 }
1841 int num3 = ((num2 >= 100) ? ((num2 - 100) / 10 + 1) : 0);
1842 if (num3 > 9)
1843 {
1844 num3 = 9;
1845 }
1846 return num3;
1847 }

References EClass.debug, CoreDebug.ignoreWeight, IsPC, and WeightLimit.

◆ GetCondition< T >()

override T Chara.GetCondition< T > ( )
inlinevirtual

Reimplemented from Card.

Definition at line 9489 of file Chara.cs.

9490 {
9491 for (int i = 0; i < conditions.Count; i++)
9492 {
9493 if (conditions[i] is T)
9494 {
9495 return conditions[i] as T;
9496 }
9497 }
9498 return null;
9499 }

◆ GetCooldown()

int Chara.GetCooldown ( int  idEle)
inline

Definition at line 8740 of file Chara.cs.

8741 {
8742 if (_cooldowns != null)
8743 {
8744 for (int i = 0; i < _cooldowns.Count; i++)
8745 {
8746 if (_cooldowns[i] / 1000 == idEle)
8747 {
8748 return _cooldowns[i] % 1000;
8749 }
8750 }
8751 }
8752 return 0;
8753 }

Referenced by NotificationCooldown.OnRefresh().

◆ GetCurrentDir()

int Chara.GetCurrentDir ( )
inline

Definition at line 3636 of file Chara.cs.

3637 {
3638 Debug.Log(angle);
3639 if (!renderer.hasActor)
3640 {
3641 if (angle == 0f || angle == 45f || angle == 90f)
3642 {
3643 return 2;
3644 }
3645 if (angle == -135f || angle == 180f || angle == -90f)
3646 {
3647 return 1;
3648 }
3649 if (angle == 135f)
3650 {
3651 return 0;
3652 }
3653 return 3;
3654 }
3655 return renderer.actor.currentDir;
3656 }
virtual int currentDir
Definition: CardActor.cs:41
float angle
Definition: Card.cs:72

References Debug.

Referenced by Player.EnterLocalZone(), and LayerTravel.Refresh().

◆ GetDestination()

Point Chara.GetDestination ( )
inline

Definition at line 7258 of file Chara.cs.

7259 {
7260 return (ai.IsRunning ? ai.GetDestination() : pos).Copy();
7261 }
virtual bool IsRunning
Definition: AIAct.cs:31
virtual Point GetDestination()
Definition: AIAct.cs:139

References Point.Copy(), AIAct.GetDestination(), and AIAct.IsRunning.

Referenced by AI_Idle.Run().

◆ GetFavArmorSkill()

Element Chara.GetFavArmorSkill ( )
inline

Definition at line 4694 of file Chara.cs.

4695 {
4696 if (elements.Value(122) > elements.Value(120))
4697 {
4698 return elements.GetElement(122);
4699 }
4700 return elements.GetElement(120);
4701 }
int Value(int ele)

Referenced by WindowChara.RefreshEquipment(), and WindowChara.RefreshNote().

◆ GetFavAttackStyle()

AttackStyle Chara.GetFavAttackStyle ( )
inline

Definition at line 4669 of file Chara.cs.

4670 {
4671 int num = Evalue(131);
4672 int num2 = Evalue(130);
4673 int num3 = Evalue(123);
4674 if (num > num2 && num > num3)
4675 {
4676 return AttackStyle.TwoWield;
4677 }
4678 if (num2 > num && num2 > num3)
4679 {
4680 return AttackStyle.TwoHand;
4681 }
4682 if (num3 > num && num3 > num2)
4683 {
4684 return AttackStyle.Shield;
4685 }
4686 return AttackStyle.Default;
4687 }

Referenced by WindowChara.RefreshNote().

◆ GetFavCat()

SourceCategory.Row Chara.GetFavCat ( )
inline

Definition at line 8079 of file Chara.cs.

8080 {
8081 SourceCategory.Row r = null;
8082 if (_listFavCat.Count == 0)
8083 {
8084 foreach (SourceCategory.Row row in EClass.sources.categories.rows)
8085 {
8086 if (row.gift > 0)
8087 {
8088 _listFavCat.Add(row);
8089 }
8090 }
8091 }
8092 Rand.UseSeed(base.uid + EClass.game.seed, delegate
8093 {
8094 r = _listFavCat.RandomItem();
8095 });
8096 return r;
8097 }
static List< SourceCategory.Row > _listFavCat
Definition: Chara.cs:196
int seed
Definition: Game.cs:201
Definition: Rand.cs:4
static void UseSeed(int seed, Action action)
Definition: Rand.cs:22

References SourceManager.categories, EClass.game, Game.seed, EClass.sources, and Rand.UseSeed().

Referenced by DramaCustomSequence.Build(), Affinity.OnGift(), WindowChara.RefreshNote(), DramaActor.Talk(), and ConSleep.Tick().

◆ GetFavFood()

SourceThing.Row Chara.GetFavFood ( )
inline

Definition at line 8059 of file Chara.cs.

8060 {
8061 if (_listFavFood.Count == 0)
8062 {
8063 foreach (SourceThing.Row row in EClass.sources.things.rows)
8064 {
8065 if (row._origin == "dish" && row.value != 0 && row.chance != 0)
8066 {
8067 _listFavFood.Add(row);
8068 }
8069 }
8070 }
8071 SourceThing.Row r = null;
8072 Rand.UseSeed(base.uid + EClass.game.seed, delegate
8073 {
8074 r = _listFavFood.RandomItem();
8075 });
8076 return r;
8077 }
static List< SourceThing.Row > _listFavFood
Definition: Chara.cs:194
SourceThing things

References EClass.game, Game.seed, EClass.sources, SourceManager.things, and Rand.UseSeed().

Referenced by DramaCustomSequence.Build(), Affinity.OnGift(), FoodEffect.Proc(), WindowChara.RefreshNote(), DramaActor.Talk(), and ConSleep.Tick().

◆ GetFavWeaponSkill()

Element Chara.GetFavWeaponSkill ( )
inline

Definition at line 4689 of file Chara.cs.

4690 {
4691 return elements.ListElements((Element e) => e.source.categorySub == "weapon" && !e.HasTag("ranged")).FindMax((Element a) => a.Value);
4692 }
List< Element > ListElements(Func< Element, bool > shoudList=null, Comparison< Element > comparison=null)
bool HasTag(string tag)
Definition: ELEMENT.cs:478

References Element.HasTag(), Element.ListElements, Element.source, and Element.Value.

Referenced by WindowChara.RefreshEquipment(), and WindowChara.RefreshNote().

◆ GetFirstStep()

Point Chara.GetFirstStep ( Point  newPoint,
PathManager::MoveType  moveType = PathManager::MoveType::Default 
)
inline

Definition at line 2605 of file Chara.cs.

2606 {
2607 return PathManager.Instance.GetFirstStep(pos, newPoint, this, IsPC ? 40 : 10, (!IsMultisize) ? moveType : PathManager.MoveType.Default);
2608 }
Point GetFirstStep(Point origin, Point _dest, IPathfindWalker walker, int maxDist=20, MoveType moveType=MoveType.Default)
Definition: PathManager.cs:67
static PathManager Instance
Definition: PathManager.cs:16

References PathManager.GetFirstStep(), PathManager.Instance, IsMultisize, IsPC, and Card.pos.

Referenced by GoalManualMove.CanMove(), ActEffect.Proc(), GoalCombat.Run(), GoalManualMove.Run(), and GoalManualMove.TryMove().

◆ GetGoalFromTimeTable()

Goal Chara.GetGoalFromTimeTable ( int  hour)
inline

Definition at line 8806 of file Chara.cs.

8807 {
8808 if (IsPC)
8809 {
8810 return null;
8811 }
8812 switch (TimeTable.GetSpan(idTimeTable, hour))
8813 {
8814 case TimeTable.Span.Sleep:
8816 {
8817 return new GoalSleep();
8818 }
8819 break;
8820 case TimeTable.Span.Eat:
8821 return new GoalIdle();
8822 case TimeTable.Span.Work:
8823 if (IsGuest())
8824 {
8825 return new GoalIdle();
8826 }
8827 return GetGoalWork();
8828 case TimeTable.Span.Free:
8829 if (IsGuest())
8830 {
8831 return new GoalIdle();
8832 }
8833 return GetGoalHobby();
8834 }
8835 return null;
8836 }
Goal GetGoalWork()
Definition: Chara.cs:8838
Goal GetGoalHobby()
Definition: Chara.cs:8851
string idTimeTable
Definition: Chara.cs:470
static Span GetSpan(string id, int hour)
Definition: TimeTable.cs:45
bool isSimulating
Definition: Zone.cs:75

References EClass._zone, TimeTable.GetSpan(), Zone.isSimulating, and Stats.value.

◆ GetGoalHobby()

Goal Chara.GetGoalHobby ( )
inline

Definition at line 8851 of file Chara.cs.

8852 {
8853 if (IsPrisoner)
8854 {
8855 return new GoalIdle();
8856 }
8857 if (memberType == FactionMemberType.Livestock)
8858 {
8859 return new GoalGraze();
8860 }
8861 return new GoalHobby();
8862 }
FactionMemberType
bool IsPrisoner
Definition: Chara.cs:1040

Referenced by Zone.Simulate().

◆ GetGoalWork()

Goal Chara.GetGoalWork ( )
inline

Definition at line 8838 of file Chara.cs.

8839 {
8840 if (IsPrisoner)
8841 {
8842 return new GoalIdle();
8843 }
8844 if (memberType == FactionMemberType.Livestock)
8845 {
8846 return new GoalGraze();
8847 }
8848 return new GoalWork();
8849 }

Referenced by Zone.Simulate().

◆ GetHappiness()

int Chara.GetHappiness ( )
inline

Definition at line 7268 of file Chara.cs.

7269 {
7270 int num = 50;
7271 if (FindBed() != null)
7272 {
7273 num += 50;
7274 }
7275 return num;
7276 }

◆ GetHireCost()

int Chara.GetHireCost ( )
inline

Definition at line 7263 of file Chara.cs.

7264 {
7265 return base.LV / 2 + 4;
7266 }

Referenced by CalcGold.Hire().

◆ GetHoverText()

override string Chara.GetHoverText ( )
inlinevirtual

Reimplemented from Card.

Definition at line 6781 of file Chara.cs.

6782 {
6783 if (mimicry != null)
6784 {
6785 return mimicry.thing.GetHoverText();
6786 }
6787 string text = base.Name;
6788 if (IsFriendOrAbove())
6789 {
6790 text = text.TagColor(EClass.Colors.colorFriend);
6791 }
6792 else if (IsHostile())
6793 {
6794 text = text.TagColor(EClass.Colors.colorHostile);
6795 }
6796 int num = 2;
6797 int lV = EClass.pc.LV;
6798 if (base.LV >= lV * 5)
6799 {
6800 num = 0;
6801 }
6802 else if (base.LV >= lV * 2)
6803 {
6804 num = 1;
6805 }
6806 else if (base.LV <= lV / 4)
6807 {
6808 num = 4;
6809 }
6810 else if (base.LV <= lV / 2)
6811 {
6812 num = 3;
6813 }
6814 string text2 = Lang.GetList("lvComparison")[num];
6815 text2 = (" (" + text2 + ") ").TagSize(14).TagColor(EClass.Colors.gradientLVComparison.Evaluate(0.25f * (float)num));
6816 string s = (IsFriendOrAbove() ? "HostilityAlly" : (IsNeutral() ? "HostilityNeutral" : "HostilityEnemy"));
6817 s = (" (" + s.lang() + ") ").TagSize(14);
6818 s = "";
6819 if (memberType == FactionMemberType.Guest)
6820 {
6821 s += (" (" + "guest".lang() + ") ").TagSize(14);
6822 }
6823 else if (memberType == FactionMemberType.Livestock)
6824 {
6825 s += (" (" + "livestock".lang() + ") ").TagSize(14);
6826 }
6827 if (!EClass.pc.IsMoving)
6828 {
6829 if (EClass.pc.HasHigherGround(this))
6830 {
6831 text2 += "lowerGround".lang();
6832 }
6833 else if (HasHigherGround(EClass.pc))
6834 {
6835 text2 += "higherGround".lang();
6836 }
6837 }
6838 if (Evalue(1232) > 0)
6839 {
6840 text2 = "milkBaby".lang().TagSize(14) + text2;
6841 }
6842 if (Guild.Fighter.ShowBounty(this) && Guild.Fighter.HasBounty(this))
6843 {
6844 text2 = "hasBounty".lang().TagSize(14) + text2;
6845 }
6846 if (EClass.pc.HasElement(481))
6847 {
6848 text2 += ("(" + faith.Name + ")").TagSize(14);
6849 }
6850 if (EClass.pc.HasElement(6607))
6851 {
6852 s += CraftUtil.GetBloodText(this).TagSize(14).TagColor(EClass.Colors.colorBlood);
6853 }
6854 return text + text2 + s;
6855 }
bool HasHigherGround(Card c)
Definition: Chara.cs:1204
override bool IsMoving
Definition: Chara.cs:610
bool IsNeutral()
Definition: Chara.cs:6580
Color colorHostile
Color colorBlood
Color colorFriend
Gradient gradientLVComparison
static string GetBloodText(Chara c)
Definition: CraftUtil.cs:117
bool ShowBounty(Chara c)
Definition: GuildFighter.cs:39
bool HasBounty(Chara c)
Definition: GuildFighter.cs:44
Definition: Guild.cs:2
static GuildFighter Fighter
Definition: Guild.cs:56
override string GetHoverText()
Definition: Thing.cs:790

References ColorProfile.colorBlood, ColorProfile.colorFriend, ColorProfile.colorHostile, EClass.Colors, Guild.Fighter, CraftUtil.GetBloodText(), Thing.GetHoverText(), Lang.GetList(), ColorProfile.gradientLVComparison, GuildFighter.HasBounty(), Card.HasElement(), HasHigherGround(), IsMoving, Card.LV, EClass.pc, GuildFighter.ShowBounty(), and ConTransmuteMimic.thing.

Referenced by WidgetMouseover.Refresh().

◆ GetHoverText2()

override string Chara.GetHoverText2 ( )
inlinevirtual

Reimplemented from Card.

Definition at line 6857 of file Chara.cs.

6858 {
6859 if (mimicry != null)
6860 {
6861 return mimicry.thing.GetHoverText2();
6862 }
6863 string text = "";
6864 if (knowFav)
6865 {
6866 text += Environment.NewLine;
6867 text = text + "<size=14>" + "favgift".lang(GetFavCat().GetName().ToLower(), GetFavFood().GetName()) + "</size>";
6868 }
6869 string text2 = "";
6871 {
6872 text2 += Environment.NewLine;
6873 text2 = text2 + "Lv:" + base.LV + " HP:" + base.hp + "/" + MaxHP + " MP:" + mana.value + "/" + mana.max + " DV:" + DV + " PV:" + PV + " Hunger:" + hunger.value;
6874 text2 += Environment.NewLine;
6875 text2 = text2 + "Global:" + IsGlobal + " AI:" + ai?.ToString() + " " + source.tactics.IsEmpty(EClass.sources.tactics.map.TryGetValue(id)?.id ?? EClass.sources.tactics.map.TryGetValue(job.id)?.id ?? "predator");
6876 text2 += Environment.NewLine;
6877 text2 = text2 + base.uid + IsMinion + "/" + base.c_uidMaster + "/" + master;
6878 text2 = text2 + " dir:" + base.dir + " skin:" + base.idSkin + " scaled:" + base.isScaled;
6879 }
6881 {
6882 text2 += Environment.NewLine;
6883 text2 += "<size=14>";
6884 foreach (Hobby item in ListWorks())
6885 {
6886 text2 = text2 + item.Name + ", ";
6887 }
6888 foreach (Hobby item2 in ListHobbies())
6889 {
6890 text2 = text2 + item2.Name + ", ";
6891 }
6892 text2 = text2.TrimEnd(", ".ToCharArray()) + "</size>";
6893 }
6894 string text3 = "";
6895 IEnumerable<BaseStats> enumerable = conditions.Concat((!IsPCFaction) ? new BaseStats[0] : new BaseStats[2] { hunger, stamina });
6896 if (enumerable.Count() > 0)
6897 {
6898 text3 += Environment.NewLine;
6899 text3 += "<size=14>";
6900 int num = 0;
6901 foreach (BaseStats item3 in enumerable)
6902 {
6903 string text4 = item3.GetPhaseStr();
6904 if (text4.IsEmpty() || text4 == "#")
6905 {
6906 continue;
6907 }
6908 Color c = Color.white;
6909 switch (item3.source.group)
6910 {
6911 case "Bad":
6912 case "Debuff":
6913 case "Disease":
6915 break;
6916 case "Buff":
6918 break;
6919 }
6921 {
6922 text4 = text4 + "(" + item3.GetValue() + ")";
6923 if (resistCon != null && resistCon.ContainsKey(item3.id))
6924 {
6925 text4 = text4 + "{" + resistCon[item3.id] + "}";
6926 }
6927 }
6928 num++;
6929 text3 = text3 + text4.TagColor(c) + ", ";
6930 }
6931 if (num == 0)
6932 {
6933 text3 = "";
6934 }
6935 else
6936 {
6937 text = "";
6938 text3 = text3.TrimEnd(", ".ToCharArray()) + "</size>";
6939 }
6940 }
6942 {
6943 text3 += Environment.NewLine;
6944 foreach (ActList.Item item4 in ability.list.items)
6945 {
6946 text3 = text3 + item4.act.Name + ", ";
6947 }
6948 text3 = text3.TrimEnd(", ".ToCharArray());
6949 }
6950 return text + text2 + text3;
6951 }
override string ToString()
Definition: AIAct.cs:124
virtual string GetPhaseStr()
Definition: BaseStats.cs:47
virtual int GetValue()
Definition: BaseStats.cs:52
virtual string GetHoverText2()
Definition: Card.cs:7837
bool isScaled
Definition: Card.cs:915
SourceCategory.Row GetFavCat()
Definition: Chara.cs:8079
bool knowFav
Definition: Chara.cs:415
override string GetName(NameStyle style, int num=-1)
Definition: Chara.cs:1371
override int DV
Definition: Chara.cs:731
List< Hobby > ListHobbies(bool useMemberType=true)
Definition: Chara.cs:8994
override int PV
Definition: Chara.cs:760
SourceThing.Row GetFavFood()
Definition: Chara.cs:8059
List< Hobby > ListWorks(bool useMemberType=true)
Definition: Chara.cs:8967
Color colorDebuff
bool showExtra
Definition: CoreDebug.cs:168
Definition: Hobby.cs:5
SourceTactics tactics

References Color, ColorProfile.colorBuff, ColorProfile.colorDebuff, EClass.Colors, EClass.debug, Card.GetHoverText2(), BaseStats.GetPhaseStr(), BaseStats.GetValue(), held, BaseStats.id, SourceJob.Row.id, Card.isScaled, item, ActList.items, CharaAbility.list, EClass.pc, CoreDebug.showExtra, BaseStats.source, EClass.sources, SourceChara.Row.tactics, SourceManager.tactics, ConTransmuteMimic.thing, AIAct.ToString(), Card.trait, and Stats.value.

Referenced by WidgetMouseover.Refresh().

◆ GetIdPortrait()

string Chara.GetIdPortrait ( )
inline

Definition at line 8161 of file Chara.cs.

8162 {
8163 if (id == "olderyoungersister")
8164 {
8165 if (base.idSkin != 2)
8166 {
8167 return "UN_olderyoungersister";
8168 }
8169 return "UN_olderyoungersister_alt";
8170 }
8171 if (Portrait.allIds.Contains("UN_" + id + ".png"))
8172 {
8173 return "UN_" + id;
8174 }
8175 return base.c_idPortrait;
8176 }
static HashSet< string > allIds
Definition: Portrait.cs:20

References Portrait.allIds.

Referenced by ButtonRoster.SetChara(), Person.SetChara(), and Portrait.SetChara().

◆ GetIdPortraitCat()

string Chara.GetIdPortraitCat ( )
inline

Definition at line 8147 of file Chara.cs.

8148 {
8149 string text = race.id;
8150 if ((text == "mifu" || text == "nefu") && EClass.rnd(2) == 0)
8151 {
8152 return "foxfolk";
8153 }
8154 if (trait is TraitGuard)
8155 {
8156 return "guard";
8157 }
8158 return "";
8159 }

References SourceRace.Row.id, and EClass.rnd().

Referenced by ApplyEditorTags(), UICharaMaker.ListGender(), and Biography.SetPortrait().

◆ GetImageSprite()

override Sprite Chara.GetImageSprite ( )
inlinevirtual

Reimplemented from Card.

Definition at line 7047 of file Chara.cs.

7048 {
7049 return GetSprite();
7050 }
override Sprite GetSprite(int dir=0)
Definition: Chara.cs:6699

◆ GetName()

override string Chara.GetName ( NameStyle  style,
int  num = -1 
)
inlinevirtual

Reimplemented from Card.

Definition at line 1371 of file Chara.cs.

1372 {
1373 if (mimicry != null)
1374 {
1375 return mimicry.thing.GetName(style, num);
1376 }
1377 if (base.isBackerContent && EClass.core.config.backer.Show(base.c_idBacker))
1378 {
1379 if (id == "follower" && !IsGlobal)
1380 {
1381 return "_follower".lang(EClass.sources.backers.map[base.c_idBacker].Name, faith.Name);
1382 }
1383 return EClass.sources.backers.map[base.c_idBacker].Name;
1384 }
1385 string text = base.c_altName ?? source.GetName(this);
1386 if (HasCondition<ConTransmuteShadow>())
1387 {
1388 text = EClass.sources.charas.map["shade"].GetName(this);
1389 }
1390 text = text.Replace("#ele5", MainElement.source.GetAltname(3)).Replace("#ele4", MainElement.source.GetAltname(2)).Replace("#ele3", MainElement.source.GetAltname(1))
1391 .Replace("#ele2", MainElement.source.GetAltname(0))
1392 .Replace("#ele", MainElement.source.GetName().ToLower());
1393 if (base.c_bossType == BossType.Evolved)
1394 {
1395 text = "_evolved".lang(text.ToTitleCase(wholeText: true));
1396 }
1397 trait.SetName(ref text);
1398 if (text.Length > 0 && char.IsLower(text[0]))
1399 {
1400 if (base.rarity >= Rarity.Legendary)
1401 {
1402 text = text.ToTitleCase();
1403 }
1404 else if (num != 0)
1405 {
1406 text = text.AddArticle();
1407 }
1408 }
1409 if (style == NameStyle.Simple)
1410 {
1411 return text;
1412 }
1413 int num2 = ((base.rarity == Rarity.Mythical) ? 3 : ((base.rarity >= Rarity.Legendary) ? 2 : ((!_alias.IsEmpty()) ? 1 : (-1))));
1414 if (trait is TraitAdventurer)
1415 {
1416 num2 = 1;
1417 }
1418 text = (Aka.IsEmpty() ? text.Bracket(num2) : (num2 switch
1419 {
1420 -1 => "_aka",
1421 1 => "_aka3",
1422 _ => "_aka2",
1423 }).lang((num2 == -1) ? Aka : Aka.ToTitleCase(wholeText: true), text.Bracket(num2)));
1424 string text2 = (base.isSale ? "forSale".lang(Lang._currency(GetPrice(CurrencyType.Money, sell: true, PriceType.PlayerShop), "money")) : "");
1425 return text + text2;
1426 }
BossType
Definition: BossType.cs:2
string Aka
Definition: Chara.cs:218
string _alias
Definition: Chara.cs:221
BackerContentConfig backer
Definition: CoreConfig.cs:613
string Name
Definition: Religion.cs:30
SourceBacker backers
SourceChara charas
override string GetName(NameStyle style, int _num=-1)
Definition: Thing.cs:535
virtual void SetName(ref string s)
Definition: Trait.cs:723

References _alias, Lang._currency(), Aka, CoreConfig.backer, SourceManager.backers, SourceManager.charas, Core.config, EClass.core, faith, Thing.GetName(), Card.GetPrice(), IsGlobal, MainElement, mimicry, Religion.Name, Trait.SetName(), CoreConfig.BackerContentConfig.Show(), source, Element.source, EClass.sources, ConTransmuteMimic.thing, and trait.

Referenced by TraitStoryBookHome.OnRead().

◆ GetNearbyCatToSniff()

Chara Chara.GetNearbyCatToSniff ( )
inline

Definition at line 8099 of file Chara.cs.

8100 {
8101 using (List<Chara>.Enumerator enumerator = pos.ListCharasInRadius(this, 3, (Chara c) => c != this && c.race.id == "cat").GetEnumerator())
8102 {
8103 if (enumerator.MoveNext())
8104 {
8105 return enumerator.Current;
8106 }
8107 }
8108 return null;
8109 }
List< Chara > ListCharasInRadius(Chara cc, int dist, Func< Chara, bool > func, bool onlyVisible=true)
Definition: Point.cs:1220

References race.

Referenced by ActEffect.Proc(), AI_Idle.Run(), and GoalCombat.TryUseAbility().

◆ GetPietyValue()

int Chara.GetPietyValue ( )
inline

Definition at line 10217 of file Chara.cs.

10218 {
10219 if (base._IsPC)
10220 {
10221 return 10 + (int)(Mathf.Sqrt(base.c_daysWithGod) * 2f + (float)Evalue(85)) / 2;
10222 }
10223 return 10 + (int)(Mathf.Sqrt(base.LV) * 5f + (float)Evalue(306)) / 2;
10224 }

◆ GetRevived()

void Chara.GetRevived ( )
inline

Definition at line 5158 of file Chara.cs.

5159 {
5160 Revive(EClass.pc.pos.GetNearestPoint(allowBlock: false, allowChara: false), msg: true);
5161 if (!IsPCFaction)
5162 {
5163 return;
5164 }
5166 {
5167 if (homeZone != null && EClass._zone != homeZone)
5168 {
5169 Msg.Say("returnHome", this, homeZone.Name);
5171 }
5172 }
5173 else if (!EClass._zone.IsPCFaction || homeBranch != EClass.Branch || base.c_wasInPcParty)
5174 {
5175 EClass.pc.party.AddMemeber(this, showMsg: true);
5176 }
5177 }
static FactionBranch Branch
Definition: EClass.cs:23
void AddMemeber(Chara c, bool showMsg=false)
Definition: Party.cs:57
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false, int minRadius=0)
Definition: Point.cs:619
virtual bool CanJoinParty
Definition: TraitChara.cs:47
virtual bool CanJoinPartyResident
Definition: TraitChara.cs:50

References EClass._zone, Party.AddMemeber(), EClass.Branch, Point.GetNearestPoint(), Zone.IsPCFaction, party, EClass.pc, Card.pos, Revive, and Msg.Say().

Referenced by ListPeopleRevive.OnClick(), and DramaOutcome.revive_pet().

◆ GetRoomWork()

BaseArea Chara.GetRoomWork ( )
inline

Definition at line 8945 of file Chara.cs.

8946 {
8947 BaseArea result = null;
8948 foreach (Hobby item in ListWorks())
8949 {
8950 AIWork aI = item.GetAI(this);
8951 if (aI.SetDestination())
8952 {
8953 if (aI.destArea != null)
8954 {
8955 result = aI.destArea;
8956 }
8957 else if (aI.destThing != null)
8958 {
8959 result = aI.destThing.pos.cell.room;
8960 }
8961 break;
8962 }
8963 }
8964 return result;
8965 }
Definition: AIWork.cs:6
Thing destThing
Definition: AIWork.cs:17
bool SetDestination()
Definition: AIWork.cs:56
BaseArea destArea
Definition: AIWork.cs:13

References Point.cell, AIWork.destArea, AIWork.destThing, item, Card.pos, Cell.room, and AIWork.SetDestination().

Referenced by BaseListPeople.AddSubButtonWork(), and ListPeopleBed.OnInstantiate().

◆ GetSprite()

override Sprite Chara.GetSprite ( int  dir = 0)
inlinevirtual

Reimplemented from Card.

Definition at line 6699 of file Chara.cs.

6700 {
6701 if (IsPCC)
6702 {
6703 PCC pCC = PCC.Get(pccData);
6704 pCC.Build();
6705 return pCC.variation.idle[0, 0];
6706 }
6707 if (spriteReplacer != null)
6708 {
6709 return spriteReplacer.data.GetSprite();
6710 }
6711 return sourceCard.GetSprite(0, (sourceCard._tiles.Length > 1) ? ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % sourceCard._tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0))) : 0);
6712 }
SpriteReplacer spriteReplacer
Definition: Chara.cs:156
override CardRow sourceCard
Definition: Chara.cs:452
int[] _tiles
Definition: RenderRow.cs:12
Sprite GetSprite(int dir=0, int skin=0, bool snow=false)
Definition: RenderRow.cs:261
Sprite GetSprite(bool snow=false)
Definition: SpriteData.cs:67
SpriteData data

References RenderRow._tiles, SpriteReplacer.data, SpriteData.GetSprite(), RenderRow.GetSprite(), and SourceChara.Row.staticSkin.

Referenced by HotItemChara.GetSprite(), HotItemFocusChara.GetSprite(), CharaActor.OnSetOwner(), LayerEditSkin.RefreshImage(), Portrait.SetChara(), Person.SetImage(), and ItemPopulation.SetTopic().

◆ GetSubPassData()

override SubPassData Chara.GetSubPassData ( )
inlinevirtual

Reimplemented from Card.

Definition at line 6723 of file Chara.cs.

6724 {
6725 if (IsPCC)
6726 {
6728 {
6730 }
6731 }
6732 else if (conSleep != null && host == null && pos.Equals(EClass.pc.pos) && IsHuman && (GetBool(123) || affinity.CanSleepBeside()))
6733 {
6734 return EClass.setting.pass.subDead;
6735 }
6736 return SubPassData.Default;
6737 }
bool GetBool(int id)
Definition: BaseCard.cs:15
ConSleep conSleep
Definition: Chara.cs:102
override bool IsDeadOrSleeping
Definition: Chara.cs:575
PassSetting pass
Definition: GameSetting.cs:303
bool altHeldPos
Definition: Player.cs:1153
static SubPassData Default
Definition: SubPassData.cs:7

References Player.altHeldPos, Affinity.CanSleepBeside(), SubPassData.Default, GameSetting.pass, EClass.pc, EClass.player, Card.pos, EClass.setting, GameSetting.PassSetting.subDead, and GameSetting.PassSetting.subDeadPCC.

◆ GetTextHappiness()

string Chara.GetTextHappiness ( )
inline

Definition at line 7278 of file Chara.cs.

7279 {
7280 return GetHappiness().ToString() ?? "";
7281 }
int GetHappiness()
Definition: Chara.cs:7268

◆ GetTextHobby()

string Chara.GetTextHobby ( bool  simple = false)
inline

Definition at line 9083 of file Chara.cs.

9084 {
9085 string text = (simple ? "" : ("hobby".lang() + ":"));
9086 foreach (Hobby item in ListHobbies())
9087 {
9088 text = text + " " + item.Name.TagColor((item.GetEfficiency(this) > 0) ? FontColor.Good : FontColor.Warning) + ",";
9089 }
9090 return text.TrimEnd(',');
9091 }

References item.

Referenced by LayerQuestBoard.RefreshHire(), WindowChara.RefreshNote(), and BaseListPeople.SetSubText().

◆ GetTextWork()

string Chara.GetTextWork ( bool  simple = false)
inline

Definition at line 9093 of file Chara.cs.

9094 {
9095 string text = (simple ? "" : ("work".lang() + ":"));
9096 foreach (Hobby item in ListWorks())
9097 {
9098 text = text + " " + item.Name.TagColor((item.GetEfficiency(this) > 0) ? FontColor.Good : FontColor.Warning) + ",";
9099 }
9100 return text.TrimEnd(',');
9101 }

References item.

Referenced by LayerQuestBoard.RefreshHire(), WindowChara.RefreshNote(), and BaseListPeople.SetSubText().

◆ GetTopicText()

string Chara.GetTopicText ( string  topic = "calm")
inline

Definition at line 6953 of file Chara.cs.

6954 {
6955 string key = source.idText.IsEmpty(id);
6956 if (id == "littleOne" && EClass._zone is Zone_LittleGarden)
6957 {
6958 key = "littleOne2";
6959 }
6960 SourceCharaText.Row row = EClass.sources.charaText.map.TryGetValue(key);
6961 if (row == null)
6962 {
6963 return null;
6964 }
6965 string text = row.GetText(topic, returnNull: true);
6966 if (text.IsEmpty())
6967 {
6968 return null;
6969 }
6970 if (text.StartsWith("@"))
6971 {
6972 row = EClass.sources.charaText.map.TryGetValue(text.Replace("@", ""));
6973 if (row == null)
6974 {
6975 return null;
6976 }
6977 text = row.GetText(topic, returnNull: true);
6978 if (text.IsEmpty())
6979 {
6980 return null;
6981 }
6982 }
6983 return text.Split(Environment.NewLine.ToCharArray()).RandomItem();
6984 }
SourceCharaText charaText

References EClass._zone, SourceManager.charaText, SourceChara.Row.idText, and EClass.sources.

◆ GetTotalFeat()

int Chara.GetTotalFeat ( )
inline

Definition at line 8121 of file Chara.cs.

8122 {
8123 int num = 0;
8124 if (base.c_upgrades != null)
8125 {
8126 num += base.c_upgrades.spent;
8127 }
8128 if (base.c_genes != null)
8129 {
8130 num += base.c_genes.GetTotalCost();
8131 }
8132 return num + base.feat;
8133 }

◆ GetWork()

Hobby Chara.GetWork ( string  id)
inline

Definition at line 9014 of file Chara.cs.

9015 {
9016 foreach (Hobby item in ListWorks())
9017 {
9018 if (item.source.alias == id)
9019 {
9020 return item;
9021 }
9022 }
9023 foreach (Hobby item2 in ListHobbies())
9024 {
9025 if (item2.source.alias == id)
9026 {
9027 return item2;
9028 }
9029 }
9030 return null;
9031 }
SourceHobby.Row source
Definition: Hobby.cs:8

References item, and Hobby.source.

Referenced by FactionBranch.AutoClean(), FactionBranch.GenerateGarbage(), and FactionBranch.OnAdvanceDay().

◆ GetWorkSummary()

WorkSummary Chara.GetWorkSummary ( )
inline

Definition at line 9166 of file Chara.cs.

9167 {
9168 if (_workSummary == null)
9169 {
9170 _workSummary = new WorkSummary();
9171 }
9172 return _workSummary;
9173 }
WorkSummary _workSummary
Definition: Chara.cs:55

Referenced by AIWork.AddDeliverable(), Expedition.End(), GoalWork.FindWork(), UIHomeInfo.RefreshReport(), GoalWork.TryWork(), and GoalWork.ValidateHobby().

◆ GiveGift()

void Chara.GiveGift ( Chara  c,
Thing  t 
)
inline

Definition at line 8260 of file Chara.cs.

8261 {
8262 if (c.IsHostile() || c.IsDeadOrSleeping)
8263 {
8264 Msg.Say("affinityNone", c, this);
8265 return;
8266 }
8267 if (!t.isCopy && t.IsCursed && t.IsEquipmentOrRanged && !t.IsAmmo && c.HasElement(1414))
8268 {
8269 bool num = t.blessedState == BlessedState.Doomed;
8270 int num2 = 200 + t.LV * 3;
8271 if (t.rarity == Rarity.Legendary)
8272 {
8273 num2 *= 3;
8274 }
8275 if (t.rarity >= Rarity.Mythical)
8276 {
8277 num2 *= 5;
8278 }
8279 if (num)
8280 {
8281 num2 *= 2;
8282 }
8283 EClass.pc.PlayEffect("identify");
8284 EClass.pc.PlaySound("identify");
8285 c.PlayEffect("mutation");
8286 c.Say("draw_curse", c, t);
8287 t.Destroy();
8288 List<Element> list = new List<Element>();
8289 foreach (Element value in EClass.pc.elements.dict.Values)
8290 {
8291 if (value is Spell)
8292 {
8293 list.Add(value);
8294 }
8295 }
8296 if (list.Count == 0)
8297 {
8299 return;
8300 }
8301 Element element = list.RandomItem();
8302 EClass.pc.ModExp(element.id, num2);
8303 EClass.pc.Say("draw_curse2", EClass.pc, element.Name);
8304 c.AddExp(Mathf.Min(num2 / 3, c.ExpToNext));
8305 return;
8306 }
8307 if ((t.id == "lovepotion" || t.id == "dreambug") && !Application.isEditor)
8308 {
8309 GiveLovePotion(c, t);
8310 return;
8311 }
8312 if (t.trait is TraitErohon && c.id == t.c_idRefName)
8313 {
8314 c.OnGiveErohon(t);
8315 return;
8316 }
8317 if (t.trait is TraitTicketMassage)
8318 {
8319 t.ModNum(-1);
8320 c.Talk("ticket");
8321 switch (t.id)
8322 {
8323 case "ticket_massage":
8324 c.ModAffinity(EClass.pc, 10);
8326 {
8327 target = c
8328 });
8329 break;
8330 case "ticket_armpillow":
8331 c.ModAffinity(EClass.pc, 20);
8332 EClass.pc.AddCondition<ConSleep>(300, force: true);
8333 c.SetAI(new AI_ArmPillow
8334 {
8335 target = EClass.pc
8336 });
8337 break;
8338 case "ticket_champagne":
8339 c.ModAffinity(EClass.pc, 10);
8341 break;
8342 }
8343 return;
8344 }
8345 if (t.id == "flyer")
8346 {
8347 stamina.Mod(-1);
8348 if (c.things.Find((Thing a) => a.id == "flyer") != null)
8349 {
8350 c.Talk("flyer_miss");
8351 DoHostileAction(c);
8352 return;
8353 }
8354 if (EClass.rnd(20) != 0 && c.CHA > EClass.rnd(base.CHA + Evalue(291) * 3 + 10))
8355 {
8356 Msg.Say("affinityNone", c, this);
8357 t.Destroy();
8358 elements.ModExp(291, 10f);
8359 return;
8360 }
8361 elements.ModExp(291, 50f);
8362 }
8363 if (t.id == "statue_weird")
8364 {
8365 EClass.pc.Say("statue_sell");
8366 }
8367 t.isGifted = true;
8368 c.nextUse = c.affinity.OnGift(t);
8369 if (!t.isDestroyed)
8370 {
8371 EClass.game.quests.list.ForeachReverse(delegate(Quest q)
8372 {
8373 q.OnGiveItem(c, t);
8374 });
8375 if (c.TryEquip(t))
8376 {
8377 c.nextUse = null;
8378 }
8379 }
8380 }
Thing OnGift(Thing t)
Definition: Affinity.cs:129
int ExpToNext
Definition: Card.cs:2009
bool isCopy
Definition: Card.cs:879
bool IsCursed
Definition: Card.cs:2258
int CHA
Definition: Card.cs:2350
bool IsEquipmentOrRanged
Definition: Card.cs:2221
void SayNothingHappans()
Definition: Card.cs:6990
string c_idRefName
Definition: Card.cs:1642
void AddExp(int a, bool applyMod=true)
Definition: Card.cs:2970
void GiveLovePotion(Chara c, Thing t)
Definition: Chara.cs:8393
bool TryEquip(Thing t, bool useFav=false)
Definition: Chara.cs:7750
void OnGiveErohon(Thing t)
Definition: Chara.cs:8382
QuestManager quests
Definition: Game.cs:183
List< Quest > list
Definition: QuestManager.cs:11
Definition: Quest.cs:7
virtual void OnGiveItem(Chara c, Thing t)
Definition: Quest.cs:536

References AddCondition(), Card.AddExp(), affinity, Card.c_idRefName, Card.CHA, Card.Destroy(), ElementContainer.dict, Card.elements, Card.ExpToNext, ThingContainer.Find(), EClass.game, Card.HasElement(), Card.id, Element.id, Card.IsAmmo, Card.isCopy, Card.IsCursed, IsDeadOrSleeping, Card.isDestroyed, Card.IsEquipmentOrRanged, IsHostile(), QuestManager.list, Stats.Mod(), ModAffinity(), Card.ModExp(), Card.ModNum(), Element.Name, Affinity.OnGift(), OnGiveErohon(), Quest.OnGiveItem(), EClass.pc, Card.PlayEffect(), Card.PlaySound(), Game.quests, Card.rarity, EClass.rnd(), Msg.Say(), Card.Say(), Card.SayNothingHappans(), SetAI(), Card.Talk(), Card.things, Card.trait, and TryEquip().

Referenced by ActPlan._Update(), ActThrow.Throw(), and HotItemHeld.TrySetAct().

◆ GiveLovePotion()

void Chara.GiveLovePotion ( Chara  c,
Thing  t 
)
inline

Definition at line 8393 of file Chara.cs.

8394 {
8395 c.Say("give_love", c, t);
8396 c.PlaySound(t.material.GetSoundDead());
8397 c.ShowEmo(Emo.angry);
8398 c.ModAffinity(EClass.pc, -20, show: false);
8399 c.Talk("pervert");
8400 t.Destroy();
8401 }

References Card.Destroy(), Card.material, ModAffinity(), EClass.pc, Card.PlaySound(), Card.Say(), Card.ShowEmo(), and Card.Talk().

Referenced by InvOwner.Transaction.Process().

◆ GoHostile()

void Chara.GoHostile ( Card  _tg)
inlineprivate

Definition at line 6328 of file Chara.cs.

6329 {
6330 if (enemy == null && !IsPC)
6331 {
6332 if (GetInt(106) == 0)
6333 {
6334 TalkTopic("aggro");
6335 }
6336 if (OriginalHostility != Hostility.Enemy)
6337 {
6338 ShowEmo(Emo.angry);
6339 }
6340 SetEnemy(_tg.Chara);
6341 }
6343 {
6344 if (hostility >= Hostility.Neutral)
6345 {
6346 Say("angry", this);
6347 }
6348 hostility = Hostility.Enemy;
6349 }
6350 }
int GetInt(int id, int? defaultInt=null)
Definition: BaseCard.cs:25
virtual bool IsPCFactionMinion
Definition: Card.cs:2158

References Card.Chara, Card.IsPCFaction, and Card.IsPCFactionMinion.

Referenced by CallHelp(), and DoHostileAction().

◆ HasAccess() [1/2]

bool Chara.HasAccess ( Card  c)
inline

Definition at line 1294 of file Chara.cs.

1295 {
1296 return HasAccess(c.pos);
1297 }
bool HasAccess(Card c)
Definition: Chara.cs:1294

References HasAccess(), and Card.pos.

Referenced by AI_Pray.GetAltar(), TraitSet.GetRandom(), HasAccess(), MoveRandom(), and AI_Idle.Run().

◆ HasAccess() [2/2]

bool Chara.HasAccess ( Point  p)
inline

Definition at line 1299 of file Chara.cs.

1300 {
1301 if (!EClass._zone.IsPCFaction || p.cell.room == null || IsPC)
1302 {
1303 return true;
1304 }
1305 return p.cell.room.data.accessType switch
1306 {
1307 BaseArea.AccessType.Resident => memberType == FactionMemberType.Default,
1308 BaseArea.AccessType.Private => false,
1309 _ => true,
1310 };
1311 }

References EClass._zone, Point.cell, IsPC, Zone.IsPCFaction, memberType, and Cell.room.

◆ HasCondition()

◆ HasCondition< T >()

override bool Chara.HasCondition< T > ( )
inlinevirtual

Reimplemented from Card.

Definition at line 9422 of file Chara.cs.

9423 {
9424 for (int i = 0; i < conditions.Count; i++)
9425 {
9426 if (conditions[i] is T)
9427 {
9428 return true;
9429 }
9430 }
9431 return false;
9432 }

◆ HasCooldown()

bool Chara.HasCooldown ( int  idEle)
inline

Definition at line 8735 of file Chara.cs.

8736 {
8737 return GetCooldown(idEle) != 0;
8738 }
int GetCooldown(int idEle)
Definition: Chara.cs:8740

Referenced by StatsMana.Mod(), RequestProtection(), and NotificationCooldown.ShouldRemove().

◆ HasHigherGround()

bool Chara.HasHigherGround ( Card  c)
inline

Definition at line 1204 of file Chara.cs.

1205 {
1206 if (c == null)
1207 {
1208 return false;
1209 }
1210 float num = renderer.position.y - pos.Position(0).y + (_isLevitating ? 0.4f : 0f);
1211 float num2 = c.renderer.position.y - c.pos.Position(0).y + ((c.isChara && c.Chara._isLevitating) ? 0.4f : 0f);
1212 return num > num2 + 0.1f;
1213 }
bool _isLevitating
Definition: Chara.cs:136
ref Vector3 Position(int height)
Definition: Point.cs:548

References _isLevitating, Card.Chara, Card.pos, and Point.Position().

Referenced by GetHoverText(), and AttackProcess.Prepare().

◆ HasHobbyOrWork()

bool Chara.HasHobbyOrWork ( string  alias)
inline

Definition at line 8864 of file Chara.cs.

8865 {
8866 int num = EClass.sources.hobbies.alias.TryGetValue(alias)?.id ?? 0;
8867 listHobby.Clear();
8868 if (_works == null || _hobbies == null)
8869 {
8870 RerollHobby();
8871 }
8872 foreach (int work in _works)
8873 {
8874 if (work == num)
8875 {
8876 return true;
8877 }
8878 }
8879 foreach (int hobby in _hobbies)
8880 {
8881 if (hobby == num)
8882 {
8883 return true;
8884 }
8885 }
8886 return false;
8887 }
static List< Hobby > listHobby
Definition: Chara.cs:13
void RerollHobby(bool extraSlotChance=true)
Definition: Chara.cs:9127
SourceHobby hobbies

References SourceManager.hobbies, and EClass.sources.

Referenced by AI_Idle.Run().

◆ HasMinion()

bool Chara.HasMinion ( string  id)
inline

Definition at line 2384 of file Chara.cs.

2385 {
2386 foreach (Chara chara in EClass._map.charas)
2387 {
2388 if (chara.c_uidMaster == base.uid)
2389 {
2390 return true;
2391 }
2392 }
2393 return false;
2394 }

References EClass._map, Card.c_uidMaster, and Map.charas.

Referenced by ActEffect.ProcAt().

◆ HealAll()

void Chara.HealAll ( )
inline

Definition at line 1738 of file Chara.cs.

1739 {
1740 Cure(CureType.HealComplete);
1741 base.hp = MaxHP;
1742 mana.value = mana.max;
1743 stamina.value = stamina.max;
1744 Refresh();
1745 }
virtual int max
Definition: Stats.cs:68

References Cure(), mana, Stats.max, MaxHP, Refresh(), and stamina.

Referenced by ZoneInstanceBout.OnLeaveZone().

◆ HoldCard()

void Chara.HoldCard ( Card  t,
int  num = -1 
)
inline

Definition at line 4492 of file Chara.cs.

4493 {
4494 if (held == t || t.isDestroyed || t.Num <= 0)
4495 {
4496 return;
4497 }
4498 if (IsPC && t.isNPCProperty)
4499 {
4500 t.isNPCProperty = false;
4502 pos.TryWitnessCrime(this);
4503 }
4504 PickHeld();
4505 if (t.isChara)
4506 {
4508 {
4509 t.ShowEmo(Emo.love);
4510 }
4511 EClass.player.altHeldPos = t.renderer.data.ForceAltHeldPosition || EClass.rnd(2) == 0;
4512 }
4513 else
4514 {
4515 if (num == -1 || num > t.Num)
4516 {
4517 num = t.Num;
4518 }
4519 if (num < t.Num)
4520 {
4521 t = t.Split(num);
4522 }
4523 }
4524 if (t.GetRootCard() != this)
4525 {
4526 t = Pick(t.Thing, msg: false, tryStack: false);
4527 if (t.GetRootCard() != this)
4528 {
4529 return;
4530 }
4531 }
4532 held = t;
4533 if (held.GetLightRadius() > 0)
4534 {
4536 }
4537 if (IsPC)
4538 {
4540 WidgetHotbar.dirtyCurrentItem = true;
4541 }
4542 }
Thing Split(int a)
Definition: Card.cs:3513
bool isNPCProperty
Definition: Card.cs:555
void RecalculateFOV()
Definition: Card.cs:6534
virtual bool IsAliveInCurrentZone
Definition: Card.cs:2128
int GetLightRadius()
Definition: Card.cs:6581
void PickHeld(bool msg=false)
Definition: Chara.cs:4544
bool TryWitnessCrime(Chara criminal, Chara target=null, int radius=4, Func< Chara, bool > funcWitness=null)
Definition: Point.cs:873

References Card.GetLightRadius(), Card.GetRootCard(), Card.IsAliveInCurrentZone, Card.isChara, Card.isDestroyed, Card.isNPCProperty, Player.ModKarma(), Card.Num, Pick, EClass.player, EClass.rnd(), LayerInventory.SetDirty(), Card.ShowEmo(), Card.Split(), and Card.Thing.

Referenced by HotItemNoItem._TrySetAct(), Recipe.Craft(), RecipeCard.Craft(), HotItemHeld.OnSetCurrentItem(), UIInventory.RefreshList(), AI_Drink.Run(), AI_Eat.Run(), AI_Read.Run(), Player.SetCurrentHotItem(), and InvOwner.TryHold().

◆ InitStats()

void Chara.InitStats ( bool  onDeserialize = false)
inline

Definition at line 9250 of file Chara.cs.

9251 {
9252 if (!onDeserialize)
9253 {
9254 _cints[10] = 20;
9255 _cints[11] = 70;
9256 _cints[13] = 70;
9257 _cints[14] = 70;
9258 _cints[15] = 70;
9259 _cints[17] = 0;
9260 _cints[18] = 0;
9261 }
9262 foreach (Condition condition in conditions)
9263 {
9264 condition.SetOwner(this, onDeserialize);
9265 }
9266 }
int[] _cints
Definition: Chara.cs:82

References BaseCondition.SetOwner().

Referenced by OnCreate(), and OnDeserialized().

◆ InstantEat()

void Chara.InstantEat ( Thing  t = null,
bool  sound = true 
)
inline

Definition at line 7592 of file Chara.cs.

7593 {
7594 if (t == null)
7595 {
7596 t = FindBestFoodToEat();
7597 }
7598 if (t == null)
7599 {
7600 t = things.Find((Thing a) => CanEat(a, shouldEat: true) && !a.c_isImportant);
7601 }
7602 if (t == null)
7603 {
7604 t = things.Find((Thing a) => CanEat(a) && !a.c_isImportant);
7605 }
7606 if (t != null)
7607 {
7608 Say("eat_start", this, t.Duplicate(1));
7609 if (sound)
7610 {
7611 PlaySound("eat");
7612 }
7613 FoodEffect.Proc(this, t);
7614 }
7615 }
Thing FindBestFoodToEat()
Definition: Chara.cs:7571
static void Proc(Chara c, Thing food, bool consume=true)
Definition: FoodEffect.cs:11

References Card.c_isImportant, and FoodEffect.Proc().

Referenced by InvOwner.OnClick(), ActEffect.Proc(), AI_Idle.Run(), and Tick().

◆ IsBranchMember()

bool Chara.IsBranchMember ( )
inline

Definition at line 6590 of file Chara.cs.

6591 {
6592 if (faction == EClass.Home)
6593 {
6594 return homeZone == EClass.game.activeZone;
6595 }
6596 return false;
6597 }
Faction faction
Definition: Chara.cs:429
Zone activeZone
Definition: Game.cs:252

References Game.activeZone, EClass.game, and EClass.Home.

◆ IsCriticallyWounded()

bool Chara.IsCriticallyWounded ( bool  includeRide = false)
inline

Definition at line 1191 of file Chara.cs.

1192 {
1193 if (host == null || includeRide)
1194 {
1195 if (Evalue(1421) <= 0)
1196 {
1197 return base.hp < MaxHP / 5;
1198 }
1199 return base.hp + mana.value < (MaxHP + mana.max) / 5;
1200 }
1201 return false;
1202 }

References Card.Evalue(), host, mana, Stats.max, and MaxHP.

Referenced by AM_Adv._OnUpdateInput(), GoalAutoCombat.GetActPlanColor(), GoalAutoCombat.GoalAutoCombat(), and Party.IsCriticallyWounded().

◆ IsEnemyOnPath()

bool Chara.IsEnemyOnPath ( Point  p,
bool  cancelAI = true 
)
inline

Definition at line 2528 of file Chara.cs.

2529 {
2530 if (!currentZone.IsRegion && p.IsValid)
2531 {
2532 CellDetail detail = p.detail;
2533 if (detail != null && detail.charas.Count > 0)
2534 {
2535 foreach (Chara chara in p.detail.charas)
2536 {
2537 if (chara.mimicry == null && (chara.IsHostile(this) || chara.IsHostile() || !chara.trait.CanBePushed))
2538 {
2539 if (cancelAI && EClass.pc.ai is GoalManualMove)
2540 {
2541 EClass.pc.ai.Cancel();
2542 }
2543 return true;
2544 }
2545 }
2546 }
2547 }
2548 return false;
2549 }
List< Chara > charas
Definition: CellDetail.cs:13
CellDetail detail
Definition: Point.cs:71

References ai, TraitChara.CanBePushed, AIAct.Cancel(), CellDetail.charas, currentZone, Point.detail, IsHostile(), Spatial.IsRegion, Point.IsValid, mimicry, EClass.pc, and trait.

Referenced by GoalManualMove.CanMove(), CanMoveTo(), and AM_Adv.PressedActionMove().

◆ IsEscorted()

bool Chara.IsEscorted ( )
inline

Definition at line 2428 of file Chara.cs.

2429 {
2430 if (!IsPCPartyMinion)
2431 {
2432 return false;
2433 }
2434 foreach (Quest item in EClass.game.quests.list)
2435 {
2436 if (item is QuestEscort questEscort && questEscort.uidChara == base.uid)
2437 {
2438 return true;
2439 }
2440 }
2441 return false;
2442 }
int uidChara
Definition: QuestEscort.cs:6

References EClass.game, IsPCPartyMinion, item, QuestManager.list, Game.quests, and QuestEscort.uidChara.

Referenced by ActPlan._Update(), and QuestManager.HasFarAwayEscort().

◆ IsFriendOrAbove() [1/2]

bool Chara.IsFriendOrAbove ( )
inline

◆ IsFriendOrAbove() [2/2]

bool Chara.IsFriendOrAbove ( Chara  c)
inline

Definition at line 6634 of file Chara.cs.

6635 {
6636 if (base.IsPCFactionOrMinion || IsFriendOrAbove())
6637 {
6639 {
6640 return true;
6641 }
6642 }
6643 else if (IsHostile() && c.IsHostile())
6644 {
6645 return true;
6646 }
6647 return false;
6648 }

References IsFriendOrAbove(), IsHostile(), and Card.IsPCFactionOrMinion.

◆ IsGuest()

◆ IsHomeMember()

◆ IsHostile() [1/2]

◆ IsHostile() [2/2]

bool Chara.IsHostile ( Chara  c)
inline

Definition at line 6538 of file Chara.cs.

6539 {
6540 if (c == null)
6541 {
6542 return false;
6543 }
6544 if (base.IsPCFactionOrMinion)
6545 {
6546 if ((c == EClass.pc.enemy && !c.IsPCFactionOrMinion) || c.hostility <= Hostility.Enemy)
6547 {
6548 return true;
6549 }
6550 }
6551 else
6552 {
6554 {
6555 return true;
6556 }
6557 if (OriginalHostility >= Hostility.Friend)
6558 {
6559 if (hostility <= Hostility.Enemy && c.IsPCFactionOrMinion)
6560 {
6561 return true;
6562 }
6563 if (c.hostility <= Hostility.Enemy && c.OriginalHostility == Hostility.Enemy)
6564 {
6565 return true;
6566 }
6567 }
6568 else if (OriginalHostility <= Hostility.Enemy && (c.IsPCFactionOrMinion || (c.OriginalHostility != Hostility.Enemy && c.hostility >= Hostility.Friend)))
6569 {
6570 return true;
6571 }
6572 }
6573 if (id == "unicorn" && (Evalue(418) < 0 || (c.HasElement(1216) && c.Evalue(418) < 1)))
6574 {
6575 return true;
6576 }
6577 return false;
6578 }
bool IsCriminal
Definition: Player.cs:1339

References EClass._zone, enemy, Card.Evalue(), Card.HasElement(), hostility, Zone.instance, Player.IsCriminal, Card.IsPCFactionOrMinion, IsPCParty, OriginalHostility, EClass.pc, and EClass.player.

◆ IsInHomeZone()

bool Chara.IsInHomeZone ( )
inline

Definition at line 6604 of file Chara.cs.

6605 {
6606 return EClass.game.activeZone == currentZone;
6607 }

Referenced by BaseListPeople.IsDisabled().

◆ IsInSpot< T >()

bool Chara.IsInSpot< T > ( )
inline
Type Constraints
T :TraitSpot 

Definition at line 6609 of file Chara.cs.

6609 : TraitSpot
6610 {
6611 foreach (T item in EClass._map.props.installed.traits.List<T>())
6612 {
6613 foreach (Point item2 in item.ListPoints())
6614 {
6615 if (pos.Equals(item2))
6616 {
6617 return true;
6618 }
6619 }
6620 }
6621 return false;
6622 }
TraitManager traits
Definition: Props.cs:18

References EClass._map, PropsManager.installed, item, Map.props, and Props.traits.

◆ IsNeutral()

bool Chara.IsNeutral ( )
inline

Definition at line 6580 of file Chara.cs.

6581 {
6582 return hostility == Hostility.Neutral;
6583 }

Referenced by ActPlan._Update().

◆ IsNeutralOrAbove()

bool Chara.IsNeutralOrAbove ( )
inline

◆ IsValidGiftWeight()

bool Chara.IsValidGiftWeight ( Card  t,
int  num = -1 
)
inline

Definition at line 8204 of file Chara.cs.

8205 {
8206 int num2 = ((!HasElement(1411)) ? 1 : 3);
8207 if (GetBurden(t, num) >= num2)
8208 {
8209 return false;
8210 }
8211 return true;
8212 }
int GetBurden(Card t=null, int num=-1)
Definition: Chara.cs:1830

Referenced by ActPlan._Update(), and HotItemHeld.TrySetAct().

◆ ListAvailabeFeats()

List< Element > Chara.ListAvailabeFeats ( bool  pet = false,
bool  showAll = false 
)
inline

Definition at line 9897 of file Chara.cs.

9898 {
9899 List<Element> list = new List<Element>();
9900 foreach (SourceElement.Row item in EClass.sources.elements.rows.Where((SourceElement.Row a) => a.group == "FEAT" && a.cost[0] != -1 && !a.categorySub.IsEmpty()))
9901 {
9903 int num = ((feat.ValueWithoutLink <= 0) ? 1 : (feat.ValueWithoutLink + 1));
9904 if (num <= feat.source.max && !feat.HasTag("class") && !feat.HasTag("hidden") && !feat.HasTag("innate") && (!pet || !feat.HasTag("noPet")) && (showAll || feat.IsPurchaseFeatReqMet(elements)))
9905 {
9906 list.Add(Element.Create(feat.id, num) as Feat);
9907 }
9908 }
9909 return list;
9910 }
int feat
Definition: Card.cs:375
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1111
Definition: FEAT.cs:310

References Element.Create(), SourceManager.elements, Element.HasTag(), Element.id, Feat.IsPurchaseFeatReqMet(), item, Element.source, EClass.sources, and Element.ValueWithoutLink.

◆ ListHobbies()

List< Hobby > Chara.ListHobbies ( bool  useMemberType = true)
inline

Definition at line 8994 of file Chara.cs.

8995 {
8996 listHobby.Clear();
8997 if (!useMemberType || memberType != FactionMemberType.Livestock)
8998 {
8999 if (_hobbies == null)
9000 {
9001 RerollHobby();
9002 }
9003 foreach (int hobby in _hobbies)
9004 {
9005 listHobby.Add(new Hobby
9006 {
9007 id = hobby
9008 });
9009 }
9010 }
9011 return listHobby;
9012 }

Referenced by DramaCustomSequence.Build(), FactionBranch.GetResidentTax(), GoalHobby.GetWorks(), FactionBranch.RefreshEfficiency(), TraitWhipLove.TrySetHeldAct(), and GoalWork.ValidateHobby().

◆ ListWorks()

List< Hobby > Chara.ListWorks ( bool  useMemberType = true)
inline

Definition at line 8967 of file Chara.cs.

8968 {
8969 listHobby.Clear();
8970 if (useMemberType && memberType == FactionMemberType.Livestock)
8971 {
8972 listHobby.Add(new Hobby
8973 {
8974 id = 45
8975 });
8976 }
8977 else
8978 {
8979 if (_works == null)
8980 {
8981 RerollHobby();
8982 }
8983 foreach (int work in _works)
8984 {
8985 listHobby.Add(new Hobby
8986 {
8987 id = work
8988 });
8989 }
8990 }
8991 return listHobby;
8992 }

Referenced by FactionBranch.DailyOutcome(), FactionBranch.GetResidentTax(), GoalWork.GetWorks(), FactionBranch.RefreshEfficiency(), UIHomeInfo.RefreshReport(), and TraitWhipLove.TrySetHeldAct().

◆ LookAt() [1/2]

◆ LookAt() [2/2]

override void Chara.LookAt ( Point  p)
inlinevirtual

Reimplemented from Card.

Definition at line 3555 of file Chara.cs.

3556 {
3557 angle = Util.GetAngle(p.x - pos.x, p.z - pos.z);
3558 if (EClass._zone.IsRegion)
3559 {
3560 if (angle > 100f && angle < 170f)
3561 {
3562 base.dir = 2;
3563 }
3564 else if (angle > 170f && angle < 190f)
3565 {
3566 base.dir = 0;
3567 }
3568 else if (angle > 190f || (angle < -10f && angle > -100f))
3569 {
3570 base.dir = 3;
3571 }
3572 else
3573 {
3574 base.dir = 1;
3575 }
3576 angle -= 45f;
3577 }
3578 else if (angle > 170f && angle < 235f)
3579 {
3580 base.dir = 0;
3581 }
3582 else if (angle > 80f && angle < 145f)
3583 {
3584 base.dir = 1;
3585 }
3586 else if (angle > -100f && angle < -35f)
3587 {
3588 base.dir = 3;
3589 }
3590 else if (angle > -10f && angle < 55f)
3591 {
3592 base.dir = 2;
3593 }
3595 }

References EClass._zone, Spatial.IsRegion, Util, Point.x, and Point.z.

◆ MakeAlly()

void Chara.MakeAlly ( bool  msg = true)
inline

Definition at line 2310 of file Chara.cs.

2311 {
2312 if (IsLocalChara && !base.IsUnique)
2313 {
2314 Debug.Log("Creating Replacement NPC for:" + this);
2316 }
2317 _MakeAlly();
2318 if (msg)
2319 {
2320 EClass.pc.Say("hire", this);
2321 EClass.Sound.Play("good");
2322 }
2323 EClass.pc.party.AddMemeber(this);
2324 if (EClass._zone.IsTown)
2325 {
2327 }
2328 }
Chara CreateReplacement()
Definition: Chara.cs:8038
void _MakeAlly()
Definition: Chara.cs:2330
virtual bool IsTown
Definition: Zone.cs:223
void RefreshListCitizen()
Definition: Zone.cs:3605

References _MakeAlly(), EClass._map, EClass._zone, Party.AddMemeber(), CreateReplacement(), Map.deadCharas, Debug, IsLocalChara, Zone.IsTown, party, EClass.pc, Zone.RefreshListCitizen(), Card.Say(), and EClass.Sound.

Referenced by DramaOutcome.fiama_pet(), AI_Fuck.Finish(), DramaOutcome.melilith_friend(), DramaOutcome.nasu_join(), TraitDiary.OnRead(), TraitGiftNewYear.OnUse(), DramaOutcome.poppy_found(), ActEffect.Proc(), ActRide.Ride(), DramaOutcome.sister_friend(), ActThrow.Throw(), and Religion.TryGetGift().

◆ MakeBraineCell()

Thing Chara.MakeBraineCell ( )
inline

Definition at line 8183 of file Chara.cs.

8184 {
8185 return DNA.GenerateGene(this, DNA.Type.Brain);
8186 }
Definition: DNA.cs:8
Type
Definition: DNA.cs:10
static Thing GenerateGene(Chara c, Type? type=null)
Definition: DNA.cs:116

References DNA.GenerateGene().

◆ MakeGene()

Thing Chara.MakeGene ( DNA::Type type = null)
inline

Definition at line 8178 of file Chara.cs.

8179 {
8180 return DNA.GenerateGene((HasElement(1290) && Evalue(418) >= 0) ? EClass.sources.charas.map["caladrius"].model.Chara : this, type);
8181 }

References SourceManager.charas, DNA.GenerateGene(), and EClass.sources.

Referenced by AI_Fuck.Finish(), ActEffect.GeneMiracle(), ActEffect.LoveMiracle(), Card.SpawnLoot(), Zone.TryGenerateEvolved(), and CoreDebug.UpdateInput().

◆ MakeGrave()

void Chara.MakeGrave ( string  lastword)
inline

Definition at line 5265 of file Chara.cs.

5266 {
5267 if (!EClass._zone.IsRegion)
5268 {
5269 List<string> list = new List<string> { "930", "931", "947", "948", "949", "950", "951", "952" };
5270 if (IsPC && EClass.rnd(2) == 0 && EClass.pc.things.Find("letter_will") != null)
5271 {
5272 list = new List<string> { "944", "946", "backerGrave", "backerGrave2" };
5273 }
5274 Thing thing = ThingGen.Create(list.RandomItem());
5275 thing.MakeRefFrom(this);
5276 if (!lastword.IsEmpty())
5277 {
5278 thing.c_note = lastword;
5279 }
5280 thing.isModified = true;
5281 EClass._zone.AddCard(thing, pos).Install();
5282 }
5283 }
Card MakeRefFrom(string id)
Definition: Card.cs:5747

References EClass._zone, Zone.AddCard(), ThingGen.Create(), ThingContainer.Find(), Card.Install(), Spatial.IsRegion, Card.MakeRefFrom(), EClass.pc, EClass.rnd(), and Card.things.

◆ MakeMinion()

void Chara.MakeMinion ( Chara  _master,
MinionType  type = MinionType::Default 
)
inline

Definition at line 2373 of file Chara.cs.

2374 {
2375 ReleaseMinion();
2376 Hostility hostility2 = (base.c_originalHostility = (_master.IsPCFaction ? Hostility.Ally : _master.hostility));
2377 this.hostility = hostility2;
2378 base.c_uidMaster = _master.uid;
2379 base.c_minionType = type;
2380 master = _master;
2381 Refresh();
2382 }
int uid
Definition: Card.cs:123

References hostility, master, Refresh(), ReleaseMinion(), and Card.uid.

Referenced by Die(), QuestEscort.OnStart(), ActEffect.ProcAt(), and GoalCombat.Run().

◆ MakePartyMemeber()

void Chara.MakePartyMemeber ( )
inline

Definition at line 2304 of file Chara.cs.

2305 {
2306 _MakeAlly();
2307 EClass.pc.party.AddMemeber(this);
2308 }

References _MakeAlly(), Party.AddMemeber(), party, and EClass.pc.

◆ ModAffinity()

void Chara.ModAffinity ( Chara  c,
int  a,
bool  show = true,
bool  showOnlyEmo = false 
)
inline

Definition at line 7960 of file Chara.cs.

7961 {
7962 if (c == this)
7963 {
7964 return;
7965 }
7966 if (IsPC)
7967 {
7968 c.ModAffinity(EClass.pc, a, show);
7969 }
7970 else
7971 {
7973 {
7974 return;
7975 }
7976 int num = StatsHygiene.GetAffinityMod(EClass.pc.hygiene.GetPhase()) + (HasElement(417) ? 30 : 0) + (EClass.pc.HasCondition<ConSmoking>() ? (-30) : 0);
7977 if (IsPCFaction && homeBranch != null)
7978 {
7979 num += (int)Mathf.Sqrt(homeBranch.Evalue(2117)) * 5;
7980 }
7981 bool flag = a > 0;
7982 if (flag)
7983 {
7984 a = a * num / 100;
7985 if (affinity.GetLunchChance() > EClass.rnd(100) && GetInt(71) >= 0 && GetInt(71) < EClass.world.date.GetRaw())
7986 {
7987 SetInt(71, -1);
7988 }
7989 }
7990 if (show)
7991 {
7992 if (a == 0)
7993 {
7994 if (!showOnlyEmo)
7995 {
7996 Say("affinityNone", this, c);
7997 }
7998 }
7999 else
8000 {
8001 ShowEmo((!flag) ? Emo.angry : Emo.love);
8002 c.ShowEmo(flag ? Emo.love : Emo.sad);
8003 if (!showOnlyEmo)
8004 {
8005 Say(flag ? "affinityPlus" : "affinityMinus", this, c);
8006 }
8007 }
8008 }
8009 if (c.IsPC)
8010 {
8011 a = affinity.Mod(a);
8012 }
8013 }
8014 }
int Mod(int a)
Definition: Affinity.cs:192
int GetLunchChance()
Definition: Affinity.cs:86
Stats hygiene
Definition: Chara.cs:1166
int GetRaw(int offsetHours=0)
Definition: Date.cs:326
int Evalue(int ele)
static int GetAffinityMod(int phase)
Definition: StatsHygiene.cs:19
virtual bool CanChangeAffinity
Definition: Trait.cs:571

References World.date, FactionBranch.Evalue(), StatsHygiene.GetAffinityMod(), Affinity.GetLunchChance(), Stats.GetPhase(), Date.GetRaw(), HasCondition(), hygiene, IsPC, Affinity.Mod(), ModAffinity(), EClass.pc, EClass.rnd(), Card.ShowEmo(), and EClass.world.

Referenced by Quest.Complete(), Cuddle(), Die(), AI_Fuck.Finish(), GiveGift(), GiveLovePotion(), ActEffect.LoveMiracle(), ModAffinity(), InvOwner.OnClick(), Affinity.OnGift(), Affinity.OnTalkRumor(), DramaManager.ParseLine(), DramaOutcome.revive_pet(), AI_Fuck.Run(), AI_Shear.Run(), and AI_Slaughter.Run().

◆ ModCorruption()

void Chara.ModCorruption ( int  a)
inline

Definition at line 9854 of file Chara.cs.

9855 {
9856 if (a > 0)
9857 {
9858 if (Evalue(962) >= 25 || (ResistLv(962) > 0 && EClass.rnd(ResistLv(962) + 1) != 0))
9859 {
9860 return;
9861 }
9862 int num = Evalue(412);
9863 if (num != 0)
9864 {
9865 float num2 = (float)a * 100f / (float)Mathf.Max(100 + num * 2, 10);
9866 a = (int)num2 + ((EClass.rndf(1f) < num2 % 1f) ? 1 : 0);
9867 }
9868 }
9869 if (a == 0)
9870 {
9871 return;
9872 }
9873 int num3 = (corruption + a) / 100 - corruption / 100;
9874 for (int i = 0; i < Mathf.Abs(num3); i++)
9875 {
9876 if (!MutateRandom((num3 > 0) ? 1 : (-1), 100, ether: true))
9877 {
9878 break;
9879 }
9880 }
9881 corruption += a;
9882 int num4 = 0;
9883 foreach (Element value in elements.dict.Values)
9884 {
9885 if (value.source.category == "ether")
9886 {
9887 num4 += value.Value;
9888 }
9889 }
9890 if (num4 > 0 && IsPC)
9891 {
9892 Tutorial.Reserve("ether");
9893 }
9894 corruption = num4 * 100 + corruption % 100;
9895 }
bool MutateRandom(int vec=0, int tries=100, bool ether=false, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:10013
static float rndf(float a)
Definition: EClass.cs:102

References Tutorial.Reserve(), EClass.rnd(), EClass.rndf(), Element.source, and Element.Value.

Referenced by Card.ApplyElementEffect(), and CoreDebug.Fix_EtherDisease().

◆ ModHeight()

void Chara.ModHeight ( int  a)
inline

Definition at line 9803 of file Chara.cs.

9804 {
9805 if (!HasElement(450))
9806 {
9807 long num = bio.height;
9808 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
9809 if (num < 1)
9810 {
9811 num = 1L;
9812 }
9813 if (num > 999999999)
9814 {
9815 num = 999999999L;
9816 }
9817 if (num != bio.height)
9818 {
9819 bio.height = (int)num;
9820 Say((a > 0) ? "height_gain" : "height_lose", this);
9821 }
9822 }
9823 }
int height
Definition: Biography.cs:53

◆ ModTempElement()

void Chara.ModTempElement ( int  ele,
int  a,
bool  naturalDecay = false,
bool  onlyRenew = false 
)
inline

Definition at line 10269 of file Chara.cs.

10270 {
10271 if (a < 0 && !naturalDecay && HasElement(EClass.sources.elements.alias["sustain_" + EClass.sources.elements.map[ele].alias]?.id ?? 0))
10272 {
10273 return;
10274 }
10275 bool flag = HasElement(1215);
10276 if (tempElements == null)
10277 {
10279 tempElements.SetParent(this);
10280 }
10281 if (a > 0 && flag)
10282 {
10283 a = a * 150 / 100;
10284 }
10285 int num = elements.ValueWithoutLink(ele);
10286 int num2 = Mathf.Abs(num) + 100;
10287 int num3 = num2 / (flag ? 2 : 4);
10288 int num4 = -num - 100;
10289 int num5 = tempElements.Base(ele);
10290 int num6 = num5 + a;
10291 if (onlyRenew)
10292 {
10293 num3 = Mathf.Min(a, num3);
10294 num4 = Mathf.Max(a, -num2 / 3);
10295 }
10296 if (a > 0 && num6 > num3)
10297 {
10298 a = ((num3 > num5) ? (num3 - num5) : 0);
10299 }
10300 if (a < 0 && num6 < num4)
10301 {
10302 a = ((num4 < num5) ? (num4 - num5) : 0);
10303 }
10304 Element element = tempElements.ModBase(ele, a);
10305 if (element.vBase == 0)
10306 {
10307 tempElements.Remove(element.id);
10308 if (tempElements.dict.Count == 0)
10309 {
10310 tempElements = null;
10311 }
10312 }
10313 }
int ValueWithoutLink(int ele)
void Remove(int id)

References ElementContainer.Base(), ElementContainer.dict, SourceManager.elements, Element.id, ElementContainer.ModBase(), ElementContainer.Remove(), ElementContainer.SetParent(), EClass.sources, and Element.vBase.

◆ ModWeight()

void Chara.ModWeight ( int  a,
bool  ignoreLimit = false 
)
inline

Definition at line 9825 of file Chara.cs.

9826 {
9827 if (HasElement(450) || a == 0)
9828 {
9829 return;
9830 }
9831 long num = bio.weight;
9832 long num2 = bio.height;
9833 long num3 = num2 * num2 * 18 / 25000;
9834 long num4 = num2 * num2 * 24 / 10000;
9835 if (ignoreLimit || (num > num3 && num < num4))
9836 {
9837 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
9838 if (num < 1)
9839 {
9840 num = 1L;
9841 }
9842 if (num > 999999999)
9843 {
9844 num = 999999999L;
9845 }
9846 if (num != bio.weight)
9847 {
9848 bio.weight = (int)num;
9849 Say((a > 0) ? "weight_gain" : "weight_lose", this);
9850 }
9851 }
9852 }
int weight
Definition: Biography.cs:41

Referenced by FoodEffect.Proc().

◆ MoveByForce()

void Chara.MoveByForce ( Point  newPoint,
Card  c = null,
bool  checkWall = false 
)
inline

Definition at line 2642 of file Chara.cs.

2643 {
2644 if (!newPoint.sourceBlock.tileType.IsBlockPass && (!checkWall || (Dist(newPoint) <= 1 && CanMoveTo(newPoint, allowDestroyPath: false))) && _Move(newPoint, MoveType.Force) == MoveResult.Success && ai.Current.CancelWhenMoved)
2645 {
2646 ai.Current.TryCancel(c);
2647 }
2648 }
bool TryCancel(Card c)
Definition: AIAct.cs:270
virtual bool CancelWhenMoved
Definition: AIAct.cs:96
override MoveResult _Move(Point newPoint, MoveType type=MoveType.Walk)
Definition: Chara.cs:2736

References _Move(), ai, AIAct.CancelWhenMoved, CanMoveTo(), AIAct.Current, Card.Dist(), Point.sourceBlock, and AIAct.TryCancel().

Referenced by _Move(), Card.Kick(), and TryPush().

◆ MoveHome() [1/2]

void Chara.MoveHome ( string  id,
int  x = -1,
int  z = -1 
)
inline

◆ MoveHome() [2/2]

void Chara.MoveHome ( Zone  zone,
int  x = -1,
int  z = -1 
)
inline

Definition at line 3471 of file Chara.cs.

3472 {
3473 if (isDead)
3474 {
3475 Revive();
3476 }
3477 else
3478 {
3479 Cure(CureType.Death);
3480 }
3481 CureCondition<ConSuspend>();
3482 if (IsPCParty)
3483 {
3485 }
3486 FactionBranch factionBranch = homeBranch;
3487 if (x == -1)
3488 {
3489 x = 50;
3490 }
3491 if (z == -1)
3492 {
3493 z = 50;
3494 }
3495 Point point = new Point(x, z);
3496 if (zone.IsActiveZone)
3497 {
3498 point = point.GetNearestPoint(allowBlock: false, allowChara: false);
3499 }
3500 zone.AddCard(this, point);
3501 SetHomeZone(zone);
3502 global.transition = new ZoneTransition
3503 {
3504 state = ZoneTransition.EnterState.Dead,
3505 x = point.x,
3506 z = point.z
3507 };
3508 orgPos = new Point(x, z);
3509 if (factionBranch != null)
3510 {
3512 factionBranch.policies.Validate();
3513 }
3514 }
void RefreshWorkElements(ElementContainer parent=null)
Definition: Chara.cs:9033
Chara SetHomeZone(Zone zone)
Definition: Chara.cs:1449
PolicyManager policies
bool IsActiveZone
Definition: Zone.cs:495

References Zone.AddCard(), Point.GetNearestPoint(), Zone.IsActiveZone, party, EClass.pc, FactionBranch.policies, Party.RemoveMember(), Revive, PolicyManager.Validate(), and Point.x.

◆ MoveNeighborDefinitely()

bool Chara.MoveNeighborDefinitely ( )
inline

Definition at line 2624 of file Chara.cs.

2625 {
2626 List<Point> list = new List<Point>();
2627 pos.ForeachNeighbor(delegate(Point p)
2628 {
2629 list.Add(p.Copy());
2630 });
2631 list.Shuffle();
2632 foreach (Point item in list)
2633 {
2634 if (!item.Equals(pos) && !item.HasChara && TryMove(item) == MoveResult.Success)
2635 {
2636 return true;
2637 }
2638 }
2639 return false;
2640 }
override MoveResult TryMove(Point newPoint, bool allowDestroyPath=true)
Definition: Chara.cs:2712
void ForeachNeighbor(Action< Point > action, bool diagonal=true)
Definition: Point.cs:1397

References Point.Copy(), Point.ForeachNeighbor(), item, Card.pos, and TryMove().

Referenced by AI_Idle.Run().

◆ MoveRandom()

bool Chara.MoveRandom ( )
inline

Definition at line 2610 of file Chara.cs.

2611 {
2612 Point randomNeighbor = pos.GetRandomNeighbor();
2613 if (!randomNeighbor.Equals(pos) && !randomNeighbor.HasChara && HasAccess(randomNeighbor))
2614 {
2615 if ((race.tag.Contains("water") || source.tag.Contains("water")) && pos.cell.IsTopWaterAndNoSnow && !randomNeighbor.IsDeepWater)
2616 {
2617 return false;
2618 }
2619 return TryMove(randomNeighbor) == MoveResult.Success;
2620 }
2621 return false;
2622 }
bool IsTopWaterAndNoSnow
Definition: Cell.cs:712
bool IsDeepWater
Definition: Point.cs:276

References Point.cell, Point.Equals(), Point.GetRandomNeighbor(), HasAccess(), Point.HasChara, Point.IsDeepWater, Cell.IsTopWaterAndNoSnow, Card.pos, race, source, and TryMove().

Referenced by GoalSleep.Run(), NoGoal.Run(), and GoalCombat.TryMove().

◆ MoveZone() [1/3]

◆ MoveZone() [2/3]

void Chara.MoveZone ( Zone  z,
ZoneTransition  transition 
)
inline

Definition at line 3344 of file Chara.cs.

3345 {
3346 if (z == currentZone)
3347 {
3348 return;
3349 }
3350 if (HasCondition<ConInvulnerable>())
3351 {
3352 RemoveCondition<ConInvulnerable>();
3353 }
3354 if (IsPC)
3355 {
3356 EClass.player.nextZone = z;
3358 {
3361 {
3362 if (EClass.player.returnInfo != null)
3363 {
3364 EClass.player.returnInfo.turns += 5;
3365 }
3367 {
3368 EClass.game.Save(isAutoSave: true);
3369 }
3370 }
3371 EClass.player.deathZoneMove = false;
3372 }
3374 if (currentZone.instance != null)
3375 {
3377 z = EClass.game.spatials.Find(instance.uidZone) ?? EClass.pc.homeZone;
3378 transition = new ZoneTransition
3379 {
3380 state = instance.ReturnState,
3381 x = instance.x,
3382 z = instance.z
3383 };
3384 instance.OnLeaveZone();
3385 Debug.Log(z);
3386 }
3387 EInput.Consume(consumeAxis: true);
3388 EClass.player.uidLastZone = currentZone.uid;
3390 {
3392 {
3393 Msg.Say("enterZone", z.Name);
3394 }
3395 else
3396 {
3397 if (z.IsRegion)
3398 {
3399 Msg.Say("leaveZone", currentZone.Name);
3400 }
3401 else if (z.id != currentZone.id)
3402 {
3403 Msg.Say("enterZone", z.Name);
3404 }
3405 EClass.player.lastZonePos = pos.Copy();
3406 }
3407 EClass.player.lastTransition = transition;
3408 }
3409 foreach (Chara item in EClass._map.charas.Where((Chara c) => c.IsPCPartyMinion && c.master != EClass.pc).ToList())
3410 {
3412 }
3413 EClass.player.listCarryoverMap = EClass._map.charas.Where((Chara c) => c.c_uidMaster != 0 && c.FindMaster() == EClass.pc && c.c_minionType == MinionType.Default).ToList();
3414 if (!z.IsRegion && (z is Zone_Tent || currentZone is Zone_Tent))
3415 {
3416 foreach (Chara chara in EClass._map.charas)
3417 {
3418 if (chara.c_uidMaster == 0 && !chara.IsGlobal && !chara.isNPCProperty && (chara.id == "reaper" || chara.id == "messenger_death") && ((chara.enemy != null && chara.enemy.IsPCFactionOrMinion) || chara.Dist(EClass.pc) < 5))
3419 {
3420 EClass.player.listCarryoverMap.Add(chara);
3421 }
3422 }
3423 }
3424 foreach (Chara item2 in EClass.player.listCarryoverMap)
3425 {
3426 EClass._zone.RemoveCard(item2);
3427 }
3428 }
3429 if (party != null && party.leader == this)
3430 {
3431 foreach (Chara member in party.members)
3432 {
3433 if (member != this && !member.isDead && member.parent is Zone)
3434 {
3435 member.MoveZone(z);
3436 }
3437 }
3438 }
3439 if (global == null)
3440 {
3441 Debug.Log(base.Name);
3442 return;
3443 }
3444 transition.uidLastZone = currentZone?.uid ?? 0;
3445 global.transition = transition;
3446 if (z.IsActiveZone)
3447 {
3448 Point spawnPos = z.GetSpawnPos(this);
3449 global.transition = null;
3450 if (IsPC)
3451 {
3452 EClass.player.lastTransition = null;
3453 }
3454 z.AddCard(this, spawnPos);
3455 if (IsBranchMember())
3456 {
3458 }
3459 }
3460 else
3461 {
3462 z.AddCard(this);
3463 }
3464 }
MinionType c_minionType
Definition: Card.cs:989
bool IsBranchMember()
Definition: Chara.cs:6590
GlobalData global
Definition: Chara.cs:76
Chara FindMaster()
Definition: Chara.cs:2419
bool ignoreAutoSave
Definition: CoreDebug.cs:126
bool Save(bool isAutoSave=false, bool silent=false)
Definition: Game.cs:1035
RoomManager rooms
Definition: Map.cs:31
Chara leader
Definition: Party.cs:31
bool deathZoneMove
Definition: Player.cs:1169
List< Chara > listCarryoverMap
Definition: Player.cs:1223
ReturnInfo returnInfo
Definition: Player.cs:866
bool simulatingZone
Definition: Player.cs:1179
void AssignCharas()
Definition: RoomManager.cs:39
int uid
Definition: Spatial.cs:70
string id
Definition: Spatial.cs:13
virtual ZoneTransition.EnterState ReturnState
Definition: ZoneInstance.cs:26
virtual void OnLeaveZone()
Definition: ZoneInstance.cs:36
virtual bool WillAutoSave
Definition: Zone.cs:263
Point GetSpawnPos(Chara c, ZoneTransition.EnterState destState=ZoneTransition.EnterState.Auto)
Definition: Zone.cs:1350

References EClass._map, EClass._zone, Zone.AddCard(), RoomManager.AssignCharas(), Card.c_minionType, Card.c_uidMaster, Map.charas, EInput.Consume(), Player.deathZoneMove, EClass.debug, Debug, Card.Dist(), enemy, SpatialManager.Find(), FindMaster(), EClass.game, Zone.GetSpawnPos(), Zone.GetTopZone(), homeZone, Card.id, Spatial.id, CoreDebug.ignoreAutoSave, Zone.instance, Zone.IsActiveZone, isDead, IsGlobal, Card.isNPCProperty, Zone.IsPCFaction, Card.IsPCFactionOrMinion, IsPCPartyMinion, Spatial.IsRegion, item, Party.leader, Player.listCarryoverMap, master, Party.members, MoveZone(), Spatial.Name, ZoneInstance.OnLeaveZone(), Card.parent, EClass.pc, EClass.player, Zone.RemoveCard(), Player.returnInfo, ZoneInstance.ReturnState, Map.rooms, Game.Save(), Msg.Say(), Player.simulatingZone, Game.spatials, ZoneInstance.uidZone, Zone.WillAutoSave, and ZoneInstance.x.

◆ MoveZone() [3/3]

void Chara.MoveZone ( Zone  z,
ZoneTransition::EnterState  state = ZoneTransition::EnterState::Auto 
)
inline

Definition at line 3336 of file Chara.cs.

3337 {
3339 {
3340 state = state
3341 });
3342 }

◆ MutateRandom()

bool Chara.MutateRandom ( int  vec = 0,
int  tries = 100,
bool  ether = false,
BlessedState  state = BlessedState::Normal 
)
inline

Definition at line 10013 of file Chara.cs.

10014 {
10015 if (!ether && vec >= 0 && HasElement(406) && EClass.rnd(5) != 0)
10016 {
10017 Say("resistMutation", this);
10018 return false;
10019 }
10020 IEnumerable<SourceElement.Row> ie = EClass.sources.elements.rows.Where((SourceElement.Row a) => a.category == (ether ? "ether" : "mutation") && !a.tag.Contains("noRandomMutation"));
10021 for (int i = 0; i < tries; i++)
10022 {
10023 SourceElement.Row row = ie.RandomItem();
10024 if (i == 0 && vec < 0 && ether && base.c_corruptionHistory != null && base.c_corruptionHistory.Count > 0)
10025 {
10026 if (EClass.sources.elements.map.ContainsKey(base.c_corruptionHistory.LastItem()))
10027 {
10028 row = EClass.sources.elements.map[base.c_corruptionHistory.LastItem()];
10029 }
10030 base.c_corruptionHistory.RemoveAt(base.c_corruptionHistory.Count - 1);
10031 if (base.c_corruptionHistory.Count == 0)
10032 {
10033 base.c_corruptionHistory = null;
10034 }
10035 }
10036 Element element = elements.GetElement(row.id);
10037 int num = 1;
10038 if ((vec > 0 && ((row.id == 1563 && corruption < 300) || (row.id == 1562 && corruption < 1000 && base.IsPowerful))) || (vec < 0 && (element == null || element.Value <= 0)) || (vec > 0 && element != null && element.Value >= row.max))
10039 {
10040 continue;
10041 }
10042 if (element == null && !row.aliasParent.IsEmpty() && elements.Has(row.aliasParent))
10043 {
10044 row = EClass.sources.elements.alias[row.aliasParent];
10045 element = elements.GetElement(row.id);
10046 }
10047 bool flag = row.tag.Contains("neg");
10048 if (vec > 0)
10049 {
10050 if ((state >= BlessedState.Blessed && flag) || (state <= BlessedState.Cursed && !flag))
10051 {
10052 continue;
10053 }
10054 }
10055 else if (vec < 0 && ((state >= BlessedState.Blessed && !flag) || (state <= BlessedState.Cursed && flag)))
10056 {
10057 continue;
10058 }
10059 bool flag2 = true;
10060 if (element != null)
10061 {
10062 num = element.Value + ((vec != 0) ? vec : ((EClass.rnd(2) == 0) ? 1 : (-1)));
10063 if (num > element.source.max)
10064 {
10065 num = element.source.max - 1;
10066 }
10067 flag = (flag && num > element.Value) || (!flag && num < element.Value);
10068 flag2 = num > element.Value;
10069 if (vec > 0 && !flag2)
10070 {
10071 continue;
10072 }
10073 }
10074 Say(flag2 ? "mutation_gain" : "mutation_loose", this);
10075 SetFeat(row.id, num);
10076 if (flag2 && ether)
10077 {
10078 if (base.c_corruptionHistory == null)
10079 {
10080 base.c_corruptionHistory = new List<int>();
10081 }
10082 base.c_corruptionHistory.Add(row.id);
10083 if (IsPCFaction)
10084 {
10085 Element element2 = elements.GetElement(row.id);
10086 WidgetPopText.Say("popEther".lang(element2.Name, base.Name));
10087 }
10089 {
10090 EClass.player.flags.gotEtherDisease = true;
10091 Thing thing = ThingGen.Create("parchment");
10092 thing.SetStr(53, "letter_ether");
10093 Thing thing2 = ThingGen.Create("1165");
10094 thing2.SetBlessedState(BlessedState.Normal);
10095 Thing p = ThingGen.CreateParcel(null, thing2, thing);
10097 }
10098 }
10099 if (EClass.core.IsGameStarted && pos != null)
10100 {
10101 PlaySound(ether ? "mutation_ether" : "mutation");
10102 PlayEffect("mutation");
10104 Say(row.GetText(flag ? "textDec" : "textInc", returnNull: true) ?? row.alias, this);
10105 }
10106 return true;
10107 }
10108 Say("nothingHappens");
10109 return false;
10110 }
void SetStr(int id, string value=null)
Definition: BaseCard.cs:63
virtual void SetBlessedState(BlessedState s)
Definition: Card.cs:3924
bool IsGameStarted
Definition: Core.cs:84
bool Has(int ele)
Color MutateBad
Definition: MsgColors.cs:21
Color MutateGood
Definition: MsgColors.cs:19
bool gotEtherDisease
Definition: Player.cs:467
static Thing CreateParcel(string idLang=null, params Thing[] things)
Definition: ThingGen.cs:42
void SendPackage(Thing p)
Definition: World.cs:68

References SourceElement.Row.alias, SourceElement.Row.aliasParent, Msg.colors, EClass.core, ThingGen.Create(), ThingGen.CreateParcel(), SourceManager.elements, Player.flags, Player.Flags.gotEtherDisease, SourceElement.Row.id, Core.IsGameStarted, SourceElement.Row.max, MsgColors.MutateBad, MsgColors.MutateGood, Element.Name, EClass.player, EClass.rnd(), WidgetPopText.Say(), World.SendPackage(), Card.SetBlessedState(), Msg.SetColor(), BaseCard.SetStr(), Element.source, EClass.sources, SourceElement.Row.tag, Element.Value, and EClass.world.

◆ OnAdvanceDay()

void Chara.OnAdvanceDay ( )
inline

Definition at line 10162 of file Chara.cs.

10163 {
10164 if (_historyFood != null)
10165 {
10166 while (_historyFood.Count > 5)
10167 {
10168 _historyFood.RemoveAt(_historyFood.Count - 1);
10169 }
10170 if (_historyFood[0].Count > 0)
10171 {
10172 _historyFood.Insert(0, new List<string>());
10173 }
10174 }
10175 }

Referenced by GameDate.AdvanceDay().

◆ OnBanish()

void Chara.OnBanish ( )
inline

Definition at line 1463 of file Chara.cs.

1464 {
1465 if (!IsGlobal)
1466 {
1467 return;
1468 }
1469 memberType = FactionMemberType.Default;
1470 foreach (Thing item in things.List((Thing a) => a.HasTag(CTAG.godArtifact)).ToList())
1471 {
1473 }
1474 UniqueData uniqueData = base.c_uniqueData;
1475 if (uniqueData != null)
1476 {
1477 Debug.Log(uniqueData.uidZone + "/" + EClass.game.spatials.map.ContainsKey(uniqueData.uidZone) + "/" + uniqueData.x + "/" + uniqueData.y);
1478 }
1479 if (uniqueData != null && EClass.game.spatials.map.ContainsKey(uniqueData.uidZone))
1480 {
1481 MoveHome(EClass.game.spatials.map[uniqueData.uidZone] as Zone, uniqueData.x, uniqueData.y);
1482 return;
1483 }
1484 Zone z = EClass.game.spatials.Find("somewhere");
1485 if (trait is TraitAdventurer)
1486 {
1487 z = EClass.world.region.ListTowns().RandomItem();
1488 SetHomeZone(z);
1489 }
1490 MoveZone(z, ZoneTransition.EnterState.RandomVisit);
1491 }
void PickOrDrop(Point p, string idThing, int idMat=-1, int num=1, bool msg=true)
Definition: Chara.cs:4308
List< Zone > ListTowns()
Definition: Region.cs:271
GlobalSpatialList map
int uidZone
Definition: UniqueData.cs:12

References Debug, SpatialManager.Find(), EClass.game, Card.HasTag(), IsGlobal, item, ThingContainer.List(), Region.ListTowns(), SpatialManager.map, memberType, MoveHome(), MoveZone(), EClass.pc, PickOrDrop(), Card.pos, World.region, SetHomeZone(), Game.spatials, Card.things, trait, UniqueData.uidZone, EClass.world, UniqueData.x, and UniqueData.y.

Referenced by FactionBranch.BanishMember().

◆ OnBeforeCreate()

override void Chara.OnBeforeCreate ( )
inlinevirtual

Reimplemented from Card.

Definition at line 1530 of file Chara.cs.

1531 {
1532 if (source.job == "*r")
1533 {
1534 base.c_idJob = EClass.sources.jobs.rows.Where((SourceJob.Row j) => j.playable < 4).RandomItem().id;
1535 }
1536 if (bp.idJob != null)
1537 {
1538 base.c_idJob = bp.idJob;
1539 }
1540 if (bp.idRace != null)
1541 {
1542 base.c_idRace = bp.idRace;
1543 }
1544 }
CardBlueprint bp
Definition: Card.cs:78
SourceJob jobs

References Card.bp, CardBlueprint.idJob, CardBlueprint.idRace, SourceManager.jobs, source, and EClass.sources.

◆ OnCreate()

override void Chara.OnCreate ( int  genLv)
inlinevirtual

Reimplemented from Card.

Definition at line 1546 of file Chara.cs.

1547 {
1548 if (source.tag.Contains("boss"))
1549 {
1550 bossText = true;
1551 }
1552 int num = ((bp.lv != -999) ? bp.lv : base.LV);
1553 if (trait.AdvType == TraitChara.Adv_Type.Adv || trait.AdvType == TraitChara.Adv_Type.Adv_Fairy)
1554 {
1555 if (ListAdvRace.Count == 0)
1556 {
1557 ListAdvRace = EClass.sources.races.rows.Where((SourceRace.Row a) => a.playable <= 1 && a.id != "fairy").ToList();
1558 ListAdvJob = EClass.sources.jobs.rows.Where((SourceJob.Row a) => a.playable <= 4).ToList();
1559 }
1560 if (trait.AdvType == TraitChara.Adv_Type.Adv)
1561 {
1562 base.c_idRace = ListAdvRace.RandomItem().id;
1563 }
1564 base.c_idJob = ListAdvJob.RandomItem().id;
1565 _race = null;
1566 _job = null;
1567 num = 10 + EClass.rnd(40);
1568 }
1569 bio = new Biography();
1570 bio.Generate(this);
1571 if (source.idActor.Length != 0 && source.idActor[0] == "pcc" && pccData == null)
1572 {
1573 pccData = PCCData.Create(IDPCCBodySet);
1574 if (source.idActor.Length > 2)
1575 {
1576 pccData.SetPart("body", IDPCCBodySet, source.idActor[2]);
1577 }
1578 else
1579 {
1580 pccData.Randomize(IDPCCBodySet);
1581 }
1582 }
1583 if (source.mainElement.Length != 0)
1584 {
1585 int _genLv = Mathf.Min(genLv, 100);
1586 List<Tuple<string, int, int>> list = new List<Tuple<string, int, int>>();
1587 string[] mainElement = source.mainElement;
1588 for (int i = 0; i < mainElement.Length; i++)
1589 {
1590 string[] array = mainElement[i].Split('/');
1591 SourceElement.Row row = EClass.sources.elements.alias["ele" + array[0]];
1592 int num2 = source.LV * row.eleP / 100;
1593 if (list.Count == 0 || num2 < _genLv || array[0] == bp.idEle)
1594 {
1595 list.Add(new Tuple<string, int, int>(array[0], (array.Length > 1) ? int.Parse(array[1]) : 0, num2));
1596 }
1597 }
1598 Tuple<string, int, int> tuple = list.RandomItemWeighted((Tuple<string, int, int> a) => 10000 / (100 + (_genLv - a.Item3) * 25));
1599 if (!bp.idEle.IsEmpty())
1600 {
1601 tuple = list.Where((Tuple<string, int, int> a) => a.Item1 == bp.idEle || "ele" + a.Item1 == bp.idEle).FirstOrDefault() ?? tuple;
1602 }
1603 SetMainElement(tuple.Item1, (tuple.Item2 == 0) ? 10 : tuple.Item2, elemental: true);
1604 if (list.Count >= 2)
1605 {
1606 num = tuple.Item3 + base.LV - source.LV;
1607 }
1608 }
1609 if (source.name == "*r")
1610 {
1611 base.c_altName = NameGen.getRandomName();
1612 }
1613 if (source.GetText("aka") == "*r" || trait.UseRandomAlias)
1614 {
1615 _alias = AliasGen.GetRandomAlias();
1616 }
1617 happiness = EClass.rnd(100);
1618 contribution = EClass.rnd(100);
1619 RerollHobby();
1620 _idTimeTable = ((EClass.rnd(5) == 0) ? 1 : 0);
1621 ApplyRace();
1622 ApplyJob();
1623 ChangeMaterial(source.defMat.IsEmpty(race.material), ignoreFixedMaterial: true);
1624 if (num != source.LV)
1625 {
1626 SetLv(num);
1627 }
1628 if (base.LV > 5 && race.id == "mutant")
1629 {
1630 for (int j = 0; j < Mathf.Min(1 + base.LV / 5, 20); j++)
1631 {
1632 SetFeat(1644, j + 1);
1633 }
1634 }
1635 switch (id)
1636 {
1637 case "putty_mech_b":
1638 case "putty_mech":
1639 case "robot":
1640 SetFeat(1248, 1 + EClass.rnd(5));
1641 break;
1642 }
1643 InitStats();
1644 body.SetOwner(this);
1646 if (race.EQ.Length != 0 || !source.equip.IsEmpty())
1647 {
1648 TryRestock(onCreate: true);
1649 }
1650 switch (id)
1651 {
1652 case "dodo":
1653 base.idSkin = EClass.rnd(4);
1654 break;
1655 case "putty_snow":
1656 if (EClass.rnd(100) == 0 || EClass.debug.enable)
1657 {
1658 base.idSkin = EClass.rnd(4);
1659 }
1660 break;
1661 case "snail":
1662 base.idSkin = 5;
1663 break;
1664 case "olderyoungersister":
1665 base.idSkin = 1;
1666 break;
1667 case "sister_undead":
1668 case "dog":
1669 case "cat":
1670 base.idSkin = EClass.rnd(sourceCard.tiles.Length);
1671 if (id == "sister_undead" && EClass.rnd(10) == 0)
1672 {
1674 if (row2 != null && (!EClass.player.doneBackers.Contains(row2.id) || EClass.core.config.test.ignoreBackerDestoryFlag))
1675 {
1676 ApplyBacker(row2.id);
1677 }
1678 }
1679 break;
1680 case "baby":
1681 case "ika":
1682 SetFeat(1232, 3);
1683 break;
1684 }
1685 if (HasTag(CTAG.random_color))
1686 {
1687 DyeRandom();
1688 }
1689 SetAI(new NoGoal());
1690 if (!source.faith.IsEmpty())
1691 {
1692 SetFaith(source.faith);
1693 }
1694 else if (EClass.game.activeZone != null && EClass.game.activeZone.id == "foxtown")
1695 {
1697 }
1698 else if (EClass.game.activeZone != null && EClass.game.activeZone.id == "foxtown_nefu")
1699 {
1701 }
1702 else
1703 {
1704 SetFaith(EClass.game.religions.GetRandomReligion(onlyJoinable: true, EClass.rnd(10) == 0));
1705 }
1706 _affinity = 0;
1707 interest = 100;
1710 Refresh();
1711 stamina.value = stamina.max;
1712 mana.value = mana.max;
1713 isCreated = true;
1714 }
static int indexSister
void Generate(Chara c)
Definition: Biography.cs:323
void ClampInitialSkill()
Definition: Card.cs:2962
void DyeRandom()
Definition: Card.cs:6151
void ApplyBacker(int bid)
Definition: Card.cs:7171
int genLv
Definition: Card.cs:195
void SetOwner(Chara chara, bool deserialized=false)
Definition: CharaBody.cs:18
string IDPCCBodySet
Definition: Chara.cs:493
int _affinity
Definition: Chara.cs:305
void SetMainElement(string id, int v=0, bool elemental=false)
Definition: Chara.cs:2105
int happiness
Definition: Chara.cs:110
int contribution
Definition: Chara.cs:18
void CalculateMaxStamina()
Definition: Chara.cs:2037
bool isCreated
Definition: Chara.cs:138
int _idTimeTable
Definition: Chara.cs:343
void TryRestock(bool onCreate)
Definition: Chara.cs:4703
static List< SourceRace.Row > ListAdvRace
Definition: Chara.cs:168
void InitStats(bool onDeserialize=false)
Definition: Chara.cs:9250
bool bossText
Definition: Chara.cs:146
static List< SourceJob.Row > ListAdvJob
Definition: Chara.cs:170
bool ignoreBackerDestoryFlag
Definition: CoreConfig.cs:562
bool enable
Definition: CoreDebug.cs:286
ReligionTrickery Trickery
Religion GetRandomReligion(bool onlyJoinable=true, bool includeMinor=false)
int[] tiles
Definition: RenderRow.cs:10
List< Row > listSister
Definition: SourceBacker.cs:79
SourceRace races
virtual Adv_Type AdvType
Definition: TraitChara.cs:99
virtual bool UseRandomAlias
Definition: TraitChara.cs:127

References _affinity, _alias, _idTimeTable, _job, _race, Game.activeZone, TraitChara.AdvType, Card.ApplyBacker(), ApplyJob(), ApplyRace(), SourceManager.backers, Card.bio, body, bossText, Card.bp, CalculateMaxStamina(), ChangeMaterial, Card.ClampInitialSkill(), Core.config, contribution, EClass.core, EClass.debug, Player.doneBackers, Card.DyeRandom(), SourceManager.elements, CoreDebug.enable, EClass.game, Biography.Generate(), Card.genLv, ReligionManager.GetRandomReligion(), happiness, Card.HasTag(), hostility, SourceBacker.Row.id, Spatial.id, CardBlueprint.idEle, IDPCCBodySet, CoreConfig.Test.ignoreBackerDestoryFlag, BackerContent.indexSister, InitStats(), interest, isCreated, SourceManager.jobs, ListAdvJob, ListAdvRace, SourceBacker.listSister, CardBlueprint.lv, mana, Stats.max, ReligionManager.MoonShadow, OriginalHostility, pccData, EClass.player, race, SourceManager.races, Refresh(), Game.religions, RerollHobby(), EClass.rnd(), SetAI(), SetFaith(), SetFeat(), Card.SetLv(), SetMainElement(), CharaBody.SetOwner(), source, sourceCard, EClass.sources, stamina, CoreConfig.test, RenderRow.tiles, trait, ReligionManager.Trickery, TryRestock(), and TraitChara.UseRandomAlias.

◆ OnDeserialized()

override void Chara.OnDeserialized ( )
inlineprotectedvirtual

Reimplemented from Card.

Definition at line 1341 of file Chara.cs.

1342 {
1343 isCreated = true;
1344 _cbits1.Bits = (uint)_cints[0];
1345 InitStats(onDeserialize: true);
1346 body.SetOwner(this, deserialized: true);
1347 elements.ApplyElementMap(base.uid, SourceValueType.Chara, job.elementMap, base.DefaultLV);
1348 elements.ApplyElementMap(base.uid, SourceValueType.Chara, race.elementMap, base.DefaultLV);
1349 if (global != null && global.goal != null)
1350 {
1351 global.goal.SetOwner(this);
1352 }
1353 if (IsPCC)
1354 {
1355 pccData.state = (base.isCensored ? PCCState.Naked : PCCState.Normal);
1356 }
1357 if (tempElements != null)
1358 {
1359 tempElements.SetParent(this);
1360 }
1361 UpdateAngle();
1363 Refresh();
1364 if (source.tag.Contains("boss"))
1365 {
1366 bossText = true;
1367 }
1368 sharedCheckTurn = EClass.rnd(200);
1369 }
int sharedCheckTurn
Definition: Chara.cs:120
void UpdateAngle()
Definition: Chara.cs:3597
GlobalGoal goal
Definition: GlobalData.cs:9
void SetOwner(Chara c)
Definition: GlobalGoal.cs:10

References _cints, ElementContainer.ApplyElementMap(), body, bossText, Card.elements, global, GlobalData.goal, InitStats(), isCreated, IsPCC, job, race, Refresh(), RefreshFaithElement(), EClass.rnd(), GlobalGoal.SetOwner(), CharaBody.SetOwner(), ElementContainer.SetParent(), sharedCheckTurn, source, tempElements, and UpdateAngle().

◆ OnGiveErohon()

void Chara.OnGiveErohon ( Thing  t)
inline

Definition at line 8382 of file Chara.cs.

8383 {
8384 Say("give_erohon", this);
8385 AddCondition<ConParalyze>(50, force: true);
8386 AddCondition<ConConfuse>(50, force: true);
8387 AddCondition<ConFear>(1000, force: true);
8388 ModAffinity(EClass.pc, 100);
8389 t.Destroy();
8390 Talk("pervert");
8391 }

References Card.Destroy(), and EClass.pc.

Referenced by GiveGift(), and ActThrow.Throw().

◆ OnInsulted()

void Chara.OnInsulted ( )
inline

Definition at line 8188 of file Chara.cs.

8189 {
8190 if (!isDead)
8191 {
8192 if (HasElement(1231))
8193 {
8194 Talk("insulted");
8195 AddCondition<ConEuphoric>(100 * Evalue(1231));
8196 }
8197 else if (EClass.rnd(20) == 0)
8198 {
8199 SetFeat(1231, 1, msg: true);
8200 }
8201 }
8202 }

References EClass.rnd().

Referenced by AI_Idle.Run().

◆ OnSerializing()

override void Chara.OnSerializing ( )
inlineprotectedvirtual

Reimplemented from Card.

Definition at line 1326 of file Chara.cs.

1327 {
1328 if (enemy != null)
1329 {
1330 SetInt(55, enemy.uid);
1331 }
1332 _cints[0] = (int)_cbits1.Bits;
1333 List<BodySlot> slots = body.slots;
1334 rawSlots = new int[slots.Count];
1335 for (int i = 0; i < slots.Count; i++)
1336 {
1337 rawSlots[i] = slots[i].elementId;
1338 }
1339 }
List< BodySlot > slots
Definition: CharaBody.cs:8
int[] rawSlots
Definition: Chara.cs:73
BitArray32 _cbits1
Definition: Chara.cs:84
uint Bits
Definition: BitArray32.cs:6

References _cbits1, _cints, BitArray32.Bits, body, enemy, rawSlots, BaseCard.SetInt(), CharaBody.slots, and Card.uid.

◆ OnSleep() [1/2]

void Chara.OnSleep ( int  power,
int  days = 1,
bool  isSunLit = false 
)
inline

Definition at line 9765 of file Chara.cs.

9766 {
9767 if (days < 1)
9768 {
9769 days = 1;
9770 }
9771 int num = power * days;
9772 if (stamina.value < 0)
9773 {
9774 stamina.Set(1);
9775 }
9776 if (isWeakToSunlight && isSunLit)
9777 {
9778 base.hp = 0;
9779 if (mana.value > 0)
9780 {
9781 mana.Set(0);
9782 }
9783 AddCondition<ConBurning>(1000, force: true);
9784 }
9785 else
9786 {
9787 HealHP(num);
9788 stamina.Mod(10 + 25 * num / 100 * (100 + elements.GetFeatRef(1642)) / 100);
9789 mana.Mod(num);
9790 }
9791 if (IsPCFaction)
9792 {
9793 hunger.Mod(20);
9794 }
9795 sleepiness.Set(0);
9796 if (!IsMinion)
9797 {
9798 interest = 100;
9799 }
9800 Cure(CureType.Sleep, power);
9801 }
virtual void HealHP(int a, HealSource origin=HealSource.None)
Definition: Card.cs:4032
bool isWeakToSunlight
Definition: Chara.cs:154
int GetFeatRef(int ele, int idx=0)

References Stats.Mod(), Stats.Set(), and Stats.value.

◆ OnSleep() [2/2]

void Chara.OnSleep ( Thing  bed = null,
int  days = 1 
)
inline

Definition at line 9745 of file Chara.cs.

9746 {
9747 bool isSunLit = pos.IsSunLit;
9748 TraitPillow traitPillow = pos.FindThing<TraitPillow>();
9749 int num = bed?.Power ?? 20;
9750 if (traitPillow != null)
9751 {
9752 num += traitPillow.owner.Power / 2;
9753 }
9754 if (bed != null)
9755 {
9756 num += bed.Evalue(750) * 5;
9757 if (bed.trait is TraitBedCoffin)
9758 {
9759 isSunLit = false;
9760 }
9761 }
9762 OnSleep(num, days, isSunLit);
9763 }
void OnSleep(Thing bed=null, int days=1)
Definition: Chara.cs:9745
Thing FindThing(Func< Thing, bool > func)
Definition: Point.cs:1140

References bed.

Referenced by LayerSleep.Advance().

◆ ParseBodySlot()

int Chara.ParseBodySlot ( string  s)
inlineprivate

Definition at line 2204 of file Chara.cs.

2205 {
2206 return s switch
2207 {
2208 "é ­" => 30,
2209 "首" => 31,
2210 "体" => 32,
2211 "背" => 33,
2212 "手" => 35,
2213 "指" => 36,
2214 "è…•" => 34,
2215 "è…°" => 37,
2216 "è¶³" => 39,
2217 _ => -1,
2218 };
2219 }

Referenced by ApplyRace(), and ResetBody().

◆ PerformWork()

void Chara.PerformWork ( WorkSession  session,
bool  isHobby = false,
bool  IsRealTime = false 
)
inline

Definition at line 9208 of file Chara.cs.

9209 {
9210 Hobby hobby = new Hobby();
9211 hobby.id = session.id;
9212 WorkSummary workSummary = _workSummary;
9213 hobby.GetAI(this).OnPerformWork(IsRealTime);
9214 if (!isHobby)
9215 {
9216 workSummary.progress += EClass.rnd(5) + 5;
9217 }
9218 int num = PerformWork(hobby, 0, isHobby);
9219 int num2 = PerformWork(hobby, 1, isHobby);
9220 int num3 = PerformWork(hobby, 2, isHobby);
9221 int num4 = PerformWork(hobby, 3, isHobby);
9222 workSummary.money += num;
9223 workSummary.food += num2;
9224 workSummary.knowledge += num3;
9225 workSummary.material += num4;
9226 int PerformWork(Hobby work, int idx, bool isHobby)
9227 {
9228 if (idx >= work.source.resources.Length)
9229 {
9230 return 0;
9231 }
9232 int num5 = work.source.resources[idx];
9233 int num6 = num5;
9234 num5 = Rand.Range(num5 * (100 - work.source.resources[idx]) / 100, num5);
9235 num5 = num5 * (isHobby ? 50 : 100) * session.efficiency / 10000;
9236 if (num6 > 0 && num5 <= 0)
9237 {
9238 num5 = 1;
9239 }
9240 return num5;
9241 }
9242 }
virtual void OnPerformWork(bool realtime)
Definition: AIWork.cs:150
void PerformWork(WorkSession session, bool isHobby=false, bool IsRealTime=false)
Definition: Chara.cs:9208
AIWork GetAI(Chara c)
Definition: Hobby.cs:12
static int Range(int min, int max)
Definition: Rand.cs:42
int efficiency
Definition: WorkSession.cs:28

References WorkSession.efficiency, Hobby.GetAI(), WorkSession.id, if(), AIWork.OnPerformWork(), Rand.Range(), EClass.rnd(), and Hobby.source.

◆ Pick()

Thing Chara.Pick ( Thing  t,
bool  msg = true,
bool  tryStack = true 
)
inline

Definition at line 4328 of file Chara.cs.

4329 {
4330 if (t.trait is TraitCard && t.isNew && EClass.game.config.autoCollectCard && !t.c_idRefCard.IsEmpty())
4331 {
4333 return t;
4334 }
4335 if (t.parent == this)
4336 {
4337 return t;
4338 }
4339 t = TryPoisonPotion(t);
4340 ThingContainer.DestData dest = things.GetDest(t, tryStack);
4341 if (!dest.IsValid)
4342 {
4343 if (t.parent != EClass._zone)
4344 {
4345 if (IsPC)
4346 {
4347 Say("backpack_full_drop", t);
4348 SE.Drop();
4349 }
4350 return EClass._zone.AddCard(t, pos).Thing;
4351 }
4352 if (IsPC)
4353 {
4354 Say("backpack_full", t);
4355 }
4356 return t;
4357 }
4358 if (dest.stack != null)
4359 {
4360 if (msg)
4361 {
4362 PlaySound("pick_thing");
4363 Say("pick_thing", this, t);
4364 }
4365 t.TryStackTo(dest.stack);
4366 return dest.stack;
4367 }
4368 TryAbsorbRod(t);
4369 if (msg)
4370 {
4371 PlaySound("pick_thing");
4372 Say("pick_thing", this, t);
4373 }
4375 return dest.container.AddThing(t, tryStack);
4376 }
bool isNew
Definition: Card.cs:483
bool TryStackTo(Thing to)
Definition: Card.cs:3426
string c_idRefCard
Definition: Card.cs:1738
void TryReservePickupTutorial(Thing t)
Definition: Chara.cs:4422
Thing TryPoisonPotion(Thing t)
Definition: Chara.cs:4378
void TryAbsorbRod(Thing t)
Definition: Chara.cs:4392
static void Collect(Thing t)
bool autoCollectCard
Definition: Game.cs:52
DestData GetDest(Thing t, bool tryStack=true)

References EClass._zone, Zone.AddCard(), Card.AddThing(), Game.Config.autoCollectCard, Card.c_idRefCard, ContentCodex.Collect(), Game.config, ThingContainer.DestData.container, EClass.game, Card.isNew, ThingContainer.DestData.IsValid, Card.parent, ThingContainer.DestData.stack, Card.Thing, Card.trait, and Card.TryStackTo().

Referenced by InvOwnerRecycle._OnProcess(), TraitGodStatue._OnUse(), ActPlan._Update(), TraitDrink.BlendLove(), TraitDrink.BlendPoison(), TraitCrafter.Craft(), QuestDeliver.Deliver(), FactionBranch.GetDailyIncome(), FortuneRollData.GetPrize(), TraitDrink.OnBlend(), InvOwner.OnClick(), ContentCodex.OnClickGetCard(), AI_UseCrafter.OnEnd(), AI_Fish.ProgressFish.OnProgressComplete(), ConSleep.OnRemoved(), AM_Blueprint.OnSave(), InvOwner.OnShiftClick(), QuestDebt.OnStart(), QuestDeliver.OnStart(), TraitGiftJure.OnUse(), TraitGiftNewYear.OnUse(), TraitGiftPack.OnUse(), TraitParcel.OnUse(), TraitPlamoBox.OnUse(), TraitPotionEmpty.OnUse(), InvOwnerDeliver.PayBill(), ActDreamBug.Perform(), ActPick.Perform(), ActEffect.Proc(), InvOwner.Transaction.Process(), Map.PutAway(), InvOwner.PutBack(), CoreDebug.Reset_LoytelDebt(), AI_Equip.Run(), AI_Idle.Run(), AI_OpenGambleChest.Run(), AI_Shear.Run(), AI_Steal.Run(), AI_UseCrafter.Run(), TaskCullLife.Run(), GameDate.ShipGoods(), ActThrow.Throw(), Recipe.TryGetFirstTimeBonus(), ActRanged.TryReload(), Map.TryShatter(), UIDragGridIngredients.Update(), and CoreDebug.UpdateInput().

◆ PickHeld()

void Chara.PickHeld ( bool  msg = false)
inline

Definition at line 4544 of file Chara.cs.

4545 {
4546 if (held == null)
4547 {
4548 return;
4549 }
4550 Card card = held;
4551 if (IsPC && held.invY == 1)
4552 {
4553 WidgetHotbar.dirtyCurrentItem = true;
4555 held = null;
4556 return;
4557 }
4558 if (held.isChara)
4559 {
4560 DropHeld();
4561 return;
4562 }
4564 {
4565 Say("canOnlyCarry", held);
4566 DropHeld();
4567 return;
4568 }
4569 bool flag = held != things.TryStack(held.Thing);
4570 if (!flag && things.IsOverflowing())
4571 {
4572 if (IsPC)
4573 {
4574 Say("backpack_full_drop", held);
4575 SE.Drop();
4576 }
4577 DropHeld();
4578 return;
4579 }
4580 if (msg)
4581 {
4582 PlaySound("pick_thing");
4583 Say("pick_held", this, card);
4584 if (IsPC && card.id == "statue_weird")
4585 {
4586 Say("statue_pick");
4587 }
4588 }
4589 if (IsPC)
4590 {
4591 WidgetHotbar.dirtyCurrentItem = true;
4592 if (!flag)
4593 {
4595 if (held.GetRootCard() != EClass.pc)
4596 {
4597 Pick(held.Thing, msg: false);
4598 }
4599 }
4600 }
4601 held = null;
4602 }
int invY
Definition: Card.cs:1956
bool IsHotItem
Definition: Card.cs:120
Card DropHeld(Point dropPos=null)
Definition: Chara.cs:4621
Thing TryStack(Thing target, int destInvX=-1, int destInvY=-1)

References Trait.CanOnlyCarry, card, Card.GetRootCard(), Card.invY, Card.isChara, Card.IsHotItem, EClass.pc, Pick, LayerInventory.SetDirty(), Card.Thing, Card.trait, and Card.TryStack().

Referenced by ActPlan._Update(), AIAct.Cancel(), HotItemHeld.OnUnselect(), Player.ResetCurrentHotItem(), AI_Idle.Run(), Player.SetCurrentHotItem(), AIAct.Start(), and InvOwner.TryHold().

◆ PickOrDrop() [1/2]

void Chara.PickOrDrop ( Point  p,
string  idThing,
int  idMat = -1,
int  num = 1,
bool  msg = true 
)
inline

Definition at line 4308 of file Chara.cs.

4309 {
4310 if (num != 0)
4311 {
4312 PickOrDrop(p, ThingGen.Create(idThing, idMat).SetNum(num), msg);
4313 }
4314 }

References ThingGen.Create(), and Card.SetNum().

Referenced by Map.MineObj(), OnBanish(), TraitBook.OnRead(), ConSuspend.OnRemoved(), TraitMannequin.OnUse(), FoodEffect.Proc(), TraitCanvas.TrySetAct(), and Map.TrySmoothPick().

◆ PickOrDrop() [2/2]

void Chara.PickOrDrop ( Point  p,
Thing  t,
bool  msg = true 
)
inline

Definition at line 4316 of file Chara.cs.

4317 {
4318 if (things.GetDest(t).IsValid)
4319 {
4320 Pick(t, msg);
4321 }
4322 else
4323 {
4324 EClass._zone.AddCard(t, p);
4325 }
4326 }

References EClass._zone, Zone.AddCard(), and Pick.

◆ Refresh()

void Chara.Refresh ( bool  calledRecursive = false)
inline

Definition at line 1747 of file Chara.cs.

1748 {
1749 if (source == null)
1750 {
1751 Debug.LogError("source is null");
1752 SetSource();
1753 }
1754 if (ride != null && ride.source != null)
1755 {
1756 ride.Refresh(calledRecursive: true);
1757 }
1758 hasTelepathy = false;
1759 isWet = false;
1760 _isLevitating = HasElement(401) || (ride != null && ride._isLevitating);
1762 isWeakToSunlight = HasElement(1251) && !HasElement(431);
1763 base.isHidden = HasElement(415);
1764 foreach (Condition condition in conditions)
1765 {
1766 condition.OnRefresh();
1767 }
1768 if (isWet)
1769 {
1770 base.isHidden = false;
1771 }
1773 SetDirtySpeed();
1774 if (host != null && !calledRecursive && host.source != null)
1775 {
1776 host.Refresh(calledRecursive: true);
1777 }
1778 }
virtual void OnRefresh()
void Refresh(bool calledRecursive=false)
Definition: Chara.cs:1747
bool isWet
Definition: Chara.cs:144
override void SetSource()
Definition: Chara.cs:2093
bool IsUndead
Definition: Chara.cs:893
bool IsHorror
Definition: Chara.cs:917
bool IsMachine
Definition: Chara.cs:905

References _isLevitating, canSeeInvisible, conditions, Debug, Card.HasElement(), hasTelepathy, host, IsHorror, IsMachine, IsMultisize, IsUndead, isWeakToSunlight, isWet, mimicry, BaseCondition.OnRefresh(), Refresh(), ride, SetDirtySpeed(), SetSource(), source, and visibleWithTelepathy.

Referenced by ElementContainerFaction.CheckDirty(), CharaBody.Equip(), Condition.Kill(), Game.OnLoad(), Player.OnLoad(), Player.OnStartNewGame(), Refresh(), CharaGenes.Remove(), ActRide.Ride(), CharaBody.Unequip(), and ActRide.Unride().

◆ RefreshFaithElement()

void Chara.RefreshFaithElement ( )
inline

Definition at line 10226 of file Chara.cs.

10227 {
10228 if (faithElements != null)
10229 {
10231 }
10233 if (idFaith == "eyth" && !HasElement(1228))
10234 {
10235 return;
10236 }
10237 SourceReligion.Row row = EClass.sources.religions.map.TryGetValue(idFaith);
10238 if (row == null)
10239 {
10240 return;
10241 }
10243 if (!HasCondition<ConExcommunication>())
10244 {
10245 SourceElement.Row row2 = EClass.sources.elements.alias.TryGetValue("featGod_" + row.id + "1");
10246 if (row2 != null)
10247 {
10248 faithElements.SetBase(row2.id, 1);
10249 }
10250 int[] array = row.elements;
10251 int num = GetPietyValue() * (120 + Evalue(1407) * 15 + Evalue(1228) * 20) / 100;
10252 for (int i = 0; i < array.Length; i += 2)
10253 {
10254 int num2 = array[i + 1] * num / 50;
10255 if (array[i] == 79)
10256 {
10257 num2 = EClass.curve(num2, array[i + 1] * 2, 10, 50);
10258 }
10259 if (num2 >= 20 && array[i] >= 950 && array[i] < 970)
10260 {
10261 num2 = 20;
10262 }
10263 faithElements.SetBase(array[i], Mathf.Max(num2, 1));
10264 }
10265 }
10267 }
string idFaith
Definition: Chara.cs:233
ElementContainer faithElements
Definition: Chara.cs:38
int GetPietyValue()
Definition: Chara.cs:10217
Element SetBase(string alias, int v, int potential=0)
SourceReligion religions

References EClass.curve(), SourceManager.elements, SourceReligion.Row.elements, SourceElement.Row.id, SourceReligion.Row.id, SourceManager.religions, ElementContainer.SetBase(), ElementContainer.SetParent(), and EClass.sources.

Referenced by TraitAltar._OnOffer(), Religion.JoinFaith(), Religion.LeaveFaith(), Player.OnAdvanceDay(), Skill.OnChangeValue(), Player.OnCreateGame(), OnDeserialized(), ConExcommunication.OnRefresh(), ConExcommunication.OnRemoved(), and SetFaith().

◆ RefreshSpeed()

void Chara.RefreshSpeed ( Element::BonusInfo  info = null)
inline

Definition at line 1890 of file Chara.cs.

1891 {
1892 if (ride != null && !ride.IsDeadOrSleeping)
1893 {
1895 _Speed = ride._Speed;
1896 info?.AddText("rideSpeed".lang(_Speed.ToString() ?? ""));
1897 }
1898 else if (host != null)
1899 {
1900 if (host.ride == this)
1901 {
1902 _Speed = Evalue(79);
1903 int a = Evalue(1423);
1904 int value = 100 + (int)_Speed * ((!race.tag.Contains("noRide")) ? 1 : 5) * Mathf.Max(a, 1) - base.STR - host.EvalueRiding() * 2 - (race.tag.Contains("ride") ? 50 : 0);
1905 _Speed = _Speed * 100 / Mathf.Clamp(value, 100, 1000);
1906 }
1907 else
1908 {
1909 _Speed = (Evalue(79) + host.Evalue(79)) / 2;
1910 }
1911 }
1912 else
1913 {
1914 _Speed = Evalue(79) + Evalue(407) / 2;
1915 }
1916 if (body.GetSlot(37, onlyEmpty: false)?.thing != null && HasElement(1209) && !HasElement(419))
1917 {
1918 _Speed -= 25L;
1919 info?.AddText(-25L, EClass.sources.elements.map[1209].GetName());
1920 }
1921 if (parasite != null)
1922 {
1923 long speed = _Speed;
1924 _Speed = _Speed * 100 / Mathf.Clamp(120 + parasite.LV * 2 - base.STR - Evalue(227) * 2, 100, 1000);
1925 info?.AddText(_Speed - speed, "parasiteSpeed".lang());
1926 }
1927 if (_Speed < elements.ValueWithoutLink(79) / 3)
1928 {
1930 info?.AddText("minSpeed".lang((elements.ValueWithoutLink(79) / 3).ToString() ?? ""));
1931 }
1932 int num = 100;
1933 if (EClass._zone.map != null && (EClass._zone.IsUnderwater || (base.Cell.IsTopWaterAndNoSnow && !base.Cell.isFloating)))
1934 {
1935 int num2 = Evalue(200);
1936 int num3 = Evalue(1252);
1937 num = 50 + Mathf.Clamp((int)Mathf.Sqrt(num2) * 5 - EClass._zone.DangerLv / 50, (num3 > 0) ? 50 : ((base.IsPowerful || IsMultisize) ? 40 : 0), 50) + Mathf.Clamp((int)Mathf.Sqrt(num2), 0, 25);
1938 if (info != null && num != 100)
1939 {
1940 info.AddFix(num - 100, EClass.sources.elements.map[200].GetName().ToTitleCase());
1941 }
1942 if (num3 > 0)
1943 {
1944 num += num3 * 20;
1945 info?.AddFix(num3 * 20, EClass.sources.elements.map[1252].GetName().ToTitleCase());
1946 }
1947 }
1948 if (IsPCFaction)
1949 {
1950 switch (burden.GetPhase())
1951 {
1952 case 1:
1953 num -= 10;
1954 info?.AddFix(-10, burden.GetPhaseStr());
1955 break;
1956 case 2:
1957 num -= 20;
1958 info?.AddFix(-20, burden.GetPhaseStr());
1959 break;
1960 case 3:
1961 num -= 30;
1962 info?.AddFix(-30, burden.GetPhaseStr());
1963 break;
1964 case 4:
1965 num -= (IsPC ? 50 : 100);
1966 info?.AddFix(IsPC ? (-50) : (-100), burden.GetPhaseStr());
1967 break;
1968 }
1969 if (IsPC)
1970 {
1971 switch (stamina.GetPhase())
1972 {
1973 case 1:
1974 num -= 10;
1975 info?.AddFix(-10, stamina.GetPhaseStr());
1976 break;
1977 case 0:
1978 num -= 20;
1979 info?.AddFix(-20, stamina.GetPhaseStr());
1980 break;
1981 }
1982 switch (sleepiness.GetPhase())
1983 {
1984 case 2:
1985 num -= 10;
1986 info?.AddFix(-10, sleepiness.GetPhaseStr());
1987 break;
1988 case 3:
1989 num -= 20;
1990 info?.AddFix(-20, sleepiness.GetPhaseStr());
1991 break;
1992 }
1993 switch (hunger.GetPhase())
1994 {
1995 case 3:
1996 case 4:
1997 num -= 10;
1998 info?.AddFix(-10, hunger.GetPhaseStr());
1999 break;
2000 case 5:
2001 num -= 30;
2002 info?.AddFix(-30, hunger.GetPhaseStr());
2003 break;
2004 }
2005 num += EClass.player.lastEmptyAlly * Evalue(1646);
2006 info?.AddFix(EClass.player.lastEmptyAlly * Evalue(1646), EClass.sources.elements.map[1646].GetName());
2007 }
2009 {
2010 num += EClass.player.lastEmptyAlly * 10 - 10;
2011 info?.AddFix(EClass.player.lastEmptyAlly * 10 - 10, "exceedParty".lang());
2012 }
2013 }
2014 else if (base.LV >= 1000 && !EClass.game.principal.disableVoidBlessing && !base.IsPCFactionOrMinion)
2015 {
2016 num += EClass.curve((base.LV - 900) / 100 * 10, 500, 100);
2017 info?.AddFix(EClass.curve((base.LV - 900) / 100 * 10, 500, 100), "enemySpeedBuff".lang());
2018 }
2019 if (HasCondition<ConGravity>())
2020 {
2021 num -= 30;
2022 info?.AddFix(-30, GetCondition<ConGravity>().Name);
2023 }
2024 if (_Speed < 10)
2025 {
2026 _Speed = 10L;
2027 }
2028 _Speed = _Speed * num / 100;
2029 if (_Speed < 10)
2030 {
2031 _Speed = 10L;
2032 info?.AddText("minSpeed".lang(10.ToString() ?? ""));
2033 }
2034 dirtySpeed = false;
2035 }
Thing thing
Definition: BodySlot.cs:8
override string ToString()
Definition: Chara.cs:1186
bool dirtySpeed
Definition: Chara.cs:172
long _Speed
Definition: Chara.cs:174
void AddText(string text, FontColor col=FontColor.Warning)
Definition: ELEMENT.cs:111
void AddFix(int v, string text)
Definition: ELEMENT.cs:132
bool disableVoidBlessing
int lastEmptyAlly
Definition: Player.cs:1193

References _Speed, EClass._zone, body, burden, EClass.curve(), Zone.DangerLv, dirtySpeed, GamePrincipal.disableVoidBlessing, Card.elements, SourceManager.elements, Card.Evalue(), EvalueRiding(), EClass.game, Stats.GetPhase(), BaseStats.GetPhaseStr(), CharaBody.GetSlot(), Card.HasElement(), host, hunger, IsDeadOrSleeping, IsMultisize, IsPC, IsPCFaction, IsPCParty, Zone.IsUnderwater, Player.lastEmptyAlly, Card.LV, Zone.map, Card.Name, parasite, EClass.player, Game.principal, race, RefreshSpeed(), ride, sleepiness, EClass.sources, stamina, BodySlot.thing, ToString(), and ElementContainer.ValueWithoutLink().

Referenced by _Move(), ConGravity.OnRefresh(), Player.RefreshEmptyAlly(), RefreshSpeed(), and Element.BonusInfo.WriteNote().

◆ RefreshWorkElements()

void Chara.RefreshWorkElements ( ElementContainer  parent = null)
inline

Definition at line 9033 of file Chara.cs.

9034 {
9035 if (workElements != null)
9036 {
9038 }
9039 workElements = null;
9040 if (IsPCParty || homeBranch == null || homeBranch.owner == null)
9041 {
9042 return;
9043 }
9044 foreach (Hobby item in ListHobbies())
9045 {
9046 TryAdd(item);
9047 }
9048 foreach (Hobby item2 in ListWorks())
9049 {
9050 TryAdd(item2);
9051 }
9052 if (workElements != null)
9053 {
9055 }
9056 void TryAdd(Hobby h)
9057 {
9058 if (!h.source.elements.IsEmpty())
9059 {
9060 if (workElements == null)
9061 {
9063 }
9064 for (int i = 0; i < h.source.elements.Length; i += 2)
9065 {
9066 int num = h.source.elements[i];
9067 int num2 = h.source.elements[i + 1];
9068 int num3 = 100;
9069 if (num != 2115 && num != 2207)
9070 {
9071 num3 = h.GetEfficiency(this) * homeBranch.efficiency / 100;
9072 if (num3 <= 0)
9073 {
9074 continue;
9075 }
9076 }
9077 workElements.ModBase(num, (num2 < 0) ? (num2 / 10) : Mathf.Max(1, h.source.elements[i + 1] * num3 / 1000));
9078 }
9079 }
9080 }
9081 }
ElementContainer workElements
Definition: Chara.cs:40
int GetEfficiency(Chara c)
Definition: Hobby.cs:31

References Hobby.GetEfficiency(), item, ElementContainer.ModBase(), FactionBranch.owner, ElementContainer.SetParent(), and Hobby.source.

Referenced by FactionBranch.AddMemeber(), Party.AddMemeber(), FactionBranch.ChangeMemberType(), FactionBranch.DailyOutcome(), FactionBranch.OnActivateZone(), Game.OnLoad(), FactionBranch.Recruit(), TraitGeneratorWheel.Refresh(), Party.RemoveMember(), and FactionBranch.RemoveMemeber().

◆ ReleaseMinion()

void Chara.ReleaseMinion ( )
inline

Definition at line 2396 of file Chara.cs.

2397 {
2398 base.c_uidMaster = 0;
2399 master = null;
2400 enemy = null;
2401 foreach (Chara chara in EClass._map.charas)
2402 {
2403 if (chara.enemy == this)
2404 {
2405 chara.SetEnemy();
2406 chara.ai.Cancel();
2407 }
2408 }
2409 ai.Cancel();
2410 Refresh();
2411 }

References EClass._map, ai, AIAct.Cancel(), Map.charas, enemy, master, Refresh(), and SetEnemy().

Referenced by _MakeAlly(), MakeMinion(), QuestEscort.ReleaseEscort(), and ActThrow.Throw().

◆ RemoveAllStances()

void Chara.RemoveAllStances ( )
inline

Definition at line 9650 of file Chara.cs.

9651 {
9652 for (int num = conditions.Count - 1; num >= 0; num--)
9653 {
9654 Condition condition = conditions[num];
9655 if (condition.Type == ConditionType.Stance)
9656 {
9657 condition.Kill();
9658 }
9659 }
9660 }

References Condition.Kill(), and BaseStats.Type.

Referenced by CharaGenes.Remove().

◆ RemoveCondition< T >()

void Chara.RemoveCondition< T > ( )
inline
Type Constraints
T :Condition 

Definition at line 9501 of file Chara.cs.

9501 : Condition
9502 {
9503 for (int num = conditions.Count - 1; num >= 0; num--)
9504 {
9505 if (conditions[num] is T)
9506 {
9507 conditions[num].Kill();
9508 break;
9509 }
9510 }
9511 }

References Condition.Kill().

◆ RemoveGlobal()

void Chara.RemoveGlobal ( )
inline

◆ RemoveLastBodyPart()

void Chara.RemoveLastBodyPart ( bool  msg = false)
inline

Definition at line 2232 of file Chara.cs.

2233 {
2234 if (body.slots.Count != 0)
2235 {
2236 BodySlot bodySlot = body.slots.LastItem();
2237 body.RemoveBodyPartAt(body.slots.Count - 1);
2238 if (msg)
2239 {
2240 Say("lose_bodyparts", this, Element.Get(bodySlot.elementId).GetName().ToLower());
2241 PlaySound("offering");
2242 }
2243 }
2244 }
int elementId
Definition: BodySlot.cs:6
void RemoveBodyPartAt(int idx)
Definition: CharaBody.cs:329

References body, BodySlot.elementId, Element.Get(), Card.PlaySound(), CharaBody.RemoveBodyPartAt(), Card.Say(), and CharaBody.slots.

Referenced by TraitFoodEggFertilized.Incubate().

◆ RequestProtection()

bool Chara.RequestProtection ( Chara  attacker,
Action< Chara action 
)
inline

Definition at line 8403 of file Chara.cs.

8404 {
8405 if (HasCondition<StanceTaunt>() || base.isRestrained || attacker == this)
8406 {
8407 return false;
8408 }
8409 if (host != null && host.isRestrained)
8410 {
8411 return false;
8412 }
8413 if (base.IsPCFactionOrMinion && attacker.IsPCFactionOrMinion)
8414 {
8415 return false;
8416 }
8417 bool flag = false;
8418 foreach (Chara chara in EClass._map.charas)
8419 {
8420 if (chara == attacker || chara.enemy == this || chara == this || chara.host != null || chara.IsDisabled || !chara.IsFriendOrAbove(this) || chara.conSuspend != null || (chara.IsPCParty && !IsPCParty) || (IsPCFaction && !chara.IsPCFaction) || (attacker.IsPCFactionOrMinion && chara.IsPCFactionOrMinion))
8421 {
8422 continue;
8423 }
8424 bool flag2 = chara.HasElement(1225) && !chara.GetBool(126);
8425 if ((!flag2 && (flag || EClass.rnd(2) == 0 || !chara.HasCondition<StanceTaunt>())) || chara.HasCooldown(1225))
8426 {
8427 continue;
8428 }
8429 int num = Mathf.Max(chara.Evalue(1649), (!chara.IsPC) ? ((!flag2) ? 1 : 3) : 0);
8430 int num2 = Dist(chara);
8431 if (num2 > 25)
8432 {
8433 continue;
8434 }
8435 if (num2 > num || !chara.CanSeeLos(pos, num2))
8436 {
8437 if (!flag2)
8438 {
8439 continue;
8440 }
8441 Point nearestPoint = pos.GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: true, ignoreCenter: true);
8442 if (!nearestPoint.IsValid)
8443 {
8444 continue;
8445 }
8446 chara.Teleport(nearestPoint);
8447 chara.AddCooldown(1225, 10);
8448 num2 = Dist(chara);
8449 Say("intercept_loyal", chara, this);
8450 chara.SetEnemy(attacker);
8451 attacker.SetEnemy(chara);
8452 if (num2 > num || !chara.CanSeeLos(pos, num2))
8453 {
8454 continue;
8455 }
8456 }
8457 if (!flag && !HasElement(1225))
8458 {
8459 Say("intercept", chara, this);
8460 if (EClass.rnd(10) == 0)
8461 {
8462 chara.Talk("intercept", base.NameSimple);
8463 }
8464 if (attacker.enemy == this)
8465 {
8466 attacker.SetEnemy(chara);
8467 }
8468 action(chara);
8469 flag = true;
8470 }
8471 }
8472 return flag;
8473 }
void Teleport(Point point, bool silent=false, bool force=false)
Definition: Card.cs:5904
ConSuspend conSuspend
Definition: Chara.cs:104
void AddCooldown(int idEle, int turns=0)
Definition: Chara.cs:8684
bool HasCooldown(int idEle)
Definition: Chara.cs:8735

References EClass._map, AddCooldown(), CanSeeLos(), Map.charas, conSuspend, enemy, Card.Evalue(), BaseCard.GetBool(), Point.GetNearestPoint(), HasCondition(), HasCooldown(), Card.HasElement(), host, IsDisabled, IsFriendOrAbove(), IsPC, IsPCFaction, Card.IsPCFactionOrMinion, IsPCParty, Card.isRestrained, Point.IsValid, EClass.rnd(), SetEnemy(), Card.Talk(), and Card.Teleport().

Referenced by ActMelee.Attack(), ActEffect.DamageEle(), and ActRanged.Perform().

◆ RerollHobby()

void Chara.RerollHobby ( bool  extraSlotChance = true)
inline

Definition at line 9127 of file Chara.cs.

9128 {
9129 if (_hobbies != null && _works != null)
9130 {
9131 _hobbies.Clear();
9132 _works.Clear();
9133 }
9134 else
9135 {
9136 _hobbies = new List<int>();
9137 _works = new List<int>();
9138 }
9139 if (source.hobbies.IsEmpty())
9140 {
9141 AddHobby(EClass.sources.hobbies.listHobbies.RandomItem().id);
9142 }
9143 else
9144 {
9145 string[] hobbies = source.hobbies;
9146 foreach (string key in hobbies)
9147 {
9148 AddHobby(EClass.sources.hobbies.alias[key].id);
9149 }
9150 }
9151 if (source.works.IsEmpty())
9152 {
9153 AddWork(EClass.sources.hobbies.listWorks.RandomItem().id);
9154 }
9155 else
9156 {
9157 string[] hobbies = source.works;
9158 foreach (string key2 in hobbies)
9159 {
9160 AddWork(EClass.sources.hobbies.alias[key2].id);
9161 }
9162 }
9164 }
WorkSummary GetWorkSummary()
Definition: Chara.cs:9166
void AddWork(int id)
Definition: Chara.cs:9115
void AddHobby(int id)
Definition: Chara.cs:9103
List< Row > listWorks
Definition: SourceHobby.cs:64
List< Row > listHobbies
Definition: SourceHobby.cs:61
void Reset()
Definition: WorkSummary.cs:78

References SourceChara.Row.hobbies, SourceManager.hobbies, SourceHobby.listHobbies, SourceHobby.listWorks, EClass.sources, and SourceChara.Row.works.

Referenced by OnCreate().

◆ ResetBody()

void Chara.ResetBody ( )
inline

Definition at line 2246 of file Chara.cs.

2247 {
2248 for (int num = body.slots.Count - 1; num >= 0; num--)
2249 {
2250 BodySlot bodySlot = body.slots[num];
2251 if (bodySlot.elementId == 45 || bodySlot.elementId == 40)
2252 {
2253 return;
2254 }
2255 body.RemoveBodyPart(num);
2256 }
2257 string[] array = race.figure.Split('|');
2258 foreach (string s in array)
2259 {
2260 int num2 = ParseBodySlot(s);
2261 if (num2 != -1)
2262 {
2263 body.AddBodyPart(num2);
2264 }
2265 }
2267 }

References CharaBody.AddBodyPart(), body, BodySlot.elementId, ParseBodySlot(), race, CharaBody.RefreshBodyParts(), CharaBody.RemoveBodyPart(), and CharaBody.slots.

◆ ResetUpgrade()

void Chara.ResetUpgrade ( )
inline

Definition at line 8569 of file Chara.cs.

8570 {
8571 _ = base.c_upgrades;
8572 }

Referenced by CoreDebug.ResetPetUpgrades().

◆ ResistCon()

void Chara.ResistCon ( Condition  con)
inline

Definition at line 9707 of file Chara.cs.

9708 {
9709 if (con.power > 0 && resistCon != null)
9710 {
9711 int a = ClassExtension.TryGetValue<int, int>((IDictionary<int, int>)resistCon, con.id, 0);
9712 if (1000 < EClass.rnd(a))
9713 {
9714 con.power = 0;
9715 }
9716 else if (500 < EClass.rnd(a))
9717 {
9718 con.power /= 5;
9719 }
9720 else if (200 < EClass.rnd(a))
9721 {
9722 con.power /= 3;
9723 }
9724 else if (100 < EClass.rnd(a))
9725 {
9726 con.power /= 2;
9727 }
9728 }
9729 }

References BaseStats.id, BaseCondition.power, and EClass.rnd().

◆ RestockEquip()

void Chara.RestockEquip ( bool  onCreate)
inline

Definition at line 4713 of file Chara.cs.

4714 {
4715 string equip = source.equip;
4716 if (equip.IsEmpty())
4717 {
4718 equip = job.equip;
4719 }
4720 if (equip == "none")
4721 {
4722 return;
4723 }
4724 bool flag = true;
4725 switch (id)
4726 {
4727 case "kettle":
4728 case "quru":
4729 case "loytel":
4730 case "shojo":
4731 EQ_ID("staff_long", 1);
4732 EQ_CAT("head");
4733 EQ_CAT("torso");
4734 EQ_CAT("arm");
4735 return;
4736 case "adv_yukiimo":
4737 if (onCreate)
4738 {
4739 EQ_ID("tail_snowleopard");
4740 }
4741 break;
4742 case "adv_kiria":
4743 if (onCreate)
4744 {
4745 EQ_ID("sword_zephir");
4746 }
4747 break;
4748 case "adv_mesherada":
4749 if (onCreate)
4750 {
4751 EQ_ID("dagger_hathaway");
4752 }
4753 break;
4754 case "adv_verna":
4755 if (onCreate)
4756 {
4757 EQ_ID("staff_long", -1, Rarity.Legendary);
4758 }
4759 if (onCreate)
4760 {
4761 EQ_ID("cloak_wing", -1, Rarity.Mythical);
4762 }
4763 break;
4764 case "big_sister":
4765 if (onCreate)
4766 {
4767 EQ_ID("sword_muramasa");
4768 }
4769 break;
4770 case "adv_gaki":
4771 if (onCreate)
4772 {
4773 EQ_ID("dagger_gaki");
4774 }
4775 if (onCreate)
4776 {
4777 EQ_ID("dagger_ninto");
4778 }
4779 break;
4780 case "adv_ivory":
4781 EQ_ID("dagger", -1, Rarity.Legendary);
4782 AddThing("60");
4783 break;
4784 case "adv_wini":
4785 if (onCreate)
4786 {
4787 EQ_ID("staff_Cat", -1, Rarity.Mythical);
4788 }
4790 if (onCreate)
4791 {
4792 AddThing("1071");
4793 }
4794 break;
4795 case "namamani":
4796 if (onCreate)
4797 {
4798 AddThing("gun_gravity2");
4799 }
4800 break;
4801 case "lomias":
4802 if (onCreate)
4803 {
4804 AddThing("bow_vindale");
4805 }
4806 break;
4807 case "larnneire":
4808 if (onCreate)
4809 {
4810 EQ_ID("EtherDagger2");
4811 }
4812 break;
4813 case "keeper_garden":
4814 if (!body.HasWeapon())
4815 {
4816 EQ_ID("sword_ragnarok");
4817 }
4818 break;
4819 case "ungaga_pap":
4820 if (onCreate)
4821 {
4822 EQ_ID("axe_destruction");
4823 }
4824 break;
4825 case "lurie_boss":
4826 if (onCreate)
4827 {
4828 EQ_ID("ribbon_duponne");
4829 }
4830 break;
4831 case "seeker":
4832 if (onCreate)
4833 {
4834 EQ_ID("helm_seeker");
4835 }
4836 EQ_ID("robe_pope");
4837 EQ_ID("sword_katana");
4838 EQ_ID("staff");
4839 EQ_ID("sword_katana");
4840 if (onCreate)
4841 {
4842 EQ_ID("boots_seven");
4843 }
4844 if (onCreate)
4845 {
4846 for (int i = 0; i < 20; i++)
4847 {
4849 }
4850 EQ_Item("panty");
4851 AddThing("plat").SetNum(6);
4852 }
4853 break;
4854 case "ephrond":
4855 if (onCreate)
4856 {
4857 AddThing("guitar_efrond");
4858 }
4859 break;
4860 case "ashland":
4861 if (onCreate)
4862 {
4863 AddThing("guitar_ash");
4864 }
4865 break;
4866 case "swordkeeper":
4867 if (onCreate)
4868 {
4869 EQ_ID("EtherDagger");
4870 }
4871 break;
4872 case "mech_angel":
4873 if (onCreate)
4874 {
4875 Thing thing = ThingGen.Create("pole_holy");
4876 thing.SetReplica(on: true);
4877 thing.rarity = Rarity.Normal;
4878 thing.elements.SetTo(60, -15);
4879 thing.elements.SetTo(418, -100);
4880 thing.elements.SetTo(93, 50);
4881 AddThing(thing);
4882 body.Equip(thing);
4883 flag = false;
4884 }
4885 break;
4886 case "azzrasizzle":
4887 if (onCreate)
4888 {
4889 EQ_ID("staff_magius");
4890 }
4891 break;
4892 case "sorin":
4893 if (onCreate)
4894 {
4895 EQ_ID("staff_insanity");
4896 }
4897 break;
4898 case "robot":
4899 if (onCreate)
4900 {
4901 EQ_ID("sword_katana");
4902 }
4903 break;
4904 case "mimu":
4905 if (onCreate)
4906 {
4907 EQ_ID("staff_leek");
4908 }
4909 break;
4910 case "kumatan":
4911 if (onCreate)
4912 {
4913 EQ_ID("dagger_hocho");
4914 }
4915 break;
4916 }
4917 if (!TryEquipRanged())
4918 {
4919 switch (id)
4920 {
4921 case "tyche":
4922 case "trooper":
4923 case "mech_scarab":
4924 AddThing("gun_laser");
4925 break;
4926 case "rocketman":
4927 {
4928 Thing thing2 = AddThing("panzerfaust");
4929 thing2.ChangeMaterial("iron");
4930 thing2.c_ammo = 0;
4931 break;
4932 }
4933 default:
4934 switch (equip)
4935 {
4936 case "archer":
4937 EQ_CAT((EClass.rnd(4) == 0) ? "crossbow" : "bow");
4938 break;
4939 case "inquisitor":
4940 case "gunner":
4941 EQ_CAT("gun");
4942 break;
4943 }
4944 break;
4945 }
4946 }
4947 int num = ((base.rarity >= Rarity.Mythical) ? (base.LV * 3) : ((base.rarity >= Rarity.Legendary) ? (base.LV * 2) : base.LV));
4948 if (trait is TraitAdventurer)
4949 {
4950 num *= 3;
4951 }
4952 if (race.id == "asura")
4953 {
4954 for (int j = 0; j < 4; j++)
4955 {
4956 EQ_CAT(job.weapon.RandomItem());
4957 }
4958 }
4959 for (int k = 0; k < ((!(race.id == "mutant")) ? 1 : (2 + base.LV / 30)); k++)
4960 {
4961 if (flag)
4962 {
4963 if (source.ContainsTag("boxer"))
4964 {
4965 EQ_CAT("martial");
4966 }
4967 else if (!job.weapon.IsEmpty())
4968 {
4969 if (race.id == "mutant" || (body.slotMainHand != null && body.slotMainHand.thing == null))
4970 {
4971 EQ_CAT(job.weapon.RandomItem());
4972 }
4973 if (race.id == "mutant" || (Evalue(131) > 0 && EClass.rnd(2) == 0))
4974 {
4975 EQ_CAT(job.weapon.RandomItem());
4976 }
4977 }
4978 }
4979 EQ_CAT("torso");
4980 if (EClass.rnd(num) > 5)
4981 {
4982 EQ_CAT("arm");
4983 }
4984 if (EClass.rnd(num) > 10)
4985 {
4986 EQ_CAT("head");
4987 }
4988 if (EClass.rnd(num) > 15)
4989 {
4990 EQ_CAT("back");
4991 }
4992 if (EClass.rnd(num) > 20)
4993 {
4994 EQ_CAT("ring");
4995 }
4996 if (EClass.rnd(num) > 25)
4997 {
4998 EQ_CAT("amulet");
4999 }
5000 if (EClass.rnd(num) > 30)
5001 {
5002 EQ_CAT("foot");
5003 }
5004 if (EClass.rnd(num) > 35)
5005 {
5006 EQ_CAT("waist");
5007 }
5008 if (EClass.rnd(num) > 40)
5009 {
5010 EQ_CAT("ring");
5011 }
5012 }
5013 if (trait is TraitBard)
5014 {
5015 AddThing(ThingGen.Create("lute"));
5016 if (EClass.debug.enable || EClass.rnd(100) == 0)
5017 {
5018 EQ_ID("shield_lute");
5019 }
5020 }
5021 if (HasTag(CTAG.shield))
5022 {
5023 EQ_CAT("shield");
5024 }
5025 }
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
Definition: Card.cs:3064
Card AddCard(Card c)
Definition: Card.cs:3113
void SetReplica(bool on)
Definition: Card.cs:3098
bool HasWeapon()
Definition: CharaBody.cs:385
BodySlot slotMainHand
Definition: CharaBody.cs:10
void EQ_Item(string s, int num=1)
Definition: Chara.cs:5135
Thing EQ_ID(string s, int mat=-1, Rarity r=Rarity.Random)
Definition: Chara.cs:5099
bool TryEquipRanged()
Definition: Chara.cs:7870
void EQ_CAT(string s)
Definition: Chara.cs:5119
void SetTo(int id, int v)
static Thing CreateSpellbook(string alias, int num=1)
Definition: ThingGen.cs:151

References Card.ChangeMaterial(), RenderRow.ContainsTag(), ThingGen.Create(), ThingGen.CreateFromCategory(), ThingGen.CreateSpellbook(), EClass.debug, Card.elements, CoreDebug.enable, CharaBody.Equip(), SourceChara.Row.equip, SourceJob.Row.equip, CharaBody.HasWeapon(), SourceRace.Row.id, EClass.rnd(), Card.SetReplica(), ElementContainer.SetTo(), CharaBody.slotMainHand, BodySlot.thing, and SourceJob.Row.weapon.

Referenced by CoreDebug.QuickStart().

◆ RestockInventory()

void Chara.RestockInventory ( bool  onCreate)
inline

Definition at line 5027 of file Chara.cs.

5028 {
5029 switch (id)
5030 {
5031 case "lomias":
5032 if (ShouldRestock("_meat"))
5033 {
5034 AddCard(ThingGen.Create("_meat").MakeRefFrom("begger"));
5035 }
5036 break;
5037 case "fiama":
5038 Restock("book_story", 1);
5039 break;
5040 case "rock_thrower":
5041 Restock("stone", 10 + EClass.rnd(10));
5042 break;
5043 case "giant":
5044 Restock("rock", 2 + EClass.rnd(10));
5045 break;
5046 case "farris":
5047 Restock("lute", 1);
5048 Restock("book_story_home", 1);
5049 break;
5050 case "begger":
5051 break;
5052 }
5053 void Restock(string id, int num)
5054 {
5055 if (ShouldRestock(id))
5056 {
5057 AddCard(ThingGen.Create(id).SetNum(num));
5058 }
5059 }
5060 bool ShouldRestock(string id)
5061 {
5062 return things.Find(id) == null;
5063 }
5064 }

References ThingGen.Create(), Card.MakeRefFrom(), EClass.rnd(), and Card.SetNum().

◆ Revive()

void Chara.Revive ( Point  p = null,
bool  msg = false 
)
inline

Definition at line 5179 of file Chara.cs.

5180 {
5181 if (!isDead)
5182 {
5183 return;
5184 }
5185 isDead = false;
5186 base.hp = MaxHP / 3;
5187 mana.value = 0;
5188 stamina.value = 0;
5189 if (hunger.value > 30)
5190 {
5191 hunger.value = 30;
5192 }
5193 sleepiness.value = 0;
5195 RemoveCondition<StanceTaunt>();
5196 if (id == "keeper_garden")
5197 {
5198 SaiyanRevive();
5199 }
5200 if (IsPC)
5201 {
5203 {
5204 Msg.Say("noDeathPenalty2", this);
5205 }
5207 {
5208 Msg.Say("noDeathPenalty", this);
5209 }
5210 else
5211 {
5213 }
5214 List<Thing> dropList = new List<Thing>();
5215 EClass.pc.things.Foreach(delegate(Thing t)
5216 {
5218 {
5219 t.ignoreAutoPick = true;
5220 dropList.Add(t);
5221 }
5222 }, onlyAccessible: false);
5223 foreach (Thing item in dropList)
5224 {
5226 Msg.Say("backpack_full_drop", item);
5227 }
5228 EClass.player.preventDeathPenalty = false;
5229 }
5230 if (IsPCFaction && homeBranch != null)
5231 {
5232 homeBranch.Log("bRevive", this);
5233 }
5234 if (p != null)
5235 {
5236 if (!p.IsInBounds)
5237 {
5239 }
5240 EClass._zone.AddCard(this, p);
5241 if (msg)
5242 {
5243 SE.Play("revive");
5244 Msg.Say("revive", this);
5245 PlayEffect("revive");
5246 }
5247 SetCensored(enable: false);
5248 }
5249 }
void SetCensored(bool enable)
Definition: Card.cs:7891
Card parentCard
Definition: Card.cs:104
void SaiyanRevive()
Definition: Chara.cs:5251
void ApplyDeathPenalty()
Definition: Chara.cs:5285
bool disableDeathPenaltyProtection
Point GetCenterPos()
Definition: MapBounds.cs:52
int days
Definition: Player.cs:75
bool preventDeathPenalty
Definition: Player.cs:1167
void Foreach(Action< Thing > action, bool onlyAccessible=true)
override int SelfWeight
Definition: Thing.cs:67

References EClass._map, EClass._zone, Zone.AddCard(), ApplyDeathPenalty(), Card.c_lockLv, Trait.CanBeDropped, Player.Stats.days, GamePrincipal.disableDeathPenaltyProtection, ThingContainer.Foreach(), EClass.game, MapBounds.GetCenterPos(), Point.GetNearestPoint(), Card.IsContainer, item, FactionBranch.Log(), Card.parentCard, EClass.pc, EClass.player, Card.pos, Player.preventDeathPenalty, Game.principal, Msg.Say(), Thing.SelfWeight, Player.stats, Card.things, Card.trait, Stats.value, and WeightLimit.

Referenced by FactionBranch.DailyOutcome(), ZonePreEnterOnCompleteQuestInstance.Execute(), CoreDebug.GodMode(), ZoneInstanceBout.OnLeaveZone(), and Zone.Revive().

◆ Rotate()

override void Chara.Rotate ( bool  reverse = false)
inlinevirtual

Reimplemented from Card.

Definition at line 3536 of file Chara.cs.

3537 {
3538 if (renderer.hasActor)
3539 {
3540 base.dir = (base.dir + ((!reverse) ? 1 : (-1))).Clamp(0, 3, loop: true);
3541 }
3542 else
3543 {
3544 base.dir = ((base.dir == 0) ? 1 : 0);
3545 }
3546 UpdateAngle();
3548 }

Referenced by AI_Dance.Run().

◆ SaiyanRevive()

void Chara.SaiyanRevive ( )
inline

Definition at line 5251 of file Chara.cs.

5252 {
5253 ModCorruption(-100000);
5254 if (base.LV < 10000000)
5255 {
5256 SetLv(base.LV * 10 + 9);
5257 }
5258 Refresh();
5259 base.hp = MaxHP;
5260 mana.value = mana.max;
5261 stamina.value = stamina.max;
5262 bossText = true;
5263 }
void ModCorruption(int a)
Definition: Chara.cs:9854

References Stats.max, and Refresh().

◆ ScaleByPrincipal()

Chara Chara.ScaleByPrincipal ( )
inline

◆ SetAI()

AIAct Chara.SetAI ( AIAct  g)
inline

Definition at line 8903 of file Chara.cs.

8904 {
8905 if (IsPC)
8906 {
8908 }
8909 if (ai.IsRunning)
8910 {
8911 if (ai == g && ai.IsNoGoal)
8912 {
8913 return g;
8914 }
8915 ai.Cancel();
8916 if (ai == g)
8917 {
8918 Debug.Log("goal is g:" + ai?.ToString() + "/" + this);
8919 return g;
8920 }
8921 }
8922 if (HasCondition<ConWait>())
8923 {
8924 RemoveCondition<ConWait>();
8925 }
8926 ai = g;
8927 ai.SetOwner(this);
8928 if (IsPC)
8929 {
8931 }
8932 return g;
8933 }
virtual bool IsNoGoal
Definition: AIAct.cs:74
void SetOwner(Chara c)
Definition: AIAct.cs:179
QueueManager queues
Definition: Player.cs:1211
void OnSetGoal(AIAct newGoal)
Definition: QueueManager.cs:23

References AIAct.Cancel(), Debug, AIAct.IsNoGoal, AIAct.IsRunning, QueueManager.OnSetGoal(), EClass.player, Player.queues, and AIAct.SetOwner().

Referenced by _Move(), Zone.AddCard(), Thing.DoAct(), UIInventory.DoAct(), Player.EndTurn(), GiveGift(), TraitTrolley.OnActivateTrap(), BaseListPeople.OnClick(), LayerCraft.OnClickCraft(), OnCreate(), ZoneInstanceBout.OnLeaveZone(), AM_Paint.OnUpdateInput(), ActBloodsuck.Perform(), ActNTR.Perform(), ActRanged.Perform(), ActRestrain.Perform(), ActSlime.Perform(), ActPlan.Item.Perform(), LayerCraftFloat.RefreshCraft(), AI_Idle.Run(), GoalSpot.Run(), ZoneEventSiege.ShouldEnd(), Zone.Simulate(), ConSleep.SuccubusVisit(), ActThrow.Throw(), TaskManager.Designations.TryRemoveDesignation(), InvOwnerCraft.TryStartCraft(), and GoalWork.TryWork().

◆ SetAIAggro()

void Chara.SetAIAggro ( )
inline

Definition at line 8893 of file Chara.cs.

8894 {
8895 SetAI(new GoalCombat());
8896 }

Referenced by ZoneEventQuest.AggroEnemy().

◆ SetAIIdle()

void Chara.SetAIIdle ( )
inline

Definition at line 8889 of file Chara.cs.

8890 {
8891 }

◆ SetAIImmediate()

void Chara.SetAIImmediate ( AIAct  g)
inline

◆ SetCooldown()

void Chara.SetCooldown ( int  idEle,
int  turns = 0 
)
inline

Definition at line 8702 of file Chara.cs.

8703 {
8704 if (_cooldowns == null)
8705 {
8706 _cooldowns = new List<int>();
8707 }
8708 bool flag = false;
8709 for (int i = 0; i < _cooldowns.Count; i++)
8710 {
8711 if (_cooldowns[i] / 1000 == idEle)
8712 {
8713 if (turns == 0)
8714 {
8715 _cooldowns.RemoveAt(i);
8716 }
8717 else
8718 {
8719 _cooldowns[i] = idEle * 1000 + turns;
8720 }
8721 flag = true;
8722 break;
8723 }
8724 }
8725 if (!flag && turns > 0)
8726 {
8727 AddCooldown(idEle, turns);
8728 }
8729 if (_cooldowns.Count == 0)
8730 {
8731 _cooldowns = null;
8732 }
8733 }

Referenced by ConTransmuteBat.OnRemoved().

◆ SetDir()

override void Chara.SetDir ( int  d)
inlinevirtual

Reimplemented from Card.

Definition at line 3529 of file Chara.cs.

3530 {
3531 base.dir = d;
3532 UpdateAngle();
3534 }

Referenced by AI_Trolley.Run(), and ConSleep.Tick().

◆ SetDirtySpeed()

void Chara.SetDirtySpeed ( )
inline

Definition at line 1881 of file Chara.cs.

1882 {
1883 dirtySpeed = true;
1884 if (host != null)
1885 {
1887 }
1888 }

References dirtySpeed, host, and SetDirtySpeed().

Referenced by CalcBurden(), Condition.Kill(), AttbMain.OnChangeValue(), Refresh(), Party.RemoveMember(), ActRide.Ride(), SetDirtySpeed(), and ActRide.Unride().

◆ SetEnemy()

Chara Chara.SetEnemy ( Chara  c = null)
inline

Definition at line 6303 of file Chara.cs.

6304 {
6305 enemy = c;
6306 if (c == null)
6307 {
6308 if (ai is GoalCombat)
6309 {
6310 ai.Cancel();
6311 }
6312 }
6313 else
6314 {
6315 calmCheckTurn = 10 + EClass.rnd(30);
6316 }
6317 return c;
6318 }

References AIAct.Cancel(), and EClass.rnd().

Referenced by ZoneEventQuest.AggroEnemy(), DoHostileAction(), AI_Torture.OnCancelOrSuccess(), ZoneInstanceBout.OnLeaveZone(), ConInvisibility.OnStart(), Zone.RefreshCriminal(), ReleaseMinion(), RequestProtection(), Zone.ResetHostility(), AI_Idle.Run(), GoalCombat.Run(), and Card.Teleport().

◆ SetEQQuality()

void Chara.SetEQQuality ( )
inlineprivate

Definition at line 5066 of file Chara.cs.

5067 {
5069 Rarity rarity = Rarity.Normal;
5070 int num = ((base.LV >= 1000) ? 7 : ((base.LV >= 500) ? 5 : ((base.LV >= 250) ? 3 : ((base.LV >= 100) ? 2 : ((base.LV >= 50) ? 1 : 0)))));
5071 Rarity rarity2 = base.rarity;
5072 if (id == "big_sister")
5073 {
5074 num = (isOnCreate ? 8 : 4);
5075 }
5076 if (!isOnCreate && EClass.rnd(10) != 0)
5077 {
5078 num /= 2;
5079 }
5080 if (rarity2 == Rarity.Superior && EClass.rnd(10) <= num)
5081 {
5082 rarity = Rarity.Superior;
5083 }
5084 else if (rarity2 == Rarity.Legendary)
5085 {
5086 rarity = ((EClass.rnd(10) <= num) ? Rarity.Legendary : ((EClass.rnd(5) <= num) ? Rarity.Superior : Rarity.Normal));
5087 }
5088 else if (rarity2 >= Rarity.Mythical)
5089 {
5090 rarity = ((EClass.rnd(30) <= num) ? Rarity.Mythical : ((EClass.rnd(10) > num) ? Rarity.Superior : Rarity.Legendary));
5091 }
5092 if (rarity == Rarity.Normal && EClass.rnd(1000) == 0)
5093 {
5094 rarity = Rarity.Legendary;
5095 }
5096 CardBlueprint.current.rarity = rarity;
5097 }
static void Set(CardBlueprint _bp=null)
static CardBlueprint CharaGenEQ
static bool isOnCreate
Definition: Chara.cs:186

References CardBlueprint.CharaGenEQ, EClass.rnd(), and CardBlueprint.Set().

◆ SetFaction()

Chara Chara.SetFaction ( Faction  f)
inline

Definition at line 1441 of file Chara.cs.

1442 {
1443 _faction = null;
1444 faction = f;
1446 return this;
1447 }
Faction _faction
Definition: Chara.cs:158
Hostility GetHostility()
Definition: FACTION.cs:255

References _faction, faction, Faction.GetHostility(), and hostility.

Referenced by _MakeAlly(), FactionBranch.AddMemeber(), Player.OnCreateGame(), CoreDebug.QuickStart(), and FactionBranch.RemoveMemeber().

◆ SetFaith() [1/2]

void Chara.SetFaith ( Religion  r)
inline

Definition at line 1732 of file Chara.cs.

1733 {
1734 faith = r;
1736 }

References faith, and RefreshFaithElement().

◆ SetFaith() [2/2]

void Chara.SetFaith ( string  id)
inline

Definition at line 1727 of file Chara.cs.

1728 {
1730 }
Dictionary< string, Religion > dictAll

References ReligionManager.dictAll, EClass.game, Game.religions, and SetFaith().

Referenced by OnCreate(), Zone_SubTown.OnGenerateRooms(), Player.OnStartNewGame(), SetFaith(), and Zone.TrySpawnFollower().

◆ SetFeat()

void Chara.SetFeat ( int  id,
int  value = 1,
bool  msg = false 
)
inline

Definition at line 9912 of file Chara.cs.

9913 {
9914 Feat feat = elements.GetElement(id) as Feat;
9915 int num = 0;
9916 if (feat != null && feat.Value > 0)
9917 {
9918 if (value == feat.Value)
9919 {
9920 return;
9921 }
9922 num = feat.Value;
9923 feat.Apply(-feat.Value, elements);
9924 }
9925 feat = elements.SetBase(id, value - (feat?.vSource ?? 0)) as Feat;
9926 if (feat.Value != 0)
9927 {
9928 feat.Apply(feat.Value, elements);
9929 }
9931 {
9932 Refresh();
9934 }
9935 if (!msg)
9936 {
9937 return;
9938 }
9939 if (feat.source.textInc.IsEmpty())
9940 {
9941 PlaySound("ding_skill");
9943 Say("gainFeat", this, feat.FullName);
9944 }
9945 else
9946 {
9947 bool flag = value < num;
9948 if (feat.source.tag.Contains("neg"))
9949 {
9950 flag = !flag;
9951 }
9952 switch (id)
9953 {
9954 case 1270:
9955 if (!flag)
9956 {
9957 PlaySound("chime_angel");
9958 }
9959 break;
9960 case 1271:
9961 if (!flag)
9962 {
9963 PlaySound("chime_devil");
9964 }
9965 break;
9966 default:
9967 PlaySound("mutation");
9968 break;
9969 }
9971 Say((value > num) ? feat.source.GetText("textInc") : feat.source.GetText("textDec"), this, feat.FullName);
9972 }
9974 }
Color Negative
Definition: MsgColors.cs:15
Color Ding
Definition: MsgColors.cs:11

References Feat.Apply(), Msg.colors, EClass.core, MsgColors.Ding, Feat.FullName, Core.IsGameStarted, MsgColors.Negative, Refresh(), Msg.SetColor(), Element.source, and Element.Value.

Referenced by Card._OnDeserialized(), LayerWorldSetting.Apply(), DNA.Apply(), ApplyEditorTags(), ApplyRace(), Card.LevelUp(), TraitFoodEggFertilized.MakeBaby(), Zone_Casino.OnActivate(), OnCreate(), TraitDrinkMilkMother.OnDrink(), ConSleep.OnRemoved(), FoodEffect.Proc(), CoreDebug.SetElement(), and DramaOutcome.upgrade_miscreation().

◆ SetGlobal() [1/2]

Chara Chara.SetGlobal ( )
inline

Definition at line 1508 of file Chara.cs.

1509 {
1510 if (!IsGlobal)
1511 {
1513 global = new GlobalData();
1514 base.isSubsetCard = false;
1515 enemy = null;
1516 base.c_uidMaster = 0;
1517 }
1518 return this;
1519 }

References CardManager.GlobalCharaList.Add(), Game.cards, enemy, EClass.game, global, CardManager.globalCharas, and IsGlobal.

Referenced by _MakeAlly(), SetGlobal(), and SetHomeZone().

◆ SetGlobal() [2/2]

Chara Chara.SetGlobal ( Zone  _home,
int  x,
int  z 
)
inline

Definition at line 1493 of file Chara.cs.

1494 {
1495 SetGlobal();
1496 homeZone = _home;
1497 _home.AddCard(this, x, z);
1498 global.transition = new ZoneTransition
1499 {
1500 state = ZoneTransition.EnterState.Exact,
1501 x = x,
1502 z = z
1503 };
1504 orgPos = new Point(x, z);
1505 return this;
1506 }

References Zone.AddCard(), homeZone, orgPos, and SetGlobal().

Referenced by FactionBranch.AddMemeber(), Zone_Nymelle.OnBeforeSimulate(), DramaOutcome.QuestExploration_AfterCrystal(), Meeting.SetChara(), Game.StartNewGame(), and CoreDebug.UpdateInput().

◆ SetHomeZone()

Chara Chara.SetHomeZone ( Zone  zone)
inline

Definition at line 1449 of file Chara.cs.

1450 {
1451 homeZone = zone;
1452 SetGlobal();
1453 return this;
1454 }

References homeZone, and SetGlobal().

Referenced by Game.AddAdventurer(), Game.AddAdventurers(), FactionBranch.AddMemeber(), Zone_Specwing.OnActivate(), OnBanish(), and CoreDebug.QuickStart().

◆ SetHostility()

Chara Chara.SetHostility ( Hostility  h)
inline

Definition at line 1456 of file Chara.cs.

1457 {
1458 Hostility hostility2 = (base.c_originalHostility = h);
1459 this.hostility = hostility2;
1460 return this;
1461 }

Referenced by Zone_Specwing.OnActivate(), Zone_CurryRuinDungeon.OnGenerateMap(), AI_Idle.Run(), Zone.SetAlarm(), and Zone.TryGenerateBigDaddy().

◆ SetMainElement() [1/2]

void Chara.SetMainElement ( int  id,
int  v = 0,
bool  elemental = false 
)
inline

Definition at line 2114 of file Chara.cs.

2115 {
2116 if (base.c_idMainElement != 0)
2117 {
2118 SetElements(base.c_idMainElement, remove: true);
2119 base.c_idMainElement = 0;
2120 }
2121 if (id != 0)
2122 {
2123 _ = EClass.sources.elements.map[id];
2124 SetElements(id, remove: false);
2125 base.c_idMainElement = id;
2126 if (elemental)
2127 {
2128 base.isElemental = true;
2129 _colorInt = 0;
2130 Color colorSprite = EClass.setting.elements[MainElement.source.alias].colorSprite;
2131 base.c_lightColor = (byte)Mathf.Clamp(colorSprite.r * 3f, 1f, 31f) * 1024 + (byte)Mathf.Clamp(colorSprite.g * 3f, 1f, 31f) * 32 + (byte)Mathf.Clamp(colorSprite.b * 3f, 1f, 31f);
2132 }
2133 _ability = null;
2134 }
2135 void SetElements(int idEle, bool remove)
2136 {
2137 elements.SetBase(idEle, (!remove) ? ((v == 0) ? 10 : v) : 0);
2138 elements.ModBase(EClass.sources.elements.alias[EClass.sources.elements.map[idEle].aliasRef].id, remove ? (-20) : 20);
2139 switch (idEle)
2140 {
2141 case 910:
2142 elements.ModBase(951, remove ? 10 : (-10));
2143 break;
2144 case 911:
2145 elements.ModBase(950, remove ? 10 : (-10));
2146 break;
2147 case 912:
2148 elements.ModBase(953, remove ? 10 : (-10));
2149 break;
2150 case 913:
2151 elements.ModBase(952, remove ? 10 : (-10));
2152 break;
2153 case 916:
2154 elements.ModBase(960, remove ? 10 : (-10));
2155 break;
2156 case 919:
2157 elements.ModBase(956, remove ? 10 : (-10));
2158 break;
2159 case 925:
2160 elements.ModBase(962, remove ? 10 : (-10));
2161 break;
2162 case 922:
2163 elements.ModBase(965, remove ? 10 : (-10));
2164 break;
2165 case 921:
2166 elements.ModBase(971, remove ? 10 : (-10));
2167 break;
2168 case 926:
2169 elements.ModBase(961, remove ? 10 : (-10));
2170 break;
2171 case 914:
2172 case 915:
2173 case 917:
2174 case 918:
2175 case 920:
2176 case 923:
2177 case 924:
2178 break;
2179 }
2180 }
2181 }
int _colorInt
Definition: Card.cs:68
CharaAbility _ability
Definition: Chara.cs:96
UD_String_ElementRef elements
Definition: GameSetting.cs:315

References _ability, Card._colorInt, Color, Card.elements, GameSetting.elements, SourceManager.elements, Card.id, MainElement, ElementContainer.ModBase(), ElementContainer.SetBase(), EClass.setting, Element.source, and EClass.sources.

◆ SetMainElement() [2/2]

void Chara.SetMainElement ( string  id,
int  v = 0,
bool  elemental = false 
)
inline

Definition at line 2105 of file Chara.cs.

2106 {
2107 if (!id.StartsWith("ele"))
2108 {
2109 id = "ele" + id;
2110 }
2111 SetMainElement(EClass.sources.elements.alias[id].id, v, elemental);
2112 }

References SourceManager.elements, Card.id, SetMainElement(), and EClass.sources.

Referenced by TraitFoodEggFertilized.Incubate(), OnCreate(), ActEffect.ProcAt(), SerializedCards.Restore(), and SetMainElement().

◆ SetMutation()

void Chara.SetMutation ( int  idEle,
int  a = 0 
)
inline

Definition at line 9976 of file Chara.cs.

9977 {
9978 SourceElement.Row row = EClass.sources.elements.map[idEle];
9980 Element element = elements.GetElement(idEle);
9981 Element element2 = elements.GetElement(row2.id);
9982 int num = element?.Value ?? 0;
9983 if (a < 0)
9984 {
9985 a = 0;
9986 }
9987 if (a > row.max)
9988 {
9989 a = row.max;
9990 }
9991 bool flag = (row.tag.Contains("neg") ? (a > num) : (a < num));
9992 if (a == 0 && (element == null || element.Value == 0))
9993 {
9995 return;
9996 }
9997 if (element != null && element.Value == a)
9998 {
10000 return;
10001 }
10002 if (element2 != null && element2.Value > 0)
10003 {
10004 SetFeat(element2.id, 0);
10005 }
10006 SetFeat(idEle, a);
10007 PlaySound("mutation");
10008 PlayEffect("mutation");
10010 Say(row.GetText(flag ? "textDec" : "textInc", returnNull: true) ?? row.alias, this);
10011 }

References SourceElement.Row.alias, SourceElement.Row.aliasParent, Msg.colors, SourceManager.elements, Element.id, SourceElement.Row.id, SourceElement.Row.max, MsgColors.MutateBad, MsgColors.MutateGood, Msg.SetColor(), EClass.sources, SourceElement.Row.tag, and Element.Value.

◆ SetNoGoal()

AIAct Chara.SetNoGoal ( )
inline

Definition at line 8898 of file Chara.cs.

8899 {
8900 return SetAI(_NoGoalPC);
8901 }
static NoGoal _NoGoalPC
Definition: Chara.cs:198

Referenced by LayerMiniGame.OnAfterInit(), and Player.TryAbortAutoCombat().

◆ SetPCCState()

void Chara.SetPCCState ( PCCState  state)
inline

Definition at line 6691 of file Chara.cs.

6692 {
6693 if (IsPCC)
6694 {
6695 PCC.Get(pccData).Build(state);
6696 }
6697 }

Referenced by _Move(), TraitChangingRoom.OnActivateTrap(), AI_Bladder.OnReset(), TraitMiniPool.OnStepped(), and AI_Bladder.Run().

◆ SetRenderParam()

override void Chara.SetRenderParam ( RenderParam  p)
inlinevirtual

Reimplemented from Card.

Definition at line 6739 of file Chara.cs.

6740 {
6741 p.mat = base.material;
6742 p.matColor = base.colorInt;
6743 if (!renderer.usePass)
6744 {
6745 return;
6746 }
6747 if (renderer.replacer != null)
6748 {
6749 p.tile = renderer.replacer.tile * ((!flipX) ? 1 : (-1));
6750 if (renderer.replacer.mat != -1)
6751 {
6752 p.mat = EClass.sources.materials.rows.TryGet(renderer.replacer.mat, 0);
6753 p.matColor = BaseTileMap.GetColorInt(ref p.mat.matColor, 100);
6754 p.color -= 1048576f;
6755 }
6756 }
6757 else if (source._tiles_snow.Length != 0 && EClass._zone.IsSnowCovered)
6758 {
6759 if (source._tiles_snow.Length > 1)
6760 {
6761 int num = ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % source._tiles_snow.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6762 p.tile = source._tiles_snow[(num < source._tiles_snow.Length) ? num : 0] * ((!flipX) ? 1 : (-1));
6763 }
6764 else
6765 {
6766 p.tile = source._tiles_snow[0] * ((!flipX) ? 1 : (-1));
6767 }
6768 }
6769 else if (sourceCard._tiles.Length > 1)
6770 {
6771 int num2 = ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % sourceCard._tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6772 p.tile = sourceCard._tiles[(num2 >= 0 && num2 < sourceCard._tiles.Length) ? num2 : 0] * ((!flipX) ? 1 : (-1));
6773 }
6774 else
6775 {
6776 p.tile = sourceCard._tiles[0] * ((!flipX) ? 1 : (-1));
6777 }
6778 p.dir = base.dir;
6779 }
static int GetColorInt(ref Color matColor, int p)
override bool flipX
Definition: Chara.cs:549
SourceMaterial.Row mat
Definition: RenderParam.cs:17
SourceMaterial materials
virtual bool IsSnowCovered
Definition: Spatial.cs:545

References RenderRow._tiles, SourceChara.Row._tiles_snow, EClass._zone, BaseTileMap.GetColorInt(), Spatial.IsSnowCovered, RenderParam.mat, SourceManager.materials, EClass.sources, and SourceChara.Row.staticSkin.

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

◆ SetSortVal()

override void Chara.SetSortVal ( UIList::SortMode  m,
CurrencyType  currency = CurrencyType::Money 
)
inlinevirtual

Reimplemented from Card.

Definition at line 7303 of file Chara.cs.

7304 {
7305 switch (m)
7306 {
7307 case UIList.SortMode.ByJob:
7308 sortVal = job._index * 10000 + sourceCard._index;
7309 break;
7310 case UIList.SortMode.ByRace:
7311 sortVal = race._index * 10000 * ((!IsHuman) ? 1 : (-1)) + sourceCard._index;
7312 break;
7313 case UIList.SortMode.ByFeat:
7314 sortVal = -GetTotalFeat();
7315 break;
7316 default:
7317 sortVal = sourceCard._index * ((!IsHuman) ? 1 : (-1));
7318 break;
7319 case UIList.SortMode.ByWorkk:
7320 break;
7321 }
7322 }
int sortVal
Definition: Card.cs:102
int GetTotalFeat()
Definition: Chara.cs:8121
Definition: UIList.cs:9
SortMode
Definition: UIList.cs:27

References SourceData< T, T2 >.BaseRow._index.

Referenced by BaseListPeople.List(), and LayerDragGrid.SetInv().

◆ SetSource()

override void Chara.SetSource ( )
inlinevirtual

Reimplemented from Card.

Definition at line 2093 of file Chara.cs.

2094 {
2095 source = EClass.sources.charas.map.TryGetValue(id);
2096 if (source == null)
2097 {
2098 Debug.LogWarning("Chara " + id + " not found");
2099 id = "chicken";
2100 source = EClass.sources.charas.map[id];
2101 }
2102 path.walker = this;
2103 }

References SourceManager.charas, Debug, Card.id, source, and EClass.sources.

Referenced by Refresh().

◆ SetSummon()

void Chara.SetSummon ( int  duration)
inline

Definition at line 2413 of file Chara.cs.

2414 {
2415 base.c_summonDuration = duration;
2416 base.isSummon = true;
2417 }

Referenced by ActEffect.ProcAt(), and QuestEscort.ReleaseEscort().

◆ SetTempHand()

void Chara.SetTempHand ( int  right = 0,
int  left = 0 
)
inline

◆ ShouldEquip()

bool Chara.ShouldEquip ( Thing  t,
bool  useFav = false 
)
inline

Definition at line 7638 of file Chara.cs.

7639 {
7640 if (t.IsRangedWeapon && t.category.slot == 0)
7641 {
7642 if (!CanEquipRanged(t))
7643 {
7644 return false;
7645 }
7646 int num = 0;
7647 foreach (Thing thing in things)
7648 {
7649 if (thing.IsRangedWeapon)
7650 {
7651 if (thing.category.slot != 0 && thing.isEquipped)
7652 {
7653 return false;
7654 }
7655 if (CanEquipRanged(thing) && thing.GetEquipValue() > num)
7656 {
7657 num = thing.GetEquipValue();
7658 }
7659 }
7660 }
7661 if (t.GetEquipValue() > num)
7662 {
7663 return true;
7664 }
7665 return false;
7666 }
7667 BodySlot bodySlot = body.GetSlot(t);
7668 if (bodySlot == null)
7669 {
7670 return false;
7671 }
7672 if (useFav)
7673 {
7674 switch (GetFavAttackStyle())
7675 {
7676 case AttackStyle.Default:
7677 case AttackStyle.TwoHand:
7678 if (t.IsMeleeWeapon)
7679 {
7680 bodySlot = body.slotMainHand;
7681 }
7682 else if (bodySlot.elementId == 35)
7683 {
7684 return false;
7685 }
7686 break;
7687 case AttackStyle.Shield:
7688 if (t.IsMeleeWeapon)
7689 {
7690 bodySlot = body.slotMainHand;
7691 }
7692 else if (bodySlot.elementId == 35 && t.IsMeleeWeapon)
7693 {
7694 return false;
7695 }
7696 break;
7697 case AttackStyle.TwoWield:
7698 if (bodySlot.elementId == 35 && !t.IsMeleeWeapon)
7699 {
7700 return false;
7701 }
7702 break;
7703 }
7704 }
7705 if (!body.IsEquippable(t, bodySlot, text: false))
7706 {
7707 return false;
7708 }
7709 if (bodySlot.thing != null && (bodySlot.thing.blessedState <= BlessedState.Cursed || bodySlot.thing.GetEquipValue() >= t.GetEquipValue()))
7710 {
7711 return false;
7712 }
7713 if (!base.IsPCFactionOrMinion)
7714 {
7715 int num2 = 0;
7716 foreach (Element value in t.elements.dict.Values)
7717 {
7718 if (value.Value <= 0)
7719 {
7720 int num3 = 100;
7721 switch (value.id)
7722 {
7723 case 418:
7724 num3 = 10;
7725 break;
7726 case 60:
7727 case 61:
7728 case 62:
7729 num3 = 200;
7730 break;
7731 case 962:
7732 num3 = 10000;
7733 break;
7734 }
7735 num2 += value.Value * num3 / 100;
7736 }
7737 }
7738 if (num2 < -40)
7739 {
7740 return false;
7741 }
7742 }
7743 if (t.HasTag(CTAG.gift))
7744 {
7745 return false;
7746 }
7747 return true;
7748 }
bool IsMeleeWeapon
Definition: Card.cs:2244
BlessedState blessedState
Definition: Card.cs:279
bool IsEquippable(Thing thing, BodySlot slot, bool text=true)
Definition: CharaBody.cs:110
AttackStyle GetFavAttackStyle()
Definition: Chara.cs:4669

References Card.blessedState, Card.category, ElementContainer.dict, BodySlot.elementId, Card.elements, Card.GetEquipValue(), CharaBody.GetSlot(), Card.HasTag(), Element.id, CharaBody.IsEquippable(), Thing.isEquipped, Card.IsMeleeWeapon, Card.IsRangedWeapon, CharaBody.slotMainHand, BodySlot.thing, and Element.Value.

◆ ShouldThrowAway()

bool Chara.ShouldThrowAway ( Thing  t,
ClearInventoryType  type 
)
inline

Definition at line 8475 of file Chara.cs.

8476 {
8477 if (IsPCFaction)
8478 {
8479 if (t.IsFood && t.category.id != "fish" && !t.IsDecayed)
8480 {
8481 return false;
8482 }
8483 if (t.trait.GetHealAction(this) != null)
8484 {
8485 return false;
8486 }
8487 if (t.IsThrownWeapon || t.IsRangedWeapon || t.IsAmmo)
8488 {
8489 return false;
8490 }
8491 if (t.trait is TraitBlanket || t.trait is TraitItemProc || t.trait is TraitBookSkill)
8492 {
8493 return false;
8494 }
8495 }
8496 if (t.isEquipped || t.rarity >= Rarity.Legendary || !t.trait.CanBeDestroyed || t.c_isImportant)
8497 {
8498 return false;
8499 }
8500 if (t.trait is TraitCurrency || t.trait is TraitTool)
8501 {
8502 return false;
8503 }
8504 switch (type)
8505 {
8506 case ClearInventoryType.SellAtTown:
8507 if (!t.isGifted && !t.isNPCProperty)
8508 {
8509 return false;
8510 }
8511 break;
8512 case ClearInventoryType.Purge:
8513 switch (t.category.id)
8514 {
8515 case "fish":
8516 if (EClass.rnd(3) == 0)
8517 {
8518 return true;
8519 }
8520 break;
8521 case "junk":
8522 case "garbage":
8523 if (EClass.rnd(3) != 0)
8524 {
8525 return true;
8526 }
8527 break;
8528 }
8529 if (t.id == "flyer")
8530 {
8531 return true;
8532 }
8533 if (!t.IsDecayed && EClass.rnd(3) == 0)
8534 {
8535 return false;
8536 }
8537 if (!things.IsFull() && t.IsRangedWeapon)
8538 {
8539 return false;
8540 }
8541 break;
8542 }
8543 return true;
8544 }
bool IsThrownWeapon
Definition: Card.cs:2248
bool IsFood
Definition: Card.cs:2178
bool isGifted
Definition: Card.cs:783
virtual Action GetHealAction(Chara c)
Definition: Trait.cs:625

References Card.c_isImportant, Trait.CanBeDestroyed, Card.category, Trait.GetHealAction(), Card.id, Card.IsAmmo, Card.IsDecayed, Thing.isEquipped, Card.IsFood, Card.isGifted, Card.isNPCProperty, Card.IsRangedWeapon, Card.IsThrownWeapon, Card.rarity, EClass.rnd(), and Card.trait.

◆ ShowDialog() [1/2]

void Chara.ShowDialog ( )
inline

Definition at line 7057 of file Chara.cs.

7058 {
7059 Zone_Nymelle zone_Nymelle = EClass._zone as Zone_Nymelle;
7060 if (conSuspend != null && IsPCParty)
7061 {
7062 RemoveCondition<ConSuspend>();
7063 }
7064 if (LayerDrama.forceJump == null)
7065 {
7066 if (IsDeadOrSleeping)
7067 {
7068 ShowDialog("_chara", "sleep");
7069 return;
7070 }
7071 if (EClass.pc.isHidden && !CanSee(EClass.pc))
7072 {
7073 ShowDialog("_chara", "invisible");
7074 return;
7075 }
7077 {
7079 ShowDialog("_chara", "give_card");
7080 Thing thing = ThingGen.Create("figure");
7081 thing.MakeFigureFrom(id);
7082 EClass.player.DropReward(thing);
7083 thing = ThingGen.Create("figure3");
7084 thing.MakeFigureFrom(id);
7085 EClass.player.DropReward(thing);
7086 return;
7087 }
7088 if (GetInt(71) == -2)
7089 {
7090 ShowDialog("_chara", "give_lunch");
7091 Thing t = CraftUtil.MakeLoveLunch(this);
7093 SetInt(71, EClass.world.date.GetRaw() + 43200);
7094 return;
7095 }
7096 if (base.isRestrained)
7097 {
7098 ShowDialog("_chara", "strain");
7099 return;
7100 }
7101 if (IsEscorted())
7102 {
7103 ShowDialog("_chara", "escort");
7104 return;
7105 }
7106 if (EClass._zone is Zone_Music)
7107 {
7108 ShowDialog("_chara", "party");
7109 return;
7110 }
7111 if (EClass.game.quests.OnShowDialog(this))
7112 {
7113 return;
7114 }
7115 switch (id)
7116 {
7117 case "loytel":
7118 {
7120 {
7121 EClass.game.quests.Get("pre_debt_runaway").Complete();
7122 EClass.player.flags.loytelEscaped = false;
7123 EClass.game.quests.Add("debt", "loytel");
7124 ShowDialog("loytel", "loytelEscaped");
7125 return;
7126 }
7127 QuestDebt questDebt = EClass.game.quests.Get<QuestDebt>();
7128 if (questDebt != null && questDebt.paid)
7129 {
7130 questDebt.stage++;
7131 if (questDebt.stage > 7)
7132 {
7133 questDebt.stage = 7;
7134 }
7135 ShowDialog("loytel", "debt" + questDebt.stage);
7136 return;
7137 }
7138 break;
7139 }
7140 case "farris":
7141 if (EClass._zone.id == "startVillage" || EClass._zone.id == "startVillage3" || EClass.game.IsSurvival)
7142 {
7143 ShowDialog("farris");
7144 return;
7145 }
7147 {
7148 case -1:
7149 ShowDialog("farris", "nymelle_noQuest");
7150 break;
7151 case 0:
7152 ShowDialog("farris", "nymelle_first");
7153 break;
7154 case 1:
7155 ShowDialog("farris", "home_first");
7156 break;
7157 default:
7158 ShowDialog("farris");
7159 break;
7160 }
7161 return;
7162 case "ashland":
7163 ShowDialog("ashland");
7164 return;
7165 case "fiama":
7166 if (zone_Nymelle != null && zone_Nymelle.IsCrystalLv && EClass.game.quests.GetPhase<QuestExploration>() == 3)
7167 {
7168 SoundManager.ForceBGM();
7169 LayerDrama.ActivateMain("mono", "nymelle_crystal");
7170 }
7172 {
7174 {
7175 EClass.player.flags.fiamaFirstDream = true;
7176 ShowDialog("fiama", "firstDream");
7177 }
7179 {
7180 ShowDialog("fiama", "giveStoryBook").SetOnKill(delegate
7181 {
7182 EClass.player.flags.fiamaStoryBookGiven = true;
7183 EClass.player.DropReward(ThingGen.Create("book_story"));
7184 });
7185 }
7186 else
7187 {
7188 ShowDialog("fiama");
7189 }
7190 }
7191 else
7192 {
7193 ShowDialog("fiama");
7194 }
7195 return;
7196 case "big_sister":
7198 {
7199 ShowDialog("big_sister", "little_saved");
7200 EClass.player.flags.little_saved = false;
7201 return;
7202 }
7204 {
7205 ShowDialog("big_sister", "little_dead");
7206 EClass.player.flags.little_killed = false;
7207 return;
7208 }
7209 break;
7210 }
7211 if (trait is TraitGuildDoorman)
7212 {
7213 string tag = ((trait is TraitDoorman_Fighter) ? "fighter" : ((trait is TraitDoorman_Mage) ? "mage" : "thief"));
7214 ShowDialog("guild_doorman", "main", tag);
7215 return;
7216 }
7217 if (trait is TraitGuildClerk)
7218 {
7219 string tag2 = ((trait is TraitClerk_Fighter) ? "fighter" : ((trait is TraitClerk_Mage) ? "mage" : "thief"));
7220 ShowDialog("guild_clerk", "main", tag2);
7221 return;
7222 }
7223 }
7224 bool flag = true;
7225 if (id == "parttimer_jure" && (!EClass._zone.IsFestival || !(EClass._zone is Zone_Noyel) || EClass.pc.faith == EClass.game.religions.Healing))
7226 {
7227 flag = false;
7228 }
7229 if (flag && File.Exists(CorePath.DramaData + id + ".xlsx"))
7230 {
7231 ShowDialog(id);
7232 }
7233 else
7234 {
7235 ShowDialog("_chara");
7236 }
7237 }
bool CanGiveCard()
Definition: Affinity.cs:63
void MakeFigureFrom(string id)
Definition: Card.cs:5742
void ShowDialog()
Definition: Chara.cs:7057
bool DroppedCard(string id)
Definition: CodexManager.cs:46
void MarkCardDrop(string id)
Definition: CodexManager.cs:41
static string DramaData
Definition: CorePath.cs:182
static Thing MakeLoveLunch(Chara c)
Definition: CraftUtil.cs:220
bool IsSurvival
Definition: Game.cs:276
static string forceJump
Definition: LayerDrama.cs:18
static LayerDrama ActivateMain(string idSheet, string idStep=null, Chara target=null, Card ref1=null, string tag="")
Definition: LayerDrama.cs:61
bool loytelEscaped
Definition: Player.cs:479
int storyFiama
Definition: Player.cs:623
bool little_saved
Definition: Player.cs:443
bool fiamaStoryBookGiven
Definition: Player.cs:299
bool fiamaFirstDream
Definition: Player.cs:311
bool little_killed
Definition: Player.cs:455
CodexManager codex
Definition: Player.cs:1115
bool EnableDreamStory
Definition: Player.cs:1270
Thing DropReward(Thing t, bool silent=false)
Definition: Player.cs:2549
bool paid
Definition: QuestDebt.cs:10
int stage
Definition: QuestDebt.cs:13
bool OnShowDialog(Chara c)
Quest Add(string id, string idGlobalChara=null)
Definition: QuestManager.cs:29
int GetPhase(string id)
Quest Get(string id)
void Complete()
Definition: Quest.cs:473
ReligionHealing Healing
bool IsCrystalLv
Definition: Zone_Nymelle.cs:25
virtual bool IsFestival
Definition: Zone.cs:209

References EClass._zone, LayerDrama.ActivateMain(), QuestManager.Add(), Affinity.CanGiveCard(), Player.codex, Quest.Complete(), ThingGen.Create(), World.date, CorePath.DramaData, CodexManager.DroppedCard(), Player.DropReward(), Player.EnableDreamStory, faith, Player.Flags.fiamaFirstDream, Player.Flags.fiamaStoryBookGiven, Player.flags, LayerDrama.forceJump, EClass.game, QuestManager.Get(), QuestManager.GetPhase(), Date.GetRaw(), ReligionManager.Healing, Spatial.id, Zone_Nymelle.IsCrystalLv, Zone.IsFestival, Card.isHidden, Game.IsSurvival, Player.Flags.little_killed, Player.Flags.little_saved, Player.Flags.loytelEscaped, Card.MakeFigureFrom(), CraftUtil.MakeLoveLunch(), CodexManager.MarkCardDrop(), QuestManager.OnShowDialog(), QuestDebt.paid, EClass.pc, EClass.player, Game.quests, Game.religions, QuestDebt.stage, Player.Flags.storyFiama, and EClass.world.

Referenced by ZonePreEnterEncounter.Execute(), ZonePreEnterOnCompleteQuestInstance.Execute(), LayerInteraction.GetPage(), Quest.OnClickQuest(), InspectGroupChara.OnSetActions(), ActChat.Perform(), MeetingMerchant.PlayDrama(), LayerHire.Refresh(), and LayerQuestBoard.RefreshHire().

◆ ShowDialog() [2/2]

LayerDrama Chara.ShowDialog ( string  book,
string  step = "main",
string  tag = "" 
)
inline

Definition at line 7239 of file Chara.cs.

7240 {
7241 return _ShowDialog(book, null, step, tag);
7242 }
LayerDrama _ShowDialog(string book, string sheet, string step="main", string tag="")
Definition: Chara.cs:7244

References book.

◆ Sleep()

void Chara.Sleep ( Thing  bed = null,
Thing  pillow = null,
bool  pickup = false,
ItemPosition  posBed = null,
ItemPosition  posPillow = null 
)
inline

Definition at line 9731 of file Chara.cs.

9732 {
9733 RemoveCondition<ConAwakening>();
9734 AddCondition(Condition.Create(100, delegate(ConSleep con)
9735 {
9736 con.pcSleep = 15;
9737 con.pcBed = bed;
9738 con.pcPillow = pillow;
9739 con.pickup = pickup;
9740 con.posBed = posBed;
9741 con.posPillow = posPillow;
9742 }), force: true);
9743 }

References bed, and Condition.Create().

Referenced by AI_Sleep.OnProgressComplete(), HotItemActionSleep.Perform(), and AI_PassTime.Run().

◆ Sniff()

void Chara.Sniff ( Chara  c)
inline

Definition at line 8111 of file Chara.cs.

8112 {
8113 Say("abCatSniff", this, c);
8114 AddCondition<ConHOT>(EClass.curve(50 + c.CHA * 5, 400, 100));
8115 c.ShowEmo(Emo.angry);
8116 ShowEmo(Emo.love);
8117 Talk("sniff");
8118 c.Talk(new string[4] { "labor", "disgust", "scold", "callGuards" }.RandomItem());
8119 }

References Card.CHA, EClass.curve(), Card.ShowEmo(), and Card.Talk().

Referenced by ActEffect.Proc(), and AI_Idle.Run().

◆ SplitHeld()

Card Chara.SplitHeld ( int  a)
inline

Definition at line 4604 of file Chara.cs.

4605 {
4606 return held.Split(a);
4607 }

References Card.Split().

Referenced by ActPlan._Update(), AI_HaulResource.Run(), and HotItemHeld.TrySetAct().

◆ Stumble()

void Chara.Stumble ( int  mtp = 100)
inline

Definition at line 1864 of file Chara.cs.

1865 {
1866 bool flag = EClass._map.FindThing((Thing t) => t.IsInstalled && t.pos.Equals(EClass.pc.pos) && t.trait is TraitStairsUp) != null;
1867 Say(flag ? "dmgBurdenStairs" : "dmgBurdenFallDown", this);
1868 int num = MaxHP;
1869 if (Evalue(1421) > 0)
1870 {
1871 num = mana.max;
1872 }
1873 int num2 = (num * (base.ChildrenWeight * 100 / WeightLimit) / (flag ? 100 : 200) + 1) * mtp / 100;
1874 if (base.hp <= 0)
1875 {
1876 num2 *= 2;
1877 }
1878 DamageHP(num2, flag ? AttackSource.BurdenStairs : AttackSource.BurdenFallDown);
1879 }
Thing FindThing(Func< Thing, bool > func)
Definition: Map.cs:2592

References EClass._map, Card.DamageHP(), Point.Equals(), Card.Evalue(), Map.FindThing(), Card.IsInstalled, mana, Stats.max, MaxHP, EClass.pc, Card.pos, Card.Say(), Card.trait, and WeightLimit.

Referenced by TraitTrap.OnActivateTrap(), and Scene.OnUpdate().

◆ SyncRide() [1/2]

void Chara.SyncRide ( )
inline

Definition at line 3948 of file Chara.cs.

3949 {
3950 if (host != null)
3951 {
3952 host.SyncRide();
3953 }
3954 if (ride != null)
3955 {
3956 SyncRide(ride);
3957 }
3958 if (parasite != null)
3959 {
3961 }
3962 }

References SyncRide().

Referenced by _Move(), Card._Move(), Card.MoveImmediate(), ActRide.Ride(), and SyncRide().

◆ SyncRide() [2/2]

void Chara.SyncRide ( Chara  c)
inline

Definition at line 3964 of file Chara.cs.

3965 {
3966 if (!c.pos.Equals(pos))
3967 {
3968 if (!pos.IsValid)
3969 {
3970 Debug.LogError("exception: pos is not valid:" + pos?.ToString() + "/" + this);
3971 pos = new Point();
3972 }
3973 EClass._map.MoveCard(pos, c);
3974 }
3975 }

References EClass._map, Debug, Point.Equals(), Map.MoveCard(), and Card.pos.

◆ TalkTopic()

string Chara.TalkTopic ( string  topic = "calm")
inline

Definition at line 6986 of file Chara.cs.

6987 {
6988 if (host == null && !IsInActiveZone)
6989 {
6990 return null;
6991 }
6992 if (!isSynced && (host == null || !host.isSynced) && topic != "dead")
6993 {
6994 return null;
6995 }
6996 if (IsPCParty)
6997 {
6998 int num = EClass.pc.party.members.Count - 1;
6999 switch (topic)
7000 {
7001 case "calm":
7002 if (EClass.rnd(num * 5) != 0)
7003 {
7004 return null;
7005 }
7006 break;
7007 case "aggro":
7008 if (EClass.rnd(num * 10) != 0)
7009 {
7010 return null;
7011 }
7012 break;
7013 case "kill":
7014 if (EClass.rnd(num * 3) != 0)
7015 {
7016 return null;
7017 }
7018 break;
7019 case "fov":
7020 return null;
7021 }
7022 }
7023 string topicText = GetTopicText(topic);
7024 if (topicText.IsEmpty())
7025 {
7026 return null;
7027 }
7028 string text = "_bracketTalk".lang();
7029 bool flag = topicText.StartsWith("*");
7030 bool flag2 = topicText.StartsWith("(");
7031 bool flag3 = topicText.StartsWith(text) || (topicText.Length > 0 && topicText[0] == text[0]) || topicText[0] == '“';
7032 topicText = ApplyTone(topicText);
7033 topicText = topicText.Replace("~", "*");
7034 Msg.SetColor(flag2 ? Msg.colors.Thinking : (flag3 ? Msg.colors.Talk : Msg.colors.Ono));
7035 Msg.Say(StripTalkSpeiclaCharacters(topicText.Replace("&", "")));
7036 if (topic == "dead")
7037 {
7038 EClass.ui.popGame.PopText(ApplyNewLine(topicText.StripBrackets()), null, "PopTextDead", default(Color), pos.Position() + EClass.setting.render.tc.textPosDead);
7039 }
7040 else if (flag || flag3 || flag2)
7041 {
7042 (host ?? this).renderer.Say(ApplyNewLine(topicText.StripBrackets()), default(Color), IsPCParty ? 0.6f : 0f);
7043 }
7044 return topicText;
7045 }
void Say(string text, Color c=default(Color), float duration=0f)
string ApplyNewLine(string text)
Definition: Card.cs:6962
string StripTalkSpeiclaCharacters(string text)
Definition: Card.cs:6943
string ApplyTone(string text, bool stripPun=false)
Definition: Card.cs:7041
string GetTopicText(string topic="calm")
Definition: Chara.cs:6953
static UI ui
Definition: EClass.cs:17
Color Thinking
Definition: MsgColors.cs:17
Color Talk
Definition: MsgColors.cs:7

References Color, Msg.colors, isSynced, MsgColors.Ono, GameSetting.render, EClass.rnd(), Msg.Say(), Msg.SetColor(), EClass.setting, MsgColors.Talk, GameSetting.RenderSetting.tc, GameSetting.RenderSetting.TCSetting.textPosDead, MsgColors.Thinking, and EClass.ui.

Referenced by AI_Churyu.Run(), and AI_Idle.Run().

◆ Tick()

override void Chara.Tick ( )
inlinevirtual

Reimplemented from Card.

Definition at line 3977 of file Chara.cs.

3978 {
3979 SyncRide();
3980 combatCount--;
3981 ignoreSPAbsorb = false;
3982 if (IsPC)
3983 {
3984 if (hasMovedThisTurn)
3985 {
3986 pos.Things.ForeachReverse(delegate(Thing t)
3987 {
3989 {
3990 AI_Goto aI_Goto = ai.Current as AI_Goto;
3991 if ((aI_Goto == null && !(ai is GoalManualMove)) || (aI_Goto != null && !aI_Goto.dest.Equals(pos)))
3992 {
3993 return;
3994 }
3995 }
3996 t.trait.OnStepped(this);
3997 });
3998 if (isDead)
3999 {
4000 return;
4001 }
4002 hasMovedThisTurn = false;
4004 {
4005 EClass.player.haltMove = false;
4006 ActionMode.Adv.TryCancelInteraction(sound: false);
4007 EInput.Consume(1);
4008 return;
4009 }
4010 if (EClass._zone.IsRegion)
4011 {
4013 {
4014 foreach (Chara member in EClass.pc.party.members)
4015 {
4016 if (member.hunger.value > 65)
4017 {
4018 member.InstantEat(null, sound: false);
4019 }
4020 }
4021 }
4022 Chara chara = null;
4024 if (cell2 != null && (cell2.zone == null || (cell2.zone is Zone_Field && !cell2.zone.IsPCFaction)))
4025 {
4026 foreach (Chara chara2 in EClass._map.charas)
4027 {
4028 if (!chara2.IsPCFactionOrMinion && !chara2.IsGlobal && chara2.pos.Equals(EClass.pc.pos))
4029 {
4030 chara = chara2;
4031 break;
4032 }
4033 }
4034 }
4035 if (chara != null)
4036 {
4038 {
4039 EClass.player.safeTravel = 5 + EClass.rnd(5);
4040 }
4041 EClass._zone.RemoveCard(chara);
4042 Msg.Say("encounter");
4043 EClass.player.EnterLocalZone(encounter: true, chara);
4044 }
4045 else if (EClass.player.safeTravel <= 0)
4046 {
4047 if (cell2 != null && cell2.zone == null && !EClass.debug.ignoreEncounter)
4048 {
4050 if (!tileInfo.shore)
4051 {
4052 bool num = EClass.pc.HasCondition<ConWardMonster>();
4053 bool flag = EClass.pc.HasCondition<ConDrawMonster>();
4054 bool flag2 = EClass.game.quests.Get<QuestEscort>() != null;
4055 int num2 = (tileInfo.isRoad ? 22 : 12);
4056 if (flag2)
4057 {
4058 num2 = (tileInfo.isRoad ? 16 : 10);
4059 }
4060 if (num)
4061 {
4062 num2 *= (flag2 ? 2 : 20);
4063 }
4064 if (flag)
4065 {
4066 num2 /= 2;
4067 }
4068 if (EClass.rnd(num2) == 0)
4069 {
4070 Msg.Say("encounter");
4071 if (!flag)
4072 {
4073 EClass.player.safeTravel = 5 + EClass.rnd(5);
4074 }
4075 EClass.player.EnterLocalZone(encounter: true);
4076 }
4077 }
4078 }
4079 }
4080 else
4081 {
4083 }
4084 }
4085 }
4086 EClass.player.pickupDelay = 0f;
4087 if (EClass.player.returnInfo != null)
4088 {
4090 if (EClass.player.returnInfo.turns <= 0)
4091 {
4093 {
4094 EClass.player.returnInfo = null;
4096 }
4097 else
4098 {
4100 {
4101 int uidDest = EClass.player.returnInfo.uidDest;
4102 Zone zone = null;
4103 if (uidDest != 0)
4104 {
4105 zone = EClass.game.spatials.map.TryGetValue(uidDest) as Zone;
4106 }
4107 if (zone == null || zone.destryoed)
4108 {
4109 zone = EClass.world.region;
4110 }
4112 {
4113 Msg.Say("returnFail");
4114 }
4115 else
4116 {
4117 Msg.Say("returnComplete");
4118 EClass.player.uidLastTravelZone = 0;
4120 EClass.player.lastZonePos = null;
4121 }
4122 EClass.player.returnInfo = null;
4123 return;
4124 }
4125 EClass.player.returnInfo = null;
4126 Msg.Say("returnOverweight");
4127 }
4128 }
4129 }
4130 if ((HasNoGoal || !ai.IsRunning) && !WillConsumeTurn())
4131 {
4133 return;
4134 }
4137 {
4138 RecipeUpdater.dirty = true;
4139 }
4141 }
4142 else
4143 {
4144 actTime = EClass.player.baseActTime * Mathf.Max(0.1f, (float)EClass.pc.Speed / (float)Speed);
4145 hasMovedThisTurn = false;
4146 }
4149 {
4150 return;
4151 }
4153 if (host != null && !consumeTurn)
4154 {
4155 if (host.ride == this && ((host.hasMovedThisTurn && IsInCombat) || (enemy != null && turn % 3 != 0)))
4156 {
4157 consumeTurn = true;
4158 }
4159 if (host.parasite == this && enemy != null && EClass.rnd(10) > EClass.rnd(host.Evalue(227) + 10))
4160 {
4161 if (Dist(enemy) < 3 && EClass.rnd(2) == 0)
4162 {
4163 Say("parasite_fail", this, host);
4164 if (EClass.rnd(2) == 0 && GetInt(106) == 0)
4165 {
4166 Talk("parasite_fail");
4167 }
4168 }
4169 consumeTurn = true;
4170 }
4171 }
4172 if (consumeTurn)
4173 {
4174 if (IsPC)
4175 {
4177 }
4178 }
4179 else
4180 {
4181 if (base.isRestrained)
4182 {
4183 TryUnrestrain();
4184 }
4185 if (enemy != null)
4186 {
4188 {
4189 enemy = null;
4190 }
4191 else if (!IsPC && (ai.CancelOnAggro || !ai.IsRunning))
4192 {
4193 SetAIAggro();
4194 }
4195 }
4196 if (HasNoGoal || !ai.IsRunning)
4197 {
4198 ChooseNewGoal();
4199 }
4200 ai.Tick();
4201 }
4202 Cell cell = base.Cell;
4204 {
4205 AddCondition<ConWet>(50);
4206 if (pos.IsHotSpring)
4207 {
4208 hygiene.Mod(2);
4209 }
4210 }
4211 if (IsPC && !EClass._zone.IsRegion && cell.CanSuffocate() && !EClass.debug.godMode)
4212 {
4213 AddCondition<ConSuffocation>(800 / (100 + EvalueMax(200, -5) * 10), force: true);
4214 }
4215 CellEffect e;
4216 if (cell.effect != null)
4217 {
4218 e = cell.effect;
4219 switch (e.id)
4220 {
4221 case 1:
4222 case 2:
4223 case 4:
4224 if (IsLevitating)
4225 {
4226 Say("levitating");
4227 break;
4228 }
4229 AddCondition<ConWet>(50);
4230 ProcEffect();
4231 break;
4232 case 3:
4233 PlaySound("fire_step");
4234 AddCondition<ConBurning>(30);
4235 break;
4236 case 5:
4237 if (!isWet)
4238 {
4239 PlaySound("bubble");
4240 AddCondition<ConWet>(30);
4241 ProcEffect();
4242 }
4243 break;
4244 case 6:
4245 if (hasMovedThisTurn)
4246 {
4247 Say("abMistOfDarkness_step", this);
4248 }
4249 AddCondition<ConDark>(e.power);
4250 break;
4251 }
4252 }
4253 if (IsPC)
4254 {
4255 if (EClass.player.currentHotItem.Thing != null)
4256 {
4258 }
4260 }
4261 void ClearEffect()
4262 {
4263 EClass._map.SetLiquid(cell.x, cell.z, 0, 0);
4264 }
4265 void ProcEffect()
4266 {
4267 if (e.idEffect != 0)
4268 {
4269 ActEffect.ProcAt(e.idEffect, e.power, e.isBlessed ? BlessedState.Blessed : (e.isCursed ? BlessedState.Cursed : BlessedState.Normal), this, this, new Point(pos), e.isHostileAct, new ActRef
4270 {
4271 aliasEle = EClass.sources.elements.map[e.idEle].alias,
4272 n1 = e.n1,
4273 refVal = e.refVal
4274 });
4275 ClearEffect();
4276 }
4277 }
4278 }
virtual bool CancelOnAggro
Definition: AIAct.cs:80
bool TryCancelInteraction(bool sound=true)
Definition: AM_Adv.cs:1069
void SetTurbo(int mtp=-1)
Definition: AM_Adv.cs:1040
static AM_Adv Adv
Definition: ActionMode.cs:15
virtual void OnEndPlayerTurn()
int turn
Definition: Card.cs:66
void TryUnrestrain(bool force=false, Chara c=null)
Definition: Card.cs:7275
bool isHostileAct
Definition: CellEffect.cs:74
EffectId idEffect
Definition: CellEffect.cs:38
bool isCursed
Definition: CellEffect.cs:98
bool isBlessed
Definition: CellEffect.cs:86
CellEffect effect
Definition: Cell.cs:94
byte z
Definition: Cell.cs:58
byte x
Definition: Cell.cs:56
void InstantEat(Thing t=null, bool sound=true)
Definition: Chara.cs:7592
int Speed
Definition: Chara.cs:1097
static bool consumeTurn
Definition: Chara.cs:182
void SetAIAggro()
Definition: Chara.cs:8893
bool ignoreSPAbsorb
Definition: Chara.cs:148
void ChooseNewGoal()
Definition: Chara.cs:8774
bool WillConsumeTurn()
Definition: Chara.cs:3674
bool ignoreEncounter
Definition: CoreDebug.cs:201
bool shore
Definition: EloMap.cs:50
TileInfo GetTileInfo(int gx, int gy)
Definition: EloMap.cs:286
ConfigPreference preference
Definition: Game.cs:97
virtual Thing Thing
Definition: HotItem.cs:38
void SetLiquid(int x, int z, CellEffect effect=null)
Definition: Map.cs:1477
static string SayNothingHappen()
Definition: Msg.cs:96
int turns
Definition: Player.cs:84
bool haltMove
Definition: Player.cs:1171
float baseActTime
Definition: Player.cs:1199
void EnterLocalZone(bool encounter=false, Chara mob=null)
Definition: Player.cs:1948
HotItem currentHotItem
Definition: Player.cs:1100
int safeTravel
Definition: Player.cs:920
int eloY
Definition: Point.cs:81
int eloX
Definition: Point.cs:79
bool IsHotSpring
Definition: Point.cs:375
bool destryoed
Definition: Spatial.cs:45
virtual void OnTickHeld()
Definition: Trait.cs:1072
virtual bool IgnoreOnSteppedWhenMoving
Definition: Trait.cs:383
Definition: ActRef.cs:2

References EClass._map, EClass._zone, Game.activeZone, ActionMode.Adv, CoreConfig.GameConfig.alwaysUpdateRecipe, ConfigPreference.autoEat, Player.baseActTime, burden, Map.charas, Core.config, Game.config, EInput.Consume(), EClass.core, EClass.debug, Spatial.destryoed, Scene.elomap, Point.eloX, Point.eloY, Player.EnterLocalZone(), Point.Equals(), CoreConfig.game, EClass.game, QuestManager.Get(), EloMap.GetCell(), Stats.GetPhase(), EloMap.GetTileInfo(), Zone.GetTopZone(), Player.haltMove, HasCondition(), hunger, CoreDebug.ignoreEncounter, Trait.IgnoreOnSteppedWhenMoving, CoreDebug.ignoreWeight, InstantEat(), IsGlobal, Zone.IsPCFaction, Card.IsPCFactionOrMinion, Spatial.IsRegion, AIAct.IsRunning, Game.IsSurvival, SpatialManager.map, Party.members, MoveZone(), Trait.OnStepped(), party, EClass.pc, EClass.player, Card.pos, Game.Config.preference, Game.quests, World.region, Zone.RemoveCard(), Player.returnInfo, EClass.rnd(), Player.safeTravel, Msg.Say(), Msg.SayNothingHappen(), EClass.scene, EloMap.TileInfo.shore, Game.spatials, Player.stats, Card.trait, AM_Adv.TryCancelInteraction(), Player.ReturnInfo.turns, Player.Stats.turns, Player.ReturnInfo.uidDest, Stats.value, EClass.world, and EloMap.Cell.zone.

◆ TickConditions()

void Chara.TickConditions ( )
inline

Definition at line 3686 of file Chara.cs.

3687 {
3688 if (_cooldowns != null)
3689 {
3690 TickCooldown();
3691 }
3692 turn++;
3693 consumeTurn = false;
3694 preventRegen = false;
3695 emoIcon = Emo2.none;
3696 if (base.isSummon)
3697 {
3698 base.c_summonDuration--;
3699 if (base.c_summonDuration <= 0)
3700 {
3701 Die();
3702 return;
3703 }
3704 }
3706 {
3707 AddCondition<ConWet>(20);
3708 }
3709 switch (turn % 50)
3710 {
3711 case 0:
3712 happiness = (hunger.value + stamina.value + depression.value + bladder.value + hygiene.value) / 5;
3713 break;
3714 case 1:
3715 if (!IsPC || !EClass.debug.godMode)
3716 {
3717 if (EClass.rnd(2) == 0 && !HasCondition<ConAwakening>())
3718 {
3719 sleepiness.Mod(1);
3720 }
3721 if (EClass.rnd(3) == 0)
3722 {
3723 hunger.Mod(1);
3724 }
3725 if (IsPC && (sleepiness.GetPhase() != 0 || stamina.GetPhase() <= 1))
3726 {
3727 Tutorial.Play("sleep");
3728 }
3729 }
3730 break;
3731 case 2:
3732 if (parasite != null)
3733 {
3734 ModExp(227, (int)((EClass._zone.IsRegion ? 5 : 40) + parasite.affinity.CurrentStage));
3735 }
3736 if (ride != null)
3737 {
3738 ModExp(226, (int)((EClass._zone.IsRegion ? 5 : 40) + ride.affinity.CurrentStage));
3739 }
3740 break;
3741 case 3:
3742 {
3743 int phase = hygiene.GetPhase();
3744 int num = 0;
3745 num = ((!IsPC) ? ((phase > 3) ? 50 : 0) : ((phase > 3) ? 50 : 0));
3746 if (num > EClass.rnd(100))
3747 {
3748 hygiene.Mod(-1);
3749 }
3750 break;
3751 }
3752 case 5:
3753 case 30:
3755 {
3756 AddCondition<ConBurning>(1000, force: true);
3757 }
3758 break;
3759 case 10:
3760 if (HasElement(1250))
3761 {
3762 if (!HasCondition<ConVampire>())
3763 {
3764 AddCondition<ConVampire>();
3765 }
3766 if (!IsPC && !HasCooldown(8793))
3767 {
3768 bool flag = false;
3769 flag = ((!HasCondition<ConTransmuteBat>()) ? (!HasElement(431) && pos.IsSunLit) : (body.HasElement(431) || (EClass.world.date.IsNight && !pos.IsSunLit)));
3770 if (flag && base.IsPCFactionOrMinion && !EClass._zone.IsPCFactionOrTent && EClass._zone.HasLaw && pos.ListWitnesses(this).Count > 0 && !HasCondition<ConBurning>())
3771 {
3772 flag = false;
3773 }
3774 if (flag)
3775 {
3776 UseAbility("SpTransmuteBat", this);
3777 }
3778 }
3779 }
3780 if (HasElement(1423) && !HasCondition<ConPeaky>())
3781 {
3782 AddCondition<ConPeaky>();
3783 }
3784 break;
3785 }
3786 if (turn % 200 == 0)
3787 {
3789 }
3790 if (IsPCParty)
3791 {
3792 if (dirtyWeight)
3793 {
3794 CalcBurden();
3795 }
3796 int phase2 = burden.GetPhase();
3797 int phase3 = hunger.GetPhase();
3798 if (phase3 >= 4)
3799 {
3800 preventRegen = true;
3801 }
3802 if (EClass.rnd(EClass._zone.IsRegion ? 100 : 30) == 0 && phase2 >= 3)
3803 {
3804 Say("dmgBurden", this);
3805 DamageHP(MaxHP * (base.ChildrenWeight * 100 / WeightLimit) / 1000 + 1, AttackSource.Burden);
3806 if (isDead)
3807 {
3808 return;
3809 }
3810 }
3811 if (EClass.rnd(12) == 0)
3812 {
3813 if (IsPC)
3814 {
3815 if (phase2 > 0)
3816 {
3817 ModExp(207, 1 + phase2 * phase2);
3818 }
3819 }
3820 else
3821 {
3822 ModExp(207, 4);
3823 }
3824 }
3825 if (IsPC)
3826 {
3827 if (phase3 >= 5)
3828 {
3829 if (!(ai is AI_Eat) && EClass.rnd(5) == 0)
3830 {
3831 DamageHP(1 + EClass.rnd(2) + MaxHP / 50, AttackSource.Hunger);
3832 }
3833 if (!isDead && EClass.rnd(3) == 0)
3834 {
3835 stamina.Mod(-1);
3836 }
3837 }
3838 if (isDead)
3839 {
3840 return;
3841 }
3842 phase3 = stamina.GetPhase();
3843 if (phase3 <= 0)
3844 {
3845 preventRegen = true;
3846 }
3848 {
3849 if (EClass.rnd(100) == 0 && !isConfused)
3850 {
3851 Msg.Say("rain_confuse");
3852 AddCondition<ConConfuse>(500);
3853 }
3854 if (EClass.rnd(300) == 0 && !isBlind)
3855 {
3856 Msg.Say("rain_confuse");
3857 AddCondition<ConBlind>(200);
3858 }
3859 }
3860 if (turn % (200000 / Mathf.Max(100 + Evalue(409) * 10, 50)) == 0)
3861 {
3862 ModCorruption(1);
3863 }
3864 }
3865 }
3866 if (!IsPC)
3867 {
3868 int num2 = Evalue(409);
3869 if (num2 > 0 && turn % (200000 / Mathf.Max(100 + num2 * 10, 50)) == 0)
3870 {
3871 ModCorruption(1);
3872 }
3873 }
3874 for (int num3 = conditions.Count - 1; num3 >= 0; num3--)
3875 {
3876 if (num3 < conditions.Count)
3877 {
3878 Condition condition = conditions[num3];
3879 if (!condition.TimeBased)
3880 {
3881 condition.Tick();
3882 }
3883 if (!condition.IsKilled)
3884 {
3885 if (condition.ConsumeTurn)
3886 {
3887 consumeTurn = true;
3888 }
3889 if (condition.PreventRegen)
3890 {
3891 preventRegen = true;
3892 }
3893 if (condition.EmoIcon != 0 && condition.EmoIcon > emoIcon)
3894 {
3895 emoIcon = condition.EmoIcon;
3896 }
3897 }
3898 if (isDead)
3899 {
3900 return;
3901 }
3902 }
3903 }
3904 string text = id;
3905 if (!(text == "cocoon"))
3906 {
3907 if (text == "tsunami")
3908 {
3909 if (elements.Base(79) < 30)
3910 {
3911 Die();
3912 return;
3913 }
3914 if (IsInCombat)
3915 {
3916 elements.SetTo(79, elements.Base(79) * 3 / 4);
3917 }
3918 }
3919 }
3920 else
3921 {
3922 if (!EClass._zone.IsRegion && !IsDisabled && 1.0001f - (float)base.hp / (float)MaxHP > EClass.rndf(1f) && !pos.IsSunLit)
3923 {
3924 HatchEgg();
3925 return;
3926 }
3927 consumeTurn = true;
3928 }
3929 if (!preventRegen)
3930 {
3931 if (EClass.rnd(25) == 0 && base.hp < MaxHP)
3932 {
3933 HealHP(EClass.rnd(Evalue(300) / 3 + 1) + 1);
3934 elements.ModExp(300, 8f);
3935 }
3936 if (EClass.rnd(8) == 0 && mana.value < mana.max)
3937 {
3938 mana.Mod(EClass.rnd(Evalue(301) / 2 + 1) + 1);
3939 elements.ModExp(301, 8f);
3940 }
3941 if (EClass.rnd(20) == 0 && !IsPC && stamina.value < stamina.max)
3942 {
3943 stamina.Mod(EClass.rnd(5) + 1);
3944 }
3945 }
3946 }
Emo2
Definition: Emo2.cs:2
Definition: AI_Eat.cs:5
Stage CurrentStage
Definition: Affinity.cs:32
virtual bool PreventRegen
virtual bool TimeBased
virtual Emo2 EmoIcon
Definition: BaseStats.cs:17
void HatchEgg()
Definition: Card.cs:5838
bool dirtyWeight
Definition: Card.cs:86
bool HasElement(int idEle)
Definition: CharaBody.cs:397
void TickCooldown()
Definition: Chara.cs:8755
void DiminishTempElements(int a=1)
Definition: Chara.cs:10346
Emo2 emoIcon
Definition: Chara.cs:108
override void Die(Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None, Chara originalTarget=null)
Definition: Chara.cs:5348
bool UseAbility(int idAct, Card tc=null, Point pos=null, bool pt=false)
Definition: Chara.cs:5828
bool isBlind
Definition: Chara.cs:132
static bool preventRegen
Definition: Chara.cs:184
void CalcBurden()
Definition: Chara.cs:1849
virtual bool IsKilled
Definition: Condition.cs:7
override void Tick()
Definition: Condition.cs:70
List< Chara > ListWitnesses(Chara criminal, int radius=4, WitnessType type=WitnessType.crime, Chara target=null)
Definition: Point.cs:830
static void Play(string idStep)
Definition: Tutorial.cs:7
bool IsRaining
Definition: Weather.cs:117
bool IsPCFactionOrTent
Definition: Zone.cs:476

References EClass._map, EClass._zone, affinity, BaseCondition.ConsumeTurn, Weather.CurrentCondition, Affinity.CurrentStage, EClass.debug, BaseStats.EmoIcon, Stats.GetPhase(), CoreDebug.godMode, Card.HasElement(), CharaBody.HasElement(), Zone.HasLaw, Map.IsIndoor, Condition.IsKilled, Zone.IsPCFactionOrTent, Weather.IsRaining, Spatial.IsRegion, Stats.max, Stats.Mod(), EClass.pc, Tutorial.Play(), BaseCondition.PreventRegen, EClass.rnd(), EClass.rndf(), Msg.Say(), Condition.Tick(), BaseCondition.TimeBased, Stats.value, World.weather, and EClass.world.

Referenced by _Move().

◆ TickCooldown()

void Chara.TickCooldown ( )
inline

Definition at line 8755 of file Chara.cs.

8756 {
8757 for (int num = _cooldowns.Count - 1; num >= 0; num--)
8758 {
8759 if (_cooldowns[num] % 1000 == 1)
8760 {
8761 _cooldowns.RemoveAt(num);
8762 }
8763 else
8764 {
8765 _cooldowns[num]--;
8766 }
8767 }
8768 if (_cooldowns.Count == 0)
8769 {
8770 _cooldowns = null;
8771 }
8772 }

◆ TickWork()

void Chara.TickWork ( VirtualDate  date)
inline

Definition at line 9175 of file Chara.cs.

9176 {
9178 if (span != TimeTable.Span.Work && span != 0)
9179 {
9180 return;
9181 }
9182 WorkSummary workSummary = GetWorkSummary();
9183 if (span == TimeTable.Span.Work)
9184 {
9185 if (workSummary.work != null)
9186 {
9187 PerformWork(workSummary.work, isHobby: false, date.IsRealTime);
9188 }
9189 }
9190 else if (workSummary.hobbies.Count > 0)
9191 {
9192 PerformWork(workSummary.hobbies.RandomItem(), isHobby: true, date.IsRealTime);
9193 }
9194 }
bool IsRealTime
Definition: VirtualDate.cs:7
WorkSession work
Definition: WorkSummary.cs:10
List< WorkSession > hobbies
Definition: WorkSummary.cs:13

References TimeTable.GetSpan(), WorkSummary.hobbies, Date.hour, VirtualDate.IsRealTime, and WorkSummary.work.

◆ ToString()

override string Chara.ToString ( )
inline

Definition at line 1186 of file Chara.cs.

1187 {
1188 return base.Name + "(" + ai?.ToString() + ")" + pos?.ToString() + "/" + base.ExistsOnMap + "/" + isDead;
1189 }
override string ToString()
Definition: Point.cs:524

References ai, isDead, Card.pos, AIAct.ToString(), and Point.ToString().

Referenced by RefreshSpeed(), ContentQuest.SelectQuest(), and GoalCombat.TryUseAbility().

◆ TryAbsorbRod()

void Chara.TryAbsorbRod ( Thing  t)
inline

Definition at line 4392 of file Chara.cs.

4393 {
4394 if (!IsPC || !(t.trait is TraitRod) || t.c_charges <= 0 || !HasElement(1564))
4395 {
4396 return;
4397 }
4398 Say("absorbRod", this, t);
4399 TraitRod rod = t.trait as TraitRod;
4400 bool flag = false;
4401 if (rod.source != null)
4402 {
4403 using IEnumerator<SourceElement.Row> enumerator = EClass.sources.elements.rows.Where((SourceElement.Row a) => a.id == rod.source.id).GetEnumerator();
4404 if (enumerator.MoveNext())
4405 {
4406 SourceElement.Row current = enumerator.Current;
4407 if (IsPC)
4408 {
4409 GainAbility(current.id, t.c_charges * 100, t);
4410 flag = true;
4411 }
4412 }
4413 }
4414 if (!flag)
4415 {
4416 mana.Mod(-50 * t.c_charges);
4417 }
4418 t.c_charges = 0;
4420 }
int c_charges
Definition: Card.cs:1270
void GainAbility(int ele, int mtp=100, Thing origin=null)
Definition: Chara.cs:10112

References Card.c_charges, SourceManager.elements, SourceElement.Row.id, Stats.Mod(), rod, LayerInventory.SetDirty(), EClass.sources, and Card.trait.

Referenced by ActZap.Perform().

◆ TryAssignBed()

TraitBed Chara.TryAssignBed ( )
inline

Definition at line 7351 of file Chara.cs.

7352 {
7353 if (!IsPCFaction && !IsGuest())
7354 {
7355 return null;
7356 }
7357 foreach (Card item in EClass._map.props.installed.all)
7358 {
7359 if (item.trait is TraitBed traitBed && traitBed.CanAssign(this))
7360 {
7361 traitBed.AddHolder(this);
7362 Msg.Say("claimBed", this);
7363 return traitBed;
7364 }
7365 }
7366 return null;
7367 }
bool CanAssign(Chara c)
Definition: TraitBed.cs:165

References EClass._map, TraitBed.AddHolder(), Props.all, TraitBed.CanAssign(), PropsManager.installed, item, Map.props, and Msg.Say().

Referenced by GoalSleep.OnSimulatePosition(), AI_Idle.Run(), GoalSleep.Run(), and GoalVisitorGuest.Run().

◆ TryDropBossLoot()

void Chara.TryDropBossLoot ( )
inline

Definition at line 5662 of file Chara.cs.

5663 {
5665 {
5666 return;
5667 }
5668 int num = 0;
5669 bool flag = false;
5670 bool flag2 = false;
5671 Point point = pos.GetNearestPoint(allowBlock: true, allowChara: false, allowInstalled: false, ignoreCenter: true) ?? pos;
5672 TreasureType type = TreasureType.BossQuest;
5673 if (EClass._zone.Boss == this)
5674 {
5675 type = TreasureType.BossNefia;
5676 num = 2 + EClass.rnd(2);
5677 flag = (flag2 = true);
5678 EClass._zone.Boss = null;
5679 Msg.Say("boss_win", EClass._zone.Name);
5681 {
5682 Msg.Say("boss_win_void", EClass._zone.Name);
5683 EClass.player.flags.KilledBossInVoid = true;
5684 }
5685 if (EClass._zone.IsNefia)
5686 {
5689 SE.Play("Jingle/fanfare2");
5690 EClass._zone.SetBGM(114, refresh: true, 3f);
5691 }
5694 }
5695 switch (id)
5696 {
5697 case "azzrasizzle":
5698 num = 5;
5699 flag = (flag2 = true);
5700 EClass.Sound.StopBGM(3f);
5701 EClass._zone.SetBGM(1, refresh: false);
5703 {
5704 EClass.game.quests.Get<QuestIntoDarkness>().UpdateOnTalk();
5705 }
5706 break;
5707 case "vernis_boss":
5708 num = 5;
5709 flag = (flag2 = true);
5710 EClass.Sound.StopBGM(3f);
5711 EClass._zone.SetBGM(1, refresh: false);
5713 {
5714 EClass.game.quests.Get<QuestVernis>().UpdateOnTalk();
5715 }
5716 break;
5717 case "lurie_boss":
5718 if (!(EClass._zone is Zone_Exile))
5719 {
5720 num = 5;
5721 flag = (flag2 = true);
5722 EClass._zone.SetBGM(120, refresh: true, 3f);
5724 {
5725 EClass.game.quests.Get<QuestNegotiationDarkness>().ChangePhase(4);
5726 EClass.player.flags.killedDuponne = true;
5727 }
5728 }
5729 break;
5730 case "ungaga_pap":
5731 num = 5;
5732 flag = (flag2 = true);
5734 {
5735 EClass._zone.SetBGM(46, refresh: true, 3f);
5736 }
5737 break;
5738 case "melilith_boss":
5739 num = 5;
5740 flag = (flag2 = true);
5741 EClass.Sound.StopBGM(3f);
5742 EClass._zone.SetBGM(1, refresh: false);
5743 break;
5744 case "doga":
5745 {
5746 QuestCurry questCurry = EClass.game.quests.Get<QuestCurry>();
5747 if (questCurry != null)
5748 {
5749 num = 5;
5750 flag = (flag2 = true);
5751 EClass.Sound.StopBGM(3f);
5752 EClass._zone.SetBGM(1, refresh: false);
5753 questCurry.NextPhase();
5754 }
5755 break;
5756 }
5757 case "fairy_raina":
5758 case "fairy_poina":
5759 {
5760 bool num2 = EClass._map.FindChara((id == "fairy_raina") ? "fairy_poina" : "fairy_raina") == null;
5761 QuestNasu questNasu = EClass.game.quests.Get<QuestNasu>();
5762 if (num2 && questNasu != null && questNasu.phase <= 1)
5763 {
5764 if (questNasu.phase == 0)
5765 {
5766 questNasu.NextPhase();
5767 }
5768 num = 5;
5769 flag = (flag2 = true);
5770 EClass.Sound.StopBGM(3f);
5771 EClass._zone.SetBGM(1, refresh: false);
5772 EClass.player.DropReward(ThingGen.Create("backpack_holding"));
5773 questNasu.NextPhase();
5774 }
5775 break;
5776 }
5777 case "isygarad":
5778 {
5779 num = 5;
5780 flag = (flag2 = true);
5781 QuestExploration questExploration = EClass.game.quests.Get<QuestExploration>();
5782 if (questExploration != null)
5783 {
5784 SE.Play("kill_boss");
5785 questExploration.ChangePhase(3);
5786 EClass.Sound.StopBGM(3f);
5787 EClass._zone.SetBGM(1, refresh: false);
5788 }
5789 break;
5790 }
5791 case "swordkeeper":
5792 num = 10;
5793 flag = true;
5794 SE.Play("kill_boss");
5795 SoundManager.ForceBGM();
5796 LayerDrama.Activate("_event", "event", "swordkeeper_defeat");
5797 break;
5798 }
5799 if (flag)
5800 {
5801 SE.Play("kill_boss");
5802 }
5803 if (num != 0)
5804 {
5806 {
5807 EClass.player.stats.deepest = EClass._zone.DangerLv;
5808 Msg.Say("update_deepest", EClass.player.stats.deepest.ToString() ?? "");
5809 }
5811 {
5812 EClass.player.stats.deepestVoid = -EClass._zone.lv;
5813 Msg.Say("update_deepest_void", EClass.player.stats.deepestVoid.ToString() ?? "");
5814 }
5815 EClass.player.willAutoSave = true;
5816 Thing thing = ThingGen.CreateTreasure("chest_boss", base.LV, type);
5817 point.SetBlock();
5818 point.SetObj();
5819 EClass._zone.AddCard(thing, point).Install();
5820 ThingGen.TryLickChest(thing);
5821 }
5822 if (flag2)
5823 {
5825 }
5826 }
TreasureType
Definition: TreasureType.cs:2
bool KilledBossInVoid
Definition: Player.cs:419
int deepest
Definition: Player.cs:114
long nefiaBeaten
Definition: Player.cs:136
int deepestVoid
Definition: Player.cs:117
void ModFame(int a)
Definition: Player.cs:2096
void SetObj(int id=0, int value=1, int dir=0)
Definition: Point.cs:928
void SetBlock(int idMat=0, int idBlock=0)
Definition: Point.cs:918
int phase
Definition: Quest.cs:40
void NextPhase()
Definition: Quest.cs:572
void ChangePhase(int a)
Definition: Quest.cs:577
bool isConquered
Definition: Spatial.cs:382
static void TryLickChest(Thing chest)
Definition: ThingGen.cs:409
static Thing CreateTreasure(string id, int lv, TreasureType type=TreasureType.Map)
Definition: ThingGen.cs:256
static Thing CreateScroll(int ele, int num=1)
Definition: ThingGen.cs:182
virtual bool IsNefia
Definition: Zone.cs:285
void SetBGM(List< int > ids, bool refresh=true, float fadeDuration=0f)
Definition: Zone.cs:2992
Chara Boss
Definition: Zone.cs:86

References EClass._map, EClass._zone, LayerDrama.Activate(), Zone.AddCard(), Zone.Boss, Quest.ChangePhase(), ThingGen.Create(), ThingGen.CreateScroll(), ThingGen.CreateTreasure(), Zone.DangerLv, EClass.debug, Player.Stats.deepest, Player.Stats.deepestVoid, Player.DropReward(), CoreDebug.enable, Map.FindChara(), Player.flags, EClass.game, QuestManager.Get(), Point.GetNearestPoint(), QuestManager.GetPhase(), Zone.GetTopZone(), Card.Install(), Spatial.isConquered, Zone.IsNefia, Player.Flags.KilledBossInVoid, Spatial.lv, Player.ModFame(), Player.ModKarma(), Spatial.Name, Player.Stats.nefiaBeaten, Quest.NextPhase(), Quest.phase, EClass.player, Game.quests, EClass.rnd(), EClass.rndHalf(), Msg.Say(), Zone.SetBGM(), Point.SetBlock(), Point.SetObj(), EClass.Sound, Player.stats, and ThingGen.TryLickChest().

Referenced by ActEffect.Proc().

◆ TryDropCarryOnly()

void Chara.TryDropCarryOnly ( )
inline

Definition at line 4609 of file Chara.cs.

4610 {
4611 if (held != null && held.trait.CanOnlyCarry)
4612 {
4613 DropHeld();
4614 }
4615 foreach (Thing item in things.List((Thing t) => t.trait.CanOnlyCarry))
4616 {
4617 DropThing(item);
4618 }
4619 }
void DropThing(Thing t, int num=-1)
Definition: Chara.cs:4641

References Trait.CanOnlyCarry, item, and Card.trait.

◆ TryEquip()

bool Chara.TryEquip ( Thing  t,
bool  useFav = false 
)
inline

Definition at line 7750 of file Chara.cs.

7751 {
7752 if (!ShouldEquip(t, useFav))
7753 {
7754 return false;
7755 }
7756 if (t.category.slot == 0)
7757 {
7758 return false;
7759 }
7760 if (useFav)
7761 {
7762 BodySlot slot = body.GetSlot(t);
7763 switch (GetFavAttackStyle())
7764 {
7765 case AttackStyle.Default:
7766 case AttackStyle.TwoHand:
7767 if (t.IsMeleeWeapon)
7768 {
7769 slot = body.slotMainHand;
7770 }
7771 break;
7772 case AttackStyle.Shield:
7773 if (t.IsMeleeWeapon)
7774 {
7775 slot = body.slotMainHand;
7776 }
7777 break;
7778 }
7779 body.Equip(t, slot);
7780 }
7781 else
7782 {
7783 body.Equip(t);
7784 }
7785 Say("equip", this, t);
7786 return true;
7787 }
bool ShouldEquip(Thing t, bool useFav=false)
Definition: Chara.cs:7638

References Card.category, CharaBody.Equip(), CharaBody.GetSlot(), Card.IsMeleeWeapon, and CharaBody.slotMainHand.

Referenced by GiveGift(), ActEffect.Proc(), InvOwner.Transaction.Process(), and CharaBody.UnqeuipIfTooHeavy().

◆ TryEquipRanged()

bool Chara.TryEquipRanged ( )
inline

Definition at line 7870 of file Chara.cs.

7871 {
7872 if (IsPC)
7873 {
7875 if (thing?.trait is TraitToolRange && CanEquipRanged(thing))
7876 {
7877 ranged = thing;
7878 return true;
7879 }
7880 return false;
7881 }
7882 if (ranged != null && ranged.parent == this)
7883 {
7884 return true;
7885 }
7887 return ranged != null;
7888 }
Thing GetBestRangedWeapon()
Definition: Chara.cs:7855

References Player.currentHotItem, Card.parent, EClass.player, and HotItem.Thing.

Referenced by TraitTrainingDummy.IdleUse(), ActRanged.Perform(), GoalCombat.TryMove(), and GoalCombat.TryUseRanged().

◆ TryGetThrowable()

Thing Chara.TryGetThrowable ( )
inline

Definition at line 7794 of file Chara.cs.

7795 {
7796 Thing dest = null;
7797 if (IsPC)
7798 {
7800 {
7801 return FindThrowable(hotbar: true);
7802 }
7803 return null;
7804 }
7805 things.Foreach(delegate(Thing t)
7806 {
7807 if (t.HasTag(CTAG.throwWeapon) || (!base.IsPCFactionOrMinion && t.HasTag(CTAG.throwWeaponEnemy)))
7808 {
7809 dest = t;
7810 }
7811 });
7812 return dest;
7813 Thing FindThrowable(bool hotbar)
7814 {
7815 things.Foreach(delegate(Thing t)
7816 {
7817 if (dest == null)
7818 {
7819 if (t.IsHotItem)
7820 {
7821 if (!hotbar)
7822 {
7823 return;
7824 }
7825 }
7826 else if (hotbar)
7827 {
7828 return;
7829 }
7830 if (t.HasTag(CTAG.throwWeapon))
7831 {
7832 dest = t;
7833 }
7834 }
7835 });
7836 return dest;
7837 }
7838 }

References Game.Config.autoCombat, ConfigAutoCombat.bUseHotBar, Game.config, EClass.game, Card.HasTag(), and Card.IsHotItem.

Referenced by AI_PlayMusic.ThrowReward(), and GoalCombat.TryThrow().

◆ TryHoldCard()

bool Chara.TryHoldCard ( Card  t,
int  num = -1,
bool  pickHeld = false 
)
inline

Definition at line 4470 of file Chara.cs.

4471 {
4472 if (held == t)
4473 {
4474 return true;
4475 }
4476 if (t.isDestroyed || t.Num <= 0)
4477 {
4478 return false;
4479 }
4480 if (!CanPick(t))
4481 {
4482 if (t.parent == null)
4483 {
4484 EClass._zone.AddCard(t, pos);
4485 }
4486 return false;
4487 }
4488 HoldCard(t, num);
4489 return true;
4490 }
bool CanPick(Card c)
Definition: Chara.cs:4290
void HoldCard(Card t, int num=-1)
Definition: Chara.cs:4492

References EClass._zone, Zone.AddCard(), Card.isDestroyed, Card.Num, and Card.parent.

Referenced by Trait.OnUse(), AI_Grab< T >.Run(), and AI_Paint.Run().

◆ TryIdentify()

bool Chara.TryIdentify ( Thing  t,
int  count = 1,
bool  show = true 
)
inline

Definition at line 8016 of file Chara.cs.

8017 {
8018 int num = Evalue(289);
8019 if (num == 0)
8020 {
8021 return false;
8022 }
8023 int lV = t.LV;
8024 if (EClass.rnd(num * num + 5) > EClass.rnd(lV * lV) * 20)
8025 {
8026 t.Identify(show, (num >= 20) ? IDTSource.SkillHigh : IDTSource.Skill);
8027 int num2 = 50;
8028 if (lV > num)
8029 {
8030 num2 += (lV - num) * 10;
8031 }
8032 elements.ModExp(289, Mathf.Min(num2, 1000));
8033 return true;
8034 }
8035 return false;
8036 }
IDTSource
Definition: IDTSource.cs:2
Thing Identify(bool show=true, IDTSource idtSource=IDTSource.Identify)
Definition: Thing.cs:2087

References Thing.Identify(), Card.LV, Card.ModExp(), and EClass.rnd().

Referenced by Player.OnAdvanceHour().

◆ TryMove()

override MoveResult Chara.TryMove ( Point  newPoint,
bool  allowDestroyPath = true 
)
inlinevirtual

Reimplemented from Card.

Definition at line 2712 of file Chara.cs.

2713 {
2714 foreach (Condition condition in conditions)
2715 {
2716 if (!condition.TryMove(newPoint))
2717 {
2718 return MoveResult.Fail;
2719 }
2720 }
2721 if (base.isRestrained)
2722 {
2723 if (!IsPC)
2724 {
2725 return MoveResult.Fail;
2726 }
2727 base.isRestrained = false;
2728 }
2729 if (!CanMoveTo(newPoint, allowDestroyPath))
2730 {
2731 return MoveResult.Fail;
2732 }
2733 return _Move(newPoint);
2734 }
virtual bool TryMove(Point p)

References _Move(), CanMoveTo(), conditions, IsPC, and BaseCondition.TryMove().

Referenced by MoveNeighborDefinitely(), MoveRandom(), GoalManualMove.Run(), AI_Goto.TryGoTo(), and TryMoveTowards().

◆ TryMoveTowards()

MoveResult Chara.TryMoveTowards ( Point  p)
inline

Definition at line 2650 of file Chara.cs.

2651 {
2652 if (p.Equals(pos))
2653 {
2654 return MoveResult.Success;
2655 }
2657 {
2658 return MoveResult.Fail;
2659 }
2660 bool flag = true;
2661 Point point = null;
2662 _sharedPos.Set(p);
2663 if (CanDestroyPath())
2664 {
2666 {
2667 return MoveResult.Success;
2668 }
2669 Debug.Log(CanMoveTo(pos));
2671 }
2672 int num = pos.Distance(p);
2673 PathProgress pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Default, num + 4, 1);
2674 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 4)
2675 {
2676 PathFinderNode pathFinderNode = pathProgress.nodes[pathProgress.nodes.Count - 1];
2677 if (TryMove(new Point(pathFinderNode.X, pathFinderNode.Z)) == MoveResult.Success)
2678 {
2679 return MoveResult.Success;
2680 }
2681 }
2682 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Combat, num + 4, 1);
2683 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 4)
2684 {
2685 PathFinderNode pathFinderNode2 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2686 if (TryMove(new Point(pathFinderNode2.X, pathFinderNode2.Z)) == MoveResult.Success)
2687 {
2688 return MoveResult.Success;
2689 }
2690 }
2691 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Default, num + 25, 2);
2692 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 25)
2693 {
2694 PathFinderNode pathFinderNode3 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2695 if (TryMove(new Point(pathFinderNode3.X, pathFinderNode3.Z)) == MoveResult.Success)
2696 {
2697 return MoveResult.Success;
2698 }
2699 }
2700 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Combat, num + 25, 2);
2701 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 25)
2702 {
2703 PathFinderNode pathFinderNode4 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2704 if (TryMove(new Point(pathFinderNode4.X, pathFinderNode4.Z)) == MoveResult.Success)
2705 {
2706 return MoveResult.Success;
2707 }
2708 }
2709 return MoveResult.Fail;
2710 }
static Point _sharedPos
Definition: Chara.cs:176
void RequestPathImmediate(PathProgress progress)
Definition: PathManager.cs:41
List< PathFinderNode > nodes
Definition: PathProgress.cs:16
bool TooHeavyToMove()
Definition: Player.cs:2560
Point GetPointTowards(Point dest)
Definition: Point.cs:801

References _sharedPos, CanDestroyPath(), CanMoveTo(), Debug, Point.Distance(), Point.Equals(), Point.GetPointTowards(), PathProgress.HasPath, PathManager.Instance, IsPC, PathProgress.nodes, EClass.player, Card.pos, PathManager.RequestPathImmediate(), Point.Set(), Player.TooHeavyToMove(), TryMove(), Algorithms.PathFinderNode.X, and Algorithms.PathFinderNode.Z.

Referenced by _Move(), AI_Idle.Run(), AI_Shear.Run(), AI_Slaughter.Run(), AI_Steal.Run(), and GoalCombat.TryMove().

◆ TryNeckHunt()

bool Chara.TryNeckHunt ( Chara  TC,
int  power,
bool  harvest = false 
)
inline

Definition at line 9662 of file Chara.cs.

9663 {
9664 if (TC == null || TC.HasCondition<ConInvulnerable>() || TC.Evalue(1421) > 0 || !TC.ExistsOnMap)
9665 {
9666 return false;
9667 }
9668 if (TC.hp > (long)TC.MaxHP * (long)(Mathf.Min(5 + (int)Mathf.Sqrt(power), harvest ? 35 : 25) + Evalue(1426) * 5) / (TC.IsPowerful ? 200 : 100))
9669 {
9670 return false;
9671 }
9672 if (TC.HasElement(427))
9673 {
9674 return false;
9675 }
9676 if (TC.IsPC && EClass.player.invlunerable)
9677 {
9678 return false;
9679 }
9680 PlaySound("hit_finish");
9681 Say("finish");
9682 Say("finish2", this, TC);
9683 TC.DamageHP(TC.MaxHP, AttackSource.Finish, this);
9684 return false;
9685 }
@ harvest
bool invlunerable
Definition: Player.cs:1173
Definition: TC.cs:4

References harvest, Player.invlunerable, and EClass.player.

Referenced by ActEffect.Proc().

◆ TryNullifyCurse()

bool Chara.TryNullifyCurse ( )
inline

Definition at line 10136 of file Chara.cs.

10137 {
10138 if (IsPCParty)
10139 {
10140 foreach (Chara member in EClass.pc.party.members)
10141 {
10142 if (member.HasElement(1641) && EClass.rnd(3) != 0)
10143 {
10144 Msg.Say("curse_nullify", member);
10145 return true;
10146 }
10147 }
10148 }
10149 else if (HasElement(1641) && EClass.rnd(3) != 0)
10150 {
10151 Say("curse_nullify", this);
10152 return true;
10153 }
10154 if (GetCondition<ConHolyVeil>() != null && EClass.rnd(5) != 0)
10155 {
10156 Say("curse_nullify", this);
10157 return true;
10158 }
10159 return false;
10160 }

References Card.HasElement(), Party.members, party, EClass.pc, EClass.rnd(), and Msg.Say().

◆ TryPickGroundItem()

void Chara.TryPickGroundItem ( Func< Card, bool >  func = null)
inline

Definition at line 4446 of file Chara.cs.

4447 {
4448 foreach (Card item in pos.ListCards())
4449 {
4450 if ((IsPC || !(EClass.pc.ai is AI_UseCrafter aI_UseCrafter) || !aI_UseCrafter.ings.Contains(item)) && item.isThing && item.placeState == PlaceState.roaming && CanPick(item) && (func == null || func(item)))
4451 {
4452 Thing thing = Pick(item.Thing);
4453 if (thing != null && !IsPC)
4454 {
4455 thing.isNPCProperty = true;
4456 }
4457 break;
4458 }
4459 }
4460 }

References ai, item, EClass.pc, and Pick.

Referenced by AI_Fish.Run().

◆ TryPoisonPotion()

Thing Chara.TryPoisonPotion ( Thing  t)
inline

Definition at line 4378 of file Chara.cs.

4379 {
4380 if (t.trait is TraitPotion && t.id != "1165" && !t.source.tag.Contains("neg") && EClass.rnd(2) == 0 && HasElement(1565))
4381 {
4382 string text = EClass.sources.things.rows.Where((SourceThing.Row a) => a._origin == "potion" && a.tag.Contains("neg") && a.chance > 100).ToList().RandomItemWeighted((SourceThing.Row a) => a.chance)
4383 .id;
4384 Say("poisonDrip", this);
4385 int num = t.Num;
4386 t.Destroy();
4387 t = ThingGen.Create(text).SetNum(num);
4388 }
4389 return t;
4390 }
SourceThing.Row source
Definition: Thing.cs:11

References ThingGen.Create(), Card.Destroy(), Card.id, Card.Num, EClass.rnd(), Card.SetNum(), Thing.source, EClass.sources, SourceManager.things, and Card.trait.

◆ TryPush()

void Chara.TryPush ( Point  point)
inline

Definition at line 3228 of file Chara.cs.

3229 {
3230 List<Chara> list = point.ListCharas();
3231 if (list.Count == 0)
3232 {
3233 return;
3234 }
3235 list.Copy().ForeachReverse(delegate(Chara c)
3236 {
3237 if (!c.ai.IsMoveAI && !c.IsPC && c.trait.CanBePushed && c != this && !c.noMove && (!EClass._zone.IsRegion || c.IsPCFactionOrMinion))
3238 {
3239 List<Point> list2 = new List<Point>();
3240 for (int i = point.x - 1; i <= point.x + 1; i++)
3241 {
3242 for (int j = point.z - 1; j <= point.z + 1; j++)
3243 {
3244 if (i != point.x || j != point.z)
3245 {
3246 Point point2 = new Point(i, j);
3247 if (point2.IsValid && !point2.HasChara && !point2.IsBlocked && !point2.cell.hasDoor && !point2.IsBlockByHeight(point))
3248 {
3249 list2.Add(point2);
3250 }
3251 }
3252 }
3253 }
3254 if (list2.Count > 0)
3255 {
3256 if (list2.Count > 1)
3257 {
3258 list2.ForeachReverse(delegate(Point p)
3259 {
3260 if (p.Equals(new Point(point.x + point.x - pos.x, point.z + point.z - pos.z)))
3261 {
3262 list2.Remove(p);
3263 }
3264 });
3265 }
3266 Point newPoint = list2.RandomItem();
3267 if (IsPC)
3268 {
3269 Say("displace", this, c);
3270 PlaySound("push");
3271 }
3272 else if (c.isSynced)
3273 {
3274 c.PlayEffect("push");
3275 }
3276 c.MoveByForce(newPoint, this, checkWall: true);
3277 if (!c.IsPC && c.trait is TraitRogue && EClass.rnd(3) == 0 && GetCurrency() > 20 && !HasElement(426))
3278 {
3279 int num = EClass.rndHalf(10 + Mathf.Min(GetCurrency() / 100, 1000));
3280 c.Talk("pushed");
3281 Say("pushed_money", this, c);
3282 ModCurrency(-num);
3283 c.ModCurrency(num);
3284 c.PlaySound("steal_money");
3285 }
3286 else if (IsPC && !c.IsPCParty && !c.IsUnique && c.IsHumanSpeak && EClass.rnd(5) == 0)
3287 {
3288 c.Talk("pushed");
3289 }
3290 }
3291 }
3292 });
3293 }
bool IsMoveAI
Definition: AIAct.cs:55
bool IsHumanSpeak
Definition: Chara.cs:1017

References EClass._zone, ai, TraitChara.CanBePushed, if(), IsHumanSpeak, AIAct.IsMoveAI, IsPC, Card.IsPCFactionOrMinion, IsPCParty, Spatial.IsRegion, isSynced, Card.IsUnique, Point.ListCharas(), Card.ModCurrency(), MoveByForce(), Card.noMove, Card.PlayEffect(), Card.PlaySound(), EClass.rnd(), EClass.rndHalf(), Card.Talk(), and trait.

Referenced by _Move().

◆ TryPutShared()

void Chara.TryPutShared ( Thing  t,
List< Thing containers = null,
bool  dropIfFail = true 
)
inline

Definition at line 4462 of file Chara.cs.

4463 {
4464 if (!EClass._zone.TryAddThingInSharedContainer(t, containers) && dropIfFail)
4465 {
4466 EClass._zone.AddCard(t, pos);
4467 }
4468 }
bool TryAddThingInSharedContainer(Thing t, List< Thing > containers=null, bool add=true, bool msg=false, Chara chara=null, bool sharedOnly=true)
Definition: Zone.cs:2135

References EClass._zone, Zone.AddCard(), and Zone.TryAddThingInSharedContainer().

Referenced by FactionBranch.DailyOutcome().

◆ TryPutSharedItems() [1/2]

void Chara.TryPutSharedItems ( bool  msg = true)
inline

Definition at line 7402 of file Chara.cs.

7403 {
7405 }
void TryPutSharedItems(IEnumerable< Thing > containers, bool msg=true)
Definition: Chara.cs:7369
List< Thing > containers
Definition: Props.cs:22

References EClass._map, Props.containers, PropsManager.installed, and Map.props.

◆ TryPutSharedItems() [2/2]

void Chara.TryPutSharedItems ( IEnumerable< Thing containers,
bool  msg = true 
)
inline

Definition at line 7369 of file Chara.cs.

7370 {
7371 if (GetInt(113) != 0)
7372 {
7373 return;
7374 }
7375 _ListItems.Clear();
7376 Thing bestRangedWeapon = GetBestRangedWeapon();
7377 foreach (Thing thing in things)
7378 {
7379 if (!thing.IsAmmo && !thing.c_isImportant)
7380 {
7381 if (thing.category.slot != 0 && !thing.isEquipped && !thing.HasTag(CTAG.gift))
7382 {
7383 _ListItems.Add(thing);
7384 }
7385 else if (thing.IsRangedWeapon && thing.category.slot == 0 && bestRangedWeapon != thing)
7386 {
7387 _ListItems.Add(thing);
7388 }
7389 }
7390 }
7391 if (_ListItems.Count == 0)
7392 {
7393 return;
7394 }
7395 List<Thing> containers2 = containers.ToList();
7396 foreach (Thing listItem in _ListItems)
7397 {
7398 EClass._zone.TryAddThingInSharedContainer(listItem, containers2, add: true, msg: true, this);
7399 }
7400 }
void Add(Act a, string s="")
Definition: ActPlan.cs:11
static List< Thing > _ListItems
Definition: Chara.cs:192

References EClass._zone, Card.c_isImportant, Card.category, Card.HasTag(), Card.IsAmmo, Thing.isEquipped, Card.IsRangedWeapon, and Zone.TryAddThingInSharedContainer().

Referenced by AI_Idle.Run().

◆ TryReservePickupTutorial()

void Chara.TryReservePickupTutorial ( Thing  t)
inline

Definition at line 4422 of file Chara.cs.

4423 {
4424 if (t.id == "axe")
4425 {
4426 Tutorial.Reserve("tool");
4427 }
4428 if (t.category.id == "mushroom")
4429 {
4430 Tutorial.Reserve("food");
4431 }
4432 if (t.category.id == "herb")
4433 {
4434 Tutorial.Reserve("herb");
4435 }
4436 if (t.id == "pasture")
4437 {
4438 Tutorial.Reserve("pasture");
4439 }
4440 if (t.id == "log")
4441 {
4442 Tutorial.Reserve("process");
4443 }
4444 }

References Card.category, Card.id, and Tutorial.Reserve().

◆ TryRestock()

void Chara.TryRestock ( bool  onCreate)
inline

Definition at line 4703 of file Chara.cs.

4704 {
4705 isOnCreate = onCreate;
4706 if (onCreate || (!IsPCFaction && (base.IsUnique || trait is TraitAdventurer || trait is TraitGuard)))
4707 {
4708 RestockEquip((!EClass.core.IsGameStarted || !(EClass._zone is Zone_Music)) && onCreate);
4709 }
4710 RestockInventory(onCreate);
4711 }
void RestockInventory(bool onCreate)
Definition: Chara.cs:5027
void RestockEquip(bool onCreate)
Definition: Chara.cs:4713

References EClass._zone, EClass.core, and Core.IsGameStarted.

Referenced by OnCreate(), Zone.OnVisit(), and ScaleByPrincipal().

◆ TrySetEnemy()

void Chara.TrySetEnemy ( Chara  c)
inline

Definition at line 6320 of file Chara.cs.

6321 {
6322 if ((!IsPC || !EClass.game.config.autoCombat.bDontChangeTarget) && (enemy == null || (EClass.rnd(5) == 0 && Dist(c) <= 1)) && ((!IsPCFaction && !IsPCFactionMinion) || (!c.IsPCFaction && !c.IsPCFactionMinion)) && (hostility != Hostility.Enemy || c.hostility != Hostility.Enemy) && (!c.IsPC || hostility < Hostility.Neutral))
6323 {
6324 SetEnemy(c);
6325 }
6326 }

References Game.Config.autoCombat, ConfigAutoCombat.bDontChangeTarget, Game.config, EClass.game, hostility, IsPC, IsPCFaction, IsPCFactionMinion, and EClass.rnd().

Referenced by GoalCombat.Run().

◆ TryTakeSharedItems() [1/2]

void Chara.TryTakeSharedItems ( bool  msg = true)
inline

Definition at line 7407 of file Chara.cs.

7408 {
7410 }
void TryTakeSharedItems(bool msg=true)
Definition: Chara.cs:7407

References EClass._map, Props.containers, PropsManager.installed, and Map.props.

Referenced by AI_Idle.Run().

◆ TryTakeSharedItems() [2/2]

void Chara.TryTakeSharedItems ( IEnumerable< Thing containers,
bool  msg = true,
bool  shouldEat = true 
)
inline

Definition at line 7412 of file Chara.cs.

7413 {
7414 if (base.isSummon || (memberType == FactionMemberType.Livestock && homeBranch != null && !homeBranch.policies.IsActive(2715)))
7415 {
7416 return;
7417 }
7418 int num = 2;
7419 int num2 = 1;
7420 int num3 = 2;
7421 bool flag = GetInt(113) == 0;
7422 int num4 = 2;
7423 int num5 = 2;
7424 int num6 = 2;
7426 {
7427 num5 = 0;
7428 num6 = 0;
7429 }
7430 foreach (Thing thing3 in things)
7431 {
7432 if (CanEat(thing3, shouldEat))
7433 {
7434 if (thing3.HasElement(757))
7435 {
7436 num2 -= thing3.Num;
7437 num -= thing3.Num;
7438 }
7439 else
7440 {
7441 num -= thing3.Num;
7442 }
7443 }
7444 if (thing3.trait.GetHealAction(this) != null)
7445 {
7446 num3 -= thing3.Num;
7447 }
7448 if (thing3.id == "polish_powder")
7449 {
7450 num4 -= thing3.Num;
7451 }
7452 if (thing3.trait is TraitBlanketColdproof)
7453 {
7454 num5 -= thing3.Num;
7455 }
7456 if (thing3.trait is TraitBlanketFireproof)
7457 {
7458 num6 -= thing3.Num;
7459 }
7460 }
7461 _ListItems.Clear();
7462 foreach (Thing container in containers)
7463 {
7464 if (!container.IsSharedContainer)
7465 {
7466 continue;
7467 }
7468 foreach (Thing thing4 in container.things)
7469 {
7470 if (!thing4.c_isImportant && thing4.IsIdentified && thing4 != EClass.pc.held)
7471 {
7472 if (num4 > 0 && thing4.id == "polish_powder")
7473 {
7474 _ListItems.Add(thing4);
7475 num4 -= thing4.Num;
7476 }
7477 else if (num5 > 0 && !HasElement(1236) && thing4.trait is TraitBlanketColdproof)
7478 {
7479 _ListItems.Add(thing4);
7480 num5 -= thing4.Num;
7481 }
7482 else if (num6 > 0 && thing4.trait is TraitBlanketFireproof)
7483 {
7484 _ListItems.Add(thing4);
7485 num6 -= thing4.Num;
7486 }
7487 else if (num2 > 0 && CanEat(thing4, shouldEat) && !thing4.c_isImportant && thing4.HasElement(757))
7488 {
7489 _ListItems.Add(thing4);
7490 num2 -= thing4.Num;
7491 }
7492 else if (num > 0 && CanEat(thing4, shouldEat) && !thing4.c_isImportant)
7493 {
7494 _ListItems.Add(thing4);
7495 num -= thing4.Num;
7496 }
7497 else if (num3 > 0 && thing4.trait.GetHealAction(this) != null)
7498 {
7499 _ListItems.Add(thing4);
7500 num3 -= thing4.Num;
7501 }
7502 else if (flag && thing4.IsEquipmentOrRanged && !thing4.HasTag(CTAG.gift) && ShouldEquip(thing4, useFav: true))
7503 {
7504 _ListItems.Add(thing4);
7505 }
7506 }
7507 }
7508 }
7509 if (_ListItems.Count == 0)
7510 {
7511 return;
7512 }
7513 _ListItems.ForeachReverse(delegate(Thing t)
7514 {
7515 if (t.IsEquipmentOrRanged)
7516 {
7517 bool flag3 = false;
7518 int slot = t.category.slot;
7519 int equipValue = t.GetEquipValue();
7520 foreach (Thing listItem in _ListItems)
7521 {
7522 if (listItem.category.slot == slot && listItem.GetEquipValue() > equipValue)
7523 {
7524 flag3 = true;
7525 break;
7526 }
7527 }
7528 if (flag3)
7529 {
7530 _ListItems.Remove(t);
7531 }
7532 }
7533 });
7534 bool flag2 = false;
7535 foreach (Thing listItem2 in _ListItems)
7536 {
7537 Thing thing = listItem2;
7538 if (things.IsFull(thing))
7539 {
7540 break;
7541 }
7542 Thing thing2 = listItem2.parent as Thing;
7543 if (thing.HasElement(757))
7544 {
7545 if (thing.Num > 1)
7546 {
7547 thing = thing.Split(1);
7548 }
7549 }
7550 else if (thing.Num > 2)
7551 {
7552 thing = thing.Split(2);
7553 }
7554 if (msg)
7555 {
7556 Say("takeSharedItem", this, thing, thing2.GetName(NameStyle.Full));
7557 }
7558 AddCard(thing);
7559 if (ShouldEquip(thing, useFav: true) && thing.category.slot != 0)
7560 {
7561 TryEquip(thing, useFav: true);
7562 flag2 = true;
7563 }
7564 }
7565 if (flag2 && flag)
7566 {
7567 TryPutSharedItems(containers);
7568 }
7569 }
bool IsIdentified
Definition: Card.cs:2380
bool HasItemProtection
bool IsActive(int id, int days=-1)
bool IsSharedContainer
Definition: Thing.cs:113

References Card.c_isImportant, Trait.GetHealAction(), Card.HasElement(), FactionBranch.HasItemProtection, Card.HasTag(), held, Card.id, if(), PolicyManager.IsActive(), Card.IsEquipmentOrRanged, Card.IsIdentified, Thing.IsSharedContainer, Card.Num, EClass.pc, FactionBranch.policies, Card.things, and Card.trait.

◆ TryUpgrade()

void Chara.TryUpgrade ( bool  msg = true)
inline

Definition at line 8574 of file Chara.cs.

8575 {
8576 if (!EClass.debug.enable || IsPC || !IsGlobal || !IsPCFaction)
8577 {
8578 return;
8579 }
8580 for (int i = 0; i < 100; i++)
8581 {
8582 if (base.feat == 0)
8583 {
8584 break;
8585 }
8586 if (base.c_upgrades == null)
8587 {
8588 base.c_upgrades = new CharaUpgrade();
8589 }
8590 if (base.c_upgrades.halt)
8591 {
8592 break;
8593 }
8594 Rand.SetSeed(base.uid + base.c_upgrades.count);
8595 int num = EClass.rnd(100);
8596 int num2 = 0;
8597 int num3 = 1;
8598 int num4 = 0;
8599 bool flag = false;
8600 IEnumerable<SourceElement.Row> ie = EClass.sources.elements.rows.Where((SourceElement.Row a) => !elements.Has(a) && a.category == "skill" && !a.tag.Contains("noPet"));
8601 List<Element> list = ListAvailabeFeats(pet: true);
8602 if (num >= 90 && list.Count > 0)
8603 {
8604 Element element = list.RandomItem();
8605 num2 = element.id;
8606 num4 = element.CostLearn;
8607 }
8608 else if (num >= 60 && ie.Any())
8609 {
8610 num2 = ie.RandomItem().id;
8611 num4 = 3;
8612 }
8613 else
8614 {
8615 num2 = Element.List_MainAttributesMajor.RandomItem();
8616 num4 = 1;
8617 num3 = 2;
8618 flag = true;
8619 }
8620 Rand.SetSeed();
8621 if (num4 > base.feat)
8622 {
8623 break;
8624 }
8625 base.feat -= num4;
8626 base.c_upgrades.count++;
8627 base.c_upgrades.spent += num4;
8628 bool flag2 = false;
8629 if (flag)
8630 {
8631 foreach (CharaUpgrade.Item item in base.c_upgrades.items)
8632 {
8633 if (item.idEle == num2)
8634 {
8635 item.value += num3;
8636 item.cost += num4;
8637 flag2 = true;
8638 break;
8639 }
8640 }
8641 }
8642 if (!flag2)
8643 {
8644 base.c_upgrades.items.Add(new CharaUpgrade.Item
8645 {
8646 idEle = num2,
8647 value = num3,
8648 cost = num4
8649 });
8650 }
8651 SourceElement.Row row = EClass.sources.elements.map[num2];
8652 if (row.category == "feat")
8653 {
8654 SetFeat(num2, elements.ValueWithoutLink(num2) + 1, msg: true);
8655 }
8656 else if (elements.ValueWithoutLink(row.id) == 0)
8657 {
8658 elements.Learn(row.id);
8659 }
8660 else
8661 {
8662 elements.ModBase(num2, num3);
8663 }
8664 }
8665 }
List< Element > ListAvailabeFeats(bool pet=false, bool showAll=false)
Definition: Chara.cs:9897
void Learn(int ele, int v=1)
virtual int CostLearn
Definition: ELEMENT.cs:319
static int[] List_MainAttributesMajor
Definition: ELEMENT.cs:247
static void SetSeed(int a=-1)
Definition: Rand.cs:37

References SourceElement.Row.category, Element.CostLearn, EClass.debug, SourceManager.elements, CoreDebug.enable, Element.id, SourceElement.Row.id, item, Element.List_MainAttributesMajor, EClass.rnd(), Rand.SetSeed(), and EClass.sources.

Referenced by WindowCharaMini.Refresh().

◆ TryUse()

bool Chara.TryUse ( Thing  t)
inline

Definition at line 7899 of file Chara.cs.

7900 {
7901 if (t.id == "338" && t.blessedState >= BlessedState.Normal)
7902 {
7903 Thing thing = things.Find((Thing a) => a.IsEquipmentOrRanged && !a.isAcidproof);
7904 if (thing != null)
7905 {
7906 Say("dip", this, thing, t.GetName(NameStyle.Full, 1));
7907 SE.Change();
7908 t.trait.OnBlend(thing, this);
7909 return true;
7910 }
7911 return false;
7912 }
7913 if (t.IsNegativeGift || t.source.HasTag(CTAG.ignoreUse))
7914 {
7915 return false;
7916 }
7917 if (t.id == "cigar")
7918 {
7919 (t.trait as TraitItemProc).OnUse(this);
7920 return true;
7921 }
7922 if (t.trait.CanEat(this) && hunger.GetPhase() > ((IsPCFaction || IsPCFactionMinion) ? 2 : 0))
7923 {
7925 {
7926 target = t
7927 });
7928 return true;
7929 }
7930 if (t.trait.CanDrink(this))
7931 {
7932 Drink(t);
7933 return true;
7934 }
7935 if (t.trait.CanRead(this))
7936 {
7938 {
7939 target = t
7940 });
7941 return true;
7942 }
7943 if (base.hp < MaxHP * 90 / 100)
7944 {
7945 Action healAction = t.trait.GetHealAction(this);
7946 if (healAction != null)
7947 {
7948 healAction();
7949 return true;
7950 }
7951 }
7952 return false;
7953 }
bool isAcidproof
Definition: Card.cs:687
void SetAIImmediate(AIAct g)
Definition: Chara.cs:8935
virtual bool CanRead(Chara c)
Definition: Trait.cs:991
virtual bool CanDrink(Chara c)
Definition: Trait.cs:1009
virtual void OnBlend(Thing t, Chara c)
Definition: Trait.cs:635

References Card.blessedState, Trait.CanDrink(), Trait.CanEat(), Trait.CanRead(), Drink, Trait.GetHealAction(), Thing.GetName(), Stats.GetPhase(), Card.id, Card.isAcidproof, Card.IsEquipmentOrRanged, Card.IsNegativeGift, Trait.OnBlend(), Thing.source, and Card.trait.

Referenced by AI_Shopping.Buy(), QuestDeliver.Deliver(), and AI_Idle.Run().

◆ TryWorkOutside()

bool Chara.TryWorkOutside ( SourceHobby::Row  sourceWork)
inline

Definition at line 9196 of file Chara.cs.

9197 {
9198 if (EClass.world.date.IsExpired(GetInt(51)))
9199 {
9200 Expedition expedition = Expedition.Create(this, sourceWork.expedition.ToEnum<ExpeditionType>());
9201 SetInt(51, EClass.world.date.GetRaw() + 60 * (expedition.hours + 24));
9202 homeBranch.expeditions.Add(expedition);
9203 return true;
9204 }
9205 return false;
9206 }
ExpeditionType
void Add(Expedition ex)
static Expedition Create(Chara c, ExpeditionType type)
Definition: Expedition.cs:112
int hours
Definition: Expedition.cs:6
ExpeditionManager expeditions
string expedition
Definition: SourceHobby.cs:29

References ExpeditionManager.Add(), Expedition.Create(), World.date, FactionBranch.expeditions, Date.GetRaw(), Expedition.hours, Date.IsExpired(), and EClass.world.

◆ UpdateAngle()

void Chara.UpdateAngle ( )
inline

Definition at line 3597 of file Chara.cs.

3598 {
3599 if (IsPCC)
3600 {
3601 if (base.dir == 0)
3602 {
3603 angle = 225f;
3604 }
3605 else if (base.dir == 1)
3606 {
3607 angle = 135f;
3608 }
3609 else if (base.dir == 2)
3610 {
3611 angle = 45f;
3612 }
3613 else if (base.dir == 3)
3614 {
3615 angle = -45f;
3616 }
3617 }
3618 else if (base.dir == 0)
3619 {
3620 angle = 165f;
3621 }
3622 else if (base.dir == 1)
3623 {
3624 angle = 300f;
3625 }
3626 else if (base.dir == 2)
3627 {
3628 angle = 0f;
3629 }
3630 else if (base.dir == 3)
3631 {
3632 angle = 120f;
3633 }
3634 }

Referenced by OnDeserialized().

◆ UpdateSight()

void Chara.UpdateSight ( )
inline

Definition at line 3658 of file Chara.cs.

3659 {
3660 int num = 4;
3661 for (int i = -num; i < num + 1; i++)
3662 {
3663 for (int j = -num; j < num + 1; j++)
3664 {
3665 shared.Set(pos.x + i, pos.z + j);
3666 if (shared.IsValid && !shared.cell.isSeen && i >= -1 && i <= 1 && j >= -1)
3667 {
3668 _ = 1;
3669 }
3670 }
3671 }
3672 }
bool isSeen
Definition: Cell.cs:282
static Point shared
Definition: Chara.cs:11

References Point.cell, Cell.isSeen, Point.IsValid, and Point.Set().

◆ UseAbility() [1/3]

bool Chara.UseAbility ( Act  a,
Card  tc = null,
Point  pos = null,
bool  pt = false 
)
inline

Definition at line 5838 of file Chara.cs.

5839 {
5840 if (HasCooldown(a.id))
5841 {
5842 return false;
5843 }
5844 if (a.source.proc.TryGet(0) == "Heal" && HasElement(1422) && !IsPC)
5845 {
5846 List<int> list = new List<int> { 8400, 8401, 8402, 8403, 8404, 8405 };
5847 int num = list.IndexOf(a.id);
5848 if (num != -1)
5849 {
5850 int num2 = list.TryGet(num + Evalue(1422));
5851 a = elements.GetElement(num2)?.act ?? ACT.Create(num2);
5852 }
5853 }
5854 int num3 = 1;
5855 Act.Cost cost = a.GetCost(this);
5856 a.GetPower(this);
5857 int i = 1;
5858 int num4 = 0;
5859 bool flag = a.IsTargetHostileParty();
5860 if (IsPC && HasCondition<StanceManaCost>())
5861 {
5862 num4 = Evalue(1657);
5863 }
5864 _pts.Clear();
5865 if (a.TargetType.ForceParty)
5866 {
5867 pt = true;
5868 }
5869 if (pt)
5870 {
5871 i = 0;
5872 if (flag)
5873 {
5874 ForeachEnemy(delegate
5875 {
5876 i++;
5877 });
5878 }
5879 else
5880 {
5881 ForeachParty(delegate
5882 {
5883 i++;
5884 });
5885 }
5886 }
5887 if (a is Spell && IsPC && a.vPotential < i)
5888 {
5889 i = 1;
5890 _pts.Clear();
5891 _pts.Add(this);
5892 pt = false;
5893 }
5894 int num5 = 100;
5895 if (!a.TargetType.ForceParty && i > 1)
5896 {
5897 num5 = (IsPC ? (i * 100) : (50 + i * 50));
5898 }
5899 int num6 = cost.cost * num5 / 100;
5900 if (cost.type == Act.CostType.MP && Evalue(483) > 0)
5901 {
5902 num6 = num6 * 100 / (100 + (int)Mathf.Sqrt(Evalue(483) * 10) * 3);
5903 }
5904 if (i == 0)
5905 {
5906 if (IsPC)
5907 {
5909 }
5910 return false;
5911 }
5912 if (!IsPC && cost.type == Act.CostType.MP && mana.value < 0 && (EClass.rnd(4) != 0 || IsPCFaction || (base.IsPowerful && mana.value < -20)))
5913 {
5914 return false;
5915 }
5916 if (IsPC)
5917 {
5918 if (!Dialog.warned && cost.type == Act.CostType.MP && cost.cost > 0 && mana.value < num6 && !EClass.debug.godMode)
5919 {
5920 ActPlan.warning = true;
5921 Dialog.TryWarnMana(delegate
5922 {
5923 if (UseAbility(a, tc, pos, pt))
5924 {
5926 }
5927 });
5928 return false;
5929 }
5930 EClass.ui.CloseLayers();
5931 }
5932 if ((isConfused && EClass.rnd(4) == 0) || (isBlind && (pt || (pos != null && !pos.Equals(base.pos)) || (tc != null && tc.pos != null && !tc.pos.Equals(base.pos))) && EClass.rnd(2) == 0))
5933 {
5934 Say("shakeHead", this);
5935 return true;
5936 }
5937 if (tc != null && tc != this)
5938 {
5939 LookAt(tc.pos);
5940 }
5941 if (pos != null && !base.pos.Equals(pos))
5942 {
5943 LookAt(pos);
5944 }
5945 if (a.CanRapidFire && HasElement(1648))
5946 {
5947 num3 = 1 + Evalue(1648);
5948 }
5949 if (IsPC && cost.cost > 0 && a.Value == 0 && !ability.Has(a.id))
5950 {
5952 return false;
5953 }
5954 if (a is Spell)
5955 {
5956 string s = (isConfused ? "_cast_confuse" : (HasCondition<ConDim>() ? "_cast_dim" : ""));
5957 if (!a.source.tag.Contains("useHand"))
5958 {
5959 Say(race.castStyle.IsEmpty("cast"), this, a.source.GetName().ToLower(), s.lang());
5960 }
5961 if (IsPC && !ability.Has(a.id))
5962 {
5963 _ = (i + 1) / 2;
5964 if (a.vPotential < i)
5965 {
5966 Msg.Say("noSpellStock");
5967 EInput.Consume();
5968 return false;
5969 }
5970 if (num4 > 0 && a.vPotential >= i * 2)
5971 {
5972 a.vPotential -= i * 2;
5973 num6 = num6 * (100 - num4 * 20) / 100;
5974 }
5975 else
5976 {
5977 a.vPotential -= i;
5978 }
5980 }
5981 }
5982 else if (a.source.langAct.Length != 0 && tc != null)
5983 {
5984 string text = a.source.langAct[0];
5985 string text2 = ((a.source.langAct.Length >= 2) ? a.source.langAct[1] : "");
5986 if (text == "spell_hand")
5987 {
5988 string[] list2 = Lang.GetList("attack" + race.meleeStyle.IsEmpty("Touch"));
5989 string @ref = text2.lang(list2[4]);
5990 Say(tc.IsPCParty ? "cast_hand_ally" : "cast_hand", this, tc, @ref, tc.IsPCParty ? list2[1] : list2[2]);
5991 }
5992 else
5993 {
5994 Say(text, this, tc, text2.IsEmpty() ? "" : text2.lang());
5995 }
5996 if (a.source.id == 6630)
5997 {
5998 Talk("insult_" + (base.IsMale ? "m" : "f"));
5999 }
6000 }
6001 switch (cost.type)
6002 {
6003 case Act.CostType.MP:
6004 if (Evalue(1421) >= 2 && base.hp <= MaxHP / Mathf.Max(1, 9 - Evalue(1421) * 2))
6005 {
6006 num6 /= 2;
6007 }
6008 if (isSynced)
6009 {
6010 PlayEffect("cast");
6011 }
6012 mana.Mod(-num6);
6013 if (isDead)
6014 {
6015 return true;
6016 }
6017 elements.ModExp(304, Mathf.Clamp(num6 * 2, 1, 200));
6018 break;
6019 case Act.CostType.SP:
6020 stamina.Mod(-num6);
6021 ignoreSPAbsorb = true;
6022 break;
6023 }
6024 if (a is Spell && GetCondition<ConSilence>() != null)
6025 {
6026 Say("cast_silence", this);
6027 return true;
6028 }
6029 if (isDead)
6030 {
6031 return true;
6032 }
6033 int spellExp = elements.GetSpellExp(this, a, num5);
6034 if (EClass.rnd(100) >= CalcCastingChance(a, i) && !EClass.debug.godMode)
6035 {
6036 Say("fizzle", this);
6037 PlayEffect("fizzle");
6038 PlaySound("fizzle");
6039 if (cost.cost > 0 && a.source.lvFactor > 0)
6040 {
6041 ModExp(a.id, spellExp / 5);
6042 }
6043 RemoveCondition<ConInvisibility>();
6044 return true;
6045 }
6046 bool flag2 = true;
6047 if (a.source.cooldown > 0 && (!IsPC || !a.source.tag.Contains("CD_npc")))
6048 {
6049 AddCooldown(a.id, a.source.cooldown);
6050 }
6051 if (HasTalk("phrase_" + a.source.alias))
6052 {
6053 EClass.player.forceTalk = true;
6054 Talk("phrase_" + a.source.alias);
6055 }
6056 if (pt)
6057 {
6058 Act.forcePt = true;
6059 if (flag)
6060 {
6061 ForeachEnemy(delegate(Chara c)
6062 {
6063 a.Perform(this, c, c.pos);
6064 });
6065 }
6066 else
6067 {
6068 ForeachParty(delegate(Chara c)
6069 {
6070 a.Perform(this, c, c.pos);
6071 });
6072 }
6073 Act.forcePt = false;
6074 }
6075 else
6076 {
6077 for (int j = 0; j < num3; j++)
6078 {
6079 if (a.TargetType != TargetType.SelfParty && tc != null && !tc.IsAliveInCurrentZone)
6080 {
6081 break;
6082 }
6083 ActEffect.RapidCount = j;
6084 ActEffect.RapidDelay = a.RapidDelay;
6085 flag2 = a.Perform(this, tc, pos);
6086 }
6087 }
6088 if (flag2 && !isDead)
6089 {
6090 if (cost.cost > 0 && a.source.lvFactor > 0)
6091 {
6092 ModExp(a.id, spellExp);
6093 }
6094 if (a.source.alias.StartsWith("sword_"))
6095 {
6096 ModExp(101, 50);
6097 }
6098 }
6099 ActEffect.RapidCount = 0;
6100 if (flag2 && !a.source.tag.Contains("keepInvisi") && EClass.rnd(2) == 0)
6101 {
6102 RemoveCondition<ConInvisibility>();
6103 RemoveCondition<ConDark>();
6104 }
6105 if (!base.IsPCFactionOrMinion && a.HasTag("specialAbility"))
6106 {
6107 string name = a.Name;
6108 renderer.Say("| " + name + " ");
6109 }
6110 return flag2;
6111 void ForeachEnemy(Action<Chara> action)
6112 {
6113 if (_pts.Count == 0)
6114 {
6115 for (int num10 = EClass._map.charas.Count - 1; num10 >= 0; num10--)
6116 {
6117 Chara chara3 = EClass._map.charas[num10];
6118 if (chara3 != this && CanSeeLos(chara3) && chara3.IsHostile(this))
6119 {
6120 _pts.Add(chara3);
6121 }
6122 }
6123 }
6124 for (int num11 = _pts.Count - 1; num11 >= 0; num11--)
6125 {
6126 action(_pts[num11]);
6127 }
6128 }
6129 void ForeachParty(Action<Chara> action)
6130 {
6131 if (_pts.Count == 0)
6132 {
6133 if (IsPCParty)
6134 {
6135 for (int num7 = EClass.pc.party.members.Count - 1; num7 >= 0; num7--)
6136 {
6137 Chara chara = EClass.pc.party.members[num7];
6138 if (chara == this || chara.host != null || CanSeeLos(chara))
6139 {
6140 _pts.Add(chara);
6141 }
6142 }
6143 }
6144 else
6145 {
6146 for (int num8 = EClass._map.charas.Count - 1; num8 >= 0; num8--)
6147 {
6148 Chara chara2 = EClass._map.charas[num8];
6149 if ((chara2 == this || (chara2.IsFriendOrAbove(this) && CanSeeLos(chara2))) && (chara2 == tc || _pts.Count < 3 || EClass.rnd(_pts.Count * _pts.Count) > 6))
6150 {
6151 _pts.Add(chara2);
6152 }
6153 }
6154 }
6155 }
6156 for (int num9 = _pts.Count - 1; num9 >= 0; num9--)
6157 {
6158 action(_pts[num9]);
6159 }
6160 }
6161 }
Definition: ACT.cs:6
static Act Create(int id)
Definition: ACT.cs:36
Definition: ACT.cs:62
CostType
Definition: ACT.cs:64
virtual bool Perform()
Definition: ACT.cs:266
virtual TargetType TargetType
Definition: ACT.cs:144
virtual float RapidDelay
Definition: ACT.cs:177
bool IsTargetHostileParty()
Definition: ACT.cs:241
virtual bool CanRapidFire
Definition: ACT.cs:175
bool HasTalk(string idTopic)
Definition: Card.cs:6873
bool Has(int id)
static List< Chara > _pts
Definition: Chara.cs:188
int CalcCastingChance(Element e, int num=1)
Definition: Chara.cs:6172
Definition: Dialog.cs:7
static bool warned
Definition: Dialog.cs:49
static void TryWarnMana(Action action)
Definition: Dialog.cs:391
int GetSpellExp(Chara c, Element e, int costMod=100)
int vPotential
Definition: ELEMENT.cs:261
virtual int GetPower(Card c)
Definition: ELEMENT.cs:1082
virtual Act.Cost GetCost(Chara c)
Definition: ELEMENT.cs:1041
Act act
Definition: ELEMENT.cs:399
static TargetTypeSelfParty SelfParty
Definition: TargetType.cs:9
virtual bool ForceParty
Definition: TargetType.cs:41
Definition: ACT.cs:71
CostType type
Definition: ACT.cs:74
int cost
Definition: ACT.cs:72

References EClass._map, Element.act, Act.CanRapidFire, SourceRace.Row.castStyle, Map.charas, EInput.Consume(), Act.Cost.cost, ACT.Create(), EClass.debug, Player.EndTurn(), TargetType.ForceParty, Element.GetCost(), Lang.GetList(), Element.GetPower(), CoreDebug.godMode, CharaAbility.Has(), Element.HasTag(), host, Element.id, IsFriendOrAbove(), IsHostile(), Act.IsTargetHostileParty(), SourceRace.Row.meleeStyle, Party.members, Stats.Mod(), Element.Name, party, EClass.pc, Act.Perform(), EClass.player, Card.pos, Act.RapidDelay, EClass.rnd(), Msg.Say(), Msg.SayNothingHappen(), TargetType.SelfParty, LayerAbility.SetDirty(), Element.source, Act.TargetType, Dialog.TryWarnMana(), Act.Cost.type, EClass.ui, Element.Value, Stats.value, Element.vPotential, and Dialog.warned.

◆ UseAbility() [2/3]

bool Chara.UseAbility ( int  idAct,
Card  tc = null,
Point  pos = null,
bool  pt = false 
)
inline

◆ UseAbility() [3/3]

bool Chara.UseAbility ( string  idAct,
Card  tc = null,
Point  pos = null,
bool  pt = false 
)
inline

Definition at line 5833 of file Chara.cs.

5834 {
5835 return UseAbility(elements.GetElement(idAct)?.act ?? ACT.Create(idAct), tc, pos, pt);
5836 }

References ACT.Create().

◆ ValidateWorks()

void Chara.ValidateWorks ( )
inline

Definition at line 9244 of file Chara.cs.

9245 {
9246 _goalWork.FindWork(this, setAI: false);
9248 }
static GoalHobby _goalHobby
Definition: Chara.cs:210
static GoalWork _goalWork
Definition: Chara.cs:208
void ValidateHobby(Chara c)
Definition: GoalWork.cs:21
bool FindWork(Chara c, bool setAI=true)
Definition: GoalWork.cs:55

References GoalWork.FindWork(), and GoalWork.ValidateHobby().

Referenced by Zone.Deactivate().

◆ Vomit()

void Chara.Vomit ( )
inline

Definition at line 5312 of file Chara.cs.

5313 {
5314 base.c_vomit++;
5315 Say("vomit", this);
5316 PlaySound("vomit");
5317 if (!EClass._zone.IsRegion)
5318 {
5319 Thing thing = ThingGen.Create("731");
5321 {
5322 thing.MakeRefFrom(this);
5323 }
5324 EClass._zone.AddCard(thing, pos);
5325 }
5326 if (HasCondition<ConAnorexia>())
5327 {
5328 ModExp(70, -50);
5329 ModExp(71, -75);
5330 ModExp(77, -100);
5331 }
5332 else if (base.c_vomit > 10)
5333 {
5334 AddCondition<ConAnorexia>();
5335 }
5336 AddCondition<ConDim>();
5337 if (HasCondition<ConAnorexia>())
5338 {
5339 ModWeight(-1 * (1 + EClass.rnd(5)));
5340 }
5341 if (hunger.GetPhase() >= 4)
5342 {
5343 DamageHP(9999L, AttackSource.Hunger);
5344 }
5345 hunger.Mod(30);
5346 }
void ModWeight(int a, bool ignoreLimit=false)
Definition: Chara.cs:9825

References EClass._zone, Zone.AddCard(), ThingGen.Create(), Stats.GetPhase(), Zone.IsPCFaction, Spatial.IsRegion, Card.MakeRefFrom(), Stats.Mod(), and EClass.rnd().

Referenced by FoodEffect.Proc(), and ConDrunk.Tick().

◆ WillConsumeTurn()

bool Chara.WillConsumeTurn ( )
inline

Definition at line 3674 of file Chara.cs.

3675 {
3676 for (int num = conditions.Count - 1; num >= 0; num--)
3677 {
3678 if (conditions[num].ConsumeTurn)
3679 {
3680 return true;
3681 }
3682 }
3683 return false;
3684 }

Referenced by AM_Adv._OnUpdateInput(), UIAutoTurn._Update(), and Player.CanAcceptInput().

◆ WriteNote()

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

Reimplemented from Card.

Definition at line 7293 of file Chara.cs.

7294 {
7295 n.Clear();
7296 UIItem uIItem = n.AddHeaderCard(base.Name.ToTitleCase());
7297 SetImage(uIItem.image2);
7298 uIItem.text2.SetText(race.GetText().ToTitleCase(wholeText: true) + " " + job.GetText().ToTitleCase(wholeText: true));
7299 n.AddText("");
7300 n.Build();
7301 }
void SetImage(Image image, int dir, int idSkin=0)
Definition: Card.cs:6259
Definition: UIItem.cs:5
Image image2
Definition: UIItem.cs:16
UIText text2
Definition: UIItem.cs:8
UIItem AddHeaderCard(string text, Sprite sprite=null)
Definition: UINote.cs:84
void Clear()
Definition: UINote.cs:35
UIItem AddText(string text, FontColor color=FontColor.DontChange)
Definition: UINote.cs:113
void Build()
Definition: UINote.cs:49
void SetText(string s)
Definition: UIText.cs:159

References UINote.AddHeaderCard(), UINote.AddText(), UINote.Build(), UINote.Clear(), UIItem.image2, UIText.SetText(), and UIItem.text2.

Member Data Documentation

◆ _ability

CharaAbility Chara._ability

Definition at line 96 of file Chara.cs.

Referenced by SetMainElement().

◆ _baseWorkElements

ElementContainer Chara._baseWorkElements

Definition at line 206 of file Chara.cs.

◆ _cbits1

BitArray32 Chara._cbits1

Definition at line 84 of file Chara.cs.

Referenced by OnSerializing().

◆ _cints

int [] Chara._cints = new int[30]

Definition at line 82 of file Chara.cs.

Referenced by OnDeserialized(), and OnSerializing().

◆ _cooldowns

List<int> Chara._cooldowns

◆ _faction

Faction Chara._faction
private

Definition at line 158 of file Chara.cs.

Referenced by SetFaction().

◆ _goalHobby

GoalHobby Chara._goalHobby = new GoalHobby()
staticprivate

Definition at line 210 of file Chara.cs.

◆ _goalWork

GoalWork Chara._goalWork = new GoalWork()
staticprivate

Definition at line 208 of file Chara.cs.

◆ _historyFood

List<List<string> > Chara._historyFood

Definition at line 64 of file Chara.cs.

◆ _hobbies

List<int> Chara._hobbies

Definition at line 49 of file Chara.cs.

◆ _isLevitating

bool Chara._isLevitating

Definition at line 136 of file Chara.cs.

Referenced by HasHigherGround(), and Refresh().

◆ _job

SourceJob.Row Chara._job

Definition at line 164 of file Chara.cs.

Referenced by ChangeJob(), and OnCreate().

◆ _listAbility

List<int> Chara._listAbility

◆ _listFavCat

List<SourceCategory.Row> Chara._listFavCat = new List<SourceCategory.Row>()
staticprivate

Definition at line 196 of file Chara.cs.

◆ _listFavFood

List<SourceThing.Row> Chara._listFavFood = new List<SourceThing.Row>()
staticprivate

Definition at line 194 of file Chara.cs.

◆ _ListItems

List<Thing> Chara._ListItems = new List<Thing>()
staticprivate

Definition at line 192 of file Chara.cs.

◆ _NoGoalPC

NoGoal Chara._NoGoalPC = new NoGoal()
static

Definition at line 198 of file Chara.cs.

◆ _NoGoalRepeat

NoGoal Chara._NoGoalRepeat = new NoGoal()
static

Definition at line 200 of file Chara.cs.

Referenced by ActPlan.Item.Perform().

◆ _pts

List<Chara> Chara._pts = new List<Chara>()
staticprivate

Definition at line 188 of file Chara.cs.

◆ _race

SourceRace.Row Chara._race

Definition at line 162 of file Chara.cs.

Referenced by ChangeRace(), and OnCreate().

◆ _sharedPos

Point Chara._sharedPos = new Point()
staticprivate

Definition at line 176 of file Chara.cs.

Referenced by TryMoveTowards().

◆ _Speed

long Chara._Speed
private

Definition at line 174 of file Chara.cs.

Referenced by RefreshSpeed().

◆ _strs

string [] Chara._strs = new string[5]

Definition at line 79 of file Chara.cs.

◆ _tactics

Tactics Chara._tactics

Definition at line 166 of file Chara.cs.

◆ _works

List<int> Chara._works

Definition at line 52 of file Chara.cs.

◆ _workSummary

WorkSummary Chara._workSummary

Definition at line 55 of file Chara.cs.

◆ actTime

float Chara.actTime = 0.3f

Definition at line 180 of file Chara.cs.

Referenced by _Move(), and CharaRenderer.UpdatePosition().

◆ ai

◆ body

◆ bossText

bool Chara.bossText

Definition at line 146 of file Chara.cs.

Referenced by CardRenderer.Draw(), OnCreate(), and OnDeserialized().

◆ calmCheckTurn

int Chara.calmCheckTurn

Definition at line 118 of file Chara.cs.

Referenced by DoHostileAction(), and GoalCombat.Run().

◆ canSeeInvisible

bool Chara.canSeeInvisible

Definition at line 140 of file Chara.cs.

Referenced by CanSee(), CanSeeLos(), Refresh(), and PointTarget.ShouldIgnore().

◆ combatCount

int Chara.combatCount

Definition at line 116 of file Chara.cs.

◆ conditions

◆ conSleep

◆ consumeTurn

bool Chara.consumeTurn
static

Definition at line 182 of file Chara.cs.

◆ conSuspend

◆ contribution

int Chara.contribution

Definition at line 18 of file Chara.cs.

Referenced by OnCreate().

◆ dirtySpeed

bool Chara.dirtySpeed = true

Definition at line 172 of file Chara.cs.

Referenced by RefreshSpeed(), and SetDirtySpeed().

◆ emoIcon

Emo2 Chara.emoIcon

Definition at line 108 of file Chara.cs.

Referenced by Condition.Kill(), TCOrbitChara.RefreshAll(), and BaseCondition.RefreshEmoIcon().

◆ enemy

◆ faithElements

◆ global

◆ goalList

GoalList Chara.goalList = new GoalList()

Definition at line 202 of file Chara.cs.

◆ happiness

int Chara.happiness

Definition at line 110 of file Chara.cs.

Referenced by FactionBranch.GetHappiness(), and OnCreate().

◆ hasMovedThisTurn

bool Chara.hasMovedThisTurn
private

Definition at line 178 of file Chara.cs.

Referenced by _Move().

◆ hasTelepathy

bool Chara.hasTelepathy

◆ held

◆ host

◆ idleActTimer

int Chara.idleActTimer

Definition at line 114 of file Chara.cs.

Referenced by AI_Idle.Run().

◆ idleTimer

float Chara.idleTimer

Definition at line 122 of file Chara.cs.

Referenced by CharaRenderer.UpdatePosition().

◆ IDTimeTable

string [] Chara.IDTimeTable = new string[2] { "default", "owl" }
static

Definition at line 15 of file Chara.cs.

◆ ignoreSPAbsorb

bool Chara.ignoreSPAbsorb

Definition at line 148 of file Chara.cs.

◆ isBerserk

bool Chara.isBerserk

◆ isBlind

◆ isConfused

◆ isCreated

bool Chara.isCreated

Definition at line 138 of file Chara.cs.

Referenced by CharaBody.Equip(), OnCreate(), OnDeserialized(), and CharaBody.Unequip().

◆ isDrunk

bool Chara.isDrunk

Definition at line 126 of file Chara.cs.

Referenced by _Move(), AI_Idle.Run(), and AI_PlayMusic.Run().

◆ isFainted

bool Chara.isFainted

Definition at line 130 of file Chara.cs.

◆ isOnCreate

bool Chara.isOnCreate
static

Definition at line 186 of file Chara.cs.

◆ isParalyzed

bool Chara.isParalyzed

Definition at line 134 of file Chara.cs.

Referenced by Point.ListWitnesses().

◆ isWeakToSunlight

bool Chara.isWeakToSunlight

Definition at line 154 of file Chara.cs.

Referenced by Refresh().

◆ isWet

bool Chara.isWet

◆ lastPos

Point Chara.lastPos = new Point()

Definition at line 90 of file Chara.cs.

Referenced by _Move().

◆ ListAdvJob

List<SourceJob.Row> Chara.ListAdvJob = new List<SourceJob.Row>()
static

Definition at line 170 of file Chara.cs.

Referenced by OnCreate().

◆ ListAdvRace

List<SourceRace.Row> Chara.ListAdvRace = new List<SourceRace.Row>()
static

Definition at line 168 of file Chara.cs.

Referenced by OnCreate().

◆ listHobby

List<Hobby> Chara.listHobby = new List<Hobby>()
staticprivate

Definition at line 13 of file Chara.cs.

◆ master

Chara Chara.master

Definition at line 88 of file Chara.cs.

Referenced by FindMaster(), MakeMinion(), MoveZone(), Zone.OnVisit(), ReleaseMinion(), and AI_Idle.Run().

◆ memberType

◆ mimicry

◆ nextUse

Thing Chara.nextUse

Definition at line 100 of file Chara.cs.

Referenced by AI_Idle.Run().

◆ orgPos

◆ parasite

◆ party

◆ path

PathProgress Chara.path = new PathProgress()

Definition at line 92 of file Chara.cs.

Referenced by AI_Goto.Run(), and AI_Goto.TryGoTo().

◆ pccData

◆ preventRegen

bool Chara.preventRegen
static

Definition at line 184 of file Chara.cs.

◆ quest

◆ ranged

◆ rawSlots

int [] Chara.rawSlots

Definition at line 73 of file Chara.cs.

Referenced by OnSerializing().

◆ resistCon

Dictionary<int, int> Chara.resistCon

Definition at line 216 of file Chara.cs.

◆ ride

◆ shared

Point Chara.shared = new Point()
staticprivate

Definition at line 11 of file Chara.cs.

◆ sharedCheckTurn

int Chara.sharedCheckTurn

Definition at line 120 of file Chara.cs.

Referenced by OnDeserialized(), and AI_Idle.Run().

◆ source

◆ spriteReplacer

SpriteReplacer Chara.spriteReplacer

Definition at line 156 of file Chara.cs.

Referenced by LayerEditSkin.RefreshImage().

◆ stealthSeen

int Chara.stealthSeen

Definition at line 190 of file Chara.cs.

◆ tempElements

◆ turnLastSeen

int Chara.turnLastSeen = -100

Definition at line 112 of file Chara.cs.

Referenced by AI_Idle.Run().

◆ visibleWithTelepathy

bool Chara.visibleWithTelepathy

◆ wasInWater

bool Chara.wasInWater

Definition at line 150 of file Chara.cs.

Referenced by _Move().

◆ workElements

ElementContainer Chara.workElements

Definition at line 40 of file Chara.cs.

Property Documentation

◆ _affinity

int Chara._affinity
getset

Definition at line 304 of file Chara.cs.

305 {
306 get
307 {
308 return _cints[5];
309 }
310 set
311 {
312 _cints[5] = value;
313 }
314 }

Referenced by TraitToolBrush.GetHeldEmo(), Affinity.GetIcon(), Affinity.Mod(), OnCreate(), and DramaActor.Talk().

◆ _alias

string Chara._alias
getset

Definition at line 220 of file Chara.cs.

221 {
222 get
223 {
224 return _strs[0];
225 }
226 set
227 {
228 _strs[0] = value;
229 }
230 }
string[] _strs
Definition: Chara.cs:79

Referenced by GetName(), OnCreate(), and CoreDebug.RegenerateNames().

◆ _idTimeTable

int Chara._idTimeTable
getset

Definition at line 342 of file Chara.cs.

343 {
344 get
345 {
346 return _cints[9];
347 }
348 set
349 {
350 _cints[9] = value;
351 }
352 }

Referenced by OnCreate().

◆ _maxStamina

int Chara._maxStamina
getset

Definition at line 366 of file Chara.cs.

367 {
368 get
369 {
370 return _cints[20];
371 }
372 set
373 {
374 _cints[20] = value;
375 }
376 }

Referenced by CalculateMaxStamina().

◆ ability

◆ actorPrefab

override string Chara.actorPrefab
get

Definition at line 520 of file Chara.cs.

521 {
522 get
523 {
524 if (IsPCC)
525 {
526 return "CharaActorPCC";
527 }
528 return "CharaActor";
529 }
530 }

◆ affinity

◆ Aka

◆ AliasMaterialOnCreate

override string Chara.AliasMaterialOnCreate
get

Definition at line 560 of file Chara.cs.

◆ baseWorkElements

ElementContainer Chara.baseWorkElements
get

Definition at line 1124 of file Chara.cs.

1125 {
1126 get
1127 {
1128 if (_baseWorkElements == null)
1129 {
1131 foreach (Hobby item in ListHobbies())
1132 {
1133 Build(item);
1134 }
1135 foreach (Hobby item2 in ListWorks())
1136 {
1137 Build(item2);
1138 }
1139 }
1140 return _baseWorkElements;
1141 void Build(Hobby h)
1142 {
1143 if (!h.source.elements.IsEmpty())
1144 {
1145 for (int i = 0; i < h.source.elements.Length; i += 2)
1146 {
1147 int ele = h.source.elements[i];
1148 int v = h.source.elements[i + 1];
1149 _baseWorkElements.ModBase(ele, v);
1150 }
1151 }
1152 }
1153 }
1154 }
ElementContainer _baseWorkElements
Definition: Chara.cs:206

◆ bladder

Stats Chara.bladder
get

Definition at line 1164 of file Chara.cs.

Referenced by WidgetStats._OnActivate(), WindowChara.RefreshStatus(), and GoalNeeds.Run().

◆ burden

◆ CanGainConResist

bool Chara.CanGainConResist
get

Definition at line 1174 of file Chara.cs.

1175 {
1176 get
1177 {
1178 if (base.rarity >= Rarity.Legendary)
1179 {
1180 return !IsPCFaction;
1181 }
1182 return false;
1183 }
1184 }

◆ CanOpenDoor

bool Chara.CanOpenDoor
get

Definition at line 820 of file Chara.cs.

821 {
822 get
823 {
824 if (base.INT < 5)
825 {
826 if (IsPCFaction)
827 {
828 return memberType == FactionMemberType.Default;
829 }
830 return false;
831 }
832 return true;
833 }
834 }

◆ CanWitness

bool Chara.CanWitness
get

Definition at line 1004 of file Chara.cs.

1005 {
1006 get
1007 {
1008 if (!IsHuman && !IsFairy && !IsGod)
1009 {
1010 return race.id == "mutant";
1011 }
1012 return true;
1013 }
1014 }
bool IsFairy
Definition: Chara.cs:941
bool IsGod
Definition: Chara.cs:953

Referenced by Point.ListWitnesses().

◆ corruption

int Chara.corruption
getset

Definition at line 378 of file Chara.cs.

379 {
380 get
381 {
382 return _cints[21];
383 }
384 set
385 {
386 _cints[21] = value;
387 }
388 }

Referenced by CanDuplicate().

◆ CurrentGeneSlot

int Chara.CurrentGeneSlot
get

Definition at line 1084 of file Chara.cs.

1085 {
1086 get
1087 {
1088 if (base.c_genes != null)
1089 {
1090 return base.c_genes.GetGeneSlot(this);
1091 }
1092 return 0;
1093 }
1094 }

Referenced by InvOwnerGene._OnProcess(), CanDuplicate(), WindowCharaMini.Refresh(), WindowChara.RefreshSkill(), and DNA.WriteNoteExtra().

◆ CurrentSpan

TimeTable.Span Chara.CurrentSpan
get

Definition at line 838 of file Chara.cs.

Referenced by ConSleep.Tick().

◆ currentZone

Zone Chara.currentZone
getset

Definition at line 256 of file Chara.cs.

257 {
258 get
259 {
260 return RefZone.Get(_cints[1]);
261 }
262 set
263 {
264 _cints[1] = RefZone.Set(value);
265 }
266 }
static int Set(Zone zone)
Definition: RefZone.cs:12
static Zone Get(int uid)
Definition: RefZone.cs:3

Referenced by _Move(), AM_ViewZone._OnUpdateInput(), Game.AddAdventurer(), Zone.AddGlobalCharasOnActivate(), Faction.AddReserve(), GameDate.AdvanceDay(), GameDate.AdvanceHour(), Zone.CanDestroy(), BaseGameScreen.Draw(), CoreDebug.Fix_RemoveDemitas(), BaseGameScreen.FocusPC(), GlobalGoalExplore.GetDestZone(), GlobalGoalVisitTown.GetDestZone(), Hobby.GetEfficiency(), IsEnemyOnPath(), Quest.IsVisibleOnQuestBoard(), CardManager.ListGlobalChara(), Region.ListTravelZones(), Player.MoveZone(), FactionBranch.OnAdvanceDay(), GlobalGoalAdv.OnAdvanceHour(), GlobalGoalVisitAndStay.OnAdvanceHour(), BaseListPeople.OnClick(), LayerNewZone.OnClickExit(), QuestDialog.OnDropReward(), Game.OnLoad(), Player.OnStartNewGame(), Scene.OnUpdate(), AM_BaseGameMode.OnUpdateInput(), AttackProcess.PlayRangedAnime(), CoreDebug.QuickStart(), FactionBranch.Recruit(), ActorEx.Refresh(), ItemCulture.Refresh(), BaseGameScreen.RefreshPosition(), GameScreenElona.RefreshPosition(), WindowChara.RefreshProfile(), LayerGlobalMap.RefreshSummary(), ContentFaction.RefreshZones(), LayerFactions.RefreshZones(), LayerLocation.RefreshZones(), FactionBranch.RemoveMemeber(), ButtonChara.SetChara(), ItemGeneral.SetChara(), Meeting.SetChara(), Quest.SetClient(), ListPeopleExpedition.SetSubText(), UIZoneInfo.SetZone(), Player.SimulateFaction(), and EloPos.WriteNote().

◆ daysStarved

int Chara.daysStarved
getset

Definition at line 330 of file Chara.cs.

331 {
332 get
333 {
334 return _cints[7];
335 }
336 set
337 {
338 _cints[7] = value;
339 }
340 }

◆ depression

Stats Chara.depression
get

Definition at line 1162 of file Chara.cs.

Referenced by WidgetStats._OnActivate(), and WindowChara.RefreshStatus().

◆ DestDist

int Chara.DestDist
get

Definition at line 1000 of file Chara.cs.

Referenced by ConfigTactics.AllyDistance(), and CanReplace().

◆ DV

override int Chara.DV
get

Definition at line 730 of file Chara.cs.

731 {
732 get
733 {
734 if (IsPCFaction)
735 {
736 return WeaknessMod(elements.Value(64));
737 }
738 int num = base.LV;
739 if (num > 50)
740 {
741 num = 50 + (num - 50) / 10;
742 }
743 return WeaknessMod(num + elements.Value(64) * (100 + num + race.DV * 5) / 100);
744 int WeaknessMod(int a)
745 {
746 if (HasCondition<ConWeakness>())
747 {
748 if (a <= 0)
749 {
750 return a * 2;
751 }
752 return a / 2;
753 }
754 return a;
755 }
756 }
757 }

Referenced by WidgetStatsBar.Build(), WindowCharaMini.Refresh(), and WindowChara.RefreshProfile().

◆ faction

Faction Chara.faction
getset

Definition at line 428 of file Chara.cs.

429 {
430 get
431 {
432 return _faction ?? (_faction = EClass.game.factions.dictAll.TryGetValue(idFaction));
433 }
434 set
435 {
436 idFaction = value?.uid;
437 }
438 }
string idFaction
Definition: Chara.cs:245
Dictionary< string, Faction > dictAll
FactionManager factions
Definition: Game.cs:162

Referenced by WidgetMenuPanel._OnChangeMode(), Element._WriteNote(), FactionBranch.AddMemeber(), PolicyManager.AddPolicy(), GameDate.AdvanceDay(), GameDate.AdvanceMonth(), QuestDialog.CanStartQuest(), Zone.ClaimZone(), Map.CountChara(), Faction.CountMembers(), FactionBranch.DailyOutcome(), CharaBody.Equip(), FactionBranch.Evalue(), GoalSiege.GetDestCard(), RankedZone.GetFactionName(), RankedZoneManager.GetIncome(), FortuneRollData.GetPrizeList(), AttackProcess.GetWeaponEnc(), Element.IsFactionElement(), Religion.JoinFaith(), Religion.LeaveFaith(), Map.ListChara(), ElementContainer.ListElements(), FactionBranch.OnClaimZone(), ListPeopleRevive.OnList(), Game.OnLoad(), TraitBookSkill.OnRead(), TraitDeed.OnRead(), TraitDeedRelocate.OnRead(), ContentHomeReport.OnSwitchContent(), FactionBranch.OnUnclaimZone(), ActRanged.Perform(), AttackProcess.Perform(), ActEffect.Proc(), Card.PurgeDuplicateArtifact(), Card.PurgeEythArtifact(), UIHomeInfo.Refresh(), UIHomeInfo.RefreshInfo(), WindowChara.RefreshInfo(), ContentPolicy.RefreshPolicyList(), WindowChara.RefreshProfile(), ContentFaction.RefreshZones(), FactionBranch.RemoveMemeber(), AI_Idle.Run(), SetFaction(), FactionBranch.SetOwner(), GameDate.ShipPackages(), Player.SimulateFaction(), ContentRanking.SwitchRanking(), CharaBody.Unequip(), FactionBranch.Upgrade(), FactionBranch.ValidateUpgradePolicies(), ElementContainer.Value(), ElementContainerCard.ValueBonus(), Element.BonusInfo.WriteNote(), and TraitBookPlan.WriteNote().

◆ faith

◆ flipX

override bool Chara.flipX
get

Definition at line 548 of file Chara.cs.

549 {
550 get
551 {
552 if (base.dir != 1)
553 {
554 return base.dir == 2;
555 }
556 return true;
557 }
558 }

Referenced by CharaActor.RefreshSprite().

◆ GeneCostMTP

int Chara.GeneCostMTP
get

Definition at line 1072 of file Chara.cs.

1073 {
1074 get
1075 {
1076 if (!IsPC)
1077 {
1078 return 100;
1079 }
1080 return 5;
1081 }
1082 }

Referenced by TraitGene.TrySetHeldAct(), and TraitGene.WriteNote().

◆ goalListType

GoalListType Chara.goalListType
getset

Definition at line 280 of file Chara.cs.

281 {
282 get
283 {
284 return _cints[3].ToEnum<GoalListType>();
285 }
286 set
287 {
288 _cints[3] = (int)value;
289 }
290 }
GoalListType
Definition: GoalListType.cs:2

◆ HasHost

override bool Chara.HasHost
get

Definition at line 690 of file Chara.cs.

Referenced by ActEffect.Proc().

◆ HasNoGoal

◆ homeBranch

◆ homeZone

◆ hostility

◆ hunger

◆ hygiene

Stats Chara.hygiene
get

Definition at line 1166 of file Chara.cs.

Referenced by WidgetStats._OnActivate(), AI_Fuck.Finish(), ModAffinity(), and AI_Bladder.Run().

◆ idFaction

string Chara.idFaction
getset

Definition at line 244 of file Chara.cs.

245 {
246 get
247 {
248 return _strs[2];
249 }
250 set
251 {
252 _strs[2] = value;
253 }
254 }

◆ idFaith

string Chara.idFaith
getset

Definition at line 232 of file Chara.cs.

233 {
234 get
235 {
236 return _strs[1];
237 }
238 set
239 {
240 _strs[1] = value;
241 }
242 }

Referenced by Element.IsActive(), and ElementContainerFaction.IsEffective().

◆ IDPCCBodySet

string Chara.IDPCCBodySet
get

Definition at line 492 of file Chara.cs.

493 {
494 get
495 {
496 if (source.idActor.Length <= 1)
497 {
498 return "female";
499 }
500 return source.idActor[1];
501 }
502 }

Referenced by BaseListPeople.OnClick(), and OnCreate().

◆ idTimeTable

string Chara.idTimeTable
get

Definition at line 470 of file Chara.cs.

Referenced by LayerQuestBoard.RefreshHire().

◆ interest

int Chara.interest
getset

Definition at line 318 of file Chara.cs.

319 {
320 get
321 {
322 return _cints[6];
323 }
324 set
325 {
326 _cints[6] = value;
327 }
328 }

Referenced by Cuddle(), TraitToolBrush.GetHeldEmo(), DramaCustomSequence.GetRumor(), OnCreate(), AI_PlayMusic.Run(), DramaActor.Talk(), and TraitToolBrush.TrySetHeldAct().

◆ IsAdventurer

bool Chara.IsAdventurer
get

Definition at line 1042 of file Chara.cs.

1043 {
1044 get
1045 {
1046 if (global != null && faction != EClass.pc.faction)
1047 {
1048 return IsPCC;
1049 }
1050 return false;
1051 }
1052 }

◆ isAlawysVisible

bool Chara.isAlawysVisible
getset

Definition at line 402 of file Chara.cs.

403 {
404 get
405 {
406 return _cbits1[1];
407 }
408 set
409 {
410 _cbits1[1] = value;
411 }
412 }

◆ IsAliveInCurrentZone

◆ IsAnimal

bool Chara.IsAnimal
get

Definition at line 868 of file Chara.cs.

869 {
870 get
871 {
872 if (!race.IsAnimal)
873 {
874 return HasTag(CTAG.animal);
875 }
876 return true;
877 }
878 }

Referenced by Map.CountWildAnimal(), AI_Fuck.Run(), and Card.SpawnLoot().

◆ IsCat

bool Chara.IsCat
get

Definition at line 988 of file Chara.cs.

989 {
990 get
991 {
992 if (!(race.id == "cat") && !(race.id == "catsister"))
993 {
994 return race.id == "catgod";
995 }
996 return true;
997 }
998 }

Referenced by Affinity.OnGift(), FoodEffect.Proc(), and AI_Idle.Run().

◆ isChara

override bool Chara.isChara
get

Definition at line 688 of file Chara.cs.

Referenced by TraitShackle.IsRestraining(), and Portrait.SetChara().

◆ isDead

◆ IsDeadOrSleeping

override bool Chara.IsDeadOrSleeping
get

◆ IsDisabled

override bool Chara.IsDisabled
get

◆ IsDragon

bool Chara.IsDragon
get

Definition at line 964 of file Chara.cs.

965 {
966 get
967 {
968 if (!race.IsDragon)
969 {
970 return HasTag(CTAG.dragon);
971 }
972 return true;
973 }
974 }

◆ IsEyth

bool Chara.IsEyth
get

Definition at line 1054 of file Chara.cs.

Referenced by TraitAltar.CanOffer(), TraitAltar.OnOffer(), and Card.PurgeEythArtifact().

◆ IsFairy

bool Chara.IsFairy
get

Definition at line 940 of file Chara.cs.

941 {
942 get
943 {
944 if (!race.IsFairy)
945 {
946 return HasTag(CTAG.fairy);
947 }
948 return true;
949 }
950 }

Referenced by Faction.IsWearingPanty().

◆ IsFish

bool Chara.IsFish
get

Definition at line 928 of file Chara.cs.

929 {
930 get
931 {
932 if (!race.IsFish)
933 {
934 return HasTag(CTAG.fish);
935 }
936 return true;
937 }
938 }

◆ IsGlobal

◆ IsGod

bool Chara.IsGod
get

Definition at line 952 of file Chara.cs.

953 {
954 get
955 {
956 if (!race.IsGod)
957 {
958 return HasTag(CTAG.god);
959 }
960 return true;
961 }
962 }

◆ IsHorror

bool Chara.IsHorror
get

Definition at line 916 of file Chara.cs.

917 {
918 get
919 {
920 if (!race.IsHorror)
921 {
922 return HasTag(CTAG.horror);
923 }
924 return true;
925 }
926 }

Referenced by Refresh().

◆ IsHuman

bool Chara.IsHuman
get

Definition at line 880 of file Chara.cs.

881 {
882 get
883 {
884 if (!race.IsHuman)
885 {
886 return HasTag(CTAG.human);
887 }
888 return true;
889 }
890 }

Referenced by CharaRenderer.DrawHat(), AI_Fuck.Finish(), Biography.Generate(), Faction.IsWearingPanty(), Card.MakeFoodFrom(), FoodEffect.Proc(), AI_Fuck.Run(), and AI_Idle.Run().

◆ IsHumanSpeak

bool Chara.IsHumanSpeak
get

Definition at line 1016 of file Chara.cs.

1017 {
1018 get
1019 {
1020 if (!IsHuman && !race.tag.Contains("humanSpeak"))
1021 {
1022 return HasTag(CTAG.humanSpeak);
1023 }
1024 return true;
1025 }
1026 }

Referenced by Card.GetTalkText(), ConEntangle.Tick(), and TryPush().

◆ IsIdle

bool Chara.IsIdle
get

Definition at line 854 of file Chara.cs.

855 {
856 get
857 {
858 if (!IsDeadOrSleeping)
859 {
860 return ai.Current.IsIdle;
861 }
862 return false;
863 }
864 }
virtual bool IsIdle
Definition: AIAct.cs:78

Referenced by _Move(), AI_Idle.Run(), and ConSleep.SuccubusVisit().

◆ IsInActiveZone

◆ IsInCombat

◆ IsLevitating

bool Chara.IsLevitating
get

Definition at line 598 of file Chara.cs.

599 {
600 get
601 {
602 if (ride != null)
603 {
604 return ride._isLevitating;
605 }
606 return _isLevitating;
607 }
608 }

Referenced by _Move(), ActEffect.DamageEle(), TraitTrap.OnActivateTrap(), TraitFloorSwitch.OnStepped(), Scene.OnUpdate(), and ConWet.Tick().

◆ IsLocalChara

bool Chara.IsLocalChara
get

Definition at line 842 of file Chara.cs.

843 {
844 get
845 {
846 if (!IsGlobal && !base.isSubsetCard)
847 {
848 return homeZone == EClass._zone;
849 }
850 return false;
851 }
852 }

Referenced by MakeAlly(), and ActThrow.Throw().

◆ IsMachine

bool Chara.IsMachine
get

Definition at line 904 of file Chara.cs.

905 {
906 get
907 {
908 if (!race.IsMachine)
909 {
910 return HasTag(CTAG.machine);
911 }
912 return true;
913 }
914 }

Referenced by Refresh(), GoalCombat.Run(), Card.SpawnLoot(), ElementContainerCard.ValueBonus(), and Element.BonusInfo.WriteNote().

◆ IsMaid

bool Chara.IsMaid
get

Definition at line 1028 of file Chara.cs.

1029 {
1030 get
1031 {
1032 if (EClass.Branch != null)
1033 {
1034 return EClass.Branch.uidMaid == base.uid;
1035 }
1036 return false;
1037 }
1038 }

Referenced by FactionBranch.GetMaid().

◆ IsMinion

override bool Chara.IsMinion
get

Definition at line 628 of file Chara.cs.

629 {
630 get
631 {
632 if (master == null)
633 {
634 return base.c_uidMaster != 0;
635 }
636 return true;
637 }
638 }

Referenced by ActPlan._Update(), ConStrife.AddKill(), CanBeTempAlly(), FindMaster(), AI_Shear.GetFur(), Zone_Casino.OnActivate(), Zone_CursedManor.OnGenerateMap(), ZoneInstanceRandomQuest.OnLeaveZone(), Zone.OnVisit(), AI_Idle.Run(), AI_PlayMusic.Run(), and GoalCombat.Run().

◆ IsMofuable

bool Chara.IsMofuable
get

Definition at line 1112 of file Chara.cs.

1113 {
1114 get
1115 {
1116 if (!race.tag.Contains("mofu"))
1117 {
1118 return HasElement(419);
1119 }
1120 return true;
1121 }
1122 }

Referenced by ActPlan._Update(), AI_Mofu.GetMofu(), and AI_Idle.Run().

◆ IsMoving

override bool Chara.IsMoving
get

Definition at line 610 of file Chara.cs.

Referenced by BaseTileMap.Draw(), TileMapElona.Draw(), GetHoverText(), and UISong.Update().

◆ IsMultisize

◆ IsPC

override bool Chara.IsPC
get

Definition at line 614 of file Chara.cs.

Referenced by _Move(), TraitShrine._OnUse(), ActPlan._Update(), Element._WriteNote(), TraitSwitch.ActivateTrap(), Zone.AddGlobalCharasOnActivate(), DNA.Apply(), Feat.Apply(), ActMelee.Attack(), CalcBurden(), CalculateMaxStamina(), TraitTrolley.CanActivate(), Thing.CanAutoFire(), AIAct.Cancel(), TraitFoodPreparedPackage.CanEat(), CanMoveTo(), ActTelekinesis.CanPerform(), Act.CanPerform(), TraitScroll.CanRead(), DNA.CanRemove(), CanReplace(), CanSee(), Player.CanSee(), CanSeeLos(), CanSeeSimple(), ActThrow.CanThrow(), AI_Torture.CreateProgress(), Cuddle(), FactionBranch.DailyOutcome(), ActionMode.DoFunc(), DoHostileAction(), CharaRenderer.Draw(), BaseTileMap.DrawTile(), CharaBody.Equip(), AI_Fish.ProgressFish.Fail(), AI_Fuck.Finish(), Biography.GetAge(), GetBurden(), Element.GetCost(), GetFirstStep(), TraitToolBrush.GetHeldEmo(), DNA.GetInvalidFeat(), FactionBranch.GetResidentTax(), Zone.GetSpawnPos(), HasAccess(), Party.HasElement(), TraitGamble.IdleUse(), Zone.IsCrime(), Party.IsCriticallyWounded(), CharaBody.IsEquippable(), AI_Eat.IsValidTarget(), Religion.JoinFaith(), Card.Kick(), Religion.LeaveFaith(), Point.ListWitnesses(), AI_Fish.Makefish(), StatsMana.Mod(), StatsStamina.Mod(), ModAffinity(), TraitBasketGame.OnActivateTrap(), TraitHitchingPost.OnActivateTrap(), FactionBranch.OnAdvanceDay(), BaseListPeople.OnClick(), WindowChara.OnClickPortrait(), TaskHarvest.OnCreateProgress(), TaskPlow.OnCreateProgress(), TraitFortuneCookie.OnEat(), AI_Fish.ProgressFish.OnProgress(), AI_Fish.ProgressFish.OnProgressComplete(), TaskDig.OnProgressComplete(), TaskMine.OnProgressComplete(), TraitBaseSpellbook.OnRead(), TraitBookExp.OnRead(), TraitBookSecret.OnRead(), TraitBookSkill.OnRead(), TraitDiary.OnRead(), TraitIndulgence.OnRead(), TraitScrollStatic.OnRead(), ConBlind.OnRemoved(), ConFaint.OnRemoved(), ConReload.OnRemoved(), AI_Read.OnSetOwner(), ConBlind.OnStart(), ConSuffocation.OnStart(), TraitCurrencyMedal.OnStepped(), TraitMiniPool.OnStepped(), TraitNewZone.OnStepped(), WindowChara.OnSwitchContent(), ActRanged.Perform(), ActWait.Perform(), ActZap.Perform(), AttackProcess.Perform(), ActEffect.Poison(), ActPray.Pray(), FoodEffect.Proc(), ActEffect.Proc(), ActEffect.ProcAt(), InvOwner.Transaction.Process(), TraitBaseSpellbook.ReadFailEffect(), ButtonRoster.Refresh(), TCOrbitChara.RefreshAll(), WindowChara.RefreshNote(), WindowChara.RefreshProfile(), WindowChara.RefreshSkill(), RefreshSpeed(), CoreDebug.RegenerateNames(), RequestProtection(), AI_Eat.Run(), AI_Fish.Run(), AI_Goto.Run(), AI_Idle.Run(), AI_PassTime.Run(), AI_PlayMusic.Run(), AI_Torture.Run(), AI_Trolley.Run(), AIProgress.Run(), GoalCombat.Run(), TaskPoint.Run(), Map.Save(), WindowChara.SetChara(), CharaRenderer.SetFirst(), LayerDragGrid.SetInv(), AIAct.Start(), ConSleep.SuccubusVisit(), Player.TargetRanged(), ConFear.Tick(), ConSleep.Tick(), ConSuffocation.Tick(), AIAct.TryCancel(), TaskHarvest.TryGetAct(), AI_Goto.TryGoTo(), GoalCombat.TryMove(), TryMove(), TryMoveTowards(), Trait.TryOpenLock(), LayerDragGrid.TryProc(), TraitBaseSpellbook.TryProgress(), TryPush(), ActRanged.TryReload(), TrySetEnemy(), TraitLeash.TrySetHeldAct(), TraitToolButcher.TrySetHeldAct(), Map.TrySmoothPick(), GoalCombat.TryUseAbility(), CharaBody.Unequip(), CharaBody.UnqeuipIfTooHeavy(), CharaRenderer.UpdatePosition(), and DramaOutcome.upgrade_miscreation().

◆ IsPCC

◆ IsPCFaction

override bool Chara.IsPCFaction
get

Definition at line 672 of file Chara.cs.

673 {
674 get
675 {
676 if (EClass.pc != null)
677 {
678 return faction == EClass.pc.faction;
679 }
680 return false;
681 }
682 }

Referenced by _Move(), ActPlan._Update(), Element._WriteNote(), GameDate.AdvanceHour(), DramaCustomSequence.Build(), CallHelp(), TraitTrolley.CanActivate(), Thing.CanAutoFire(), CanBeTempAlly(), TraitSalesTag.CanTagSale(), ElementContainerFaction.CheckDirty(), Map.CountHostile(), Map.CountNonHostile(), Map.CountWildAnimal(), AI_Torture.CreateProgress(), ActionMode.DoFunc(), DoHostileAction(), AI_Fuck.Finish(), Element.IsFactionElement(), Quest.IsVisibleOnQuestBoard(), ElementContainer.ListElements(), Point.ListWitnesses(), ActEffect.LoveMiracle(), AI_Fish.Makefish(), StatsMana.Mod(), TraitHitchingPost.OnActivateTrap(), GlobalGoalAdv.OnAdvanceHour(), QuestNasu.OnComplete(), ElementContainerFaction.OnEquip(), Zone_SubTown.OnGenerateRooms(), BaseListPeople.OnInstantiate(), ElementContainerFaction.OnJoinFaith(), QuestTaskHunt.OnKillChara(), ElementContainerFaction.OnLeaveFaith(), ElementContainerCard.OnLevelDown(), ElementContainerCard.OnLevelUp(), ListPeopleBed.OnList(), Game.OnLoad(), ElementContainerFaction.OnUnequip(), Zone.OnVisit(), AttackProcess.Perform(), FoodEffect.Proc(), ActEffect.Proc(), TraitBaseSpellbook.ReadFailEffect(), TraitGeneratorWheel.Refresh(), WindowChara.RefreshProfile(), LayerQuestBoard.RefreshRanking(), RefreshSpeed(), RequestProtection(), Zone.ResetHostility(), CoreDebug.ResetPetUpgrades(), ActRide.Ride(), AI_Fish.Run(), AI_Fuck.Run(), AI_Idle.Run(), AI_PlayMusic.Run(), AI_Steal.Run(), GoalCombat.Run(), TraitGeneratorWheel.ShouldWork(), Zone.Simulate(), ConMiasma.Tick(), ConSleep.Tick(), TraitSwitch.TryDisarmTrap(), TrySetEnemy(), TraitStethoscope.TrySetHeldAct(), TraitToolButcher.TrySetHeldAct(), TraitWhipLove.TrySetHeldAct(), Map.TryShatter(), GoalCombat.TryUseAbility(), TraitBed.ValidateOwners(), and Element.BonusInfo.WriteNote().

◆ IsPCFactionMinion

override bool Chara.IsPCFactionMinion
get

Definition at line 656 of file Chara.cs.

657 {
658 get
659 {
660 if (master != null)
661 {
662 if (!master.IsPCFaction)
663 {
665 }
666 return true;
667 }
668 return false;
669 }
670 }

Referenced by ActPlan._Update(), ElementContainerFaction.CheckDirty(), DoHostileAction(), Point.ListWitnesses(), AI_PlayMusic.Run(), GoalCombat.Run(), and TrySetEnemy().

◆ IsPCParty

override bool Chara.IsPCParty
get

Definition at line 616 of file Chara.cs.

617 {
618 get
619 {
620 if (party != null)
621 {
622 return party.leader == EClass.pc;
623 }
624 return false;
625 }
626 }

Referenced by ActPlan._Update(), Zone.AbandonZone(), Zone.AddGlobalCharasOnActivate(), Faction.AddReserve(), GameDate.AdvanceHour(), FactionBranch.AutoClean(), CanReplace(), Player.CanSee(), TraitSalesTag.CanTagSale(), Cuddle(), FactionBranch.DailyOutcome(), Die(), DoHostileAction(), AI_Fuck.Finish(), FactionBranch.GenerateGarbage(), DramaCustomSequence.GetListGuide(), FactionBranch.GetProductBonus(), IsHostile(), AI_Fish.Makefish(), TraitHitchingPost.OnActivateTrap(), FactionBranch.OnAdvanceDay(), FactionBranch.OnAfterSimulate(), ZoneEventDefenseGame.OnCharaDie(), BaseListPeople.OnClick(), Zone_CursedManor.OnGenerateMap(), ListPeopleExpedition.OnList(), AI_Fish.ProgressFish.OnProgressComplete(), TraitBaseSpellbook.OnRead(), ConTransmute.OnRemoved(), AI_Read.OnSetOwner(), FactionBranch.OnSimulateDay(), FactionBranch.OnSimulateHour(), ConTransmute.OnStart(), TraitGeneMachine.OnUse(), Zone.OnVisit(), ActWait.Perform(), ActWater.Perform(), ActZap.Perform(), AttackProcess.Perform(), AttackProcess.Prepare(), FoodEffect.Proc(), ActEffect.Proc(), ActEffect.ProcAt(), TCOrbitChara.RefreshAll(), Zone.RefreshCriminal(), FactionBranch.RefreshEfficiency(), UIHomeInfo.RefreshReport(), RefreshSpeed(), RequestProtection(), AI_Eat.Run(), AI_Fish.Run(), AI_Idle.Run(), AI_PlayMusic.Run(), GoalCombat.Run(), ItemGeneral.SetChara(), Zone.Simulate(), TraitSwitch.TryDisarmTrap(), TryPush(), TraitLeash.TrySetHeldAct(), GoalCombat.TryUseAbility(), CharaRenderer.UpdatePosition(), and TraitBed.ValidateOwners().

◆ IsPCPartyMinion

override bool Chara.IsPCPartyMinion
get

Definition at line 640 of file Chara.cs.

641 {
642 get
643 {
644 if (master != null)
645 {
646 if (!master.IsPCParty)
647 {
648 return master.IsPCPartyMinion;
649 }
650 return true;
651 }
652 return false;
653 }
654 }

Referenced by ActPlan._Update(), DoHostileAction(), IsEscorted(), MoveZone(), ZoneEventDefenseGame.OnCharaDie(), and ActEffect.Proc().

◆ IsPlant

bool Chara.IsPlant
get

Definition at line 976 of file Chara.cs.

977 {
978 get
979 {
980 if (!race.IsPlant)
981 {
982 return HasTag(CTAG.plant);
983 }
984 return true;
985 }
986 }

Referenced by GoalCombat.Run().

◆ IsPrisoner

bool Chara.IsPrisoner
get

Definition at line 1040 of file Chara.cs.

◆ isSynced

override bool Chara.isSynced
get

◆ isThing

override bool Chara.isThing
get

Definition at line 686 of file Chara.cs.

◆ IsUndead

bool Chara.IsUndead
get

Definition at line 892 of file Chara.cs.

893 {
894 get
895 {
896 if (!race.IsUndead)
897 {
898 return HasTag(CTAG.undead);
899 }
900 return true;
901 }
902 }

Referenced by Card.MakeFoodFrom(), and Refresh().

◆ IsWealthy

bool Chara.IsWealthy
get

Definition at line 1056 of file Chara.cs.

1057 {
1058 get
1059 {
1060 if (!source.works.Contains("Rich"))
1061 {
1062 return source.hobbies.Contains("Rich");
1063 }
1064 return true;
1065 }
1066 }

Referenced by FactionBranch.CountWealthyGuests(), FactionBranch.GetResidentTax(), and CalcMoney.Whore().

◆ job

◆ knowFav

bool Chara.knowFav
getset

Definition at line 414 of file Chara.cs.

415 {
416 get
417 {
418 return _cbits1[3];
419 }
420 set
421 {
422 _cbits1[3] = value;
423 }
424 }

Referenced by DramaActor.Talk(), and ConSleep.Tick().

◆ MainElement

Element Chara.MainElement
get

Definition at line 718 of file Chara.cs.

719 {
720 get
721 {
722 if (base.c_idMainElement == 0)
723 {
724 return Element.Void;
725 }
726 return elements.GetElement(base.c_idMainElement);
727 }
728 }

Referenced by Cuddle(), ZonePreEnterEncounter.Execute(), CardRow.GetName(), GetName(), Act.Perform(), AttackProcess.Perform(), ActEffect.ProcAt(), CharaAbility.Refresh(), Card.RefreshColor(), SetMainElement(), and GoalCombat.TryUseAbility().

◆ mana

◆ MaxGeneSlot

int Chara.MaxGeneSlot
get

◆ MaxHP

◆ MaxSummon

int Chara.MaxSummon
get

◆ NameBraced

string Chara.NameBraced
get

◆ NameTitled

string Chara.NameTitled
get

Definition at line 518 of file Chara.cs.

Referenced by ActEffect.Proc().

◆ OriginalHostility

Hostility Chara.OriginalHostility
get

Definition at line 472 of file Chara.cs.

473 {
474 get
475 {
476 if (EClass.pc == null || !IsPCFaction)
477 {
478 if (base.c_originalHostility == (Hostility)0)
479 {
480 if (!source.hostility.IsEmpty())
481 {
482 return source.hostility.ToEnum<Hostility>();
483 }
484 return Hostility.Enemy;
485 }
486 return base.c_originalHostility;
487 }
488 return Hostility.Ally;
489 }
490 }

Referenced by FactionBranch.AddMemeber(), CallHelp(), GuildFighter.CanGiveContribution(), Die(), IsHostile(), Point.ListWitnesses(), OnCreate(), Zone.OnGenerateMap(), QuestTaskHunt.OnKillChara(), Zone.ResetHostility(), AI_Idle.Run(), AI_Steal.Run(), and GoalCombat.Run().

◆ Pref

override SourcePref Chara.Pref
get

Definition at line 788 of file Chara.cs.

789 {
790 get
791 {
792 if (spriteReplacer != null)
793 {
795 }
796 if (base.idSkin > 0)
797 {
798 switch (sourceCard.tiles.TryGet(base.idSkin))
799 {
800 case 2319:
801 case 2619:
802 case 2621:
803 case 2623:
804 case 2625:
806 case 2320:
807 case 2611:
808 case 2620:
809 case 2622:
810 case 2624:
811 case 2626:
812 case 2828:
814 }
815 }
816 return sourceCard.pref;
817 }
818 }
SourcePref snowputit2
Definition: CoreRef.cs:326
SourcePref sonwputit1
Definition: CoreRef.cs:324
SourcePref replacer1
Definition: CoreRef.cs:330
PrefData prefs
Definition: CoreRef.cs:417
CoreRef refs
Definition: Core.cs:51
SourcePref pref
Definition: RenderRow.cs:68
SourcePref pref
Definition: SpriteData.cs:23

Referenced by BaseTileMap.DrawTile(), LayerEditSkin.OnClickEdit(), and TCOrbitChara.OnSetOwner().

◆ PrefIndex

override int Chara.PrefIndex
get

Definition at line 532 of file Chara.cs.

533 {
534 get
535 {
536 if (sourceCard._tiles.Length != 0 || renderer.replacer != null)
537 {
538 if (base.dir != 1 && base.dir != 2)
539 {
540 return 0;
541 }
542 return 1;
543 }
544 return base.dir;
545 }
546 }

◆ PV

override int Chara.PV
get

Definition at line 759 of file Chara.cs.

760 {
761 get
762 {
763 if (IsPCFaction)
764 {
765 return WeaknessMod(elements.Value(65));
766 }
767 int num = base.LV;
768 if (num > 50)
769 {
770 num = 50 + (num - 50) / 10;
771 }
772 return WeaknessMod(num + elements.Value(65) * (100 + num + race.PV * 5) / 100);
773 int WeaknessMod(int a)
774 {
775 if (HasCondition<ConWeakness>())
776 {
777 if (a <= 0)
778 {
779 return a * 2;
780 }
781 return a / 2;
782 }
783 return a;
784 }
785 }
786 }

Referenced by WidgetStatsBar.Build(), WindowCharaMini.Refresh(), and WindowChara.RefreshProfile().

◆ race

◆ SAN

◆ SelfWeight

override int Chara.SelfWeight
get

Definition at line 714 of file Chara.cs.

◆ sleepiness

Stats Chara.sleepiness
get

◆ sourceCard

override CardRow Chara.sourceCard
get

◆ sourceRenderCard

override CardRow Chara.sourceRenderCard
get

Definition at line 454 of file Chara.cs.

455 {
456 get
457 {
458 if (pccData != null && !(source.renderData is RenderDataPcc))
459 {
461 }
462 return source;
463 }
464 }
static Row rowDefaultPCC
Definition: SourceChara.cs:140

◆ Speed

int Chara.Speed
get

Definition at line 1096 of file Chara.cs.

1097 {
1098 get
1099 {
1100 if (dirtySpeed)
1101 {
1102 RefreshSpeed();
1103 }
1104 if (_Speed > 100000000)
1105 {
1106 return 100000000;
1107 }
1108 return (int)_Speed;
1109 }
1110 }

Referenced by GameUpdater.ConditionUpdater.FixedUpdate().

◆ stamina

◆ tactics

Tactics Chara.tactics
get

Definition at line 836 of file Chara.cs.

◆ trait

◆ uidEditor

int Chara.uidEditor
getset

Definition at line 354 of file Chara.cs.

355 {
356 get
357 {
358 return _cints[10];
359 }
360 set
361 {
362 _cints[10] = value;
363 }
364 }

Referenced by SerializedCards.Add().

◆ WeightLimit

override int Chara.WeightLimit
get

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