Elin Decompiled Documentation EA 23.282 Stable Patch 3
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)
 
void UnmakeMinion ()
 
void BanishAllMinions ()
 
bool HasMinion (string id)
 
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)
 
void Kiss (Chara c)
 
void Slap (Chara c, bool slapToDeath=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 ()
 
void Marry (Chara c)
 
void Divorce (Chara c)
 
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, bool simple=false)
 
Thing MakeEgg (bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
 
Thing MakeMilk (bool effect=true, int num=1, bool addToZone=true, BlessedState? state=null)
 
Thing GiveBirth (Thing t, bool effect)
 
void HatchEgg ()
 
Card SetHidden (bool hide=true)
 
virtual MoveResult _Move (Point p, MoveType type=MoveType.Walk)
 
void MoveImmediate (Point p, bool focus=true, bool cancelAI=true)
 
void Teleport (Point point, bool silent=false, bool force=false)
 
virtual void OnLand ()
 
MoveResult TryMoveFrom (Point p)
 
virtual MoveResult TryMove (Point newPoint, bool allowDestroyPath=true)
 
void Kick (Point p, bool ignoreSelf=false, bool checkWall=true)
 
void Kick (Chara t, bool ignoreSelf=false, bool karmaLoss=true, bool show=true, bool checkWall=true)
 
int ResistLvFrom (int ele)
 
int ResistLv (int res)
 
bool HasElement (int ele, bool includeNagative=false)
 
bool HasElement (int ele, int req)
 
bool HasElement (string id, int req=1)
 
bool HasGlobalElement (int ele)
 
bool HasElementNoCopy ()
 
virtual CardRenderer _CreateRenderer ()
 
void AddBlood (int a=1, int id=-1)
 
RenderParam GetRenderParam ()
 
virtual void SetRenderParam (RenderParam p)
 
void DyeRandom ()
 
void Dye (string idMat)
 
void Dye (SourceMaterial.Row mat)
 
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]
 
bool IsMarried [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_uidAttune [get, set]
 
int c_dyeMat [get, set]
 
VisitorState visitorState [get, set]
 
RescueState c_rescueState [get, set]
 
BossType c_bossType [get, set]
 
int c_dateStockExpire [get, set]
 
int c_dateDeathLock [get, set]
 
int c_IDTState [get, set]
 
int c_charges [get, set]
 
int c_bill [get, set]
 
int c_invest [get, set]
 
int c_seed [get, set]
 
int c_allowance [get, set]
 
int c_fur [get, set]
 
int c_dateCooked [get, set]
 
int c_lockedAge [get, set]
 
int c_containerSize [get, set]
 
int c_weight [get, set]
 
int c_diceDim [get, set]
 
int c_indexContainerIcon [get, set]
 
int c_idMainElement [get, set]
 
int c_summonDuration [get, set]
 
int c_idBacker [get, set]
 
int c_uidMaster [get, set]
 
int c_ammo [get, set]
 
int c_daysWithGod [get, set]
 
int c_daysWithPC [get, set]
 
string c_idPortrait [get, set]
 
string c_idRace [get, set]
 
string c_idJob [get, set]
 
string c_idTone [get, set]
 
string c_color [get, set]
 
string c_idSpriteReplacer [get, set]
 
string c_idTalk [get, set]
 
string c_idDeity [get, set]
 
string c_altName [get, set]
 
string c_altName2 [get, set]
 
string c_extraNameRef [get, set]
 
string c_refText [get, set]
 
string c_idRefName [get, set]
 
string c_idRidePCC [get, set]
 
string c_idAbility [get, set]
 
string c_context [get, set]
 
string c_idEditor [get, set]
 
string c_editorTags [get, set]
 
string c_editorTraitVal [get, set]
 
string c_idTrait [get, set]
 
string c_idRefCard [get, set]
 
string c_idRefCard2 [get, set]
 
string c_note [get, set]
 
UniqueData c_uniqueData [get, set]
 
Thing ammoData [get, set]
 
List< SocketDatasocketList [get, set]
 
Thing c_copyContainer [get, set]
 
Window.SaveData c_windowSaveData [get, set]
 
CharaUpgrade c_upgrades [get, set]
 
LoveData c_love [get, set]
 
CharaGenes c_genes [get, set]
 
List< int > c_corruptionHistory [get, set]
 
ContainerUpgrade c_containerUpgrade [get, set]
 
DNA c_DNA [get, set]
 
CharaList c_charaList [get, set]
 
MixedFoodData c_mixedFoodData [get, set]
 
Thing c_bloodData [get, set]
 
byte[] c_textureData [get, set]
 
SourceMaterial.Row DyeMat [get]
 
int invX [get, set]
 
int invY [get, set]
 
CardRow refCard [get]
 
CardRow refCard2 [get]
 
int ExpToNext [get]
 
int DefaultLV [get]
 
int ChildrenWeight [get]
 
int ChildrenAndSelfWeight [get]
 
int ChildrenAndSelfWeightSingle [get]
 
virtual int SelfWeight [get]
 
virtual int WeightLimit [get]
 
SourceCategory.Row category [get]
 
SourceMaterial.Row material [get]
 
virtual string AliasMaterialOnCreate [get]
 
Cell Cell [get]
 
virtual Thing Thing [get]
 
virtual Chara Chara [get]
 
virtual bool isThing [get]
 
virtual bool isChara [get]
 
bool ExistsOnMap [get]
 
virtual bool isSynced [get]
 
bool IsContainer [get]
 
bool IsUnique [get]
 
bool IsPowerful [get]
 
bool IsImportant [get]
 
virtual SourcePref Pref [get]
 
virtual bool IsDeadOrSleeping [get]
 
virtual bool IsDisabled [get]
 
virtual bool IsMoving [get]
 
virtual bool flipX [get]
 
virtual bool IsAliveInCurrentZone [get]
 
virtual string actorPrefab [get]
 
virtual CardRow sourceCard [get]
 
virtual CardRow sourceRenderCard [get]
 
virtual RenderRow TileRow [get]
 
TileType TileType [get]
 
string Name [get]
 
string NameSimple [get]
 
string NameOne [get]
 
virtual bool IsPC [get]
 
bool _IsPC [get]
 
virtual bool IsPCC [get]
 
virtual bool IsPCParty [get]
 
virtual bool IsMinion [get]
 
virtual bool IsPCPartyMinion [get]
 
virtual bool IsPCFactionMinion [get]
 
virtual bool IsMultisize [get]
 
bool IsToolbelt [get]
 
bool IsLightsource [get]
 
bool IsEquipment [get]
 
bool IsFood [get]
 
bool IsInheritFoodTraits [get]
 
bool ShowFoodEnc [get]
 
bool IsWeapon [get]
 
bool IsEquipmentOrRanged [get]
 
bool IsEquipmentOrRangedOrAmmo [get]
 
bool IsMeleeWeapon [get]
 
bool IsRangedWeapon [get]
 
bool IsThrownWeapon [get]
 
bool IsAmmo [get]
 
bool IsAgent [get]
 
bool IsFurniture [get]
 
bool IsBlessed [get]
 
bool IsCursed [get]
 
bool 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 6763 of file Chara.cs.

6764 {
6765 CardRenderer cardRenderer = renderer;
6766 CharaRenderer charaRenderer = new CharaRenderer();
6767 if (source.skinAntiSpider != 0 && EClass.core.config.game.antiSpider)
6768 {
6769 base.idSkin = source.skinAntiSpider;
6770 }
6771 if (host != null)
6772 {
6773 charaRenderer.pccData = PCCData.Create("ride");
6774 string idPart = base.c_idRidePCC.IsEmpty(EClass.core.pccs.sets["ride"].map["body"].map.Keys.First());
6775 charaRenderer.pccData.SetPart("body", "ride", idPart);
6776 charaRenderer.pccData.ride = EClass.core.pccs.GetRideData(idPart);
6777 }
6778 else
6779 {
6780 foreach (Condition condition in conditions)
6781 {
6782 RendererReplacer rendererReplacer = condition.GetRendererReplacer();
6783 if (rendererReplacer != null)
6784 {
6785 charaRenderer.replacer = rendererReplacer;
6786 charaRenderer.data = rendererReplacer.data;
6787 break;
6788 }
6789 }
6790 if (charaRenderer.replacer == null)
6791 {
6792 charaRenderer.pccData = pccData;
6793 }
6794 }
6795 renderer = charaRenderer;
6796 renderer.SetOwner(this);
6797 if (cardRenderer != null)
6798 {
6799 renderer.SetFirst(first: false, cardRenderer.position);
6800 }
6801 return charaRenderer;
6802 }
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 2345 of file Chara.cs.

2346 {
2347 if (EClass.pc.homeBranch != null)
2348 {
2350 }
2351 else
2352 {
2353 SetGlobal();
2355 }
2356 Hostility hostility2 = (base.c_originalHostility = Hostility.Ally);
2357 this.hostility = hostility2;
2358 orgPos = null;
2359 base.c_summonDuration = 0;
2360 base.isSummon = false;
2361 UnmakeMinion();
2362 SetInt(32);
2363 Refresh();
2364 }
Hostility
Definition: Hostility.cs:2
list. Refresh()
void SetInt(int id, int value=0)
Definition: BaseCard.cs:39
void UnmakeMinion()
Definition: Chara.cs:2399
Chara SetFaction(Faction f)
Definition: Chara.cs:1453
Point orgPos
Definition: Chara.cs:21
FactionBranch homeBranch
Definition: Chara.cs:1080
Chara SetGlobal()
Definition: Chara.cs:1520
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(), SetFaction(), SetGlobal(), BaseCard.SetInt(), and UnmakeMinion().

Referenced by MakeAlly(), and MakePartyMemeber().

◆ _Move()

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

Reimplemented from Card.

Definition at line 2767 of file Chara.cs.

2768 {
2769 if (isDead)
2770 {
2771 return MoveResult.Fail;
2772 }
2773 if (IsPC)
2774 {
2775 float num = EClass.setting.defaultActPace;
2776 switch (burden.GetPhase())
2777 {
2778 case 3:
2779 num *= 1.5f;
2780 break;
2781 case 4:
2782 num *= 2f;
2783 break;
2784 }
2786 {
2787 int num2 = 30;
2788 if (!EClass.pc.HasElement(408))
2789 {
2791 {
2792 case Weather.Condition.Rain:
2793 num2 += 5;
2794 break;
2795 case Weather.Condition.RainHeavy:
2796 num2 += 10;
2797 num *= 1.5f;
2798 break;
2799 case Weather.Condition.Snow:
2800 num2 += 10;
2801 break;
2802 case Weather.Condition.SnowHeavy:
2803 num2 += 15;
2804 num *= 1.5f;
2805 break;
2806 }
2807 }
2808 if (newPoint.matFloor.id == 48)
2809 {
2810 num2 += 20;
2811 num *= 1.8f;
2812 }
2813 num2 = num2 * 100 / (100 + EClass.sqrt(EvalueMax(240, -20) * 10) + EvalueMax(407, -5) * 5);
2814 EClass.world.date.AdvanceMin(num2 * 6);
2815 EClass.player.lastZonePos = null;
2817 int num3 = base.hp;
2818 for (int i = 0; i < num2 * 4; i++)
2819 {
2820 EClass.pc.party.members.ForeachReverse(delegate(Chara m)
2821 {
2822 if (!m.isDead)
2823 {
2824 m.TickConditions();
2825 }
2826 });
2827 if (base.hp < MaxHP / 5 && base.hp < num3 && !EClass.player.regionMoveWarned)
2828 {
2829 EClass.player.regionMoveWarned = true;
2830 Msg.Say("regionAbortMove");
2831 EInput.Consume(consumeAxis: true);
2832 SetAI(new NoGoal());
2833 return MoveResult.Fail;
2834 }
2835 }
2836 if (newPoint.cell.CanSuffocate())
2837 {
2838 bool flag = HasElement(1252);
2839 if (!flag)
2840 {
2841 AddCondition<ConSuffocation>((Evalue(200) != 0) ? (2000 / (100 + EvalueMax(200, -5) * 10)) : 30, force: true);
2842 }
2843 int num4 = GetCondition<ConSuffocation>()?.GetPhase() ?? 0;
2844 if (num4 >= 2)
2845 {
2846 DamageHP(EClass.rndHalf(10 + MaxHP / 5), AttackSource.Condition);
2847 }
2848 if (!isDead && !HasElement(429))
2849 {
2850 ModExp(200, ((!flag) ? 1 : 10) + num4 * 12);
2851 }
2852 }
2853 EClass.player.regionMoveWarned = false;
2854 if (isDead)
2855 {
2856 return MoveResult.Fail;
2857 }
2858 }
2859 if (num > EClass.setting.defaultActPace * 3f)
2860 {
2861 num = EClass.setting.defaultActPace * 3f;
2862 }
2863 actTime = num;
2864 }
2865 if (IsPCFaction && EClass.rnd(5) == 0 && newPoint.cell.CanSuffocate())
2866 {
2867 int num5 = Mathf.Min(5 + EClass._zone.DangerLv / 10, 200);
2868 ModExp(200, EClass._zone.IsRegion ? 50 : num5);
2869 if (ride != null)
2870 {
2871 ride.ModExp(200, EClass._zone.IsRegion ? 50 : num5);
2872 }
2873 if (parasite != null)
2874 {
2875 parasite.ModExp(200, EClass._zone.IsRegion ? 50 : num5);
2876 }
2877 }
2878 Chara chara = ((ride == null) ? this : ride);
2879 if (!EClass._zone.IsRegion || chara.IsPC)
2880 {
2881 bool flag2 = (chara.isConfused && EClass.rnd(2) == 0) || (chara.isDrunk && EClass.rnd(IsIdle ? 2 : 8) == 0 && !chara.HasElement(1215));
2882 if (host != null && host.ride == this && ((host.isConfused && EClass.rnd(2) == 0) || (host.isDrunk && EClass.rnd(IsIdle ? 2 : 8) == 0 && !host.HasElement(1215))))
2883 {
2884 flag2 = true;
2885 }
2886 if (flag2 && newPoint.Distance(pos) <= 1)
2887 {
2888 Point randomNeighbor = pos.GetRandomNeighbor();
2889 if (CanMoveTo(randomNeighbor, allowDestroyPath: false))
2890 {
2891 newPoint = randomNeighbor;
2892 if (isDrunk)
2893 {
2894 Talk("drunk");
2895 }
2896 }
2897 }
2898 }
2899 if (newPoint.x != pos.x || newPoint.z != pos.z)
2900 {
2901 LookAt(newPoint);
2902 }
2903 CellEffect effect = base.Cell.effect;
2904 if (effect != null && effect.id == 7)
2905 {
2906 CellEffect effect2 = base.Cell.effect;
2907 if (race.height < 500 && !race.tag.Contains("webfree") && EClass.rnd(effect2.power + 25) > EClass.rnd(base.STR + base.DEX + 1))
2908 {
2909 Say("abWeb_caught", this);
2910 PlaySound("web");
2911 effect2.power = effect2.power * 3 / 4;
2912 renderer.PlayAnime(AnimeID.Shiver);
2913 return MoveResult.Fail;
2914 }
2915 Say("abWeb_pass", this);
2916 EClass._map.SetEffect(base.Cell.x, base.Cell.z);
2917 }
2918 if (IsPC)
2919 {
2920 EClass.player.renderExtraTime = 0f;
2921 if (EClass._zone.IsRegion)
2922 {
2924 }
2925 else if ((newPoint.x > pos.x && newPoint.z > pos.z) || (newPoint.x < pos.x && newPoint.z < pos.z))
2926 {
2927 EClass.player.renderExtraTime = actTime * EClass.setting.render.anime.diagonalSpeed;
2928 }
2929 }
2930 if (newPoint.HasChara)
2931 {
2932 foreach (Chara item in newPoint.ListCharas())
2933 {
2934 if (item.mimicry != null && item.IsHostile(this))
2935 {
2936 item.mimicry.RevealMimicry(this, surprise: true);
2937 return MoveResult.Event;
2938 }
2939 }
2940 }
2941 if (newPoint.cell.hasDoor)
2942 {
2943 foreach (Thing thing in pos.Things)
2944 {
2945 if (thing.trait is TraitDoor traitDoor && traitDoor.owner.c_lockLv > 0)
2946 {
2947 if (base.INT < 10)
2948 {
2949 return MoveResult.Fail;
2950 }
2951 traitDoor.TryOpenLock(this);
2952 return MoveResult.Door;
2953 }
2954 }
2955 }
2956 Cell cell = newPoint.cell;
2957 Cell cell2 = pos.cell;
2958 bool flag3 = cell.HasLiquid && !IsLevitating;
2959 bool hasBridge = cell.HasBridge;
2960 bool hasRamp = cell.HasRamp;
2961 bool flag4 = EClass._zone.IsSnowCovered && !cell.HasRoof && !cell.isClearSnow;
2962 TileRow tileRow = (hasRamp ? ((TileRow)cell.sourceBlock) : ((TileRow)(hasBridge ? cell.sourceBridge : cell.sourceFloor)));
2963 SourceMaterial.Row row = (hasRamp ? cell.matBlock : (hasBridge ? cell.matBridge : cell.matFloor));
2964 bool flag5 = cell.IsTopWater && !cell.isFloating;
2965 if (!EClass._zone.IsRegion)
2966 {
2967 if (cell.hasDoorBoat)
2968 {
2969 tileRow = FLOOR.sourceWood;
2970 row = MATERIAL.sourceOak;
2971 flag5 = false;
2972 }
2973 else if (flag4 && !tileRow.ignoreSnow)
2974 {
2975 if (tileRow.tileType.IsWater)
2976 {
2977 tileRow = FLOOR.sourceIce;
2978 row = MATERIAL.sourceIce;
2979 }
2980 else
2981 {
2982 tileRow = FLOOR.sourceSnow;
2983 row = MATERIAL.sourceSnow;
2984 }
2985 flag5 = false;
2986 }
2987 }
2988 if ((pos.sourceFloor.isBeach || cell2.IsSnowTile) && !pos.HasObj)
2989 {
2990 EClass._map.SetFoormark(pos, 1, (int)Util.GetAngle(pos.x - newPoint.x, pos.z - newPoint.z), cell2.IsSnowTile ? 312 : 304);
2991 }
2992 if (isSynced)
2993 {
2994 string text = ((flag3 || flag5) ? "water" : tileRow.soundFoot.IsEmpty(row.soundFoot.IsEmpty("default")));
2995 if (cell.obj != 0 && cell.sourceObj.tileType.IsPlayFootSound && !cell.matObj.soundFoot.IsEmpty())
2996 {
2997 text = cell.matObj.soundFoot;
2998 }
2999 if (IsPC)
3000 {
3001 foreach (Thing thing2 in newPoint.Things)
3002 {
3003 if (thing2.IsInstalled && (thing2.trait.IsChangeFloorHeight || thing2.Pref.Surface))
3004 {
3005 text = thing2.material.soundFoot;
3006 }
3007 }
3008 }
3009 if (!text.IsEmpty())
3010 {
3011 SoundManager.altLastData = IsPC;
3012 PlaySound("Footstep/" + text, IsPC ? 1f : 0.9f);
3013 }
3014 if (!flag5)
3015 {
3017 PCOrbit pcOrbit = EClass.screen.pcOrbit;
3018 bool flag6 = scene.actionMode.gameSpeed > 1f;
3019 scene.psFoot.transform.position = renderer.position + pcOrbit.footPos;
3020 scene.psFoot.startColor = row.matColor;
3021 scene.psFoot.Emit(pcOrbit.emitFoot * ((!flag6) ? 1 : 2));
3022 if (flag6 && IsPC)
3023 {
3024 scene.psSmoke.transform.position = renderer.position + pcOrbit.smokePos;
3025 scene.psSmoke.Emit(pcOrbit.emitSmoke);
3026 }
3027 }
3028 if (flag3 || flag5)
3029 {
3030 Effect.Get("ripple").Play(newPoint);
3031 }
3032 }
3033 lastPos.Set(pos);
3034 if (type != MoveType.Force)
3035 {
3036 if (newPoint.HasChara && ai.Current.PushChara)
3037 {
3038 TryPush(newPoint);
3039 }
3040 if (newPoint.HasChara && newPoint.Charas.Count == 1)
3041 {
3042 Chara chara2 = newPoint.Charas[0];
3043 if (CanReplace(chara2))
3044 {
3045 chara2.MoveByForce(lastPos, this);
3046 if (chara.IsPC)
3047 {
3048 Say("replace_pc", chara, chara2);
3049 }
3050 }
3051 }
3052 }
3053 if (cell.hasDoor)
3054 {
3055 foreach (Thing thing3 in newPoint.Things)
3056 {
3057 if (thing3.trait is TraitDoor traitDoor2)
3058 {
3059 traitDoor2.TryOpen(this);
3060 }
3061 }
3062 }
3063 EClass._zone.map.MoveCard(newPoint, this);
3064 SyncRide();
3066 {
3067 foreach (Chara member in EClass.pc.party.members)
3068 {
3069 if (member.isLeashed && !member.IsPC && member.host == null && !member.IsDisabled && !member.HasCondition<ConEntangle>() && !member.IsInCombat && member.Dist(EClass.pc) > 1)
3070 {
3071 member.TryMoveTowards(EClass.pc.pos);
3072 }
3073 }
3074 }
3076 {
3078 }
3079 if (IsPC)
3080 {
3081 PlaySound("Footstep/Extra/pcfootstep");
3082 if (pos.HasThing)
3083 {
3084 foreach (Card item2 in pos.ListCards())
3085 {
3086 if (!item2.isThing || item2.placeState != 0 || item2.ignoreAutoPick)
3087 {
3088 continue;
3089 }
3091 {
3093 ContainerFlag containerFlag = item2.category.GetRoot().id.ToEnum<ContainerFlag>();
3094 if (containerFlag == ContainerFlag.none)
3095 {
3096 containerFlag = ContainerFlag.other;
3097 }
3098 if ((dataPick.noRotten && item2.IsDecayed) || (dataPick.onlyRottable && item2.trait.Decay == 0))
3099 {
3100 continue;
3101 }
3102 if (dataPick.userFilter)
3103 {
3104 switch (dataPick.IsFilterPass(item2.GetName(NameStyle.Full, 1)))
3105 {
3106 case Window.SaveData.FilterResult.PassWithoutFurtherTest:
3107 Pick(item2.Thing);
3108 continue;
3109 case Window.SaveData.FilterResult.Block:
3110 continue;
3111 }
3112 }
3113 if (dataPick.advDistribution)
3114 {
3115 foreach (int cat in dataPick.cats)
3116 {
3117 if (item2.category.uid == cat)
3118 {
3119 Pick(item2.Thing);
3120 }
3121 }
3122 }
3123 else if (!dataPick.flag.HasFlag(containerFlag))
3124 {
3125 Pick(item2.Thing);
3126 }
3127 }
3128 else
3129 {
3130 Pick(item2.Thing);
3131 }
3132 }
3133 }
3134 if (EClass._zone.IsRegion)
3135 {
3137 if (cell3?.zone != null && !cell3.zone.HiddenInRegionMap && (!(cell3.zone is Zone_Field) || cell3.zone.children.Count > 0 || cell3.zone.IsPCFaction))
3138 {
3139 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() ?? "");
3140 }
3141 if (pos.matFloor.alias == "snow" && EClass.rnd(3) == 0)
3142 {
3144 Msg.Say(Lang.GetList("walk_snow").RandomItem());
3145 }
3146 else if (EClass.world.weather.CurrentCondition == Weather.Condition.RainHeavy && EClass.rnd(3) == 0)
3147 {
3149 Msg.Say(Lang.GetList("walk_storm").RandomItem());
3150 }
3151 }
3153 }
3154 if (IsPCC)
3155 {
3156 int num6 = Mathf.Abs(cell2.topHeight - cell.topHeight);
3157 if ((num6 >= 3 && lastPos.sourceBlock.tileType.slopeHeight == 0 && newPoint.sourceBlock.tileType.slopeHeight == 0) || cell2.hasDoorBoat || cell.hasDoorBoat)
3158 {
3159 renderer.PlayAnime((cell2.topHeight >= cell.topHeight) ? AnimeID.JumpDown : ((num6 >= 6) ? AnimeID.Jump : AnimeID.JumpSmall));
3160 }
3161 else
3162 {
3163 float surfaceHeight = cell2.GetSurfaceHeight();
3164 float surfaceHeight2 = cell.GetSurfaceHeight();
3165 num6 = (int)Mathf.Abs((surfaceHeight - surfaceHeight2) * 100f);
3166 if (num6 >= 15)
3167 {
3168 renderer.PlayAnime((surfaceHeight >= surfaceHeight2) ? AnimeID.JumpDown : ((num6 >= 40) ? AnimeID.Jump : AnimeID.JumpSmall));
3169 }
3170 }
3171 }
3172 lastPos.Things.ForeachReverse(delegate(Thing t)
3173 {
3174 t.trait.OnSteppedOut(this);
3175 });
3176 if (!IsPC)
3177 {
3178 pos.Things.ForeachReverse(delegate(Thing t)
3179 {
3180 t.trait.OnStepped(this);
3181 });
3182 }
3183 if (CanDestroyPath())
3184 {
3186 }
3187 if (IsPC)
3188 {
3189 if (renderer.anime == null && renderer.replacer != null)
3190 {
3192 }
3194 {
3195 if (!FLOOR.IsTatami(pos.cell.sourceSurface.id) && pos.cell.room == null)
3196 {
3197 EClass.player.flags.isShoesOff = false;
3198 EClass.pc.Say("shoes_on", EClass.pc);
3199 EClass.pc.SetPCCState(PCCState.Normal);
3200 }
3201 }
3202 else if (FLOOR.IsTatami(pos.cell.sourceSurface.id) && pos.cell.room != null)
3203 {
3204 EClass.player.flags.isShoesOff = true;
3205 EClass.pc.Say("shoes_off", EClass.pc);
3206 EClass.pc.SetPCCState(PCCState.ShoesOff);
3207 }
3208 }
3209 bool flag7 = flag5 || EClass._zone.IsUnderwater;
3210 if (wasInWater != flag7)
3211 {
3212 wasInWater = flag7;
3213 RefreshSpeed();
3214 }
3215 hasMovedThisTurn = true;
3216 return MoveResult.Success;
3217 }
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:2643
bool IsDecayed
Definition: Card.cs:2315
virtual bool isThing
Definition: Card.cs:2107
int EvalueMax(int ele, int min=0)
Definition: Card.cs:2613
SourceMaterial.Row material
Definition: Card.cs:2077
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:6343
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:6903
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:4117
MoveResult
Definition: Card.cs:13
bool IsInstalled
Definition: Card.cs:2409
virtual Thing Thing
Definition: Card.cs:2084
int Evalue(int ele)
Definition: Card.cs:2599
int Dist(Card c)
Definition: Card.cs:7867
void ModExp(string alias, int a)
Definition: Card.cs:2676
SourceCategory.Row category
Definition: Card.cs:2075
virtual RenderRow TileRow
Definition: Card.cs:2161
bool isLeashed
Definition: Card.cs:843
bool HasElement(int ele, bool includeNagative=false)
Definition: Card.cs:6090
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:7020
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:3721
bool wasInWater
Definition: Chara.cs:150
bool IsLevitating
Definition: Chara.cs:599
AIAct ai
Definition: Chara.cs:204
override bool IsPC
Definition: Chara.cs:626
bool isDrunk
Definition: Chara.cs:126
Party party
Definition: Chara.cs:43
bool CanDestroyPath()
Definition: Chara.cs:2475
bool IsInCombat
Definition: Chara.cs:878
bool HasCondition(string alias)
Definition: Chara.cs:9581
AIAct SetAI(AIAct g)
Definition: Chara.cs:9050
bool IsIdle
Definition: Chara.cs:867
override bool IsDisabled
Definition: Chara.cs:587
bool hasMovedThisTurn
Definition: Chara.cs:178
override bool isSynced
Definition: Chara.cs:705
bool CanMoveTo(Point p, bool allowDestroyPath=true)
Definition: Chara.cs:2488
void DestroyPath(Point pos)
Definition: Chara.cs:3219
override bool IsPCFaction
Definition: Chara.cs:685
float actTime
Definition: Chara.cs:180
override int MaxHP
Definition: Chara.cs:722
Zone currentZone
Definition: Chara.cs:257
bool CanReplace(Chara c)
Definition: Chara.cs:3330
Point lastPos
Definition: Chara.cs:90
void MoveByForce(Point newPoint, Card c=null, bool checkWall=false)
Definition: Chara.cs:2673
Stats burden
Definition: Chara.cs:1170
Chara parasite
Definition: Chara.cs:30
Chara ride
Definition: Chara.cs:27
void RefreshSpeed(Element.BonusInfo info=null)
Definition: Chara.cs:1905
MoveResult TryMoveTowards(Point p)
Definition: Chara.cs:2681
void SyncRide()
Definition: Chara.cs:3989
bool isDead
Definition: Chara.cs:391
override void LookAt(Card c)
Definition: Chara.cs:3585
bool isConfused
Definition: Chara.cs:128
override bool IsPCC
Definition: Chara.cs:696
void TryPush(Point point)
Definition: Chara.cs:3263
void SetPCCState(PCCState state)
Definition: Chara.cs:6804
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:662
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:358
int distanceTravel
Definition: Player.cs:916
Flags flags
Definition: Player.cs:1117
Window.SaveData dataPick
Definition: Player.cs:1057
bool regionMoveWarned
Definition: Player.cs:1180
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:1106
virtual bool IsChangeFloorHeight
Definition: Trait.cs:74
virtual void OnStepped(Chara c)
Definition: Trait.cs:1102
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:289
override int DangerLv
Definition: Zone.cs:110
bool IsPCFaction
Definition: Zone.cs:475
virtual bool IsUnderwater
Definition: Zone.cs:271
virtual bool KeepAllyDistance
Definition: Zone.cs:304
virtual bool HiddenInRegionMap
Definition: Zone.cs:415
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 7368 of file Chara.cs.

7369 {
7370 EClass.Sound.Play("pop_drama");
7371 if (book == "_chara" && IsPC)
7372 {
7373 step = "pc";
7374 }
7375 if (id == "lomias")
7376 {
7378 }
7379 return LayerDrama.Activate(book, sheet, step, this, null, tag);
7380 }
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:10
static void GetAchievement(ID_Achievement id)
Definition: Steam.cs:51

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

◆ AddCondition() [1/2]

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

Definition at line 9425 of file Chara.cs.

9426 {
9427 c.owner = this;
9428 if (!(c is ConBurning))
9429 {
9430 if (c is ConBleed && ResistLv(964) >= 3)
9431 {
9432 return null;
9433 }
9434 }
9435 else if (ResistLv(950) >= 3)
9436 {
9437 return null;
9438 }
9440 {
9441 if (c.GainResistFactor >= 400)
9442 {
9443 c.power /= 2;
9444 }
9445 ResistCon(c);
9446 if (c.power <= 0)
9447 {
9448 return null;
9449 }
9450 }
9451 if (!force)
9452 {
9453 if (c.source.negate.Length != 0)
9454 {
9455 string[] negate = c.source.negate;
9456 foreach (string text in negate)
9457 {
9458 if (HasElement(text))
9459 {
9460 return null;
9461 }
9462 }
9463 }
9464 Element defenseAttribute = c.GetDefenseAttribute(this);
9465 if (defenseAttribute != null)
9466 {
9467 c.power = 100 * c.power / Mathf.Max(100 + defenseAttribute.Value, 1);
9468 }
9469 if (c.source.resistance.Length != 0)
9470 {
9471 int num = ResistLv(EClass.sources.elements.alias[c.source.resistance[0]].id);
9472 if (num > 0)
9473 {
9474 c.power /= num * num + 1;
9475 if (c.power <= 40)
9476 {
9477 return null;
9478 }
9479 }
9480 }
9481 c.power = c.EvaluatePower(c.power);
9482 if (c.power <= 0)
9483 {
9484 return null;
9485 }
9486 }
9487 int num2 = c.EvaluateTurn(c.power);
9488 if (num2 == 0)
9489 {
9490 return null;
9491 }
9492 for (int j = 0; j < conditions.Count; j++)
9493 {
9494 if (conditions[j].id != c.id)
9495 {
9496 continue;
9497 }
9498 if (c.Type == ConditionType.Stance || c.IsToggle)
9499 {
9500 conditions[j].Kill();
9501 return null;
9502 }
9503 if (conditions[j].CanStack(c))
9504 {
9505 if (conditions[j].ShouldOverride(c))
9506 {
9507 if (conditions[j].IsOverrideConditionMet(c, num2))
9508 {
9509 conditions[j].Kill(silent: true);
9510 continue;
9511 }
9512 return null;
9513 }
9514 if (CanGainConResist)
9515 {
9516 AddResistCon(c);
9517 }
9518 conditions[j].OnStacked(c.power);
9519 conditions[j].OnStartOrStack();
9520 conditions[j].PlayEffect();
9521 }
9522 if (!conditions[j].AllowMultipleInstance)
9523 {
9524 return null;
9525 }
9526 }
9527 foreach (Condition condition in conditions)
9528 {
9529 if (condition.TryNullify(c))
9530 {
9531 return null;
9532 }
9533 }
9534 c.value = num2;
9535 conditions.Add(c);
9536 if (CanGainConResist)
9537 {
9538 AddResistCon(c);
9539 }
9540 c.SetOwner(this);
9541 c.Start();
9542 SetDirtySpeed();
9543 if (c.ShouldRefresh)
9544 {
9545 Refresh();
9546 }
9547 if (c.CancelAI)
9548 {
9549 ai.Cancel();
9550 }
9551 if (IsPC && c.ConsumeTurn && !EClass.pc.isRestrained)
9552 {
9554 }
9555 if (c.SyncRide && (ride != null || parasite != null))
9556 {
9557 if (ride != null)
9558 {
9560 }
9561 if (parasite != null)
9562 {
9564 }
9565 }
9566 return c;
9567 }
ConditionType
Definition: ConditionType.cs:2
virtual Status Cancel()
Definition: AIAct.cs:305
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:6085
void SetDirtySpeed()
Definition: Chara.cs:1896
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:9420
bool CanGainConResist
Definition: Chara.cs:1187
void AddResistCon(Condition con)
Definition: Chara.cs:9834
void ResistCon(Condition con)
Definition: Chara.cs:9854
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:2106
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 9415 of file Chara.cs.

9415 : Condition
9416 {
9417 return AddCondition(typeof(T).Name, p, force);
9418 }
string Name
Definition: Card.cs:2165

◆ AddCooldown()

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

Definition at line 8831 of file Chara.cs.

8832 {
8833 if (_cooldowns == null)
8834 {
8835 _cooldowns = new List<int>();
8836 }
8837 if (turns != 0)
8838 {
8839 _cooldowns.Add(idEle * 1000 + turns);
8840 return;
8841 }
8842 SourceElement.Row row = EClass.sources.elements.map[idEle];
8843 if (row.cooldown > 0)
8844 {
8845 _cooldowns.Add(idEle * 1000 + row.cooldown);
8846 }
8847 }
List< int > _cooldowns
Definition: Chara.cs:58

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

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

◆ AddFoodHistory()

void Chara.AddFoodHistory ( Thing  food)
inline

Definition at line 10324 of file Chara.cs.

10325 {
10326 if (!IsPCFaction || !IsGlobal)
10327 {
10328 _historyFood = null;
10329 return;
10330 }
10331 if (_historyFood == null)
10332 {
10333 _historyFood = new List<List<string>>
10334 {
10335 new List<string>()
10336 };
10337 }
10338 if (_historyFood[0].Count < 5)
10339 {
10340 _historyFood[0].Add(food.id);
10341 }
10342 }
override bool IsGlobal
Definition: Chara.cs:624
List< List< string > > _historyFood
Definition: Chara.cs:64

References food.

Referenced by FoodEffect.Proc().

◆ AddHobby()

void Chara.AddHobby ( int  id)
inline

Definition at line 9250 of file Chara.cs.

9251 {
9252 foreach (int hobby in _hobbies)
9253 {
9254 if (hobby == id)
9255 {
9256 return;
9257 }
9258 }
9259 _hobbies.Add(id);
9260 }
List< int > _hobbies
Definition: Chara.cs:49

◆ AddRandomBodyPart()

void Chara.AddRandomBodyPart ( bool  msg = false)
inline

Definition at line 2236 of file Chara.cs.

2237 {
2238 int ele = new int[9] { 30, 31, 33, 35, 35, 36, 34, 37, 39 }.RandomItem();
2239 body.AddBodyPart(ele);
2240 if (msg)
2241 {
2242 Say("gain_bodyparts", this, Element.Get(ele).GetName().ToLower());
2243 PlaySound("offering");
2244 }
2245 }
void AddBodyPart(int ele, Thing thing=null)
Definition: CharaBody.cs:283
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 9834 of file Chara.cs.

9835 {
9836 if (con.power > 0 && con.GainResistFactor > 0)
9837 {
9838 int key = con.id;
9839 if (resistCon == null)
9840 {
9841 resistCon = new Dictionary<int, int>();
9842 }
9843 if (resistCon.ContainsKey(key))
9844 {
9845 resistCon[key] += con.power * con.GainResistFactor / 100;
9846 }
9847 else
9848 {
9849 resistCon[key] = con.power * con.GainResistFactor / 100;
9850 }
9851 }
9852 }
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 9262 of file Chara.cs.

9263 {
9264 foreach (int work in _works)
9265 {
9266 if (work == id)
9267 {
9268 return;
9269 }
9270 }
9271 _works.Add(id);
9272 }
List< int > _works
Definition: Chara.cs:52

◆ ApplyDeathPenalty()

void Chara.ApplyDeathPenalty ( )
inline

Definition at line 5329 of file Chara.cs.

5330 {
5331 if (!IsPC)
5332 {
5333 return;
5334 }
5335 int currency = GetCurrency();
5336 if (currency > 0)
5337 {
5338 int num = currency / 3 + EClass.rnd(currency / 3 + 1);
5339 if (num <= 0)
5340 {
5341 num = 1;
5342 }
5343 Msg.Say("panaltyMoney", this, Lang._currency(num));
5344 ModCurrency(-num);
5346 }
5347 foreach (Element value in EClass.pc.elements.dict.Values)
5348 {
5349 if (EClass.rnd(5) == 0 && value.IsMainAttribute)
5350 {
5351 EClass.pc.elements.ModExp(value.id, -500f);
5352 }
5353 }
5354 }
@ currency
ElementContainerCard elements
Definition: Card.cs:42
int GetCurrency(string id="money")
Definition: Card.cs:4029
void ModCurrency(int a, string id="money")
Definition: Card.cs:4015
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:1994

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 2071 of file Chara.cs.

2072 {
2073 switch (tag)
2074 {
2075 case EditorTag.HostilityNeutral:
2076 {
2077 Hostility hostility2 = (base.c_originalHostility = Hostility.Neutral);
2078 this.hostility = hostility2;
2079 break;
2080 }
2081 case EditorTag.HostilityEnemy:
2082 {
2083 Hostility hostility2 = (base.c_originalHostility = Hostility.Enemy);
2084 this.hostility = hostility2;
2085 break;
2086 }
2087 case EditorTag.HostilityFriend:
2088 {
2089 Hostility hostility2 = (base.c_originalHostility = Hostility.Friend);
2090 this.hostility = hostility2;
2091 break;
2092 }
2093 case EditorTag.Male:
2094 bio.SetGender(2);
2095 base.c_idPortrait = Portrait.GetRandomPortrait(2, GetIdPortraitCat());
2096 break;
2097 case EditorTag.Female:
2098 bio.SetGender(1);
2099 base.c_idPortrait = Portrait.GetRandomPortrait(1, GetIdPortraitCat());
2100 break;
2101 case EditorTag.baby:
2102 SetFeat(1232);
2103 break;
2104 }
2105 base.ApplyEditorTags(tag);
2106 }
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:10059
string GetIdPortraitCat()
Definition: Chara.cs:8294
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 2198 of file Chara.cs.

2199 {
2200 elements.ApplyElementMap(base.uid, SourceValueType.Chara, job.elementMap, base.DefaultLV, remove, applyFeat: true);
2201 if (IsPCC)
2202 {
2203 EClass.game.uniforms.Apply(pccData, job.id, base.IsMale, canUseOtherGender: true);
2204 }
2205 }
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 2284 of file Chara.cs.

2285 {
2286 string[] array = race.figure.Split('|');
2287 foreach (string s in array)
2288 {
2289 int num = ParseBodySlot(s);
2290 if (num != -1)
2291 {
2292 if (remove)
2293 {
2294 body.RemoveBodyPart(num);
2295 }
2296 else
2297 {
2298 body.AddBodyPart(num);
2299 }
2300 }
2301 }
2303 elements.ApplyElementMap(base.uid, SourceValueType.Chara, race.elementMap, base.DefaultLV, remove, applyFeat: true);
2304 if (!remove && race.id == "bike" && id != "bike_cub")
2305 {
2306 SetFeat(1423, (id == "chara" || id == "player") ? 10 : (1 + EClass.rnd(10)));
2307 }
2308 }
void RefreshBodyParts()
Definition: CharaBody.cs:309
void RemoveBodyPart(int ele)
Definition: CharaBody.cs:338
int ParseBodySlot(string s)
Definition: Chara.cs:2219

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 2379 of file Chara.cs.

2380 {
2381 owner?.Say("summon_vanish", this);
2382 pos.PlayEffect("vanish");
2383 pos.PlaySound("vanish");
2384 pos.PlayEffect("teleport");
2385 Destroy();
2386 }
void Destroy()
Definition: Card.cs:5132
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().

◆ BanishAllMinions()

void Chara.BanishAllMinions ( )
inline

Definition at line 2416 of file Chara.cs.

2417 {
2418 List<Chara> list = new List<Chara>();
2419 foreach (Chara chara in EClass._map.charas)
2420 {
2421 if (chara.IsMinion && chara.master == this)
2422 {
2423 list.Add(chara);
2424 }
2425 }
2426 foreach (Chara item in list)
2427 {
2428 item.Banish(this);
2429 }
2430 }
override bool IsMinion
Definition: Chara.cs:641
Chara master
Definition: Chara.cs:88
List< Chara > charas
Definition: Map.cs:81

References EClass._map, Map.charas, IsMinion, item, and master.

◆ CalcBurden()

void Chara.CalcBurden ( )
inline

Definition at line 1864 of file Chara.cs.

1865 {
1866 int num = base.ChildrenWeight * 100 / Mathf.Max(1, WeightLimit);
1867 if (num < 0)
1868 {
1869 num = 1000;
1870 }
1872 {
1873 num = 0;
1874 }
1875 burden.Set(num);
1876 SetDirtySpeed();
1877 }
override int WeightLimit
Definition: Chara.cs:724
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 6245 of file Chara.cs.

6246 {
6247 if (!(e is Spell))
6248 {
6249 return 100;
6250 }
6251 if (!IsPC)
6252 {
6253 int num2 = 95;
6254 if (host != null)
6255 {
6256 if (host.ride == this)
6257 {
6258 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.EvalueRiding()));
6259 }
6260 if (host.parasite == this)
6261 {
6262 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.Evalue(227)));
6263 }
6264 }
6265 return num2;
6266 }
6267 int num3 = Evalue(304);
6268 if (!IsPCFaction)
6269 {
6270 num3 = Mathf.Max(num3, base.LV + 5);
6271 }
6272 int num4 = 0;
6273 int num5 = 0;
6274 bool num6 = GetArmorSkill() == 122;
6275 AttackStyle attackStyle = body.GetAttackStyle();
6276 if (num6)
6277 {
6278 num4 = 20 - Evalue(122) / 5;
6279 num5 += 10 - Evalue(1654) * 4;
6280 }
6281 else
6282 {
6283 num4 = 10 - Evalue(120) / 5;
6284 }
6285 if (num4 < 5)
6286 {
6287 num4 = 5;
6288 }
6289 if (ride != null)
6290 {
6291 num4 += 5;
6292 }
6293 if (parasite != null)
6294 {
6295 num4 += 10;
6296 }
6297 if (attackStyle == AttackStyle.TwoWield)
6298 {
6299 num4 += 5;
6300 }
6301 if (attackStyle == AttackStyle.Shield)
6302 {
6303 num4 += 10;
6304 num5 += 20 - Evalue(1654) * 8;
6305 }
6306 if (isConfused)
6307 {
6308 num4 += 10000;
6309 }
6310 if (HasCondition<ConDim>())
6311 {
6312 num4 += ((Evalue(1654) >= 3) ? 1500 : 2500);
6313 }
6314 if (num > 1)
6315 {
6316 num4 += 5 * num;
6317 }
6318 if (num5 < 0)
6319 {
6320 num5 = 0;
6321 }
6322 return Mathf.Clamp(100 + e.Value - 10 - e.source.LV * e.source.cost[0] * num4 / Mathf.Max(10 + num3 * 10, 1), 0, 100 - num5);
6323 }
AttackStyle
Definition: AttackStyle.cs:2
AttackStyle GetAttackStyle()
Definition: CharaBody.cs:479
override int GetArmorSkill()
Definition: Chara.cs:8014
int EvalueRiding()
Definition: Chara.cs:6236
SourceElement.Row source
Definition: ELEMENT.cs:278
Definition: SPELL.cs:626

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 2052 of file Chara.cs.

2053 {
2054 int num = base.END;
2055 int num2 = 0;
2056 foreach (Element value in elements.dict.Values)
2057 {
2058 if (value.source.category == "skill")
2059 {
2060 num = ((!IsPC) ? (num + Mathf.Max(value.ValueWithoutLink, 0)) : (num + Mathf.Max(value.vBase, 0)));
2061 }
2062 }
2063 num2 = EClass.curve(num, 30, 10, 60);
2064 if (num2 < 10)
2065 {
2066 num2 = 10;
2067 }
2068 _maxStamina = num2 + 15;
2069 }
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 6547 of file Chara.cs.

6548 {
6549 foreach (Chara chara in EClass._map.charas)
6550 {
6551 if (!chara.IsPCFaction && chara.OriginalHostility == OriginalHostility && (fanatic || Dist(chara) <= 6) && (EClass.rnd(3) != 0 || fanatic))
6552 {
6553 chara.GoHostile(tg);
6554 }
6555 }
6556 }
Hostility OriginalHostility
Definition: Chara.cs:473
void GoHostile(Card _tg)
Definition: Chara.cs:6441

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 8382 of file Chara.cs.

8383 {
8384 if (things.IsFull())
8385 {
8386 return false;
8387 }
8388 if (t.c_isImportant)
8389 {
8390 return false;
8391 }
8392 if (t.id == "1084")
8393 {
8394 return true;
8395 }
8396 if (t.trait is TraitBookExp)
8397 {
8398 return true;
8399 }
8400 if (t.trait.CanOnlyCarry || !t.trait.CanBeDestroyed || t.trait.CanExtendBuild || t.rarity == Rarity.Artifact || t.IsContainer)
8401 {
8402 return false;
8403 }
8404 return true;
8405 }
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:2115
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 8361 of file Chara.cs.

8362 {
8364 {
8365 return true;
8366 }
8367 if (!IsValidGiftWeight(t, num))
8368 {
8369 return false;
8370 }
8371 if (!skipImportantCheck && t.c_isImportant)
8372 {
8373 return false;
8374 }
8375 if ((t.category.IsChildOf("furniture") || t.category.IsChildOf("junk")) && !HasElement(1411))
8376 {
8377 return false;
8378 }
8379 return true;
8380 }
bool IsValidGiftWeight(Card t, int num=-1)
Definition: Chara.cs:8351

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 4326 of file Chara.cs.

4327 {
4328 return true;
4329 }

◆ CanBeTempAlly()

bool Chara.CanBeTempAlly ( Chara  c)
inline

Definition at line 2366 of file Chara.cs.

2367 {
2368 if (IsPCFaction || IsGlobal || IsMinion || IsMultisize || EClass._zone.CountMinions(c) > c.MaxSummon || base.rarity >= Rarity.Legendary)
2369 {
2370 return false;
2371 }
2372 if (HasElement(1222))
2373 {
2374 return false;
2375 }
2376 return true;
2377 }
int MaxSummon
Definition: Chara.cs:728
override bool IsMultisize
Definition: Chara.cs:720
int CountMinions(Chara c)
Definition: Zone.cs:3777

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 8814 of file Chara.cs.

8815 {
8816 if (IsPC || base.isScaled || HasElement(1273))
8817 {
8818 return false;
8819 }
8820 if (!EClass.debug.godMode)
8821 {
8822 if (base.c_daysWithPC > 360)
8823 {
8824 return affinity.CanSleepBeside();
8825 }
8826 return false;
8827 }
8828 return true;
8829 }
bool CanSleepBeside()
Definition: Affinity.cs:79
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 2475 of file Chara.cs.

2476 {
2477 if (!IsMultisize)
2478 {
2479 if (base.rarity >= Rarity.Superior && !base.IsPCFactionOrMinion && ai is GoalCombat && !EClass._zone.IsPCFaction)
2480 {
2481 return !(EClass._zone is Zone_Town);
2482 }
2483 return false;
2484 }
2485 return true;
2486 }

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

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

◆ CanDuplicate()

bool Chara.CanDuplicate ( )
inline

Definition at line 1792 of file Chara.cs.

1793 {
1794 if (EClass._zone.IsRegion || HasCondition<ConPoison>() || HasCondition<ConConfuse>() || HasCondition<ConDim>() || HasCondition<ConParalyze>() || HasCondition<ConSleep>() || HasCondition<ConBurning>() || HasCondition<ConFreeze>() || HasCondition<ConMiasma>() || corruption >= 100)
1795 {
1796 return false;
1797 }
1799 {
1800 return false;
1801 }
1802 string text = id;
1803 if (!(text == "mech_scarab"))
1804 {
1805 if (text == "spider_queen" && (pos.cell.light > 0 || pos.IsSunLit))
1806 {
1807 return false;
1808 }
1809 }
1810 else if (isSynced || pos.cell.light > 0 || (!EClass._map.IsIndoor && !pos.cell.HasRoof && !EClass.world.date.IsNight))
1811 {
1812 return false;
1813 }
1814 return true;
1815 }
byte light
Definition: Cell.cs:60
bool HasRoof
Definition: Cell.cs:648
int corruption
Definition: Chara.cs:379
int CurrentGeneSlot
Definition: Chara.cs:1097
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 7741 of file Chara.cs.

7742 {
7743 if (t.IsDecayed && !HasElement(480))
7744 {
7745 return false;
7746 }
7747 if (HasElement(1250) && !t.HasElement(710))
7748 {
7749 return false;
7750 }
7751 if (shouldEat && (!(t.trait is TraitFoodPrepared) || t.c_isImportant))
7752 {
7753 return false;
7754 }
7755 if (!t.IsNegativeGift && !t.HasTag(CTAG.ignoreUse) && !t.isEquipped)
7756 {
7757 return t.trait.CanEat(this);
7758 }
7759 return false;
7760 }
CTAG
Definition: CTAG.cs:2
bool IsNegativeGift
Definition: Card.cs:2424
bool HasTag(CTAG tag)
Definition: Card.cs:2623
bool isEquipped
Definition: Thing.cs:17
virtual bool CanEat(Chara c)
Definition: Trait.cs:1004

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 7913 of file Chara.cs.

7914 {
7915 return !body.IsTooHeavyToEquip(t);
7916 }
bool IsTooHeavyToEquip(Thing thing)
Definition: CharaBody.cs:168

References CharaBody.IsTooHeavyToEquip().

Referenced by GoalAutoCombat.TryUseRanged().

◆ CanInsult()

bool Chara.CanInsult ( )
inline

Definition at line 8282 of file Chara.cs.

8283 {
8284 foreach (ActList.Item item in ability.list.items)
8285 {
8286 if (item.act.id == 6630)
8287 {
8288 return true;
8289 }
8290 }
8291 return false;
8292 }
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 2582 of file Chara.cs.

2583 {
2584 return CanInteractTo(c.pos);
2585 }
bool CanInteractTo(Card c)
Definition: Chara.cs:2582

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 2587 of file Chara.cs.

2588 {
2589 if (!p.IsValid)
2590 {
2591 return false;
2592 }
2593 if (EClass._map.cells[p.x, p.z].blocked)
2594 {
2595 return true;
2596 }
2597 if (!IsMultisize)
2598 {
2599 int num = ((p.z >= pos.z) ? ((p.x > pos.x) ? 1 : ((p.z > pos.z) ? 2 : 3)) : 0);
2600 if (EClass._map.cells[pos.x, pos.z].weights[num] == 0)
2601 {
2602 return false;
2603 }
2604 if (p.x != pos.x && p.z != pos.z)
2605 {
2606 Cell[,] cells = EClass._map.cells;
2607 int x = p.x;
2608 int z = pos.z;
2609 int num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2610 if (cells[pos.x, pos.z].weights[num2] == 0)
2611 {
2612 return false;
2613 }
2614 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2615 if (cells[p.x, p.z].weights[num2] == 0)
2616 {
2617 return false;
2618 }
2619 x = pos.x;
2620 z = p.z;
2621 num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2622 if (cells[pos.x, pos.z].weights[num2] == 0)
2623 {
2624 return false;
2625 }
2626 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2627 if (cells[p.x, p.z].weights[num2] == 0)
2628 {
2629 return false;
2630 }
2631 }
2632 }
2633 return true;
2634 }
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 4321 of file Chara.cs.

4322 {
4323 return true;
4324 }

Referenced by HotItemNoItem._TrySetAct().

◆ CanMoveTo()

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

Definition at line 2488 of file Chara.cs.

2489 {
2490 if (!p.IsValid)
2491 {
2492 return false;
2493 }
2494 int num = ((p.z >= pos.z) ? ((p.x > pos.x) ? 1 : ((p.z > pos.z) ? 2 : 3)) : 0);
2495 if (allowDestroyPath && CanDestroyPath())
2496 {
2497 if (!p.IsInBounds)
2498 {
2499 return false;
2500 }
2501 }
2502 else
2503 {
2504 if (EClass._map.cells[p.x, p.z].blocked || EClass._map.cells[pos.x, pos.z].weights[num] == 0)
2505 {
2506 return false;
2507 }
2508 if (p.x != pos.x && p.z != pos.z)
2509 {
2510 Cell[,] cells = EClass._map.cells;
2511 int x = p.x;
2512 int z = pos.z;
2513 int num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2514 if (cells[pos.x, pos.z].weights[num2] == 0)
2515 {
2516 return false;
2517 }
2518 if (cells[x, z].blocked)
2519 {
2520 return false;
2521 }
2522 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2523 if (cells[p.x, p.z].weights[num2] == 0)
2524 {
2525 return false;
2526 }
2527 x = pos.x;
2528 z = p.z;
2529 num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2530 if (cells[pos.x, pos.z].weights[num2] == 0)
2531 {
2532 return false;
2533 }
2534 if (cells[x, z].blocked)
2535 {
2536 return false;
2537 }
2538 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2539 if (cells[p.x, p.z].weights[num2] == 0)
2540 {
2541 return false;
2542 }
2543 }
2544 }
2545 if (IsPC)
2546 {
2547 if (IsEnemyOnPath(p))
2548 {
2549 return false;
2550 }
2551 }
2552 else if (p.HasChara && !IsMultisize && !CanReplace(p.FirstChara))
2553 {
2554 return false;
2555 }
2556 return true;
2557 }
bool IsEnemyOnPath(Point p, bool cancelAI=true)
Definition: Chara.cs:2559
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 4331 of file Chara.cs.

4332 {
4333 if (c.isDestroyed)
4334 {
4335 return false;
4336 }
4337 Card rootCard = c.GetRootCard();
4338 if (rootCard.isDestroyed || (rootCard.ExistsOnMap && rootCard.pos.Distance(pos) > 1))
4339 {
4340 return false;
4341 }
4342 if (rootCard != this && things.IsFull(c.Thing))
4343 {
4344 return false;
4345 }
4346 return true;
4347 }
bool isDestroyed
Definition: Card.cs:76
bool ExistsOnMap
Definition: Card.cs:2111
Card GetRootCard()
Definition: Card.cs:3480

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 3330 of file Chara.cs.

3331 {
3333 {
3334 return false;
3335 }
3336 if (IsPC)
3337 {
3338 return true;
3339 }
3340 if (c.IsPC || c.pos.Equals(EClass.pc.pos) || c.host != null)
3341 {
3342 return false;
3343 }
3344 if (!IsHostile(c))
3345 {
3346 if (c.c_uidMaster != 0 || c.isSummon || base.IsPowerful || IsEscorted())
3347 {
3348 return true;
3349 }
3350 if (DestDist < c.DestDist)
3351 {
3352 return true;
3353 }
3354 if (IsPCParty && !c.IsPCParty)
3355 {
3356 return true;
3357 }
3358 if (IsPCFaction && !c.IsPCParty)
3359 {
3360 return true;
3361 }
3362 }
3363 return false;
3364 }
bool IsPCFactionOrMinion
Definition: Card.cs:2300
bool isSummon
Definition: Card.cs:711
int c_uidMaster
Definition: Card.cs:1463
bool noMove
Definition: Card.cs:771
new TraitChara trait
Definition: Chara.cs:505
override bool IsPCParty
Definition: Chara.cs:629
int DestDist
Definition: Chara.cs:1012
bool IsHostile()
Definition: Chara.cs:6646
bool IsEscorted()
Definition: Chara.cs:2459
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 5197 of file Chara.cs.

5198 {
5199 return EClass.world.date.IsExpired(base.c_dateDeathLock);
5200 }
bool IsExpired(int time)
Definition: Date.cs:338

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 1244 of file Chara.cs.

1245 {
1246 if (c == this)
1247 {
1248 return true;
1249 }
1250 if (!c.pos.IsValid)
1251 {
1252 return false;
1253 }
1254 if (c.isChara)
1255 {
1257 {
1258 return true;
1259 }
1260 if (c.isHidden && c != this && !canSeeInvisible)
1261 {
1262 return false;
1263 }
1264 }
1265 if (IsPC)
1266 {
1267 if (fov != null)
1268 {
1269 return fov.lastPoints.ContainsKey(c.pos.index);
1270 }
1271 return false;
1272 }
1273 return true;
1274 }
virtual Chara Chara
Definition: Card.cs:2096
Fov fov
Definition: Card.cs:58
virtual bool isChara
Definition: Card.cs:2109
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 1285 of file Chara.cs.

1286 {
1287 if (dist == -1)
1288 {
1289 dist = pos.Distance(p);
1290 }
1291 if (dist > GetSightRadius())
1292 {
1293 return false;
1294 }
1295 if (IsPC)
1296 {
1297 if (fov != null)
1298 {
1299 return fov.lastPoints.ContainsKey(p.index);
1300 }
1301 return false;
1302 }
1303 return Los.IsVisible(pos, p);
1304 }
int GetSightRadius()
Definition: Card.cs:6597
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 1227 of file Chara.cs.

1228 {
1229 if (!p.IsValid || p.IsHidden)
1230 {
1231 return false;
1232 }
1233 if (IsPC)
1234 {
1235 if (fov != null)
1236 {
1237 return fov.lastPoints.ContainsKey(p.index);
1238 }
1239 return false;
1240 }
1241 return true;
1242 }
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 1325 of file Chara.cs.

1326 {
1327 if (EClass._zone.events.GetEvent<ZoneEventQuest>() != null)
1328 {
1329 return false;
1330 }
1331 if (!EClass.debug.godMode && sleepiness.GetPhase() == 0)
1332 {
1333 return stamina.GetPhase() <= 1;
1334 }
1335 return true;
1336 }
Stats sleepiness
Definition: Chara.cs:1182
Stats stamina
Definition: Chara.cs:1172
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 2207 of file Chara.cs.

2208 {
2209 ApplyJob(remove: true);
2210 base.c_idJob = idNew;
2211 _job = null;
2212 ApplyJob();
2213 if (IsPCC)
2214 {
2215 PCC.Get(pccData).Build();
2216 }
2217 }
void ApplyJob(bool remove=false)
Definition: Chara.cs:2198
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 7165 of file Chara.cs.

7166 {
7167 memberType = type;
7168 }
FactionMemberType memberType
Definition: Chara.cs:46

◆ ChangeRace()

void Chara.ChangeRace ( string  idNew)
inline

Definition at line 2310 of file Chara.cs.

2311 {
2312 ApplyRace(remove: true);
2313 base.c_idRace = idNew;
2314 _race = null;
2315 ApplyRace();
2316 ChangeMaterial(source.defMat.IsEmpty(race.material));
2317 }
@ ChangeMaterial
void ApplyRace(bool remove=false)
Definition: Chara.cs:2284
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 1440 of file Chara.cs.

1441 {
1442 if (r != base.rarity)
1443 {
1444 base.rarity = r;
1445 if (renderer != null && renderer.isSynced)
1446 {
1448 }
1449 base.hp = MaxHP;
1450 }
1451 }
void RefreshExtra()

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

Referenced by ZonePreEnterBout.Execute().

◆ ChooseNewGoal()

void Chara.ChooseNewGoal ( )
inline

Definition at line 8921 of file Chara.cs.

8922 {
8923 if (IsPC && EClass.AdvMode)
8924 {
8925 SetNoGoal();
8926 return;
8927 }
8928 if (IsPCParty || base.noMove)
8929 {
8930 SetAI(new GoalIdle());
8931 return;
8932 }
8933 if ((IsHomeMember() && IsInHomeZone()) || IsGuest())
8934 {
8935 Goal goalFromTimeTable = GetGoalFromTimeTable(EClass.world.date.hour);
8936 if (goalFromTimeTable != null)
8937 {
8938 SetAI(goalFromTimeTable);
8939 if (goalFromTimeTable is GoalWork)
8940 {
8941 goalFromTimeTable.Tick();
8942 }
8943 return;
8944 }
8945 }
8946 if (goalList.index == -2)
8947 {
8949 }
8950 SetAI(goalList.Next());
8951 }
Status Tick()
Definition: AIAct.cs:366
Goal GetGoalFromTimeTable(int hour)
Definition: Chara.cs:8953
GoalListType goalListType
Definition: Chara.cs:281
AIAct SetNoGoal()
Definition: Chara.cs:9045
bool IsHomeMember()
Definition: Chara.cs:6712
bool IsGuest()
Definition: Chara.cs:6737
GoalList goalList
Definition: Chara.cs:202
bool IsInHomeZone()
Definition: Chara.cs:6717
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 7448 of file Chara.cs.

7449 {
7450 if (map == null)
7451 {
7452 map = EClass._map;
7453 }
7454 foreach (Card item in map.props.installed.all)
7455 {
7456 if (item.trait is TraitBed traitBed && traitBed.IsHolder(this))
7457 {
7458 traitBed.RemoveHolder(this);
7459 }
7460 }
7461 }
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 8693 of file Chara.cs.

8694 {
8695 int num = 0;
8696 for (int num2 = things.Count - 1; num2 >= 0; num2--)
8697 {
8698 Thing thing = things[num2];
8699 if (ShouldThrowAway(thing, type))
8700 {
8701 num += thing.GetPrice(CurrencyType.Money, sell: true, PriceType.Default, this) * thing.Num;
8702 thing.Destroy();
8703 }
8704 }
8705 if (num > 0)
8706 {
8707 ModCurrency(num);
8708 if (type == ClearInventoryType.SellAtTown)
8709 {
8710 Msg.Say("party_sell", this, num.ToString() ?? "");
8711 PlaySound("pay");
8712 }
8713 }
8714 }
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:7472
int Num
Definition: Card.cs:159
bool ShouldThrowAway(Thing t, ClearInventoryType type)
Definition: Chara.cs:8622

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 10538 of file Chara.cs.

10539 {
10540 if (tempElements != null)
10541 {
10543 tempElements = null;
10544 }
10545 }
ElementContainer tempElements
Definition: Chara.cs:36
void SetParent(Card c)

References ElementContainer.SetParent().

◆ CountDebuff()

int Chara.CountDebuff ( )
inline

Definition at line 9610 of file Chara.cs.

9611 {
9612 int num = 0;
9613 foreach (Condition condition in conditions)
9614 {
9615 if (condition.Type == ConditionType.Debuff)
9616 {
9617 num++;
9618 }
9619 }
9620 return num;
9621 }

References BaseStats.Type.

Referenced by GoalCombat.TryUseAbility().

◆ CountNumEaten()

int Chara.CountNumEaten ( Thing  food)
inline

Definition at line 10344 of file Chara.cs.

10345 {
10346 if (_historyFood == null)
10347 {
10348 return -1;
10349 }
10350 int num = 0;
10351 foreach (List<string> item in _historyFood)
10352 {
10353 foreach (string item2 in item)
10354 {
10355 if (item2 == food.id)
10356 {
10357 num++;
10358 }
10359 }
10360 }
10361 return num;
10362 }

References food, and item.

Referenced by FoodEffect.Proc().

◆ CreateReplacement()

Chara Chara.CreateReplacement ( )
inline

Definition at line 8162 of file Chara.cs.

8163 {
8164 Chara chara = CharaGen.Create(id);
8165 chara.c_originalHostility = base.c_originalHostility;
8166 if (chara.c_originalHostility != 0)
8167 {
8168 chara.hostility = chara.c_originalHostility;
8169 }
8170 if (orgPos != null)
8171 {
8172 chara.orgPos = orgPos.Copy();
8173 }
8174 chara.pos = pos.Copy();
8175 chara.isImported = true;
8176 chara.c_editorTags = base.c_editorTags;
8177 chara.c_editorTraitVal = base.c_editorTraitVal;
8178 chara.c_idTrait = base.c_idTrait;
8179 chara.homeZone = homeZone;
8180 return chara;
8181 }
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 6337 of file Chara.cs.

6338 {
6339 Talk("goodBoy");
6340 Say(headpat ? "headpat" : "cuddle", this, c);
6341 c.ShowEmo(Emo.love);
6342 if (EClass.rnd(IsPC ? 100 : 5000) == 0)
6343 {
6344 c.MakeEgg();
6345 }
6346 if (headpat && this != c)
6347 {
6348 if (c.interest > 0)
6349 {
6350 c.ModAffinity(EClass.pc, 1 + EClass.rnd(3));
6351 c.interest -= 20 + EClass.rnd(10);
6352 }
6354 {
6355 foreach (Chara member in party.members)
6356 {
6357 if (!member.IsPC && CanSeeLos(member))
6358 {
6359 member.AddCondition<ConEuphoric>(100 + Evalue(6904) * 5);
6360 }
6361 }
6362 }
6363 }
6364 if (c.Evalue(1221) > 0)
6365 {
6366 int ele = ((c.MainElement == Element.Void) ? 924 : c.MainElement.id);
6367 if (c.id == "hedgehog_ether")
6368 {
6369 ele = 922;
6370 }
6371 Say("reflect_thorne", this, c);
6372 DamageHP(10L, ele, Power, AttackSource.Condition);
6373 }
6374 }
Emo
Definition: Emo.cs:2
virtual int Power
Definition: Card.cs:2323
void ShowEmo(Emo _emo=Emo.none, float duration=0f, bool skipSame=true)
Definition: Card.cs:6311
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
Definition: Card.cs:5790
Element MainElement
Definition: Chara.cs:731
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Definition: Chara.cs:8084
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 9673 of file Chara.cs.

9674 {
9675 bool flag = state == BlessedState.Blessed;
9676 switch (type)
9677 {
9678 case CureType.Heal:
9679 case CureType.Prayer:
9680 CureCondition<ConFear>();
9681 CureCondition<ConBlind>(2 * p / 100 + 5);
9682 CureCondition<ConPoison>(5 * p / 100 + 5);
9683 CureCondition<ConConfuse>(10 * p / 100 + 10);
9684 CureCondition<ConDim>(p / 100 + 5);
9685 CureCondition<ConBleed>(2 * p / 100 + 10);
9686 if (flag)
9687 {
9688 SAN.Mod(-15);
9689 }
9690 break;
9691 case CureType.CureBody:
9692 CureCondition<ConBlind>(5 * p / 100 + 15);
9693 CureCondition<ConPoison>(10 * p / 100 + 15);
9694 CureCondition<ConBleed>(5 * p / 100 + 20);
9695 CureTempElements(p, body: true, mind: false);
9696 break;
9697 case CureType.CureMind:
9698 CureCondition<ConFear>();
9699 CureCondition<ConDim>(3 * p / 100 + 10);
9700 CureTempElements(p, body: false, mind: true);
9701 break;
9702 case CureType.Sleep:
9703 {
9704 for (int num2 = conditions.Count - 1; num2 >= 0; num2--)
9705 {
9706 Condition condition2 = conditions[num2];
9707 if (!(condition2 is ConSleep) && !(condition2 is ConFaint))
9708 {
9709 if (condition2.isPerfume)
9710 {
9711 condition2.Mod(-1, force: true);
9712 }
9713 else if (condition2.Type == ConditionType.Bad || condition2.Type == ConditionType.Debuff)
9714 {
9715 condition2.Kill();
9716 }
9717 }
9718 }
9719 CureCondition<ConWait>();
9720 CureCondition<ConDisease>((EClass.rnd(20) + 10) * p / 100);
9721 bool flag2 = HasCondition<ConAnorexia>();
9722 base.c_vomit -= (flag2 ? 3 : 2) * p / 100;
9723 if (base.c_vomit < 0)
9724 {
9725 base.c_vomit = 0;
9726 if (flag2)
9727 {
9728 RemoveCondition<ConAnorexia>();
9729 }
9730 }
9731 break;
9732 }
9733 case CureType.HealComplete:
9734 case CureType.Death:
9735 case CureType.Jure:
9736 case CureType.Boss:
9737 case CureType.Unicorn:
9738 {
9739 CureTempElements(p * 100, body: true, mind: true);
9740 for (int num = conditions.Count - 1; num >= 0; num--)
9741 {
9742 Condition condition = conditions[num];
9743 if (condition is ConAnorexia && type != CureType.Death && type != CureType.Unicorn && type != CureType.Jure)
9744 {
9745 continue;
9746 }
9747 switch (condition.Type)
9748 {
9749 case ConditionType.Bad:
9750 case ConditionType.Debuff:
9751 case ConditionType.Disease:
9752 condition.Kill();
9753 continue;
9754 case ConditionType.Stance:
9755 if (type == CureType.Death)
9756 {
9757 condition.Kill();
9758 continue;
9759 }
9760 break;
9761 }
9762 if (type == CureType.Death && condition.isPerfume)
9763 {
9764 condition.Kill();
9765 }
9766 }
9767 CureCondition<ConWait>();
9768 CureCondition<ConSleep>();
9769 switch (type)
9770 {
9771 case CureType.Death:
9772 case CureType.Boss:
9773 case CureType.Unicorn:
9774 SAN.Mod(-20);
9775 RemoveCondition<ConBrightnessOfLife>();
9776 RemoveCondition<ConDeathSentense>();
9777 break;
9778 case CureType.Jure:
9779 SAN.Mod(-999);
9780 if (HasElement(1206))
9781 {
9782 SetFeat(1206, 0, msg: true);
9783 }
9784 RemoveCondition<ConBrightnessOfLife>();
9785 RemoveCondition<ConDeathSentense>();
9786 break;
9787 case CureType.CureBody:
9788 case CureType.CureMind:
9789 case CureType.Prayer:
9790 break;
9791 }
9792 break;
9793 }
9794 }
9795 }
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:10508
Stats SAN
Definition: Chara.cs:1184
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 9623 of file Chara.cs.

9623 : Condition
9624 {
9625 T condition = GetCondition<T>();
9626 if (condition != null)
9627 {
9628 condition.value -= v;
9629 if (condition.value <= 0)
9630 {
9631 condition.Kill();
9632 }
9633 }
9634 }
override T GetCondition< T >()
Definition: Chara.cs:9636

◆ CureHost()

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

Definition at line 9660 of file Chara.cs.

9661 {
9662 if (parasite != null)
9663 {
9664 parasite.Cure(type, p, state);
9665 }
9666 if (ride != null)
9667 {
9668 ride.Cure(type, p, state);
9669 }
9670 Cure(type, p, state);
9671 }
void Cure(CureType type, int p=100, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:9673

References Cure().

Referenced by FactionBranch.DailyOutcome().

◆ CureTempElements()

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

Definition at line 10508 of file Chara.cs.

10509 {
10510 if (tempElements != null)
10511 {
10512 if (body)
10513 {
10515 }
10516 if (mind)
10517 {
10519 }
10520 }
10521 void Cure(int[] eles)
10522 {
10523 foreach (int ele in eles)
10524 {
10525 if (tempElements == null)
10526 {
10527 break;
10528 }
10529 Element element = tempElements.GetElement(ele);
10530 if (element != null && element.vBase < 0)
10531 {
10532 ModTempElement(ele, Mathf.Clamp(p / 20 + EClass.rnd(p / 20), 1, -element.vBase));
10533 }
10534 }
10535 }
10536 }
void ModTempElement(int ele, int a, bool naturalDecay=false, bool onlyRenew=false)
Definition: Chara.cs:10416
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 10474 of file Chara.cs.

10475 {
10476 ModTempElement(ele, onlyRenew ? (-p / 20) : (-(p / 100 + EClass.rnd(p / 100 + 1) + 1)), naturalDecay: false, onlyRenew);
10477 }

References EClass.rnd().

◆ DamageTempElements()

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

Definition at line 10462 of file Chara.cs.

10463 {
10464 if (body)
10465 {
10466 DamageTempElement(Element.List_Body.RandomItem(), p, onlyRenew);
10467 }
10468 if (mind)
10469 {
10470 DamageTempElement(Element.List_Mind.RandomItem(), p, onlyRenew);
10471 }
10472 }
void DamageTempElement(int ele, int p, bool onlyRenew=false)
Definition: Chara.cs:10474

References Element.List_Body, and Element.List_Mind.

◆ DestroyPath()

void Chara.DestroyPath ( Point  pos)
inline

Definition at line 3219 of file Chara.cs.

3220 {
3221 bool broke = false;
3222 pos.ForeachMultiSize(base.W, base.H, delegate(Point _p, bool main)
3223 {
3224 if (_p.IsValid)
3225 {
3226 if (_p.HasBlock)
3227 {
3228 EClass._map.MineBlock(_p, recoverBlock: false, this);
3229 if (_p.HasObj)
3230 {
3231 EClass._map.MineObj(_p, null, this);
3232 }
3233 broke = true;
3234 }
3235 if (_p.HasObj && _p.IsBlocked)
3236 {
3237 EClass._map.MineObj(_p, null, this);
3238 broke = true;
3239 }
3240 _p.Things.ForeachReverse(delegate(Thing t)
3241 {
3242 if (t.IsInstalled && (t.trait.IsBlockPath || t.trait.IsDoor))
3243 {
3244 if (t.isNPCProperty && t.trait.CanBeDestroyed)
3245 {
3246 t.Destroy();
3247 }
3248 else if (!t.IsUnique && !t.trait.CanBeDestroyed)
3249 {
3250 t.SetPlaceState(PlaceState.roaming);
3251 }
3252 }
3253 });
3254 }
3255 });
3256 if (broke)
3257 {
3258 Msg.Say("stomp");
3259 Shaker.ShakeCam("stomp");
3260 }
3261 }
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
bool IsUnique
Definition: Card.cs:2117
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 5392 of file Chara.cs.

5393 {
5394 combatCount = 0;
5395 if (isDead)
5396 {
5397 return;
5398 }
5399 if (host != null)
5400 {
5401 base.hp = -1;
5402 if ((uint)(attackSource - 17) > 1u)
5403 {
5404 AddCondition<ConFaint>(200, force: true);
5405 return;
5406 }
5407 ActRide.Unride(host, this);
5408 }
5409 bool isInActiveZone = IsInActiveZone;
5410 if (isInActiveZone)
5411 {
5412 if (id == "putty" && origin != null && origin.IsPCParty)
5413 {
5415 }
5416 if (IsPC)
5417 {
5419 }
5420 if (base.isSummon)
5421 {
5422 if (id == "tsunami")
5423 {
5424 pos.PlaySound("water");
5425 }
5426 else
5427 {
5428 Say("summon_vanish", this);
5429 pos.PlayEffect("vanish");
5430 pos.PlaySound("vanish");
5431 }
5432 Destroy();
5433 return;
5434 }
5435 if ((uint)(attackSource - 17) <= 1u)
5436 {
5437 if (attackSource == AttackSource.Euthanasia && trait is TraitLittleOne)
5438 {
5439 MakeEgg();
5440 if (IsPCFaction)
5441 {
5443 }
5444 }
5445 PlayEffect("revive");
5446 PlaySound("chime_angel");
5447 }
5448 else
5449 {
5450 Effect.Get("blood").Play((parent is Chara) ? (parent as Chara).pos : pos).SetParticleColor(EClass.Colors.matColors[base.material.alias].main)
5451 .Emit(50);
5452 AddBlood(AI_Slaughter.slaughtering ? 12 : (2 + EClass.rnd(2)));
5453 PlaySound(base.material.GetSoundDead(source));
5454 }
5457 ClearFOV();
5458 }
5459 if (base.hp >= 0)
5460 {
5461 base.hp = -1;
5462 }
5463 string text = "";
5464 "dead_in".langGame(EClass._zone.Name);
5465 string text2 = ((origin == null) ? "" : origin.GetName(NameStyle.Full));
5466 if (LangGame.Has("dead_" + attackSource))
5467 {
5468 text = "dead_" + attackSource;
5469 }
5470 else
5471 {
5472 if (e != Element.Void && e != null)
5473 {
5474 text = "dead_" + e.source.alias;
5475 }
5476 if (text == "" || !LangGame.Has(text))
5477 {
5478 text = "dead";
5479 }
5480 }
5481 if (IsPC)
5482 {
5483 EClass._zone.isDeathLocation = true;
5484 string s = ((origin == null) ? text : "dead_by");
5486 if (attackSource == AttackSource.Wrath)
5487 {
5489 }
5490 EClass.player.deathMsg = GameLang.Parse(s.langGame(), thirdPerson: true, EClass.pc.NameBraced, "dead_in".langGame(EClass._zone.Name), text2);
5492 if (EClass._zone.instance is ZoneInstanceRandomQuest zoneInstanceRandomQuest)
5493 {
5494 zoneInstanceRandomQuest.status = ZoneInstance.Status.Fail;
5495 }
5496 AI_PlayMusic.keepPlaying = false;
5497 }
5498 if (isInActiveZone)
5499 {
5500 if (attackSource == AttackSource.DeathSentence || attackSource == AttackSource.Euthanasia)
5501 {
5502 Msg.Say("goto_heaven", this);
5503 }
5504 else
5505 {
5506 if (originalTarget != null || origin == null || !origin.isSynced || (attackSource != AttackSource.Melee && attackSource != AttackSource.Range))
5507 {
5508 Msg.Say(text, this, "", text2);
5509 }
5510 string text3 = TalkTopic("dead");
5511 if (!text3.IsEmpty())
5512 {
5513 text3 = text3.StripBrackets();
5514 }
5515 bool flag = base.rarity >= Rarity.Legendary && !IsPCFaction;
5516 if (!IsPC && flag)
5517 {
5518 MakeGrave(text3);
5519 }
5520 Msg.SetColor();
5521 SpawnLoot(origin);
5522 }
5523 if (IsPC)
5524 {
5526 }
5527 }
5528 if (IsPCFaction)
5529 {
5530 if (homeBranch != null)
5531 {
5532 homeBranch.Log(text, this, "");
5533 }
5534 WidgetPopText.Say("popDead".lang(base.Name), FontColor.Bad);
5535 if (!IsPC)
5536 {
5537 if (EClass.player.stats.allyDeath == 0)
5538 {
5539 Tutorial.Reserve("death_pet");
5540 }
5542 }
5543 }
5544 if (id == "mandrake" || HasElement(488))
5545 {
5546 Say("a_scream", this);
5547 ActEffect.ProcAt(EffectId.Scream, base.LV * 3 + 200, BlessedState.Normal, this, this, pos, isNeg: true);
5548 }
5549 daysStarved = 0;
5550 isDead = true;
5552 enemy = null;
5553 _cooldowns = null;
5554 base.isSale = false;
5555 SetInt(70);
5556 EClass._map.props.sales.Remove(this);
5557 Cure(CureType.Death);
5558 SetAI(new NoGoal());
5560 if (isInActiveZone && EClass._zone.HasLaw && IsHuman && OriginalHostility >= Hostility.Neutral)
5561 {
5562 pos.TalkWitnesses(origin?.Chara, "witness", 3, WitnessType.crime, (Chara c) => !c.IsPCParty && !c.IsUnique);
5563 }
5564 if (IsPC)
5565 {
5566 EClass.player.returnInfo = null;
5567 EClass.player.uidLastTravelZone = 0;
5568 foreach (Chara chara3 in EClass._map.charas)
5569 {
5570 if (chara3.IsHostile())
5571 {
5572 chara3.hostility = chara3.OriginalHostility;
5573 }
5574 if (chara3.enemy == EClass.pc)
5575 {
5576 chara3.enemy = null;
5577 }
5578 }
5579 if (EClass.pc.things.Find("letter_will") != null && EClass.rnd(10) == 0)
5580 {
5581 EClass.player.preventDeathPenalty = true;
5582 }
5583 }
5584 else
5585 {
5586 bool flag2 = currentZone.IsActiveZone && IsLocalChara && !currentZone.IsPCFaction;
5587 if (currentZone is Zone_LittleGarden && id == "littleOne")
5588 {
5589 flag2 = false;
5590 }
5591 if (flag2)
5592 {
5593 EClass._map.deadCharas.Add(this);
5594 }
5595 currentZone.RemoveCard(this);
5596 }
5597 if ((origin != null && origin.IsPCParty) || IsPCFaction)
5598 {
5599 int a = -10;
5600 if (IsPCFaction && !IsPCParty && (origin == null || !origin.IsPCParty))
5601 {
5602 a = -5;
5603 }
5604 ModAffinity(EClass.pc, a, show: false);
5605 string text4 = id;
5606 if (!(text4 == "quru"))
5607 {
5608 if (text4 == "corgon")
5609 {
5610 EClass.game.cards.globalCharas.Find("quru")?.ModAffinity(EClass.pc, -20, show: false);
5611 }
5612 }
5613 else
5614 {
5615 EClass.game.cards.globalCharas.Find("corgon")?.ModAffinity(EClass.pc, -20, show: false);
5616 }
5617 }
5618 if (origin != null)
5619 {
5620 if (origin.IsPCParty || origin.IsPCPartyMinion)
5621 {
5622 int num = 0;
5623 if (OriginalHostility >= Hostility.Friend && IsHuman && !base.IsPCFactionOrMinion)
5624 {
5625 num = -5;
5626 }
5627 else if (race.id == "cat" && OriginalHostility >= Hostility.Neutral)
5628 {
5629 EClass.pc.Say("killcat");
5630 num = -1;
5631 }
5632 if (EClass.pc.party.HasElement(1563) && num < 0)
5633 {
5634 num = num * 30 / 100;
5635 }
5636 if (num != 0)
5637 {
5638 EClass.player.ModKarma(num);
5639 }
5640 }
5641 if (origin == EClass.pc)
5642 {
5643 EClass.pc.faith.Revelation("kill", 10);
5644 }
5645 else if (origin.IsPCFaction)
5646 {
5647 origin.Chara.ModAffinity(EClass.pc, 1, show: false);
5648 origin.Chara.ShowEmo(Emo.love);
5649 }
5650 }
5651 if (base.sourceBacker != null && origin != null && origin.IsPCParty)
5652 {
5653 EClass.player.doneBackers.Add(base.sourceBacker.id);
5654 }
5655 if (base.IsPCFactionOrMinion)
5656 {
5658 {
5659 Msg.Say("abort_allyDead");
5660 }
5661 }
5663 {
5664 Msg.Say("abort_enemyDead");
5665 }
5666 if (IsPCParty && !IsPC)
5667 {
5669 base.c_wasInPcParty = true;
5670 EClass.pc.Say("allyDead");
5671 }
5672 switch (id)
5673 {
5674 case "littleOne":
5675 if (attackSource != AttackSource.Euthanasia && !IsPCFaction)
5676 {
5677 EClass.player.flags.little_killed = true;
5679 }
5680 break;
5681 case "big_daddy":
5682 if (!IsPCFaction)
5683 {
5684 Chara chara = CharaGen.Create("littleOne");
5685 EClass._zone.AddCard(chara, pos.Copy());
5686 Msg.Say("little_pop");
5688 }
5689 break;
5690 case "shark_sister":
5691 if (!IsPCFaction)
5692 {
5693 Chara t = CharaGen.Create("sister_shark");
5694 EClass._zone.AddCard(t, pos.Copy());
5695 Msg.Say("shark_pop");
5696 }
5697 break;
5698 }
5699 if (attackSource == AttackSource.Finish && origin != null && origin.Evalue(665) > 0)
5700 {
5701 Chara chara2 = CharaGen.CreateFromFilter("c_plant", base.LV);
5702 EClass._zone.AddCard(chara2, pos.Copy());
5703 if (chara2.LV < base.LV)
5704 {
5705 chara2.SetLv(base.LV);
5706 }
5707 chara2.MakeMinion((origin.IsPCParty || origin.IsPCPartyMinion) ? EClass.pc : origin.Chara, MinionType.Friend);
5708 Msg.Say("plant_pop", this, chara2);
5709 }
5712 }
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:107
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:6150
virtual bool IsPCParty
Definition: Card.cs:2177
Card SetLv(int a)
Definition: Card.cs:2949
ICardParent parent
Definition: Card.cs:56
virtual bool IsPCPartyMinion
Definition: Card.cs:2181
void ClearFOV()
Definition: Card.cs:6766
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:6377
virtual bool IsPCFaction
Definition: Card.cs:2297
void SpawnLoot(Card origin)
Definition: Card.cs:5172
int LV
Definition: Card.cs:387
virtual bool isSynced
Definition: Card.cs:2113
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:893
int daysStarved
Definition: Chara.cs:331
void MakeMinion(Chara _master, MinionType type=MinionType.Default)
Definition: Chara.cs:2388
string NameBraced
Definition: Chara.cs:516
void ClearTempElements()
Definition: Chara.cs:10538
string TalkTopic(string topic="calm")
Definition: Chara.cs:7099
void TryDropBossLoot()
Definition: Chara.cs:5714
bool IsLocalChara
Definition: Chara.cs:855
Chara enemy
Definition: Chara.cs:86
bool IsInActiveZone
Definition: Chara.cs:852
void TryDropCarryOnly()
Definition: Chara.cs:4653
void MakeGrave(string lastword)
Definition: Chara.cs:5309
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:178
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:2563
Stats stats
Definition: Player.cs:1039
int little_dead
Definition: Player.cs:949
HashSet< int > doneBackers
Definition: Player.cs:1096
bool TryAbortAutoCombat(bool immediate=true)
Definition: Player.cs:2457
string deathMsg
Definition: Player.cs:1208
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:146
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:1115
virtual bool HasLaw
Definition: Zone.cs:231
void RemoveCard(Card t)
Definition: Zone.cs:2034
void ResetHostility()
Definition: Zone.cs:2722
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(), Steam.GetAchievement(), 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(), Slap(), and ConDeathSentense.Tick().

◆ DiminishTempElements()

void Chara.DiminishTempElements ( int  a = 1)
inline

Definition at line 10493 of file Chara.cs.

10494 {
10495 if (tempElements == null)
10496 {
10497 return;
10498 }
10499 foreach (Element item in tempElements.dict.Values.ToList())
10500 {
10501 if (item.vBase > 0)
10502 {
10503 ModTempElement(item.id, -Mathf.Min(item.vBase * 5 / 100 + 1, item.vBase), naturalDecay: true);
10504 }
10505 }
10506 }

References ElementContainer.dict, and item.

◆ Divorce()

void Chara.Divorce ( Chara  c)
inline

Definition at line 8236 of file Chara.cs.

8237 {
8238 if (base.c_love != null)
8239 {
8240 base.c_love.dateMarriage = 0;
8241 SetFeat(1275, 0);
8243 }
8244 }
int divorced
Definition: Player.cs:132

References Player.Stats.divorced, EClass.player, and Player.stats.

◆ DoAI()

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

Definition at line 6325 of file Chara.cs.

6326 {
6327 SetAI(new DynamicAIAct("", delegate
6328 {
6329 onPerform();
6330 return true;
6331 })
6332 {
6333 wait = wait
6334 });
6335 }

◆ DoHostileAction()

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

Definition at line 6465 of file Chara.cs.

6466 {
6467 if (_tg == null || !_tg.isChara)
6468 {
6469 return;
6470 }
6471 Chara chara = _tg.Chara;
6472 if (chara.IsPC)
6473 {
6474 EClass.pc.combatCount = 10;
6475 }
6476 if (!chara.IsAliveInCurrentZone || !IsAliveInCurrentZone || chara == this)
6477 {
6478 return;
6479 }
6480 if ((IsPCFaction || IsPCFactionMinion) && (chara.IsPCFaction || chara.IsPCFactionMinion))
6481 {
6482 chara.Say("frown", this, chara);
6483 }
6484 else
6485 {
6486 if (EClass._zone.IsRegion)
6487 {
6488 return;
6489 }
6490 if (IsPC)
6491 {
6492 if (chara.IsFriendOrAbove() && !immediate)
6493 {
6494 chara.Say("frown", this, chara);
6495 chara.ShowEmo(Emo.sad);
6496 chara.hostility = Hostility.Neutral;
6497 return;
6498 }
6499 if (!chara.IsPCFaction && chara.hostility >= Hostility.Neutral && !EClass._zone.IsPCFaction)
6500 {
6501 bool flag = chara.id == "fanatic";
6502 if (EClass.rnd(4) == 0 || flag)
6503 {
6504 chara.Say("callHelp", chara);
6505 chara.CallHelp(this, flag);
6506 }
6507 }
6508 if (chara.hostility <= Hostility.Enemy)
6509 {
6510 foreach (Chara member in EClass.pc.party.members)
6511 {
6512 if (member != EClass.pc && member.enemy == null && member.CanSee(chara))
6513 {
6514 member.SetEnemy(chara);
6515 }
6516 }
6517 }
6518 }
6519 else if (chara.IsPC && hostility <= Hostility.Enemy)
6520 {
6521 foreach (Chara member2 in EClass.pc.party.members)
6522 {
6523 if (member2 != EClass.pc && member2.enemy == null && member2.CanSee(this))
6524 {
6525 member2.SetEnemy(this);
6526 }
6527 }
6528 }
6529 if (chara.calmCheckTurn <= 0 || IsPC)
6530 {
6531 chara.calmCheckTurn = (IsPC ? (20 + EClass.rnd(30)) : (10 + EClass.rnd(10)));
6532 }
6533 if (hostility != Hostility.Enemy || chara.hostility != Hostility.Enemy)
6534 {
6535 GoHostile(chara);
6536 chara.GoHostile(this);
6537 if (base.isHidden && !chara.CanSee(this) && !chara.IsDisabled && !chara.IsPCParty && !chara.IsPCPartyMinion && EClass.rnd(10 + Dist(chara) * 10) == 0)
6538 {
6539 Thing t = ThingGen.Create("49");
6540 ActThrow.Throw(chara, pos, t);
6541 Act.TC = chara;
6542 }
6543 }
6544 }
6545 }
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:653
int calmCheckTurn
Definition: Chara.cs:118
bool CanSee(Card c)
Definition: Chara.cs:1244
override bool IsPCFactionMinion
Definition: Chara.cs:669
bool IsFriendOrAbove()
Definition: Chara.cs:6742
Chara SetEnemy(Chara c=null)
Definition: Chara.cs:6416
void CallHelp(Chara tg, bool fanatic=false)
Definition: Chara.cs:6547
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 5186 of file Chara.cs.

5187 {
5188 Say("drink", this, t.Duplicate(1));
5189 Say("quaff");
5190 PlaySound("drink");
5191 hunger.Mod(-2);
5192 t.ModNum(-1);
5193 t.trait.OnDrink(this);
5194 _ = IsPC;
5195 }
Thing Duplicate(int num)
Definition: Card.cs:3498
void ModNum(int a, bool notify=true)
Definition: Card.cs:3569
Stats hunger
Definition: Chara.cs:1168
virtual void OnDrink(Chara c)
Definition: Trait.cs:1018

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 4665 of file Chara.cs.

4666 {
4667 if (held == null)
4668 {
4669 return null;
4670 }
4671 if (IsPC)
4672 {
4673 WidgetHotbar.dirtyCurrentItem = true;
4675 }
4676 Card card = EClass._zone.AddCard(held, dropPos ?? pos);
4677 card.OnLand();
4678 if (card.trait.CanOnlyCarry)
4679 {
4680 card.SetPlaceState(PlaceState.installed);
4681 }
4682 return card;
4683 }
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 4685 of file Chara.cs.

4686 {
4687 if (t.c_isImportant)
4688 {
4689 Msg.Say("markedImportant");
4690 return;
4691 }
4692 if (!t.trait.CanBeDropped)
4693 {
4694 Msg.Say("cantDrop", t);
4695 return;
4696 }
4697 if (t.trait is TraitAbility)
4698 {
4699 SE.Trash();
4700 t.Destroy();
4701 return;
4702 }
4703 Msg.Say("dropItem", t.Name);
4704 t.ignoreAutoPick = true;
4705 PlaySound("drop");
4706 EClass._zone.AddCard(t, pos);
4707 if (t.trait.CanOnlyCarry)
4708 {
4709 t.Install();
4710 }
4711 }
Card Install()
Definition: Card.cs:3795
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 1817 of file Chara.cs.

1818 {
1819 Chara chara = CharaGen.Create(id);
1820 chara.mana.value = mana.value;
1821 chara.stamina.value = stamina.value;
1822 foreach (KeyValuePair<int, Element> item in elements.dict)
1823 {
1824 if (item.Key != 1275)
1825 {
1826 Element orCreateElement = chara.elements.GetOrCreateElement(item.Key);
1827 orCreateElement.vBase = item.Value.ValueWithoutLink - orCreateElement.vSource;
1828 }
1829 }
1830 chara.SetFaith(faith);
1831 chara.bio = IO.DeepCopy(bio);
1832 chara.LV = base.LV;
1833 chara.c_daysWithGod = base.c_daysWithGod;
1834 chara.RefreshFaithElement();
1835 chara.hp = (int)Mathf.Clamp((float)chara.MaxHP * ((float)base.hp / (float)MaxHP) * 0.99f, 0f, chara.MaxHP);
1836 chara.isCopy = true;
1837 chara.isScaled = base.isScaled;
1838 if (HaveFur())
1839 {
1840 chara.c_fur = -1;
1841 }
1842 return chara;
1843 }
bool HaveFur()
Definition: Card.cs:8077
Stats mana
Definition: Chara.cs:1180
void RefreshFaithElement()
Definition: Chara.cs:10373
void SetFaith(string id)
Definition: Chara.cs:1739
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 10488 of file Chara.cs.

10489 {
10490 ModTempElement(ele, onlyRenew ? (p / 20) : (p / 100 + EClass.rnd(p / 100 + 1)), naturalDecay: false, onlyRenew);
10491 }

References EClass.rnd().

◆ EnhanceTempElements()

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

Definition at line 10479 of file Chara.cs.

10480 {
10481 int[] array = (body ? Element.List_Body : Element.List_Mind);
10482 foreach (int ele in array)
10483 {
10484 EnhanceTempElement(ele, p, onlyRenew);
10485 }
10486 }
void EnhanceTempElement(int ele, int p, bool onlyRenew=false)
Definition: Chara.cs:10488

References Element.List_Mind.

◆ EQ_CAT()

void Chara.EQ_CAT ( string  s)
inline

Definition at line 5163 of file Chara.cs.

5164 {
5165 int slot = EClass.sources.categories.map[s].slot;
5166 BodySlot bodySlot = ((slot == 0) ? null : body.GetSlot(slot));
5167 if ((slot == 0 || bodySlot != null) && (slot != 37 || !HasElement(1209)))
5168 {
5169 SetEQQuality();
5170 Thing thing = ThingGen.CreateFromCategory(s, base.LV);
5171 AddThing(thing);
5172 if (bodySlot != null && !body.Equip(thing, bodySlot))
5173 {
5174 thing.Destroy();
5175 }
5176 }
5177 }
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:3152
bool Equip(Thing thing, BodySlot slot=null, bool msg=true)
Definition: CharaBody.cs:194
BodySlot GetSlot(Thing t, bool onlyEmpty=false, bool secondSlot=false)
Definition: CharaBody.cs:369
void SetEQQuality()
Definition: Chara.cs:5110
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 5143 of file Chara.cs.

5144 {
5145 SetEQQuality();
5146 if (r != Rarity.Random)
5147 {
5148 CardBlueprint.current.rarity = r;
5149 }
5150 Thing thing = ThingGen.Create(s, mat, base.LV);
5151 if (body.GetSlot(thing, onlyEmpty: true) == null)
5152 {
5153 return thing;
5154 }
5155 AddThing(thing);
5156 if (!body.Equip(thing))
5157 {
5158 thing.Destroy();
5159 }
5160 return thing;
5161 }

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 5179 of file Chara.cs.

5180 {
5181 SetEQQuality();
5182 Thing t = ThingGen.Create(s, -1, base.LV).SetNum(num);
5183 AddThing(t);
5184 }
Thing SetNum(int a)
Definition: Card.cs:3549

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

◆ EvalueRiding()

int Chara.EvalueRiding ( )
inline

Definition at line 6236 of file Chara.cs.

6237 {
6238 if (ride != null && ride.HasCondition<ConTransmuteBroom>() && HasElement(1417))
6239 {
6240 return 25 + Evalue(226) * 125 / 100;
6241 }
6242 return Evalue(226);
6243 }

References HasCondition().

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

◆ FallFromZone()

void Chara.FallFromZone ( )
inline

Definition at line 3551 of file Chara.cs.

3552 {
3553 Msg.Say("skyFall", EClass.pc, EClass._zone.Name);
3554 Zone zone = (EClass._zone.isExternalZone ? null : EClass._zone.GetTopZone().FindZone(EClass._zone.lv - 1));
3555 zone = zone ?? EClass.world.region;
3557 {
3558 state = ZoneTransition.EnterState.Fall,
3559 x = pos.x,
3560 z = pos.z
3561 });
3562 }
void MoveZone(string alias)
Definition: Chara.cs:3366
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:1950

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 7964 of file Chara.cs.

7965 {
7966 TraitToolRange ranged = weapon.trait as TraitToolRange;
7967 Thing thing = (IsPC ? EClass.pc.things.Find<TraitQuiver>() : null);
7968 if (thing != null)
7969 {
7970 Thing thing2 = thing.things.Find((Thing t) => ranged.IsAmmo(t));
7971 if (thing2 != null)
7972 {
7973 return thing2;
7974 }
7975 }
7976 return things.Find((Thing t) => ranged.IsAmmo(t));
7977 }
bool IsAmmo
Definition: Card.cs:2275
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 7463 of file Chara.cs.

7464 {
7465 foreach (Card item in EClass._map.props.installed.all)
7466 {
7467 if (item.trait is TraitBed traitBed && traitBed.IsHolder(this))
7468 {
7469 return traitBed;
7470 }
7471 }
7472 return null;
7473 }

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 7695 of file Chara.cs.

7696 {
7697 Thing result = null;
7698 int num = -1;
7699 if (IsPC)
7700 {
7701 return null;
7702 }
7703 foreach (Thing item in things.List((Thing t) => CanEat(t, shouldEat: true) && !t.c_isImportant, onlyAccessible: true))
7704 {
7705 int num2 = CountNumEaten(item);
7706 int num3 = 100 - num2 + (item.HasElement(757) ? 10 : 0);
7707 if (num3 > num)
7708 {
7709 result = item;
7710 num = num3;
7711 }
7712 }
7713 return result;
7714 }
bool CanEat(Thing t, bool shouldEat=false)
Definition: Chara.cs:7741
int CountNumEaten(Thing food)
Definition: Chara.cs:10344
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 2450 of file Chara.cs.

2451 {
2452 if (IsMinion)
2453 {
2454 master = EClass._map.FindChara(base.c_uidMaster);
2455 }
2456 return master;
2457 }
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 6631 of file Chara.cs.

6632 {
6633 for (int i = 0; i < EClass._map.charas.Count; i++)
6634 {
6635 Chara chara = EClass._map.charas[i];
6636 if (chara != this && chara != enemy && chara.mimicry == null && IsHostile(chara) && Dist(chara) <= 1 && CanInteractTo(chara.pos))
6637 {
6638 DoHostileAction(chara);
6639 enemy = chara;
6640 return true;
6641 }
6642 }
6643 return false;
6644 }
ConTransmuteMimic mimicry
Definition: Chara.cs:106
void DoHostileAction(Card _tg, bool immediate=false)
Definition: Chara.cs:6465

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 6558 of file Chara.cs.

6559 {
6560 if (EClass._zone.isPeace && base.IsPCFactionOrMinion && !IsPC)
6561 {
6562 return false;
6563 }
6564 if (enemy != null && !enemy.IsAliveInCurrentZone)
6565 {
6566 enemy = null;
6567 }
6568 if (enemy != null)
6569 {
6570 return false;
6571 }
6572 if (IsPCParty && EClass.pc.isHidden && base.isHidden)
6573 {
6574 return false;
6575 }
6576 if (mimicry != null)
6577 {
6578 return false;
6579 }
6580 bool flag = enemy != null || ai is GoalCombat;
6581 int num = (base.PER + Evalue(210) * 2) * ((!flag) ? 1 : 2);
6582 bool flag2 = IsPCParty && !IsPC && EClass.game.config.tactics.dontWander;
6583 bool flag3 = !IsPCParty;
6584 Chara chara = null;
6585 int num2 = 9999;
6586 for (int i = 0; i < EClass._map.charas.Count; i++)
6587 {
6588 Chara chara2 = EClass._map.charas[i];
6589 if (chara2 == this || !IsHostile(chara2) || !CanSee(chara2) || chara2.mimicry != null)
6590 {
6591 continue;
6592 }
6593 int num3 = Dist(chara2);
6594 int num4 = GetSightRadius() + (flag ? 1 : 0);
6595 if (num3 > num4)
6596 {
6597 continue;
6598 }
6599 if (flag3 && EClass.rnd(chara2.Evalue(152) + 5) * (100 + num3 * num3 * 10) / 100 > EClass.rnd(num))
6600 {
6601 if (this == pos.FirstChara)
6602 {
6603 chara2.ModExp(152, Mathf.Clamp((num - chara2.Evalue(152)) / 2, 1, Mathf.Max(30 - stealthSeen * 2, 1)));
6604 }
6605 stealthSeen++;
6606 }
6607 else if (CanSeeLos(chara2) && (!flag2 || EClass.pc.isBlind || EClass.pc.CanSeeLos(chara2)) && (!IsPCFaction || EClass.pc.ai.ShouldAllyAttack(chara2)))
6608 {
6609 if (!IsPCParty)
6610 {
6611 DoHostileAction(chara2);
6612 enemy = chara2;
6613 return true;
6614 }
6615 if (num3 < num2)
6616 {
6617 num2 = num3;
6618 chara = chara2;
6619 }
6620 }
6621 }
6622 if (chara != null)
6623 {
6624 DoHostileAction(chara);
6625 enemy = chara;
6626 return true;
6627 }
6628 return false;
6629 }
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 8079 of file Chara.cs.

8080 {
8081 return FindBed()?.owner.pos.cell.room;
8082 }
TraitBed FindBed()
Definition: Chara.cs:7463

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 10259 of file Chara.cs.

10260 {
10261 Element orCreateElement = elements.GetOrCreateElement(ele);
10262 if (orCreateElement.ValueWithoutLink == 0)
10263 {
10264 elements.ModBase(orCreateElement.id, 1);
10265 }
10266 if (orCreateElement is Spell)
10267 {
10268 int num = EClass.curve(Evalue(307), 50, 20) + (HasElement(307) ? 20 : 0);
10269 int num2 = origin?.Evalue(765) ?? 0;
10270 num = num * (100 - num2) / 100;
10271 int a = mtp * orCreateElement.source.charge * (100 + num) / 100 / 100;
10272 a = Mathf.Max(1, EClass.rndHalf(a));
10273 if (orCreateElement.source.charge == 1)
10274 {
10275 a = 1;
10276 }
10277 orCreateElement.vPotential += a;
10278 }
10279 Say("spell_gain", this, orCreateElement.Name);
10280 LayerAbility.SetDirty(orCreateElement);
10281 }
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 7407 of file Chara.cs.

7408 {
7409 string result = "?????";
7410 if (ai != null)
7411 {
7412 result = ai.GetCurrentActionText();
7413 }
7414 return result;
7415 }
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 8014 of file Chara.cs.

8015 {
8016 if (body.GetWeight(armorOnly: true) <= (HasElement(1204) ? 6000 : 30000))
8017 {
8018 return 120;
8019 }
8020 return 122;
8021 }
int GetWeight(bool armorOnly=false)
Definition: CharaBody.cs:436

References CharaBody.GetWeight().

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

◆ GetBestRangedWeapon()

Thing Chara.GetBestRangedWeapon ( )
inline

Definition at line 7979 of file Chara.cs.

7980 {
7981 Thing result = null;
7982 int num = 0;
7983 foreach (Thing thing in things)
7984 {
7985 if (thing.IsRangedWeapon && CanEquipRanged(thing) && thing.GetEquipValue() > num)
7986 {
7987 num = thing.GetEquipValue();
7988 result = thing;
7989 }
7990 }
7991 return result;
7992 }
int GetEquipValue()
Definition: Card.cs:7373
bool IsRangedWeapon
Definition: Card.cs:2271
bool CanEquipRanged(Thing t)
Definition: Chara.cs:7913

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

◆ GetBuffStats() [1/2]

Element Chara.GetBuffStats ( int  ele)
inline

Definition at line 9598 of file Chara.cs.

9599 {
9600 for (int i = 0; i < conditions.Count; i++)
9601 {
9602 if (conditions[i] is ConBuffStats conBuffStats && conBuffStats.refVal == ele)
9603 {
9604 return conBuffStats.elements.GetElement(ele);
9605 }
9606 }
9607 return null;
9608 }

References BaseCondition.refVal.

◆ GetBuffStats() [2/2]

Element Chara.GetBuffStats ( string  alias)
inline

Definition at line 9593 of file Chara.cs.

9594 {
9595 return GetBuffStats(EClass.sources.elements.alias[alias].id);
9596 }
Element GetBuffStats(string alias)
Definition: Chara.cs:9593

References SourceManager.elements, and EClass.sources.

Referenced by GoalCombat.TryUseAbility().

◆ GetBurden()

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

Definition at line 1845 of file Chara.cs.

1846 {
1847 int num2 = (base.ChildrenWeight + ((t != null) ? ((num == -1) ? t.ChildrenAndSelfWeight : (t.SelfWeight * num)) : 0)) * 100 / WeightLimit;
1848 if (num2 < 0)
1849 {
1850 num2 = 1000;
1851 }
1853 {
1854 num2 = 0;
1855 }
1856 int num3 = ((num2 >= 100) ? ((num2 - 100) / 10 + 1) : 0);
1857 if (num3 > 9)
1858 {
1859 num3 = 9;
1860 }
1861 return num3;
1862 }

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

◆ GetCondition< T >()

override T Chara.GetCondition< T > ( )
inlinevirtual

Reimplemented from Card.

Definition at line 9636 of file Chara.cs.

9637 {
9638 for (int i = 0; i < conditions.Count; i++)
9639 {
9640 if (conditions[i] is T)
9641 {
9642 return conditions[i] as T;
9643 }
9644 }
9645 return null;
9646 }

◆ GetCooldown()

int Chara.GetCooldown ( int  idEle)
inline

Definition at line 8887 of file Chara.cs.

8888 {
8889 if (_cooldowns != null)
8890 {
8891 for (int i = 0; i < _cooldowns.Count; i++)
8892 {
8893 if (_cooldowns[i] / 1000 == idEle)
8894 {
8895 return _cooldowns[i] % 1000;
8896 }
8897 }
8898 }
8899 return 0;
8900 }

Referenced by NotificationCooldown.OnRefresh().

◆ GetCurrentDir()

int Chara.GetCurrentDir ( )
inline

Definition at line 3671 of file Chara.cs.

3672 {
3673 Debug.Log(angle);
3674 if (!renderer.hasActor)
3675 {
3676 if (angle == 0f || angle == 45f || angle == 90f)
3677 {
3678 return 2;
3679 }
3680 if (angle == -135f || angle == 180f || angle == -90f)
3681 {
3682 return 1;
3683 }
3684 if (angle == 135f)
3685 {
3686 return 0;
3687 }
3688 return 3;
3689 }
3690 return renderer.actor.currentDir;
3691 }
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 7382 of file Chara.cs.

7383 {
7384 return (ai.IsRunning ? ai.GetDestination() : pos).Copy();
7385 }
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 4738 of file Chara.cs.

4739 {
4740 if (elements.Value(122) > elements.Value(120))
4741 {
4742 return elements.GetElement(122);
4743 }
4744 return elements.GetElement(120);
4745 }
int Value(int ele)

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

◆ GetFavAttackStyle()

AttackStyle Chara.GetFavAttackStyle ( )
inline

Definition at line 4713 of file Chara.cs.

4714 {
4715 int num = Evalue(131);
4716 int num2 = Evalue(130);
4717 int num3 = Evalue(123);
4718 if (num > num2 && num > num3)
4719 {
4720 return AttackStyle.TwoWield;
4721 }
4722 if (num2 > num && num2 > num3)
4723 {
4724 return AttackStyle.TwoHand;
4725 }
4726 if (num3 > num && num3 > num2)
4727 {
4728 return AttackStyle.Shield;
4729 }
4730 return AttackStyle.Default;
4731 }

Referenced by WindowChara.RefreshNote().

◆ GetFavCat()

SourceCategory.Row Chara.GetFavCat ( )
inline

Definition at line 8203 of file Chara.cs.

8204 {
8205 SourceCategory.Row r = null;
8206 if (_listFavCat.Count == 0)
8207 {
8208 foreach (SourceCategory.Row row in EClass.sources.categories.rows)
8209 {
8210 if (row.gift > 0)
8211 {
8212 _listFavCat.Add(row);
8213 }
8214 }
8215 }
8216 Rand.UseSeed(base.uid + EClass.game.seed, delegate
8217 {
8218 r = _listFavCat.RandomItem();
8219 });
8220 return r;
8221 }
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 8183 of file Chara.cs.

8184 {
8185 if (_listFavFood.Count == 0)
8186 {
8187 foreach (SourceThing.Row row in EClass.sources.things.rows)
8188 {
8189 if (row._origin == "dish" && row.value != 0 && row.chance != 0)
8190 {
8191 _listFavFood.Add(row);
8192 }
8193 }
8194 }
8195 SourceThing.Row r = null;
8196 Rand.UseSeed(base.uid + EClass.game.seed, delegate
8197 {
8198 r = _listFavFood.RandomItem();
8199 });
8200 return r;
8201 }
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 4733 of file Chara.cs.

4734 {
4735 return elements.ListElements((Element e) => e.source.categorySub == "weapon" && !e.HasTag("ranged")).FindMax((Element a) => a.Value);
4736 }
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 2636 of file Chara.cs.

2637 {
2638 return PathManager.Instance.GetFirstStep(pos, newPoint, this, IsPC ? 40 : 10, (!IsMultisize) ? moveType : PathManager.MoveType.Default);
2639 }
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 8953 of file Chara.cs.

8954 {
8955 if (IsPC)
8956 {
8957 return null;
8958 }
8959 switch (TimeTable.GetSpan(idTimeTable, hour))
8960 {
8961 case TimeTable.Span.Sleep:
8963 {
8964 return new GoalSleep();
8965 }
8966 break;
8967 case TimeTable.Span.Eat:
8968 return new GoalIdle();
8969 case TimeTable.Span.Work:
8970 if (IsGuest())
8971 {
8972 return new GoalIdle();
8973 }
8974 return GetGoalWork();
8975 case TimeTable.Span.Free:
8976 if (IsGuest())
8977 {
8978 return new GoalIdle();
8979 }
8980 return GetGoalHobby();
8981 }
8982 return null;
8983 }
Goal GetGoalWork()
Definition: Chara.cs:8985
Goal GetGoalHobby()
Definition: Chara.cs:8998
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 8998 of file Chara.cs.

8999 {
9000 if (IsPrisoner)
9001 {
9002 return new GoalIdle();
9003 }
9004 if (memberType == FactionMemberType.Livestock)
9005 {
9006 return new GoalGraze();
9007 }
9008 return new GoalHobby();
9009 }
FactionMemberType
bool IsPrisoner
Definition: Chara.cs:1052

Referenced by Zone.Simulate().

◆ GetGoalWork()

Goal Chara.GetGoalWork ( )
inline

Definition at line 8985 of file Chara.cs.

8986 {
8987 if (IsPrisoner)
8988 {
8989 return new GoalIdle();
8990 }
8991 if (memberType == FactionMemberType.Livestock)
8992 {
8993 return new GoalGraze();
8994 }
8995 return new GoalWork();
8996 }

Referenced by Zone.Simulate().

◆ GetHappiness()

int Chara.GetHappiness ( )
inline

Definition at line 7392 of file Chara.cs.

7393 {
7394 int num = 50;
7395 if (FindBed() != null)
7396 {
7397 num += 50;
7398 }
7399 return num;
7400 }

◆ GetHireCost()

int Chara.GetHireCost ( )
inline

Definition at line 7387 of file Chara.cs.

7388 {
7389 return base.LV / 2 + 4;
7390 }

Referenced by CalcGold.Hire().

◆ GetHoverText()

override string Chara.GetHoverText ( )
inlinevirtual

Reimplemented from Card.

Definition at line 6894 of file Chara.cs.

6895 {
6896 if (mimicry != null)
6897 {
6898 return mimicry.thing.GetHoverText();
6899 }
6900 string text = base.Name;
6901 if (IsFriendOrAbove())
6902 {
6903 text = text.TagColor(EClass.Colors.colorFriend);
6904 }
6905 else if (IsHostile())
6906 {
6907 text = text.TagColor(EClass.Colors.colorHostile);
6908 }
6909 int num = 2;
6910 int lV = EClass.pc.LV;
6911 if (base.LV >= lV * 5)
6912 {
6913 num = 0;
6914 }
6915 else if (base.LV >= lV * 2)
6916 {
6917 num = 1;
6918 }
6919 else if (base.LV <= lV / 4)
6920 {
6921 num = 4;
6922 }
6923 else if (base.LV <= lV / 2)
6924 {
6925 num = 3;
6926 }
6927 string text2 = Lang.GetList("lvComparison")[num];
6928 text2 = (" (" + text2 + ") ").TagSize(14).TagColor(EClass.Colors.gradientLVComparison.Evaluate(0.25f * (float)num));
6929 string s = (IsFriendOrAbove() ? "HostilityAlly" : (IsNeutral() ? "HostilityNeutral" : "HostilityEnemy"));
6930 s = (" (" + s.lang() + ") ").TagSize(14);
6931 s = "";
6932 if (memberType == FactionMemberType.Guest)
6933 {
6934 s += (" (" + "guest".lang() + ") ").TagSize(14);
6935 }
6936 else if (memberType == FactionMemberType.Livestock)
6937 {
6938 s += (" (" + "livestock".lang() + ") ").TagSize(14);
6939 }
6940 if (!EClass.pc.IsMoving)
6941 {
6942 if (EClass.pc.HasHigherGround(this))
6943 {
6944 text2 += "lowerGround".lang();
6945 }
6946 else if (HasHigherGround(EClass.pc))
6947 {
6948 text2 += "higherGround".lang();
6949 }
6950 }
6951 if (Evalue(1232) > 0)
6952 {
6953 text2 = "milkBaby".lang().TagSize(14) + text2;
6954 }
6955 if (Guild.Fighter.ShowBounty(this) && Guild.Fighter.HasBounty(this))
6956 {
6957 text2 = "hasBounty".lang().TagSize(14) + text2;
6958 }
6959 if (EClass.pc.HasElement(481))
6960 {
6961 text2 += ("(" + faith.Name + ")").TagSize(14);
6962 }
6963 if (EClass.pc.HasElement(6607))
6964 {
6965 s += CraftUtil.GetBloodText(this).TagSize(14).TagColor(EClass.Colors.colorBlood);
6966 }
6967 return text + text2 + s;
6968 }
bool HasHigherGround(Card c)
Definition: Chara.cs:1216
override bool IsMoving
Definition: Chara.cs:622
bool IsNeutral()
Definition: Chara.cs:6693
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 6970 of file Chara.cs.

6971 {
6972 if (mimicry != null)
6973 {
6974 return mimicry.thing.GetHoverText2();
6975 }
6976 string text = "";
6977 if (knowFav)
6978 {
6979 text += Environment.NewLine;
6980 text = text + "<size=14>" + "favgift".lang(GetFavCat().GetName().ToLower(), GetFavFood().GetName()) + "</size>";
6981 }
6982 string text2 = "";
6984 {
6985 text2 += Environment.NewLine;
6986 text2 = text2 + "Lv:" + base.LV + " HP:" + base.hp + "/" + MaxHP + " MP:" + mana.value + "/" + mana.max + " DV:" + DV + " PV:" + PV + " Hunger:" + hunger.value;
6987 text2 += Environment.NewLine;
6988 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");
6989 text2 += Environment.NewLine;
6990 text2 = text2 + base.uid + IsMinion + "/" + base.c_uidMaster + "/" + master;
6991 text2 = text2 + " dir:" + base.dir + " skin:" + base.idSkin + " scaled:" + base.isScaled;
6992 }
6994 {
6995 text2 += Environment.NewLine;
6996 text2 += "<size=14>";
6997 foreach (Hobby item in ListWorks())
6998 {
6999 text2 = text2 + item.Name + ", ";
7000 }
7001 foreach (Hobby item2 in ListHobbies())
7002 {
7003 text2 = text2 + item2.Name + ", ";
7004 }
7005 text2 = text2.TrimEnd(", ".ToCharArray()) + "</size>";
7006 }
7007 string text3 = "";
7008 IEnumerable<BaseStats> enumerable = conditions.Concat((!IsPCFaction) ? new BaseStats[0] : new BaseStats[2] { hunger, stamina });
7009 if (enumerable.Count() > 0)
7010 {
7011 text3 += Environment.NewLine;
7012 text3 += "<size=14>";
7013 int num = 0;
7014 foreach (BaseStats item3 in enumerable)
7015 {
7016 string text4 = item3.GetPhaseStr();
7017 if (text4.IsEmpty() || text4 == "#")
7018 {
7019 continue;
7020 }
7021 Color c = Color.white;
7022 switch (item3.source.group)
7023 {
7024 case "Bad":
7025 case "Debuff":
7026 case "Disease":
7028 break;
7029 case "Buff":
7031 break;
7032 }
7034 {
7035 text4 = text4 + "(" + item3.GetValue() + ")";
7036 if (resistCon != null && resistCon.ContainsKey(item3.id))
7037 {
7038 text4 = text4 + "{" + resistCon[item3.id] + "}";
7039 }
7040 }
7041 num++;
7042 text3 = text3 + text4.TagColor(c) + ", ";
7043 }
7044 if (num == 0)
7045 {
7046 text3 = "";
7047 }
7048 else
7049 {
7050 text = "";
7051 text3 = text3.TrimEnd(", ".ToCharArray()) + "</size>";
7052 }
7053 }
7055 {
7056 text3 += Environment.NewLine;
7057 foreach (ActList.Item item4 in ability.list.items)
7058 {
7059 text3 = text3 + item4.act.Name + ", ";
7060 }
7061 text3 = text3.TrimEnd(", ".ToCharArray());
7062 }
7063 return text + text2 + text3;
7064 }
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:7862
bool isScaled
Definition: Card.cs:915
SourceCategory.Row GetFavCat()
Definition: Chara.cs:8203
bool knowFav
Definition: Chara.cs:415
override string GetName(NameStyle style, int num=-1)
Definition: Chara.cs:1383
override int DV
Definition: Chara.cs:743
List< Hobby > ListHobbies(bool useMemberType=true)
Definition: Chara.cs:9141
override int PV
Definition: Chara.cs:772
SourceThing.Row GetFavFood()
Definition: Chara.cs:8183
List< Hobby > ListWorks(bool useMemberType=true)
Definition: Chara.cs:9114
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 8308 of file Chara.cs.

8309 {
8310 if (id == "olderyoungersister")
8311 {
8312 if (base.idSkin != 2)
8313 {
8314 return "UN_olderyoungersister";
8315 }
8316 return "UN_olderyoungersister_alt";
8317 }
8318 if (Portrait.allIds.Contains("UN_" + id + ".png"))
8319 {
8320 return "UN_" + id;
8321 }
8322 return base.c_idPortrait;
8323 }
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 8294 of file Chara.cs.

8295 {
8296 string text = race.id;
8297 if ((text == "mifu" || text == "nefu") && EClass.rnd(2) == 0)
8298 {
8299 return "foxfolk";
8300 }
8301 if (trait is TraitGuard)
8302 {
8303 return "guard";
8304 }
8305 return "";
8306 }

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 7160 of file Chara.cs.

7161 {
7162 return GetSprite();
7163 }
override Sprite GetSprite(int dir=0)
Definition: Chara.cs:6812

◆ GetName()

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

Reimplemented from Card.

Definition at line 1383 of file Chara.cs.

1384 {
1385 if (mimicry != null)
1386 {
1387 return mimicry.thing.GetName(style, num);
1388 }
1389 if (base.isBackerContent && EClass.core.config.backer.Show(base.c_idBacker))
1390 {
1391 if (id == "follower" && !IsGlobal)
1392 {
1393 return "_follower".lang(EClass.sources.backers.map[base.c_idBacker].Name, faith.Name);
1394 }
1395 return EClass.sources.backers.map[base.c_idBacker].Name;
1396 }
1397 string text = base.c_altName ?? source.GetName(this);
1398 if (HasCondition<ConTransmuteShadow>())
1399 {
1400 text = EClass.sources.charas.map["shade"].GetName(this);
1401 }
1402 text = text.Replace("#ele5", MainElement.source.GetAltname(3)).Replace("#ele4", MainElement.source.GetAltname(2)).Replace("#ele3", MainElement.source.GetAltname(1))
1403 .Replace("#ele2", MainElement.source.GetAltname(0))
1404 .Replace("#ele", MainElement.source.GetName().ToLower());
1405 if (base.c_bossType == BossType.Evolved)
1406 {
1407 text = "_evolved".lang(text.ToTitleCase(wholeText: true));
1408 }
1409 trait.SetName(ref text);
1410 if (text.Length > 0 && char.IsLower(text[0]))
1411 {
1412 if (base.rarity >= Rarity.Legendary)
1413 {
1414 text = text.ToTitleCase();
1415 }
1416 else if (num != 0)
1417 {
1418 text = text.AddArticle();
1419 }
1420 }
1421 if (style == NameStyle.Simple)
1422 {
1423 return text;
1424 }
1425 int num2 = ((base.rarity == Rarity.Mythical) ? 3 : ((base.rarity >= Rarity.Legendary) ? 2 : ((!_alias.IsEmpty()) ? 1 : (-1))));
1426 if (trait is TraitAdventurer)
1427 {
1428 num2 = 1;
1429 }
1430 text = (Aka.IsEmpty() ? text.Bracket(num2) : (num2 switch
1431 {
1432 -1 => "_aka",
1433 1 => "_aka3",
1434 _ => "_aka2",
1435 }).lang((num2 == -1) ? Aka : Aka.ToTitleCase(wholeText: true), text.Bracket(num2)));
1436 string text2 = (base.isSale ? "forSale".lang(Lang._currency(GetPrice(CurrencyType.Money, sell: true, PriceType.PlayerShop), "money")) : "");
1437 return text + text2;
1438 }
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 8246 of file Chara.cs.

8247 {
8248 using (List<Chara>.Enumerator enumerator = pos.ListCharasInRadius(this, 3, (Chara c) => c != this && c.race.id == "cat").GetEnumerator())
8249 {
8250 if (enumerator.MoveNext())
8251 {
8252 return enumerator.Current;
8253 }
8254 }
8255 return null;
8256 }
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 10364 of file Chara.cs.

10365 {
10366 if (base._IsPC)
10367 {
10368 return 10 + (int)(Mathf.Sqrt(base.c_daysWithGod) * 2f + (float)Evalue(85)) / 2;
10369 }
10370 return 10 + (int)(Mathf.Sqrt(base.LV) * 5f + (float)Evalue(306)) / 2;
10371 }

◆ GetRevived()

void Chara.GetRevived ( )
inline

Definition at line 5202 of file Chara.cs.

5203 {
5204 Revive(EClass.pc.pos.GetNearestPoint(allowBlock: false, allowChara: false), msg: true);
5205 if (!IsPCFaction)
5206 {
5207 return;
5208 }
5210 {
5211 if (homeZone != null && EClass._zone != homeZone)
5212 {
5213 Msg.Say("returnHome", this, homeZone.Name);
5215 }
5216 }
5217 else if (!EClass._zone.IsPCFaction || homeBranch != EClass.Branch || base.c_wasInPcParty)
5218 {
5219 EClass.pc.party.AddMemeber(this, showMsg: true);
5220 }
5221 }
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 9092 of file Chara.cs.

9093 {
9094 BaseArea result = null;
9095 foreach (Hobby item in ListWorks())
9096 {
9097 AIWork aI = item.GetAI(this);
9098 if (aI.SetDestination())
9099 {
9100 if (aI.destArea != null)
9101 {
9102 result = aI.destArea;
9103 }
9104 else if (aI.destThing != null)
9105 {
9106 result = aI.destThing.pos.cell.room;
9107 }
9108 break;
9109 }
9110 }
9111 return result;
9112 }
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 6812 of file Chara.cs.

6813 {
6814 if (IsPCC)
6815 {
6816 PCC pCC = PCC.Get(pccData);
6817 pCC.Build();
6818 return pCC.variation.idle[0, 0];
6819 }
6820 if (spriteReplacer != null)
6821 {
6822 return spriteReplacer.data.GetSprite();
6823 }
6824 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);
6825 }
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 6836 of file Chara.cs.

6837 {
6838 if (IsPCC)
6839 {
6841 {
6843 }
6844 }
6845 else if (conSleep != null && host == null && pos.Equals(EClass.pc.pos) && IsHuman && (GetBool(123) || affinity.CanSleepBeside()))
6846 {
6847 return EClass.setting.pass.subDead;
6848 }
6849 return SubPassData.Default;
6850 }
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:1176
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 7402 of file Chara.cs.

7403 {
7404 return GetHappiness().ToString() ?? "";
7405 }
int GetHappiness()
Definition: Chara.cs:7392

◆ GetTextHobby()

string Chara.GetTextHobby ( bool  simple = false)
inline

Definition at line 9230 of file Chara.cs.

9231 {
9232 string text = (simple ? "" : ("hobby".lang() + ":"));
9233 foreach (Hobby item in ListHobbies())
9234 {
9235 text = text + " " + item.Name.TagColor((item.GetEfficiency(this) > 0) ? FontColor.Good : FontColor.Warning) + ",";
9236 }
9237 return text.TrimEnd(',');
9238 }

References item.

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

◆ GetTextWork()

string Chara.GetTextWork ( bool  simple = false)
inline

Definition at line 9240 of file Chara.cs.

9241 {
9242 string text = (simple ? "" : ("work".lang() + ":"));
9243 foreach (Hobby item in ListWorks())
9244 {
9245 text = text + " " + item.Name.TagColor((item.GetEfficiency(this) > 0) ? FontColor.Good : FontColor.Warning) + ",";
9246 }
9247 return text.TrimEnd(',');
9248 }

References item.

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

◆ GetTopicText()

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

Definition at line 7066 of file Chara.cs.

7067 {
7068 string key = source.idText.IsEmpty(id);
7069 if (id == "littleOne" && EClass._zone is Zone_LittleGarden)
7070 {
7071 key = "littleOne2";
7072 }
7073 SourceCharaText.Row row = EClass.sources.charaText.map.TryGetValue(key);
7074 if (row == null)
7075 {
7076 return null;
7077 }
7078 string text = row.GetText(topic, returnNull: true);
7079 if (text.IsEmpty())
7080 {
7081 return null;
7082 }
7083 if (text.StartsWith("@"))
7084 {
7085 row = EClass.sources.charaText.map.TryGetValue(text.Replace("@", ""));
7086 if (row == null)
7087 {
7088 return null;
7089 }
7090 text = row.GetText(topic, returnNull: true);
7091 if (text.IsEmpty())
7092 {
7093 return null;
7094 }
7095 }
7096 return text.Split(Environment.NewLine.ToCharArray()).RandomItem();
7097 }
SourceCharaText charaText

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

◆ GetTotalFeat()

int Chara.GetTotalFeat ( )
inline

Definition at line 8268 of file Chara.cs.

8269 {
8270 int num = 0;
8271 if (base.c_upgrades != null)
8272 {
8273 num += base.c_upgrades.spent;
8274 }
8275 if (base.c_genes != null)
8276 {
8277 num += base.c_genes.GetTotalCost();
8278 }
8279 return num + base.feat;
8280 }

◆ GetWork()

Hobby Chara.GetWork ( string  id)
inline

Definition at line 9161 of file Chara.cs.

9162 {
9163 foreach (Hobby item in ListWorks())
9164 {
9165 if (item.source.alias == id)
9166 {
9167 return item;
9168 }
9169 }
9170 foreach (Hobby item2 in ListHobbies())
9171 {
9172 if (item2.source.alias == id)
9173 {
9174 return item2;
9175 }
9176 }
9177 return null;
9178 }
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 9313 of file Chara.cs.

9314 {
9315 if (_workSummary == null)
9316 {
9317 _workSummary = new WorkSummary();
9318 }
9319 return _workSummary;
9320 }
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 8407 of file Chara.cs.

8408 {
8409 if (c.IsHostile() || c.IsDeadOrSleeping)
8410 {
8411 Msg.Say("affinityNone", c, this);
8412 return;
8413 }
8414 if (!t.isCopy && t.IsCursed && t.IsEquipmentOrRanged && !t.IsAmmo && c.HasElement(1414))
8415 {
8416 bool num = t.blessedState == BlessedState.Doomed;
8417 int num2 = 200 + t.LV * 3;
8418 if (t.rarity == Rarity.Legendary)
8419 {
8420 num2 *= 3;
8421 }
8422 if (t.rarity >= Rarity.Mythical)
8423 {
8424 num2 *= 5;
8425 }
8426 if (num)
8427 {
8428 num2 *= 2;
8429 }
8430 EClass.pc.PlayEffect("identify");
8431 EClass.pc.PlaySound("identify");
8432 c.PlayEffect("mutation");
8433 c.Say("draw_curse", c, t);
8434 t.Destroy();
8435 List<Element> list = new List<Element>();
8436 foreach (Element value in EClass.pc.elements.dict.Values)
8437 {
8438 if (value is Spell)
8439 {
8440 list.Add(value);
8441 }
8442 }
8443 if (list.Count == 0)
8444 {
8446 return;
8447 }
8448 Element element = list.RandomItem();
8449 EClass.pc.ModExp(element.id, num2);
8450 EClass.pc.Say("draw_curse2", EClass.pc, element.Name);
8451 c.AddExp(Mathf.Min(num2 / 3, c.ExpToNext));
8452 return;
8453 }
8454 if ((t.id == "lovepotion" || t.id == "dreambug") && !Application.isEditor)
8455 {
8456 GiveLovePotion(c, t);
8457 return;
8458 }
8459 if (t.trait is TraitErohon && c.id == t.c_idRefName)
8460 {
8461 c.OnGiveErohon(t);
8462 return;
8463 }
8464 if (t.trait is TraitTicketMassage)
8465 {
8466 t.ModNum(-1);
8467 c.Talk("ticket");
8468 switch (t.id)
8469 {
8470 case "ticket_massage":
8471 c.ModAffinity(EClass.pc, 10);
8473 {
8474 target = c
8475 });
8476 break;
8477 case "ticket_armpillow":
8478 c.ModAffinity(EClass.pc, 20);
8479 EClass.pc.AddCondition<ConSleep>(300, force: true);
8480 c.SetAI(new AI_ArmPillow
8481 {
8482 target = EClass.pc
8483 });
8484 break;
8485 case "ticket_champagne":
8486 c.ModAffinity(EClass.pc, 10);
8488 break;
8489 }
8490 return;
8491 }
8492 if (t.id == "flyer")
8493 {
8494 stamina.Mod(-1);
8495 if (c.things.Find((Thing a) => a.id == "flyer") != null)
8496 {
8497 c.Talk("flyer_miss");
8498 DoHostileAction(c);
8499 return;
8500 }
8501 if (EClass.rnd(20) != 0 && c.CHA > EClass.rnd(base.CHA + Evalue(291) * 3 + 10))
8502 {
8503 Msg.Say("affinityNone", c, this);
8504 t.Destroy();
8505 elements.ModExp(291, 10f);
8506 return;
8507 }
8508 elements.ModExp(291, 50f);
8509 }
8510 if (t.id == "statue_weird")
8511 {
8512 EClass.pc.Say("statue_sell");
8513 }
8514 t.isGifted = true;
8515 c.nextUse = c.affinity.OnGift(t);
8516 if (!t.isDestroyed)
8517 {
8518 EClass.game.quests.list.ForeachReverse(delegate(Quest q)
8519 {
8520 q.OnGiveItem(c, t);
8521 });
8522 if (c.TryEquip(t))
8523 {
8524 c.nextUse = null;
8525 }
8526 }
8527 }
Thing OnGift(Thing t)
Definition: Affinity.cs:131
int ExpToNext
Definition: Card.cs:2034
bool isCopy
Definition: Card.cs:879
bool IsCursed
Definition: Card.cs:2283
int CHA
Definition: Card.cs:2375
bool IsEquipmentOrRanged
Definition: Card.cs:2246
void SayNothingHappans()
Definition: Card.cs:7015
string c_idRefName
Definition: Card.cs:1655
void AddExp(int a, bool applyMod=true)
Definition: Card.cs:2995
void GiveLovePotion(Chara c, Thing t)
Definition: Chara.cs:8540
bool TryEquip(Thing t, bool useFav=false)
Definition: Chara.cs:7874
void OnGiveErohon(Thing t)
Definition: Chara.cs:8529
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 8540 of file Chara.cs.

8541 {
8542 c.Say("give_love", c, t);
8543 c.PlaySound(t.material.GetSoundDead());
8544 c.ShowEmo(Emo.angry);
8545 c.ModAffinity(EClass.pc, -20, show: false);
8546 c.Talk("pervert");
8547 t.Destroy();
8548 }

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 6441 of file Chara.cs.

6442 {
6443 if (enemy == null && !IsPC)
6444 {
6445 if (GetInt(106) == 0)
6446 {
6447 TalkTopic("aggro");
6448 }
6449 if (OriginalHostility != Hostility.Enemy)
6450 {
6451 ShowEmo(Emo.angry);
6452 }
6453 SetEnemy(_tg.Chara);
6454 }
6456 {
6457 if (hostility >= Hostility.Neutral)
6458 {
6459 Say("angry", this);
6460 }
6461 hostility = Hostility.Enemy;
6462 }
6463 }
int GetInt(int id, int? defaultInt=null)
Definition: BaseCard.cs:25
virtual bool IsPCFactionMinion
Definition: Card.cs:2183

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 1306 of file Chara.cs.

1307 {
1308 return HasAccess(c.pos);
1309 }
bool HasAccess(Card c)
Definition: Chara.cs:1306

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 1311 of file Chara.cs.

1312 {
1313 if (!EClass._zone.IsPCFaction || p.cell.room == null || IsPC)
1314 {
1315 return true;
1316 }
1317 return p.cell.room.data.accessType switch
1318 {
1319 BaseArea.AccessType.Resident => memberType == FactionMemberType.Default,
1320 BaseArea.AccessType.Private => false,
1321 _ => true,
1322 };
1323 }

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

◆ HasCondition()

bool Chara.HasCondition ( string  alias)
inline

◆ HasCondition< T >()

override bool Chara.HasCondition< T > ( )
inlinevirtual

Reimplemented from Card.

Definition at line 9569 of file Chara.cs.

9570 {
9571 for (int i = 0; i < conditions.Count; i++)
9572 {
9573 if (conditions[i] is T)
9574 {
9575 return true;
9576 }
9577 }
9578 return false;
9579 }

◆ HasCooldown()

bool Chara.HasCooldown ( int  idEle)
inline

Definition at line 8882 of file Chara.cs.

8883 {
8884 return GetCooldown(idEle) != 0;
8885 }
int GetCooldown(int idEle)
Definition: Chara.cs:8887

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

◆ HasHigherGround()

bool Chara.HasHigherGround ( Card  c)
inline

Definition at line 1216 of file Chara.cs.

1217 {
1218 if (c == null)
1219 {
1220 return false;
1221 }
1222 float num = renderer.position.y - pos.Position(0).y + (_isLevitating ? 0.4f : 0f);
1223 float num2 = c.renderer.position.y - c.pos.Position(0).y + ((c.isChara && c.Chara._isLevitating) ? 0.4f : 0f);
1224 return num > num2 + 0.1f;
1225 }
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 9011 of file Chara.cs.

9012 {
9013 int num = EClass.sources.hobbies.alias.TryGetValue(alias)?.id ?? 0;
9014 listHobby.Clear();
9015 if (_works == null || _hobbies == null)
9016 {
9017 RerollHobby();
9018 }
9019 foreach (int work in _works)
9020 {
9021 if (work == num)
9022 {
9023 return true;
9024 }
9025 }
9026 foreach (int hobby in _hobbies)
9027 {
9028 if (hobby == num)
9029 {
9030 return true;
9031 }
9032 }
9033 return false;
9034 }
static List< Hobby > listHobby
Definition: Chara.cs:13
void RerollHobby(bool extraSlotChance=true)
Definition: Chara.cs:9274
SourceHobby hobbies

References SourceManager.hobbies, and EClass.sources.

Referenced by AI_Idle.Run().

◆ HasMinion()

bool Chara.HasMinion ( string  id)
inline

Definition at line 2432 of file Chara.cs.

2433 {
2434 foreach (Chara chara in EClass._map.charas)
2435 {
2436 if (chara.c_uidMaster == base.uid)
2437 {
2438 return true;
2439 }
2440 }
2441 return false;
2442 }

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

Referenced by ActEffect.ProcAt().

◆ HealAll()

void Chara.HealAll ( )
inline

Definition at line 1750 of file Chara.cs.

1751 {
1752 Cure(CureType.HealComplete);
1753 base.hp = MaxHP;
1754 mana.value = mana.max;
1755 stamina.value = stamina.max;
1756 Refresh();
1757 }
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 4533 of file Chara.cs.

4534 {
4535 if (held == t || t.isDestroyed || t.Num <= 0)
4536 {
4537 return;
4538 }
4539 if (IsPC && t.isNPCProperty)
4540 {
4541 t.isNPCProperty = false;
4542 if (!t.GetBool(128))
4543 {
4545 pos.TryWitnessCrime(this);
4546 }
4547 }
4548 PickHeld();
4549 if (t.isChara)
4550 {
4552 {
4553 t.ShowEmo(Emo.love);
4554 }
4555 EClass.player.altHeldPos = t.renderer.data.ForceAltHeldPosition || EClass.rnd(2) == 0;
4556 }
4557 else
4558 {
4559 if (num == -1 || num > t.Num)
4560 {
4561 num = t.Num;
4562 }
4563 if (num < t.Num)
4564 {
4565 t = t.Split(num);
4566 }
4567 }
4568 if (t.GetRootCard() != this)
4569 {
4570 t = Pick(t.Thing, msg: false, tryStack: false);
4571 if (t.GetRootCard() != this)
4572 {
4573 return;
4574 }
4575 }
4576 held = t;
4577 if (held.GetLightRadius() > 0)
4578 {
4580 }
4581 if (IsPC)
4582 {
4584 WidgetHotbar.dirtyCurrentItem = true;
4585 }
4586 }
Thing Split(int a)
Definition: Card.cs:3538
bool isNPCProperty
Definition: Card.cs:555
void RecalculateFOV()
Definition: Card.cs:6559
virtual bool IsAliveInCurrentZone
Definition: Card.cs:2153
int GetLightRadius()
Definition: Card.cs:6606
void PickHeld(bool msg=false)
Definition: Chara.cs:4588
bool TryWitnessCrime(Chara criminal, Chara target=null, int radius=4, Func< Chara, bool > funcWitness=null)
Definition: Point.cs:873

References BaseCard.GetBool(), 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 9397 of file Chara.cs.

9398 {
9399 if (!onDeserialize)
9400 {
9401 _cints[10] = 20;
9402 _cints[11] = 70;
9403 _cints[13] = 70;
9404 _cints[14] = 70;
9405 _cints[15] = 70;
9406 _cints[17] = 0;
9407 _cints[18] = 0;
9408 }
9409 foreach (Condition condition in conditions)
9410 {
9411 condition.SetOwner(this, onDeserialize);
9412 }
9413 }
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 7716 of file Chara.cs.

7717 {
7718 if (t == null)
7719 {
7720 t = FindBestFoodToEat();
7721 }
7722 if (t == null)
7723 {
7724 t = things.Find((Thing a) => CanEat(a, shouldEat: true) && !a.c_isImportant);
7725 }
7726 if (t == null)
7727 {
7728 t = things.Find((Thing a) => CanEat(a) && !a.c_isImportant);
7729 }
7730 if (t != null)
7731 {
7732 Say("eat_start", this, t.Duplicate(1));
7733 if (sound)
7734 {
7735 PlaySound("eat");
7736 }
7737 FoodEffect.Proc(this, t);
7738 }
7739 }
Thing FindBestFoodToEat()
Definition: Chara.cs:7695
static void Proc(Chara c, Thing food, bool consume=true)
Definition: FoodEffect.cs:12

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 6703 of file Chara.cs.

6704 {
6705 if (faction == EClass.Home)
6706 {
6707 return homeZone == EClass.game.activeZone;
6708 }
6709 return false;
6710 }
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 1203 of file Chara.cs.

1204 {
1205 if (host == null || includeRide)
1206 {
1207 if (Evalue(1421) <= 0)
1208 {
1209 return base.hp < MaxHP / 5;
1210 }
1211 return base.hp + mana.value < (MaxHP + mana.max) / 5;
1212 }
1213 return false;
1214 }

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 2559 of file Chara.cs.

2560 {
2561 if (!currentZone.IsRegion && p.IsValid)
2562 {
2563 CellDetail detail = p.detail;
2564 if (detail != null && detail.charas.Count > 0)
2565 {
2566 foreach (Chara chara in p.detail.charas)
2567 {
2568 if (chara.mimicry == null && (chara.IsHostile(this) || chara.IsHostile() || !chara.trait.CanBePushed))
2569 {
2570 if (cancelAI && EClass.pc.ai is GoalManualMove)
2571 {
2572 EClass.pc.ai.Cancel();
2573 }
2574 return true;
2575 }
2576 }
2577 }
2578 }
2579 return false;
2580 }
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 2459 of file Chara.cs.

2460 {
2461 if (!IsPCPartyMinion)
2462 {
2463 return false;
2464 }
2465 foreach (Quest item in EClass.game.quests.list)
2466 {
2467 if (item is QuestEscort questEscort && questEscort.uidChara == base.uid)
2468 {
2469 return true;
2470 }
2471 }
2472 return false;
2473 }
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 6747 of file Chara.cs.

6748 {
6749 if (base.IsPCFactionOrMinion || IsFriendOrAbove())
6750 {
6752 {
6753 return true;
6754 }
6755 }
6756 else if (IsHostile() && c.IsHostile())
6757 {
6758 return true;
6759 }
6760 return false;
6761 }

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

◆ IsGuest()

◆ IsHomeMember()

◆ IsHostile() [1/2]

◆ IsHostile() [2/2]

bool Chara.IsHostile ( Chara  c)
inline

Definition at line 6651 of file Chara.cs.

6652 {
6653 if (c == null)
6654 {
6655 return false;
6656 }
6657 if (base.IsPCFactionOrMinion)
6658 {
6659 if ((c == EClass.pc.enemy && !c.IsPCFactionOrMinion) || c.hostility <= Hostility.Enemy)
6660 {
6661 return true;
6662 }
6663 }
6664 else
6665 {
6667 {
6668 return true;
6669 }
6670 if (OriginalHostility >= Hostility.Friend)
6671 {
6672 if (hostility <= Hostility.Enemy && c.IsPCFactionOrMinion)
6673 {
6674 return true;
6675 }
6676 if (c.hostility <= Hostility.Enemy && c.OriginalHostility == Hostility.Enemy)
6677 {
6678 return true;
6679 }
6680 }
6681 else if (OriginalHostility <= Hostility.Enemy && (c.IsPCFactionOrMinion || (c.OriginalHostility != Hostility.Enemy && c.hostility >= Hostility.Friend)))
6682 {
6683 return true;
6684 }
6685 }
6686 if (id == "unicorn" && (Evalue(418) < 0 || (c.HasElement(1216) && c.Evalue(418) < 1)))
6687 {
6688 return true;
6689 }
6690 return false;
6691 }
bool IsCriminal
Definition: Player.cs:1362

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 6717 of file Chara.cs.

6718 {
6719 return EClass.game.activeZone == currentZone;
6720 }

Referenced by BaseListPeople.IsDisabled().

◆ IsInSpot< T >()

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

Definition at line 6722 of file Chara.cs.

6722 : TraitSpot
6723 {
6724 foreach (T item in EClass._map.props.installed.traits.List<T>())
6725 {
6726 foreach (Point item2 in item.ListPoints())
6727 {
6728 if (pos.Equals(item2))
6729 {
6730 return true;
6731 }
6732 }
6733 }
6734 return false;
6735 }
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 6693 of file Chara.cs.

6694 {
6695 return hostility == Hostility.Neutral;
6696 }

Referenced by ActPlan._Update().

◆ IsNeutralOrAbove()

bool Chara.IsNeutralOrAbove ( )
inline

◆ IsValidGiftWeight()

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

Definition at line 8351 of file Chara.cs.

8352 {
8353 int num2 = ((!HasElement(1411)) ? 1 : 3);
8354 if (GetBurden(t, num) >= num2)
8355 {
8356 return false;
8357 }
8358 return true;
8359 }
int GetBurden(Card t=null, int num=-1)
Definition: Chara.cs:1845

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

◆ Kiss()

void Chara.Kiss ( Chara  c)
inline

Definition at line 6376 of file Chara.cs.

6377 {
6378 EClass.player.forceTalk = true;
6379 Talk("kiss", null, null, IsPC);
6380 PlaySound("kiss");
6381 renderer.PlayAnime(AnimeID.Kiss, c);
6382 int num = 2 + EClass.rnd(4) + ((!c.IsPC && c.affinity.CurrentStage < Affinity.Stage.Fond) ? (-EClass.rnd(10)) : 0);
6383 c.ShowEmo((num > 0) ? Emo.love : Emo.sad);
6384 if (num > 0 && EClass.rnd(IsPC ? 100 : 5000) == 0)
6385 {
6386 c.MakeEgg();
6387 }
6388 if (IsPC && this != c)
6389 {
6390 if (c.interest > 0)
6391 {
6392 c.ModAffinity(EClass.pc, num);
6393 c.interest -= 20 + EClass.rnd(10);
6394 }
6395 else
6396 {
6397 c.Say("affinityNone", c, EClass.pc);
6398 }
6399 }
6400 Effect.Get("love")._Play(pos, isSynced ? renderer.position : pos.Position(), 0f, c.pos);
6401 }
Effect _Play(Point from, Vector3 fromV, float fixY=0f, Point to=null, Sprite sprite=null)
Definition: Effect.cs:117

References Effect._Play(), Effect.Get(), interest, Card.MakeEgg(), ModAffinity(), EClass.pc, Card.pos, EClass.rnd(), Card.Say(), and Card.ShowEmo().

Referenced by ActKiss.Perform(), and DramaOutcome.wedding_kiss().

◆ ListAvailabeFeats()

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

Definition at line 10044 of file Chara.cs.

10045 {
10046 List<Element> list = new List<Element>();
10047 foreach (SourceElement.Row item in EClass.sources.elements.rows.Where((SourceElement.Row a) => a.group == "FEAT" && a.cost[0] != -1 && !a.categorySub.IsEmpty()))
10048 {
10050 int num = ((feat.ValueWithoutLink <= 0) ? 1 : (feat.ValueWithoutLink + 1));
10051 if (num <= feat.source.max && !feat.HasTag("class") && !feat.HasTag("hidden") && !feat.HasTag("innate") && (!pet || !feat.HasTag("noPet")) && (showAll || feat.IsPurchaseFeatReqMet(elements)))
10052 {
10053 list.Add(Element.Create(feat.id, num) as Feat);
10054 }
10055 }
10056 return list;
10057 }
int feat
Definition: Card.cs:375
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1111
Definition: FEAT.cs:316

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 9141 of file Chara.cs.

9142 {
9143 listHobby.Clear();
9144 if (!useMemberType || memberType != FactionMemberType.Livestock)
9145 {
9146 if (_hobbies == null)
9147 {
9148 RerollHobby();
9149 }
9150 foreach (int hobby in _hobbies)
9151 {
9152 listHobby.Add(new Hobby
9153 {
9154 id = hobby
9155 });
9156 }
9157 }
9158 return listHobby;
9159 }

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 9114 of file Chara.cs.

9115 {
9116 listHobby.Clear();
9117 if (useMemberType && memberType == FactionMemberType.Livestock)
9118 {
9119 listHobby.Add(new Hobby
9120 {
9121 id = 45
9122 });
9123 }
9124 else
9125 {
9126 if (_works == null)
9127 {
9128 RerollHobby();
9129 }
9130 foreach (int work in _works)
9131 {
9132 listHobby.Add(new Hobby
9133 {
9134 id = work
9135 });
9136 }
9137 }
9138 return listHobby;
9139 }

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 3590 of file Chara.cs.

3591 {
3592 angle = Util.GetAngle(p.x - pos.x, p.z - pos.z);
3593 if (EClass._zone.IsRegion)
3594 {
3595 if (angle > 100f && angle < 170f)
3596 {
3597 base.dir = 2;
3598 }
3599 else if (angle > 170f && angle < 190f)
3600 {
3601 base.dir = 0;
3602 }
3603 else if (angle > 190f || (angle < -10f && angle > -100f))
3604 {
3605 base.dir = 3;
3606 }
3607 else
3608 {
3609 base.dir = 1;
3610 }
3611 angle -= 45f;
3612 }
3613 else if (angle > 170f && angle < 235f)
3614 {
3615 base.dir = 0;
3616 }
3617 else if (angle > 80f && angle < 145f)
3618 {
3619 base.dir = 1;
3620 }
3621 else if (angle > -100f && angle < -35f)
3622 {
3623 base.dir = 3;
3624 }
3625 else if (angle > -10f && angle < 55f)
3626 {
3627 base.dir = 2;
3628 }
3630 }

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

◆ MakeAlly()

void Chara.MakeAlly ( bool  msg = true)
inline

Definition at line 2325 of file Chara.cs.

2326 {
2327 if (IsLocalChara && !base.IsUnique)
2328 {
2329 Debug.Log("Creating Replacement NPC for:" + this);
2331 }
2332 _MakeAlly();
2333 if (msg)
2334 {
2335 EClass.pc.Say("hire", this);
2336 EClass.Sound.Play("good");
2337 }
2338 EClass.pc.party.AddMemeber(this);
2339 if (EClass._zone.IsTown)
2340 {
2342 }
2343 }
Chara CreateReplacement()
Definition: Chara.cs:8162
void _MakeAlly()
Definition: Chara.cs:2345
virtual bool IsTown
Definition: Zone.cs:225
void RefreshListCitizen()
Definition: Zone.cs:3616

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 8330 of file Chara.cs.

8331 {
8332 return DNA.GenerateGene(this, DNA.Type.Brain);
8333 }
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 8325 of file Chara.cs.

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

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 5309 of file Chara.cs.

5310 {
5311 if (!EClass._zone.IsRegion)
5312 {
5313 List<string> list = new List<string> { "930", "931", "947", "948", "949", "950", "951", "952" };
5314 if (IsPC && EClass.rnd(2) == 0 && EClass.pc.things.Find("letter_will") != null)
5315 {
5316 list = new List<string> { "944", "946", "backerGrave", "backerGrave2" };
5317 }
5318 Thing thing = ThingGen.Create(list.RandomItem());
5319 thing.MakeRefFrom(this);
5320 if (!lastword.IsEmpty())
5321 {
5322 thing.c_note = lastword;
5323 }
5324 thing.isModified = true;
5325 EClass._zone.AddCard(thing, pos).Install();
5326 }
5327 }
Card MakeRefFrom(string id)
Definition: Card.cs:5772

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 2388 of file Chara.cs.

2389 {
2390 UnmakeMinion();
2391 Hostility hostility2 = (base.c_originalHostility = (_master.IsPCFaction ? Hostility.Ally : _master.hostility));
2392 this.hostility = hostility2;
2393 base.c_uidMaster = _master.uid;
2394 base.c_minionType = type;
2395 master = _master;
2396 Refresh();
2397 }
int uid
Definition: Card.cs:123

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

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

◆ MakePartyMemeber()

void Chara.MakePartyMemeber ( )
inline

Definition at line 2319 of file Chara.cs.

2320 {
2321 _MakeAlly();
2322 EClass.pc.party.AddMemeber(this);
2323 }

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

◆ Marry()

void Chara.Marry ( Chara  c)
inline

Definition at line 8223 of file Chara.cs.

8224 {
8225 if (base.c_love == null)
8226 {
8227 base.c_love = new LoveData();
8228 }
8229 base.c_love.dateMarriage = EClass.world.date.GetRaw();
8230 base.c_love.uidZoneMarriage = EClass._zone.uid;
8231 base.c_love.nameZoneMarriage = EClass._zone.Name;
8232 SetFeat(1275, 1, msg: true);
8234 }
int GetRaw(int offsetHours=0)
Definition: Date.cs:328
int married
Definition: Player.cs:129
int uid
Definition: Spatial.cs:70

References EClass._zone, World.date, Date.GetRaw(), Player.Stats.married, Spatial.Name, EClass.player, Player.stats, Spatial.uid, and EClass.world.

Referenced by DramaOutcome.marry().

◆ ModAffinity()

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

Definition at line 8084 of file Chara.cs.

8085 {
8086 if (c == this)
8087 {
8088 return;
8089 }
8090 if (IsPC)
8091 {
8092 c.ModAffinity(EClass.pc, a, show);
8093 }
8094 else
8095 {
8097 {
8098 return;
8099 }
8100 int num = StatsHygiene.GetAffinityMod(EClass.pc.hygiene.GetPhase()) + (HasElement(417) ? 30 : 0) + (EClass.pc.HasCondition<ConSmoking>() ? (-30) : 0);
8101 if (IsPCFaction && homeBranch != null)
8102 {
8103 num += (int)Mathf.Sqrt(homeBranch.Evalue(2117)) * 5;
8104 }
8105 bool flag = a > 0;
8106 if (flag)
8107 {
8108 a = a * num / 100;
8109 if (affinity.GetLunchChance() > EClass.rnd(100) && GetInt(71) >= 0 && GetInt(71) < EClass.world.date.GetRaw())
8110 {
8111 SetInt(71, -1);
8112 }
8113 }
8114 if (show)
8115 {
8116 if (a == 0)
8117 {
8118 if (!showOnlyEmo)
8119 {
8120 Say("affinityNone", this, c);
8121 }
8122 }
8123 else
8124 {
8125 ShowEmo((!flag) ? Emo.angry : Emo.love);
8126 c.ShowEmo(flag ? Emo.love : Emo.sad);
8127 if (!showOnlyEmo)
8128 {
8129 Say(flag ? "affinityPlus" : "affinityMinus", this, c);
8130 }
8131 }
8132 }
8133 if (c.IsPC)
8134 {
8135 a = affinity.Mod(a);
8136 }
8137 }
8138 }
int Mod(int a)
Definition: Affinity.cs:194
int GetLunchChance()
Definition: Affinity.cs:88
Stats hygiene
Definition: Chara.cs:1178
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(), Kiss(), 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 10001 of file Chara.cs.

10002 {
10003 if (a > 0)
10004 {
10005 if (Evalue(962) >= 25 || (ResistLv(962) > 0 && EClass.rnd(ResistLv(962) + 1) != 0))
10006 {
10007 return;
10008 }
10009 int num = Evalue(412);
10010 if (num != 0)
10011 {
10012 float num2 = (float)a * 100f / (float)Mathf.Max(100 + num * 2, 10);
10013 a = (int)num2 + ((EClass.rndf(1f) < num2 % 1f) ? 1 : 0);
10014 }
10015 }
10016 if (a == 0)
10017 {
10018 return;
10019 }
10020 int num3 = (corruption + a) / 100 - corruption / 100;
10021 for (int i = 0; i < Mathf.Abs(num3); i++)
10022 {
10023 if (!MutateRandom((num3 > 0) ? 1 : (-1), 100, ether: true))
10024 {
10025 break;
10026 }
10027 }
10028 corruption += a;
10029 int num4 = 0;
10030 foreach (Element value in elements.dict.Values)
10031 {
10032 if (value.source.category == "ether")
10033 {
10034 num4 += value.Value;
10035 }
10036 }
10037 if (num4 > 0 && IsPC)
10038 {
10039 Tutorial.Reserve("ether");
10040 }
10041 corruption = num4 * 100 + corruption % 100;
10042 }
bool MutateRandom(int vec=0, int tries=100, bool ether=false, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:10160
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 9950 of file Chara.cs.

9951 {
9952 if (!HasElement(450))
9953 {
9954 long num = bio.height;
9955 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
9956 if (num < 1)
9957 {
9958 num = 1L;
9959 }
9960 if (num > 999999999)
9961 {
9962 num = 999999999L;
9963 }
9964 if (num != bio.height)
9965 {
9966 bio.height = (int)num;
9967 Say((a > 0) ? "height_gain" : "height_lose", this);
9968 }
9969 }
9970 }
int height
Definition: Biography.cs:53

◆ ModTempElement()

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

Definition at line 10416 of file Chara.cs.

10417 {
10418 if (a < 0 && !naturalDecay && HasElement(EClass.sources.elements.alias["sustain_" + EClass.sources.elements.map[ele].alias]?.id ?? 0))
10419 {
10420 return;
10421 }
10422 bool flag = HasElement(1215);
10423 if (tempElements == null)
10424 {
10426 tempElements.SetParent(this);
10427 }
10428 if (a > 0 && flag)
10429 {
10430 a = a * 150 / 100;
10431 }
10432 int num = elements.ValueWithoutLink(ele);
10433 int num2 = Mathf.Abs(num) + 100;
10434 int num3 = num2 / (flag ? 2 : 4);
10435 int num4 = -num - 100;
10436 int num5 = tempElements.Base(ele);
10437 int num6 = num5 + a;
10438 if (onlyRenew)
10439 {
10440 num3 = Mathf.Min(a, num3);
10441 num4 = Mathf.Max(a, -num2 / 3);
10442 }
10443 if (a > 0 && num6 > num3)
10444 {
10445 a = ((num3 > num5) ? (num3 - num5) : 0);
10446 }
10447 if (a < 0 && num6 < num4)
10448 {
10449 a = ((num4 < num5) ? (num4 - num5) : 0);
10450 }
10451 Element element = tempElements.ModBase(ele, a);
10452 if (element.vBase == 0)
10453 {
10454 tempElements.Remove(element.id);
10455 if (tempElements.dict.Count == 0)
10456 {
10457 tempElements = null;
10458 }
10459 }
10460 }
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 9972 of file Chara.cs.

9973 {
9974 if (HasElement(450) || a == 0)
9975 {
9976 return;
9977 }
9978 long num = bio.weight;
9979 long num2 = bio.height;
9980 long num3 = num2 * num2 * 18 / 25000;
9981 long num4 = num2 * num2 * 24 / 10000;
9982 if (ignoreLimit || (num > num3 && num < num4))
9983 {
9984 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
9985 if (num < 1)
9986 {
9987 num = 1L;
9988 }
9989 if (num > 999999999)
9990 {
9991 num = 999999999L;
9992 }
9993 if (num != bio.weight)
9994 {
9995 bio.weight = (int)num;
9996 Say((a > 0) ? "weight_gain" : "weight_lose", this);
9997 }
9998 }
9999 }
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 2673 of file Chara.cs.

2674 {
2675 if (!newPoint.sourceBlock.tileType.IsBlockPass && (!checkWall || (Dist(newPoint) <= 1 && CanMoveTo(newPoint, allowDestroyPath: false))) && _Move(newPoint, MoveType.Force) == MoveResult.Success && ai.Current.CancelWhenMoved)
2676 {
2677 ai.Current.TryCancel(c);
2678 }
2679 }
bool TryCancel(Card c)
Definition: AIAct.cs:280
virtual bool CancelWhenMoved
Definition: AIAct.cs:96
override MoveResult _Move(Point newPoint, MoveType type=MoveType.Walk)
Definition: Chara.cs:2767

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 3506 of file Chara.cs.

3507 {
3508 if (isDead)
3509 {
3510 Revive();
3511 }
3512 else
3513 {
3514 Cure(CureType.Death);
3515 }
3516 CureCondition<ConSuspend>();
3517 if (IsPCParty)
3518 {
3520 }
3521 FactionBranch factionBranch = homeBranch;
3522 if (x == -1)
3523 {
3524 x = 50;
3525 }
3526 if (z == -1)
3527 {
3528 z = 50;
3529 }
3530 Point point = new Point(x, z);
3531 if (zone.IsActiveZone)
3532 {
3533 point = point.GetNearestPoint(allowBlock: false, allowChara: false);
3534 }
3535 zone.AddCard(this, point);
3536 SetHomeZone(zone);
3537 global.transition = new ZoneTransition
3538 {
3539 state = ZoneTransition.EnterState.Dead,
3540 x = point.x,
3541 z = point.z
3542 };
3543 orgPos = new Point(x, z);
3544 if (factionBranch != null)
3545 {
3547 factionBranch.policies.Validate();
3548 }
3549 }
void RefreshWorkElements(ElementContainer parent=null)
Definition: Chara.cs:9180
Chara SetHomeZone(Zone zone)
Definition: Chara.cs:1461
PolicyManager policies
bool IsActiveZone
Definition: Zone.cs:497

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 2655 of file Chara.cs.

2656 {
2657 List<Point> list = new List<Point>();
2658 pos.ForeachNeighbor(delegate(Point p)
2659 {
2660 list.Add(p.Copy());
2661 });
2662 list.Shuffle();
2663 foreach (Point item in list)
2664 {
2665 if (!item.Equals(pos) && !item.HasChara && TryMove(item) == MoveResult.Success)
2666 {
2667 return true;
2668 }
2669 }
2670 return false;
2671 }
override MoveResult TryMove(Point newPoint, bool allowDestroyPath=true)
Definition: Chara.cs:2743
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 2641 of file Chara.cs.

2642 {
2643 Point randomNeighbor = pos.GetRandomNeighbor();
2644 if (!randomNeighbor.Equals(pos) && !randomNeighbor.HasChara && HasAccess(randomNeighbor))
2645 {
2646 if ((race.tag.Contains("water") || source.tag.Contains("water")) && pos.cell.IsTopWaterAndNoSnow && !randomNeighbor.IsDeepWater)
2647 {
2648 return false;
2649 }
2650 return TryMove(randomNeighbor) == MoveResult.Success;
2651 }
2652 return false;
2653 }
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 3379 of file Chara.cs.

3380 {
3381 if (z == currentZone)
3382 {
3383 return;
3384 }
3385 if (HasCondition<ConInvulnerable>())
3386 {
3387 RemoveCondition<ConInvulnerable>();
3388 }
3389 if (IsPC)
3390 {
3391 EClass.player.nextZone = z;
3393 {
3396 {
3397 if (EClass.player.returnInfo != null)
3398 {
3399 EClass.player.returnInfo.turns += 5;
3400 }
3402 {
3403 EClass.game.Save(isAutoSave: true);
3404 }
3405 }
3406 EClass.player.deathZoneMove = false;
3407 }
3409 if (currentZone.instance != null)
3410 {
3412 z = EClass.game.spatials.Find(instance.uidZone) ?? EClass.pc.homeZone;
3413 transition = new ZoneTransition
3414 {
3415 state = instance.ReturnState,
3416 x = instance.x,
3417 z = instance.z
3418 };
3419 instance.OnLeaveZone();
3420 Debug.Log(z);
3421 }
3422 EInput.Consume(consumeAxis: true);
3423 EClass.player.uidLastZone = currentZone.uid;
3425 {
3427 {
3428 Msg.Say("enterZone", z.Name);
3429 }
3430 else
3431 {
3432 if (z.IsRegion)
3433 {
3434 Msg.Say("leaveZone", currentZone.Name);
3435 }
3436 else if (z.id != currentZone.id)
3437 {
3438 Msg.Say("enterZone", z.Name);
3439 }
3440 EClass.player.lastZonePos = pos.Copy();
3441 }
3442 EClass.player.lastTransition = transition;
3443 }
3444 foreach (Chara item in EClass._map.charas.Where((Chara c) => c.IsPCPartyMinion && c.master != EClass.pc).ToList())
3445 {
3447 }
3448 EClass.player.listCarryoverMap = EClass._map.charas.Where((Chara c) => c.c_uidMaster != 0 && c.FindMaster() == EClass.pc && c.c_minionType == MinionType.Default).ToList();
3449 if (!z.IsRegion && (z is Zone_Tent || currentZone is Zone_Tent))
3450 {
3451 foreach (Chara chara in EClass._map.charas)
3452 {
3453 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))
3454 {
3455 EClass.player.listCarryoverMap.Add(chara);
3456 }
3457 }
3458 }
3459 foreach (Chara item2 in EClass.player.listCarryoverMap)
3460 {
3461 EClass._zone.RemoveCard(item2);
3462 }
3463 }
3464 if (party != null && party.leader == this)
3465 {
3466 foreach (Chara member in party.members)
3467 {
3468 if (member != this && !member.isDead && member.parent is Zone)
3469 {
3470 member.MoveZone(z);
3471 }
3472 }
3473 }
3474 if (global == null)
3475 {
3476 Debug.Log(base.Name);
3477 return;
3478 }
3479 transition.uidLastZone = currentZone?.uid ?? 0;
3480 global.transition = transition;
3481 if (z.IsActiveZone)
3482 {
3483 Point spawnPos = z.GetSpawnPos(this);
3484 global.transition = null;
3485 if (IsPC)
3486 {
3487 EClass.player.lastTransition = null;
3488 }
3489 z.AddCard(this, spawnPos);
3490 if (IsBranchMember())
3491 {
3493 }
3494 }
3495 else
3496 {
3497 z.AddCard(this);
3498 }
3499 }
MinionType c_minionType
Definition: Card.cs:989
bool IsBranchMember()
Definition: Chara.cs:6703
GlobalData global
Definition: Chara.cs:76
Chara FindMaster()
Definition: Chara.cs:2450
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:1192
List< Chara > listCarryoverMap
Definition: Player.cs:1246
ReturnInfo returnInfo
Definition: Player.cs:889
bool simulatingZone
Definition: Player.cs:1202
void AssignCharas()
Definition: RoomManager.cs:39
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:265
Point GetSpawnPos(Chara c, ZoneTransition.EnterState destState=ZoneTransition.EnterState.Auto)
Definition: Zone.cs:1352

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 3371 of file Chara.cs.

3372 {
3374 {
3375 state = state
3376 });
3377 }

◆ MutateRandom()

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

Definition at line 10160 of file Chara.cs.

10161 {
10162 if (!ether && vec >= 0 && HasElement(406) && EClass.rnd(5) != 0)
10163 {
10164 Say("resistMutation", this);
10165 return false;
10166 }
10167 IEnumerable<SourceElement.Row> ie = EClass.sources.elements.rows.Where((SourceElement.Row a) => a.category == (ether ? "ether" : "mutation") && !a.tag.Contains("noRandomMutation"));
10168 for (int i = 0; i < tries; i++)
10169 {
10170 SourceElement.Row row = ie.RandomItem();
10171 if (i == 0 && vec < 0 && ether && base.c_corruptionHistory != null && base.c_corruptionHistory.Count > 0)
10172 {
10173 if (EClass.sources.elements.map.ContainsKey(base.c_corruptionHistory.LastItem()))
10174 {
10175 row = EClass.sources.elements.map[base.c_corruptionHistory.LastItem()];
10176 }
10177 base.c_corruptionHistory.RemoveAt(base.c_corruptionHistory.Count - 1);
10178 if (base.c_corruptionHistory.Count == 0)
10179 {
10180 base.c_corruptionHistory = null;
10181 }
10182 }
10183 Element element = elements.GetElement(row.id);
10184 int num = 1;
10185 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))
10186 {
10187 continue;
10188 }
10189 if (element == null && !row.aliasParent.IsEmpty() && elements.Has(row.aliasParent))
10190 {
10191 row = EClass.sources.elements.alias[row.aliasParent];
10192 element = elements.GetElement(row.id);
10193 }
10194 bool flag = row.tag.Contains("neg");
10195 if (vec > 0)
10196 {
10197 if ((state >= BlessedState.Blessed && flag) || (state <= BlessedState.Cursed && !flag))
10198 {
10199 continue;
10200 }
10201 }
10202 else if (vec < 0 && ((state >= BlessedState.Blessed && !flag) || (state <= BlessedState.Cursed && flag)))
10203 {
10204 continue;
10205 }
10206 bool flag2 = true;
10207 if (element != null)
10208 {
10209 num = element.Value + ((vec != 0) ? vec : ((EClass.rnd(2) == 0) ? 1 : (-1)));
10210 if (num > element.source.max)
10211 {
10212 num = element.source.max - 1;
10213 }
10214 flag = (flag && num > element.Value) || (!flag && num < element.Value);
10215 flag2 = num > element.Value;
10216 if (vec > 0 && !flag2)
10217 {
10218 continue;
10219 }
10220 }
10221 Say(flag2 ? "mutation_gain" : "mutation_loose", this);
10222 SetFeat(row.id, num);
10223 if (flag2 && ether)
10224 {
10225 if (base.c_corruptionHistory == null)
10226 {
10227 base.c_corruptionHistory = new List<int>();
10228 }
10229 base.c_corruptionHistory.Add(row.id);
10230 if (IsPCFaction)
10231 {
10232 Element element2 = elements.GetElement(row.id);
10233 WidgetPopText.Say("popEther".lang(element2.Name, base.Name));
10234 }
10236 {
10237 EClass.player.flags.gotEtherDisease = true;
10238 Thing thing = ThingGen.Create("parchment");
10239 thing.SetStr(53, "letter_ether");
10240 Thing thing2 = ThingGen.Create("1165");
10241 thing2.SetBlessedState(BlessedState.Normal);
10242 Thing p = ThingGen.CreateParcel(null, thing2, thing);
10244 }
10245 }
10246 if (EClass.core.IsGameStarted && pos != null)
10247 {
10248 PlaySound(ether ? "mutation_ether" : "mutation");
10249 PlayEffect("mutation");
10251 Say(row.GetText(flag ? "textDec" : "textInc", returnNull: true) ?? row.alias, this);
10252 }
10253 return true;
10254 }
10255 Say("nothingHappens");
10256 return false;
10257 }
void SetStr(int id, string value=null)
Definition: BaseCard.cs:63
virtual void SetBlessedState(BlessedState s)
Definition: Card.cs:3949
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:478
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 10309 of file Chara.cs.

10310 {
10311 if (_historyFood != null)
10312 {
10313 while (_historyFood.Count > 5)
10314 {
10315 _historyFood.RemoveAt(_historyFood.Count - 1);
10316 }
10317 if (_historyFood[0].Count > 0)
10318 {
10319 _historyFood.Insert(0, new List<string>());
10320 }
10321 }
10322 }

Referenced by GameDate.AdvanceDay().

◆ OnBanish()

void Chara.OnBanish ( )
inline

Definition at line 1475 of file Chara.cs.

1476 {
1477 if (!IsGlobal)
1478 {
1479 return;
1480 }
1481 memberType = FactionMemberType.Default;
1482 foreach (Thing item in things.List((Thing a) => a.HasTag(CTAG.godArtifact)).ToList())
1483 {
1485 }
1486 UniqueData uniqueData = base.c_uniqueData;
1487 if (uniqueData != null)
1488 {
1489 Debug.Log(uniqueData.uidZone + "/" + EClass.game.spatials.map.ContainsKey(uniqueData.uidZone) + "/" + uniqueData.x + "/" + uniqueData.y);
1490 }
1491 if (uniqueData != null && EClass.game.spatials.map.ContainsKey(uniqueData.uidZone))
1492 {
1493 MoveHome(EClass.game.spatials.map[uniqueData.uidZone] as Zone, uniqueData.x, uniqueData.y);
1494 return;
1495 }
1496 Zone z = EClass.game.spatials.Find("somewhere");
1497 if (trait is TraitAdventurer)
1498 {
1499 z = EClass.world.region.ListTowns().RandomItem();
1500 SetHomeZone(z);
1501 }
1502 MoveZone(z, ZoneTransition.EnterState.RandomVisit);
1503 }
void PickOrDrop(Point p, string idThing, int idMat=-1, int num=1, bool msg=true)
Definition: Chara.cs:4349
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 1542 of file Chara.cs.

1543 {
1544 if (source.job == "*r")
1545 {
1546 base.c_idJob = EClass.sources.jobs.rows.Where((SourceJob.Row j) => j.playable < 4).RandomItem().id;
1547 }
1548 if (bp.idJob != null)
1549 {
1550 base.c_idJob = bp.idJob;
1551 }
1552 if (bp.idRace != null)
1553 {
1554 base.c_idRace = bp.idRace;
1555 }
1556 }
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 1558 of file Chara.cs.

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

1354 {
1355 isCreated = true;
1356 _cbits1.Bits = (uint)_cints[0];
1357 InitStats(onDeserialize: true);
1358 body.SetOwner(this, deserialized: true);
1359 elements.ApplyElementMap(base.uid, SourceValueType.Chara, job.elementMap, base.DefaultLV);
1360 elements.ApplyElementMap(base.uid, SourceValueType.Chara, race.elementMap, base.DefaultLV);
1361 if (global != null && global.goal != null)
1362 {
1363 global.goal.SetOwner(this);
1364 }
1365 if (IsPCC)
1366 {
1367 pccData.state = (base.isCensored ? PCCState.Naked : PCCState.Normal);
1368 }
1369 if (tempElements != null)
1370 {
1371 tempElements.SetParent(this);
1372 }
1373 UpdateAngle();
1375 Refresh();
1376 if (source.tag.Contains("boss"))
1377 {
1378 bossText = true;
1379 }
1380 sharedCheckTurn = EClass.rnd(200);
1381 }
int sharedCheckTurn
Definition: Chara.cs:120
void UpdateAngle()
Definition: Chara.cs:3632
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 8529 of file Chara.cs.

8530 {
8531 Say("give_erohon", this);
8532 AddCondition<ConParalyze>(50, force: true);
8533 AddCondition<ConConfuse>(50, force: true);
8534 AddCondition<ConFear>(1000, force: true);
8535 ModAffinity(EClass.pc, 100);
8536 t.Destroy();
8537 Talk("pervert");
8538 }

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

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

◆ OnInsulted()

void Chara.OnInsulted ( )
inline

Definition at line 8335 of file Chara.cs.

8336 {
8337 if (!isDead)
8338 {
8339 if (HasElement(1231))
8340 {
8341 Talk("insulted");
8342 AddCondition<ConEuphoric>(100 * Evalue(1231));
8343 }
8344 else if (EClass.rnd(20) == 0)
8345 {
8346 SetFeat(1231, 1, msg: true);
8347 }
8348 }
8349 }

References EClass.rnd().

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

◆ OnSerializing()

override void Chara.OnSerializing ( )
inlineprotectedvirtual

Reimplemented from Card.

Definition at line 1338 of file Chara.cs.

1339 {
1340 if (enemy != null)
1341 {
1342 SetInt(55, enemy.uid);
1343 }
1344 _cints[0] = (int)_cbits1.Bits;
1345 List<BodySlot> slots = body.slots;
1346 rawSlots = new int[slots.Count];
1347 for (int i = 0; i < slots.Count; i++)
1348 {
1349 rawSlots[i] = slots[i].elementId;
1350 }
1351 }
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 9912 of file Chara.cs.

9913 {
9914 if (days < 1)
9915 {
9916 days = 1;
9917 }
9918 int num = power * days;
9919 if (stamina.value < 0)
9920 {
9921 stamina.Set(1);
9922 }
9923 if (isWeakToSunlight && isSunLit)
9924 {
9925 base.hp = 0;
9926 if (mana.value > 0)
9927 {
9928 mana.Set(0);
9929 }
9930 AddCondition<ConBurning>(1000, force: true);
9931 }
9932 else
9933 {
9934 HealHP(num);
9935 stamina.Mod(10 + 25 * num / 100 * (100 + elements.GetFeatRef(1642)) / 100);
9936 mana.Mod(num);
9937 }
9938 if (IsPCFaction)
9939 {
9940 hunger.Mod(20);
9941 }
9942 sleepiness.Set(0);
9943 if (!IsMinion)
9944 {
9945 interest = 100;
9946 }
9947 Cure(CureType.Sleep, power);
9948 }
virtual void HealHP(int a, HealSource origin=HealSource.None)
Definition: Card.cs:4057
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 9892 of file Chara.cs.

9893 {
9894 bool isSunLit = pos.IsSunLit;
9895 TraitPillow traitPillow = pos.FindThing<TraitPillow>();
9896 int num = bed?.Power ?? 20;
9897 if (traitPillow != null)
9898 {
9899 num += traitPillow.owner.Power / 2;
9900 }
9901 if (bed != null)
9902 {
9903 num += bed.Evalue(750) * 5;
9904 if (bed.trait is TraitBedCoffin)
9905 {
9906 isSunLit = false;
9907 }
9908 }
9909 OnSleep(num, days, isSunLit);
9910 }
void OnSleep(Thing bed=null, int days=1)
Definition: Chara.cs:9892
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 2219 of file Chara.cs.

2220 {
2221 return s switch
2222 {
2223 "é ­" => 30,
2224 "首" => 31,
2225 "体" => 32,
2226 "背" => 33,
2227 "手" => 35,
2228 "指" => 36,
2229 "è…•" => 34,
2230 "è…°" => 37,
2231 "è¶³" => 39,
2232 _ => -1,
2233 };
2234 }

Referenced by ApplyRace(), and ResetBody().

◆ PerformWork()

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

Definition at line 9355 of file Chara.cs.

9356 {
9357 Hobby hobby = new Hobby();
9358 hobby.id = session.id;
9359 WorkSummary workSummary = _workSummary;
9360 hobby.GetAI(this).OnPerformWork(IsRealTime);
9361 if (!isHobby)
9362 {
9363 workSummary.progress += EClass.rnd(5) + 5;
9364 }
9365 int num = PerformWork(hobby, 0, isHobby);
9366 int num2 = PerformWork(hobby, 1, isHobby);
9367 int num3 = PerformWork(hobby, 2, isHobby);
9368 int num4 = PerformWork(hobby, 3, isHobby);
9369 workSummary.money += num;
9370 workSummary.food += num2;
9371 workSummary.knowledge += num3;
9372 workSummary.material += num4;
9373 int PerformWork(Hobby work, int idx, bool isHobby)
9374 {
9375 if (idx >= work.source.resources.Length)
9376 {
9377 return 0;
9378 }
9379 int num5 = work.source.resources[idx];
9380 int num6 = num5;
9381 num5 = Rand.Range(num5 * (100 - work.source.resources[idx]) / 100, num5);
9382 num5 = num5 * (isHobby ? 50 : 100) * session.efficiency / 10000;
9383 if (num6 > 0 && num5 <= 0)
9384 {
9385 num5 = 1;
9386 }
9387 return num5;
9388 }
9389 }
virtual void OnPerformWork(bool realtime)
Definition: AIWork.cs:150
void PerformWork(WorkSession session, bool isHobby=false, bool IsRealTime=false)
Definition: Chara.cs:9355
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 4369 of file Chara.cs.

4370 {
4371 if (t.trait is TraitCard && t.isNew && EClass.game.config.autoCollectCard && !t.c_idRefCard.IsEmpty())
4372 {
4374 return t;
4375 }
4376 if (t.parent == this)
4377 {
4378 return t;
4379 }
4380 t = TryPoisonPotion(t);
4381 ThingContainer.DestData dest = things.GetDest(t, tryStack);
4382 if (!dest.IsValid)
4383 {
4384 if (t.parent != EClass._zone)
4385 {
4386 if (IsPC)
4387 {
4388 Say("backpack_full_drop", t);
4389 SE.Drop();
4390 }
4391 return EClass._zone.AddCard(t, pos).Thing;
4392 }
4393 if (IsPC)
4394 {
4395 Say("backpack_full", t);
4396 }
4397 return t;
4398 }
4399 if (dest.stack != null)
4400 {
4401 if (msg)
4402 {
4403 PlaySound("pick_thing");
4404 Say("pick_thing", this, t);
4405 }
4406 t.TryStackTo(dest.stack);
4407 return dest.stack;
4408 }
4409 TryAbsorbRod(t);
4410 if (msg)
4411 {
4412 PlaySound("pick_thing");
4413 Say("pick_thing", this, t);
4414 }
4416 return dest.container.AddThing(t, tryStack);
4417 }
bool isNew
Definition: Card.cs:483
bool TryStackTo(Thing to)
Definition: Card.cs:3451
string c_idRefCard
Definition: Card.cs:1751
void TryReservePickupTutorial(Thing t)
Definition: Chara.cs:4463
Thing TryPoisonPotion(Thing t)
Definition: Chara.cs:4419
void TryAbsorbRod(Thing t)
Definition: Chara.cs:4433
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 4588 of file Chara.cs.

4589 {
4590 if (held == null)
4591 {
4592 return;
4593 }
4594 Card card = held;
4595 if (IsPC && held.invY == 1)
4596 {
4597 WidgetHotbar.dirtyCurrentItem = true;
4599 held = null;
4600 return;
4601 }
4602 if (held.isChara)
4603 {
4604 DropHeld();
4605 return;
4606 }
4608 {
4609 Say("canOnlyCarry", held);
4610 DropHeld();
4611 return;
4612 }
4613 bool flag = held != things.TryStack(held.Thing);
4614 if (!flag && things.IsOverflowing())
4615 {
4616 if (IsPC)
4617 {
4618 Say("backpack_full_drop", held);
4619 SE.Drop();
4620 }
4621 DropHeld();
4622 return;
4623 }
4624 if (msg)
4625 {
4626 PlaySound("pick_thing");
4627 Say("pick_held", this, card);
4628 if (IsPC && card.id == "statue_weird")
4629 {
4630 Say("statue_pick");
4631 }
4632 }
4633 if (IsPC)
4634 {
4635 WidgetHotbar.dirtyCurrentItem = true;
4636 if (!flag)
4637 {
4639 if (held.GetRootCard() != EClass.pc)
4640 {
4641 Pick(held.Thing, msg: false);
4642 }
4643 }
4644 }
4645 held = null;
4646 }
int invY
Definition: Card.cs:1981
bool IsHotItem
Definition: Card.cs:120
Card DropHeld(Point dropPos=null)
Definition: Chara.cs:4665
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 4349 of file Chara.cs.

4350 {
4351 if (num != 0)
4352 {
4353 PickOrDrop(p, ThingGen.Create(idThing, idMat).SetNum(num), msg);
4354 }
4355 }

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 4357 of file Chara.cs.

4358 {
4359 if (things.GetDest(t).IsValid)
4360 {
4361 Pick(t, msg);
4362 }
4363 else
4364 {
4365 EClass._zone.AddCard(t, p);
4366 }
4367 }

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

◆ Refresh()

void Chara.Refresh ( bool  calledRecursive = false)
inline

Definition at line 1759 of file Chara.cs.

1760 {
1761 if (source == null)
1762 {
1763 Debug.LogError("source is null");
1764 SetSource();
1765 }
1766 if (ride != null && ride.source != null)
1767 {
1768 ride.Refresh(calledRecursive: true);
1769 }
1770 hasTelepathy = false;
1771 isWet = false;
1772 _isLevitating = HasElement(401) || (ride != null && ride._isLevitating);
1774 isWeakToSunlight = HasElement(1251) && !HasElement(431);
1775 base.isHidden = HasElement(415);
1776 foreach (Condition condition in conditions)
1777 {
1778 condition.OnRefresh();
1779 }
1780 if (isWet)
1781 {
1782 base.isHidden = false;
1783 }
1785 SetDirtySpeed();
1786 if (host != null && !calledRecursive && host.source != null)
1787 {
1788 host.Refresh(calledRecursive: true);
1789 }
1790 }
virtual void OnRefresh()
void Refresh(bool calledRecursive=false)
Definition: Chara.cs:1759
bool isWet
Definition: Chara.cs:144
override void SetSource()
Definition: Chara.cs:2108
bool IsUndead
Definition: Chara.cs:905
bool IsHorror
Definition: Chara.cs:929
bool IsMachine
Definition: Chara.cs:917

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 10373 of file Chara.cs.

10374 {
10375 if (faithElements != null)
10376 {
10378 }
10380 if (idFaith == "eyth" && !HasElement(1228))
10381 {
10382 return;
10383 }
10384 SourceReligion.Row row = EClass.sources.religions.map.TryGetValue(idFaith);
10385 if (row == null)
10386 {
10387 return;
10388 }
10390 if (!HasCondition<ConExcommunication>())
10391 {
10392 SourceElement.Row row2 = EClass.sources.elements.alias.TryGetValue("featGod_" + row.id + "1");
10393 if (row2 != null)
10394 {
10395 faithElements.SetBase(row2.id, 1);
10396 }
10397 int[] array = row.elements;
10398 int num = GetPietyValue() * (120 + Evalue(1407) * 15 + Evalue(1228) * 20) / 100;
10399 for (int i = 0; i < array.Length; i += 2)
10400 {
10401 int num2 = array[i + 1] * num / 50;
10402 if (array[i] == 79)
10403 {
10404 num2 = EClass.curve(num2, array[i + 1] * 2, 10, 50);
10405 }
10406 if (num2 >= 20 && array[i] >= 950 && array[i] < 970)
10407 {
10408 num2 = 20;
10409 }
10410 faithElements.SetBase(array[i], Mathf.Max(num2, 1));
10411 }
10412 }
10414 }
string idFaith
Definition: Chara.cs:233
ElementContainer faithElements
Definition: Chara.cs:38
int GetPietyValue()
Definition: Chara.cs:10364
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 1905 of file Chara.cs.

1906 {
1907 if (ride != null && !ride.IsDeadOrSleeping)
1908 {
1910 _Speed = ride._Speed;
1911 info?.AddText("rideSpeed".lang(_Speed.ToString() ?? ""));
1912 }
1913 else if (host != null)
1914 {
1915 if (host.ride == this)
1916 {
1917 _Speed = Evalue(79);
1918 int a = Evalue(1423);
1919 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);
1920 _Speed = _Speed * 100 / Mathf.Clamp(value, 100, 1000);
1921 }
1922 else
1923 {
1924 _Speed = (Evalue(79) + host.Evalue(79)) / 2;
1925 }
1926 }
1927 else
1928 {
1929 _Speed = Evalue(79) + Evalue(407) / 2;
1930 }
1931 if (body.GetSlot(37, onlyEmpty: false)?.thing != null && HasElement(1209) && !HasElement(419))
1932 {
1933 _Speed -= 25L;
1934 info?.AddText(-25L, EClass.sources.elements.map[1209].GetName());
1935 }
1936 if (parasite != null)
1937 {
1938 long speed = _Speed;
1939 _Speed = _Speed * 100 / Mathf.Clamp(120 + parasite.LV * 2 - base.STR - Evalue(227) * 2, 100, 1000);
1940 info?.AddText(_Speed - speed, "parasiteSpeed".lang());
1941 }
1942 if (_Speed < elements.ValueWithoutLink(79) / 3)
1943 {
1945 info?.AddText("minSpeed".lang((elements.ValueWithoutLink(79) / 3).ToString() ?? ""));
1946 }
1947 int num = 100;
1948 if (EClass._zone.map != null && (EClass._zone.IsUnderwater || (base.Cell.IsTopWaterAndNoSnow && !base.Cell.isFloating)))
1949 {
1950 int num2 = Evalue(200);
1951 int num3 = Evalue(1252);
1952 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);
1953 if (info != null && num != 100)
1954 {
1955 info.AddFix(num - 100, EClass.sources.elements.map[200].GetName().ToTitleCase());
1956 }
1957 if (num3 > 0)
1958 {
1959 num += num3 * 20;
1960 info?.AddFix(num3 * 20, EClass.sources.elements.map[1252].GetName().ToTitleCase());
1961 }
1962 }
1963 if (IsPCFaction)
1964 {
1965 switch (burden.GetPhase())
1966 {
1967 case 1:
1968 num -= 10;
1969 info?.AddFix(-10, burden.GetPhaseStr());
1970 break;
1971 case 2:
1972 num -= 20;
1973 info?.AddFix(-20, burden.GetPhaseStr());
1974 break;
1975 case 3:
1976 num -= 30;
1977 info?.AddFix(-30, burden.GetPhaseStr());
1978 break;
1979 case 4:
1980 num -= (IsPC ? 50 : 100);
1981 info?.AddFix(IsPC ? (-50) : (-100), burden.GetPhaseStr());
1982 break;
1983 }
1984 if (IsPC)
1985 {
1986 switch (stamina.GetPhase())
1987 {
1988 case 1:
1989 num -= 10;
1990 info?.AddFix(-10, stamina.GetPhaseStr());
1991 break;
1992 case 0:
1993 num -= 20;
1994 info?.AddFix(-20, stamina.GetPhaseStr());
1995 break;
1996 }
1997 switch (sleepiness.GetPhase())
1998 {
1999 case 2:
2000 num -= 10;
2001 info?.AddFix(-10, sleepiness.GetPhaseStr());
2002 break;
2003 case 3:
2004 num -= 20;
2005 info?.AddFix(-20, sleepiness.GetPhaseStr());
2006 break;
2007 }
2008 switch (hunger.GetPhase())
2009 {
2010 case 3:
2011 case 4:
2012 num -= 10;
2013 info?.AddFix(-10, hunger.GetPhaseStr());
2014 break;
2015 case 5:
2016 num -= 30;
2017 info?.AddFix(-30, hunger.GetPhaseStr());
2018 break;
2019 }
2020 num += EClass.player.lastEmptyAlly * Evalue(1646);
2021 info?.AddFix(EClass.player.lastEmptyAlly * Evalue(1646), EClass.sources.elements.map[1646].GetName());
2022 }
2024 {
2025 num += EClass.player.lastEmptyAlly * 10 - 10;
2026 info?.AddFix(EClass.player.lastEmptyAlly * 10 - 10, "exceedParty".lang());
2027 }
2028 }
2029 else if (base.LV >= 1000 && !EClass.game.principal.disableVoidBlessing && !base.IsPCFactionOrMinion)
2030 {
2031 num += EClass.curve((base.LV - 900) / 100 * 10, 500, 100);
2032 info?.AddFix(EClass.curve((base.LV - 900) / 100 * 10, 500, 100), "enemySpeedBuff".lang());
2033 }
2034 if (HasCondition<ConGravity>())
2035 {
2036 num -= 30;
2037 info?.AddFix(-30, GetCondition<ConGravity>().Name);
2038 }
2039 if (_Speed < 10)
2040 {
2041 _Speed = 10L;
2042 }
2043 _Speed = _Speed * num / 100;
2044 if (_Speed < 10)
2045 {
2046 _Speed = 10L;
2047 info?.AddText("minSpeed".lang(10.ToString() ?? ""));
2048 }
2049 dirtySpeed = false;
2050 }
Thing thing
Definition: BodySlot.cs:8
override string ToString()
Definition: Chara.cs:1198
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:1216

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 9180 of file Chara.cs.

9181 {
9182 if (workElements != null)
9183 {
9185 }
9186 workElements = null;
9187 if (IsPCParty || homeBranch == null || homeBranch.owner == null)
9188 {
9189 return;
9190 }
9191 foreach (Hobby item in ListHobbies())
9192 {
9193 TryAdd(item);
9194 }
9195 foreach (Hobby item2 in ListWorks())
9196 {
9197 TryAdd(item2);
9198 }
9199 if (workElements != null)
9200 {
9202 }
9203 void TryAdd(Hobby h)
9204 {
9205 if (!h.source.elements.IsEmpty())
9206 {
9207 if (workElements == null)
9208 {
9210 }
9211 for (int i = 0; i < h.source.elements.Length; i += 2)
9212 {
9213 int num = h.source.elements[i];
9214 int num2 = h.source.elements[i + 1];
9215 int num3 = 100;
9216 if (num != 2115 && num != 2207)
9217 {
9218 num3 = h.GetEfficiency(this) * homeBranch.efficiency / 100;
9219 if (num3 <= 0)
9220 {
9221 continue;
9222 }
9223 }
9224 workElements.ModBase(num, (num2 < 0) ? (num2 / 10) : Mathf.Max(1, h.source.elements[i + 1] * num3 / 1000));
9225 }
9226 }
9227 }
9228 }
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().

◆ RemoveAllStances()

void Chara.RemoveAllStances ( )
inline

Definition at line 9797 of file Chara.cs.

9798 {
9799 for (int num = conditions.Count - 1; num >= 0; num--)
9800 {
9801 Condition condition = conditions[num];
9802 if (condition.Type == ConditionType.Stance)
9803 {
9804 condition.Kill();
9805 }
9806 }
9807 }

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

Referenced by CharaGenes.Remove().

◆ RemoveCondition< T >()

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

Definition at line 9648 of file Chara.cs.

9648 : Condition
9649 {
9650 for (int num = conditions.Count - 1; num >= 0; num--)
9651 {
9652 if (conditions[num] is T)
9653 {
9654 conditions[num].Kill();
9655 break;
9656 }
9657 }
9658 }

References Condition.Kill().

◆ RemoveGlobal()

void Chara.RemoveGlobal ( )
inline

◆ RemoveLastBodyPart()

void Chara.RemoveLastBodyPart ( bool  msg = false)
inline

Definition at line 2247 of file Chara.cs.

2248 {
2249 if (body.slots.Count != 0)
2250 {
2251 BodySlot bodySlot = body.slots.LastItem();
2252 body.RemoveBodyPartAt(body.slots.Count - 1);
2253 if (msg)
2254 {
2255 Say("lose_bodyparts", this, Element.Get(bodySlot.elementId).GetName().ToLower());
2256 PlaySound("offering");
2257 }
2258 }
2259 }
int elementId
Definition: BodySlot.cs:6
void RemoveBodyPartAt(int idx)
Definition: CharaBody.cs:344

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 8550 of file Chara.cs.

8551 {
8552 if (HasCondition<StanceTaunt>() || base.isRestrained || attacker == this)
8553 {
8554 return false;
8555 }
8556 if (host != null && host.isRestrained)
8557 {
8558 return false;
8559 }
8560 if (base.IsPCFactionOrMinion && attacker.IsPCFactionOrMinion)
8561 {
8562 return false;
8563 }
8564 bool flag = false;
8565 foreach (Chara chara in EClass._map.charas)
8566 {
8567 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))
8568 {
8569 continue;
8570 }
8571 bool flag2 = chara.HasElement(1225) && !chara.GetBool(126);
8572 if ((!flag2 && (flag || EClass.rnd(2) == 0 || !chara.HasCondition<StanceTaunt>())) || chara.HasCooldown(1225))
8573 {
8574 continue;
8575 }
8576 int num = Mathf.Max(chara.Evalue(1649), (!chara.IsPC) ? ((!flag2) ? 1 : 3) : 0);
8577 int num2 = Dist(chara);
8578 if (num2 > 25)
8579 {
8580 continue;
8581 }
8582 if (num2 > num || !chara.CanSeeLos(pos, num2))
8583 {
8584 if (!flag2)
8585 {
8586 continue;
8587 }
8588 Point nearestPoint = pos.GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: true, ignoreCenter: true);
8589 if (!nearestPoint.IsValid)
8590 {
8591 continue;
8592 }
8593 chara.Teleport(nearestPoint);
8594 chara.AddCooldown(1225, 10);
8595 num2 = Dist(chara);
8596 Say("intercept_loyal", chara, this);
8597 chara.SetEnemy(attacker);
8598 attacker.SetEnemy(chara);
8599 if (num2 > num || !chara.CanSeeLos(pos, num2))
8600 {
8601 continue;
8602 }
8603 }
8604 if (!flag && !HasElement(1225))
8605 {
8606 Say("intercept", chara, this);
8607 if (EClass.rnd(10) == 0)
8608 {
8609 chara.Talk("intercept", base.NameSimple);
8610 }
8611 if (attacker.enemy == this)
8612 {
8613 attacker.SetEnemy(chara);
8614 }
8615 action(chara);
8616 flag = true;
8617 }
8618 }
8619 return flag;
8620 }
void Teleport(Point point, bool silent=false, bool force=false)
Definition: Card.cs:5929
ConSuspend conSuspend
Definition: Chara.cs:104
void AddCooldown(int idEle, int turns=0)
Definition: Chara.cs:8831
bool HasCooldown(int idEle)
Definition: Chara.cs:8882

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 9274 of file Chara.cs.

9275 {
9276 if (_hobbies != null && _works != null)
9277 {
9278 _hobbies.Clear();
9279 _works.Clear();
9280 }
9281 else
9282 {
9283 _hobbies = new List<int>();
9284 _works = new List<int>();
9285 }
9286 if (source.hobbies.IsEmpty())
9287 {
9288 AddHobby(EClass.sources.hobbies.listHobbies.RandomItem().id);
9289 }
9290 else
9291 {
9292 string[] hobbies = source.hobbies;
9293 foreach (string key in hobbies)
9294 {
9295 AddHobby(EClass.sources.hobbies.alias[key].id);
9296 }
9297 }
9298 if (source.works.IsEmpty())
9299 {
9300 AddWork(EClass.sources.hobbies.listWorks.RandomItem().id);
9301 }
9302 else
9303 {
9304 string[] hobbies = source.works;
9305 foreach (string key2 in hobbies)
9306 {
9307 AddWork(EClass.sources.hobbies.alias[key2].id);
9308 }
9309 }
9311 }
WorkSummary GetWorkSummary()
Definition: Chara.cs:9313
void AddWork(int id)
Definition: Chara.cs:9262
void AddHobby(int id)
Definition: Chara.cs:9250
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 2261 of file Chara.cs.

2262 {
2263 for (int num = body.slots.Count - 1; num >= 0; num--)
2264 {
2265 BodySlot bodySlot = body.slots[num];
2266 if (bodySlot.elementId == 45 || bodySlot.elementId == 40)
2267 {
2268 return;
2269 }
2270 body.RemoveBodyPart(num);
2271 }
2272 string[] array = race.figure.Split('|');
2273 foreach (string s in array)
2274 {
2275 int num2 = ParseBodySlot(s);
2276 if (num2 != -1)
2277 {
2278 body.AddBodyPart(num2);
2279 }
2280 }
2282 }

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

◆ ResetUpgrade()

void Chara.ResetUpgrade ( )
inline

Definition at line 8716 of file Chara.cs.

8717 {
8718 _ = base.c_upgrades;
8719 }

Referenced by CoreDebug.ResetPetUpgrades().

◆ ResistCon()

void Chara.ResistCon ( Condition  con)
inline

Definition at line 9854 of file Chara.cs.

9855 {
9856 if (con.power > 0 && resistCon != null)
9857 {
9858 int a = ClassExtension.TryGetValue<int, int>((IDictionary<int, int>)resistCon, con.id, 0);
9859 if (1000 < EClass.rnd(a))
9860 {
9861 con.power = 0;
9862 }
9863 else if (500 < EClass.rnd(a))
9864 {
9865 con.power /= 5;
9866 }
9867 else if (200 < EClass.rnd(a))
9868 {
9869 con.power /= 3;
9870 }
9871 else if (100 < EClass.rnd(a))
9872 {
9873 con.power /= 2;
9874 }
9875 }
9876 }

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

◆ RestockEquip()

void Chara.RestockEquip ( bool  onCreate)
inline

Definition at line 4757 of file Chara.cs.

4758 {
4759 string equip = source.equip;
4760 if (equip.IsEmpty())
4761 {
4762 equip = job.equip;
4763 }
4764 if (equip == "none")
4765 {
4766 return;
4767 }
4768 bool flag = true;
4769 switch (id)
4770 {
4771 case "kettle":
4772 case "quru":
4773 case "loytel":
4774 case "shojo":
4775 EQ_ID("staff_long", 1);
4776 EQ_CAT("head");
4777 EQ_CAT("torso");
4778 EQ_CAT("arm");
4779 return;
4780 case "adv_yukiimo":
4781 if (onCreate)
4782 {
4783 EQ_ID("tail_snowleopard");
4784 }
4785 break;
4786 case "adv_kiria":
4787 if (onCreate)
4788 {
4789 EQ_ID("sword_zephir");
4790 }
4791 break;
4792 case "adv_mesherada":
4793 if (onCreate)
4794 {
4795 EQ_ID("dagger_hathaway");
4796 }
4797 break;
4798 case "adv_verna":
4799 if (onCreate)
4800 {
4801 EQ_ID("staff_long", -1, Rarity.Legendary);
4802 }
4803 if (onCreate)
4804 {
4805 EQ_ID("cloak_wing", -1, Rarity.Mythical);
4806 }
4807 break;
4808 case "big_sister":
4809 if (onCreate)
4810 {
4811 EQ_ID("sword_muramasa");
4812 }
4813 break;
4814 case "adv_gaki":
4815 if (onCreate)
4816 {
4817 EQ_ID("dagger_gaki");
4818 }
4819 if (onCreate)
4820 {
4821 EQ_ID("dagger_ninto");
4822 }
4823 break;
4824 case "adv_ivory":
4825 EQ_ID("dagger", -1, Rarity.Legendary);
4826 AddThing("60");
4827 break;
4828 case "adv_wini":
4829 if (onCreate)
4830 {
4831 EQ_ID("staff_Cat", -1, Rarity.Mythical);
4832 }
4834 if (onCreate)
4835 {
4836 AddThing("1071");
4837 }
4838 break;
4839 case "namamani":
4840 if (onCreate)
4841 {
4842 AddThing("gun_gravity2");
4843 }
4844 break;
4845 case "lomias":
4846 if (onCreate)
4847 {
4848 AddThing("bow_vindale");
4849 }
4850 break;
4851 case "larnneire":
4852 if (onCreate)
4853 {
4854 EQ_ID("EtherDagger2");
4855 }
4856 break;
4857 case "keeper_garden":
4858 if (!body.HasWeapon())
4859 {
4860 EQ_ID("sword_ragnarok");
4861 }
4862 break;
4863 case "ungaga_pap":
4864 if (onCreate)
4865 {
4866 EQ_ID("axe_destruction");
4867 }
4868 break;
4869 case "lurie_boss":
4870 if (onCreate)
4871 {
4872 EQ_ID("ribbon_duponne");
4873 }
4874 break;
4875 case "seeker":
4876 if (onCreate)
4877 {
4878 EQ_ID("helm_seeker");
4879 }
4880 EQ_ID("robe_pope");
4881 EQ_ID("sword_katana");
4882 EQ_ID("staff");
4883 EQ_ID("sword_katana");
4884 if (onCreate)
4885 {
4886 EQ_ID("boots_seven");
4887 }
4888 if (onCreate)
4889 {
4890 for (int i = 0; i < 20; i++)
4891 {
4893 }
4894 EQ_Item("panty");
4895 AddThing("plat").SetNum(6);
4896 }
4897 break;
4898 case "ephrond":
4899 if (onCreate)
4900 {
4901 AddThing("guitar_efrond");
4902 }
4903 break;
4904 case "ashland":
4905 if (onCreate)
4906 {
4907 AddThing("guitar_ash");
4908 }
4909 break;
4910 case "swordkeeper":
4911 if (onCreate)
4912 {
4913 EQ_ID("EtherDagger");
4914 }
4915 break;
4916 case "mech_angel":
4917 if (onCreate)
4918 {
4919 Thing thing = ThingGen.Create("pole_holy");
4920 thing.SetReplica(on: true);
4921 thing.rarity = Rarity.Normal;
4922 thing.elements.SetTo(60, -15);
4923 thing.elements.SetTo(418, -100);
4924 thing.elements.SetTo(93, 50);
4925 AddThing(thing);
4926 body.Equip(thing);
4927 flag = false;
4928 }
4929 break;
4930 case "azzrasizzle":
4931 if (onCreate)
4932 {
4933 EQ_ID("staff_magius");
4934 }
4935 break;
4936 case "sorin":
4937 if (onCreate)
4938 {
4939 EQ_ID("staff_insanity");
4940 }
4941 break;
4942 case "robot":
4943 if (onCreate)
4944 {
4945 EQ_ID("sword_katana");
4946 }
4947 break;
4948 case "mimu":
4949 if (onCreate)
4950 {
4951 EQ_ID("staff_leek");
4952 }
4953 break;
4954 case "kumatan":
4955 if (onCreate)
4956 {
4957 EQ_ID("dagger_hocho");
4958 }
4959 break;
4960 }
4961 if (!TryEquipRanged())
4962 {
4963 switch (id)
4964 {
4965 case "tyche":
4966 case "trooper":
4967 case "mech_scarab":
4968 AddThing("gun_laser");
4969 break;
4970 case "rocketman":
4971 {
4972 Thing thing2 = AddThing("panzerfaust");
4973 thing2.ChangeMaterial("iron");
4974 thing2.c_ammo = 0;
4975 break;
4976 }
4977 default:
4978 switch (equip)
4979 {
4980 case "archer":
4981 EQ_CAT((EClass.rnd(4) == 0) ? "crossbow" : "bow");
4982 break;
4983 case "inquisitor":
4984 case "gunner":
4985 EQ_CAT("gun");
4986 break;
4987 }
4988 break;
4989 }
4990 }
4991 int num = ((base.rarity >= Rarity.Mythical) ? (base.LV * 3) : ((base.rarity >= Rarity.Legendary) ? (base.LV * 2) : base.LV));
4992 if (trait is TraitAdventurer)
4993 {
4994 num *= 3;
4995 }
4996 if (race.id == "asura")
4997 {
4998 for (int j = 0; j < 4; j++)
4999 {
5000 EQ_CAT(job.weapon.RandomItem());
5001 }
5002 }
5003 for (int k = 0; k < ((!(race.id == "mutant")) ? 1 : (2 + base.LV / 30)); k++)
5004 {
5005 if (flag)
5006 {
5007 if (source.ContainsTag("boxer"))
5008 {
5009 EQ_CAT("martial");
5010 }
5011 else if (!job.weapon.IsEmpty())
5012 {
5013 if (race.id == "mutant" || (body.slotMainHand != null && body.slotMainHand.thing == null))
5014 {
5015 EQ_CAT(job.weapon.RandomItem());
5016 }
5017 if (race.id == "mutant" || (Evalue(131) > 0 && EClass.rnd(2) == 0))
5018 {
5019 EQ_CAT(job.weapon.RandomItem());
5020 }
5021 }
5022 }
5023 EQ_CAT("torso");
5024 if (EClass.rnd(num) > 5)
5025 {
5026 EQ_CAT("arm");
5027 }
5028 if (EClass.rnd(num) > 10)
5029 {
5030 EQ_CAT("head");
5031 }
5032 if (EClass.rnd(num) > 15)
5033 {
5034 EQ_CAT("back");
5035 }
5036 if (EClass.rnd(num) > 20)
5037 {
5038 EQ_CAT("ring");
5039 }
5040 if (EClass.rnd(num) > 25)
5041 {
5042 EQ_CAT("amulet");
5043 }
5044 if (EClass.rnd(num) > 30)
5045 {
5046 EQ_CAT("foot");
5047 }
5048 if (EClass.rnd(num) > 35)
5049 {
5050 EQ_CAT("waist");
5051 }
5052 if (EClass.rnd(num) > 40)
5053 {
5054 EQ_CAT("ring");
5055 }
5056 }
5057 if (trait is TraitBard)
5058 {
5059 AddThing(ThingGen.Create("lute"));
5060 if (EClass.debug.enable || EClass.rnd(100) == 0)
5061 {
5062 EQ_ID("shield_lute");
5063 }
5064 }
5065 if (HasTag(CTAG.shield))
5066 {
5067 EQ_CAT("shield");
5068 }
5069 }
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
Definition: Card.cs:3089
Card AddCard(Card c)
Definition: Card.cs:3138
void SetReplica(bool on)
Definition: Card.cs:3123
bool HasWeapon()
Definition: CharaBody.cs:400
BodySlot slotMainHand
Definition: CharaBody.cs:10
void EQ_Item(string s, int num=1)
Definition: Chara.cs:5179
Thing EQ_ID(string s, int mat=-1, Rarity r=Rarity.Random)
Definition: Chara.cs:5143
bool TryEquipRanged()
Definition: Chara.cs:7994
void EQ_CAT(string s)
Definition: Chara.cs:5163
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 5071 of file Chara.cs.

5072 {
5073 switch (id)
5074 {
5075 case "lomias":
5076 if (ShouldRestock("_meat"))
5077 {
5078 AddCard(ThingGen.Create("_meat").MakeRefFrom("begger"));
5079 }
5080 break;
5081 case "fiama":
5082 Restock("book_story", 1);
5083 break;
5084 case "rock_thrower":
5085 Restock("stone", 10 + EClass.rnd(10));
5086 break;
5087 case "giant":
5088 Restock("rock", 2 + EClass.rnd(10));
5089 break;
5090 case "farris":
5091 Restock("lute", 1);
5092 Restock("book_story_home", 1);
5093 break;
5094 case "begger":
5095 break;
5096 }
5097 void Restock(string id, int num)
5098 {
5099 if (ShouldRestock(id))
5100 {
5101 AddCard(ThingGen.Create(id).SetNum(num));
5102 }
5103 }
5104 bool ShouldRestock(string id)
5105 {
5106 return things.Find(id) == null;
5107 }
5108 }

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

◆ Revive()

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

Definition at line 5223 of file Chara.cs.

5224 {
5225 if (!isDead)
5226 {
5227 return;
5228 }
5229 isDead = false;
5230 base.hp = MaxHP / 3;
5231 mana.value = 0;
5232 stamina.value = 0;
5233 if (hunger.value > 30)
5234 {
5235 hunger.value = 30;
5236 }
5237 sleepiness.value = 0;
5239 RemoveCondition<StanceTaunt>();
5240 if (id == "keeper_garden")
5241 {
5242 SaiyanRevive();
5243 }
5244 if (IsPC)
5245 {
5247 {
5248 Msg.Say("noDeathPenalty2", this);
5249 }
5251 {
5252 Msg.Say("noDeathPenalty", this);
5253 }
5254 else
5255 {
5257 }
5258 List<Thing> dropList = new List<Thing>();
5259 EClass.pc.things.Foreach(delegate(Thing t)
5260 {
5262 {
5263 t.ignoreAutoPick = true;
5264 dropList.Add(t);
5265 }
5266 }, onlyAccessible: false);
5267 foreach (Thing item in dropList)
5268 {
5270 Msg.Say("backpack_full_drop", item);
5271 }
5272 EClass.player.preventDeathPenalty = false;
5273 }
5274 if (IsPCFaction && homeBranch != null)
5275 {
5276 homeBranch.Log("bRevive", this);
5277 }
5278 if (p != null)
5279 {
5280 if (!p.IsInBounds)
5281 {
5283 }
5284 EClass._zone.AddCard(this, p);
5285 if (msg)
5286 {
5287 SE.Play("revive");
5288 Msg.Say("revive", this);
5289 PlayEffect("revive");
5290 }
5291 SetCensored(enable: false);
5292 }
5293 }
void SetCensored(bool enable)
Definition: Card.cs:7916
Card parentCard
Definition: Card.cs:104
void SaiyanRevive()
Definition: Chara.cs:5295
void ApplyDeathPenalty()
Definition: Chara.cs:5329
bool disableDeathPenaltyProtection
Point GetCenterPos()
Definition: MapBounds.cs:52
int days
Definition: Player.cs:75
bool preventDeathPenalty
Definition: Player.cs:1190
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 3571 of file Chara.cs.

3572 {
3573 if (renderer.hasActor)
3574 {
3575 base.dir = (base.dir + ((!reverse) ? 1 : (-1))).Clamp(0, 3, loop: true);
3576 }
3577 else
3578 {
3579 base.dir = ((base.dir == 0) ? 1 : 0);
3580 }
3581 UpdateAngle();
3583 }

Referenced by AI_Dance.Run().

◆ SaiyanRevive()

void Chara.SaiyanRevive ( )
inline

Definition at line 5295 of file Chara.cs.

5296 {
5297 ModCorruption(-100000);
5298 if (base.LV < 10000000)
5299 {
5300 SetLv(base.LV * 10 + 9);
5301 }
5302 Refresh();
5303 base.hp = MaxHP;
5304 mana.value = mana.max;
5305 stamina.value = stamina.max;
5306 bossText = true;
5307 }
void ModCorruption(int a)
Definition: Chara.cs:10001

References Stats.max, and Refresh().

◆ ScaleByPrincipal()

Chara Chara.ScaleByPrincipal ( )
inline

◆ SetAI()

AIAct Chara.SetAI ( AIAct  g)
inline

Definition at line 9050 of file Chara.cs.

9051 {
9052 if (IsPC)
9053 {
9055 }
9056 if (ai.IsRunning)
9057 {
9058 if (ai == g && ai.IsNoGoal)
9059 {
9060 return g;
9061 }
9062 ai.Cancel();
9063 if (ai == g)
9064 {
9065 Debug.Log("goal is g:" + ai?.ToString() + "/" + this);
9066 return g;
9067 }
9068 }
9069 if (HasCondition<ConWait>())
9070 {
9071 RemoveCondition<ConWait>();
9072 }
9073 ai = g;
9074 ai.SetOwner(this);
9075 if (IsPC)
9076 {
9078 }
9079 return g;
9080 }
virtual bool IsNoGoal
Definition: AIAct.cs:74
void SetOwner(Chara c)
Definition: AIAct.cs:189
QueueManager queues
Definition: Player.cs:1234
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 9040 of file Chara.cs.

9041 {
9042 SetAI(new GoalCombat());
9043 }

Referenced by ZoneEventQuest.AggroEnemy().

◆ SetAIIdle()

void Chara.SetAIIdle ( )
inline

Definition at line 9036 of file Chara.cs.

9037 {
9038 }

◆ SetAIImmediate()

void Chara.SetAIImmediate ( AIAct  g)
inline

◆ SetCooldown()

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

Definition at line 8849 of file Chara.cs.

8850 {
8851 if (_cooldowns == null)
8852 {
8853 _cooldowns = new List<int>();
8854 }
8855 bool flag = false;
8856 for (int i = 0; i < _cooldowns.Count; i++)
8857 {
8858 if (_cooldowns[i] / 1000 == idEle)
8859 {
8860 if (turns == 0)
8861 {
8862 _cooldowns.RemoveAt(i);
8863 }
8864 else
8865 {
8866 _cooldowns[i] = idEle * 1000 + turns;
8867 }
8868 flag = true;
8869 break;
8870 }
8871 }
8872 if (!flag && turns > 0)
8873 {
8874 AddCooldown(idEle, turns);
8875 }
8876 if (_cooldowns.Count == 0)
8877 {
8878 _cooldowns = null;
8879 }
8880 }

Referenced by ConTransmuteBat.OnRemoved().

◆ SetDir()

override void Chara.SetDir ( int  d)
inlinevirtual

Reimplemented from Card.

Definition at line 3564 of file Chara.cs.

3565 {
3566 base.dir = d;
3567 UpdateAngle();
3569 }

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

◆ SetDirtySpeed()

void Chara.SetDirtySpeed ( )
inline

Definition at line 1896 of file Chara.cs.

1897 {
1898 dirtySpeed = true;
1899 if (host != null)
1900 {
1902 }
1903 }

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 6416 of file Chara.cs.

6417 {
6418 enemy = c;
6419 if (c == null)
6420 {
6421 if (ai is GoalCombat)
6422 {
6423 ai.Cancel();
6424 }
6425 }
6426 else
6427 {
6428 calmCheckTurn = 10 + EClass.rnd(30);
6429 }
6430 return c;
6431 }

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

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

◆ SetEQQuality()

void Chara.SetEQQuality ( )
inlineprivate

Definition at line 5110 of file Chara.cs.

5111 {
5113 Rarity rarity = Rarity.Normal;
5114 int num = ((base.LV >= 1000) ? 7 : ((base.LV >= 500) ? 5 : ((base.LV >= 250) ? 3 : ((base.LV >= 100) ? 2 : ((base.LV >= 50) ? 1 : 0)))));
5115 Rarity rarity2 = base.rarity;
5116 if (id == "big_sister")
5117 {
5118 num = (isOnCreate ? 8 : 4);
5119 }
5120 if (!isOnCreate && EClass.rnd(10) != 0)
5121 {
5122 num /= 2;
5123 }
5124 if (rarity2 == Rarity.Superior && EClass.rnd(10) <= num)
5125 {
5126 rarity = Rarity.Superior;
5127 }
5128 else if (rarity2 == Rarity.Legendary)
5129 {
5130 rarity = ((EClass.rnd(10) <= num) ? Rarity.Legendary : ((EClass.rnd(5) <= num) ? Rarity.Superior : Rarity.Normal));
5131 }
5132 else if (rarity2 >= Rarity.Mythical)
5133 {
5134 rarity = ((EClass.rnd(30) <= num) ? Rarity.Mythical : ((EClass.rnd(10) > num) ? Rarity.Superior : Rarity.Legendary));
5135 }
5136 if (rarity == Rarity.Normal && EClass.rnd(1000) == 0)
5137 {
5138 rarity = Rarity.Legendary;
5139 }
5140 CardBlueprint.current.rarity = rarity;
5141 }
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 1453 of file Chara.cs.

1454 {
1455 _faction = null;
1456 faction = f;
1458 return this;
1459 }
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 1744 of file Chara.cs.

1745 {
1746 faith = r;
1748 }

References faith, and RefreshFaithElement().

◆ SetFaith() [2/2]

void Chara.SetFaith ( string  id)
inline

Definition at line 1739 of file Chara.cs.

1740 {
1742 }
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 10059 of file Chara.cs.

10060 {
10061 Feat feat = elements.GetElement(id) as Feat;
10062 int num = 0;
10063 if (feat != null && feat.Value > 0)
10064 {
10065 if (value == feat.Value)
10066 {
10067 return;
10068 }
10069 num = feat.Value;
10070 feat.Apply(-feat.Value, elements);
10071 }
10072 feat = elements.SetBase(id, value - (feat?.vSource ?? 0)) as Feat;
10073 if (feat.Value != 0)
10074 {
10075 feat.Apply(feat.Value, elements);
10076 }
10078 {
10079 Refresh();
10081 }
10082 if (!msg)
10083 {
10084 return;
10085 }
10086 if (feat.source.textInc.IsEmpty())
10087 {
10088 PlaySound("ding_skill");
10090 Say("gainFeat", this, feat.FullName);
10091 }
10092 else
10093 {
10094 bool flag = value < num;
10095 if (feat.source.tag.Contains("neg"))
10096 {
10097 flag = !flag;
10098 }
10099 switch (id)
10100 {
10101 case 1270:
10102 if (!flag)
10103 {
10104 PlaySound("chime_angel");
10105 }
10106 break;
10107 case 1271:
10108 if (!flag)
10109 {
10110 PlaySound("chime_devil");
10111 }
10112 break;
10113 default:
10114 PlaySound("mutation");
10115 break;
10116 }
10118 Say((value > num) ? feat.source.GetText("textInc") : feat.source.GetText("textDec"), this, feat.FullName);
10119 }
10121 }
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(), DramaOutcome.upgrade_miscreation(), and DramaOutcome.wedding_setup().

◆ SetGlobal() [1/2]

Chara Chara.SetGlobal ( )
inline

Definition at line 1520 of file Chara.cs.

1521 {
1522 if (!IsGlobal)
1523 {
1525 global = new GlobalData();
1526 base.isSubsetCard = false;
1527 enemy = null;
1528 base.c_uidMaster = 0;
1529 }
1530 return this;
1531 }

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 1505 of file Chara.cs.

1506 {
1507 SetGlobal();
1508 homeZone = _home;
1509 _home.AddCard(this, x, z);
1510 global.transition = new ZoneTransition
1511 {
1512 state = ZoneTransition.EnterState.Exact,
1513 x = x,
1514 z = z
1515 };
1516 orgPos = new Point(x, z);
1517 return this;
1518 }

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 1461 of file Chara.cs.

1462 {
1463 homeZone = zone;
1464 SetGlobal();
1465 return this;
1466 }

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 1468 of file Chara.cs.

1469 {
1470 Hostility hostility2 = (base.c_originalHostility = h);
1471 this.hostility = hostility2;
1472 return this;
1473 }

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 2129 of file Chara.cs.

2130 {
2131 if (base.c_idMainElement != 0)
2132 {
2133 SetElements(base.c_idMainElement, remove: true);
2134 base.c_idMainElement = 0;
2135 }
2136 if (id != 0)
2137 {
2138 _ = EClass.sources.elements.map[id];
2139 SetElements(id, remove: false);
2140 base.c_idMainElement = id;
2141 if (elemental)
2142 {
2143 base.isElemental = true;
2144 _colorInt = 0;
2145 Color colorSprite = EClass.setting.elements[MainElement.source.alias].colorSprite;
2146 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);
2147 }
2148 _ability = null;
2149 }
2150 void SetElements(int idEle, bool remove)
2151 {
2152 elements.SetBase(idEle, (!remove) ? ((v == 0) ? 10 : v) : 0);
2153 elements.ModBase(EClass.sources.elements.alias[EClass.sources.elements.map[idEle].aliasRef].id, remove ? (-20) : 20);
2154 switch (idEle)
2155 {
2156 case 910:
2157 elements.ModBase(951, remove ? 10 : (-10));
2158 break;
2159 case 911:
2160 elements.ModBase(950, remove ? 10 : (-10));
2161 break;
2162 case 912:
2163 elements.ModBase(953, remove ? 10 : (-10));
2164 break;
2165 case 913:
2166 elements.ModBase(952, remove ? 10 : (-10));
2167 break;
2168 case 916:
2169 elements.ModBase(960, remove ? 10 : (-10));
2170 break;
2171 case 919:
2172 elements.ModBase(956, remove ? 10 : (-10));
2173 break;
2174 case 925:
2175 elements.ModBase(962, remove ? 10 : (-10));
2176 break;
2177 case 922:
2178 elements.ModBase(965, remove ? 10 : (-10));
2179 break;
2180 case 921:
2181 elements.ModBase(971, remove ? 10 : (-10));
2182 break;
2183 case 926:
2184 elements.ModBase(961, remove ? 10 : (-10));
2185 break;
2186 case 914:
2187 case 915:
2188 case 917:
2189 case 918:
2190 case 920:
2191 case 923:
2192 case 924:
2193 break;
2194 }
2195 }
2196 }
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 2120 of file Chara.cs.

2121 {
2122 if (!id.StartsWith("ele"))
2123 {
2124 id = "ele" + id;
2125 }
2126 SetMainElement(EClass.sources.elements.alias[id].id, v, elemental);
2127 }

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 10123 of file Chara.cs.

10124 {
10125 SourceElement.Row row = EClass.sources.elements.map[idEle];
10127 Element element = elements.GetElement(idEle);
10128 Element element2 = elements.GetElement(row2.id);
10129 int num = element?.Value ?? 0;
10130 if (a < 0)
10131 {
10132 a = 0;
10133 }
10134 if (a > row.max)
10135 {
10136 a = row.max;
10137 }
10138 bool flag = (row.tag.Contains("neg") ? (a > num) : (a < num));
10139 if (a == 0 && (element == null || element.Value == 0))
10140 {
10142 return;
10143 }
10144 if (element != null && element.Value == a)
10145 {
10147 return;
10148 }
10149 if (element2 != null && element2.Value > 0)
10150 {
10151 SetFeat(element2.id, 0);
10152 }
10153 SetFeat(idEle, a);
10154 PlaySound("mutation");
10155 PlayEffect("mutation");
10157 Say(row.GetText(flag ? "textDec" : "textInc", returnNull: true) ?? row.alias, this);
10158 }

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 9045 of file Chara.cs.

9046 {
9047 return SetAI(_NoGoalPC);
9048 }
static NoGoal _NoGoalPC
Definition: Chara.cs:198

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

◆ SetPCCState()

void Chara.SetPCCState ( PCCState  state)
inline

Definition at line 6804 of file Chara.cs.

6805 {
6806 if (IsPCC)
6807 {
6808 PCC.Get(pccData).Build(state);
6809 }
6810 }

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 6852 of file Chara.cs.

6853 {
6854 p.mat = base.material;
6855 p.matColor = base.colorInt;
6856 if (!renderer.usePass)
6857 {
6858 return;
6859 }
6860 if (renderer.replacer != null)
6861 {
6862 p.tile = renderer.replacer.tile * ((!flipX) ? 1 : (-1));
6863 if (renderer.replacer.mat != -1)
6864 {
6865 p.mat = EClass.sources.materials.rows.TryGet(renderer.replacer.mat, 0);
6866 p.matColor = BaseTileMap.GetColorInt(ref p.mat.matColor, 100);
6867 p.color -= 1048576f;
6868 }
6869 }
6870 else if (source._tiles_snow.Length != 0 && EClass._zone.IsSnowCovered)
6871 {
6872 if (source._tiles_snow.Length > 1)
6873 {
6874 int num = ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % source._tiles_snow.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6875 p.tile = source._tiles_snow[(num < source._tiles_snow.Length) ? num : 0] * ((!flipX) ? 1 : (-1));
6876 }
6877 else
6878 {
6879 p.tile = source._tiles_snow[0] * ((!flipX) ? 1 : (-1));
6880 }
6881 }
6882 else if (sourceCard._tiles.Length > 1)
6883 {
6884 int num2 = ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % sourceCard._tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6885 p.tile = sourceCard._tiles[(num2 >= 0 && num2 < sourceCard._tiles.Length) ? num2 : 0] * ((!flipX) ? 1 : (-1));
6886 }
6887 else
6888 {
6889 p.tile = sourceCard._tiles[0] * ((!flipX) ? 1 : (-1));
6890 }
6891 p.dir = base.dir;
6892 }
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 7427 of file Chara.cs.

7428 {
7429 switch (m)
7430 {
7431 case UIList.SortMode.ByJob:
7432 sortVal = job._index * 10000 + sourceCard._index;
7433 break;
7434 case UIList.SortMode.ByRace:
7435 sortVal = race._index * 10000 * ((!IsHuman) ? 1 : (-1)) + sourceCard._index;
7436 break;
7437 case UIList.SortMode.ByFeat:
7438 sortVal = -GetTotalFeat();
7439 break;
7440 default:
7441 sortVal = sourceCard._index * ((!IsHuman) ? 1 : (-1));
7442 break;
7443 case UIList.SortMode.ByWorkk:
7444 break;
7445 }
7446 }
int sortVal
Definition: Card.cs:102
int GetTotalFeat()
Definition: Chara.cs:8268
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 2108 of file Chara.cs.

2109 {
2110 source = EClass.sources.charas.map.TryGetValue(id);
2111 if (source == null)
2112 {
2113 Debug.LogWarning("Chara " + id + " not found");
2114 id = "chicken";
2115 source = EClass.sources.charas.map[id];
2116 }
2117 path.walker = this;
2118 }

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

Referenced by Refresh().

◆ SetSummon()

void Chara.SetSummon ( int  duration)
inline

Definition at line 2444 of file Chara.cs.

2445 {
2446 base.c_summonDuration = duration;
2447 base.isSummon = true;
2448 }

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 7762 of file Chara.cs.

7763 {
7764 if (t.IsRangedWeapon && t.category.slot == 0)
7765 {
7766 if (!CanEquipRanged(t))
7767 {
7768 return false;
7769 }
7770 int num = 0;
7771 foreach (Thing thing in things)
7772 {
7773 if (thing.IsRangedWeapon)
7774 {
7775 if (thing.category.slot != 0 && thing.isEquipped)
7776 {
7777 return false;
7778 }
7779 if (CanEquipRanged(thing) && thing.GetEquipValue() > num)
7780 {
7781 num = thing.GetEquipValue();
7782 }
7783 }
7784 }
7785 if (t.GetEquipValue() > num)
7786 {
7787 return true;
7788 }
7789 return false;
7790 }
7791 BodySlot bodySlot = body.GetSlot(t);
7792 if (bodySlot == null)
7793 {
7794 return false;
7795 }
7796 if (useFav)
7797 {
7798 switch (GetFavAttackStyle())
7799 {
7800 case AttackStyle.Default:
7801 case AttackStyle.TwoHand:
7802 if (t.IsMeleeWeapon)
7803 {
7804 bodySlot = body.slotMainHand;
7805 }
7806 else if (bodySlot.elementId == 35)
7807 {
7808 return false;
7809 }
7810 break;
7811 case AttackStyle.Shield:
7812 if (t.IsMeleeWeapon)
7813 {
7814 bodySlot = body.slotMainHand;
7815 }
7816 else if (bodySlot.elementId == 35 && t.IsMeleeWeapon)
7817 {
7818 return false;
7819 }
7820 break;
7821 case AttackStyle.TwoWield:
7822 if (bodySlot.elementId == 35 && !t.IsMeleeWeapon)
7823 {
7824 return false;
7825 }
7826 break;
7827 }
7828 }
7829 if (!body.IsEquippable(t, bodySlot, text: false))
7830 {
7831 return false;
7832 }
7833 if (bodySlot.thing != null && (bodySlot.thing.blessedState <= BlessedState.Cursed || bodySlot.thing.GetEquipValue() >= t.GetEquipValue()))
7834 {
7835 return false;
7836 }
7837 if (!base.IsPCFactionOrMinion)
7838 {
7839 int num2 = 0;
7840 foreach (Element value in t.elements.dict.Values)
7841 {
7842 if (value.Value <= 0)
7843 {
7844 int num3 = 100;
7845 switch (value.id)
7846 {
7847 case 418:
7848 num3 = 10;
7849 break;
7850 case 60:
7851 case 61:
7852 case 62:
7853 num3 = 200;
7854 break;
7855 case 962:
7856 num3 = 10000;
7857 break;
7858 }
7859 num2 += value.Value * num3 / 100;
7860 }
7861 }
7862 if (num2 < -40)
7863 {
7864 return false;
7865 }
7866 }
7867 if (t.HasTag(CTAG.gift) && t.c_uidAttune != base.uid)
7868 {
7869 return false;
7870 }
7871 return true;
7872 }
bool IsMeleeWeapon
Definition: Card.cs:2269
BlessedState blessedState
Definition: Card.cs:279
int c_uidAttune
Definition: Card.cs:1186
bool IsEquippable(Thing thing, BodySlot slot, bool text=true)
Definition: CharaBody.cs:110
AttackStyle GetFavAttackStyle()
Definition: Chara.cs:4713

References Card.blessedState, Card.c_uidAttune, 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 8622 of file Chara.cs.

8623 {
8624 if (IsPCFaction)
8625 {
8626 if (t.IsFood && t.category.id != "fish" && !t.IsDecayed)
8627 {
8628 return false;
8629 }
8630 if (t.trait.GetHealAction(this) != null)
8631 {
8632 return false;
8633 }
8634 if (t.IsThrownWeapon || t.IsRangedWeapon || t.IsAmmo)
8635 {
8636 return false;
8637 }
8638 if (t.trait is TraitBlanket || t.trait is TraitItemProc || t.trait is TraitBookSkill)
8639 {
8640 return false;
8641 }
8642 }
8643 if (t.isEquipped || t.rarity >= Rarity.Legendary || !t.trait.CanBeDestroyed || t.c_isImportant)
8644 {
8645 return false;
8646 }
8647 if (t.trait is TraitCurrency || t.trait is TraitTool)
8648 {
8649 return false;
8650 }
8651 switch (type)
8652 {
8653 case ClearInventoryType.SellAtTown:
8654 if (!t.isGifted && !t.isNPCProperty)
8655 {
8656 return false;
8657 }
8658 break;
8659 case ClearInventoryType.Purge:
8660 switch (t.category.id)
8661 {
8662 case "fish":
8663 if (EClass.rnd(3) == 0)
8664 {
8665 return true;
8666 }
8667 break;
8668 case "junk":
8669 case "garbage":
8670 if (EClass.rnd(3) != 0)
8671 {
8672 return true;
8673 }
8674 break;
8675 }
8676 if (t.id == "flyer")
8677 {
8678 return true;
8679 }
8680 if (!t.IsDecayed && EClass.rnd(3) == 0)
8681 {
8682 return false;
8683 }
8684 if (!things.IsFull() && t.IsRangedWeapon)
8685 {
8686 return false;
8687 }
8688 break;
8689 }
8690 return true;
8691 }
bool IsThrownWeapon
Definition: Card.cs:2273
bool IsFood
Definition: Card.cs:2203
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 7170 of file Chara.cs.

7171 {
7172 Zone_Nymelle zone_Nymelle = EClass._zone as Zone_Nymelle;
7173 if (conSuspend != null && IsPCParty)
7174 {
7175 RemoveCondition<ConSuspend>();
7176 }
7177 if (LayerDrama.forceJump == null)
7178 {
7179 if (IsDeadOrSleeping)
7180 {
7181 ShowDialog("_chara", "sleep");
7182 return;
7183 }
7184 if (EClass.pc.isHidden && !CanSee(EClass.pc))
7185 {
7186 ShowDialog("_chara", "invisible");
7187 return;
7188 }
7190 {
7192 ShowDialog("_chara", "give_card");
7193 Thing thing = ThingGen.Create("figure");
7194 thing.MakeFigureFrom(id);
7195 EClass.player.DropReward(thing);
7196 thing = ThingGen.Create("figure3");
7197 thing.MakeFigureFrom(id);
7198 EClass.player.DropReward(thing);
7199 return;
7200 }
7201 if (GetInt(71) == -2)
7202 {
7203 ShowDialog("_chara", "give_lunch");
7204 Thing t = CraftUtil.MakeLoveLunch(this);
7206 SetInt(71, EClass.world.date.GetRaw() + 43200);
7207 return;
7208 }
7209 if (base.isRestrained)
7210 {
7211 ShowDialog("_chara", "strain");
7212 return;
7213 }
7214 if (IsEscorted())
7215 {
7216 ShowDialog("_chara", "escort");
7217 return;
7218 }
7220 {
7221 string step = ((!(EClass._zone is Zone_Wedding)) ? "party" : (IsPCParty ? "wedding_love" : ((IsMarried || affinity.IsWeddingHater) ? "wedding_hater" : "wedding")));
7222 if (EClass._zone is Zone_Wedding && IsPCParty && base.c_love != null && !base.c_love.gaveCutter)
7223 {
7224 step = "wedding_cutter";
7225 EClass.player.DropReward(ThingGen.Create("dagger_cakecutter"));
7226 base.c_love.gaveCutter = true;
7227 }
7228 ShowDialog("_chara", step);
7229 return;
7230 }
7231 if (EClass.game.quests.OnShowDialog(this))
7232 {
7233 return;
7234 }
7235 if (id == "nino")
7236 {
7238 }
7239 switch (id)
7240 {
7241 case "loytel":
7242 {
7244 {
7245 EClass.game.quests.Get("pre_debt_runaway").Complete();
7246 EClass.player.flags.loytelEscaped = false;
7247 EClass.game.quests.Add("debt", "loytel");
7248 ShowDialog("loytel", "loytelEscaped");
7249 return;
7250 }
7251 QuestDebt questDebt = EClass.game.quests.Get<QuestDebt>();
7252 if (questDebt != null && questDebt.paid)
7253 {
7254 questDebt.stage++;
7255 if (questDebt.stage > 7)
7256 {
7257 questDebt.stage = 7;
7258 }
7259 ShowDialog("loytel", "debt" + questDebt.stage);
7260 return;
7261 }
7262 break;
7263 }
7264 case "farris":
7265 if (EClass._zone.id == "startVillage" || EClass._zone.id == "startVillage3" || EClass.game.IsSurvival)
7266 {
7267 ShowDialog("farris");
7268 return;
7269 }
7271 {
7272 case -1:
7273 ShowDialog("farris", "nymelle_noQuest");
7274 break;
7275 case 0:
7276 ShowDialog("farris", "nymelle_first");
7277 break;
7278 case 1:
7279 ShowDialog("farris", "home_first");
7280 break;
7281 default:
7282 ShowDialog("farris");
7283 break;
7284 }
7285 return;
7286 case "ashland":
7287 ShowDialog("ashland");
7288 return;
7289 case "fiama":
7290 if (zone_Nymelle != null && zone_Nymelle.IsCrystalLv && EClass.game.quests.GetPhase<QuestExploration>() == 3)
7291 {
7292 SoundManager.ForceBGM();
7293 LayerDrama.ActivateMain("mono", "nymelle_crystal");
7294 }
7296 {
7298 {
7299 EClass.player.flags.fiamaFirstDream = true;
7300 ShowDialog("fiama", "firstDream");
7301 }
7303 {
7304 ShowDialog("fiama", "giveStoryBook").SetOnKill(delegate
7305 {
7306 EClass.player.flags.fiamaStoryBookGiven = true;
7307 EClass.player.DropReward(ThingGen.Create("book_story"));
7308 });
7309 }
7310 else
7311 {
7312 ShowDialog("fiama");
7313 }
7314 }
7315 else
7316 {
7317 ShowDialog("fiama");
7318 }
7319 return;
7320 case "big_sister":
7322 {
7323 ShowDialog("big_sister", "little_saved");
7324 EClass.player.flags.little_saved = false;
7325 return;
7326 }
7328 {
7329 ShowDialog("big_sister", "little_dead");
7330 EClass.player.flags.little_killed = false;
7331 return;
7332 }
7333 break;
7334 }
7335 if (trait is TraitGuildDoorman)
7336 {
7337 string tag = ((trait is TraitDoorman_Fighter) ? "fighter" : ((trait is TraitDoorman_Mage) ? "mage" : "thief"));
7338 ShowDialog("guild_doorman", "main", tag);
7339 return;
7340 }
7341 if (trait is TraitGuildClerk)
7342 {
7343 string tag2 = ((trait is TraitClerk_Fighter) ? "fighter" : ((trait is TraitClerk_Mage) ? "mage" : "thief"));
7344 ShowDialog("guild_clerk", "main", tag2);
7345 return;
7346 }
7347 }
7348 bool flag = true;
7349 if (id == "parttimer_jure" && (!EClass._zone.IsFestival || !(EClass._zone is Zone_Noyel) || EClass.pc.faith == EClass.game.religions.Healing))
7350 {
7351 flag = false;
7352 }
7353 if (flag && File.Exists(CorePath.DramaData + id + ".xlsx"))
7354 {
7355 ShowDialog(id);
7356 }
7357 else
7358 {
7359 ShowDialog("_chara");
7360 }
7361 }
bool CanGiveCard()
Definition: Affinity.cs:65
bool IsWeddingHater
Definition: Affinity.cs:36
void MakeFigureFrom(string id)
Definition: Card.cs:5767
void ShowDialog()
Definition: Chara.cs:7170
bool IsMarried
Definition: Chara.cs:611
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:490
int storyFiama
Definition: Player.cs:634
bool little_saved
Definition: Player.cs:454
bool fiamaStoryBookGiven
Definition: Player.cs:310
bool fiamaFirstDream
Definition: Player.cs:322
bool little_killed
Definition: Player.cs:466
CodexManager codex
Definition: Player.cs:1138
bool EnableDreamStory
Definition: Player.cs:1293
Thing DropReward(Thing t, bool silent=false)
Definition: Player.cs:2595
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:211

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(), Steam.GetAchievement(), QuestManager.GetPhase(), Date.GetRaw(), ReligionManager.Healing, Spatial.id, Zone_Nymelle.IsCrystalLv, Zone.IsFestival, Card.isHidden, Game.IsSurvival, Affinity.IsWeddingHater, 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 7363 of file Chara.cs.

7364 {
7365 return _ShowDialog(book, null, step, tag);
7366 }
LayerDrama _ShowDialog(string book, string sheet, string step="main", string tag="")
Definition: Chara.cs:7368

References book.

◆ Slap()

void Chara.Slap ( Chara  c,
bool  slapToDeath = false 
)
inline

Definition at line 6403 of file Chara.cs.

6404 {
6405 PlaySound("whip");
6406 Say("slap", this, c);
6407 c.PlayAnime(AnimeID.Shiver);
6408 c.DamageHP(slapToDeath ? (c.MaxHP * 2) : (5 + EClass.rndHalf(EClass.pc.MaxHP / 3)), 919, 100, AttackSource.Condition);
6409 c.OnInsulted();
6410 if (slapToDeath && c.IsAliveInCurrentZone)
6411 {
6412 c.Die();
6413 }
6414 }
void PlayAnime(AnimeID id, bool force=false)
Definition: Card.cs:6362
void OnInsulted()
Definition: Chara.cs:8335
override void Die(Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None, Chara originalTarget=null)
Definition: Chara.cs:5392

References Card.DamageHP(), Die(), IsAliveInCurrentZone, MaxHP, OnInsulted(), EClass.pc, Card.PlayAnime(), and EClass.rndHalf().

Referenced by DramaOutcome.wedding_fail().

◆ Sleep()

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

Definition at line 9878 of file Chara.cs.

9879 {
9880 RemoveCondition<ConAwakening>();
9881 AddCondition(Condition.Create(100, delegate(ConSleep con)
9882 {
9883 con.pcSleep = 15;
9884 con.pcBed = bed;
9885 con.pcPillow = pillow;
9886 con.pickup = pickup;
9887 con.posBed = posBed;
9888 con.posPillow = posPillow;
9889 }), force: true);
9890 }

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 8258 of file Chara.cs.

8259 {
8260 Say("abCatSniff", this, c);
8261 AddCondition<ConHOT>(EClass.curve(50 + c.CHA * 5, 400, 100));
8262 c.ShowEmo(Emo.angry);
8263 ShowEmo(Emo.love);
8264 Talk("sniff");
8265 c.Talk(new string[4] { "labor", "disgust", "scold", "callGuards" }.RandomItem());
8266 }

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 4648 of file Chara.cs.

4649 {
4650 return held.Split(a);
4651 }

References Card.Split().

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

◆ Stumble()

void Chara.Stumble ( int  mtp = 100)
inline

Definition at line 1879 of file Chara.cs.

1880 {
1881 bool flag = EClass._map.FindThing((Thing t) => t.IsInstalled && t.pos.Equals(EClass.pc.pos) && t.trait is TraitStairsUp) != null;
1882 Say(flag ? "dmgBurdenStairs" : "dmgBurdenFallDown", this);
1883 int num = MaxHP;
1884 if (Evalue(1421) > 0)
1885 {
1886 num = mana.max;
1887 }
1888 int num2 = (num * (base.ChildrenWeight * 100 / WeightLimit) / (flag ? 100 : 200) + 1) * mtp / 100;
1889 if (base.hp <= 0)
1890 {
1891 num2 *= 2;
1892 }
1893 DamageHP(num2, flag ? AttackSource.BurdenStairs : AttackSource.BurdenFallDown);
1894 }
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 3989 of file Chara.cs.

3990 {
3991 if (host != null)
3992 {
3993 host.SyncRide();
3994 }
3995 if (ride != null)
3996 {
3997 SyncRide(ride);
3998 }
3999 if (parasite != null)
4000 {
4002 }
4003 }

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 4005 of file Chara.cs.

4006 {
4007 if (!c.pos.Equals(pos))
4008 {
4009 if (!pos.IsValid)
4010 {
4011 Debug.LogError("exception: pos is not valid:" + pos?.ToString() + "/" + this);
4012 pos = new Point();
4013 }
4014 EClass._map.MoveCard(pos, c);
4015 }
4016 }

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

◆ TalkTopic()

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

Definition at line 7099 of file Chara.cs.

7100 {
7101 if (host == null && !IsInActiveZone)
7102 {
7103 return null;
7104 }
7105 if (!isSynced && (host == null || !host.isSynced) && topic != "dead")
7106 {
7107 return null;
7108 }
7109 if (IsPCParty)
7110 {
7111 int num = EClass.pc.party.members.Count - 1;
7112 switch (topic)
7113 {
7114 case "calm":
7115 if (EClass.rnd(num * 5) != 0)
7116 {
7117 return null;
7118 }
7119 break;
7120 case "aggro":
7121 if (EClass.rnd(num * 10) != 0)
7122 {
7123 return null;
7124 }
7125 break;
7126 case "kill":
7127 if (EClass.rnd(num * 3) != 0)
7128 {
7129 return null;
7130 }
7131 break;
7132 case "fov":
7133 return null;
7134 }
7135 }
7136 string topicText = GetTopicText(topic);
7137 if (topicText.IsEmpty())
7138 {
7139 return null;
7140 }
7141 string text = "_bracketTalk".lang();
7142 bool flag = topicText.StartsWith("*");
7143 bool flag2 = topicText.StartsWith("(");
7144 bool flag3 = topicText.StartsWith(text) || (topicText.Length > 0 && topicText[0] == text[0]) || topicText[0] == '“';
7145 topicText = ApplyTone(topicText);
7146 topicText = topicText.Replace("~", "*");
7147 Msg.SetColor(flag2 ? Msg.colors.Thinking : (flag3 ? Msg.colors.Talk : Msg.colors.Ono));
7148 Msg.Say(StripTalkSpeiclaCharacters(topicText.Replace("&", "")));
7149 if (topic == "dead")
7150 {
7151 EClass.ui.popGame.PopText(ApplyNewLine(topicText.StripBrackets()), null, "PopTextDead", default(Color), pos.Position() + EClass.setting.render.tc.textPosDead);
7152 }
7153 else if (flag || flag3 || flag2)
7154 {
7155 (host ?? this).renderer.Say(ApplyNewLine(topicText.StripBrackets()), default(Color), IsPCParty ? 0.6f : 0f);
7156 }
7157 return topicText;
7158 }
void Say(string text, Color c=default(Color), float duration=0f)
string ApplyNewLine(string text)
Definition: Card.cs:6987
string StripTalkSpeiclaCharacters(string text)
Definition: Card.cs:6968
string ApplyTone(string text, bool stripPun=false)
Definition: Card.cs:7066
string GetTopicText(string topic="calm")
Definition: Chara.cs:7066
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 4018 of file Chara.cs.

4019 {
4020 SyncRide();
4021 combatCount--;
4022 ignoreSPAbsorb = false;
4023 if (IsPC)
4024 {
4025 if (hasMovedThisTurn)
4026 {
4027 pos.Things.ForeachReverse(delegate(Thing t)
4028 {
4030 {
4031 AI_Goto aI_Goto = ai.Current as AI_Goto;
4032 if ((aI_Goto == null && !(ai is GoalManualMove)) || (aI_Goto != null && !aI_Goto.dest.Equals(pos)))
4033 {
4034 return;
4035 }
4036 }
4037 t.trait.OnStepped(this);
4038 });
4039 if (isDead)
4040 {
4041 return;
4042 }
4043 hasMovedThisTurn = false;
4045 {
4046 EClass.player.haltMove = false;
4047 ActionMode.Adv.TryCancelInteraction(sound: false);
4048 EInput.Consume(1);
4049 return;
4050 }
4051 if (EClass._zone.IsRegion)
4052 {
4054 {
4055 foreach (Chara member in EClass.pc.party.members)
4056 {
4057 if (member.hunger.value > 65)
4058 {
4059 member.InstantEat(null, sound: false);
4060 }
4061 }
4062 }
4063 Chara chara = null;
4065 if (cell2 != null && (cell2.zone == null || (cell2.zone is Zone_Field && !cell2.zone.IsPCFaction)))
4066 {
4067 foreach (Chara chara2 in EClass._map.charas)
4068 {
4069 if (!chara2.IsPCFactionOrMinion && !chara2.IsGlobal && chara2.pos.Equals(EClass.pc.pos))
4070 {
4071 chara = chara2;
4072 break;
4073 }
4074 }
4075 }
4076 if (chara != null)
4077 {
4079 {
4080 EClass.player.safeTravel = 5 + EClass.rnd(5);
4081 }
4082 EClass._zone.RemoveCard(chara);
4083 Msg.Say("encounter");
4084 EClass.player.EnterLocalZone(encounter: true, chara);
4085 }
4086 else if (EClass.player.safeTravel <= 0)
4087 {
4088 if (cell2 != null && cell2.zone == null && !EClass.debug.ignoreEncounter)
4089 {
4091 if (!tileInfo.shore)
4092 {
4093 bool num = EClass.pc.HasCondition<ConWardMonster>();
4094 bool flag = EClass.pc.HasCondition<ConDrawMonster>();
4095 bool flag2 = EClass.game.quests.Get<QuestEscort>() != null;
4096 int num2 = (tileInfo.isRoad ? 22 : 12);
4097 if (flag2)
4098 {
4099 num2 = (tileInfo.isRoad ? 16 : 10);
4100 }
4101 if (num)
4102 {
4103 num2 *= (flag2 ? 2 : 20);
4104 }
4105 if (flag)
4106 {
4107 num2 /= 2;
4108 }
4109 if (EClass.rnd(num2) == 0)
4110 {
4111 Msg.Say("encounter");
4112 if (!flag)
4113 {
4114 EClass.player.safeTravel = 5 + EClass.rnd(5);
4115 }
4116 EClass.player.EnterLocalZone(encounter: true);
4117 }
4118 }
4119 }
4120 }
4121 else
4122 {
4124 }
4125 }
4126 }
4127 EClass.player.pickupDelay = 0f;
4128 if (EClass.player.returnInfo != null)
4129 {
4131 if (EClass.player.returnInfo.turns <= 0)
4132 {
4134 {
4135 EClass.player.returnInfo = null;
4137 }
4138 else
4139 {
4141 {
4142 int uidDest = EClass.player.returnInfo.uidDest;
4143 Zone zone = null;
4144 if (uidDest != 0)
4145 {
4146 zone = EClass.game.spatials.map.TryGetValue(uidDest) as Zone;
4147 }
4148 if (zone == null || zone.destryoed)
4149 {
4150 zone = EClass.world.region;
4151 }
4153 {
4154 Msg.Say("returnFail");
4155 }
4156 else
4157 {
4158 Msg.Say("returnComplete");
4159 EClass.player.uidLastTravelZone = 0;
4161 EClass.player.lastZonePos = null;
4162 }
4163 EClass.player.returnInfo = null;
4164 return;
4165 }
4166 EClass.player.returnInfo = null;
4167 Msg.Say("returnOverweight");
4168 }
4169 }
4170 }
4171 if ((HasNoGoal || !ai.IsRunning) && !WillConsumeTurn())
4172 {
4174 return;
4175 }
4178 {
4179 RecipeUpdater.dirty = true;
4180 }
4182 }
4183 else
4184 {
4185 actTime = EClass.player.baseActTime * Mathf.Max(0.1f, (float)EClass.pc.Speed / (float)Speed);
4186 hasMovedThisTurn = false;
4187 }
4190 {
4191 return;
4192 }
4194 if (host != null && !consumeTurn)
4195 {
4196 if (host.ride == this && ((host.hasMovedThisTurn && IsInCombat) || (enemy != null && turn % 3 != 0)))
4197 {
4198 consumeTurn = true;
4199 }
4200 if (host.parasite == this && enemy != null && EClass.rnd(10) > EClass.rnd(host.Evalue(227) + 10))
4201 {
4202 if (Dist(enemy) < 3 && EClass.rnd(2) == 0)
4203 {
4204 Say("parasite_fail", this, host);
4205 if (EClass.rnd(2) == 0 && GetInt(106) == 0)
4206 {
4207 Talk("parasite_fail");
4208 }
4209 }
4210 consumeTurn = true;
4211 }
4212 }
4213 if (consumeTurn)
4214 {
4215 if (IsPC)
4216 {
4218 }
4219 }
4220 else
4221 {
4222 if (base.isRestrained)
4223 {
4224 TryUnrestrain();
4225 }
4226 if (enemy != null)
4227 {
4229 {
4230 enemy = null;
4231 }
4232 else if (!IsPC && (ai.CancelOnAggro || !ai.IsRunning))
4233 {
4234 SetAIAggro();
4235 }
4236 }
4237 if (HasNoGoal || !ai.IsRunning)
4238 {
4239 ChooseNewGoal();
4240 }
4241 ai.Tick();
4242 }
4243 Cell cell = base.Cell;
4245 {
4246 AddCondition<ConWet>(50);
4247 if (pos.IsHotSpring)
4248 {
4249 hygiene.Mod(2);
4250 }
4251 }
4252 if (IsPC && !EClass._zone.IsRegion && cell.CanSuffocate() && !EClass.debug.godMode && !HasElement(1252))
4253 {
4254 AddCondition<ConSuffocation>(800 / (100 + EvalueMax(200, -5) * 10), force: true);
4255 }
4256 CellEffect e;
4257 if (cell.effect != null)
4258 {
4259 e = cell.effect;
4260 switch (e.id)
4261 {
4262 case 1:
4263 case 2:
4264 case 4:
4265 if (IsLevitating)
4266 {
4267 Say("levitating");
4268 break;
4269 }
4270 AddCondition<ConWet>(50);
4271 ProcEffect();
4272 break;
4273 case 3:
4274 PlaySound("fire_step");
4275 AddCondition<ConBurning>(30);
4276 break;
4277 case 5:
4278 if (!isWet)
4279 {
4280 PlaySound("bubble");
4281 AddCondition<ConWet>(30);
4282 ProcEffect();
4283 }
4284 break;
4285 case 6:
4286 if (hasMovedThisTurn)
4287 {
4288 Say("abMistOfDarkness_step", this);
4289 }
4290 AddCondition<ConDark>(e.power);
4291 break;
4292 }
4293 }
4294 if (IsPC)
4295 {
4296 if (EClass.player.currentHotItem.Thing != null)
4297 {
4299 }
4301 }
4302 void ClearEffect()
4303 {
4304 EClass._map.SetLiquid(cell.x, cell.z, 0, 0);
4305 }
4306 void ProcEffect()
4307 {
4308 if (e.idEffect != 0)
4309 {
4310 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
4311 {
4312 aliasEle = EClass.sources.elements.map[e.idEle].alias,
4313 n1 = e.n1,
4314 refVal = e.refVal
4315 });
4316 ClearEffect();
4317 }
4318 }
4319 }
virtual bool CancelOnAggro
Definition: AIAct.cs:80
bool TryCancelInteraction(bool sound=true)
Definition: AM_Adv.cs:1101
void SetTurbo(int mtp=-1)
Definition: AM_Adv.cs:1072
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:7300
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:7716
int Speed
Definition: Chara.cs:1109
static bool consumeTurn
Definition: Chara.cs:182
void SetAIAggro()
Definition: Chara.cs:9040
bool ignoreSPAbsorb
Definition: Chara.cs:148
void ChooseNewGoal()
Definition: Chara.cs:8921
bool WillConsumeTurn()
Definition: Chara.cs:3709
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:1194
float baseActTime
Definition: Player.cs:1222
void EnterLocalZone(bool encounter=false, Chara mob=null)
Definition: Player.cs:1971
HotItem currentHotItem
Definition: Player.cs:1123
int safeTravel
Definition: Player.cs:943
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:1076
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 3721 of file Chara.cs.

3722 {
3723 if (_cooldowns != null)
3724 {
3725 TickCooldown();
3726 }
3727 turn++;
3728 consumeTurn = false;
3729 preventRegen = false;
3730 emoIcon = Emo2.none;
3731 if (base.isSummon)
3732 {
3733 base.c_summonDuration--;
3734 if (base.c_summonDuration <= 0)
3735 {
3736 Die();
3737 return;
3738 }
3739 }
3741 {
3742 AddCondition<ConWet>(20);
3743 }
3744 switch (turn % 50)
3745 {
3746 case 0:
3747 happiness = (hunger.value + stamina.value + depression.value + bladder.value + hygiene.value) / 5;
3748 break;
3749 case 1:
3750 if (!IsPC || !EClass.debug.godMode)
3751 {
3752 if (EClass.rnd(2) == 0 && !HasCondition<ConAwakening>())
3753 {
3754 sleepiness.Mod(1);
3755 }
3756 if (EClass.rnd(3) == 0)
3757 {
3758 hunger.Mod(1);
3759 }
3760 if (IsPC && (sleepiness.GetPhase() != 0 || stamina.GetPhase() <= 1))
3761 {
3762 Tutorial.Play("sleep");
3763 }
3764 }
3765 break;
3766 case 2:
3767 if (parasite != null)
3768 {
3769 ModExp(227, (int)((EClass._zone.IsRegion ? 5 : 40) + parasite.affinity.CurrentStage));
3770 }
3771 if (ride != null)
3772 {
3773 ModExp(226, (int)((EClass._zone.IsRegion ? 5 : 40) + ride.affinity.CurrentStage));
3774 }
3775 break;
3776 case 3:
3777 {
3778 int phase = hygiene.GetPhase();
3779 int num = 0;
3780 num = ((!IsPC) ? ((phase > 3) ? 50 : 0) : ((phase > 3) ? 50 : 0));
3781 if (num > EClass.rnd(100))
3782 {
3783 hygiene.Mod(-1);
3784 }
3785 break;
3786 }
3787 case 4:
3788 if (IsPC)
3789 {
3791 }
3792 break;
3793 case 5:
3794 case 30:
3796 {
3797 AddCondition<ConBurning>(1000, force: true);
3798 }
3799 break;
3800 case 10:
3801 if (HasElement(1250))
3802 {
3803 if (!HasCondition<ConVampire>())
3804 {
3805 AddCondition<ConVampire>();
3806 }
3807 if (!IsPC && !HasCooldown(8793))
3808 {
3809 bool flag = false;
3810 flag = ((!HasCondition<ConTransmuteBat>()) ? (!HasElement(431) && pos.IsSunLit) : (body.HasElement(431) || (EClass.world.date.IsNight && !pos.IsSunLit)));
3811 if (flag && base.IsPCFactionOrMinion && !EClass._zone.IsPCFactionOrTent && EClass._zone.HasLaw && pos.ListWitnesses(this).Count > 0 && !HasCondition<ConBurning>())
3812 {
3813 flag = false;
3814 }
3815 if (flag)
3816 {
3817 UseAbility("SpTransmuteBat", this);
3818 }
3819 }
3820 }
3821 if (HasElement(1423) && !HasCondition<ConPeaky>())
3822 {
3823 AddCondition<ConPeaky>();
3824 }
3825 break;
3826 }
3827 if (turn % 200 == 0)
3828 {
3830 }
3831 if (IsPCParty)
3832 {
3833 if (dirtyWeight)
3834 {
3835 CalcBurden();
3836 }
3837 int phase2 = burden.GetPhase();
3838 int phase3 = hunger.GetPhase();
3839 if (phase3 >= 4)
3840 {
3841 preventRegen = true;
3842 }
3843 if (EClass.rnd(EClass._zone.IsRegion ? 100 : 30) == 0 && phase2 >= 3)
3844 {
3845 Say("dmgBurden", this);
3846 DamageHP(MaxHP * (base.ChildrenWeight * 100 / WeightLimit) / 1000 + 1, AttackSource.Burden);
3847 if (isDead)
3848 {
3849 return;
3850 }
3851 }
3852 if (EClass.rnd(12) == 0)
3853 {
3854 if (IsPC)
3855 {
3856 if (phase2 > 0)
3857 {
3858 ModExp(207, 1 + phase2 * phase2);
3859 }
3860 }
3861 else
3862 {
3863 ModExp(207, 4);
3864 }
3865 }
3866 if (IsPC)
3867 {
3868 if (phase3 >= 5)
3869 {
3870 if (!(ai is AI_Eat) && EClass.rnd(5) == 0)
3871 {
3872 DamageHP(1 + EClass.rnd(2) + MaxHP / 50, AttackSource.Hunger);
3873 }
3874 if (!isDead && EClass.rnd(3) == 0)
3875 {
3876 stamina.Mod(-1);
3877 }
3878 }
3879 if (isDead)
3880 {
3881 return;
3882 }
3883 phase3 = stamina.GetPhase();
3884 if (phase3 <= 0)
3885 {
3886 preventRegen = true;
3887 }
3889 {
3890 if (EClass.rnd(100) == 0 && !isConfused)
3891 {
3892 Msg.Say("rain_confuse");
3893 AddCondition<ConConfuse>(500);
3894 }
3895 if (EClass.rnd(300) == 0 && !isBlind)
3896 {
3897 Msg.Say("rain_confuse");
3898 AddCondition<ConBlind>(200);
3899 }
3900 }
3901 if (turn % (200000 / Mathf.Max(100 + Evalue(409) * 10, 50)) == 0)
3902 {
3903 ModCorruption(1);
3904 }
3905 }
3906 }
3907 if (!IsPC)
3908 {
3909 int num2 = Evalue(409);
3910 if (num2 > 0 && turn % (200000 / Mathf.Max(100 + num2 * 10, 50)) == 0)
3911 {
3912 ModCorruption(1);
3913 }
3914 }
3915 for (int num3 = conditions.Count - 1; num3 >= 0; num3--)
3916 {
3917 if (num3 < conditions.Count)
3918 {
3919 Condition condition = conditions[num3];
3920 if (!condition.TimeBased)
3921 {
3922 condition.Tick();
3923 }
3924 if (!condition.IsKilled)
3925 {
3926 if (condition.ConsumeTurn)
3927 {
3928 consumeTurn = true;
3929 }
3930 if (condition.PreventRegen)
3931 {
3932 preventRegen = true;
3933 }
3934 if (condition.EmoIcon != 0 && condition.EmoIcon > emoIcon)
3935 {
3936 emoIcon = condition.EmoIcon;
3937 }
3938 }
3939 if (isDead)
3940 {
3941 return;
3942 }
3943 }
3944 }
3945 string text = id;
3946 if (!(text == "cocoon"))
3947 {
3948 if (text == "tsunami")
3949 {
3950 if (elements.Base(79) < 30)
3951 {
3952 Die();
3953 return;
3954 }
3955 if (IsInCombat)
3956 {
3957 elements.SetTo(79, elements.Base(79) * 3 / 4);
3958 }
3959 }
3960 }
3961 else
3962 {
3963 if (!EClass._zone.IsRegion && !IsDisabled && 1.0001f - (float)base.hp / (float)MaxHP > EClass.rndf(1f) && !pos.IsSunLit)
3964 {
3965 HatchEgg();
3966 return;
3967 }
3968 consumeTurn = true;
3969 }
3970 if (!preventRegen)
3971 {
3972 if (EClass.rnd(25) == 0 && base.hp < MaxHP)
3973 {
3974 HealHP(EClass.rnd(Evalue(300) / 3 + 1) + 1);
3975 elements.ModExp(300, 8f);
3976 }
3977 if (EClass.rnd(8) == 0 && mana.value < mana.max)
3978 {
3979 mana.Mod(EClass.rnd(Evalue(301) / 2 + 1) + 1);
3980 elements.ModExp(301, 8f);
3981 }
3982 if (EClass.rnd(20) == 0 && !IsPC && stamina.value < stamina.max)
3983 {
3984 stamina.Mod(EClass.rnd(5) + 1);
3985 }
3986 }
3987 }
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:5863
bool dirtyWeight
Definition: Card.cs:86
bool HasElement(int idEle)
Definition: CharaBody.cs:412
void TickCooldown()
Definition: Chara.cs:8902
void DiminishTempElements(int a=1)
Definition: Chara.cs:10493
Emo2 emoIcon
Definition: Chara.cs:108
bool UseAbility(int idAct, Card tc=null, Point pos=null, bool pt=false)
Definition: Chara.cs:5880
bool isBlind
Definition: Chara.cs:132
static bool preventRegen
Definition: Chara.cs:184
void CalcBurden()
Definition: Chara.cs:1864
virtual bool IsKilled
Definition: Condition.cs:7
override void Tick()
Definition: Condition.cs:70
void UpdateNyan()
Definition: Player.cs:2435
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:478

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(), EClass.player, BaseCondition.PreventRegen, EClass.rnd(), EClass.rndf(), Msg.Say(), Condition.Tick(), BaseCondition.TimeBased, Player.UpdateNyan(), Stats.value, World.weather, and EClass.world.

Referenced by _Move().

◆ TickCooldown()

void Chara.TickCooldown ( )
inline

Definition at line 8902 of file Chara.cs.

8903 {
8904 for (int num = _cooldowns.Count - 1; num >= 0; num--)
8905 {
8906 if (_cooldowns[num] % 1000 == 1)
8907 {
8908 _cooldowns.RemoveAt(num);
8909 }
8910 else
8911 {
8912 _cooldowns[num]--;
8913 }
8914 }
8915 if (_cooldowns.Count == 0)
8916 {
8917 _cooldowns = null;
8918 }
8919 }

◆ TickWork()

void Chara.TickWork ( VirtualDate  date)
inline

Definition at line 9322 of file Chara.cs.

9323 {
9325 if (span != TimeTable.Span.Work && span != 0)
9326 {
9327 return;
9328 }
9329 WorkSummary workSummary = GetWorkSummary();
9330 if (span == TimeTable.Span.Work)
9331 {
9332 if (workSummary.work != null)
9333 {
9334 PerformWork(workSummary.work, isHobby: false, date.IsRealTime);
9335 }
9336 }
9337 else if (workSummary.hobbies.Count > 0)
9338 {
9339 PerformWork(workSummary.hobbies.RandomItem(), isHobby: true, date.IsRealTime);
9340 }
9341 }
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 1198 of file Chara.cs.

1199 {
1200 return base.Name + "(" + ai?.ToString() + ")" + pos?.ToString() + "/" + base.ExistsOnMap + "/" + isDead;
1201 }
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 4433 of file Chara.cs.

4434 {
4435 if (!IsPC || !(t.trait is TraitRod) || t.c_charges <= 0 || !HasElement(1564))
4436 {
4437 return;
4438 }
4439 Say("absorbRod", this, t);
4440 TraitRod rod = t.trait as TraitRod;
4441 bool flag = false;
4442 if (rod.source != null)
4443 {
4444 using IEnumerator<SourceElement.Row> enumerator = EClass.sources.elements.rows.Where((SourceElement.Row a) => a.id == rod.source.id).GetEnumerator();
4445 if (enumerator.MoveNext())
4446 {
4447 SourceElement.Row current = enumerator.Current;
4448 if (IsPC)
4449 {
4450 GainAbility(current.id, t.c_charges * 100, t);
4451 flag = true;
4452 }
4453 }
4454 }
4455 if (!flag)
4456 {
4457 mana.Mod(-50 * t.c_charges);
4458 }
4459 t.c_charges = 0;
4461 }
int c_charges
Definition: Card.cs:1283
void GainAbility(int ele, int mtp=100, Thing origin=null)
Definition: Chara.cs:10259

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 7475 of file Chara.cs.

7476 {
7477 if (!IsPCFaction && !IsGuest())
7478 {
7479 return null;
7480 }
7481 foreach (Card item in EClass._map.props.installed.all)
7482 {
7483 if (item.trait is TraitBed traitBed && traitBed.CanAssign(this))
7484 {
7485 traitBed.AddHolder(this);
7486 Msg.Say("claimBed", this);
7487 return traitBed;
7488 }
7489 }
7490 return null;
7491 }
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 5714 of file Chara.cs.

5715 {
5717 {
5718 return;
5719 }
5720 int num = 0;
5721 bool flag = false;
5722 bool flag2 = false;
5723 Point point = pos.GetNearestPoint(allowBlock: true, allowChara: false, allowInstalled: false, ignoreCenter: true) ?? pos;
5724 TreasureType type = TreasureType.BossQuest;
5725 if (EClass._zone.Boss == this)
5726 {
5727 type = TreasureType.BossNefia;
5728 num = 2 + EClass.rnd(2);
5729 flag = (flag2 = true);
5730 EClass._zone.Boss = null;
5731 Msg.Say("boss_win", EClass._zone.Name);
5733 {
5734 Msg.Say("boss_win_void", EClass._zone.Name);
5735 EClass.player.flags.KilledBossInVoid = true;
5736 }
5737 if (EClass._zone.IsNefia)
5738 {
5741 SE.Play("Jingle/fanfare2");
5742 EClass._zone.SetBGM(114, refresh: true, 3f);
5743 }
5746 }
5747 switch (id)
5748 {
5749 case "azzrasizzle":
5750 num = 5;
5751 flag = (flag2 = true);
5752 EClass.Sound.StopBGM(3f);
5753 EClass._zone.SetBGM(1, refresh: false);
5755 {
5756 EClass.game.quests.Get<QuestIntoDarkness>().UpdateOnTalk();
5757 }
5758 break;
5759 case "vernis_boss":
5760 num = 5;
5761 flag = (flag2 = true);
5762 EClass.Sound.StopBGM(3f);
5763 EClass._zone.SetBGM(1, refresh: false);
5765 {
5766 EClass.game.quests.Get<QuestVernis>().UpdateOnTalk();
5767 }
5768 break;
5769 case "lurie_boss":
5770 if (!(EClass._zone is Zone_Exile))
5771 {
5772 num = 5;
5773 flag = (flag2 = true);
5774 EClass._zone.SetBGM(120, refresh: true, 3f);
5776 {
5777 EClass.game.quests.Get<QuestNegotiationDarkness>().ChangePhase(4);
5778 EClass.player.flags.killedDuponne = true;
5779 }
5780 }
5781 break;
5782 case "ungaga_pap":
5783 num = 5;
5784 flag = (flag2 = true);
5786 {
5787 EClass._zone.SetBGM(46, refresh: true, 3f);
5788 }
5789 break;
5790 case "melilith_boss":
5791 num = 5;
5792 flag = (flag2 = true);
5793 EClass.Sound.StopBGM(3f);
5794 EClass._zone.SetBGM(1, refresh: false);
5795 break;
5796 case "doga":
5797 {
5798 QuestCurry questCurry = EClass.game.quests.Get<QuestCurry>();
5799 if (questCurry != null)
5800 {
5801 num = 5;
5802 flag = (flag2 = true);
5803 EClass.Sound.StopBGM(3f);
5804 EClass._zone.SetBGM(1, refresh: false);
5805 questCurry.NextPhase();
5806 }
5807 break;
5808 }
5809 case "fairy_raina":
5810 case "fairy_poina":
5811 {
5812 bool num2 = EClass._map.FindChara((id == "fairy_raina") ? "fairy_poina" : "fairy_raina") == null;
5813 QuestNasu questNasu = EClass.game.quests.Get<QuestNasu>();
5814 if (num2 && questNasu != null && questNasu.phase <= 1)
5815 {
5816 if (questNasu.phase == 0)
5817 {
5818 questNasu.NextPhase();
5819 }
5820 num = 5;
5821 flag = (flag2 = true);
5822 EClass.Sound.StopBGM(3f);
5823 EClass._zone.SetBGM(1, refresh: false);
5824 EClass.player.DropReward(ThingGen.Create("backpack_holding"));
5825 questNasu.NextPhase();
5826 }
5827 break;
5828 }
5829 case "isygarad":
5830 {
5831 num = 5;
5832 flag = (flag2 = true);
5833 QuestExploration questExploration = EClass.game.quests.Get<QuestExploration>();
5834 if (questExploration != null)
5835 {
5836 SE.Play("kill_boss");
5837 questExploration.ChangePhase(3);
5838 EClass.Sound.StopBGM(3f);
5839 EClass._zone.SetBGM(1, refresh: false);
5840 }
5841 break;
5842 }
5843 case "swordkeeper":
5844 num = 10;
5845 flag = true;
5846 SE.Play("kill_boss");
5847 SoundManager.ForceBGM();
5848 LayerDrama.Activate("_event", "event", "swordkeeper_defeat");
5849 break;
5850 }
5851 if (flag)
5852 {
5853 SE.Play("kill_boss");
5854 }
5855 if (num != 0)
5856 {
5858 {
5859 EClass.player.stats.deepest = EClass._zone.DangerLv;
5860 Msg.Say("update_deepest", EClass.player.stats.deepest.ToString() ?? "");
5861 }
5863 {
5864 EClass.player.stats.deepestVoid = -EClass._zone.lv;
5865 Msg.Say("update_deepest_void", EClass.player.stats.deepestVoid.ToString() ?? "");
5866 }
5867 EClass.player.willAutoSave = true;
5868 Thing thing = ThingGen.CreateTreasure("chest_boss", base.LV, type);
5869 point.SetBlock();
5870 point.SetObj();
5871 EClass._zone.AddCard(thing, point).Install();
5872 ThingGen.TryLickChest(thing);
5873 }
5874 if (flag2)
5875 {
5877 }
5878 }
TreasureType
Definition: TreasureType.cs:2
bool KilledBossInVoid
Definition: Player.cs:430
int deepest
Definition: Player.cs:114
long nefiaBeaten
Definition: Player.cs:147
int deepestVoid
Definition: Player.cs:117
void ModFame(int a)
Definition: Player.cs:2119
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:287
void SetBGM(List< int > ids, bool refresh=true, float fadeDuration=0f)
Definition: Zone.cs:3003
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 4653 of file Chara.cs.

4654 {
4655 if (held != null && held.trait.CanOnlyCarry)
4656 {
4657 DropHeld();
4658 }
4659 foreach (Thing item in things.List((Thing t) => t.trait.CanOnlyCarry))
4660 {
4661 DropThing(item);
4662 }
4663 }
void DropThing(Thing t, int num=-1)
Definition: Chara.cs:4685

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

◆ TryEquip()

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

Definition at line 7874 of file Chara.cs.

7875 {
7876 if (!ShouldEquip(t, useFav))
7877 {
7878 return false;
7879 }
7880 if (t.category.slot == 0)
7881 {
7882 return false;
7883 }
7884 if (useFav)
7885 {
7886 BodySlot slot = body.GetSlot(t);
7887 switch (GetFavAttackStyle())
7888 {
7889 case AttackStyle.Default:
7890 case AttackStyle.TwoHand:
7891 if (t.IsMeleeWeapon)
7892 {
7893 slot = body.slotMainHand;
7894 }
7895 break;
7896 case AttackStyle.Shield:
7897 if (t.IsMeleeWeapon)
7898 {
7899 slot = body.slotMainHand;
7900 }
7901 break;
7902 }
7903 body.Equip(t, slot);
7904 }
7905 else
7906 {
7907 body.Equip(t);
7908 }
7909 Say("equip", this, t);
7910 return true;
7911 }
bool ShouldEquip(Thing t, bool useFav=false)
Definition: Chara.cs:7762

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 7994 of file Chara.cs.

7995 {
7996 if (IsPC)
7997 {
7999 if (thing?.trait is TraitToolRange && CanEquipRanged(thing))
8000 {
8001 ranged = thing;
8002 return true;
8003 }
8004 return false;
8005 }
8006 if (ranged != null && ranged.parent == this)
8007 {
8008 return true;
8009 }
8011 return ranged != null;
8012 }
Thing GetBestRangedWeapon()
Definition: Chara.cs:7979

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 7918 of file Chara.cs.

7919 {
7920 Thing dest = null;
7921 if (IsPC)
7922 {
7924 {
7925 return FindThrowable(hotbar: true);
7926 }
7927 return null;
7928 }
7929 things.Foreach(delegate(Thing t)
7930 {
7931 if (t.HasTag(CTAG.throwWeapon) || (!base.IsPCFactionOrMinion && t.HasTag(CTAG.throwWeaponEnemy)))
7932 {
7933 dest = t;
7934 }
7935 });
7936 return dest;
7937 Thing FindThrowable(bool hotbar)
7938 {
7939 things.Foreach(delegate(Thing t)
7940 {
7941 if (dest == null)
7942 {
7943 if (t.IsHotItem)
7944 {
7945 if (!hotbar)
7946 {
7947 return;
7948 }
7949 }
7950 else if (hotbar)
7951 {
7952 return;
7953 }
7954 if (t.HasTag(CTAG.throwWeapon))
7955 {
7956 dest = t;
7957 }
7958 }
7959 });
7960 return dest;
7961 }
7962 }

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 4511 of file Chara.cs.

4512 {
4513 if (held == t)
4514 {
4515 return true;
4516 }
4517 if (t.isDestroyed || t.Num <= 0)
4518 {
4519 return false;
4520 }
4521 if (!CanPick(t))
4522 {
4523 if (t.parent == null)
4524 {
4525 EClass._zone.AddCard(t, pos);
4526 }
4527 return false;
4528 }
4529 HoldCard(t, num);
4530 return true;
4531 }
bool CanPick(Card c)
Definition: Chara.cs:4331
void HoldCard(Card t, int num=-1)
Definition: Chara.cs:4533

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 8140 of file Chara.cs.

8141 {
8142 int num = Evalue(289);
8143 if (num == 0)
8144 {
8145 return false;
8146 }
8147 int lV = t.LV;
8148 if (EClass.rnd(num * num + 5) > EClass.rnd(lV * lV) * 20)
8149 {
8150 t.Identify(show, (num >= 20) ? IDTSource.SkillHigh : IDTSource.Skill);
8151 int num2 = 50;
8152 if (lV > num)
8153 {
8154 num2 += (lV - num) * 10;
8155 }
8156 elements.ModExp(289, Mathf.Min(num2, 1000));
8157 return true;
8158 }
8159 return false;
8160 }
IDTSource
Definition: IDTSource.cs:2
Thing Identify(bool show=true, IDTSource idtSource=IDTSource.Identify)
Definition: Thing.cs:2102

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 2743 of file Chara.cs.

2744 {
2745 foreach (Condition condition in conditions)
2746 {
2747 if (!condition.TryMove(newPoint))
2748 {
2749 return MoveResult.Fail;
2750 }
2751 }
2752 if (base.isRestrained)
2753 {
2754 if (!IsPC)
2755 {
2756 return MoveResult.Fail;
2757 }
2758 base.isRestrained = false;
2759 }
2760 if (!CanMoveTo(newPoint, allowDestroyPath))
2761 {
2762 return MoveResult.Fail;
2763 }
2764 return _Move(newPoint);
2765 }
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 2681 of file Chara.cs.

2682 {
2683 if (p.Equals(pos))
2684 {
2685 return MoveResult.Success;
2686 }
2688 {
2689 return MoveResult.Fail;
2690 }
2691 bool flag = true;
2692 Point point = null;
2693 _sharedPos.Set(p);
2694 if (CanDestroyPath())
2695 {
2697 {
2698 return MoveResult.Success;
2699 }
2700 Debug.Log(CanMoveTo(pos));
2702 }
2703 int num = pos.Distance(p);
2704 PathProgress pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Default, num + 4, 1);
2705 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 4)
2706 {
2707 PathFinderNode pathFinderNode = pathProgress.nodes[pathProgress.nodes.Count - 1];
2708 if (TryMove(new Point(pathFinderNode.X, pathFinderNode.Z)) == MoveResult.Success)
2709 {
2710 return MoveResult.Success;
2711 }
2712 }
2713 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Combat, num + 4, 1);
2714 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 4)
2715 {
2716 PathFinderNode pathFinderNode2 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2717 if (TryMove(new Point(pathFinderNode2.X, pathFinderNode2.Z)) == MoveResult.Success)
2718 {
2719 return MoveResult.Success;
2720 }
2721 }
2722 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Default, num + 25, 2);
2723 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 25)
2724 {
2725 PathFinderNode pathFinderNode3 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2726 if (TryMove(new Point(pathFinderNode3.X, pathFinderNode3.Z)) == MoveResult.Success)
2727 {
2728 return MoveResult.Success;
2729 }
2730 }
2731 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Combat, num + 25, 2);
2732 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 25)
2733 {
2734 PathFinderNode pathFinderNode4 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2735 if (TryMove(new Point(pathFinderNode4.X, pathFinderNode4.Z)) == MoveResult.Success)
2736 {
2737 return MoveResult.Success;
2738 }
2739 }
2740 return MoveResult.Fail;
2741 }
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:2606
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 9809 of file Chara.cs.

9810 {
9811 if (TC == null || TC.HasCondition<ConInvulnerable>() || TC.Evalue(1421) > 0 || !TC.ExistsOnMap)
9812 {
9813 return false;
9814 }
9815 if (TC.hp > (long)TC.MaxHP * (long)(Mathf.Min(5 + (int)Mathf.Sqrt(power), harvest ? 35 : 25) + Evalue(1426) * 5) / (TC.IsPowerful ? 200 : 100))
9816 {
9817 return false;
9818 }
9819 if (TC.HasElement(427))
9820 {
9821 return false;
9822 }
9823 if (TC.IsPC && EClass.player.invlunerable)
9824 {
9825 return false;
9826 }
9827 PlaySound("hit_finish");
9828 Say("finish");
9829 Say("finish2", this, TC);
9830 TC.DamageHP(TC.MaxHP, AttackSource.Finish, this);
9831 return false;
9832 }
@ harvest
bool invlunerable
Definition: Player.cs:1196
Definition: TC.cs:4

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

Referenced by ActEffect.Proc().

◆ TryNullifyCurse()

bool Chara.TryNullifyCurse ( )
inline

Definition at line 10283 of file Chara.cs.

10284 {
10285 if (IsPCParty)
10286 {
10287 foreach (Chara member in EClass.pc.party.members)
10288 {
10289 if (member.HasElement(1641) && EClass.rnd(3) != 0)
10290 {
10291 Msg.Say("curse_nullify", member);
10292 return true;
10293 }
10294 }
10295 }
10296 else if (HasElement(1641) && EClass.rnd(3) != 0)
10297 {
10298 Say("curse_nullify", this);
10299 return true;
10300 }
10301 if (GetCondition<ConHolyVeil>() != null && EClass.rnd(5) != 0)
10302 {
10303 Say("curse_nullify", this);
10304 return true;
10305 }
10306 return false;
10307 }

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 4487 of file Chara.cs.

4488 {
4489 foreach (Card item in pos.ListCards())
4490 {
4491 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)))
4492 {
4493 Thing thing = Pick(item.Thing);
4494 if (thing != null && !IsPC)
4495 {
4496 thing.isNPCProperty = true;
4497 }
4498 break;
4499 }
4500 }
4501 }

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

Referenced by AI_Fish.Run().

◆ TryPoisonPotion()

Thing Chara.TryPoisonPotion ( Thing  t)
inline

Definition at line 4419 of file Chara.cs.

4420 {
4421 if (t.trait is TraitPotion && t.id != "1165" && !t.source.tag.Contains("neg") && EClass.rnd(2) == 0 && HasElement(1565))
4422 {
4423 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)
4424 .id;
4425 Say("poisonDrip", this);
4426 int num = t.Num;
4427 t.Destroy();
4428 t = ThingGen.Create(text).SetNum(num);
4429 }
4430 return t;
4431 }
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 3263 of file Chara.cs.

3264 {
3265 List<Chara> list = point.ListCharas();
3266 if (list.Count == 0)
3267 {
3268 return;
3269 }
3270 list.Copy().ForeachReverse(delegate(Chara c)
3271 {
3272 if (!c.ai.IsMoveAI && !c.IsPC && c.trait.CanBePushed && c != this && !c.noMove && (!EClass._zone.IsRegion || c.IsPCFactionOrMinion))
3273 {
3274 List<Point> list2 = new List<Point>();
3275 for (int i = point.x - 1; i <= point.x + 1; i++)
3276 {
3277 for (int j = point.z - 1; j <= point.z + 1; j++)
3278 {
3279 if (i != point.x || j != point.z)
3280 {
3281 Point point2 = new Point(i, j);
3282 if (point2.IsValid && !point2.HasChara && !point2.IsBlocked && !point2.cell.hasDoor && !point2.IsBlockByHeight(point))
3283 {
3284 list2.Add(point2);
3285 }
3286 }
3287 }
3288 }
3289 if (list2.Count > 0)
3290 {
3291 if (list2.Count > 1)
3292 {
3293 list2.ForeachReverse(delegate(Point p)
3294 {
3295 if (p.Equals(new Point(point.x + point.x - pos.x, point.z + point.z - pos.z)))
3296 {
3297 list2.Remove(p);
3298 }
3299 });
3300 }
3301 Point newPoint = list2.RandomItem();
3302 if (IsPC)
3303 {
3304 Say("displace", this, c);
3305 PlaySound("push");
3306 }
3307 else if (c.isSynced)
3308 {
3309 c.PlayEffect("push");
3310 }
3311 c.MoveByForce(newPoint, this, checkWall: true);
3312 if (!c.IsPC && c.trait is TraitRogue && EClass.rnd(3) == 0 && GetCurrency() > 20 && !HasElement(426))
3313 {
3314 int num = EClass.rndHalf(10 + Mathf.Min(GetCurrency() / 100, 1000));
3315 c.Talk("pushed");
3316 Say("pushed_money", this, c);
3317 ModCurrency(-num);
3318 c.ModCurrency(num);
3319 c.PlaySound("steal_money");
3320 }
3321 else if (IsPC && !c.IsPCParty && !c.IsUnique && c.IsHumanSpeak && EClass.rnd(5) == 0)
3322 {
3323 c.Talk("pushed");
3324 }
3325 }
3326 }
3327 });
3328 }
bool IsMoveAI
Definition: AIAct.cs:55
bool IsHumanSpeak
Definition: Chara.cs:1029

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 4503 of file Chara.cs.

4504 {
4505 if (!EClass._zone.TryAddThingInSharedContainer(t, containers) && dropIfFail)
4506 {
4507 EClass._zone.AddCard(t, pos);
4508 }
4509 }
bool TryAddThingInSharedContainer(Thing t, List< Thing > containers=null, bool add=true, bool msg=false, Chara chara=null, bool sharedOnly=true)
Definition: Zone.cs:2137

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 7526 of file Chara.cs.

7527 {
7529 }
void TryPutSharedItems(IEnumerable< Thing > containers, bool msg=true)
Definition: Chara.cs:7493
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 7493 of file Chara.cs.

7494 {
7495 if (GetInt(113) != 0)
7496 {
7497 return;
7498 }
7499 _ListItems.Clear();
7500 Thing bestRangedWeapon = GetBestRangedWeapon();
7501 foreach (Thing thing in things)
7502 {
7503 if (!thing.IsAmmo && !thing.c_isImportant)
7504 {
7505 if (thing.category.slot != 0 && !thing.isEquipped && !thing.HasTag(CTAG.gift))
7506 {
7507 _ListItems.Add(thing);
7508 }
7509 else if (thing.IsRangedWeapon && thing.category.slot == 0 && bestRangedWeapon != thing)
7510 {
7511 _ListItems.Add(thing);
7512 }
7513 }
7514 }
7515 if (_ListItems.Count == 0)
7516 {
7517 return;
7518 }
7519 List<Thing> containers2 = containers.ToList();
7520 foreach (Thing listItem in _ListItems)
7521 {
7522 EClass._zone.TryAddThingInSharedContainer(listItem, containers2, add: true, msg: true, this);
7523 }
7524 }
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 4463 of file Chara.cs.

4464 {
4465 if (t.id == "axe")
4466 {
4467 Tutorial.Reserve("tool");
4468 }
4469 if (t.category.id == "mushroom")
4470 {
4471 Tutorial.Reserve("food");
4472 }
4473 if (t.category.id == "herb")
4474 {
4475 Tutorial.Reserve("herb");
4476 }
4477 if (t.id == "pasture")
4478 {
4479 Tutorial.Reserve("pasture");
4480 }
4481 if (t.id == "log")
4482 {
4483 Tutorial.Reserve("process");
4484 }
4485 }

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

◆ TryRestock()

void Chara.TryRestock ( bool  onCreate)
inline

Definition at line 4747 of file Chara.cs.

4748 {
4749 isOnCreate = onCreate;
4750 if (onCreate || (!IsPCFaction && (base.IsUnique || trait is TraitAdventurer || trait is TraitGuard)))
4751 {
4752 RestockEquip((!EClass.core.IsGameStarted || !(EClass._zone is Zone_Music)) && onCreate);
4753 }
4754 RestockInventory(onCreate);
4755 }
void RestockInventory(bool onCreate)
Definition: Chara.cs:5071
void RestockEquip(bool onCreate)
Definition: Chara.cs:4757

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 6433 of file Chara.cs.

6434 {
6435 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))
6436 {
6437 SetEnemy(c);
6438 }
6439 }

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 7531 of file Chara.cs.

7532 {
7534 }
void TryTakeSharedItems(bool msg=true)
Definition: Chara.cs:7531

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 7536 of file Chara.cs.

7537 {
7538 if (base.isSummon || (memberType == FactionMemberType.Livestock && homeBranch != null && !homeBranch.policies.IsActive(2715)))
7539 {
7540 return;
7541 }
7542 int num = 2;
7543 int num2 = 1;
7544 int num3 = 2;
7545 bool flag = GetInt(113) == 0;
7546 int num4 = 2;
7547 int num5 = 2;
7548 int num6 = 2;
7550 {
7551 num5 = 0;
7552 num6 = 0;
7553 }
7554 foreach (Thing thing3 in things)
7555 {
7556 if (CanEat(thing3, shouldEat))
7557 {
7558 if (thing3.HasElement(757))
7559 {
7560 num2 -= thing3.Num;
7561 num -= thing3.Num;
7562 }
7563 else
7564 {
7565 num -= thing3.Num;
7566 }
7567 }
7568 if (thing3.trait.GetHealAction(this) != null)
7569 {
7570 num3 -= thing3.Num;
7571 }
7572 if (thing3.id == "polish_powder")
7573 {
7574 num4 -= thing3.Num;
7575 }
7576 if (thing3.trait is TraitBlanketColdproof)
7577 {
7578 num5 -= thing3.Num;
7579 }
7580 if (thing3.trait is TraitBlanketFireproof)
7581 {
7582 num6 -= thing3.Num;
7583 }
7584 }
7585 _ListItems.Clear();
7586 foreach (Thing container in containers)
7587 {
7588 if (!container.IsSharedContainer)
7589 {
7590 continue;
7591 }
7592 foreach (Thing thing4 in container.things)
7593 {
7594 if (!thing4.c_isImportant && thing4.IsIdentified && thing4 != EClass.pc.held)
7595 {
7596 if (num4 > 0 && thing4.id == "polish_powder")
7597 {
7598 _ListItems.Add(thing4);
7599 num4 -= thing4.Num;
7600 }
7601 else if (num5 > 0 && !HasElement(1236) && thing4.trait is TraitBlanketColdproof)
7602 {
7603 _ListItems.Add(thing4);
7604 num5 -= thing4.Num;
7605 }
7606 else if (num6 > 0 && thing4.trait is TraitBlanketFireproof)
7607 {
7608 _ListItems.Add(thing4);
7609 num6 -= thing4.Num;
7610 }
7611 else if (num2 > 0 && CanEat(thing4, shouldEat) && !thing4.c_isImportant && thing4.HasElement(757))
7612 {
7613 _ListItems.Add(thing4);
7614 num2 -= thing4.Num;
7615 }
7616 else if (num > 0 && CanEat(thing4, shouldEat) && !thing4.c_isImportant)
7617 {
7618 _ListItems.Add(thing4);
7619 num -= thing4.Num;
7620 }
7621 else if (num3 > 0 && thing4.trait.GetHealAction(this) != null)
7622 {
7623 _ListItems.Add(thing4);
7624 num3 -= thing4.Num;
7625 }
7626 else if (flag && thing4.IsEquipmentOrRanged && !thing4.HasTag(CTAG.gift) && ShouldEquip(thing4, useFav: true))
7627 {
7628 _ListItems.Add(thing4);
7629 }
7630 }
7631 }
7632 }
7633 if (_ListItems.Count == 0)
7634 {
7635 return;
7636 }
7637 _ListItems.ForeachReverse(delegate(Thing t)
7638 {
7639 if (t.IsEquipmentOrRanged)
7640 {
7641 bool flag3 = false;
7642 int slot = t.category.slot;
7643 int equipValue = t.GetEquipValue();
7644 foreach (Thing listItem in _ListItems)
7645 {
7646 if (listItem.category.slot == slot && listItem.GetEquipValue() > equipValue)
7647 {
7648 flag3 = true;
7649 break;
7650 }
7651 }
7652 if (flag3)
7653 {
7654 _ListItems.Remove(t);
7655 }
7656 }
7657 });
7658 bool flag2 = false;
7659 foreach (Thing listItem2 in _ListItems)
7660 {
7661 Thing thing = listItem2;
7662 if (things.IsFull(thing))
7663 {
7664 break;
7665 }
7666 Thing thing2 = listItem2.parent as Thing;
7667 if (thing.HasElement(757))
7668 {
7669 if (thing.Num > 1)
7670 {
7671 thing = thing.Split(1);
7672 }
7673 }
7674 else if (thing.Num > 2)
7675 {
7676 thing = thing.Split(2);
7677 }
7678 if (msg)
7679 {
7680 Say("takeSharedItem", this, thing, thing2.GetName(NameStyle.Full));
7681 }
7682 AddCard(thing);
7683 if (ShouldEquip(thing, useFav: true) && thing.category.slot != 0)
7684 {
7685 TryEquip(thing, useFav: true);
7686 flag2 = true;
7687 }
7688 }
7689 if (flag2 && flag)
7690 {
7691 TryPutSharedItems(containers);
7692 }
7693 }
bool IsIdentified
Definition: Card.cs:2405
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 8721 of file Chara.cs.

8722 {
8723 if (!EClass.debug.enable || IsPC || !IsGlobal || !IsPCFaction)
8724 {
8725 return;
8726 }
8727 for (int i = 0; i < 100; i++)
8728 {
8729 if (base.feat == 0)
8730 {
8731 break;
8732 }
8733 if (base.c_upgrades == null)
8734 {
8735 base.c_upgrades = new CharaUpgrade();
8736 }
8737 if (base.c_upgrades.halt)
8738 {
8739 break;
8740 }
8741 Rand.SetSeed(base.uid + base.c_upgrades.count);
8742 int num = EClass.rnd(100);
8743 int num2 = 0;
8744 int num3 = 1;
8745 int num4 = 0;
8746 bool flag = false;
8747 IEnumerable<SourceElement.Row> ie = EClass.sources.elements.rows.Where((SourceElement.Row a) => !elements.Has(a) && a.category == "skill" && !a.tag.Contains("noPet"));
8748 List<Element> list = ListAvailabeFeats(pet: true);
8749 if (num >= 90 && list.Count > 0)
8750 {
8751 Element element = list.RandomItem();
8752 num2 = element.id;
8753 num4 = element.CostLearn;
8754 }
8755 else if (num >= 60 && ie.Any())
8756 {
8757 num2 = ie.RandomItem().id;
8758 num4 = 3;
8759 }
8760 else
8761 {
8762 num2 = Element.List_MainAttributesMajor.RandomItem();
8763 num4 = 1;
8764 num3 = 2;
8765 flag = true;
8766 }
8767 Rand.SetSeed();
8768 if (num4 > base.feat)
8769 {
8770 break;
8771 }
8772 base.feat -= num4;
8773 base.c_upgrades.count++;
8774 base.c_upgrades.spent += num4;
8775 bool flag2 = false;
8776 if (flag)
8777 {
8778 foreach (CharaUpgrade.Item item in base.c_upgrades.items)
8779 {
8780 if (item.idEle == num2)
8781 {
8782 item.value += num3;
8783 item.cost += num4;
8784 flag2 = true;
8785 break;
8786 }
8787 }
8788 }
8789 if (!flag2)
8790 {
8791 base.c_upgrades.items.Add(new CharaUpgrade.Item
8792 {
8793 idEle = num2,
8794 value = num3,
8795 cost = num4
8796 });
8797 }
8798 SourceElement.Row row = EClass.sources.elements.map[num2];
8799 if (row.category == "feat")
8800 {
8801 SetFeat(num2, elements.ValueWithoutLink(num2) + 1, msg: true);
8802 }
8803 else if (elements.ValueWithoutLink(row.id) == 0)
8804 {
8805 elements.Learn(row.id);
8806 }
8807 else
8808 {
8809 elements.ModBase(num2, num3);
8810 }
8811 }
8812 }
List< Element > ListAvailabeFeats(bool pet=false, bool showAll=false)
Definition: Chara.cs:10044
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 8023 of file Chara.cs.

8024 {
8025 if (t.id == "338" && t.blessedState >= BlessedState.Normal)
8026 {
8027 Thing thing = things.Find((Thing a) => a.IsEquipmentOrRanged && !a.isAcidproof);
8028 if (thing != null)
8029 {
8030 Say("dip", this, thing, t.GetName(NameStyle.Full, 1));
8031 SE.Change();
8032 t.trait.OnBlend(thing, this);
8033 return true;
8034 }
8035 return false;
8036 }
8037 if (t.IsNegativeGift || t.source.HasTag(CTAG.ignoreUse))
8038 {
8039 return false;
8040 }
8041 if (t.id == "cigar")
8042 {
8043 (t.trait as TraitItemProc).OnUse(this);
8044 return true;
8045 }
8046 if (t.trait.CanEat(this) && hunger.GetPhase() > ((IsPCFaction || IsPCFactionMinion) ? 2 : 0))
8047 {
8049 {
8050 target = t
8051 });
8052 return true;
8053 }
8054 if (t.trait.CanDrink(this))
8055 {
8056 Drink(t);
8057 return true;
8058 }
8059 if (t.trait.CanRead(this))
8060 {
8062 {
8063 target = t
8064 });
8065 return true;
8066 }
8067 if (base.hp < MaxHP * 90 / 100)
8068 {
8069 Action healAction = t.trait.GetHealAction(this);
8070 if (healAction != null)
8071 {
8072 healAction();
8073 return true;
8074 }
8075 }
8076 return false;
8077 }
bool isAcidproof
Definition: Card.cs:687
void SetAIImmediate(AIAct g)
Definition: Chara.cs:9082
virtual bool CanRead(Chara c)
Definition: Trait.cs:995
virtual bool CanDrink(Chara c)
Definition: Trait.cs:1013
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 9343 of file Chara.cs.

9344 {
9345 if (EClass.world.date.IsExpired(GetInt(51)))
9346 {
9347 Expedition expedition = Expedition.Create(this, sourceWork.expedition.ToEnum<ExpeditionType>());
9348 SetInt(51, EClass.world.date.GetRaw() + 60 * (expedition.hours + 24));
9349 homeBranch.expeditions.Add(expedition);
9350 return true;
9351 }
9352 return false;
9353 }
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.

◆ UnmakeMinion()

void Chara.UnmakeMinion ( )
inline

Definition at line 2399 of file Chara.cs.

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

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

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

◆ UpdateAngle()

void Chara.UpdateAngle ( )
inline

Definition at line 3632 of file Chara.cs.

3633 {
3634 if (IsPCC)
3635 {
3636 if (base.dir == 0)
3637 {
3638 angle = 225f;
3639 }
3640 else if (base.dir == 1)
3641 {
3642 angle = 135f;
3643 }
3644 else if (base.dir == 2)
3645 {
3646 angle = 45f;
3647 }
3648 else if (base.dir == 3)
3649 {
3650 angle = -45f;
3651 }
3652 }
3653 else if (base.dir == 0)
3654 {
3655 angle = 165f;
3656 }
3657 else if (base.dir == 1)
3658 {
3659 angle = 300f;
3660 }
3661 else if (base.dir == 2)
3662 {
3663 angle = 0f;
3664 }
3665 else if (base.dir == 3)
3666 {
3667 angle = 120f;
3668 }
3669 }

Referenced by OnDeserialized().

◆ UpdateSight()

void Chara.UpdateSight ( )
inline

Definition at line 3693 of file Chara.cs.

3694 {
3695 int num = 4;
3696 for (int i = -num; i < num + 1; i++)
3697 {
3698 for (int j = -num; j < num + 1; j++)
3699 {
3700 shared.Set(pos.x + i, pos.z + j);
3701 if (shared.IsValid && !shared.cell.isSeen && i >= -1 && i <= 1 && j >= -1)
3702 {
3703 _ = 1;
3704 }
3705 }
3706 }
3707 }
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 5890 of file Chara.cs.

5891 {
5892 if (HasCooldown(a.id))
5893 {
5894 return false;
5895 }
5896 if (!a.ValidatePerform(this, tc, pos))
5897 {
5898 return false;
5899 }
5900 if (a.source.proc.TryGet(0) == "Heal" && HasElement(1422) && !IsPC)
5901 {
5902 List<int> list = new List<int> { 8400, 8401, 8402, 8403, 8404, 8405 };
5903 int num = list.IndexOf(a.id);
5904 if (num != -1)
5905 {
5906 int num2 = list.TryGet(num + Evalue(1422));
5907 a = elements.GetElement(num2)?.act ?? ACT.Create(num2);
5908 }
5909 }
5910 int num3 = 1;
5911 Act.Cost cost = a.GetCost(this);
5912 a.GetPower(this);
5913 int i = 1;
5914 int num4 = 0;
5915 bool flag = a.IsTargetHostileParty();
5916 bool flag2 = ability.Has(a.id);
5917 if (IsPC && HasCondition<StanceManaCost>())
5918 {
5919 num4 = Evalue(1657);
5920 }
5921 _pts.Clear();
5922 if (a.TargetType.ForceParty)
5923 {
5924 pt = true;
5925 }
5926 if (pt)
5927 {
5928 i = 0;
5929 if (flag)
5930 {
5931 ForeachEnemy(delegate
5932 {
5933 i++;
5934 });
5935 }
5936 else
5937 {
5938 ForeachParty(delegate
5939 {
5940 i++;
5941 });
5942 }
5943 }
5944 if (a is Spell && IsPC && a.vPotential < i && !flag2)
5945 {
5946 i = 1;
5947 _pts.Clear();
5948 _pts.Add(this);
5949 pt = false;
5950 }
5951 int num5 = 100;
5952 if (!a.TargetType.ForceParty && i > 1)
5953 {
5954 num5 = (IsPC ? (i * 100) : (50 + i * 50));
5955 }
5956 int num6 = cost.cost * num5 / 100;
5957 if (cost.type == Act.CostType.MP && Evalue(483) > 0)
5958 {
5959 num6 = num6 * 100 / (100 + (int)Mathf.Sqrt(Evalue(483) * 10) * 3);
5960 }
5961 if (i == 0)
5962 {
5963 if (IsPC)
5964 {
5966 }
5967 return false;
5968 }
5969 if (!IsPC && cost.type == Act.CostType.MP && mana.value < 0 && (EClass.rnd(4) != 0 || IsPCFaction || (base.IsPowerful && mana.value < -20)))
5970 {
5971 return false;
5972 }
5973 if (IsPC)
5974 {
5975 if (!Dialog.warned && cost.type == Act.CostType.MP && cost.cost > 0 && mana.value < num6 && !EClass.debug.godMode)
5976 {
5977 ActPlan.warning = true;
5978 Dialog.TryWarnMana(delegate
5979 {
5980 if (UseAbility(a, tc, pos, pt))
5981 {
5983 }
5984 });
5985 return false;
5986 }
5987 EClass.ui.CloseLayers();
5988 }
5989 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))
5990 {
5991 Say("shakeHead", this);
5992 return true;
5993 }
5994 if (tc != null && tc != this)
5995 {
5996 LookAt(tc.pos);
5997 }
5998 if (pos != null && !base.pos.Equals(pos))
5999 {
6000 LookAt(pos);
6001 }
6002 if (a.CanRapidFire && HasElement(1648))
6003 {
6004 num3 = 1 + Evalue(1648);
6005 }
6006 if (IsPC && cost.cost > 0 && a.Value == 0 && !flag2)
6007 {
6009 return false;
6010 }
6011 if (a is Spell)
6012 {
6013 string s = (isConfused ? "_cast_confuse" : (HasCondition<ConDim>() ? "_cast_dim" : ""));
6014 if (!a.source.tag.Contains("useHand"))
6015 {
6016 Say(race.castStyle.IsEmpty("cast"), this, a.source.GetName().ToLower(), s.lang());
6017 }
6018 if (IsPC)
6019 {
6020 _ = (i + 1) / 2;
6021 if (a.vPotential < i && !flag2)
6022 {
6023 Msg.Say("noSpellStock");
6024 EInput.Consume();
6025 return false;
6026 }
6027 if (num4 > 0 && (a.vPotential >= i * 2 || flag2))
6028 {
6029 if (!flag2)
6030 {
6031 a.vPotential -= i * 2;
6032 }
6033 num6 = num6 * (100 - num4 * 20) / 100;
6034 }
6035 else if (!flag2)
6036 {
6037 a.vPotential -= i;
6038 }
6040 }
6041 }
6042 else
6043 {
6044 if (IsPC && HasElement(1274) && a.vPotential < 0 && !flag2)
6045 {
6046 Msg.Say("noSpellStock");
6047 EInput.Consume();
6048 return false;
6049 }
6050 if (a.source.langAct.Length != 0 && tc != null)
6051 {
6052 string text = a.source.langAct[0];
6053 string text2 = ((a.source.langAct.Length >= 2) ? a.source.langAct[1] : "");
6054 if (text == "spell_hand")
6055 {
6056 string[] list2 = Lang.GetList("attack" + race.meleeStyle.IsEmpty("Touch"));
6057 string @ref = text2.lang(list2[4]);
6058 Say(tc.IsPCParty ? "cast_hand_ally" : "cast_hand", this, tc, @ref, tc.IsPCParty ? list2[1] : list2[2]);
6059 }
6060 else
6061 {
6062 Say(text, this, tc, text2.IsEmpty() ? "" : text2.lang());
6063 }
6064 if (a.source.id == 6630)
6065 {
6066 Talk("insult_" + (base.IsMale ? "m" : "f"));
6067 }
6068 }
6069 }
6070 switch (cost.type)
6071 {
6072 case Act.CostType.MP:
6073 if (Evalue(1421) >= 2 && base.hp <= MaxHP / Mathf.Max(1, 9 - Evalue(1421) * 2))
6074 {
6075 num6 /= 2;
6076 }
6077 if (isSynced)
6078 {
6079 PlayEffect("cast");
6080 }
6081 mana.Mod(-num6);
6082 if (isDead)
6083 {
6084 return true;
6085 }
6086 elements.ModExp(304, Mathf.Clamp(num6 * 2, 1, 200));
6087 break;
6088 case Act.CostType.SP:
6089 stamina.Mod(-num6);
6090 ignoreSPAbsorb = true;
6091 break;
6092 }
6093 if (a is Spell && GetCondition<ConSilence>() != null)
6094 {
6095 Say("cast_silence", this);
6096 return true;
6097 }
6098 if (isDead)
6099 {
6100 return true;
6101 }
6102 int spellExp = elements.GetSpellExp(this, a, num5);
6103 if (EClass.rnd(100) >= CalcCastingChance(a, i) && !EClass.debug.godMode)
6104 {
6105 Say("fizzle", this);
6106 PlayEffect("fizzle");
6107 PlaySound("fizzle");
6108 if (cost.cost > 0 && a.source.lvFactor > 0)
6109 {
6110 ModExp(a.id, spellExp / 5);
6111 }
6112 RemoveCondition<ConInvisibility>();
6113 return true;
6114 }
6115 bool flag3 = true;
6116 if (a.source.cooldown > 0 && (!IsPC || !a.source.tag.Contains("CD_npc")))
6117 {
6118 AddCooldown(a.id, a.source.cooldown);
6119 }
6120 if (HasTalk("phrase_" + a.source.alias))
6121 {
6122 EClass.player.forceTalk = true;
6123 Talk("phrase_" + a.source.alias);
6124 }
6125 if (pt)
6126 {
6127 Act.forcePt = true;
6128 if (flag)
6129 {
6130 ForeachEnemy(delegate(Chara c)
6131 {
6132 a.Perform(this, c, c.pos);
6133 });
6134 }
6135 else
6136 {
6137 ForeachParty(delegate(Chara c)
6138 {
6139 a.Perform(this, c, c.pos);
6140 });
6141 }
6142 Act.forcePt = false;
6143 }
6144 else
6145 {
6146 for (int j = 0; j < num3; j++)
6147 {
6148 if (a.TargetType != TargetType.SelfParty && tc != null && !tc.IsAliveInCurrentZone)
6149 {
6150 break;
6151 }
6152 ActEffect.RapidCount = j;
6153 ActEffect.RapidDelay = a.RapidDelay;
6154 flag3 = a.Perform(this, tc, pos);
6155 }
6156 }
6157 if (flag3 && !isDead)
6158 {
6159 if (IsPC && flag2 && elements.Base(a.id) == 0 && a.PotentialAsStock)
6160 {
6161 elements.ModBase(a.id, 1);
6162 }
6163 if (cost.cost > 0 && a.source.lvFactor > 0)
6164 {
6165 ModExp(a.id, spellExp);
6166 }
6167 if (a.source.alias.StartsWith("sword_"))
6168 {
6169 ModExp(101, 50);
6170 }
6171 }
6172 ActEffect.RapidCount = 0;
6173 if (flag3 && !a.source.tag.Contains("keepInvisi") && EClass.rnd(2) == 0)
6174 {
6175 RemoveCondition<ConInvisibility>();
6176 RemoveCondition<ConDark>();
6177 }
6178 if (!base.IsPCFactionOrMinion && a.HasTag("specialAbility"))
6179 {
6180 string name = a.Name;
6181 renderer.Say("| " + name + " ");
6182 }
6183 return flag3;
6184 void ForeachEnemy(Action<Chara> action)
6185 {
6186 if (_pts.Count == 0)
6187 {
6188 for (int num10 = EClass._map.charas.Count - 1; num10 >= 0; num10--)
6189 {
6190 Chara chara3 = EClass._map.charas[num10];
6191 if (chara3 != this && CanSeeLos(chara3) && chara3.IsHostile(this))
6192 {
6193 _pts.Add(chara3);
6194 }
6195 }
6196 }
6197 for (int num11 = _pts.Count - 1; num11 >= 0; num11--)
6198 {
6199 action(_pts[num11]);
6200 }
6201 }
6202 void ForeachParty(Action<Chara> action)
6203 {
6204 if (_pts.Count == 0)
6205 {
6206 if (IsPCParty)
6207 {
6208 for (int num7 = EClass.pc.party.members.Count - 1; num7 >= 0; num7--)
6209 {
6210 Chara chara = EClass.pc.party.members[num7];
6211 if (chara == this || chara.host != null || CanSeeLos(chara))
6212 {
6213 _pts.Add(chara);
6214 }
6215 }
6216 }
6217 else
6218 {
6219 for (int num8 = EClass._map.charas.Count - 1; num8 >= 0; num8--)
6220 {
6221 Chara chara2 = EClass._map.charas[num8];
6222 if ((chara2 == this || (chara2.IsFriendOrAbove(this) && CanSeeLos(chara2))) && (chara2 == tc || _pts.Count < 3 || EClass.rnd(_pts.Count * _pts.Count) > 6))
6223 {
6224 _pts.Add(chara2);
6225 }
6226 }
6227 }
6228 }
6229 for (int num9 = _pts.Count - 1; num9 >= 0; num9--)
6230 {
6231 action(_pts[num9]);
6232 }
6233 }
6234 }
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
virtual bool ValidatePerform(Chara _cc, Card _tc, Point _tp)
Definition: ACT.cs:316
bool IsTargetHostileParty()
Definition: ACT.cs:241
virtual bool CanRapidFire
Definition: ACT.cs:175
bool HasTalk(string idTopic)
Definition: Card.cs:6898
bool Has(int id)
static List< Chara > _pts
Definition: Chara.cs:188
int CalcCastingChance(Element e, int num=1)
Definition: Chara.cs:6245
Definition: Dialog.cs:7
static bool warned
Definition: Dialog.cs:49
static void TryWarnMana(Action action)
Definition: Dialog.cs:389
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
virtual bool PotentialAsStock
Definition: ELEMENT.cs:341
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, Element.PotentialAsStock, Act.RapidDelay, EClass.rnd(), Msg.Say(), Msg.SayNothingHappen(), TargetType.SelfParty, LayerAbility.SetDirty(), Element.source, Act.TargetType, Dialog.TryWarnMana(), Act.Cost.type, EClass.ui, Act.ValidatePerform(), 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 5885 of file Chara.cs.

5886 {
5887 return UseAbility(elements.GetElement(idAct)?.act ?? ACT.Create(idAct), tc, pos, pt);
5888 }

References ACT.Create().

◆ ValidateWorks()

void Chara.ValidateWorks ( )
inline

Definition at line 9391 of file Chara.cs.

9392 {
9393 _goalWork.FindWork(this, setAI: false);
9395 }
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 5356 of file Chara.cs.

5357 {
5358 base.c_vomit++;
5359 Say("vomit", this);
5360 PlaySound("vomit");
5361 if (!EClass._zone.IsRegion)
5362 {
5363 Thing thing = ThingGen.Create("731");
5365 {
5366 thing.MakeRefFrom(this);
5367 }
5368 EClass._zone.AddCard(thing, pos);
5369 }
5370 if (HasCondition<ConAnorexia>())
5371 {
5372 ModExp(70, -50);
5373 ModExp(71, -75);
5374 ModExp(77, -100);
5375 }
5376 else if (base.c_vomit > 10)
5377 {
5378 AddCondition<ConAnorexia>();
5379 }
5380 AddCondition<ConDim>();
5381 if (HasCondition<ConAnorexia>())
5382 {
5383 ModWeight(-1 * (1 + EClass.rnd(5)));
5384 }
5385 if (hunger.GetPhase() >= 4)
5386 {
5387 DamageHP(9999L, AttackSource.Hunger);
5388 }
5389 hunger.Mod(30);
5390 }
void ModWeight(int a, bool ignoreLimit=false)
Definition: Chara.cs:9972

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 3709 of file Chara.cs.

3710 {
3711 for (int num = conditions.Count - 1; num >= 0; num--)
3712 {
3713 if (conditions[num].ConsumeTurn)
3714 {
3715 return true;
3716 }
3717 }
3718 return false;
3719 }

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 7417 of file Chara.cs.

7418 {
7419 n.Clear();
7420 UIItem uIItem = n.AddHeaderCard(base.Name.ToTitleCase());
7421 SetImage(uIItem.image2);
7422 uIItem.text2.SetText(race.GetText().ToTitleCase(wholeText: true) + " " + job.GetText().ToTitleCase(wholeText: true));
7423 n.AddText("");
7424 n.Build();
7425 }
void SetImage(Image image, int dir, int idSkin=0)
Definition: Card.cs:6284
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:163

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

◆ 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 1136 of file Chara.cs.

1137 {
1138 get
1139 {
1140 if (_baseWorkElements == null)
1141 {
1143 foreach (Hobby item in ListHobbies())
1144 {
1145 Build(item);
1146 }
1147 foreach (Hobby item2 in ListWorks())
1148 {
1149 Build(item2);
1150 }
1151 }
1152 return _baseWorkElements;
1153 void Build(Hobby h)
1154 {
1155 if (!h.source.elements.IsEmpty())
1156 {
1157 for (int i = 0; i < h.source.elements.Length; i += 2)
1158 {
1159 int ele = h.source.elements[i];
1160 int v = h.source.elements[i + 1];
1161 _baseWorkElements.ModBase(ele, v);
1162 }
1163 }
1164 }
1165 }
1166 }
ElementContainer _baseWorkElements
Definition: Chara.cs:206

◆ bladder

Stats Chara.bladder
get

Definition at line 1176 of file Chara.cs.

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

◆ burden

◆ CanGainConResist

bool Chara.CanGainConResist
get

Definition at line 1186 of file Chara.cs.

1187 {
1188 get
1189 {
1190 if (base.rarity >= Rarity.Legendary)
1191 {
1192 return !IsPCFaction;
1193 }
1194 return false;
1195 }
1196 }

◆ CanOpenDoor

bool Chara.CanOpenDoor
get

Definition at line 832 of file Chara.cs.

833 {
834 get
835 {
836 if (base.INT < 5)
837 {
838 if (IsPCFaction)
839 {
840 return memberType == FactionMemberType.Default;
841 }
842 return false;
843 }
844 return true;
845 }
846 }

◆ CanWitness

bool Chara.CanWitness
get

Definition at line 1016 of file Chara.cs.

1017 {
1018 get
1019 {
1020 if (!IsHuman && !IsFairy && !IsGod)
1021 {
1022 return race.id == "mutant";
1023 }
1024 return true;
1025 }
1026 }
bool IsFairy
Definition: Chara.cs:953
bool IsGod
Definition: Chara.cs:965

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 1096 of file Chara.cs.

1097 {
1098 get
1099 {
1100 if (base.c_genes != null)
1101 {
1102 return base.c_genes.GetGeneSlot(this);
1103 }
1104 return 0;
1105 }
1106 }

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

◆ CurrentSpan

TimeTable.Span Chara.CurrentSpan
get

Definition at line 850 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(), CharaMassTransfer.Add(), 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(), ZoneEventWedding.OnVisit(), 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 1174 of file Chara.cs.

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

◆ DestDist

int Chara.DestDist
get

Definition at line 1012 of file Chara.cs.

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

◆ DV

override int Chara.DV
get

Definition at line 742 of file Chara.cs.

743 {
744 get
745 {
746 if (IsPCFaction)
747 {
748 return WeaknessMod(elements.Value(64));
749 }
750 int num = base.LV;
751 if (num > 50)
752 {
753 num = 50 + (num - 50) / 10;
754 }
755 return WeaknessMod(num + elements.Value(64) * (100 + num + race.DV * 5) / 100);
756 int WeaknessMod(int a)
757 {
758 if (HasCondition<ConWeakness>())
759 {
760 if (a <= 0)
761 {
762 return a * 2;
763 }
764 return a / 2;
765 }
766 return a;
767 }
768 }
769 }

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 1084 of file Chara.cs.

1085 {
1086 get
1087 {
1088 if (!IsPC)
1089 {
1090 return 100;
1091 }
1092 return 5;
1093 }
1094 }

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 702 of file Chara.cs.

Referenced by ActEffect.Proc().

◆ HasNoGoal

◆ homeBranch

◆ homeZone

◆ hostility

◆ hunger

◆ hygiene

Stats Chara.hygiene
get

Definition at line 1178 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(), Kiss(), OnCreate(), AI_PlayMusic.Run(), DramaActor.Talk(), and TraitToolBrush.TrySetHeldAct().

◆ IsAdventurer

bool Chara.IsAdventurer
get

Definition at line 1054 of file Chara.cs.

1055 {
1056 get
1057 {
1058 if (global != null && faction != EClass.pc.faction)
1059 {
1060 return IsPCC;
1061 }
1062 return false;
1063 }
1064 }

◆ 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 880 of file Chara.cs.

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

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

◆ IsCat

bool Chara.IsCat
get

Definition at line 1000 of file Chara.cs.

1001 {
1002 get
1003 {
1004 if (!(race.id == "cat") && !(race.id == "catsister"))
1005 {
1006 return race.id == "catgod";
1007 }
1008 return true;
1009 }
1010 }

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

◆ isChara

override bool Chara.isChara
get

Definition at line 700 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 976 of file Chara.cs.

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

◆ IsEyth

bool Chara.IsEyth
get

Definition at line 1066 of file Chara.cs.

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

◆ IsFairy

bool Chara.IsFairy
get

Definition at line 952 of file Chara.cs.

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

Referenced by Faction.IsWearingPanty().

◆ IsFish

bool Chara.IsFish
get

Definition at line 940 of file Chara.cs.

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

◆ IsGlobal

◆ IsGod

bool Chara.IsGod
get

Definition at line 964 of file Chara.cs.

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

◆ IsHorror

bool Chara.IsHorror
get

Definition at line 928 of file Chara.cs.

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

Referenced by Refresh().

◆ IsHuman

bool Chara.IsHuman
get

Definition at line 892 of file Chara.cs.

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

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 1028 of file Chara.cs.

1029 {
1030 get
1031 {
1032 if (!IsHuman && !race.tag.Contains("humanSpeak"))
1033 {
1034 return HasTag(CTAG.humanSpeak);
1035 }
1036 return true;
1037 }
1038 }

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

◆ IsIdle

bool Chara.IsIdle
get

Definition at line 866 of file Chara.cs.

867 {
868 get
869 {
870 if (!IsDeadOrSleeping)
871 {
872 return ai.Current.IsIdle;
873 }
874 return false;
875 }
876 }
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 854 of file Chara.cs.

855 {
856 get
857 {
858 if (!IsGlobal && !base.isSubsetCard)
859 {
860 return homeZone == EClass._zone;
861 }
862 return false;
863 }
864 }

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

◆ IsMachine

bool Chara.IsMachine
get

Definition at line 916 of file Chara.cs.

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

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

◆ IsMaid

bool Chara.IsMaid
get

Definition at line 1040 of file Chara.cs.

1041 {
1042 get
1043 {
1044 if (EClass.Branch != null)
1045 {
1046 return EClass.Branch.uidMaid == base.uid;
1047 }
1048 return false;
1049 }
1050 }

Referenced by FactionBranch.GetMaid().

◆ IsMarried

bool Chara.IsMarried
get

Definition at line 610 of file Chara.cs.

611 {
612 get
613 {
614 if (base.c_love != null)
615 {
616 return base.c_love.dateMarriage != 0;
617 }
618 return false;
619 }
620 }

Referenced by DramaOutcome.marry(), WindowChara.RefreshNote(), AI_Idle.Run(), and TraitDeedDivorce.TrySetHeldAct().

◆ IsMinion

override bool Chara.IsMinion
get

Definition at line 640 of file Chara.cs.

641 {
642 get
643 {
644 if (master == null)
645 {
646 return base.c_uidMaster != 0;
647 }
648 return true;
649 }
650 }

Referenced by ActPlan._Update(), ConStrife.AddKill(), BanishAllMinions(), 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 1124 of file Chara.cs.

1125 {
1126 get
1127 {
1128 if (!race.tag.Contains("mofu"))
1129 {
1130 return HasElement(419);
1131 }
1132 return true;
1133 }
1134 }

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

◆ IsMoving

override bool Chara.IsMoving
get

Definition at line 622 of file Chara.cs.

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

◆ IsMultisize

◆ IsPC

override bool Chara.IsPC
get

Definition at line 626 of file Chara.cs.

Referenced by _Move(), TraitShrine._OnUse(), ActPlan._Update(), Element._WriteNote(), TraitSwitch.ActivateTrap(), CharaAbility.Add(), 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(), CharaAbility.Remove(), 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 684 of file Chara.cs.

685 {
686 get
687 {
688 if (EClass.pc != null)
689 {
690 return faction == EClass.pc.faction;
691 }
692 return false;
693 }
694 }

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(), ZoneEventWedding.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(), 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 668 of file Chara.cs.

669 {
670 get
671 {
672 if (master != null)
673 {
674 if (!master.IsPCFaction)
675 {
677 }
678 return true;
679 }
680 return false;
681 }
682 }

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 628 of file Chara.cs.

629 {
630 get
631 {
632 if (party != null)
633 {
634 return party.leader == EClass.pc;
635 }
636 return false;
637 }
638 }

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 652 of file Chara.cs.

653 {
654 get
655 {
656 if (master != null)
657 {
658 if (!master.IsPCParty)
659 {
660 return master.IsPCPartyMinion;
661 }
662 return true;
663 }
664 return false;
665 }
666 }

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

◆ IsPlant

bool Chara.IsPlant
get

Definition at line 988 of file Chara.cs.

989 {
990 get
991 {
992 if (!race.IsPlant)
993 {
994 return HasTag(CTAG.plant);
995 }
996 return true;
997 }
998 }

Referenced by GoalCombat.Run().

◆ IsPrisoner

bool Chara.IsPrisoner
get

Definition at line 1052 of file Chara.cs.

◆ isSynced

override bool Chara.isSynced
get

◆ isThing

override bool Chara.isThing
get

Definition at line 698 of file Chara.cs.

◆ IsUndead

bool Chara.IsUndead
get

Definition at line 904 of file Chara.cs.

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

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

◆ IsWealthy

bool Chara.IsWealthy
get

Definition at line 1068 of file Chara.cs.

1069 {
1070 get
1071 {
1072 if (!source.works.Contains("Rich"))
1073 {
1074 return source.hobbies.Contains("Rich");
1075 }
1076 return true;
1077 }
1078 }

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 730 of file Chara.cs.

731 {
732 get
733 {
734 if (base.c_idMainElement == 0)
735 {
736 return Element.Void;
737 }
738 return elements.GetElement(base.c_idMainElement);
739 }
740 }

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

◆ NameTitled

string Chara.NameTitled
get

Definition at line 518 of file Chara.cs.

Referenced by Scene.OnUpdate(), and 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 800 of file Chara.cs.

801 {
802 get
803 {
804 if (spriteReplacer != null)
805 {
807 }
808 if (base.idSkin > 0)
809 {
810 switch (sourceCard.tiles.TryGet(base.idSkin))
811 {
812 case 2319:
813 case 2619:
814 case 2621:
815 case 2623:
816 case 2625:
818 case 2320:
819 case 2611:
820 case 2620:
821 case 2622:
822 case 2624:
823 case 2626:
824 case 2828:
826 }
827 }
828 return sourceCard.pref;
829 }
830 }
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 771 of file Chara.cs.

772 {
773 get
774 {
775 if (IsPCFaction)
776 {
777 return WeaknessMod(elements.Value(65));
778 }
779 int num = base.LV;
780 if (num > 50)
781 {
782 num = 50 + (num - 50) / 10;
783 }
784 return WeaknessMod(num + elements.Value(65) * (100 + num + race.PV * 5) / 100);
785 int WeaknessMod(int a)
786 {
787 if (HasCondition<ConWeakness>())
788 {
789 if (a <= 0)
790 {
791 return a * 2;
792 }
793 return a / 2;
794 }
795 return a;
796 }
797 }
798 }

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

◆ race

◆ SAN

◆ SelfWeight

override int Chara.SelfWeight
get

Definition at line 726 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 1108 of file Chara.cs.

1109 {
1110 get
1111 {
1112 if (dirtySpeed)
1113 {
1114 RefreshSpeed();
1115 }
1116 if (_Speed > 100000000)
1117 {
1118 return 100000000;
1119 }
1120 return (int)_Speed;
1121 }
1122 }

Referenced by GameUpdater.ConditionUpdater.FixedUpdate().

◆ stamina

◆ tactics

Tactics Chara.tactics
get

Definition at line 848 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: