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

Public Member Functions

override string ToString ()
 
bool IsCriticallyWounded (bool includeRide=false)
 
bool HasHigherGround (Card c)
 
bool CanSeeSimple (Point p)
 
bool CanSee (Card c)
 
bool CanSeeLos (Card c, int dist=-1)
 
bool CanSeeLos (Point p, int dist=-1)
 
bool HasAccess (Card c)
 
bool HasAccess (Point p)
 
bool CanSleep ()
 
override string GetName (NameStyle style, int num=-1)
 
override void ChangeRarity (Rarity r)
 
Chara SetFaction (Faction f)
 
Chara SetHomeZone (Zone zone)
 
Chara SetHostility (Hostility h)
 
void OnBanish ()
 
Chara SetGlobal (Zone _home, int x, int z)
 
Chara SetGlobal ()
 
void RemoveGlobal ()
 
override void OnBeforeCreate ()
 
override void OnCreate (int genLv)
 
Chara ScaleByPrincipal ()
 
void SetFaith (string id)
 
void SetFaith (Religion r)
 
void HealAll ()
 
void Refresh (bool calledRecursive=false)
 
bool CanDuplicate ()
 
Chara Duplicate ()
 
int GetBurden (Card t=null, int num=-1)
 
void CalcBurden ()
 
void Stumble (int mtp=100)
 
void SetDirtySpeed ()
 
void RefreshSpeed (Element.BonusInfo info=null)
 
void CalculateMaxStamina ()
 
override void ApplyEditorTags (EditorTag tag)
 
override void SetSource ()
 
void SetMainElement (string id, int v=0, bool elemental=false)
 
void SetMainElement (int id, int v=0, bool elemental=false)
 
void ApplyJob (bool remove=false)
 
void ChangeJob (string idNew)
 
void AddRandomBodyPart (bool msg=false)
 
void RemoveLastBodyPart (bool msg=false)
 
void ResetBody ()
 
void ApplyRace (bool remove=false)
 
void ChangeRace (string idNew)
 
void MakePartyMemeber ()
 
void MakeAlly (bool msg=true)
 
void _MakeAlly ()
 
bool CanBeTempAlly (Chara c)
 
void Banish (Chara owner)
 
void MakeMinion (Chara _master, MinionType type=MinionType.Default)
 
bool HasMinion (string id)
 
void ReleaseMinion ()
 
void SetSummon (int duration)
 
Chara FindMaster ()
 
bool IsEscorted ()
 
bool CanDestroyPath ()
 
bool CanMoveTo (Point p, bool allowDestroyPath=true)
 
bool IsEnemyOnPath (Point p, bool cancelAI=true)
 
bool CanInteractTo (Card c)
 
bool CanInteractTo (Point p)
 
Point GetFirstStep (Point newPoint, PathManager.MoveType moveType=PathManager.MoveType.Default)
 
bool MoveRandom ()
 
bool MoveNeighborDefinitely ()
 
void MoveByForce (Point newPoint, Card c=null, bool checkWall=false)
 
MoveResult TryMoveTowards (Point p)
 
MoveResult TryMoveFrom (Point p)
 
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 ()
 
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 ()
 
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)
 
bool UseAbility (int idAct, Card tc=null, Point pos=null, bool pt=false)
 
bool UseAbility (string idAct, Card tc=null, Point pos=null, bool pt=false)
 
bool UseAbility (Act a, Card tc=null, Point pos=null, bool pt=false)
 
int EvalueRiding ()
 
int CalcCastingChance (Element e, int num=1)
 
void DoAI (int wait, Action onPerform)
 
void Cuddle (Chara c, bool headpat=false)
 
Chara SetEnemy (Chara c=null)
 
void TrySetEnemy (Chara c)
 
void DoHostileAction (Card _tg, bool immediate=false)
 
void CallHelp (Chara tg, bool fanatic=false)
 
bool FindNewEnemy ()
 
bool FindNearestNewEnemy ()
 
bool IsHostile ()
 
bool IsHostile (Chara c)
 
bool IsNeutral ()
 
bool IsNeutralOrAbove ()
 
bool IsBranchMember ()
 
bool IsHomeMember ()
 
bool IsInHomeZone ()
 
bool IsInSpot< T > ()
 
bool IsGuest ()
 
bool IsFriendOrAbove ()
 
bool IsFriendOrAbove (Chara c)
 
override CardRenderer _CreateRenderer ()
 
void SetPCCState (PCCState state)
 
override Sprite GetSprite (int dir=0)
 
void SetTempHand (int right=0, int left=0)
 
override SubPassData GetSubPassData ()
 
override void SetRenderParam (RenderParam p)
 
override string GetHoverText ()
 
override string GetHoverText2 ()
 
string GetTopicText (string topic="calm")
 
string TalkTopic (string topic="calm")
 
override Sprite GetImageSprite ()
 
void ChangeMemberType (FactionMemberType type)
 
void ShowDialog ()
 
LayerDrama ShowDialog (string book, string step="main", string tag="")
 
Point GetDestination ()
 
int GetHireCost ()
 
int GetHappiness ()
 
string GetTextHappiness ()
 
string GetActionText ()
 
override void WriteNote (UINote n, Action< UINote > onWriteNote=null, IInspect.NoteMode mode=IInspect.NoteMode.Default, Recipe recipe=null)
 
override void SetSortVal (UIList.SortMode m, CurrencyType currency=CurrencyType.Money)
 
void ClearBed (Map map=null)
 
TraitBed FindBed ()
 
TraitBed TryAssignBed ()
 
void TryPutSharedItems (IEnumerable< Thing > containers, bool msg=true)
 
void TryPutSharedItems (bool msg=true)
 
void TryTakeSharedItems (bool msg=true)
 
void TryTakeSharedItems (IEnumerable< Thing > containers, bool msg=true, bool shouldEat=true)
 
Thing FindBestFoodToEat ()
 
void InstantEat (Thing t=null, bool sound=true)
 
bool CanEat (Thing t, bool shouldEat=false)
 
bool ShouldEquip (Thing t, bool useFav=false)
 
bool TryEquip (Thing t, bool useFav=false)
 
bool CanEquipRanged (Thing t)
 
Thing TryGetThrowable ()
 
Thing FindAmmo (Thing weapon)
 
Thing GetBestRangedWeapon ()
 
bool TryEquipRanged ()
 
override int GetArmorSkill ()
 
bool TryUse (Thing t)
 
Room FindRoom ()
 
void ModAffinity (Chara c, int a, bool show=true, bool showOnlyEmo=false)
 
bool TryIdentify (Thing t, int count=1, bool show=true)
 
Chara CreateReplacement ()
 
SourceThing.Row GetFavFood ()
 
SourceCategory.Row GetFavCat ()
 
Chara GetNearbyCatToSniff ()
 
void Sniff (Chara c)
 
int GetTotalFeat ()
 
bool CanInsult ()
 
string GetIdPortraitCat ()
 
string GetIdPortrait ()
 
Thing MakeGene (DNA.Type? type=null)
 
Thing MakeBraineCell ()
 
void OnInsulted ()
 
bool IsValidGiftWeight (Card t, int num=-1)
 
bool CanAcceptItem (Card t, int num=-1)
 
bool 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)
 
GetCondition< T > ()
 
void RemoveCondition< T > ()
 
void CureHost (CureType type, int p=100, BlessedState state=BlessedState.Normal)
 
void Cure (CureType type, int p=100, BlessedState state=BlessedState.Normal)
 
void RemoveAllStances ()
 
bool TryNeckHunt (Chara TC, int power, bool harvest=false)
 
void AddResistCon (Condition con)
 
void ResistCon (Condition con)
 
void Sleep (Thing bed=null, Thing pillow=null, bool pickup=false, ItemPosition posBed=null, ItemPosition posPillow=null)
 
void OnSleep (Thing bed=null, int days=1)
 
void OnSleep (int power, int days=1, bool isSunLit=false)
 
void ModHeight (int a)
 
void ModWeight (int a, bool ignoreLimit=false)
 
void ModCorruption (int a)
 
List< ElementListAvailabeFeats (bool pet=false, bool showAll=false)
 
void SetFeat (int id, int value=1, bool msg=false)
 
void SetMutation (int idEle, int a=0)
 
bool MutateRandom (int vec=0, int tries=100, bool ether=false, BlessedState state=BlessedState.Normal)
 
void GainAbility (int ele, int mtp=100, Thing origin=null)
 
bool TryNullifyCurse ()
 
void OnAdvanceDay ()
 
void AddFoodHistory (Thing food)
 
int CountNumEaten (Thing food)
 
int GetPietyValue ()
 
void RefreshFaithElement ()
 
void ModTempElement (int ele, int a, bool naturalDecay=false, bool onlyRenew=false)
 
void DamageTempElements (int p, bool body, bool mind, bool onlyRenew=false)
 
void DamageTempElement (int ele, int p, bool onlyRenew=false)
 
void EnhanceTempElements (int p, bool body, bool mind, bool onlyRenew=false)
 
void EnhanceTempElement (int ele, int p, bool onlyRenew=false)
 
void DiminishTempElements (int a=1)
 
void CureTempElements (int p, bool body, bool mind)
 
void ClearTempElements ()
 
- Public Member Functions inherited from Card
override string ToString ()
 
bool CanReserve (AIAct act)
 
bool TryReserve (AIAct act)
 
void Mod ()
 
Window.SaveData GetWindowSaveData ()
 
bool IsExcludeFromCraft (Recipe.Ingredient ing)
 
void SetDirtyWeight ()
 
void ChangeWeight (int a)
 
int Evalue (int ele)
 
int Evalue (int ele, bool ignoreGlobalElement)
 
int EvalueMax (int ele, int min=0)
 
int Evalue (string alias)
 
bool HasTag (CTAG tag)
 
bool HasEditorTag (EditorTag tag)
 
void AddEditorTag (EditorTag tag)
 
void RemoveEditorTag (EditorTag tag)
 
virtual string GetName (NameStyle style, int num=-1)
 
virtual string GetExtraName ()
 
virtual string GetDetail ()
 
int GetBestAttribute ()
 
void ModExp (string alias, int a)
 
void ModExp (int ele, int a)
 
bool IsChildOf (Card c)
 
FindTool< T > ()
 
string ReferenceId ()
 
void Create (string _id, int _idMat=-1, int genLv=-1)
 
virtual void OnBeforeCreate ()
 
virtual void OnCreate (int genLv)
 
virtual void SetSource ()
 
virtual void ApplyEditorTags (EditorTag tag)
 
void ApplyTrait ()
 
Card SetLv (int a)
 
void ClampInitialSkill ()
 
void AddExp (int a, bool applyMod=true)
 
int GetExpMtp ()
 
int GetAffinityExpBonus ()
 
int GetDaysTogetherBonus ()
 
void LevelUp ()
 
virtual void ApplyMaterialElements (bool remove)
 
virtual void ApplyMaterial (bool remove=false)
 
Card ChangeMaterial (int idNew, bool ignoreFixedMaterial=false)
 
Card ChangeMaterial (string idNew, bool ignoreFixedMaterial=false)
 
Card ChangeMaterial (SourceMaterial.Row row, bool ignoreFixedMaterial=false)
 
void SetReplica (bool on)
 
Thing Add (string id, int num=1, int lv=1)
 
Card AddCard (Card c)
 
void RemoveCard (Card c)
 
void NotifyAddThing (Thing t, int num)
 
Thing AddThing (string id, int lv=-1)
 
Thing AddThing (Thing t, bool tryStack=true, int destInvX=-1, int destInvY=-1)
 
void PurgeDuplicateArtifact (Thing af)
 
void PurgeEythArtifact ()
 
void RemoveThings ()
 
void RemoveThing (Thing thing)
 
bool ShouldTrySetDirtyInventory ()
 
virtual bool CanStackTo (Thing to)
 
bool TryStackTo (Thing to)
 
ICardParent GetRoot ()
 
Card GetRootCard ()
 
bool IsStackable (Thing tg)
 
Thing Duplicate (int num)
 
Thing Split (int a)
 
Thing SetNum (int a)
 
Thing SetNoSell ()
 
void ModNum (int a, bool notify=true)
 
void AddSocket ()
 
void ApplySocket (Thing t)
 
void ApplySocket (int id, int lv, Card mod=null)
 
void EjectSockets ()
 
SocketData AddRune (Card rune)
 
SocketData AddRune (int idEle, int v, bool free)
 
SocketData GetRuneEnc (int idEle)
 
int CountRune (bool countFree=true)
 
int MaxRune ()
 
bool CanAddRune (TraitMod mod)
 
bool HasRune ()
 
void OnChildNumChange (Card c)
 
Card Install ()
 
void SetPlaceState (PlaceState newState, bool byPlayer=false)
 
int GetTotalQuality (bool applyBonus=true)
 
void ModEncLv (int a)
 
void SetEncLv (int a)
 
void SetTier (int a, bool setTraits=true)
 
virtual void SetBlessedState (BlessedState s)
 
virtual void ChangeRarity (Rarity q)
 
bool TryPay (int a, string id="money")
 
void SetCharge (int a)
 
void ModCharge (int a, bool destroy=false)
 
void ModCurrency (int a, string id="money")
 
int GetCurrency (string id="money")
 
virtual void HealHPHost (int a, HealSource origin=HealSource.None)
 
virtual void HealHP (int a, HealSource origin=HealSource.None)
 
virtual int GetArmorSkill ()
 
virtual long ApplyProtection (long dmg, int mod=100)
 
void DamageHP (long dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
 
void DamageHP (long dmg, int ele, int eleP=100, AttackSource attackSource=AttackSource.None, Card origin=null, bool showEffect=true, Thing weapon=null, Chara originalTarget=null)
 
void ApplyElementEffect (Element e, int eleP, Card origin, bool checkHostileAct=false)
 
virtual void Die (Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None, Chara originalTarget=null)
 
void Explode (Point p, Card origin)
 
void Deconstruct ()
 
void Destroy ()
 
void SpawnLoot (Card origin)
 
Thing TryMakeRandomItem (int lv=-1, TryMakeRandomItemSource itemSource=TryMakeRandomItemSource.Default, Chara crafter=null)
 
Card MakeFoodFrom (string _id)
 
Card MakeFoodFrom (Card c)
 
void MakeFoodRef (Card c1, Card c2=null)
 
string TryGetFoodName (Card c)
 
string GetFoodName (string s)
 
void MakeFigureFrom (string id)
 
Card MakeRefFrom (string id)
 
void MakeRefFrom (Card c1, Card c2=null)
 
Thing MakeEgg (bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
 
Thing MakeMilk (bool effect=true, int num=1, bool addToZone=true, BlessedState? state=null)
 
Thing GiveBirth (Thing t, bool effect)
 
void HatchEgg ()
 
Card SetHidden (bool hide=true)
 
virtual MoveResult _Move (Point p, MoveType type=MoveType.Walk)
 
void MoveImmediate (Point p, bool focus=true, bool cancelAI=true)
 
void Teleport (Point point, bool silent=false, bool force=false)
 
virtual void OnLand ()
 
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 ApplyNewLine (string text)
 
void SayRaw (string text, string ref1=null, string ref2=null)
 
void SayNothingHappans ()
 
void Say (string lang, string ref1=null, string ref2=null)
 
void Say (string lang, Card c1, Card c2, string ref1=null, string ref2=null)
 
void Say (string lang, Card c1, string ref1=null, string ref2=null)
 
string GetTalkText (string idTopic, bool stripPun=false, bool useDefault=true)
 
string ApplyTone (string text, bool stripPun=false)
 
void SetRandomTalk ()
 
void SetRandomTone ()
 
bool HasCraftBonusTrait ()
 
List< ElementListCraftBonusTraits ()
 
void TryStack (Thing t)
 
void ApplyBacker (int bid)
 
void RemoveBacker ()
 
void SetPaintData ()
 
byte[] GetPaintData ()
 
void ClearPaintSprite ()
 
Sprite GetPaintSprite ()
 
void TryUnrestrain (bool force=false, Chara c=null)
 
TraitShackle GetRestrainer ()
 
virtual void Tick ()
 
Thing SetPriceFix (int a)
 
int GetEquipValue ()
 
void SetSale (bool sale)
 
int GetValue (PriceType priceType=PriceType.Default, bool sell=false)
 
virtual int GetPrice (CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
 
virtual string GetHoverText ()
 
virtual string GetHoverText2 ()
 
int Dist (Card c)
 
int Dist (Point p)
 
bool IsInMutterDistance (int d=10)
 
void SetCensored (bool enable)
 
void SetDeconstruct (bool deconstruct)
 
virtual bool MatchEncSearch (string s)
 
virtual void SetSortVal (UIList.SortMode m, CurrencyType currency=CurrencyType.Money)
 
virtual int SecondaryCompare (UIList.SortMode m, Card c)
 
void ForeachFOV (Func< Point, bool > func)
 
void ForeachPoint (Action< Point, bool > action)
 
void OnInspect ()
 
virtual void WriteNote (UINote n, Action< UINote > onWriteNote=null, IInspect.NoteMode mode=IInspect.NoteMode.Default, Recipe recipe=null)
 
void Inspect ()
 
virtual bool HasCondition< T > ()
 
bool HaveFur ()
 
bool CanBeSheared ()
 
- Public Member Functions inherited from BaseCard
bool GetBool (int id)
 
void SetBool (int id, bool enable)
 
int GetInt (int id, int? defaultInt=null)
 
void AddInt (int id, int value)
 
void SetInt (int id, int value=0)
 
string GetStr (int id, string defaultStr=null)
 
void SetStr (int id, string value=null)
 
GetObj< T > (int id)
 
void SetObj (int id, object o)
 
SetObj< T > (int id, object o)
 
ICardParent GetRoot ()
 
void RemoveCard (Card c)
 
void OnChildNumChange (Card c)
 
string ReferenceId ()
 
void WriteNote (UINote n, Action< UINote > onWriteNote=null, NoteMode mode=NoteMode.Default, Recipe recipe=null)
 
void OnInspect ()
 

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
 
Emo2 emoIcon
 
int happiness
 
int turnLastSeen = -100
 
int idleActTimer
 
int combatCount
 
int calmCheckTurn
 
int sharedCheckTurn
 
float idleTimer
 
bool isBerserk
 
bool isDrunk
 
bool isConfused
 
bool isFainted
 
bool isBlind
 
bool isParalyzed
 
bool _isLevitating
 
bool isCreated
 
bool canSeeInvisible
 
bool hasTelepathy
 
bool isWet
 
bool bossText
 
bool ignoreSPAbsorb
 
bool wasInWater
 
bool visibleWithTelepathy
 
bool isWeakToSunlight
 
SpriteReplacer spriteReplacer
 
SourceChara.Row source
 
SourceRace.Row _race
 
SourceJob.Row _job
 
Tactics _tactics
 
bool dirtySpeed = true
 
float actTime = 0.3f
 
int stealthSeen
 
GoalList goalList = new GoalList()
 
AIAct ai = new NoGoal()
 
ElementContainer _baseWorkElements
 
List< Conditionconditions = new List<Condition>()
 
Dictionary< int, int > resistCon
 
- Public Attributes inherited from Card
int[] _ints = new int[30]
 
string id = ""
 
ThingContainer things = new ThingContainer()
 
ElementContainerCard elements = new ElementContainerCard()
 
Biography bio
 
List< int > sockets
 
AIAct reservedAct
 
Props props
 
Trait trait
 
ICardParent parent
 
Fov fov
 
Point pos = new Point()
 
CardRenderer renderer
 
CardRow hat
 
int turn
 
int _colorInt
 
float roundTimer
 
float angle = 180f
 
float animeCounter
 
bool isDestroyed
 
CardBlueprint bp
 
BitArray32 _bits1
 
BitArray32 _bits2
 
PlaceState placeState
 
bool dirtyWeight = true
 
SourceMaterial.Row _material
 
Emo lastEmo
 
int sortVal
 
- Public Attributes inherited from BaseCard
Dictionary< int, object > mapObj = new Dictionary<int, object>()
 
Dictionary< int, int > mapInt = new Dictionary<int, int>()
 
Dictionary< int, string > mapStr = new Dictionary<int, string>()
 

Static Public Attributes

static string[] IDTimeTable = new string[2] { "default", "owl" }
 
static List< SourceRace.RowListAdvRace = new List<SourceRace.Row>()
 
static List< SourceJob.RowListAdvJob = new List<SourceJob.Row>()
 
static bool consumeTurn
 
static bool preventRegen
 
static bool isOnCreate
 
static NoGoal _NoGoalPC = new NoGoal()
 
static NoGoal _NoGoalRepeat = new NoGoal()
 
- Static Public Attributes inherited from Card
const int MaxWeight = 10000000
 
const int SocketDiv = 1000
 
const int DamageLimit = 99999999
 
- Static Public Attributes inherited from EClass
static Core core
 

Protected Member Functions

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

Properties

string Aka [get]
 
string _alias [get, set]
 
string idFaith [get, set]
 
string idFaction [get, set]
 
Zone currentZone [get, set]
 
Zone homeZone [get, set]
 
GoalListType goalListType [get, set]
 
Hostility hostility [get, set]
 
int _affinity [get, set]
 
Affinity affinity [get]
 
int interest [get, set]
 
int daysStarved [get, set]
 
int _idTimeTable [get, set]
 
int uidEditor [get, set]
 
int _maxStamina [get, set]
 
int corruption [get, set]
 
bool isDead [get, set]
 
bool isAlawysVisible [get, set]
 
bool knowFav [get, set]
 
CharaAbility ability [get]
 
Faction faction [get, set]
 
Religion faith [get, set]
 
override CardRow sourceCard [get]
 
override CardRow sourceRenderCard [get]
 
SourceRace.Row race [get]
 
SourceJob.Row job [get]
 
string idTimeTable [get]
 
Hostility OriginalHostility [get]
 
string IDPCCBodySet [get]
 
new TraitChara trait [get, set]
 
string NameBraced [get]
 
string NameTitled [get]
 
override string actorPrefab [get]
 
override int PrefIndex [get]
 
override bool flipX [get]
 
override string AliasMaterialOnCreate [get]
 
override bool IsAliveInCurrentZone [get]
 
override bool IsDeadOrSleeping [get]
 
override bool IsDisabled [get]
 
bool IsLevitating [get]
 
override bool IsMoving [get]
 
override bool IsGlobal [get]
 
override bool IsPC [get]
 
override bool IsPCParty [get]
 
override bool IsMinion [get]
 
override bool IsPCPartyMinion [get]
 
override bool IsPCFactionMinion [get]
 
override bool IsPCFaction [get]
 
override bool IsPCC [get]
 
override bool isThing [get]
 
override bool isChara [get]
 
override bool HasHost [get]
 
override bool isSynced [get]
 
override bool IsMultisize [get]
 
override int MaxHP [get]
 
override int WeightLimit [get]
 
override int SelfWeight [get]
 
int MaxSummon [get]
 
Element MainElement [get]
 
override int DV [get]
 
override int PV [get]
 
override SourcePref Pref [get]
 
bool CanOpenDoor [get]
 
Tactics tactics [get]
 
TimeTable.Span CurrentSpan [get]
 
bool IsInActiveZone [get]
 
bool IsLocalChara [get]
 
bool IsIdle [get]
 
bool IsInCombat [get]
 
bool IsAnimal [get]
 
bool IsHuman [get]
 
bool IsUndead [get]
 
bool IsMachine [get]
 
bool IsHorror [get]
 
bool IsFish [get]
 
bool IsFairy [get]
 
bool IsGod [get]
 
bool IsDragon [get]
 
bool IsPlant [get]
 
bool IsCat [get]
 
int DestDist [get]
 
bool HasNoGoal [get]
 
bool CanWitness [get]
 
bool IsHumanSpeak [get]
 
bool IsMaid [get]
 
bool IsPrisoner [get]
 
bool IsAdventurer [get]
 
bool IsEyth [get]
 
bool IsWealthy [get]
 
FactionBranch homeBranch [get]
 
int MaxGeneSlot [get]
 
int CurrentGeneSlot [get]
 
int Speed [get]
 
bool IsMofuable [get]
 
ElementContainer baseWorkElements [get]
 
Stats hunger [get]
 
Stats burden [get]
 
Stats stamina [get]
 
Stats depression [get]
 
Stats bladder [get]
 
Stats hygiene [get]
 
Stats mana [get]
 
Stats sleepiness [get]
 
Stats SAN [get]
 
bool CanGainConResist [get]
 
- Properties inherited from Card
Card parentCard [get]
 
Thing parentThing [get]
 
int colorInt [get]
 
bool IsHotItem [get]
 
int uid [get, set]
 
int idMaterial [get, set]
 
int dir [get, set]
 
int Num [get, set]
 
int _x [get, set]
 
int _z [get, set]
 
int genLv [get, set]
 
int refVal [get, set]
 
int decay [get, set]
 
int altitude [get, set]
 
int hp [get, set]
 
float fx [get, set]
 
float fy [get, set]
 
BlessedState blessedState [get, set]
 
PlaceState _placeState [get, set]
 
int rarityLv [get, set]
 
Rarity rarity [get, set]
 
int encLV [get, set]
 
int posInvX [get, set]
 
int posInvY [get, set]
 
int idSkin [get, set]
 
int feat [get, set]
 
int LV [get, set]
 
int exp [get, set]
 
int tier [get, set]
 
int version [get, set]
 
bool isCensored [get, set]
 
bool isDeconstructing [get, set]
 
bool isDyed [get, set]
 
bool isModified [get, set]
 
bool isNew [get, set]
 
bool isPlayerCreation [get, set]
 
bool ignoreAutoPick [get, set]
 
bool freePos [get, set]
 
bool isHidden [get, set]
 
bool isOn [get, set]
 
bool isNPCProperty [get, set]
 
bool isRestrained [get, set]
 
bool isRoofItem [get, set]
 
bool isMasked [get, set]
 
bool disableAutoToggle [get, set]
 
bool isImported [get, set]
 
bool autoRefuel [get, set]
 
bool ignoreStackHeight [get, set]
 
bool isFloating [get, set]
 
bool isWeightChanged [get, set]
 
bool isFireproof [get, set]
 
bool isAcidproof [get, set]
 
bool isReplica [get, set]
 
bool isSummon [get, set]
 
bool isElemental [get, set]
 
bool isBroken [get, set]
 
bool isSubsetCard [get, set]
 
bool noSnow [get, set]
 
bool noMove [get, set]
 
bool isGifted [get, set]
 
bool isCrafted [get, set]
 
bool isLostProperty [get, set]
 
bool noShadow [get, set]
 
bool noSell [get, set]
 
bool isLeashed [get, set]
 
bool isStolen [get, set]
 
bool isSale [get, set]
 
bool isCopy [get, set]
 
bool isRestocking [get, set]
 
bool hasSpawned [get, set]
 
bool isScaled [get, set]
 
bool isBackerContent [get]
 
SourceBacker.Row sourceBacker [get]
 
BedType c_bedType [get, set]
 
int c_equippedSlot [get, set]
 
int c_lockLv [get, set]
 
Hostility c_originalHostility [get, set]
 
MinionType c_minionType [get, set]
 
int c_vomit [get, set]
 
bool c_wasInPcParty [get, set]
 
bool c_isImportant [get, set]
 
bool c_lockedHard [get, set]
 
bool c_revealLock [get, set]
 
bool c_isTrained [get, set]
 
bool c_isPrayed [get, set]
 
bool c_isDisableStockUse [get, set]
 
int c_lightColor [get, set]
 
Color LightColor [get]
 
int c_uidZone [get, set]
 
int c_uidRefCard [get, set]
 
int c_priceFix [get, set]
 
int c_priceAdd [get, set]
 
int c_priceCopy [get, set]
 
int c_fixedValue [get, set]
 
int c_dyeMat [get, set]
 
VisitorState visitorState [get, set]
 
RescueState c_rescueState [get, set]
 
BossType c_bossType [get, set]
 
int c_dateStockExpire [get, set]
 
int c_dateDeathLock [get, set]
 
int c_IDTState [get, set]
 
int c_charges [get, set]
 
int c_bill [get, set]
 
int c_invest [get, set]
 
int c_seed [get, set]
 
int c_allowance [get, set]
 
int c_fur [get, set]
 
int c_dateCooked [get, set]
 
int c_lockedAge [get, set]
 
int c_containerSize [get, set]
 
int c_weight [get, set]
 
int c_diceDim [get, set]
 
int c_indexContainerIcon [get, set]
 
int c_idMainElement [get, set]
 
int c_summonDuration [get, set]
 
int c_idBacker [get, set]
 
int c_uidMaster [get, set]
 
int c_ammo [get, set]
 
int c_daysWithGod [get, set]
 
int c_daysWithPC [get, set]
 
string c_idPortrait [get, set]
 
string c_idRace [get, set]
 
string c_idJob [get, set]
 
string c_idTone [get, set]
 
string c_color [get, set]
 
string c_idSpriteReplacer [get, set]
 
string c_idTalk [get, set]
 
string c_idDeity [get, set]
 
string c_altName [get, set]
 
string c_altName2 [get, set]
 
string c_extraNameRef [get, set]
 
string c_refText [get, set]
 
string c_idRefName [get, set]
 
string c_idRidePCC [get, set]
 
string c_idAbility [get, set]
 
string c_context [get, set]
 
string c_idEditor [get, set]
 
string c_editorTags [get, set]
 
string c_editorTraitVal [get, set]
 
string c_idTrait [get, set]
 
string c_idRefCard [get, set]
 
string c_idRefCard2 [get, set]
 
string c_note [get, set]
 
UniqueData c_uniqueData [get, set]
 
Thing ammoData [get, set]
 
List< SocketDatasocketList [get, set]
 
Thing c_copyContainer [get, set]
 
Window.SaveData c_windowSaveData [get, set]
 
CharaUpgrade c_upgrades [get, set]
 
CharaGenes c_genes [get, set]
 
List< int > c_corruptionHistory [get, set]
 
ContainerUpgrade c_containerUpgrade [get, set]
 
DNA c_DNA [get, set]
 
CharaList c_charaList [get, set]
 
MixedFoodData c_mixedFoodData [get, set]
 
Thing c_bloodData [get, set]
 
byte[] c_textureData [get, set]
 
SourceMaterial.Row DyeMat [get]
 
int invX [get, set]
 
int invY [get, set]
 
CardRow refCard [get]
 
CardRow refCard2 [get]
 
int ExpToNext [get]
 
int DefaultLV [get]
 
int ChildrenWeight [get]
 
int ChildrenAndSelfWeight [get]
 
int ChildrenAndSelfWeightSingle [get]
 
virtual int SelfWeight [get]
 
virtual int WeightLimit [get]
 
SourceCategory.Row category [get]
 
SourceMaterial.Row material [get]
 
virtual string AliasMaterialOnCreate [get]
 
Cell Cell [get]
 
virtual Thing Thing [get]
 
virtual Chara Chara [get]
 
virtual bool isThing [get]
 
virtual bool isChara [get]
 
bool ExistsOnMap [get]
 
virtual bool isSynced [get]
 
bool IsContainer [get]
 
bool IsUnique [get]
 
bool IsPowerful [get]
 
bool IsImportant [get]
 
virtual SourcePref Pref [get]
 
virtual bool IsDeadOrSleeping [get]
 
virtual bool IsDisabled [get]
 
virtual bool IsMoving [get]
 
virtual bool flipX [get]
 
virtual bool IsAliveInCurrentZone [get]
 
virtual string actorPrefab [get]
 
virtual CardRow sourceCard [get]
 
virtual CardRow sourceRenderCard [get]
 
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 }
 
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 (int _a, int start, int step, int rate=75)
 
static int sqrt (int a)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 

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

6640 {
6641 CardRenderer cardRenderer = renderer;
6642 CharaRenderer charaRenderer = new CharaRenderer();
6643 if (source.skinAntiSpider != 0 && EClass.core.config.game.antiSpider)
6644 {
6645 base.idSkin = source.skinAntiSpider;
6646 }
6647 if (host != null)
6648 {
6649 charaRenderer.pccData = PCCData.Create("ride");
6650 string idPart = base.c_idRidePCC.IsEmpty(EClass.core.pccs.sets["ride"].map["body"].map.Keys.First());
6651 charaRenderer.pccData.SetPart("body", "ride", idPart);
6652 charaRenderer.pccData.ride = EClass.core.pccs.GetRideData(idPart);
6653 }
6654 else
6655 {
6656 foreach (Condition condition in conditions)
6657 {
6658 RendererReplacer rendererReplacer = condition.GetRendererReplacer();
6659 if (rendererReplacer != null)
6660 {
6661 charaRenderer.replacer = rendererReplacer;
6662 charaRenderer.data = rendererReplacer.data;
6663 break;
6664 }
6665 }
6666 if (charaRenderer.replacer == null)
6667 {
6668 charaRenderer.pccData = pccData;
6669 }
6670 }
6671 renderer = charaRenderer;
6672 renderer.SetOwner(this);
6673 if (cardRenderer != null)
6674 {
6675 renderer.SetFirst(first: false, cardRenderer.position);
6676 }
6677 return charaRenderer;
6678 }
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:61
PCCData pccData
Chara host
Definition: Chara.cs:33
List< Condition > conditions
Definition: Chara.cs:211
SourceChara.Row source
Definition: Chara.cs:158
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 2296 of file Chara.cs.

2297 {
2298 if (EClass.pc.homeBranch != null)
2299 {
2301 }
2302 else
2303 {
2304 SetGlobal();
2306 }
2307 Hostility hostility2 = (base.c_originalHostility = Hostility.Ally);
2308 this.hostility = hostility2;
2309 orgPos = null;
2310 base.c_summonDuration = 0;
2311 base.isSummon = false;
2312 ReleaseMinion();
2313 SetInt(32);
2314 Refresh();
2315 }
Hostility
Definition: Hostility.cs:2
list. Refresh()
void SetInt(int id, int value=0)
Definition: BaseCard.cs:39
void ReleaseMinion()
Definition: Chara.cs:2362
Chara SetFaction(Faction f)
Definition: Chara.cs:1419
Point orgPos
Definition: Chara.cs:21
FactionBranch homeBranch
Definition: Chara.cs:1066
Chara SetGlobal()
Definition: Chara.cs:1486
static Faction Home
Definition: EClass.cs:27
static Chara pc
Definition: EClass.cs:15
void AddMemeber(Chara c)

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

Referenced by MakeAlly(), and MakePartyMemeber().

◆ _Move()

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

Reimplemented from Card.

Definition at line 2742 of file Chara.cs.

2743 {
2744 if (isDead)
2745 {
2746 return MoveResult.Fail;
2747 }
2748 if (IsPC)
2749 {
2750 float num = EClass.setting.defaultActPace;
2751 switch (burden.GetPhase())
2752 {
2753 case 3:
2754 num *= 1.5f;
2755 break;
2756 case 4:
2757 num *= 2f;
2758 break;
2759 }
2761 {
2762 int num2 = 30;
2763 if (!EClass.pc.HasElement(408))
2764 {
2766 {
2767 case Weather.Condition.Rain:
2768 num2 += 5;
2769 break;
2770 case Weather.Condition.RainHeavy:
2771 num2 += 10;
2772 num *= 1.5f;
2773 break;
2774 case Weather.Condition.Snow:
2775 num2 += 10;
2776 break;
2777 case Weather.Condition.SnowHeavy:
2778 num2 += 15;
2779 num *= 1.5f;
2780 break;
2781 }
2782 }
2783 if (newPoint.matFloor.id == 48)
2784 {
2785 num2 += 20;
2786 num *= 1.8f;
2787 }
2788 num2 = num2 * 100 / (100 + EClass.sqrt(EvalueMax(240, -20) * 10) + EvalueMax(407, -5) * 5);
2789 EClass.world.date.AdvanceMin(num2 * 6);
2790 EClass.player.lastZonePos = null;
2792 int num3 = base.hp;
2793 for (int i = 0; i < num2 * 4; i++)
2794 {
2795 EClass.pc.party.members.ForeachReverse(delegate(Chara m)
2796 {
2797 if (!m.isDead)
2798 {
2799 m.TickConditions();
2800 }
2801 });
2802 if (base.hp < MaxHP / 5 && base.hp < num3 && !EClass.player.regionMoveWarned)
2803 {
2804 EClass.player.regionMoveWarned = true;
2805 Msg.Say("regionAbortMove");
2806 EInput.Consume(consumeAxis: true);
2807 SetAI(new NoGoal());
2808 return MoveResult.Fail;
2809 }
2810 }
2811 if (newPoint.cell.CanSuffocate())
2812 {
2813 AddCondition<ConSuffocation>((EClass.pc.Evalue(200) != 0) ? (2000 / (100 + EvalueMax(200, -5) * 10)) : 30, force: true);
2814 int num4 = GetCondition<ConSuffocation>()?.GetPhase() ?? 0;
2815 if (num4 >= 2)
2816 {
2817 DamageHP(EClass.rndHalf(10 + MaxHP / 5), AttackSource.Condition);
2818 }
2819 if (!isDead && !HasElement(429))
2820 {
2821 ModExp(200, 1 + num4 * 12);
2822 }
2823 }
2824 EClass.player.regionMoveWarned = false;
2825 if (isDead)
2826 {
2827 return MoveResult.Fail;
2828 }
2829 }
2830 if (num > EClass.setting.defaultActPace * 3f)
2831 {
2832 num = EClass.setting.defaultActPace * 3f;
2833 }
2834 actTime = num;
2835 }
2836 if (IsPCFaction && EClass.rnd(5) == 0 && newPoint.cell.CanSuffocate())
2837 {
2838 int num5 = Mathf.Min(5 + EClass._zone.DangerLv / 10, 200);
2839 ModExp(200, EClass._zone.IsRegion ? 50 : num5);
2840 if (ride != null)
2841 {
2842 ride.ModExp(200, EClass._zone.IsRegion ? 50 : num5);
2843 }
2844 if (parasite != null)
2845 {
2846 parasite.ModExp(200, EClass._zone.IsRegion ? 50 : num5);
2847 }
2848 }
2849 Chara chara = ((ride == null) ? this : ride);
2850 if (!EClass._zone.IsRegion || chara.IsPC)
2851 {
2852 bool flag = (chara.isConfused && EClass.rnd(2) == 0) || (chara.isDrunk && EClass.rnd(IsIdle ? 2 : 8) == 0 && !chara.HasElement(1215));
2853 if (host != null && host.ride == this && ((host.isConfused && EClass.rnd(2) == 0) || (host.isDrunk && EClass.rnd(IsIdle ? 2 : 8) == 0 && !host.HasElement(1215))))
2854 {
2855 flag = true;
2856 }
2857 if (flag && newPoint.Distance(pos) <= 1)
2858 {
2859 Point randomNeighbor = pos.GetRandomNeighbor();
2860 if (CanMoveTo(randomNeighbor, allowDestroyPath: false))
2861 {
2862 newPoint = randomNeighbor;
2863 if (isDrunk)
2864 {
2865 Talk("drunk");
2866 }
2867 }
2868 }
2869 }
2870 if (newPoint.x != pos.x || newPoint.z != pos.z)
2871 {
2872 LookAt(newPoint);
2873 }
2874 CellEffect effect = base.Cell.effect;
2875 if (effect != null && effect.id == 7)
2876 {
2877 CellEffect effect2 = base.Cell.effect;
2878 if (race.height < 500 && !race.tag.Contains("webfree") && EClass.rnd(effect2.power + 25) > EClass.rnd(base.STR + base.DEX + 1))
2879 {
2880 Say("abWeb_caught", this);
2881 PlaySound("web");
2882 effect2.power = effect2.power * 3 / 4;
2883 renderer.PlayAnime(AnimeID.Shiver);
2884 return MoveResult.Fail;
2885 }
2886 Say("abWeb_pass", this);
2887 EClass._map.SetEffect(base.Cell.x, base.Cell.z);
2888 }
2889 if (IsPC)
2890 {
2891 if (EClass._zone.IsRegion)
2892 {
2894 }
2895 else if ((newPoint.x > pos.x && newPoint.z > pos.z) || (newPoint.x < pos.x && newPoint.z < pos.z))
2896 {
2898 }
2899 }
2900 if (newPoint.cell.hasDoor)
2901 {
2902 foreach (Thing thing in pos.Things)
2903 {
2904 if (thing.trait is TraitDoor traitDoor && traitDoor.owner.c_lockLv > 0)
2905 {
2906 if (base.INT < 10)
2907 {
2908 return MoveResult.Fail;
2909 }
2910 traitDoor.TryOpenLock(this);
2911 return MoveResult.Door;
2912 }
2913 }
2914 }
2915 Cell cell = newPoint.cell;
2916 Cell cell2 = pos.cell;
2917 bool flag2 = cell.HasLiquid && !IsLevitating;
2918 bool hasBridge = cell.HasBridge;
2919 bool hasRamp = cell.HasRamp;
2920 bool flag3 = EClass._zone.IsSnowCovered && !cell.HasRoof && !cell.isClearSnow;
2921 TileRow tileRow = (hasRamp ? ((TileRow)cell.sourceBlock) : ((TileRow)(hasBridge ? cell.sourceBridge : cell.sourceFloor)));
2922 SourceMaterial.Row row = (hasRamp ? cell.matBlock : (hasBridge ? cell.matBridge : cell.matFloor));
2923 bool flag4 = cell.IsTopWater && !cell.isFloating;
2924 if (!EClass._zone.IsRegion)
2925 {
2926 if (cell.hasDoorBoat)
2927 {
2928 tileRow = FLOOR.sourceWood;
2929 row = MATERIAL.sourceOak;
2930 flag4 = false;
2931 }
2932 else if (flag3 && !tileRow.ignoreSnow)
2933 {
2934 if (tileRow.tileType.IsWater)
2935 {
2936 tileRow = FLOOR.sourceIce;
2937 row = MATERIAL.sourceIce;
2938 }
2939 else
2940 {
2941 tileRow = FLOOR.sourceSnow;
2942 row = MATERIAL.sourceSnow;
2943 }
2944 flag4 = false;
2945 }
2946 }
2947 if ((pos.sourceFloor.isBeach || cell2.IsSnowTile) && !pos.HasObj)
2948 {
2949 EClass._map.SetFoormark(pos, 1, (int)Util.GetAngle(pos.x - newPoint.x, pos.z - newPoint.z), cell2.IsSnowTile ? 312 : 304);
2950 }
2951 if (isSynced)
2952 {
2953 string text = ((flag2 || flag4) ? "water" : tileRow.soundFoot.IsEmpty(row.soundFoot.IsEmpty("default")));
2954 if (cell.obj != 0 && cell.sourceObj.tileType.IsPlayFootSound && !cell.matObj.soundFoot.IsEmpty())
2955 {
2956 text = cell.matObj.soundFoot;
2957 }
2958 if (IsPC)
2959 {
2960 foreach (Thing thing2 in newPoint.Things)
2961 {
2962 if (thing2.IsInstalled && (thing2.trait.IsChangeFloorHeight || thing2.Pref.Surface))
2963 {
2964 text = thing2.material.soundFoot;
2965 }
2966 }
2967 }
2968 if (!text.IsEmpty())
2969 {
2970 SoundManager.altLastData = IsPC;
2971 PlaySound("Footstep/" + text, IsPC ? 1f : 0.9f);
2972 }
2973 if (!flag4)
2974 {
2976 PCOrbit pcOrbit = EClass.screen.pcOrbit;
2977 bool flag5 = scene.actionMode.gameSpeed > 1f;
2978 scene.psFoot.transform.position = renderer.position + pcOrbit.footPos;
2979 scene.psFoot.startColor = row.matColor;
2980 scene.psFoot.Emit(pcOrbit.emitFoot * ((!flag5) ? 1 : 2));
2981 if (flag5 && IsPC)
2982 {
2983 scene.psSmoke.transform.position = renderer.position + pcOrbit.smokePos;
2984 scene.psSmoke.Emit(pcOrbit.emitSmoke);
2985 }
2986 }
2987 if (flag2 || flag4)
2988 {
2989 Effect.Get("ripple").Play(0.4f * actTime * EClass.scene.actionMode.gameSpeed, newPoint);
2990 }
2991 }
2992 lastPos.Set(pos);
2993 if (type != MoveType.Force)
2994 {
2995 if (newPoint.HasChara && ai.Current.PushChara)
2996 {
2997 TryPush(newPoint);
2998 }
2999 if (newPoint.HasChara && newPoint.Charas.Count == 1)
3000 {
3001 Chara chara2 = newPoint.Charas[0];
3002 if (CanReplace(chara2))
3003 {
3004 chara2.MoveByForce(lastPos, this);
3005 if (chara.IsPC)
3006 {
3007 Say("replace_pc", chara, chara2);
3008 }
3009 }
3010 }
3011 }
3012 if (cell.hasDoor)
3013 {
3014 foreach (Thing thing3 in newPoint.Things)
3015 {
3016 if (thing3.trait is TraitDoor traitDoor2)
3017 {
3018 traitDoor2.TryOpen(this);
3019 }
3020 }
3021 }
3022 EClass._zone.map.MoveCard(newPoint, this);
3023 SyncRide();
3025 {
3026 foreach (Chara member in EClass.pc.party.members)
3027 {
3028 if (member.isLeashed && !member.IsPC && member.host == null && !member.IsDisabled && !member.HasCondition<ConEntangle>() && !member.IsInCombat && member.Dist(EClass.pc) > 1)
3029 {
3030 member.TryMoveTowards(EClass.pc.pos);
3031 }
3032 }
3033 }
3035 {
3037 }
3038 if (IsPC)
3039 {
3040 PlaySound("Footstep/Extra/pcfootstep");
3041 if (pos.HasThing)
3042 {
3043 foreach (Card item in pos.ListCards())
3044 {
3045 if (!item.isThing || item.placeState != 0 || item.ignoreAutoPick)
3046 {
3047 continue;
3048 }
3050 {
3052 ContainerFlag containerFlag = item.category.GetRoot().id.ToEnum<ContainerFlag>();
3053 if (containerFlag == ContainerFlag.none)
3054 {
3055 containerFlag = ContainerFlag.other;
3056 }
3057 if ((dataPick.noRotten && item.IsDecayed) || (dataPick.onlyRottable && item.trait.Decay == 0))
3058 {
3059 continue;
3060 }
3061 if (dataPick.userFilter)
3062 {
3063 switch (dataPick.IsFilterPass(item.GetName(NameStyle.Full, 1)))
3064 {
3065 case Window.SaveData.FilterResult.PassWithoutFurtherTest:
3066 Pick(item.Thing);
3067 continue;
3068 case Window.SaveData.FilterResult.Block:
3069 continue;
3070 }
3071 }
3072 if (dataPick.advDistribution)
3073 {
3074 foreach (int cat in dataPick.cats)
3075 {
3076 if (item.category.uid == cat)
3077 {
3078 Pick(item.Thing);
3079 }
3080 }
3081 }
3082 else if (!dataPick.flag.HasFlag(containerFlag))
3083 {
3084 Pick(item.Thing);
3085 }
3086 }
3087 else
3088 {
3089 Pick(item.Thing);
3090 }
3091 }
3092 }
3093 if (EClass._zone.IsRegion)
3094 {
3096 if (cell3?.zone != null && !cell3.zone.HiddenInRegionMap && (!(cell3.zone is Zone_Field) || cell3.zone.children.Count > 0 || cell3.zone.IsPCFaction))
3097 {
3098 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() ?? "");
3099 }
3100 if (pos.matFloor.alias == "snow" && EClass.rnd(3) == 0)
3101 {
3103 Msg.Say(Lang.GetList("walk_snow").RandomItem());
3104 }
3105 else if (EClass.world.weather.CurrentCondition == Weather.Condition.RainHeavy && EClass.rnd(3) == 0)
3106 {
3108 Msg.Say(Lang.GetList("walk_storm").RandomItem());
3109 }
3110 }
3112 }
3113 if (IsPCC)
3114 {
3115 int num6 = Mathf.Abs(cell2.topHeight - cell.topHeight);
3116 if ((num6 >= 3 && lastPos.sourceBlock.tileType.slopeHeight == 0 && newPoint.sourceBlock.tileType.slopeHeight == 0) || cell2.hasDoorBoat || cell.hasDoorBoat)
3117 {
3118 renderer.PlayAnime((cell2.topHeight >= cell.topHeight) ? AnimeID.JumpDown : ((num6 >= 6) ? AnimeID.Jump : AnimeID.JumpSmall));
3119 }
3120 else
3121 {
3122 float surfaceHeight = cell2.GetSurfaceHeight();
3123 float surfaceHeight2 = cell.GetSurfaceHeight();
3124 num6 = (int)Mathf.Abs((surfaceHeight - surfaceHeight2) * 100f);
3125 if (num6 >= 15)
3126 {
3127 renderer.PlayAnime((surfaceHeight >= surfaceHeight2) ? AnimeID.JumpDown : ((num6 >= 40) ? AnimeID.Jump : AnimeID.JumpSmall));
3128 }
3129 }
3130 }
3131 lastPos.Things.ForeachReverse(delegate(Thing t)
3132 {
3133 t.trait.OnSteppedOut(this);
3134 });
3135 if (!IsPC)
3136 {
3137 pos.Things.ForeachReverse(delegate(Thing t)
3138 {
3139 t.trait.OnStepped(this);
3140 });
3141 }
3142 if (CanDestroyPath())
3143 {
3145 }
3146 if (IsPC)
3147 {
3148 if (renderer.anime == null && renderer.replacer != null)
3149 {
3151 }
3153 {
3154 if (!FLOOR.IsTatami(pos.cell.sourceSurface.id) && pos.cell.room == null)
3155 {
3156 EClass.player.flags.isShoesOff = false;
3157 EClass.pc.Say("shoes_on", EClass.pc);
3158 EClass.pc.SetPCCState(PCCState.Normal);
3159 }
3160 }
3161 else if (FLOOR.IsTatami(pos.cell.sourceSurface.id) && pos.cell.room != null)
3162 {
3163 EClass.player.flags.isShoesOff = true;
3164 EClass.pc.Say("shoes_off", EClass.pc);
3165 EClass.pc.SetPCCState(PCCState.ShoesOff);
3166 }
3167 }
3168 hasMovedThisTurn = true;
3169 return MoveResult.Success;
3170 }
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:44
virtual float gameSpeed
Definition: ActionMode.cs:119
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
int EvalueMax(int ele, int min=0)
Definition: Card.cs:2585
SourceMaterial.Row material
Definition: Card.cs:2051
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:6165
int c_lockLv
Definition: Card.cs:964
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
Definition: Card.cs:6721
Point pos
Definition: Card.cs:59
Trait trait
Definition: Card.cs:53
MoveType
Definition: Card.cs:20
void DamageHP(long dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
Definition: Card.cs:4063
MoveResult
Definition: Card.cs:13
bool IsInstalled
Definition: Card.cs:2381
int Evalue(int ele)
Definition: Card.cs:2571
int Dist(Card c)
Definition: Card.cs:7665
void ModExp(string alias, int a)
Definition: Card.cs:2648
bool isLeashed
Definition: Card.cs:842
bool HasElement(int ele, bool includeNagative=false)
Definition: Card.cs:5920
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:6818
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:3664
bool IsLevitating
Definition: Chara.cs:597
AIAct ai
Definition: Chara.cs:202
override bool IsPC
Definition: Chara.cs:612
bool isDrunk
Definition: Chara.cs:124
Party party
Definition: Chara.cs:43
bool CanDestroyPath()
Definition: Chara.cs:2410
bool IsInCombat
Definition: Chara.cs:864
bool HasCondition(string alias)
Definition: Chara.cs:9405
AIAct SetAI(AIAct g)
Definition: Chara.cs:8874
bool IsIdle
Definition: Chara.cs:853
override bool IsDisabled
Definition: Chara.cs:585
bool hasMovedThisTurn
Definition: Chara.cs:176
override bool isSynced
Definition: Chara.cs:691
bool CanMoveTo(Point p, bool allowDestroyPath=true)
Definition: Chara.cs:2423
void DestroyPath(Point pos)
Definition: Chara.cs:3172
override bool IsPCFaction
Definition: Chara.cs:671
float actTime
Definition: Chara.cs:178
override int MaxHP
Definition: Chara.cs:708
Zone currentZone
Definition: Chara.cs:255
bool CanReplace(Chara c)
Definition: Chara.cs:3283
Point lastPos
Definition: Chara.cs:90
void MoveByForce(Point newPoint, Card c=null, bool checkWall=false)
Definition: Chara.cs:2608
Stats burden
Definition: Chara.cs:1144
Chara parasite
Definition: Chara.cs:30
Chara ride
Definition: Chara.cs:27
MoveResult TryMoveTowards(Point p)
Definition: Chara.cs:2616
void SyncRide()
Definition: Chara.cs:3923
bool isDead
Definition: Chara.cs:389
override void LookAt(Card c)
Definition: Chara.cs:3528
bool isConfused
Definition: Chara.cs:126
override bool IsPCC
Definition: Chara.cs:682
void TryPush(Point point)
Definition: Chara.cs:3216
void SetPCCState(PCCState state)
Definition: Chara.cs:6680
SourceRace.Row race
Definition: Chara.cs:464
bool allyKeepDistance
Definition: ConfigTactics.cs:6
static Game game
Definition: EClass.cs:9
static Scene scene
Definition: EClass.cs:31
static Zone _zone
Definition: EClass.cs:21
static World world
Definition: EClass.cs:41
static Map _map
Definition: EClass.cs:19
static int rnd(long a)
Definition: EClass.cs:59
static BaseGameScreen screen
Definition: EClass.cs:33
static int rndHalf(int a)
Definition: EClass.cs:97
static Player player
Definition: EClass.cs:13
static int sqrt(int a)
Definition: EClass.cs:88
static GameSetting setting
Definition: EClass.cs:35
Definition: EInput.cs:8
static void Consume(int _skipFrame)
Definition: EInput.cs:656
Definition: Effect.cs:7
static Effect Get(Effect original)
Definition: Effect.cs:85
void Play(float delay, Point from, float fixY=0f, Point to=null, Sprite sprite=null)
Definition: Effect.cs:100
Zone zone
Definition: EloMap.cs:11
Cell GetCell(Point pos)
Definition: EloMap.cs:272
Definition: FLOOR.cs:2
static SourceFloor.Row sourceSnow
Definition: FLOOR.cs:31
static SourceFloor.Row sourceIce
Definition: FLOOR.cs:35
static bool IsTatami(int id)
Definition: FLOOR.cs:39
static SourceFloor.Row sourceWood
Definition: FLOOR.cs:37
void AdvanceMin(int a)
Definition: GameDate.cs:22
float defaultActPace
Definition: GameSetting.cs:327
RenderSetting render
Definition: GameSetting.cs:301
ConfigTactics tactics
Definition: Game.cs:90
Config config
Definition: Game.cs:218
Definition: Lang.cs:6
static string[] GetList(string id)
Definition: Lang.cs:114
static SourceMaterial.Row sourceOak
Definition: MATERIAL.cs:47
static SourceMaterial.Row sourceSnow
Definition: MATERIAL.cs:41
static SourceMaterial.Row sourceIce
Definition: MATERIAL.cs:43
void MoveCard(Point p, Card t)
Definition: Map.cs:841
void SetFoormark(Point pos, int id, int angle, int offset=0)
Definition: Map.cs:2060
void SetEffect(int x, int z, CellEffect effect=null)
Definition: Map.cs:1508
Color Ono
Definition: MsgColors.cs:13
Definition: Msg.cs:5
static MsgColors colors
Definition: Msg.cs:20
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
static void SetColor()
Definition: Msg.cs:22
Definition: NoGoal.cs:4
int emitFoot
Definition: PCOrbit.cs:9
int emitSmoke
Definition: PCOrbit.cs:11
Vector3 smokePos
Definition: PCOrbit.cs:15
Vector3 footPos
Definition: PCOrbit.cs:13
List< Chara > members
Definition: Party.cs:19
bool isShoesOff
Definition: Player.cs:347
int distanceTravel
Definition: Player.cs:893
Flags flags
Definition: Player.cs:1094
Window.SaveData dataPick
Definition: Player.cs:1034
bool regionMoveWarned
Definition: Player.cs:1157
Definition: Point.cs:9
SourceMaterial.Row matFloor
Definition: Point.cs:57
SourceBlock.Row sourceBlock
Definition: Point.cs:63
List< Card > ListCards(bool includeMasked=false)
Definition: Point.cs:1051
Point Set(int _x, int _z)
Definition: Point.cs:503
List< Thing > Things
Definition: Point.cs:338
int x
Definition: Point.cs:36
int z
Definition: Point.cs:39
List< Chara > Charas
Definition: Point.cs:340
bool HasThing
Definition: Point.cs:251
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
ActionMode actionMode
Definition: Scene.cs:79
ParticleSystem psFoot
Definition: Scene.cs:111
EloMap elomap
Definition: Scene.cs:149
bool Surface
Definition: SourcePref.cs:318
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:163
virtual void OnSteppedOut(Chara c)
Definition: Trait.cs:1081
virtual bool IsChangeFloorHeight
Definition: Trait.cs:73
virtual void OnStepped(Chara c)
Definition: Trait.cs:1077
Card owner
Definition: Trait.cs:27
Definition: Util.cs:10
static float GetAngle(Vector3 self, Vector3 target)
Definition: Util.cs:121
Condition
Definition: Weather.cs:16
Condition CurrentCondition
Definition: Weather.cs:79
FilterResult IsFilterPass(string text)
Definition: Window.cs:498
ContainerFlag flag
Definition: Window.cs:267
HashSet< int > cats
Definition: Window.cs:119
bool userFilter
Definition: Window.cs:132
bool noRotten
Definition: Window.cs:439
bool advDistribution
Definition: Window.cs:427
Definition: Window.cs:13
GameDate date
Definition: World.cs:6
Weather weather
Definition: World.cs:12
virtual bool PetFollow
Definition: Zone.cs:287
override int DangerLv
Definition: Zone.cs:110
bool IsPCFaction
Definition: Zone.cs:473
virtual bool KeepAllyDistance
Definition: Zone.cs:302
virtual bool HiddenInRegionMap
Definition: Zone.cs:413
Map map
Definition: Zone.cs:63

References EClass._map, EClass._zone, Scene.actionMode, 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(), 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, ActionMode.gameSpeed, Effect.Get(), EloMap.GetCell(), Lang.GetList(), 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, TileRow.ignoreSnow, Trait.IsChangeFloorHeight, Cell.isClearSnow, isConfused, isDead, 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(), TileType.IsWater, item, Zone.KeepAllyDistance, lastPos, Point.ListCards(), 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, Effect.Play(), CardRenderer.PlayAnime(), EClass.player, Card.PlaySound(), Card.pos, CellEffect.power, Thing.Pref, Scene.psFoot, Scene.psSmoke, AIAct.PushChara, race, 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, Point.Things, TickConditions(), RenderRow.tileType, Cell.topHeight, Card.trait, TryMoveTowards(), TryPush(), Window.SaveData.userFilter, Util, 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 7219 of file Chara.cs.

7220 {
7221 EClass.Sound.Play("pop_drama");
7222 if (book == "_chara" && IsPC)
7223 {
7224 step = "pc";
7225 }
7226 return LayerDrama.Activate(book, sheet, step, this, null, tag);
7227 }
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

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

◆ AddCondition() [1/2]

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

Definition at line 9249 of file Chara.cs.

9250 {
9251 c.owner = this;
9252 if (!(c is ConBurning))
9253 {
9254 if (c is ConBleed && ResistLv(964) >= 3)
9255 {
9256 return null;
9257 }
9258 }
9259 else if (ResistLv(950) >= 3)
9260 {
9261 return null;
9262 }
9264 {
9265 if (c.GainResistFactor >= 400)
9266 {
9267 c.power /= 2;
9268 }
9269 ResistCon(c);
9270 if (c.power <= 0)
9271 {
9272 return null;
9273 }
9274 }
9275 if (!force)
9276 {
9277 if (c.source.negate.Length != 0)
9278 {
9279 string[] negate = c.source.negate;
9280 foreach (string text in negate)
9281 {
9282 if (HasElement(text))
9283 {
9284 return null;
9285 }
9286 }
9287 }
9288 Element defenseAttribute = c.GetDefenseAttribute(this);
9289 if (defenseAttribute != null)
9290 {
9291 c.power = 100 * c.power / Mathf.Max(100 + defenseAttribute.Value, 1);
9292 }
9293 if (c.source.resistance.Length != 0)
9294 {
9295 int num = ResistLv(EClass.sources.elements.alias[c.source.resistance[0]].id);
9296 if (num > 0)
9297 {
9298 c.power /= num * num + 1;
9299 if (c.power <= 40)
9300 {
9301 return null;
9302 }
9303 }
9304 }
9305 c.power = c.EvaluatePower(c.power);
9306 if (c.power <= 0)
9307 {
9308 return null;
9309 }
9310 }
9311 int num2 = c.EvaluateTurn(c.power);
9312 if (num2 == 0)
9313 {
9314 return null;
9315 }
9316 for (int j = 0; j < conditions.Count; j++)
9317 {
9318 if (conditions[j].id != c.id)
9319 {
9320 continue;
9321 }
9322 if (c.Type == ConditionType.Stance || c.IsToggle)
9323 {
9324 conditions[j].Kill();
9325 return null;
9326 }
9327 if (conditions[j].CanStack(c))
9328 {
9329 if (conditions[j].ShouldOverride(c))
9330 {
9331 if (num2 > conditions[j].value || num2 * conditions[j].value < 0)
9332 {
9333 conditions[j].Kill(silent: true);
9334 continue;
9335 }
9336 return null;
9337 }
9338 if (CanGainConResist)
9339 {
9340 AddResistCon(c);
9341 }
9342 conditions[j].OnStacked(c.power);
9343 conditions[j].OnStartOrStack();
9344 conditions[j].PlayEffect();
9345 }
9346 if (!conditions[j].AllowMultipleInstance)
9347 {
9348 return null;
9349 }
9350 }
9351 foreach (Condition condition in conditions)
9352 {
9353 if (condition.TryNullify(c))
9354 {
9355 return null;
9356 }
9357 }
9358 c.value = num2;
9359 conditions.Add(c);
9360 if (CanGainConResist)
9361 {
9362 AddResistCon(c);
9363 }
9364 c.SetOwner(this);
9365 c.Start();
9366 SetDirtySpeed();
9367 if (c.ShouldRefresh)
9368 {
9369 Refresh();
9370 }
9371 if (c.CancelAI)
9372 {
9373 ai.Cancel();
9374 }
9375 if (IsPC && c.ConsumeTurn && !EClass.pc.isRestrained)
9376 {
9378 }
9379 if (c.SyncRide && (ride != null || parasite != null))
9380 {
9381 if (ride != null)
9382 {
9384 }
9385 if (parasite != null)
9386 {
9388 }
9389 }
9390 return c;
9391 }
ConditionType
Definition: ConditionType.cs:2
virtual Status Cancel()
Definition: AIAct.cs:291
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)
bool TryNullify(Condition c)
virtual void SetOwner(Chara _owner, bool onDeserialize=false)
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:566
int ResistLv(int res)
Definition: Card.cs:5915
void SetDirtySpeed()
Definition: Chara.cs:1859
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:9244
bool CanGainConResist
Definition: Chara.cs:1161
void AddResistCon(Condition con)
Definition: Chara.cs:9648
void ResistCon(Condition con)
Definition: Chara.cs:9668
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:292
void EndTurn(bool consume=true)
Definition: Player.cs:2081
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 9239 of file Chara.cs.

9239 : Condition
9240 {
9241 return AddCondition(typeof(T).Name, p, force);
9242 }
string Name
Definition: Card.cs:2137

◆ AddCooldown()

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

Definition at line 8655 of file Chara.cs.

8656 {
8657 if (_cooldowns == null)
8658 {
8659 _cooldowns = new List<int>();
8660 }
8661 if (turns != 0)
8662 {
8663 _cooldowns.Add(idEle * 1000 + turns);
8664 return;
8665 }
8666 SourceElement.Row row = EClass.sources.elements.map[idEle];
8667 if (row.cooldown > 0)
8668 {
8669 _cooldowns.Add(idEle * 1000 + row.cooldown);
8670 }
8671 }
List< int > _cooldowns
Definition: Chara.cs:58

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

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

◆ AddFoodHistory()

void Chara.AddFoodHistory ( Thing  food)
inline

Definition at line 10135 of file Chara.cs.

10136 {
10137 if (!IsPCFaction || !IsGlobal)
10138 {
10139 _historyFood = null;
10140 return;
10141 }
10142 if (_historyFood == null)
10143 {
10144 _historyFood = new List<List<string>>
10145 {
10146 new List<string>()
10147 };
10148 }
10149 if (_historyFood[0].Count < 5)
10150 {
10151 _historyFood[0].Add(food.id);
10152 }
10153 }
override bool IsGlobal
Definition: Chara.cs:610
List< List< string > > _historyFood
Definition: Chara.cs:64

References food.

Referenced by FoodEffect.Proc().

◆ AddHobby()

void Chara.AddHobby ( int  id)
inline

Definition at line 9074 of file Chara.cs.

9075 {
9076 foreach (int hobby in _hobbies)
9077 {
9078 if (hobby == id)
9079 {
9080 return;
9081 }
9082 }
9083 _hobbies.Add(id);
9084 }
List< int > _hobbies
Definition: Chara.cs:49

◆ AddRandomBodyPart()

void Chara.AddRandomBodyPart ( bool  msg = false)
inline

Definition at line 2191 of file Chara.cs.

2192 {
2193 int ele = new int[9] { 30, 31, 33, 35, 35, 36, 34, 37, 39 }.RandomItem();
2194 body.AddBodyPart(ele);
2195 if (msg)
2196 {
2197 Say("gain_bodyparts", this, Element.Get(ele).GetName().ToLower());
2198 PlaySound("offering");
2199 }
2200 }
void AddBodyPart(int ele, Thing thing=null)
Definition: CharaBody.cs:268
CharaBody body
Definition: Chara.cs:94
static SourceElement.Row Get(int id)
Definition: ELEMENT.cs:401

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

9649 {
9650 if (con.power > 0 && con.GainResistFactor > 0)
9651 {
9652 int key = con.id;
9653 if (resistCon == null)
9654 {
9655 resistCon = new Dictionary<int, int>();
9656 }
9657 if (resistCon.ContainsKey(key))
9658 {
9659 resistCon[key] += con.power * con.GainResistFactor / 100;
9660 }
9661 else
9662 {
9663 resistCon[key] = con.power * con.GainResistFactor / 100;
9664 }
9665 }
9666 }
Dictionary< int, int > resistCon
Definition: Chara.cs:214

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

◆ AddWork()

void Chara.AddWork ( int  id)
inline

Definition at line 9086 of file Chara.cs.

9087 {
9088 foreach (int work in _works)
9089 {
9090 if (work == id)
9091 {
9092 return;
9093 }
9094 }
9095 _works.Add(id);
9096 }
List< int > _works
Definition: Chara.cs:52

◆ ApplyDeathPenalty()

void Chara.ApplyDeathPenalty ( )
inline

Definition at line 5242 of file Chara.cs.

5243 {
5244 if (!IsPC)
5245 {
5246 return;
5247 }
5248 int currency = GetCurrency();
5249 if (currency > 0)
5250 {
5251 int num = currency / 3 + EClass.rnd(currency / 3 + 1);
5252 if (num <= 0)
5253 {
5254 num = 1;
5255 }
5256 Msg.Say("panaltyMoney", this, Lang._currency(num));
5257 ModCurrency(-num);
5259 }
5260 foreach (Element value in EClass.pc.elements.dict.Values)
5261 {
5262 if (EClass.rnd(5) == 0 && value.IsMainAttribute)
5263 {
5264 EClass.pc.elements.ModExp(value.id, -500f);
5265 }
5266 }
5267 }
@ currency
ElementContainerCard elements
Definition: Card.cs:41
int GetCurrency(string id="money")
Definition: Card.cs:3975
void ModCurrency(int a, string id="money")
Definition: Card.cs:3961
void ModExp(int ele, float a, bool chain=false)
Dictionary< int, Element > dict
int id
Definition: ELEMENT.cs:250
bool IsMainAttribute
Definition: ELEMENT.cs:383
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:1977

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

2027 {
2028 switch (tag)
2029 {
2030 case EditorTag.HostilityNeutral:
2031 {
2032 Hostility hostility2 = (base.c_originalHostility = Hostility.Neutral);
2033 this.hostility = hostility2;
2034 break;
2035 }
2036 case EditorTag.HostilityEnemy:
2037 {
2038 Hostility hostility2 = (base.c_originalHostility = Hostility.Enemy);
2039 this.hostility = hostility2;
2040 break;
2041 }
2042 case EditorTag.HostilityFriend:
2043 {
2044 Hostility hostility2 = (base.c_originalHostility = Hostility.Friend);
2045 this.hostility = hostility2;
2046 break;
2047 }
2048 case EditorTag.Male:
2049 bio.SetGender(2);
2050 base.c_idPortrait = Portrait.GetRandomPortrait(2, GetIdPortraitCat());
2051 break;
2052 case EditorTag.Female:
2053 bio.SetGender(1);
2054 base.c_idPortrait = Portrait.GetRandomPortrait(1, GetIdPortraitCat());
2055 break;
2056 case EditorTag.baby:
2057 SetFeat(1232);
2058 break;
2059 }
2060 base.ApplyEditorTags(tag);
2061 }
EditorTag
Definition: EditorTag.cs:2
void SetGender(int g)
Definition: Biography.cs:473
Biography bio
Definition: Card.cs:44
void SetFeat(int id, int value=1, bool msg=false)
Definition: Chara.cs:9873
string GetIdPortraitCat()
Definition: Chara.cs:8118
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 2153 of file Chara.cs.

2154 {
2155 elements.ApplyElementMap(base.uid, SourceValueType.Chara, job.elementMap, base.DefaultLV, remove, applyFeat: true);
2156 if (IsPCC)
2157 {
2158 EClass.game.uniforms.Apply(pccData, job.id, base.IsMale, canUseOtherGender: true);
2159 }
2160 }
SourceValueType
SourceJob.Row job
Definition: Chara.cs:466
void ApplyElementMap(int uid, SourceValueType type, Dictionary< int, int > map, int lv, bool invert=false, bool applyFeat=false)
PCCUniformManager uniforms
Definition: Game.cs:194

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

2240 {
2241 string[] array = race.figure.Split('|');
2242 foreach (string s in array)
2243 {
2244 int num = ParseBodySlot(s);
2245 if (num != -1)
2246 {
2247 if (remove)
2248 {
2249 body.RemoveBodyPart(num);
2250 }
2251 else
2252 {
2253 body.AddBodyPart(num);
2254 }
2255 }
2256 }
2258 elements.ApplyElementMap(base.uid, SourceValueType.Chara, race.elementMap, base.DefaultLV, remove, applyFeat: true);
2259 }
void RefreshBodyParts()
Definition: CharaBody.cs:294
void RemoveBodyPart(int ele)
Definition: CharaBody.cs:323
int ParseBodySlot(string s)
Definition: Chara.cs:2174

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

Referenced by ChangeRace(), and OnCreate().

◆ Banish()

void Chara.Banish ( Chara  owner)
inline

Definition at line 2330 of file Chara.cs.

2331 {
2332 owner?.Say("summon_vanish", this);
2333 pos.PlayEffect("vanish");
2334 pos.PlaySound("vanish");
2335 pos.PlayEffect("teleport");
2336 Destroy();
2337 }
void Destroy()
Definition: Card.cs:5070
SoundSource PlaySound(string id, bool synced=true, float v=1f, bool spatial=true)
Definition: Point.cs:1253
Effect PlayEffect(string id)
Definition: Point.cs:1248

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

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

◆ CalcBurden()

void Chara.CalcBurden ( )
inline

Definition at line 1827 of file Chara.cs.

1828 {
1829 int num = base.ChildrenWeight * 100 / Mathf.Max(1, WeightLimit);
1830 if (num < 0)
1831 {
1832 num = 1000;
1833 }
1835 {
1836 num = 0;
1837 }
1838 burden.Set(num);
1839 SetDirtySpeed();
1840 }
override int WeightLimit
Definition: Chara.cs:710
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 6169 of file Chara.cs.

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

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

2008 {
2009 int num = base.END;
2010 int num2 = 0;
2011 foreach (Element value in elements.dict.Values)
2012 {
2013 if (value.source.category == "skill")
2014 {
2015 num = ((!IsPC) ? (num + Mathf.Max(value.ValueWithoutLink, 0)) : (num + Mathf.Max(value.vBase, 0)));
2016 }
2017 }
2018 num2 = EClass.curve(num, 30, 10, 60);
2019 if (num2 < 10)
2020 {
2021 num2 = 10;
2022 }
2023 _maxStamina = num2 + 15;
2024 }
int _maxStamina
Definition: Chara.cs:365
static int curve(int _a, int start, int step, int rate=75)
Definition: EClass.cs:69
int ValueWithoutLink
Definition: ELEMENT.cs:294
int vBase
Definition: ELEMENT.cs:252

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

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

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

Referenced by DoHostileAction().

◆ CanAcceptGift()

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

Definition at line 8206 of file Chara.cs.

8207 {
8208 if (things.IsFull())
8209 {
8210 return false;
8211 }
8212 if (t.c_isImportant)
8213 {
8214 return false;
8215 }
8216 if (t.id == "1084")
8217 {
8218 return true;
8219 }
8220 if (t.trait is TraitBookExp)
8221 {
8222 return true;
8223 }
8224 if (t.trait.CanOnlyCarry || !t.trait.CanBeDestroyed || t.trait.CanExtendBuild || t.rarity == Rarity.Artifact || t.IsContainer)
8225 {
8226 return false;
8227 }
8228 return true;
8229 }
Rarity
Definition: Rarity.cs:2
string id
Definition: Card.cs:35
Rarity rarity
Definition: Card.cs:314
bool c_isImportant
Definition: Card.cs:1024
ThingContainer things
Definition: Card.cs:38
bool IsContainer
Definition: Card.cs:2089
bool IsFull(int y=0)
virtual bool CanExtendBuild
Definition: Trait.cs:170
virtual bool CanBeDestroyed
Definition: Trait.cs:296
virtual bool CanOnlyCarry
Definition: Trait.cs:294

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

Definition at line 8185 of file Chara.cs.

8186 {
8188 {
8189 return true;
8190 }
8191 if (!IsValidGiftWeight(t, num))
8192 {
8193 return false;
8194 }
8195 if (t.c_isImportant)
8196 {
8197 return false;
8198 }
8199 if ((t.category.IsChildOf("furniture") || t.category.IsChildOf("junk")) && !HasElement(1411))
8200 {
8201 return false;
8202 }
8203 return true;
8204 }
SourceCategory.Row category
Definition: Card.cs:2049
bool IsValidGiftWeight(Card t, int num=-1)
Definition: Chara.cs:8175

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

4261 {
4262 return true;
4263 }

◆ CanBeTempAlly()

bool Chara.CanBeTempAlly ( Chara  c)
inline

Definition at line 2317 of file Chara.cs.

2318 {
2319 if (IsPCFaction || IsGlobal || IsMinion || IsMultisize || EClass._zone.CountMinions(c) > c.MaxSummon || base.rarity >= Rarity.Legendary)
2320 {
2321 return false;
2322 }
2323 if (HasElement(1222))
2324 {
2325 return false;
2326 }
2327 return true;
2328 }
override bool IsMinion
Definition: Chara.cs:627
int MaxSummon
Definition: Chara.cs:714
override bool IsMultisize
Definition: Chara.cs:706
int CountMinions(Chara c)
Definition: Zone.cs:3733

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

8639 {
8640 if (IsPC || base.isScaled || HasElement(1273))
8641 {
8642 return false;
8643 }
8644 if (!EClass.debug.godMode)
8645 {
8646 if (base.c_daysWithPC > 360)
8647 {
8648 return affinity.CanSleepBeside();
8649 }
8650 return false;
8651 }
8652 return true;
8653 }
bool CanSleepBeside()
Definition: Affinity.cs:77
Affinity affinity
Definition: Chara.cs:314
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 2410 of file Chara.cs.

2411 {
2412 if (!IsMultisize)
2413 {
2414 if (base.rarity >= Rarity.Superior && !base.IsPCFactionOrMinion && ai is GoalCombat && !EClass._zone.IsPCFaction)
2415 {
2416 return !(EClass._zone is Zone_Town);
2417 }
2418 return false;
2419 }
2420 return true;
2421 }

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

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

◆ CanDuplicate()

bool Chara.CanDuplicate ( )
inline

Definition at line 1758 of file Chara.cs.

1759 {
1760 if (EClass._zone.IsRegion || HasCondition<ConPoison>() || HasCondition<ConConfuse>() || HasCondition<ConDim>() || HasCondition<ConParalyze>() || HasCondition<ConSleep>() || HasCondition<ConBurning>() || HasCondition<ConFreeze>() || HasCondition<ConMiasma>() || corruption >= 100)
1761 {
1762 return false;
1763 }
1765 {
1766 return false;
1767 }
1768 string text = id;
1769 if (!(text == "mech_scarab"))
1770 {
1771 if (text == "spider_queen" && (pos.cell.light > 0 || pos.IsSunLit))
1772 {
1773 return false;
1774 }
1775 }
1776 else if (isSynced || pos.cell.light > 0 || (!EClass._map.IsIndoor && !pos.cell.HasRoof && !EClass.world.date.IsNight))
1777 {
1778 return false;
1779 }
1780 return true;
1781 }
byte light
Definition: Cell.cs:60
bool HasRoof
Definition: Cell.cs:648
int corruption
Definition: Chara.cs:377
int CurrentGeneSlot
Definition: Chara.cs:1071
bool IsNight
Definition: Date.cs:112
GamePrincipal principal
Definition: Game.cs:224
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 7588 of file Chara.cs.

7589 {
7590 if (t.IsDecayed && !HasElement(480))
7591 {
7592 return false;
7593 }
7594 if (HasElement(1250) && !t.HasElement(710))
7595 {
7596 return false;
7597 }
7598 if (shouldEat && (!(t.trait is TraitFoodPrepared) || t.c_isImportant))
7599 {
7600 return false;
7601 }
7602 if (!t.IsNegativeGift && !t.HasTag(CTAG.ignoreUse) && !t.isEquipped)
7603 {
7604 return t.trait.CanEat(this);
7605 }
7606 return false;
7607 }
CTAG
Definition: CTAG.cs:2
bool IsNegativeGift
Definition: Card.cs:2396
bool IsDecayed
Definition: Card.cs:2287
bool HasTag(CTAG tag)
Definition: Card.cs:2595
bool isEquipped
Definition: Thing.cs:17
virtual bool CanEat(Chara c)
Definition: Trait.cs:979

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

7761 {
7762 return !body.IsTooHeavyToEquip(t);
7763 }
bool IsTooHeavyToEquip(Thing thing)
Definition: CharaBody.cs:160

References CharaBody.IsTooHeavyToEquip().

Referenced by GoalAutoCombat.TryUseRanged().

◆ CanInsult()

bool Chara.CanInsult ( )
inline

Definition at line 8106 of file Chara.cs.

8107 {
8108 foreach (ActList.Item item in ability.list.items)
8109 {
8110 if (item.act.id == 6630)
8111 {
8112 return true;
8113 }
8114 }
8115 return false;
8116 }
List< Item > items
Definition: ActList.cs:14
ActList list
Definition: CharaAbility.cs:12
CharaAbility ability
Definition: Chara.cs:424

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

◆ CanInteractTo() [1/2]

bool Chara.CanInteractTo ( Card  c)
inline

Definition at line 2517 of file Chara.cs.

2518 {
2519 return CanInteractTo(c.pos);
2520 }
bool CanInteractTo(Card c)
Definition: Chara.cs:2517

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

2523 {
2524 if (!p.IsValid)
2525 {
2526 return false;
2527 }
2528 if (EClass._map.cells[p.x, p.z].blocked)
2529 {
2530 return true;
2531 }
2532 if (!IsMultisize)
2533 {
2534 int num = ((p.z >= pos.z) ? ((p.x > pos.x) ? 1 : ((p.z > pos.z) ? 2 : 3)) : 0);
2535 if (EClass._map.cells[pos.x, pos.z].weights[num] == 0)
2536 {
2537 return false;
2538 }
2539 if (p.x != pos.x && p.z != pos.z)
2540 {
2541 Cell[,] cells = EClass._map.cells;
2542 int x = p.x;
2543 int z = pos.z;
2544 int num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2545 if (cells[pos.x, pos.z].weights[num2] == 0)
2546 {
2547 return false;
2548 }
2549 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2550 if (cells[p.x, p.z].weights[num2] == 0)
2551 {
2552 return false;
2553 }
2554 x = pos.x;
2555 z = p.z;
2556 num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2557 if (cells[pos.x, pos.z].weights[num2] == 0)
2558 {
2559 return false;
2560 }
2561 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2562 if (cells[p.x, p.z].weights[num2] == 0)
2563 {
2564 return false;
2565 }
2566 }
2567 }
2568 return true;
2569 }
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 4255 of file Chara.cs.

4256 {
4257 return true;
4258 }

◆ CanMoveTo()

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

Definition at line 2423 of file Chara.cs.

2424 {
2425 if (!p.IsValid)
2426 {
2427 return false;
2428 }
2429 int num = ((p.z >= pos.z) ? ((p.x > pos.x) ? 1 : ((p.z > pos.z) ? 2 : 3)) : 0);
2430 if (allowDestroyPath && CanDestroyPath())
2431 {
2432 if (!p.IsInBounds)
2433 {
2434 return false;
2435 }
2436 }
2437 else
2438 {
2439 if (EClass._map.cells[p.x, p.z].blocked || EClass._map.cells[pos.x, pos.z].weights[num] == 0)
2440 {
2441 return false;
2442 }
2443 if (p.x != pos.x && p.z != pos.z)
2444 {
2445 Cell[,] cells = EClass._map.cells;
2446 int x = p.x;
2447 int z = pos.z;
2448 int num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2449 if (cells[pos.x, pos.z].weights[num2] == 0)
2450 {
2451 return false;
2452 }
2453 if (cells[x, z].blocked)
2454 {
2455 return false;
2456 }
2457 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2458 if (cells[p.x, p.z].weights[num2] == 0)
2459 {
2460 return false;
2461 }
2462 x = pos.x;
2463 z = p.z;
2464 num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2465 if (cells[pos.x, pos.z].weights[num2] == 0)
2466 {
2467 return false;
2468 }
2469 if (cells[x, z].blocked)
2470 {
2471 return false;
2472 }
2473 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2474 if (cells[p.x, p.z].weights[num2] == 0)
2475 {
2476 return false;
2477 }
2478 }
2479 }
2480 if (IsPC)
2481 {
2482 if (IsEnemyOnPath(p))
2483 {
2484 return false;
2485 }
2486 }
2487 else if (p.HasChara && !IsMultisize && !CanReplace(p.FirstChara))
2488 {
2489 return false;
2490 }
2491 return true;
2492 }
bool IsEnemyOnPath(Point p, bool cancelAI=true)
Definition: Chara.cs:2494
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 4265 of file Chara.cs.

4266 {
4267 if (c.isDestroyed)
4268 {
4269 return false;
4270 }
4271 Card rootCard = c.GetRootCard();
4272 if (rootCard.isDestroyed || (rootCard.ExistsOnMap && rootCard.pos.Distance(pos) > 1))
4273 {
4274 return false;
4275 }
4276 if (rootCard != this && things.IsFull(c.Thing))
4277 {
4278 return false;
4279 }
4280 return true;
4281 }
bool isDestroyed
Definition: Card.cs:75
bool ExistsOnMap
Definition: Card.cs:2085
virtual Thing Thing
Definition: Card.cs:2058
Card GetRootCard()
Definition: Card.cs:3426

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

3284 {
3286 {
3287 return false;
3288 }
3289 if (IsPC)
3290 {
3291 return true;
3292 }
3293 if (c.IsPC || c.pos.Equals(EClass.pc.pos) || c.host != null)
3294 {
3295 return false;
3296 }
3297 if (!IsHostile(c))
3298 {
3299 if (c.c_uidMaster != 0 || c.isSummon || base.IsPowerful || IsEscorted())
3300 {
3301 return true;
3302 }
3303 if (DestDist < c.DestDist)
3304 {
3305 return true;
3306 }
3307 if (IsPCParty && !c.IsPCParty)
3308 {
3309 return true;
3310 }
3311 if (IsPCFaction && !c.IsPCParty)
3312 {
3313 return true;
3314 }
3315 }
3316 return false;
3317 }
bool IsPCFactionOrMinion
Definition: Card.cs:2272
bool isSummon
Definition: Card.cs:710
int c_uidMaster
Definition: Card.cs:1449
bool noMove
Definition: Card.cs:770
new TraitChara trait
Definition: Chara.cs:503
override bool IsPCParty
Definition: Chara.cs:615
int DestDist
Definition: Chara.cs:998
bool IsHostile()
Definition: Chara.cs:6526
bool IsEscorted()
Definition: Chara.cs:2394
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 5110 of file Chara.cs.

5111 {
5112 return EClass.world.date.IsExpired(base.c_dateDeathLock);
5113 }
bool IsExpired(int time)
Definition: Date.cs:336

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

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

◆ CanSee()

bool Chara.CanSee ( Card  c)
inline

Definition at line 1218 of file Chara.cs.

1219 {
1220 if (c == this)
1221 {
1222 return true;
1223 }
1224 if (!c.pos.IsValid)
1225 {
1226 return false;
1227 }
1228 if (c.isChara)
1229 {
1231 {
1232 return true;
1233 }
1234 if (c.isHidden && c != this && !canSeeInvisible)
1235 {
1236 return false;
1237 }
1238 }
1239 if (IsPC)
1240 {
1241 if (fov != null)
1242 {
1243 return fov.lastPoints.ContainsKey(c.pos.index);
1244 }
1245 return false;
1246 }
1247 return true;
1248 }
virtual Chara Chara
Definition: Card.cs:2070
Fov fov
Definition: Card.cs:57
virtual bool isChara
Definition: Card.cs:2083
bool isHidden
Definition: Card.cs:530
bool canSeeInvisible
Definition: Chara.cs:138
bool visibleWithTelepathy
Definition: Chara.cs:150
bool hasTelepathy
Definition: Chara.cs:140
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 1259 of file Chara.cs.

1260 {
1261 if (dist == -1)
1262 {
1263 dist = pos.Distance(p);
1264 }
1265 if (dist > GetSightRadius())
1266 {
1267 return false;
1268 }
1269 if (IsPC)
1270 {
1271 if (fov != null)
1272 {
1273 return fov.lastPoints.ContainsKey(p.index);
1274 }
1275 return false;
1276 }
1277 return Los.IsVisible(pos, p);
1278 }
int GetSightRadius()
Definition: Card.cs:6415
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 1201 of file Chara.cs.

1202 {
1203 if (!p.IsValid || p.IsHidden)
1204 {
1205 return false;
1206 }
1207 if (IsPC)
1208 {
1209 if (fov != null)
1210 {
1211 return fov.lastPoints.ContainsKey(p.index);
1212 }
1213 return false;
1214 }
1215 return true;
1216 }
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 1299 of file Chara.cs.

1300 {
1301 if (EClass._zone.events.GetEvent<ZoneEventQuest>() != null)
1302 {
1303 return false;
1304 }
1305 if (!EClass.debug.godMode && sleepiness.GetPhase() == 0)
1306 {
1307 return stamina.GetPhase() <= 1;
1308 }
1309 return true;
1310 }
Stats sleepiness
Definition: Chara.cs:1156
Stats stamina
Definition: Chara.cs:1146
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 2162 of file Chara.cs.

2163 {
2164 ApplyJob(remove: true);
2165 base.c_idJob = idNew;
2166 _job = null;
2167 ApplyJob();
2168 if (IsPCC)
2169 {
2170 PCC.Get(pccData).Build();
2171 }
2172 }
void ApplyJob(bool remove=false)
Definition: Chara.cs:2153
SourceJob.Row _job
Definition: Chara.cs:162

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

7028 {
7029 memberType = type;
7030 }
FactionMemberType memberType
Definition: Chara.cs:46

◆ ChangeRace()

void Chara.ChangeRace ( string  idNew)
inline

Definition at line 2261 of file Chara.cs.

2262 {
2263 ApplyRace(remove: true);
2264 base.c_idRace = idNew;
2265 _race = null;
2266 ApplyRace();
2267 ChangeMaterial(source.defMat.IsEmpty(race.material));
2268 }
@ ChangeMaterial
void ApplyRace(bool remove=false)
Definition: Chara.cs:2239
SourceRace.Row _race
Definition: Chara.cs:160

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

1407 {
1408 if (r != base.rarity)
1409 {
1410 base.rarity = r;
1411 if (renderer != null && renderer.isSynced)
1412 {
1414 }
1415 base.hp = MaxHP;
1416 }
1417 }
void RefreshExtra()

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

Referenced by ZonePreEnterBout.Execute().

◆ ChooseNewGoal()

void Chara.ChooseNewGoal ( )
inline

Definition at line 8745 of file Chara.cs.

8746 {
8747 if (IsPC && EClass.AdvMode)
8748 {
8749 SetNoGoal();
8750 return;
8751 }
8752 if (IsPCParty || base.noMove)
8753 {
8754 SetAI(new GoalIdle());
8755 return;
8756 }
8757 if ((IsHomeMember() && IsInHomeZone()) || IsGuest())
8758 {
8759 Goal goalFromTimeTable = GetGoalFromTimeTable(EClass.world.date.hour);
8760 if (goalFromTimeTable != null)
8761 {
8762 SetAI(goalFromTimeTable);
8763 if (goalFromTimeTable is GoalWork)
8764 {
8765 goalFromTimeTable.Tick();
8766 }
8767 return;
8768 }
8769 }
8770 if (goalList.index == -2)
8771 {
8773 }
8774 SetAI(goalList.Next());
8775 }
Status Tick()
Definition: AIAct.cs:352
Goal GetGoalFromTimeTable(int hour)
Definition: Chara.cs:8777
GoalListType goalListType
Definition: Chara.cs:279
AIAct SetNoGoal()
Definition: Chara.cs:8869
bool IsHomeMember()
Definition: Chara.cs:6588
bool IsGuest()
Definition: Chara.cs:6613
GoalList goalList
Definition: Chara.cs:200
bool IsInHomeZone()
Definition: Chara.cs:6593
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 7295 of file Chara.cs.

7296 {
7297 if (map == null)
7298 {
7299 map = EClass._map;
7300 }
7301 foreach (Card item in map.props.installed.all)
7302 {
7303 if (item.trait is TraitBed traitBed && traitBed.IsHolder(this))
7304 {
7305 traitBed.RemoveHolder(this);
7306 }
7307 }
7308 }
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 8517 of file Chara.cs.

8518 {
8519 int num = 0;
8520 for (int num2 = things.Count - 1; num2 >= 0; num2--)
8521 {
8522 Thing thing = things[num2];
8523 if (ShouldThrowAway(thing, type))
8524 {
8525 num += thing.GetPrice(CurrencyType.Money, sell: true, PriceType.Default, this) * thing.Num;
8526 thing.Destroy();
8527 }
8528 }
8529 if (num > 0)
8530 {
8531 ModCurrency(num);
8532 if (type == ClearInventoryType.SellAtTown)
8533 {
8534 Msg.Say("party_sell", this, num.ToString() ?? "");
8535 PlaySound("pay");
8536 }
8537 }
8538 }
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:7270
int Num
Definition: Card.cs:158
bool ShouldThrowAway(Thing t, ClearInventoryType type)
Definition: Chara.cs:8446

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

10350 {
10351 if (tempElements != null)
10352 {
10354 tempElements = null;
10355 }
10356 }
ElementContainer tempElements
Definition: Chara.cs:36
void SetParent(Card c)

References ElementContainer.SetParent().

◆ CountDebuff()

int Chara.CountDebuff ( )
inline

Definition at line 9434 of file Chara.cs.

9435 {
9436 int num = 0;
9437 foreach (Condition condition in conditions)
9438 {
9439 if (condition.Type == ConditionType.Debuff)
9440 {
9441 num++;
9442 }
9443 }
9444 return num;
9445 }

References BaseStats.Type.

Referenced by GoalCombat.TryUseAbility().

◆ CountNumEaten()

int Chara.CountNumEaten ( Thing  food)
inline

Definition at line 10155 of file Chara.cs.

10156 {
10157 if (_historyFood == null)
10158 {
10159 return -1;
10160 }
10161 int num = 0;
10162 foreach (List<string> item in _historyFood)
10163 {
10164 foreach (string item2 in item)
10165 {
10166 if (item2 == food.id)
10167 {
10168 num++;
10169 }
10170 }
10171 }
10172 return num;
10173 }

References food, and item.

Referenced by FoodEffect.Proc().

◆ CreateReplacement()

Chara Chara.CreateReplacement ( )
inline

Definition at line 8009 of file Chara.cs.

8010 {
8011 Chara chara = CharaGen.Create(id);
8012 chara.c_originalHostility = base.c_originalHostility;
8013 if (chara.c_originalHostility != 0)
8014 {
8015 chara.hostility = chara.c_originalHostility;
8016 }
8017 if (orgPos != null)
8018 {
8019 chara.orgPos = orgPos.Copy();
8020 }
8021 chara.pos = pos.Copy();
8022 chara.isImported = true;
8023 chara.c_editorTags = base.c_editorTags;
8024 chara.c_editorTraitVal = base.c_editorTraitVal;
8025 chara.c_idTrait = base.c_idTrait;
8026 chara.homeZone = homeZone;
8027 return chara;
8028 }
Hostility c_originalHostility
Definition: Card.cs:976
static Chara Create(string id, int lv=-1)
Definition: CharaGen.cs:17
Zone homeZone
Definition: Chara.cs:267
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 6261 of file Chara.cs.

6262 {
6263 Talk("goodBoy");
6264 Say(headpat ? "headpat" : "cuddle", this, c);
6265 c.ShowEmo(Emo.love);
6266 if (EClass.rnd(IsPC ? 100 : 5000) == 0)
6267 {
6268 c.MakeEgg();
6269 }
6270 if (headpat && this != c)
6271 {
6272 if (c.interest > 0)
6273 {
6274 c.ModAffinity(EClass.pc, 1 + EClass.rnd(3));
6275 c.interest -= 20 + EClass.rnd(10);
6276 }
6278 {
6279 foreach (Chara member in party.members)
6280 {
6281 if (!member.IsPC && CanSeeLos(member))
6282 {
6283 member.AddCondition<ConEuphoric>(100 + Evalue(6904) * 5);
6284 }
6285 }
6286 }
6287 }
6288 if (c.Evalue(1221) > 0)
6289 {
6290 int ele = ((c.MainElement == Element.Void) ? 924 : c.MainElement.id);
6291 if (c.id == "hedgehog_ether")
6292 {
6293 ele = 922;
6294 }
6295 Say("reflect_thorne", c, this);
6296 DamageHP(10L, ele, Power, AttackSource.Condition);
6297 }
6298 }
Emo
Definition: Emo.cs:2
virtual int Power
Definition: Card.cs:2295
void ShowEmo(Emo _emo=Emo.none, float duration=0f, bool skipSame=true)
Definition: Card.cs:6133
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
Definition: Card.cs:5727
Element MainElement
Definition: Chara.cs:717
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Definition: Chara.cs:7931
int interest
Definition: Chara.cs:317
Religion faith
Definition: Chara.cs:439
static Element Void
Definition: ELEMENT.cs:238
ReligionManager religions
Definition: Game.cs:158
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 9497 of file Chara.cs.

9498 {
9499 bool flag = state == BlessedState.Blessed;
9500 switch (type)
9501 {
9502 case CureType.Heal:
9503 case CureType.Prayer:
9504 CureCondition<ConFear>();
9505 CureCondition<ConBlind>(2 * p / 100 + 5);
9506 CureCondition<ConPoison>(5 * p / 100 + 5);
9507 CureCondition<ConConfuse>(10 * p / 100 + 10);
9508 CureCondition<ConDim>(p / 100 + 5);
9509 CureCondition<ConBleed>(2 * p / 100 + 10);
9510 if (flag)
9511 {
9512 SAN.Mod(-15);
9513 }
9514 break;
9515 case CureType.CureBody:
9516 CureCondition<ConBlind>(5 * p / 100 + 15);
9517 CureCondition<ConPoison>(10 * p / 100 + 15);
9518 CureCondition<ConBleed>(5 * p / 100 + 20);
9519 CureTempElements(p, body: true, mind: false);
9520 break;
9521 case CureType.CureMind:
9522 CureCondition<ConFear>();
9523 CureCondition<ConDim>(3 * p / 100 + 10);
9524 CureTempElements(p, body: false, mind: true);
9525 break;
9526 case CureType.Sleep:
9527 {
9528 for (int num2 = conditions.Count - 1; num2 >= 0; num2--)
9529 {
9530 Condition condition2 = conditions[num2];
9531 if (!(condition2 is ConSleep) && !(condition2 is ConFaint))
9532 {
9533 if (condition2.isPerfume)
9534 {
9535 condition2.Mod(-1, force: true);
9536 }
9537 else if (condition2.Type == ConditionType.Bad || condition2.Type == ConditionType.Debuff)
9538 {
9539 condition2.Kill();
9540 }
9541 }
9542 }
9543 CureCondition<ConWait>();
9544 CureCondition<ConDisease>((EClass.rnd(20) + 10) * p / 100);
9545 bool flag3 = HasCondition<ConAnorexia>();
9546 base.c_vomit -= (flag3 ? 3 : 2) * p / 100;
9547 if (base.c_vomit < 0)
9548 {
9549 base.c_vomit = 0;
9550 if (flag3)
9551 {
9552 RemoveCondition<ConAnorexia>();
9553 }
9554 }
9555 break;
9556 }
9557 case CureType.HealComplete:
9558 case CureType.Death:
9559 case CureType.Jure:
9560 case CureType.Boss:
9561 {
9562 bool flag2 = type == CureType.Death;
9563 CureTempElements(p * 100, body: true, mind: true);
9564 for (int num = conditions.Count - 1; num >= 0; num--)
9565 {
9566 Condition condition = conditions[num];
9567 if (condition is ConAnorexia && !flag2)
9568 {
9569 continue;
9570 }
9571 switch (condition.Type)
9572 {
9573 case ConditionType.Bad:
9574 case ConditionType.Debuff:
9575 case ConditionType.Disease:
9576 condition.Kill();
9577 continue;
9578 case ConditionType.Stance:
9579 if (flag2)
9580 {
9581 condition.Kill();
9582 continue;
9583 }
9584 break;
9585 }
9586 if (flag2 && condition.isPerfume)
9587 {
9588 condition.Kill();
9589 }
9590 }
9591 CureCondition<ConWait>();
9592 CureCondition<ConSleep>();
9593 if (flag2 || type == CureType.Boss)
9594 {
9595 SAN.Mod(-20);
9596 RemoveCondition<ConBrightnessOfLife>();
9597 }
9598 if (type == CureType.Jure)
9599 {
9600 SAN.Mod(-999);
9601 if (HasElement(1206))
9602 {
9603 SetFeat(1206, 0, msg: true);
9604 }
9605 }
9606 break;
9607 }
9608 }
9609 }
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:10319
Stats SAN
Definition: Chara.cs:1158
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 9447 of file Chara.cs.

9447 : Condition
9448 {
9449 T condition = GetCondition<T>();
9450 if (condition != null)
9451 {
9452 condition.value -= v;
9453 if (condition.value <= 0)
9454 {
9455 condition.Kill();
9456 }
9457 }
9458 }
T GetCondition< T >()
Definition: Chara.cs:9460

◆ CureHost()

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

Definition at line 9484 of file Chara.cs.

9485 {
9486 if (parasite != null)
9487 {
9488 parasite.Cure(type, p, state);
9489 }
9490 if (ride != null)
9491 {
9492 ride.Cure(type, p, state);
9493 }
9494 Cure(type, p, state);
9495 }
void Cure(CureType type, int p=100, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:9497

References Cure().

Referenced by FactionBranch.DailyOutcome().

◆ CureTempElements()

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

Definition at line 10319 of file Chara.cs.

10320 {
10321 if (tempElements != null)
10322 {
10323 if (body)
10324 {
10326 }
10327 if (mind)
10328 {
10330 }
10331 }
10332 void Cure(int[] eles)
10333 {
10334 foreach (int ele in eles)
10335 {
10336 if (tempElements == null)
10337 {
10338 break;
10339 }
10340 Element element = tempElements.GetElement(ele);
10341 if (element != null && element.vBase < 0)
10342 {
10343 ModTempElement(ele, Mathf.Clamp(p / 20 + EClass.rnd(p / 20), 1, -element.vBase));
10344 }
10345 }
10346 }
10347 }
void ModTempElement(int ele, int a, bool naturalDecay=false, bool onlyRenew=false)
Definition: Chara.cs:10227
Element GetElement(string alias)
static int[] List_Body
Definition: ELEMENT.cs:244
static int[] List_Mind
Definition: ELEMENT.cs:246

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

10286 {
10287 ModTempElement(ele, onlyRenew ? (-p / 20) : (-(p / 100 + EClass.rnd(p / 100 + 1) + 1)), naturalDecay: false, onlyRenew);
10288 }

References EClass.rnd().

◆ DamageTempElements()

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

Definition at line 10273 of file Chara.cs.

10274 {
10275 if (body)
10276 {
10277 DamageTempElement(Element.List_Body.RandomItem(), p, onlyRenew);
10278 }
10279 if (mind)
10280 {
10281 DamageTempElement(Element.List_Mind.RandomItem(), p, onlyRenew);
10282 }
10283 }
void DamageTempElement(int ele, int p, bool onlyRenew=false)
Definition: Chara.cs:10285

References Element.List_Body, and Element.List_Mind.

◆ DestroyPath()

void Chara.DestroyPath ( Point  pos)
inline

Definition at line 3172 of file Chara.cs.

3173 {
3174 bool broke = false;
3175 pos.ForeachMultiSize(base.W, base.H, delegate(Point _p, bool main)
3176 {
3177 if (_p.IsValid)
3178 {
3179 if (_p.HasBlock)
3180 {
3181 EClass._map.MineBlock(_p, recoverBlock: false, this);
3182 if (_p.HasObj)
3183 {
3184 EClass._map.MineObj(_p, null, this);
3185 }
3186 broke = true;
3187 }
3188 if (_p.HasObj && _p.IsBlocked)
3189 {
3190 EClass._map.MineObj(_p, null, this);
3191 broke = true;
3192 }
3193 _p.Things.ForeachReverse(delegate(Thing t)
3194 {
3195 if (t.IsInstalled && (t.trait.IsBlockPath || t.trait.IsDoor))
3196 {
3197 if (t.isNPCProperty && t.trait.CanBeDestroyed)
3198 {
3199 t.Destroy();
3200 }
3201 else if (!t.IsUnique && !t.trait.CanBeDestroyed)
3202 {
3203 t.SetPlaceState(PlaceState.roaming);
3204 }
3205 }
3206 });
3207 }
3208 });
3209 if (broke)
3210 {
3211 Msg.Say("stomp");
3212 Shaker.ShakeCam("stomp");
3213 }
3214 }
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
bool IsUnique
Definition: Card.cs:2091
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:53
virtual bool IsDoor
Definition: Trait.cs:57

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

5306 {
5307 combatCount = 0;
5308 if (isDead || host != null)
5309 {
5310 return;
5311 }
5312 bool isInActiveZone = IsInActiveZone;
5313 if (isInActiveZone)
5314 {
5315 if (IsPC)
5316 {
5318 }
5319 if (base.isSummon)
5320 {
5321 if (id == "tsunami")
5322 {
5323 pos.PlaySound("water");
5324 }
5325 else
5326 {
5327 Say("summon_vanish", this);
5328 pos.PlayEffect("vanish");
5329 pos.PlaySound("vanish");
5330 }
5331 Destroy();
5332 return;
5333 }
5334 if (attackSource == AttackSource.DeathSentense)
5335 {
5336 if (trait is TraitLittleOne)
5337 {
5338 MakeEgg();
5339 if (IsPCFaction)
5340 {
5342 }
5343 }
5344 PlayEffect("revive");
5345 PlaySound("chime_angel");
5346 }
5347 else
5348 {
5349 Effect.Get("blood").Play((parent is Chara) ? (parent as Chara).pos : pos).SetParticleColor(EClass.Colors.matColors[base.material.alias].main)
5350 .Emit(50);
5351 AddBlood(AI_Slaughter.slaughtering ? 12 : (2 + EClass.rnd(2)));
5352 PlaySound(base.material.GetSoundDead(source));
5353 }
5356 ClearFOV();
5357 }
5358 string text = "";
5359 "dead_in".langGame(EClass._zone.Name);
5360 string text2 = ((origin == null) ? "" : origin.GetName(NameStyle.Full));
5361 if (LangGame.Has("dead_" + attackSource))
5362 {
5363 text = "dead_" + attackSource;
5364 }
5365 else
5366 {
5367 if (e != Element.Void && e != null)
5368 {
5369 text = "dead_" + e.source.alias;
5370 }
5371 if (text == "" || !LangGame.Has(text))
5372 {
5373 text = "dead";
5374 }
5375 }
5376 if (IsPC)
5377 {
5378 EClass._zone.isDeathLocation = true;
5379 string s = ((origin == null) ? text : "dead_by");
5381 if (attackSource == AttackSource.Wrath)
5382 {
5384 }
5385 EClass.player.deathMsg = GameLang.Parse(s.langGame(), thirdPerson: true, EClass.pc.NameBraced, "dead_in".langGame(EClass._zone.Name), text2);
5387 if (EClass._zone.instance is ZoneInstanceRandomQuest zoneInstanceRandomQuest)
5388 {
5389 zoneInstanceRandomQuest.status = ZoneInstance.Status.Fail;
5390 }
5391 AI_PlayMusic.keepPlaying = false;
5392 }
5393 if (isInActiveZone)
5394 {
5395 if (attackSource == AttackSource.DeathSentense)
5396 {
5397 Msg.Say("goto_heaven", this);
5398 }
5399 else
5400 {
5401 if (originalTarget != null || origin == null || !origin.isSynced || (attackSource != AttackSource.Melee && attackSource != AttackSource.Range))
5402 {
5403 Msg.Say(text, this, "", text2);
5404 }
5405 string text3 = TalkTopic("dead");
5406 if (!text3.IsEmpty())
5407 {
5408 text3 = text3.StripBrackets();
5409 }
5410 bool flag = base.rarity >= Rarity.Legendary && !IsPCFaction;
5411 if (!IsPC && flag)
5412 {
5413 MakeGrave(text3);
5414 }
5415 Msg.SetColor();
5416 SpawnLoot(origin);
5417 }
5418 if (IsPC)
5419 {
5421 }
5422 }
5423 if (IsPCFaction)
5424 {
5425 if (homeBranch != null)
5426 {
5427 homeBranch.Log(text, this, "");
5428 }
5429 WidgetPopText.Say("popDead".lang(base.Name), FontColor.Bad);
5430 if (!IsPC)
5431 {
5432 if (EClass.player.stats.allyDeath == 0)
5433 {
5434 Tutorial.Reserve("death_pet");
5435 }
5437 }
5438 }
5439 if (id == "mandrake" || HasElement(488))
5440 {
5441 Say("a_scream", this);
5442 ActEffect.ProcAt(EffectId.Scream, base.LV * 3 + 200, BlessedState.Normal, this, this, pos, isNeg: true);
5443 }
5444 daysStarved = 0;
5445 isDead = true;
5447 enemy = null;
5448 _cooldowns = null;
5449 base.isSale = false;
5450 SetInt(70);
5451 EClass._map.props.sales.Remove(this);
5452 Cure(CureType.Death);
5453 SetAI(new NoGoal());
5455 if (isInActiveZone && EClass._zone.HasLaw && IsHuman && OriginalHostility >= Hostility.Neutral)
5456 {
5457 pos.TalkWitnesses(origin?.Chara, "witness", 3, WitnessType.crime, (Chara c) => !c.IsPCParty && !c.IsUnique);
5458 }
5459 if (IsPC)
5460 {
5461 EClass.player.returnInfo = null;
5462 EClass.player.uidLastTravelZone = 0;
5463 foreach (Chara chara3 in EClass._map.charas)
5464 {
5465 if (chara3.IsHostile())
5466 {
5467 chara3.hostility = chara3.OriginalHostility;
5468 }
5469 if (chara3.enemy == EClass.pc)
5470 {
5471 chara3.enemy = null;
5472 }
5473 }
5474 if (EClass.pc.things.Find("letter_will") != null && EClass.rnd(10) == 0)
5475 {
5476 EClass.player.preventDeathPenalty = true;
5477 }
5478 }
5479 else
5480 {
5481 bool flag2 = currentZone.IsActiveZone && IsLocalChara && !currentZone.IsPCFaction;
5482 if (currentZone is Zone_LittleGarden && id == "littleOne")
5483 {
5484 flag2 = false;
5485 }
5486 if (flag2)
5487 {
5488 EClass._map.deadCharas.Add(this);
5489 }
5490 currentZone.RemoveCard(this);
5491 }
5492 if ((origin != null && origin.IsPCParty) || IsPCFaction)
5493 {
5494 int a = -10;
5495 if (IsPCFaction && !IsPCParty && (origin == null || !origin.IsPCParty))
5496 {
5497 a = -5;
5498 }
5499 ModAffinity(EClass.pc, a, show: false);
5500 string text4 = id;
5501 if (!(text4 == "quru"))
5502 {
5503 if (text4 == "corgon")
5504 {
5505 EClass.game.cards.globalCharas.Find("quru")?.ModAffinity(EClass.pc, -20, show: false);
5506 }
5507 }
5508 else
5509 {
5510 EClass.game.cards.globalCharas.Find("corgon")?.ModAffinity(EClass.pc, -20, show: false);
5511 }
5512 }
5513 if (origin != null)
5514 {
5515 if (origin.IsPCParty || origin.IsPCPartyMinion)
5516 {
5517 int num = 0;
5518 if (OriginalHostility >= Hostility.Friend && IsHuman && !base.IsPCFactionOrMinion)
5519 {
5520 num = -5;
5521 }
5522 else if (race.id == "cat" && OriginalHostility >= Hostility.Neutral)
5523 {
5524 EClass.pc.Say("killcat");
5525 num = -1;
5526 }
5527 if (EClass.pc.party.HasElement(1563) && num < 0)
5528 {
5529 num = num * 30 / 100;
5530 }
5531 if (num != 0)
5532 {
5533 EClass.player.ModKarma(num);
5534 }
5535 }
5536 if (origin == EClass.pc)
5537 {
5538 EClass.pc.faith.Revelation("kill", 10);
5539 }
5540 else if (origin.IsPCFaction)
5541 {
5542 origin.Chara.ModAffinity(EClass.pc, 1, show: false);
5543 origin.Chara.ShowEmo(Emo.love);
5544 }
5545 }
5546 if (base.sourceBacker != null && origin != null && origin.IsPCParty)
5547 {
5548 EClass.player.doneBackers.Add(base.sourceBacker.id);
5549 }
5550 if (base.IsPCFactionOrMinion)
5551 {
5553 {
5554 Msg.Say("abort_allyDead");
5555 }
5556 }
5558 {
5559 Msg.Say("abort_enemyDead");
5560 }
5561 if (IsPCParty && !IsPC)
5562 {
5564 base.c_wasInPcParty = true;
5565 EClass.pc.Say("allyDead");
5566 }
5567 switch (id)
5568 {
5569 case "littleOne":
5570 if (attackSource != AttackSource.DeathSentense && !IsPCFaction)
5571 {
5572 EClass.player.flags.little_killed = true;
5574 }
5575 break;
5576 case "big_daddy":
5577 if (!IsPCFaction)
5578 {
5579 Chara chara = CharaGen.Create("littleOne");
5580 EClass._zone.AddCard(chara, pos.Copy());
5581 Msg.Say("little_pop");
5583 }
5584 break;
5585 case "shark_sister":
5586 if (!IsPCFaction)
5587 {
5588 Chara t = CharaGen.Create("sister_shark");
5589 EClass._zone.AddCard(t, pos.Copy());
5590 Msg.Say("shark_pop");
5591 }
5592 break;
5593 }
5594 if (attackSource == AttackSource.Finish && origin != null && origin.Evalue(665) > 0)
5595 {
5596 Chara chara2 = CharaGen.CreateFromFilter("c_plant", base.LV);
5597 EClass._zone.AddCard(chara2, pos.Copy());
5598 if (chara2.LV < base.LV)
5599 {
5600 chara2.SetLv(base.LV);
5601 }
5602 chara2.MakeMinion((origin.IsPCParty || origin.IsPCPartyMinion) ? EClass.pc : origin.Chara, MinionType.Friend);
5603 Msg.Say("plant_pop", this, chara2);
5604 }
5606 }
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:485
Chara Find(string id)
Definition: CardManager.cs:20
GlobalCharaList globalCharas
Definition: CardManager.cs:46
void RefreshSprite()
virtual void RefreshStateIcon()
virtual string GetName(NameStyle style, int num=-1)
Definition: Card.cs:2615
void AddBlood(int a=1, int id=-1)
Definition: Card.cs:5980
virtual bool IsPCParty
Definition: Card.cs:2149
Card SetLv(int a)
Definition: Card.cs:2905
ICardParent parent
Definition: Card.cs:55
virtual bool IsPCPartyMinion
Definition: Card.cs:2153
void ClearFOV()
Definition: Card.cs:6584
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:6199
virtual bool IsPCFaction
Definition: Card.cs:2269
void SpawnLoot(Card origin)
Definition: Card.cs:5110
int LV
Definition: Card.cs:386
virtual bool isSynced
Definition: Card.cs:2087
static Chara CreateFromFilter(string id, int lv=-1, int levelRange=-1)
Definition: CharaGen.cs:22
int combatCount
Definition: Chara.cs:114
bool IsHuman
Definition: Chara.cs:879
int daysStarved
Definition: Chara.cs:329
void MakeMinion(Chara _master, MinionType type=MinionType.Default)
Definition: Chara.cs:2339
string NameBraced
Definition: Chara.cs:514
void ClearTempElements()
Definition: Chara.cs:10349
string TalkTopic(string topic="calm")
Definition: Chara.cs:6961
void TryDropBossLoot()
Definition: Chara.cs:5608
bool IsLocalChara
Definition: Chara.cs:841
Chara enemy
Definition: Chara.cs:86
bool IsInActiveZone
Definition: Chara.cs:838
void TryDropCarryOnly()
Definition: Chara.cs:4584
void MakeGrave(string lastword)
Definition: Chara.cs:5222
UD_String_MatData matColors
static ColorProfile Colors
Definition: EClass.cs:39
void RemoveMemeber(Chara c)
string Log(string idLang, string ref1=null, string ref2=null, string ref3=null, string ref4=null)
static string Parse(string text, bool thirdPerson, string val1, string val2=null, string val3=null, string val4=null)
Definition: GameLang.cs:141
ConfigAutoCombat autoCombat
Definition: Game.cs:93
CardManager cards
Definition: Game.cs:155
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:2516
Stats stats
Definition: Player.cs:1016
int little_dead
Definition: Player.cs:926
HashSet< int > doneBackers
Definition: Player.cs:1073
bool TryAbortAutoCombat(bool immediate=true)
Definition: Player.cs:2410
string deathMsg
Definition: Player.cs:1185
void TalkWitnesses(Chara criminal, string idTalk, int radius=4, WitnessType type=WitnessType.everyone, Func< Chara, bool > talkIf=null, int chance=3)
Definition: Point.cs:815
List< Card > sales
Definition: PropsManager.cs:14
static Religion recentWrath
Definition: Religion.cs:22
void Revelation(string idTalk, int chance=100)
Definition: Religion.cs:145
string NameShort
Definition: Religion.cs:34
Thing Find(int uid)
void Set(string n)
static void Reserve(string idStep, Action onBeforePlay=null)
Definition: Tutorial.cs:55
static void Say(string text, FontColor fontColor=FontColor.Default, Sprite sprite=null)
void OnCharaDie(Chara c)
virtual bool HasLaw
Definition: Zone.cs:229
void RemoveCard(Card t)
Definition: Zone.cs:2017
void ResetHostility()
Definition: Zone.cs:2688
ZoneInstance instance
Definition: Zone.cs:55

References EClass._map, EClass._zone, ConfigAutoCombat.abortOnAllyDead, ConfigAutoCombat.abortOnEnemyDead, Zone.AddCard(), AddCondition(), Player.Stats.allyDeath, Game.Config.autoCombat, Game.cards, Map.charas, EClass.Colors, Game.config, CharaGen.Create(), CharaGen.CreateFromFilter(), Map.deadCharas, Player.deathMsg, Debug, Player.doneBackers, enemy, Zone.events, faith, ThingContainer.Find(), CardManager.GlobalCharaList.Find(), EClass.game, Effect.Get(), CardManager.globalCharas, LangGame.Has(), Party.HasElement(), Zone.HasLaw, SourceRace.Row.id, Zone.instance, IsHostile(), IsPCParty, Card.IsUnique, Player.little_dead, FactionBranch.Log(), Card.LV, MakeMinion(), ColorProfile.matColors, ModAffinity(), Player.ModKarma(), Spatial.Name, NameBraced, Religion.NameShort, ZoneEventManager.OnCharaDie(), OriginalHostility, GameLang.Parse(), party, EClass.pc, Effect.Play(), EClass.player, ActEffect.ProcAt(), Map.props, Religion.recentWrath, 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(), and Element.Void.

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

◆ DiminishTempElements()

void Chara.DiminishTempElements ( int  a = 1)
inline

Definition at line 10304 of file Chara.cs.

10305 {
10306 if (tempElements == null)
10307 {
10308 return;
10309 }
10310 foreach (Element item in tempElements.dict.Values.ToList())
10311 {
10312 if (item.vBase > 0)
10313 {
10314 ModTempElement(item.id, -Mathf.Min(item.vBase * 5 / 100 + 1, item.vBase), naturalDecay: true);
10315 }
10316 }
10317 }

References ElementContainer.dict, and item.

◆ DoAI()

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

Definition at line 6249 of file Chara.cs.

6250 {
6251 SetAI(new DynamicAIAct("", delegate
6252 {
6253 onPerform();
6254 return true;
6255 })
6256 {
6257 wait = wait
6258 });
6259 }

◆ DoHostileAction()

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

Definition at line 6349 of file Chara.cs.

6350 {
6351 if (_tg == null || !_tg.isChara)
6352 {
6353 return;
6354 }
6355 Chara chara = _tg.Chara;
6356 if (chara.IsPC)
6357 {
6358 EClass.pc.combatCount = 10;
6359 }
6360 if (!chara.IsAliveInCurrentZone || !IsAliveInCurrentZone || chara == this)
6361 {
6362 return;
6363 }
6364 if ((IsPCFaction || IsPCFactionMinion) && (chara.IsPCFaction || chara.IsPCFactionMinion))
6365 {
6366 chara.Say("frown", this, chara);
6367 }
6368 else
6369 {
6370 if (EClass._zone.IsRegion)
6371 {
6372 return;
6373 }
6374 if (IsPC)
6375 {
6376 if (chara.IsFriendOrAbove() && !immediate)
6377 {
6378 chara.Say("frown", this, chara);
6379 chara.ShowEmo(Emo.sad);
6380 chara.hostility = Hostility.Neutral;
6381 return;
6382 }
6383 if (!chara.IsPCFaction && chara.hostility >= Hostility.Neutral && !EClass._zone.IsPCFaction)
6384 {
6385 bool flag = chara.id == "fanatic";
6386 if (EClass.rnd(4) == 0 || flag)
6387 {
6388 chara.Say("callHelp", chara);
6389 chara.CallHelp(this, flag);
6390 }
6391 }
6392 if (chara.hostility <= Hostility.Enemy)
6393 {
6394 foreach (Chara member in EClass.pc.party.members)
6395 {
6396 if (member != EClass.pc && member.enemy == null && member.CanSee(chara))
6397 {
6398 member.SetEnemy(chara);
6399 }
6400 }
6401 }
6402 }
6403 else if (chara.IsPC && hostility <= Hostility.Enemy)
6404 {
6405 foreach (Chara member2 in EClass.pc.party.members)
6406 {
6407 if (member2 != EClass.pc && member2.enemy == null && member2.CanSee(this))
6408 {
6409 member2.SetEnemy(this);
6410 }
6411 }
6412 }
6413 if (chara.calmCheckTurn <= 0 || IsPC)
6414 {
6415 chara.calmCheckTurn = (IsPC ? (20 + EClass.rnd(30)) : (10 + EClass.rnd(10)));
6416 }
6417 if (hostility != Hostility.Enemy || chara.hostility != Hostility.Enemy)
6418 {
6419 GoHostile(chara);
6420 chara.GoHostile(this);
6421 if (base.isHidden && !chara.CanSee(this) && !chara.IsDisabled && !chara.IsPCParty && !chara.IsPCPartyMinion && EClass.rnd(10 + Dist(chara) * 10) == 0)
6422 {
6423 Thing t = ThingGen.Create("49");
6424 ActThrow.Throw(chara, pos, t);
6425 Act.TC = chara;
6426 }
6427 }
6428 }
6429 }
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:561
override bool IsPCPartyMinion
Definition: Chara.cs:639
int calmCheckTurn
Definition: Chara.cs:116
bool CanSee(Card c)
Definition: Chara.cs:1218
override bool IsPCFactionMinion
Definition: Chara.cs:655
bool IsFriendOrAbove()
Definition: Chara.cs:6618
Chara SetEnemy(Chara c=null)
Definition: Chara.cs:6300
void CallHelp(Chara tg, bool fanatic=false)
Definition: Chara.cs:6431
Hostility hostility
Definition: Chara.cs:291
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(), DramaOutcome.event_az3(), DramaOutcome.fiama_starter_gift(), AI_Fuck.Finish(), ActRanged.Perform(), ActSummonGuard.Perform(), ActWater.Perform(), ActEffect.Proc(), AI_AttackHome.Run(), AI_Idle.Run(), GoalSiege.Run(), and ActThrow.Throw().

◆ Drink()

void Chara.Drink ( Card  t)
inline

Definition at line 5099 of file Chara.cs.

5100 {
5101 Say("drink", this, t.Duplicate(1));
5102 Say("quaff");
5103 PlaySound("drink");
5104 hunger.Mod(-2);
5105 t.ModNum(-1);
5106 t.trait.OnDrink(this);
5107 _ = IsPC;
5108 }
Thing Duplicate(int num)
Definition: Card.cs:3444
void ModNum(int a, bool notify=true)
Definition: Card.cs:3515
Stats hunger
Definition: Chara.cs:1142
virtual void OnDrink(Chara c)
Definition: Trait.cs:993

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

4597 {
4598 if (held == null)
4599 {
4600 return null;
4601 }
4602 if (IsPC)
4603 {
4604 WidgetHotbar.dirtyCurrentItem = true;
4606 }
4607 Card card = EClass._zone.AddCard(held, dropPos ?? pos);
4608 card.OnLand();
4609 if (card.trait.CanOnlyCarry)
4610 {
4611 card.SetPlaceState(PlaceState.installed);
4612 }
4613 return card;
4614 }
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 4616 of file Chara.cs.

4617 {
4618 if (t.c_isImportant)
4619 {
4620 Msg.Say("markedImportant");
4621 return;
4622 }
4623 if (!t.trait.CanBeDropped)
4624 {
4625 Msg.Say("cantDrop", t);
4626 return;
4627 }
4628 if (t.trait is TraitAbility)
4629 {
4630 SE.Trash();
4631 t.Destroy();
4632 return;
4633 }
4634 Msg.Say("dropItem", t.Name);
4635 t.ignoreAutoPick = true;
4636 PlaySound("drop");
4637 EClass._zone.AddCard(t, pos);
4638 if (t.trait.CanOnlyCarry)
4639 {
4640 t.Install();
4641 }
4642 }
Card Install()
Definition: Card.cs:3741
virtual bool CanBeDropped
Definition: Trait.cs:302

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

1784 {
1785 Chara chara = CharaGen.Create(id);
1786 chara.mana.value = mana.value;
1787 chara.stamina.value = stamina.value;
1788 foreach (KeyValuePair<int, Element> item in elements.dict)
1789 {
1790 Element orCreateElement = chara.elements.GetOrCreateElement(item.Key);
1791 orCreateElement.vBase = item.Value.ValueWithoutLink - orCreateElement.vSource;
1792 }
1793 chara.SetFaith(faith);
1794 chara.bio = IO.DeepCopy(bio);
1795 chara.LV = base.LV;
1796 chara.c_daysWithGod = base.c_daysWithGod;
1797 chara.RefreshFaithElement();
1798 chara.hp = (int)Mathf.Clamp((float)chara.MaxHP * ((float)base.hp / (float)MaxHP) * 0.99f, 0f, chara.MaxHP);
1799 chara.isCopy = true;
1800 chara.isScaled = base.isScaled;
1801 if (HaveFur())
1802 {
1803 chara.c_fur = -1;
1804 }
1805 return chara;
1806 }
bool HaveFur()
Definition: Card.cs:7870
Stats mana
Definition: Chara.cs:1154
void RefreshFaithElement()
Definition: Chara.cs:10184
void SetFaith(string id)
Definition: Chara.cs:1705
Element GetOrCreateElement(Element ele)
int vSource
Definition: ELEMENT.cs:262
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 10299 of file Chara.cs.

10300 {
10301 ModTempElement(ele, onlyRenew ? (p / 20) : (p / 100 + EClass.rnd(p / 100 + 1)), naturalDecay: false, onlyRenew);
10302 }

References EClass.rnd().

◆ EnhanceTempElements()

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

Definition at line 10290 of file Chara.cs.

10291 {
10292 int[] array = (body ? Element.List_Body : Element.List_Mind);
10293 foreach (int ele in array)
10294 {
10295 EnhanceTempElement(ele, p, onlyRenew);
10296 }
10297 }
void EnhanceTempElement(int ele, int p, bool onlyRenew=false)
Definition: Chara.cs:10299

References Element.List_Mind.

◆ EQ_CAT()

void Chara.EQ_CAT ( string  s)
inline

Definition at line 5076 of file Chara.cs.

5077 {
5078 int slot = EClass.sources.categories.map[s].slot;
5079 BodySlot bodySlot = ((slot == 0) ? null : body.GetSlot(slot));
5080 if ((slot == 0 || bodySlot != null) && (slot != 37 || !HasElement(1209)))
5081 {
5082 SetEQQuality();
5083 Thing thing = ThingGen.CreateFromCategory(s, base.LV);
5084 AddThing(thing);
5085 if (bodySlot != null && !body.Equip(thing, bodySlot))
5086 {
5087 thing.Destroy();
5088 }
5089 }
5090 }
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:3104
bool Equip(Thing thing, BodySlot slot=null, bool msg=true)
Definition: CharaBody.cs:186
BodySlot GetSlot(Thing t, bool onlyEmpty=false, bool secondSlot=false)
Definition: CharaBody.cs:354
void SetEQQuality()
Definition: Chara.cs:5023
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 5056 of file Chara.cs.

5057 {
5058 SetEQQuality();
5059 if (r != Rarity.Random)
5060 {
5061 CardBlueprint.current.rarity = r;
5062 }
5063 Thing thing = ThingGen.Create(s, mat, base.LV);
5064 if (body.GetSlot(thing, onlyEmpty: true) == null)
5065 {
5066 return thing;
5067 }
5068 AddThing(thing);
5069 if (!body.Equip(thing))
5070 {
5071 thing.Destroy();
5072 }
5073 return thing;
5074 }

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

5093 {
5094 SetEQQuality();
5095 Thing t = ThingGen.Create(s, -1, base.LV).SetNum(num);
5096 AddThing(t);
5097 }
Thing SetNum(int a)
Definition: Card.cs:3495

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

◆ EvalueRiding()

int Chara.EvalueRiding ( )
inline

Definition at line 6160 of file Chara.cs.

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

References HasCondition().

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

◆ FallFromZone()

void Chara.FallFromZone ( )
inline

Definition at line 3494 of file Chara.cs.

3495 {
3496 Msg.Say("skyFall", EClass.pc, EClass._zone.Name);
3497 Zone zone = (EClass._zone.isExternalZone ? null : EClass._zone.GetTopZone().FindZone(EClass._zone.lv - 1));
3498 zone = zone ?? EClass.world.region;
3500 {
3501 state = ZoneTransition.EnterState.Fall,
3502 x = pos.x,
3503 z = pos.z
3504 });
3505 }
void MoveZone(string alias)
Definition: Chara.cs:3319
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:1933

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

7812 {
7813 TraitToolRange ranged = weapon.trait as TraitToolRange;
7814 Thing thing = (IsPC ? EClass.pc.things.Find<TraitQuiver>() : null);
7815 if (thing != null)
7816 {
7817 Thing thing2 = thing.things.Find((Thing t) => ranged.IsAmmo(t));
7818 if (thing2 != null)
7819 {
7820 return thing2;
7821 }
7822 }
7823 return things.Find((Thing t) => ranged.IsAmmo(t));
7824 }
bool IsAmmo
Definition: Card.cs:2247
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 7310 of file Chara.cs.

7311 {
7312 foreach (Card item in EClass._map.props.installed.all)
7313 {
7314 if (item.trait is TraitBed traitBed && traitBed.IsHolder(this))
7315 {
7316 return traitBed;
7317 }
7318 }
7319 return null;
7320 }

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

7543 {
7544 Thing result = null;
7545 int num = -1;
7546 if (IsPC)
7547 {
7548 return null;
7549 }
7550 foreach (Thing item in things.List((Thing t) => CanEat(t, shouldEat: true) && !t.c_isImportant, onlyAccessible: true))
7551 {
7552 int num2 = CountNumEaten(item);
7553 int num3 = 100 - num2 + (item.HasElement(757) ? 10 : 0);
7554 if (num3 > num)
7555 {
7556 result = item;
7557 num = num3;
7558 }
7559 }
7560 return result;
7561 }
bool CanEat(Thing t, bool shouldEat=false)
Definition: Chara.cs:7588
int CountNumEaten(Thing food)
Definition: Chara.cs:10155
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 2385 of file Chara.cs.

2386 {
2387 if (IsMinion)
2388 {
2389 master = EClass._map.FindChara(base.c_uidMaster);
2390 }
2391 return master;
2392 }
Chara master
Definition: Chara.cs:88
Chara FindChara(string id)
Definition: Map.cs:2568

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

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

◆ FindNearestNewEnemy()

bool Chara.FindNearestNewEnemy ( )
inline

Definition at line 6511 of file Chara.cs.

6512 {
6513 for (int i = 0; i < EClass._map.charas.Count; i++)
6514 {
6515 Chara chara = EClass._map.charas[i];
6516 if (chara != this && chara != enemy && IsHostile(chara) && Dist(chara) <= 1 && CanInteractTo(chara.pos))
6517 {
6518 DoHostileAction(chara);
6519 enemy = chara;
6520 return true;
6521 }
6522 }
6523 return false;
6524 }
void DoHostileAction(Card _tg, bool immediate=false)
Definition: Chara.cs:6349

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

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

◆ FindNewEnemy()

bool Chara.FindNewEnemy ( )
inline

Definition at line 6442 of file Chara.cs.

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

7927 {
7928 return FindBed()?.owner.pos.cell.room;
7929 }
TraitBed FindBed()
Definition: Chara.cs:7310

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

10071 {
10072 Element orCreateElement = elements.GetOrCreateElement(ele);
10073 if (orCreateElement.ValueWithoutLink == 0)
10074 {
10075 elements.ModBase(orCreateElement.id, 1);
10076 }
10077 if (orCreateElement is Spell)
10078 {
10079 int num = EClass.curve(Evalue(307), 50, 20) + (HasElement(307) ? 20 : 0);
10080 int num2 = origin?.Evalue(765) ?? 0;
10081 num = num * (100 - num2) / 100;
10082 int a = mtp * orCreateElement.source.charge * (100 + num) / 100 / 100;
10083 a = Mathf.Max(1, EClass.rndHalf(a));
10084 if (orCreateElement.source.charge == 1)
10085 {
10086 a = 1;
10087 }
10088 orCreateElement.vPotential += a;
10089 }
10090 Say("spell_gain", this, orCreateElement.Name);
10091 LayerAbility.SetDirty(orCreateElement);
10092 }
Element ModBase(int ele, int v)
virtual string Name
Definition: ELEMENT.cs:304
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 7254 of file Chara.cs.

7255 {
7256 string result = "?????";
7257 if (ai != null)
7258 {
7259 result = ai.GetCurrentActionText();
7260 }
7261 return result;
7262 }
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 7861 of file Chara.cs.

7862 {
7863 if (body.GetWeight(armorOnly: true) <= (HasElement(1204) ? 6000 : 30000))
7864 {
7865 return 120;
7866 }
7867 return 122;
7868 }
int GetWeight(bool armorOnly=false)
Definition: CharaBody.cs:421

References CharaBody.GetWeight().

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

◆ GetBestRangedWeapon()

Thing Chara.GetBestRangedWeapon ( )
inline

Definition at line 7826 of file Chara.cs.

7827 {
7828 Thing result = null;
7829 int num = 0;
7830 foreach (Thing thing in things)
7831 {
7832 if (thing.IsRangedWeapon && CanEquipRanged(thing) && thing.GetEquipValue() > num)
7833 {
7834 num = thing.GetEquipValue();
7835 result = thing;
7836 }
7837 }
7838 return result;
7839 }
int GetEquipValue()
Definition: Card.cs:7171
bool IsRangedWeapon
Definition: Card.cs:2243
bool CanEquipRanged(Thing t)
Definition: Chara.cs:7760

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

◆ GetBuffStats() [1/2]

Element Chara.GetBuffStats ( int  ele)
inline

Definition at line 9422 of file Chara.cs.

9423 {
9424 for (int i = 0; i < conditions.Count; i++)
9425 {
9426 if (conditions[i] is ConBuffStats conBuffStats && conBuffStats.refVal == ele)
9427 {
9428 return conBuffStats.elements.GetElement(ele);
9429 }
9430 }
9431 return null;
9432 }

References BaseCondition.refVal.

◆ GetBuffStats() [2/2]

Element Chara.GetBuffStats ( string  alias)
inline

Definition at line 9417 of file Chara.cs.

9418 {
9419 return GetBuffStats(EClass.sources.elements.alias[alias].id);
9420 }
Element GetBuffStats(string alias)
Definition: Chara.cs:9417

References SourceManager.elements, and EClass.sources.

Referenced by GoalCombat.TryUseAbility().

◆ GetBurden()

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

Definition at line 1808 of file Chara.cs.

1809 {
1810 int num2 = (base.ChildrenWeight + ((t != null) ? ((num == -1) ? t.ChildrenAndSelfWeight : (t.SelfWeight * num)) : 0)) * 100 / WeightLimit;
1811 if (num2 < 0)
1812 {
1813 num2 = 1000;
1814 }
1816 {
1817 num2 = 0;
1818 }
1819 int num3 = ((num2 >= 100) ? ((num2 - 100) / 10 + 1) : 0);
1820 if (num3 > 9)
1821 {
1822 num3 = 9;
1823 }
1824 return num3;
1825 }

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

◆ GetCondition< T >()

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

Definition at line 9460 of file Chara.cs.

9460 : Condition
9461 {
9462 for (int i = 0; i < conditions.Count; i++)
9463 {
9464 if (conditions[i] is T)
9465 {
9466 return conditions[i] as T;
9467 }
9468 }
9469 return null;
9470 }

◆ GetCooldown()

int Chara.GetCooldown ( int  idEle)
inline

Definition at line 8711 of file Chara.cs.

8712 {
8713 if (_cooldowns != null)
8714 {
8715 for (int i = 0; i < _cooldowns.Count; i++)
8716 {
8717 if (_cooldowns[i] / 1000 == idEle)
8718 {
8719 return _cooldowns[i] % 1000;
8720 }
8721 }
8722 }
8723 return 0;
8724 }

Referenced by NotificationCooldown.OnRefresh().

◆ GetCurrentDir()

int Chara.GetCurrentDir ( )
inline

Definition at line 3614 of file Chara.cs.

3615 {
3616 Debug.Log(angle);
3617 if (!renderer.hasActor)
3618 {
3619 if (angle == 0f || angle == 45f || angle == 90f)
3620 {
3621 return 2;
3622 }
3623 if (angle == -135f || angle == 180f || angle == -90f)
3624 {
3625 return 1;
3626 }
3627 if (angle == 135f)
3628 {
3629 return 0;
3630 }
3631 return 3;
3632 }
3633 return renderer.actor.currentDir;
3634 }
virtual int currentDir
Definition: CardActor.cs:41
float angle
Definition: Card.cs:71

References Debug.

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

◆ GetDestination()

Point Chara.GetDestination ( )
inline

Definition at line 7229 of file Chara.cs.

7230 {
7231 return (ai.IsRunning ? ai.GetDestination() : pos).Copy();
7232 }
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 4669 of file Chara.cs.

4670 {
4671 if (elements.Value(122) > elements.Value(120))
4672 {
4673 return elements.GetElement(122);
4674 }
4675 return elements.GetElement(120);
4676 }
int Value(int ele)

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

◆ GetFavAttackStyle()

AttackStyle Chara.GetFavAttackStyle ( )
inline

Definition at line 4644 of file Chara.cs.

4645 {
4646 int num = Evalue(131);
4647 int num2 = Evalue(130);
4648 int num3 = Evalue(123);
4649 if (num > num2 && num > num3)
4650 {
4651 return AttackStyle.TwoWield;
4652 }
4653 if (num2 > num && num2 > num3)
4654 {
4655 return AttackStyle.TwoHand;
4656 }
4657 if (num3 > num && num3 > num2)
4658 {
4659 return AttackStyle.Shield;
4660 }
4661 return AttackStyle.Default;
4662 }

Referenced by WindowChara.RefreshNote().

◆ GetFavCat()

SourceCategory.Row Chara.GetFavCat ( )
inline

Definition at line 8050 of file Chara.cs.

8051 {
8052 SourceCategory.Row r = null;
8053 if (_listFavCat.Count == 0)
8054 {
8055 foreach (SourceCategory.Row row in EClass.sources.categories.rows)
8056 {
8057 if (row.gift > 0)
8058 {
8059 _listFavCat.Add(row);
8060 }
8061 }
8062 }
8063 Rand.UseSeed(base.uid + EClass.game.seed, delegate
8064 {
8065 r = _listFavCat.RandomItem();
8066 });
8067 return r;
8068 }
static List< SourceCategory.Row > _listFavCat
Definition: Chara.cs:194
int seed
Definition: Game.cs:200
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 8030 of file Chara.cs.

8031 {
8032 if (_listFavFood.Count == 0)
8033 {
8034 foreach (SourceThing.Row row in EClass.sources.things.rows)
8035 {
8036 if (row._origin == "dish" && row.value != 0 && row.chance != 0)
8037 {
8038 _listFavFood.Add(row);
8039 }
8040 }
8041 }
8042 SourceThing.Row r = null;
8043 Rand.UseSeed(base.uid + EClass.game.seed, delegate
8044 {
8045 r = _listFavFood.RandomItem();
8046 });
8047 return r;
8048 }
static List< SourceThing.Row > _listFavFood
Definition: Chara.cs:192
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 4664 of file Chara.cs.

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

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

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

8778 {
8779 if (IsPC)
8780 {
8781 return null;
8782 }
8783 switch (TimeTable.GetSpan(idTimeTable, hour))
8784 {
8785 case TimeTable.Span.Sleep:
8787 {
8788 return new GoalSleep();
8789 }
8790 break;
8791 case TimeTable.Span.Eat:
8792 return new GoalIdle();
8793 case TimeTable.Span.Work:
8794 if (IsGuest())
8795 {
8796 return new GoalIdle();
8797 }
8798 return GetGoalWork();
8799 case TimeTable.Span.Free:
8800 if (IsGuest())
8801 {
8802 return new GoalIdle();
8803 }
8804 return GetGoalHobby();
8805 }
8806 return null;
8807 }
Goal GetGoalWork()
Definition: Chara.cs:8809
Goal GetGoalHobby()
Definition: Chara.cs:8822
string idTimeTable
Definition: Chara.cs:468
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 8822 of file Chara.cs.

8823 {
8824 if (IsPrisoner)
8825 {
8826 return new GoalIdle();
8827 }
8828 if (memberType == FactionMemberType.Livestock)
8829 {
8830 return new GoalGraze();
8831 }
8832 return new GoalHobby();
8833 }
FactionMemberType
bool IsPrisoner
Definition: Chara.cs:1038

Referenced by Zone.Simulate().

◆ GetGoalWork()

Goal Chara.GetGoalWork ( )
inline

Definition at line 8809 of file Chara.cs.

8810 {
8811 if (IsPrisoner)
8812 {
8813 return new GoalIdle();
8814 }
8815 if (memberType == FactionMemberType.Livestock)
8816 {
8817 return new GoalGraze();
8818 }
8819 return new GoalWork();
8820 }

Referenced by Zone.Simulate().

◆ GetHappiness()

int Chara.GetHappiness ( )
inline

Definition at line 7239 of file Chara.cs.

7240 {
7241 int num = 50;
7242 if (FindBed() != null)
7243 {
7244 num += 50;
7245 }
7246 return num;
7247 }

◆ GetHireCost()

int Chara.GetHireCost ( )
inline

Definition at line 7234 of file Chara.cs.

7235 {
7236 return base.LV / 2 + 4;
7237 }

Referenced by CalcGold.Hire().

◆ GetHoverText()

override string Chara.GetHoverText ( )
inlinevirtual

Reimplemented from Card.

Definition at line 6764 of file Chara.cs.

6765 {
6766 string text = base.Name;
6767 if (IsFriendOrAbove())
6768 {
6769 text = text.TagColor(EClass.Colors.colorFriend);
6770 }
6771 else if (IsHostile())
6772 {
6773 text = text.TagColor(EClass.Colors.colorHostile);
6774 }
6775 int num = 2;
6776 int lV = EClass.pc.LV;
6777 if (base.LV >= lV * 5)
6778 {
6779 num = 0;
6780 }
6781 else if (base.LV >= lV * 2)
6782 {
6783 num = 1;
6784 }
6785 else if (base.LV <= lV / 4)
6786 {
6787 num = 4;
6788 }
6789 else if (base.LV <= lV / 2)
6790 {
6791 num = 3;
6792 }
6793 string text2 = Lang.GetList("lvComparison")[num];
6794 text2 = (" (" + text2 + ") ").TagSize(14).TagColor(EClass.Colors.gradientLVComparison.Evaluate(0.25f * (float)num));
6795 string s = (IsFriendOrAbove() ? "HostilityAlly" : (IsNeutral() ? "HostilityNeutral" : "HostilityEnemy"));
6796 s = (" (" + s.lang() + ") ").TagSize(14);
6797 s = "";
6798 if (memberType == FactionMemberType.Guest)
6799 {
6800 s += (" (" + "guest".lang() + ") ").TagSize(14);
6801 }
6802 else if (memberType == FactionMemberType.Livestock)
6803 {
6804 s += (" (" + "livestock".lang() + ") ").TagSize(14);
6805 }
6806 if (!EClass.pc.IsMoving)
6807 {
6808 if (EClass.pc.HasHigherGround(this))
6809 {
6810 text2 += "lowerGround".lang();
6811 }
6812 else if (HasHigherGround(EClass.pc))
6813 {
6814 text2 += "higherGround".lang();
6815 }
6816 }
6817 if (Evalue(1232) > 0)
6818 {
6819 text2 = "milkBaby".lang().TagSize(14) + text2;
6820 }
6821 if (Guild.Fighter.ShowBounty(this) && Guild.Fighter.HasBounty(this))
6822 {
6823 text2 = "hasBounty".lang().TagSize(14) + text2;
6824 }
6825 if (EClass.pc.HasElement(481))
6826 {
6827 text2 += ("(" + faith.Name + ")").TagSize(14);
6828 }
6829 if (EClass.pc.HasElement(6607))
6830 {
6831 s += CraftUtil.GetBloodText(this).TagSize(14).TagColor(EClass.Colors.colorBlood);
6832 }
6833 return text + text2 + s;
6834 }
bool HasHigherGround(Card c)
Definition: Chara.cs:1190
override bool IsMoving
Definition: Chara.cs:608
bool IsNeutral()
Definition: Chara.cs:6569
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

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

Referenced by WidgetMouseover.Refresh().

◆ GetHoverText2()

override string Chara.GetHoverText2 ( )
inlinevirtual

Reimplemented from Card.

Definition at line 6836 of file Chara.cs.

6837 {
6838 string text = "";
6839 if (knowFav)
6840 {
6841 text += Environment.NewLine;
6842 text = text + "<size=14>" + "favgift".lang(GetFavCat().GetName().ToLower(), GetFavFood().GetName()) + "</size>";
6843 }
6844 string text2 = "";
6846 {
6847 text2 += Environment.NewLine;
6848 text2 = text2 + "Lv:" + base.LV + " HP:" + base.hp + "/" + MaxHP + " MP:" + mana.value + "/" + mana.max + " DV:" + DV + " PV:" + PV + " Hunger:" + hunger.value;
6849 text2 += Environment.NewLine;
6850 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");
6851 text2 += Environment.NewLine;
6852 text2 = text2 + base.uid + IsMinion + "/" + base.c_uidMaster + "/" + master;
6853 text2 = text2 + " dir:" + base.dir + " skin:" + base.idSkin + " scaled:" + base.isScaled;
6854 }
6856 {
6857 text2 += Environment.NewLine;
6858 text2 += "<size=14>";
6859 foreach (Hobby item in ListWorks())
6860 {
6861 text2 = text2 + item.Name + ", ";
6862 }
6863 foreach (Hobby item2 in ListHobbies())
6864 {
6865 text2 = text2 + item2.Name + ", ";
6866 }
6867 text2 = text2.TrimEnd(", ".ToCharArray()) + "</size>";
6868 }
6869 string text3 = "";
6870 IEnumerable<BaseStats> enumerable = conditions.Concat((!IsPCFaction) ? new BaseStats[0] : new BaseStats[2] { hunger, stamina });
6871 if (enumerable.Count() > 0)
6872 {
6873 text3 += Environment.NewLine;
6874 text3 += "<size=14>";
6875 int num = 0;
6876 foreach (BaseStats item3 in enumerable)
6877 {
6878 string text4 = item3.GetPhaseStr();
6879 if (text4.IsEmpty() || text4 == "#")
6880 {
6881 continue;
6882 }
6883 Color c = Color.white;
6884 switch (item3.source.group)
6885 {
6886 case "Bad":
6887 case "Debuff":
6888 case "Disease":
6890 break;
6891 case "Buff":
6893 break;
6894 }
6896 {
6897 text4 = text4 + "(" + item3.GetValue() + ")";
6898 if (resistCon != null && resistCon.ContainsKey(item3.id))
6899 {
6900 text4 = text4 + "{" + resistCon[item3.id] + "}";
6901 }
6902 }
6903 num++;
6904 text3 = text3 + text4.TagColor(c) + ", ";
6905 }
6906 if (num == 0)
6907 {
6908 text3 = "";
6909 }
6910 else
6911 {
6912 text = "";
6913 text3 = text3.TrimEnd(", ".ToCharArray()) + "</size>";
6914 }
6915 }
6917 {
6918 text3 += Environment.NewLine;
6919 foreach (ActList.Item item4 in ability.list.items)
6920 {
6921 text3 = text3 + item4.act.Name + ", ";
6922 }
6923 text3 = text3.TrimEnd(", ".ToCharArray());
6924 }
6925 return text + text2 + text3;
6926 }
override string ToString()
Definition: AIAct.cs:124
virtual string GetPhaseStr()
Definition: BaseStats.cs:47
virtual int GetValue()
Definition: BaseStats.cs:52
bool isScaled
Definition: Card.cs:914
SourceCategory.Row GetFavCat()
Definition: Chara.cs:8050
bool knowFav
Definition: Chara.cs:413
override string GetName(NameStyle style, int num=-1)
Definition: Chara.cs:1357
override int DV
Definition: Chara.cs:729
List< Hobby > ListHobbies(bool useMemberType=true)
Definition: Chara.cs:8965
override int PV
Definition: Chara.cs:758
SourceThing.Row GetFavFood()
Definition: Chara.cs:8030
List< Hobby > ListWorks(bool useMemberType=true)
Definition: Chara.cs:8938
Color colorDebuff
bool showExtra
Definition: CoreDebug.cs:168
Definition: Hobby.cs:5
SourceTactics tactics

References Color, ColorProfile.colorBuff, ColorProfile.colorDebuff, EClass.Colors, EClass.debug, 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, AIAct.ToString(), Card.trait, and Stats.value.

Referenced by WidgetMouseover.Refresh().

◆ GetIdPortrait()

string Chara.GetIdPortrait ( )
inline

Definition at line 8132 of file Chara.cs.

8133 {
8134 if (id == "olderyoungersister")
8135 {
8136 if (base.idSkin != 2)
8137 {
8138 return "UN_olderyoungersister";
8139 }
8140 return "UN_olderyoungersister_alt";
8141 }
8142 if (Portrait.allIds.Contains("UN_" + id + ".png"))
8143 {
8144 return "UN_" + id;
8145 }
8146 return base.c_idPortrait;
8147 }
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 8118 of file Chara.cs.

8119 {
8120 string text = race.id;
8121 if ((text == "mifu" || text == "nefu") && EClass.rnd(2) == 0)
8122 {
8123 return "foxfolk";
8124 }
8125 if (trait is TraitGuard)
8126 {
8127 return "guard";
8128 }
8129 return "";
8130 }

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

7023 {
7024 return GetSprite();
7025 }
override Sprite GetSprite(int dir=0)
Definition: Chara.cs:6688

◆ GetName()

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

Reimplemented from Card.

Definition at line 1357 of file Chara.cs.

1358 {
1359 if (base.isBackerContent && EClass.core.config.backer.Show(base.c_idBacker))
1360 {
1361 if (id == "follower" && !IsGlobal)
1362 {
1363 return "_follower".lang(EClass.sources.backers.map[base.c_idBacker].Name, faith.Name);
1364 }
1365 return EClass.sources.backers.map[base.c_idBacker].Name;
1366 }
1367 string text = base.c_altName ?? source.GetName(this);
1368 text = text.Replace("#ele5", MainElement.source.GetAltname(3)).Replace("#ele4", MainElement.source.GetAltname(2)).Replace("#ele3", MainElement.source.GetAltname(1))
1369 .Replace("#ele2", MainElement.source.GetAltname(0))
1370 .Replace("#ele", MainElement.source.GetName().ToLower());
1371 if (base.c_bossType == BossType.Evolved)
1372 {
1373 text = "_evolved".lang(text.ToTitleCase(wholeText: true));
1374 }
1375 trait.SetName(ref text);
1376 if (text.Length > 0 && char.IsLower(text[0]))
1377 {
1378 if (base.rarity >= Rarity.Legendary)
1379 {
1380 text = text.ToTitleCase();
1381 }
1382 else if (num != 0)
1383 {
1384 text = text.AddArticle();
1385 }
1386 }
1387 if (style == NameStyle.Simple)
1388 {
1389 return text;
1390 }
1391 int num2 = ((base.rarity == Rarity.Mythical) ? 3 : ((base.rarity >= Rarity.Legendary) ? 2 : ((!_alias.IsEmpty()) ? 1 : (-1))));
1392 if (trait is TraitAdventurer)
1393 {
1394 num2 = 1;
1395 }
1396 text = (Aka.IsEmpty() ? text.Bracket(num2) : (num2 switch
1397 {
1398 -1 => "_aka",
1399 1 => "_aka3",
1400 _ => "_aka2",
1401 }).lang((num2 == -1) ? Aka : Aka.ToTitleCase(wholeText: true), text.Bracket(num2)));
1402 string text2 = (base.isSale ? "forSale".lang(Lang._currency(GetPrice(CurrencyType.Money, sell: true, PriceType.PlayerShop), "money")) : "");
1403 return text + text2;
1404 }
BossType
Definition: BossType.cs:2
string Aka
Definition: Chara.cs:216
string _alias
Definition: Chara.cs:219
BackerContentConfig backer
Definition: CoreConfig.cs:613
string Name
Definition: Religion.cs:30
SourceBacker backers
virtual void SetName(ref string s)
Definition: Trait.cs:702

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

Referenced by TraitStoryBookHome.OnRead().

◆ GetNearbyCatToSniff()

Chara Chara.GetNearbyCatToSniff ( )
inline

Definition at line 8070 of file Chara.cs.

8071 {
8072 using (List<Chara>.Enumerator enumerator = pos.ListCharasInRadius(this, 3, (Chara c) => c != this && c.race.id == "cat").GetEnumerator())
8073 {
8074 if (enumerator.MoveNext())
8075 {
8076 return enumerator.Current;
8077 }
8078 }
8079 return null;
8080 }
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 10175 of file Chara.cs.

10176 {
10177 if (base._IsPC)
10178 {
10179 return 10 + (int)(Mathf.Sqrt(base.c_daysWithGod) * 2f + (float)Evalue(85)) / 2;
10180 }
10181 return 10 + (int)(Mathf.Sqrt(base.LV) * 5f + (float)Evalue(306)) / 2;
10182 }

◆ GetRevived()

void Chara.GetRevived ( )
inline

Definition at line 5115 of file Chara.cs.

5116 {
5117 Revive(EClass.pc.pos.GetNearestPoint(allowBlock: false, allowChara: false), msg: true);
5118 if (!IsPCFaction)
5119 {
5120 return;
5121 }
5123 {
5124 if (homeZone != null && EClass._zone != homeZone)
5125 {
5126 Msg.Say("returnHome", this, homeZone.Name);
5128 }
5129 }
5130 else if (!EClass._zone.IsPCFaction || homeBranch != EClass.Branch || base.c_wasInPcParty)
5131 {
5132 EClass.pc.party.AddMemeber(this, showMsg: true);
5133 }
5134 }
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 8916 of file Chara.cs.

8917 {
8918 BaseArea result = null;
8919 foreach (Hobby item in ListWorks())
8920 {
8921 AIWork aI = item.GetAI(this);
8922 if (aI.SetDestination())
8923 {
8924 if (aI.destArea != null)
8925 {
8926 result = aI.destArea;
8927 }
8928 else if (aI.destThing != null)
8929 {
8930 result = aI.destThing.pos.cell.room;
8931 }
8932 break;
8933 }
8934 }
8935 return result;
8936 }
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 6688 of file Chara.cs.

6689 {
6690 if (IsPCC)
6691 {
6692 PCC pCC = PCC.Get(pccData);
6693 pCC.Build();
6694 return pCC.variation.idle[0, 0];
6695 }
6696 if (spriteReplacer != null)
6697 {
6698 return spriteReplacer.data.GetSprite();
6699 }
6700 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);
6701 }
SpriteReplacer spriteReplacer
Definition: Chara.cs:154
override CardRow sourceCard
Definition: Chara.cs:450
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 6712 of file Chara.cs.

6713 {
6714 if (IsPCC)
6715 {
6717 {
6719 }
6720 }
6721 else if (conSleep != null && host == null && pos.Equals(EClass.pc.pos) && IsHuman && (GetBool(123) || affinity.CanSleepBeside()))
6722 {
6723 return EClass.setting.pass.subDead;
6724 }
6725 return SubPassData.Default;
6726 }
bool GetBool(int id)
Definition: BaseCard.cs:15
ConSleep conSleep
Definition: Chara.cs:102
override bool IsDeadOrSleeping
Definition: Chara.cs:573
PassSetting pass
Definition: GameSetting.cs:303
bool altHeldPos
Definition: Player.cs:1153
static SubPassData Default
Definition: SubPassData.cs:7

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

◆ GetTextHappiness()

string Chara.GetTextHappiness ( )
inline

Definition at line 7249 of file Chara.cs.

7250 {
7251 return GetHappiness().ToString() ?? "";
7252 }
int GetHappiness()
Definition: Chara.cs:7239

◆ GetTextHobby()

string Chara.GetTextHobby ( bool  simple = false)
inline

Definition at line 9054 of file Chara.cs.

9055 {
9056 string text = (simple ? "" : ("hobby".lang() + ":"));
9057 foreach (Hobby item in ListHobbies())
9058 {
9059 text = text + " " + item.Name.TagColor((item.GetEfficiency(this) > 0) ? FontColor.Good : FontColor.Warning) + ",";
9060 }
9061 return text.TrimEnd(',');
9062 }

References item.

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

◆ GetTextWork()

string Chara.GetTextWork ( bool  simple = false)
inline

Definition at line 9064 of file Chara.cs.

9065 {
9066 string text = (simple ? "" : ("work".lang() + ":"));
9067 foreach (Hobby item in ListWorks())
9068 {
9069 text = text + " " + item.Name.TagColor((item.GetEfficiency(this) > 0) ? FontColor.Good : FontColor.Warning) + ",";
9070 }
9071 return text.TrimEnd(',');
9072 }

References item.

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

◆ GetTopicText()

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

Definition at line 6928 of file Chara.cs.

6929 {
6930 string key = source.idText.IsEmpty(id);
6931 if (id == "littleOne" && EClass._zone is Zone_LittleGarden)
6932 {
6933 key = "littleOne2";
6934 }
6935 SourceCharaText.Row row = EClass.sources.charaText.map.TryGetValue(key);
6936 if (row == null)
6937 {
6938 return null;
6939 }
6940 string text = row.GetText(topic, returnNull: true);
6941 if (text.IsEmpty())
6942 {
6943 return null;
6944 }
6945 if (text.StartsWith("@"))
6946 {
6947 row = EClass.sources.charaText.map.TryGetValue(text.Replace("@", ""));
6948 if (row == null)
6949 {
6950 return null;
6951 }
6952 text = row.GetText(topic, returnNull: true);
6953 if (text.IsEmpty())
6954 {
6955 return null;
6956 }
6957 }
6958 return text.Split(Environment.NewLine.ToCharArray()).RandomItem();
6959 }
SourceCharaText charaText

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

◆ GetTotalFeat()

int Chara.GetTotalFeat ( )
inline

Definition at line 8092 of file Chara.cs.

8093 {
8094 int num = 0;
8095 if (base.c_upgrades != null)
8096 {
8097 num += base.c_upgrades.spent;
8098 }
8099 if (base.c_genes != null)
8100 {
8101 num += base.c_genes.GetTotalCost();
8102 }
8103 return num + base.feat;
8104 }

◆ GetWork()

Hobby Chara.GetWork ( string  id)
inline

Definition at line 8985 of file Chara.cs.

8986 {
8987 foreach (Hobby item in ListWorks())
8988 {
8989 if (item.source.alias == id)
8990 {
8991 return item;
8992 }
8993 }
8994 foreach (Hobby item2 in ListHobbies())
8995 {
8996 if (item2.source.alias == id)
8997 {
8998 return item2;
8999 }
9000 }
9001 return null;
9002 }
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 9137 of file Chara.cs.

9138 {
9139 if (_workSummary == null)
9140 {
9141 _workSummary = new WorkSummary();
9142 }
9143 return _workSummary;
9144 }
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 8231 of file Chara.cs.

8232 {
8233 if (c.IsHostile() || c.IsDeadOrSleeping)
8234 {
8235 Msg.Say("affinityNone", c, this);
8236 return;
8237 }
8238 if (!t.isCopy && t.IsCursed && t.IsEquipmentOrRanged && !t.IsAmmo && c.HasElement(1414))
8239 {
8240 bool num = t.blessedState == BlessedState.Doomed;
8241 int num2 = 200 + t.LV * 3;
8242 if (t.rarity == Rarity.Legendary)
8243 {
8244 num2 *= 3;
8245 }
8246 if (t.rarity >= Rarity.Mythical)
8247 {
8248 num2 *= 5;
8249 }
8250 if (num)
8251 {
8252 num2 *= 2;
8253 }
8254 EClass.pc.PlayEffect("identify");
8255 EClass.pc.PlaySound("identify");
8256 c.PlayEffect("mutation");
8257 c.Say("draw_curse", c, t);
8258 t.Destroy();
8259 List<Element> list = new List<Element>();
8260 foreach (Element value in EClass.pc.elements.dict.Values)
8261 {
8262 if (value is Spell)
8263 {
8264 list.Add(value);
8265 }
8266 }
8267 if (list.Count == 0)
8268 {
8270 return;
8271 }
8272 Element element = list.RandomItem();
8273 EClass.pc.ModExp(element.id, num2);
8274 EClass.pc.Say("draw_curse2", EClass.pc, element.Name);
8275 c.AddExp(Mathf.Min(num2 / 3, c.ExpToNext));
8276 return;
8277 }
8278 if ((t.id == "lovepotion" || t.id == "dreambug") && !Application.isEditor)
8279 {
8280 GiveLovePotion(c, t);
8281 return;
8282 }
8283 if (t.trait is TraitErohon && c.id == t.c_idRefName)
8284 {
8285 c.OnGiveErohon(t);
8286 return;
8287 }
8288 if (t.trait is TraitTicketMassage)
8289 {
8290 t.ModNum(-1);
8291 c.Talk("ticket");
8292 switch (t.id)
8293 {
8294 case "ticket_massage":
8295 c.ModAffinity(EClass.pc, 10);
8297 {
8298 target = c
8299 });
8300 break;
8301 case "ticket_armpillow":
8302 c.ModAffinity(EClass.pc, 20);
8303 EClass.pc.AddCondition<ConSleep>(300, force: true);
8304 c.SetAI(new AI_ArmPillow
8305 {
8306 target = EClass.pc
8307 });
8308 break;
8309 case "ticket_champagne":
8310 c.ModAffinity(EClass.pc, 10);
8312 break;
8313 }
8314 return;
8315 }
8316 if (t.id == "flyer")
8317 {
8318 stamina.Mod(-1);
8319 if (c.things.Find((Thing a) => a.id == "flyer") != null)
8320 {
8321 c.Talk("flyer_miss");
8322 DoHostileAction(c);
8323 return;
8324 }
8325 if (EClass.rnd(20) != 0 && c.CHA > EClass.rnd(base.CHA + Evalue(291) * 3 + 10))
8326 {
8327 Msg.Say("affinityNone", c, this);
8328 t.Destroy();
8329 elements.ModExp(291, 10f);
8330 return;
8331 }
8332 elements.ModExp(291, 50f);
8333 }
8334 if (t.id == "statue_weird")
8335 {
8336 EClass.pc.Say("statue_sell");
8337 }
8338 t.isGifted = true;
8339 c.nextUse = c.affinity.OnGift(t);
8340 if (!t.isDestroyed)
8341 {
8342 EClass.game.quests.list.ForeachReverse(delegate(Quest q)
8343 {
8344 q.OnGiveItem(c, t);
8345 });
8346 if (c.TryEquip(t))
8347 {
8348 c.nextUse = null;
8349 }
8350 }
8351 }
Thing OnGift(Thing t)
Definition: Affinity.cs:129
int ExpToNext
Definition: Card.cs:2008
bool isCopy
Definition: Card.cs:878
bool IsCursed
Definition: Card.cs:2255
int CHA
Definition: Card.cs:2347
bool IsEquipmentOrRanged
Definition: Card.cs:2218
void SayNothingHappans()
Definition: Card.cs:6813
string c_idRefName
Definition: Card.cs:1641
void AddExp(int a, bool applyMod=true)
Definition: Card.cs:2951
void GiveLovePotion(Chara c, Thing t)
Definition: Chara.cs:8364
bool TryEquip(Thing t, bool useFav=false)
Definition: Chara.cs:7721
void OnGiveErohon(Thing t)
Definition: Chara.cs:8353
QuestManager quests
Definition: Game.cs:182
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 8364 of file Chara.cs.

8365 {
8366 c.Say("give_love", c, t);
8367 c.PlaySound(t.material.GetSoundDead());
8368 c.ShowEmo(Emo.angry);
8369 c.ModAffinity(EClass.pc, -20, show: false);
8370 c.Talk("pervert");
8371 t.Destroy();
8372 }

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

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

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

1281 {
1282 return HasAccess(c.pos);
1283 }
bool HasAccess(Card c)
Definition: Chara.cs:1280

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

1286 {
1287 if (!EClass._zone.IsPCFaction || p.cell.room == null || IsPC)
1288 {
1289 return true;
1290 }
1291 return p.cell.room.data.accessType switch
1292 {
1293 BaseArea.AccessType.Resident => memberType == FactionMemberType.Default,
1294 BaseArea.AccessType.Private => false,
1295 _ => true,
1296 };
1297 }

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

◆ HasCondition()

◆ HasCondition< T >()

override bool Chara.HasCondition< T > ( )
inlinevirtual

Reimplemented from Card.

Definition at line 9393 of file Chara.cs.

9394 {
9395 for (int i = 0; i < conditions.Count; i++)
9396 {
9397 if (conditions[i] is T)
9398 {
9399 return true;
9400 }
9401 }
9402 return false;
9403 }

◆ HasCooldown()

bool Chara.HasCooldown ( int  idEle)
inline

Definition at line 8706 of file Chara.cs.

8707 {
8708 return GetCooldown(idEle) != 0;
8709 }
int GetCooldown(int idEle)
Definition: Chara.cs:8711

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

◆ HasHigherGround()

bool Chara.HasHigherGround ( Card  c)
inline

Definition at line 1190 of file Chara.cs.

1191 {
1192 if (c == null)
1193 {
1194 return false;
1195 }
1196 float num = renderer.position.y - pos.Position(0).y + (_isLevitating ? 0.4f : 0f);
1197 float num2 = c.renderer.position.y - c.pos.Position(0).y + ((c.isChara && c.Chara._isLevitating) ? 0.4f : 0f);
1198 return num > num2 + 0.1f;
1199 }
bool _isLevitating
Definition: Chara.cs:134
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 8835 of file Chara.cs.

8836 {
8837 int num = EClass.sources.hobbies.alias.TryGetValue(alias)?.id ?? 0;
8838 listHobby.Clear();
8839 if (_works == null || _hobbies == null)
8840 {
8841 RerollHobby();
8842 }
8843 foreach (int work in _works)
8844 {
8845 if (work == num)
8846 {
8847 return true;
8848 }
8849 }
8850 foreach (int hobby in _hobbies)
8851 {
8852 if (hobby == num)
8853 {
8854 return true;
8855 }
8856 }
8857 return false;
8858 }
static List< Hobby > listHobby
Definition: Chara.cs:13
void RerollHobby(bool extraSlotChance=true)
Definition: Chara.cs:9098
SourceHobby hobbies

References SourceManager.hobbies, and EClass.sources.

Referenced by AI_Idle.Run().

◆ HasMinion()

bool Chara.HasMinion ( string  id)
inline

Definition at line 2350 of file Chara.cs.

2351 {
2352 foreach (Chara chara in EClass._map.charas)
2353 {
2354 if (chara.c_uidMaster == base.uid)
2355 {
2356 return true;
2357 }
2358 }
2359 return false;
2360 }

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

Referenced by ActEffect.ProcAt().

◆ HealAll()

void Chara.HealAll ( )
inline

Definition at line 1716 of file Chara.cs.

1717 {
1718 Cure(CureType.HealComplete);
1719 base.hp = MaxHP;
1720 mana.value = mana.max;
1721 stamina.value = stamina.max;
1722 Refresh();
1723 }
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 4467 of file Chara.cs.

4468 {
4469 if (held == t || t.isDestroyed || t.Num <= 0)
4470 {
4471 return;
4472 }
4473 if (IsPC && t.isNPCProperty)
4474 {
4475 t.isNPCProperty = false;
4477 pos.TryWitnessCrime(this);
4478 }
4479 PickHeld();
4480 if (t.isChara)
4481 {
4483 {
4484 t.ShowEmo(Emo.love);
4485 }
4486 EClass.player.altHeldPos = t.renderer.data.ForceAltHeldPosition || EClass.rnd(2) == 0;
4487 }
4488 else
4489 {
4490 if (num == -1 || num > t.Num)
4491 {
4492 num = t.Num;
4493 }
4494 if (num < t.Num)
4495 {
4496 t = t.Split(num);
4497 }
4498 }
4499 if (t.GetRootCard() != this)
4500 {
4501 t = Pick(t.Thing, msg: false, tryStack: false);
4502 if (t.GetRootCard() != this)
4503 {
4504 return;
4505 }
4506 }
4507 held = t;
4508 if (held.GetLightRadius() > 0)
4509 {
4511 }
4512 if (IsPC)
4513 {
4515 WidgetHotbar.dirtyCurrentItem = true;
4516 }
4517 }
Thing Split(int a)
Definition: Card.cs:3484
bool isNPCProperty
Definition: Card.cs:554
void RecalculateFOV()
Definition: Card.cs:6377
virtual bool IsAliveInCurrentZone
Definition: Card.cs:2127
int GetLightRadius()
Definition: Card.cs:6424
void PickHeld(bool msg=false)
Definition: Chara.cs:4519
bool TryWitnessCrime(Chara criminal, Chara target=null, int radius=4, Func< Chara, bool > funcWitness=null)
Definition: Point.cs:873

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

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

◆ InitStats()

void Chara.InitStats ( bool  onDeserialize = false)
inline

Definition at line 9221 of file Chara.cs.

9222 {
9223 if (!onDeserialize)
9224 {
9225 _cints[10] = 20;
9226 _cints[11] = 70;
9227 _cints[13] = 70;
9228 _cints[14] = 70;
9229 _cints[15] = 70;
9230 _cints[17] = 0;
9231 _cints[18] = 0;
9232 }
9233 foreach (Condition condition in conditions)
9234 {
9235 condition.SetOwner(this, onDeserialize);
9236 }
9237 }
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 7563 of file Chara.cs.

7564 {
7565 if (t == null)
7566 {
7567 t = FindBestFoodToEat();
7568 }
7569 if (t == null)
7570 {
7571 t = things.Find((Thing a) => CanEat(a, shouldEat: true) && !a.c_isImportant);
7572 }
7573 if (t == null)
7574 {
7575 t = things.Find((Thing a) => CanEat(a) && !a.c_isImportant);
7576 }
7577 if (t != null)
7578 {
7579 Say("eat_start", this, t.Duplicate(1));
7580 if (sound)
7581 {
7582 PlaySound("eat");
7583 }
7584 FoodEffect.Proc(this, t);
7585 }
7586 }
Thing FindBestFoodToEat()
Definition: Chara.cs:7542
static void Proc(Chara c, Thing food, bool consume=true)
Definition: FoodEffect.cs:11

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

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

◆ IsBranchMember()

bool Chara.IsBranchMember ( )
inline

Definition at line 6579 of file Chara.cs.

6580 {
6581 if (faction == EClass.Home)
6582 {
6583 return homeZone == EClass.game.activeZone;
6584 }
6585 return false;
6586 }
Faction faction
Definition: Chara.cs:427
Zone activeZone
Definition: Game.cs:251

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

◆ IsCriticallyWounded()

bool Chara.IsCriticallyWounded ( bool  includeRide = false)
inline

Definition at line 1177 of file Chara.cs.

1178 {
1179 if (host == null || includeRide)
1180 {
1181 if (Evalue(1421) <= 0)
1182 {
1183 return base.hp < MaxHP / 5;
1184 }
1185 return base.hp + mana.value < (MaxHP + mana.max) / 5;
1186 }
1187 return false;
1188 }

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

2495 {
2496 if (!currentZone.IsRegion && p.IsValid)
2497 {
2498 CellDetail detail = p.detail;
2499 if (detail != null && detail.charas.Count > 0)
2500 {
2501 foreach (Chara chara in p.detail.charas)
2502 {
2503 if (chara.IsHostile(this) || chara.IsHostile() || !chara.trait.CanBePushed)
2504 {
2505 if (cancelAI && EClass.pc.ai is GoalManualMove)
2506 {
2507 EClass.pc.ai.Cancel();
2508 }
2509 return true;
2510 }
2511 }
2512 }
2513 }
2514 return false;
2515 }
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, EClass.pc, and trait.

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

◆ IsEscorted()

bool Chara.IsEscorted ( )
inline

Definition at line 2394 of file Chara.cs.

2395 {
2396 if (!IsPCPartyMinion)
2397 {
2398 return false;
2399 }
2400 foreach (Quest item in EClass.game.quests.list)
2401 {
2402 if (item is QuestEscort questEscort && questEscort.uidChara == base.uid)
2403 {
2404 return true;
2405 }
2406 }
2407 return false;
2408 }
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 6623 of file Chara.cs.

6624 {
6625 if (base.IsPCFactionOrMinion || IsFriendOrAbove())
6626 {
6628 {
6629 return true;
6630 }
6631 }
6632 else if (IsHostile() && c.IsHostile())
6633 {
6634 return true;
6635 }
6636 return false;
6637 }

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

◆ IsGuest()

◆ IsHomeMember()

◆ IsHostile() [1/2]

◆ IsHostile() [2/2]

bool Chara.IsHostile ( Chara  c)
inline

Definition at line 6531 of file Chara.cs.

6532 {
6533 if (c == null)
6534 {
6535 return false;
6536 }
6537 if (base.IsPCFactionOrMinion)
6538 {
6539 if ((c == EClass.pc.enemy && !c.IsPCFactionOrMinion) || c.hostility <= Hostility.Enemy)
6540 {
6541 return true;
6542 }
6543 }
6544 else
6545 {
6547 {
6548 return true;
6549 }
6550 if (OriginalHostility >= Hostility.Friend)
6551 {
6552 if (hostility <= Hostility.Enemy && c.IsPCFactionOrMinion)
6553 {
6554 return true;
6555 }
6556 if (c.hostility <= Hostility.Enemy && c.OriginalHostility == Hostility.Enemy)
6557 {
6558 return true;
6559 }
6560 }
6561 else if (OriginalHostility <= Hostility.Enemy && (c.IsPCFactionOrMinion || (c.OriginalHostility != Hostility.Enemy && c.hostility >= Hostility.Friend)))
6562 {
6563 return true;
6564 }
6565 }
6566 return false;
6567 }
bool IsCriminal
Definition: Player.cs:1337

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

◆ IsInHomeZone()

bool Chara.IsInHomeZone ( )
inline

Definition at line 6593 of file Chara.cs.

6594 {
6595 return EClass.game.activeZone == currentZone;
6596 }

Referenced by BaseListPeople.IsDisabled().

◆ IsInSpot< T >()

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

Definition at line 6598 of file Chara.cs.

6598 : TraitSpot
6599 {
6600 foreach (T item in EClass._map.props.installed.traits.List<T>())
6601 {
6602 foreach (Point item2 in item.ListPoints())
6603 {
6604 if (pos.Equals(item2))
6605 {
6606 return true;
6607 }
6608 }
6609 }
6610 return false;
6611 }
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 6569 of file Chara.cs.

6570 {
6571 return hostility == Hostility.Neutral;
6572 }

Referenced by ActPlan._Update().

◆ IsNeutralOrAbove()

bool Chara.IsNeutralOrAbove ( )
inline

◆ IsValidGiftWeight()

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

Definition at line 8175 of file Chara.cs.

8176 {
8177 int num2 = ((!HasElement(1411)) ? 1 : 3);
8178 if (GetBurden(t, num) >= num2)
8179 {
8180 return false;
8181 }
8182 return true;
8183 }
int GetBurden(Card t=null, int num=-1)
Definition: Chara.cs:1808

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

◆ Kick() [1/2]

void Chara.Kick ( Chara  t,
bool  ignoreSelf = false,
bool  karmaLoss = true,
bool  show = true,
bool  checkWall = true 
)
inline

Definition at line 5782 of file Chara.cs.

5783 {
5785 {
5786 return;
5787 }
5788 if (t.IsPC)
5789 {
5791 }
5792 if (t.host != null)
5793 {
5794 return;
5795 }
5796 if (t == this)
5797 {
5798 if (!ignoreSelf)
5799 {
5800 Debug.Log(t.pos.GetNearestPoint());
5801 if (TryMove(t.pos.GetNearestPoint()) != MoveResult.Success)
5802 {
5804 }
5805 }
5806 return;
5807 }
5808 if (show)
5809 {
5810 Say("kick", this, t);
5811 }
5812 PlaySound("kick");
5813 if ((t.conSuspend == null || t.conSuspend.uidMachine != 0) && t.trait.CanBePushed && (!t.IsHostile() || EClass.rnd(2) == 0) && !t.noMove && !t.isRestrained)
5814 {
5815 t.MoveByForce(t.pos.GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: true, ignoreCenter: true), this, checkWall && !t.pos.IsBlocked);
5816 }
5817 if (t.conSleep != null)
5818 {
5819 t.conSleep.Kill();
5820 }
5821 if (IsPC && t.IsFriendOrAbove() && !t.IsPCFactionOrMinion && karmaLoss)
5822 {
5824 }
5825 t.PlayEffect("kick");
5826 }
void ClearPlans()
Definition: AM_Adv.cs:426
static AM_Adv Adv
Definition: ActionMode.cs:15
void MoveImmediate(Point p, bool focus=true, bool cancelAI=true)
Definition: Card.cs:5833
ConSuspend conSuspend
Definition: Chara.cs:104
MoveResult TryMove(Point newPoint, bool allowDestroyPath=true)
Definition: Chara.cs:2718
int uidMachine
Definition: ConSuspend.cs:6

References ActionMode.Adv, TraitChara.CanBePushed, AM_Adv.ClearPlans(), conSleep, conSuspend, Debug, Point.GetNearestPoint(), host, Point.IsBlocked, IsFriendOrAbove(), IsHostile(), IsPC, Card.IsPCFactionOrMinion, Card.isRestrained, Condition.Kill(), Player.ModKarma(), MoveByForce(), Card.MoveImmediate(), Card.noMove, Card.PlayEffect(), EClass.player, Card.pos, EClass.rnd(), trait, and ConSuspend.uidMachine.

◆ Kick() [2/2]

void Chara.Kick ( Point  p,
bool  ignoreSelf = false,
bool  checkWall = true 
)
inline

Definition at line 5774 of file Chara.cs.

5775 {
5776 foreach (Chara item in p.ListCharas())
5777 {
5778 Kick(item, ignoreSelf, karmaLoss: true, show: true, checkWall);
5779 }
5780 }
List< Chara > ListCharas()
Definition: Point.cs:1171

References item, and Kick.

Referenced by Recipe.Build(), RecipeCard.Build(), Map.MineFloor(), TaskBuild.OnProgressComplete(), TraitGeneMachine.OnUse(), ActKick.Perform(), AI_Bladder.Run(), AI_Trolley.Run(), and ActThrow.Throw().

◆ ListAvailabeFeats()

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

Definition at line 9858 of file Chara.cs.

9859 {
9860 List<Element> list = new List<Element>();
9861 foreach (SourceElement.Row item in EClass.sources.elements.rows.Where((SourceElement.Row a) => a.group == "FEAT" && a.cost[0] != -1 && !a.categorySub.IsEmpty()))
9862 {
9864 int num = ((feat.ValueWithoutLink <= 0) ? 1 : (feat.ValueWithoutLink + 1));
9865 if (num <= feat.source.max && !feat.HasTag("class") && !feat.HasTag("hidden") && !feat.HasTag("innate") && (!pet || !feat.HasTag("noPet")) && (showAll || feat.IsPurchaseFeatReqMet(elements)))
9866 {
9867 list.Add(Element.Create(feat.id, num) as Feat);
9868 }
9869 }
9870 return list;
9871 }
int feat
Definition: Card.cs:374
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1102
Definition: FEAT.cs:297

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

8966 {
8967 listHobby.Clear();
8968 if (!useMemberType || memberType != FactionMemberType.Livestock)
8969 {
8970 if (_hobbies == null)
8971 {
8972 RerollHobby();
8973 }
8974 foreach (int hobby in _hobbies)
8975 {
8976 listHobby.Add(new Hobby
8977 {
8978 id = hobby
8979 });
8980 }
8981 }
8982 return listHobby;
8983 }

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

8939 {
8940 listHobby.Clear();
8941 if (useMemberType && memberType == FactionMemberType.Livestock)
8942 {
8943 listHobby.Add(new Hobby
8944 {
8945 id = 45
8946 });
8947 }
8948 else
8949 {
8950 if (_works == null)
8951 {
8952 RerollHobby();
8953 }
8954 foreach (int work in _works)
8955 {
8956 listHobby.Add(new Hobby
8957 {
8958 id = work
8959 });
8960 }
8961 }
8962 return listHobby;
8963 }

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

3534 {
3535 angle = Util.GetAngle(p.x - pos.x, p.z - pos.z);
3536 if (EClass._zone.IsRegion)
3537 {
3538 if (angle > 100f && angle < 170f)
3539 {
3540 base.dir = 2;
3541 }
3542 else if (angle > 170f && angle < 190f)
3543 {
3544 base.dir = 0;
3545 }
3546 else if (angle > 190f || (angle < -10f && angle > -100f))
3547 {
3548 base.dir = 3;
3549 }
3550 else
3551 {
3552 base.dir = 1;
3553 }
3554 angle -= 45f;
3555 }
3556 else if (angle > 170f && angle < 235f)
3557 {
3558 base.dir = 0;
3559 }
3560 else if (angle > 80f && angle < 145f)
3561 {
3562 base.dir = 1;
3563 }
3564 else if (angle > -100f && angle < -35f)
3565 {
3566 base.dir = 3;
3567 }
3568 else if (angle > -10f && angle < 55f)
3569 {
3570 base.dir = 2;
3571 }
3573 }

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

◆ MakeAlly()

void Chara.MakeAlly ( bool  msg = true)
inline

Definition at line 2276 of file Chara.cs.

2277 {
2278 if (IsLocalChara && !base.IsUnique)
2279 {
2280 Debug.Log("Creating Replacement NPC for:" + this);
2282 }
2283 _MakeAlly();
2284 if (msg)
2285 {
2286 EClass.pc.Say("hire", this);
2287 EClass.Sound.Play("good");
2288 }
2289 EClass.pc.party.AddMemeber(this);
2290 if (EClass._zone.IsTown)
2291 {
2293 }
2294 }
Chara CreateReplacement()
Definition: Chara.cs:8009
void _MakeAlly()
Definition: Chara.cs:2296
virtual bool IsTown
Definition: Zone.cs:223
void RefreshListCitizen()
Definition: Zone.cs:3572

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

8155 {
8156 return DNA.GenerateGene(this, DNA.Type.Brain);
8157 }
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 8149 of file Chara.cs.

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

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

Referenced by ActEffect.GeneMiracle(), ActEffect.LoveMiracle(), Card.SpawnLoot(), and Zone.TryGenerateEvolved().

◆ MakeGrave()

void Chara.MakeGrave ( string  lastword)
inline

Definition at line 5222 of file Chara.cs.

5223 {
5224 if (!EClass._zone.IsRegion)
5225 {
5226 List<string> list = new List<string> { "930", "931", "947", "948", "949", "950", "951", "952" };
5227 if (IsPC && EClass.rnd(2) == 0 && EClass.pc.things.Find("letter_will") != null)
5228 {
5229 list = new List<string> { "944", "946", "backerGrave", "backerGrave2" };
5230 }
5231 Thing thing = ThingGen.Create(list.RandomItem());
5232 thing.MakeRefFrom(this);
5233 if (!lastword.IsEmpty())
5234 {
5235 thing.c_note = lastword;
5236 }
5237 thing.isModified = true;
5238 EClass._zone.AddCard(thing, pos).Install();
5239 }
5240 }
Card MakeRefFrom(string id)
Definition: Card.cs:5709

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

2340 {
2341 ReleaseMinion();
2342 Hostility hostility2 = (base.c_originalHostility = (_master.IsPCFaction ? Hostility.Ally : _master.hostility));
2343 this.hostility = hostility2;
2344 base.c_uidMaster = _master.uid;
2345 base.c_minionType = type;
2346 master = _master;
2347 Refresh();
2348 }
int uid
Definition: Card.cs:122

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

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

◆ MakePartyMemeber()

void Chara.MakePartyMemeber ( )
inline

Definition at line 2270 of file Chara.cs.

2271 {
2272 _MakeAlly();
2273 EClass.pc.party.AddMemeber(this);
2274 }

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

◆ ModAffinity()

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

Definition at line 7931 of file Chara.cs.

7932 {
7933 if (c == this)
7934 {
7935 return;
7936 }
7937 if (IsPC)
7938 {
7939 c.ModAffinity(EClass.pc, a, show);
7940 }
7941 else
7942 {
7944 {
7945 return;
7946 }
7947 int num = StatsHygiene.GetAffinityMod(EClass.pc.hygiene.GetPhase()) + (HasElement(417) ? 30 : 0) + (EClass.pc.HasCondition<ConSmoking>() ? (-30) : 0);
7948 if (IsPCFaction && homeBranch != null)
7949 {
7950 num += (int)Mathf.Sqrt(homeBranch.Evalue(2117)) * 5;
7951 }
7952 bool flag = a > 0;
7953 if (flag)
7954 {
7955 a = a * num / 100;
7956 if (affinity.GetLunchChance() > EClass.rnd(100) && GetInt(71) >= 0 && GetInt(71) < EClass.world.date.GetRaw())
7957 {
7958 SetInt(71, -1);
7959 }
7960 }
7961 if (show)
7962 {
7963 if (a == 0)
7964 {
7965 if (!showOnlyEmo)
7966 {
7967 Say("affinityNone", this, c);
7968 }
7969 }
7970 else
7971 {
7972 ShowEmo((!flag) ? Emo.angry : Emo.love);
7973 c.ShowEmo(flag ? Emo.love : Emo.sad);
7974 if (!showOnlyEmo)
7975 {
7976 Say(flag ? "affinityPlus" : "affinityMinus", this, c);
7977 }
7978 }
7979 }
7980 if (c.IsPC)
7981 {
7982 a = affinity.Mod(a);
7983 }
7984 }
7985 }
int Mod(int a)
Definition: Affinity.cs:192
int GetLunchChance()
Definition: Affinity.cs:86
Stats hygiene
Definition: Chara.cs:1152
int GetRaw(int offsetHours=0)
Definition: Date.cs:326
int Evalue(int ele)
static int GetAffinityMod(int phase)
Definition: StatsHygiene.cs:19
virtual bool CanChangeAffinity
Definition: Trait.cs:560

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

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

◆ ModCorruption()

void Chara.ModCorruption ( int  a)
inline

Definition at line 9815 of file Chara.cs.

9816 {
9817 if (a > 0)
9818 {
9819 if (Evalue(962) >= 25 || (ResistLv(962) > 0 && EClass.rnd(ResistLv(962) + 1) != 0))
9820 {
9821 return;
9822 }
9823 int num = Evalue(412);
9824 if (num != 0)
9825 {
9826 float num2 = (float)a * 100f / (float)Mathf.Max(100 + num * 2, 10);
9827 a = (int)num2 + ((EClass.rndf(1f) < num2 % 1f) ? 1 : 0);
9828 }
9829 }
9830 if (a == 0)
9831 {
9832 return;
9833 }
9834 int num3 = (corruption + a) / 100 - corruption / 100;
9835 for (int i = 0; i < Mathf.Abs(num3); i++)
9836 {
9837 if (!MutateRandom((num3 > 0) ? 1 : (-1), 100, ether: true))
9838 {
9839 break;
9840 }
9841 }
9842 corruption += a;
9843 int num4 = 0;
9844 foreach (Element value in elements.dict.Values)
9845 {
9846 if (value.source.category == "ether")
9847 {
9848 num4 += value.Value;
9849 }
9850 }
9851 if (num4 > 0 && IsPC)
9852 {
9853 Tutorial.Reserve("ether");
9854 }
9855 corruption = num4 * 100 + corruption % 100;
9856 }
bool MutateRandom(int vec=0, int tries=100, bool ether=false, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:9974
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 9764 of file Chara.cs.

9765 {
9766 if (!HasElement(450))
9767 {
9768 long num = bio.height;
9769 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
9770 if (num < 1)
9771 {
9772 num = 1L;
9773 }
9774 if (num > 999999999)
9775 {
9776 num = 999999999L;
9777 }
9778 if (num != bio.height)
9779 {
9780 bio.height = (int)num;
9781 Say((a > 0) ? "height_gain" : "height_lose", this);
9782 }
9783 }
9784 }
int height
Definition: Biography.cs:53

◆ ModTempElement()

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

Definition at line 10227 of file Chara.cs.

10228 {
10229 if (a < 0 && !naturalDecay && HasElement(EClass.sources.elements.alias["sustain_" + EClass.sources.elements.map[ele].alias]?.id ?? 0))
10230 {
10231 return;
10232 }
10233 bool flag = HasElement(1215);
10234 if (tempElements == null)
10235 {
10237 tempElements.SetParent(this);
10238 }
10239 if (a > 0 && flag)
10240 {
10241 a = a * 150 / 100;
10242 }
10243 int num = elements.ValueWithoutLink(ele);
10244 int num2 = Mathf.Abs(num) + 100;
10245 int num3 = num2 / (flag ? 2 : 4);
10246 int num4 = -num - 100;
10247 int num5 = tempElements.Base(ele);
10248 int num6 = num5 + a;
10249 if (onlyRenew)
10250 {
10251 num3 = Mathf.Min(a, num3);
10252 num4 = Mathf.Max(a, -num2 / 3);
10253 }
10254 if (a > 0 && num6 > num3)
10255 {
10256 a = ((num3 > num5) ? (num3 - num5) : 0);
10257 }
10258 if (a < 0 && num6 < num4)
10259 {
10260 a = ((num4 < num5) ? (num4 - num5) : 0);
10261 }
10262 Element element = tempElements.ModBase(ele, a);
10263 if (element.vBase == 0)
10264 {
10265 tempElements.Remove(element.id);
10266 if (tempElements.dict.Count == 0)
10267 {
10268 tempElements = null;
10269 }
10270 }
10271 }
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 9786 of file Chara.cs.

9787 {
9788 if (HasElement(450) || a == 0)
9789 {
9790 return;
9791 }
9792 long num = bio.weight;
9793 long num2 = bio.height;
9794 long num3 = num2 * num2 * 18 / 25000;
9795 long num4 = num2 * num2 * 24 / 10000;
9796 if (ignoreLimit || (num > num3 && num < num4))
9797 {
9798 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
9799 if (num < 1)
9800 {
9801 num = 1L;
9802 }
9803 if (num > 999999999)
9804 {
9805 num = 999999999L;
9806 }
9807 if (num != bio.weight)
9808 {
9809 bio.weight = (int)num;
9810 Say((a > 0) ? "weight_gain" : "weight_lose", this);
9811 }
9812 }
9813 }
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 2608 of file Chara.cs.

2609 {
2610 if (!newPoint.sourceBlock.tileType.IsBlockPass && (!checkWall || (Dist(newPoint) <= 1 && CanMoveTo(newPoint, allowDestroyPath: false))) && _Move(newPoint, MoveType.Force) == MoveResult.Success && ai.Current.CancelWhenMoved)
2611 {
2612 ai.Current.TryCancel(c);
2613 }
2614 }
bool TryCancel(Card c)
Definition: AIAct.cs:266
virtual bool CancelWhenMoved
Definition: AIAct.cs:96
override MoveResult _Move(Point newPoint, MoveType type=MoveType.Walk)
Definition: Chara.cs:2742

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

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

◆ MoveHome() [1/2]

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

Definition at line 3444 of file Chara.cs.

3445 {
3446 MoveHome(EClass.game.world.FindZone(id), x, z);
3447 }
void MoveHome(string id, int x=-1, int z=-1)
Definition: Chara.cs:3444
new World world
Definition: Game.cs:176

References Spatial.FindZone(), EClass.game, and Game.world.

Referenced by OnBanish(), Zone_Nymelle.OnBeforeSimulate(), QuestVernis.OnChangePhase(), QuestDialog.OnDropReward(), and DramaOutcome.QuestExploration_AfterComplete().

◆ MoveHome() [2/2]

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

Definition at line 3449 of file Chara.cs.

3450 {
3451 if (isDead)
3452 {
3453 Revive();
3454 }
3455 else
3456 {
3457 Cure(CureType.Death);
3458 }
3459 CureCondition<ConSuspend>();
3460 if (IsPCParty)
3461 {
3463 }
3464 FactionBranch factionBranch = homeBranch;
3465 if (x == -1)
3466 {
3467 x = 50;
3468 }
3469 if (z == -1)
3470 {
3471 z = 50;
3472 }
3473 Point point = new Point(x, z);
3474 if (zone.IsActiveZone)
3475 {
3476 point = point.GetNearestPoint(allowBlock: false, allowChara: false);
3477 }
3478 zone.AddCard(this, point);
3479 SetHomeZone(zone);
3480 global.transition = new ZoneTransition
3481 {
3482 state = ZoneTransition.EnterState.Dead,
3483 x = point.x,
3484 z = point.z
3485 };
3486 orgPos = new Point(x, z);
3487 if (factionBranch != null)
3488 {
3490 factionBranch.policies.Validate();
3491 }
3492 }
void RefreshWorkElements(ElementContainer parent=null)
Definition: Chara.cs:9004
Chara SetHomeZone(Zone zone)
Definition: Chara.cs:1427
PolicyManager policies
bool IsActiveZone
Definition: Zone.cs:495

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

◆ MoveNeighborDefinitely()

bool Chara.MoveNeighborDefinitely ( )
inline

Definition at line 2590 of file Chara.cs.

2591 {
2592 List<Point> list = new List<Point>();
2593 pos.ForeachNeighbor(delegate(Point p)
2594 {
2595 list.Add(p.Copy());
2596 });
2597 list.Shuffle();
2598 foreach (Point item in list)
2599 {
2600 if (!item.Equals(pos) && !item.HasChara && TryMove(item) == MoveResult.Success)
2601 {
2602 return true;
2603 }
2604 }
2605 return false;
2606 }
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 2576 of file Chara.cs.

2577 {
2578 Point randomNeighbor = pos.GetRandomNeighbor();
2579 if (!randomNeighbor.Equals(pos) && !randomNeighbor.HasChara && HasAccess(randomNeighbor))
2580 {
2581 if ((race.tag.Contains("water") || source.tag.Contains("water")) && pos.cell.IsTopWaterAndNoSnow && !randomNeighbor.IsDeepWater)
2582 {
2583 return false;
2584 }
2585 return TryMove(randomNeighbor) == MoveResult.Success;
2586 }
2587 return false;
2588 }
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 3332 of file Chara.cs.

3333 {
3334 if (z == currentZone)
3335 {
3336 return;
3337 }
3338 if (HasCondition<ConInvulnerable>())
3339 {
3340 RemoveCondition<ConInvulnerable>();
3341 }
3342 if (IsPC)
3343 {
3344 EClass.player.nextZone = z;
3346 {
3349 {
3350 if (EClass.player.returnInfo != null)
3351 {
3352 EClass.player.returnInfo.turns += 5;
3353 }
3355 {
3356 EClass.game.Save(isAutoSave: true);
3357 }
3358 }
3359 EClass.player.deathZoneMove = false;
3360 }
3362 if (currentZone.instance != null)
3363 {
3365 z = EClass.game.spatials.Find(instance.uidZone) ?? EClass.pc.homeZone;
3366 transition = new ZoneTransition
3367 {
3368 state = instance.ReturnState,
3369 x = instance.x,
3370 z = instance.z
3371 };
3372 instance.OnLeaveZone();
3373 Debug.Log(z);
3374 }
3375 EInput.Consume(consumeAxis: true);
3376 EClass.player.uidLastZone = currentZone.uid;
3378 {
3380 {
3381 Msg.Say("enterZone", z.Name);
3382 }
3383 else
3384 {
3385 if (z.IsRegion)
3386 {
3387 Msg.Say("leaveZone", currentZone.Name);
3388 }
3389 else if (z.id != currentZone.id)
3390 {
3391 Msg.Say("enterZone", z.Name);
3392 }
3393 EClass.player.lastZonePos = pos.Copy();
3394 }
3395 EClass.player.lastTransition = transition;
3396 }
3397 foreach (Chara item in EClass._map.charas.Where((Chara c) => c.IsPCPartyMinion && c.master != EClass.pc).ToList())
3398 {
3400 }
3401 EClass.player.listSummon = EClass._map.charas.Where((Chara c) => c.c_uidMaster != 0 && c.FindMaster() == EClass.pc && c.c_minionType == MinionType.Default).ToList();
3402 foreach (Chara item2 in EClass.player.listSummon)
3403 {
3404 EClass._zone.RemoveCard(item2);
3405 }
3406 }
3407 if (party != null && party.leader == this)
3408 {
3409 foreach (Chara member in party.members)
3410 {
3411 if (member != this && !member.isDead && member.parent is Zone)
3412 {
3413 member.MoveZone(z);
3414 }
3415 }
3416 }
3417 if (global == null)
3418 {
3419 Debug.Log(base.Name);
3420 return;
3421 }
3422 transition.uidLastZone = currentZone?.uid ?? 0;
3423 global.transition = transition;
3424 if (z.IsActiveZone)
3425 {
3426 Point spawnPos = z.GetSpawnPos(this);
3427 global.transition = null;
3428 if (IsPC)
3429 {
3430 EClass.player.lastTransition = null;
3431 }
3432 z.AddCard(this, spawnPos);
3433 if (IsBranchMember())
3434 {
3436 }
3437 }
3438 else
3439 {
3440 z.AddCard(this);
3441 }
3442 }
MinionType c_minionType
Definition: Card.cs:988
bool IsBranchMember()
Definition: Chara.cs:6579
GlobalData global
Definition: Chara.cs:76
Chara FindMaster()
Definition: Chara.cs:2385
bool ignoreAutoSave
Definition: CoreDebug.cs:126
bool Save(bool isAutoSave=false, bool silent=false)
Definition: Game.cs:1028
RoomManager rooms
Definition: Map.cs:31
Chara leader
Definition: Party.cs:31
bool deathZoneMove
Definition: Player.cs:1169
List< Chara > listSummon
Definition: Player.cs:1221
ReturnInfo returnInfo
Definition: Player.cs:866
bool simulatingZone
Definition: Player.cs:1179
void AssignCharas()
Definition: RoomManager.cs:39
int uid
Definition: Spatial.cs:70
string id
Definition: Spatial.cs:13
virtual ZoneTransition.EnterState ReturnState
Definition: ZoneInstance.cs:26
virtual void OnLeaveZone()
Definition: ZoneInstance.cs:36
virtual bool WillAutoSave
Definition: Zone.cs:263
Point GetSpawnPos(Chara c, ZoneTransition.EnterState destState=ZoneTransition.EnterState.Auto)
Definition: Zone.cs:1335

References EClass._map, EClass._zone, Zone.AddCard(), RoomManager.AssignCharas(), Card.c_minionType, Card.c_uidMaster, Map.charas, EInput.Consume(), Player.deathZoneMove, EClass.debug, Debug, SpatialManager.Find(), FindMaster(), EClass.game, Zone.GetSpawnPos(), Zone.GetTopZone(), homeZone, Spatial.id, CoreDebug.ignoreAutoSave, Zone.instance, Zone.IsActiveZone, isDead, Zone.IsPCFaction, IsPCPartyMinion, Spatial.IsRegion, item, Party.leader, Player.listSummon, 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 3324 of file Chara.cs.

3325 {
3327 {
3328 state = state
3329 });
3330 }

◆ MutateRandom()

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

Definition at line 9974 of file Chara.cs.

9975 {
9976 if (!ether && vec >= 0 && HasElement(406) && EClass.rnd(5) != 0)
9977 {
9978 Say("resistMutation", this);
9979 return false;
9980 }
9981 IEnumerable<SourceElement.Row> ie = EClass.sources.elements.rows.Where((SourceElement.Row a) => a.category == (ether ? "ether" : "mutation") && !a.tag.Contains("noRandomMutation"));
9982 for (int i = 0; i < tries; i++)
9983 {
9984 SourceElement.Row row = ie.RandomItem();
9985 if (i == 0 && vec < 0 && ether && base.c_corruptionHistory != null && base.c_corruptionHistory.Count > 0)
9986 {
9987 row = EClass.sources.elements.map[base.c_corruptionHistory.LastItem()];
9988 base.c_corruptionHistory.RemoveAt(base.c_corruptionHistory.Count - 1);
9989 if (base.c_corruptionHistory.Count == 0)
9990 {
9991 base.c_corruptionHistory = null;
9992 }
9993 }
9994 Element element = elements.GetElement(row.id);
9995 int num = 1;
9996 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))
9997 {
9998 continue;
9999 }
10000 if (element == null && !row.aliasParent.IsEmpty() && elements.Has(row.aliasParent))
10001 {
10002 row = EClass.sources.elements.alias[row.aliasParent];
10003 element = elements.GetElement(row.id);
10004 }
10005 bool flag = row.tag.Contains("neg");
10006 if (vec > 0)
10007 {
10008 if ((state >= BlessedState.Blessed && flag) || (state <= BlessedState.Cursed && !flag))
10009 {
10010 continue;
10011 }
10012 }
10013 else if (vec < 0 && ((state >= BlessedState.Blessed && !flag) || (state <= BlessedState.Cursed && flag)))
10014 {
10015 continue;
10016 }
10017 bool flag2 = true;
10018 if (element != null)
10019 {
10020 num = element.Value + ((vec != 0) ? vec : ((EClass.rnd(2) == 0) ? 1 : (-1)));
10021 if (num > element.source.max)
10022 {
10023 num = element.source.max - 1;
10024 }
10025 flag = (flag && num > element.Value) || (!flag && num < element.Value);
10026 flag2 = num > element.Value;
10027 if (vec > 0 && !flag2)
10028 {
10029 continue;
10030 }
10031 }
10032 Say(flag2 ? "mutation_gain" : "mutation_loose", this);
10033 SetFeat(row.id, num);
10034 if (flag2 && ether)
10035 {
10036 if (base.c_corruptionHistory == null)
10037 {
10038 base.c_corruptionHistory = new List<int>();
10039 }
10040 base.c_corruptionHistory.Add(row.id);
10041 if (IsPCFaction)
10042 {
10043 Element element2 = elements.GetElement(row.id);
10044 WidgetPopText.Say("popEther".lang(element2.Name, base.Name));
10045 }
10047 {
10048 EClass.player.flags.gotEtherDisease = true;
10049 Thing thing = ThingGen.Create("parchment");
10050 thing.SetStr(53, "letter_ether");
10051 Thing thing2 = ThingGen.Create("1165");
10052 thing2.SetBlessedState(BlessedState.Normal);
10053 Thing p = ThingGen.CreateParcel(null, thing2, thing);
10055 }
10056 }
10057 if (EClass.core.IsGameStarted && pos != null)
10058 {
10059 PlaySound(ether ? "mutation_ether" : "mutation");
10060 PlayEffect("mutation");
10062 Say(row.GetText(flag ? "textDec" : "textInc", returnNull: true) ?? row.alias, this);
10063 }
10064 return true;
10065 }
10066 Say("nothingHappens");
10067 return false;
10068 }
void SetStr(int id, string value=null)
Definition: BaseCard.cs:63
virtual void SetBlessedState(BlessedState s)
Definition: Card.cs:3895
bool IsGameStarted
Definition: Core.cs:84
bool Has(int ele)
Color MutateBad
Definition: MsgColors.cs:21
Color MutateGood
Definition: MsgColors.cs:19
bool gotEtherDisease
Definition: Player.cs:467
static Thing CreateParcel(string idLang=null, params Thing[] things)
Definition: ThingGen.cs:42
void SendPackage(Thing p)
Definition: World.cs:68

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

◆ OnAdvanceDay()

void Chara.OnAdvanceDay ( )
inline

Definition at line 10120 of file Chara.cs.

10121 {
10122 if (_historyFood != null)
10123 {
10124 while (_historyFood.Count > 5)
10125 {
10126 _historyFood.RemoveAt(_historyFood.Count - 1);
10127 }
10128 if (_historyFood[0].Count > 0)
10129 {
10130 _historyFood.Insert(0, new List<string>());
10131 }
10132 }
10133 }

Referenced by GameDate.AdvanceDay().

◆ OnBanish()

void Chara.OnBanish ( )
inline

Definition at line 1441 of file Chara.cs.

1442 {
1443 if (!IsGlobal)
1444 {
1445 return;
1446 }
1447 memberType = FactionMemberType.Default;
1448 foreach (Thing item in things.List((Thing a) => a.HasTag(CTAG.godArtifact)).ToList())
1449 {
1451 }
1452 UniqueData uniqueData = base.c_uniqueData;
1453 if (uniqueData != null)
1454 {
1455 Debug.Log(uniqueData.uidZone + "/" + EClass.game.spatials.map.ContainsKey(uniqueData.uidZone) + "/" + uniqueData.x + "/" + uniqueData.y);
1456 }
1457 if (uniqueData != null && EClass.game.spatials.map.ContainsKey(uniqueData.uidZone))
1458 {
1459 MoveHome(EClass.game.spatials.map[uniqueData.uidZone] as Zone, uniqueData.x, uniqueData.y);
1460 return;
1461 }
1462 Zone z = EClass.game.spatials.Find("somewhere");
1463 if (trait is TraitAdventurer)
1464 {
1465 z = EClass.world.region.ListTowns().RandomItem();
1466 SetHomeZone(z);
1467 }
1468 MoveZone(z, ZoneTransition.EnterState.RandomVisit);
1469 }
void PickOrDrop(Point p, string idThing, int idMat=-1, int num=1, bool msg=true)
Definition: Chara.cs:4283
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 1508 of file Chara.cs.

1509 {
1510 if (source.job == "*r")
1511 {
1512 base.c_idJob = EClass.sources.jobs.rows.Where((SourceJob.Row j) => j.playable < 4).RandomItem().id;
1513 }
1514 if (bp.idJob != null)
1515 {
1516 base.c_idJob = bp.idJob;
1517 }
1518 if (bp.idRace != null)
1519 {
1520 base.c_idRace = bp.idRace;
1521 }
1522 }
CardBlueprint bp
Definition: Card.cs:77
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 1524 of file Chara.cs.

1525 {
1526 if (source.tag.Contains("boss"))
1527 {
1528 bossText = true;
1529 }
1530 int num = ((bp.lv != -999) ? bp.lv : base.LV);
1531 if (trait.AdvType == TraitChara.Adv_Type.Adv || trait.AdvType == TraitChara.Adv_Type.Adv_Fairy)
1532 {
1533 if (ListAdvRace.Count == 0)
1534 {
1535 ListAdvRace = EClass.sources.races.rows.Where((SourceRace.Row a) => a.playable <= 1 && a.id != "fairy").ToList();
1536 ListAdvJob = EClass.sources.jobs.rows.Where((SourceJob.Row a) => a.playable <= 4).ToList();
1537 }
1538 if (trait.AdvType == TraitChara.Adv_Type.Adv)
1539 {
1540 base.c_idRace = ListAdvRace.RandomItem().id;
1541 }
1542 base.c_idJob = ListAdvJob.RandomItem().id;
1543 _race = null;
1544 _job = null;
1545 num = 10 + EClass.rnd(40);
1546 }
1547 bio = new Biography();
1548 bio.Generate(this);
1549 if (source.idActor.Length != 0 && source.idActor[0] == "pcc" && pccData == null)
1550 {
1551 pccData = PCCData.Create(IDPCCBodySet);
1552 if (source.idActor.Length > 2)
1553 {
1554 pccData.SetPart("body", IDPCCBodySet, source.idActor[2]);
1555 }
1556 else
1557 {
1558 pccData.Randomize(IDPCCBodySet);
1559 }
1560 }
1561 if (source.mainElement.Length != 0)
1562 {
1563 int _genLv = Mathf.Min(genLv, 100);
1564 List<Tuple<string, int, int>> list = new List<Tuple<string, int, int>>();
1565 string[] mainElement = source.mainElement;
1566 for (int i = 0; i < mainElement.Length; i++)
1567 {
1568 string[] array = mainElement[i].Split('/');
1569 SourceElement.Row row = EClass.sources.elements.alias["ele" + array[0]];
1570 int num2 = source.LV * row.eleP / 100;
1571 if (list.Count == 0 || num2 < _genLv || array[0] == bp.idEle)
1572 {
1573 list.Add(new Tuple<string, int, int>(array[0], (array.Length > 1) ? int.Parse(array[1]) : 0, num2));
1574 }
1575 }
1576 Tuple<string, int, int> tuple = list.RandomItemWeighted((Tuple<string, int, int> a) => 10000 / (100 + (_genLv - a.Item3) * 25));
1577 if (!bp.idEle.IsEmpty())
1578 {
1579 tuple = list.Where((Tuple<string, int, int> a) => a.Item1 == bp.idEle || "ele" + a.Item1 == bp.idEle).FirstOrDefault() ?? tuple;
1580 }
1581 SetMainElement(tuple.Item1, (tuple.Item2 == 0) ? 10 : tuple.Item2, elemental: true);
1582 if (list.Count >= 2)
1583 {
1584 num = tuple.Item3 + base.LV - source.LV;
1585 }
1586 }
1587 if (source.name == "*r")
1588 {
1589 base.c_altName = NameGen.getRandomName();
1590 }
1591 if (source.GetText("aka") == "*r" || trait.UseRandomAlias)
1592 {
1593 _alias = AliasGen.GetRandomAlias();
1594 }
1595 happiness = EClass.rnd(100);
1596 contribution = EClass.rnd(100);
1597 RerollHobby();
1598 _idTimeTable = ((EClass.rnd(5) == 0) ? 1 : 0);
1599 ApplyRace();
1600 ApplyJob();
1601 ChangeMaterial(source.defMat.IsEmpty(race.material), ignoreFixedMaterial: true);
1602 if (num != source.LV)
1603 {
1604 SetLv(num);
1605 }
1606 if (base.LV > 5 && race.id == "mutant")
1607 {
1608 for (int j = 0; j < Mathf.Min(1 + base.LV / 5, 22); j++)
1609 {
1610 SetFeat(1644, j + 1);
1611 }
1612 }
1613 switch (id)
1614 {
1615 case "putty_mech_b":
1616 case "putty_mech":
1617 case "robot":
1618 SetFeat(1248, 1 + EClass.rnd(5));
1619 break;
1620 }
1621 InitStats();
1622 body.SetOwner(this);
1624 if (race.EQ.Length != 0 || !source.equip.IsEmpty())
1625 {
1626 TryRestock(onCreate: true);
1627 }
1628 switch (id)
1629 {
1630 case "dodo":
1631 base.idSkin = EClass.rnd(4);
1632 break;
1633 case "putty_snow":
1634 if (EClass.rnd(100) == 0 || EClass.debug.enable)
1635 {
1636 base.idSkin = EClass.rnd(4);
1637 }
1638 break;
1639 case "snail":
1640 base.idSkin = 5;
1641 break;
1642 case "olderyoungersister":
1643 base.idSkin = 1;
1644 break;
1645 case "sister_undead":
1646 case "dog":
1647 case "cat":
1648 base.idSkin = EClass.rnd(sourceCard.tiles.Length);
1649 if (id == "sister_undead" && EClass.rnd(10) == 0)
1650 {
1652 if (row2 != null && (!EClass.player.doneBackers.Contains(row2.id) || EClass.core.config.test.ignoreBackerDestoryFlag))
1653 {
1654 ApplyBacker(row2.id);
1655 }
1656 }
1657 break;
1658 case "baby":
1659 case "ika":
1660 SetFeat(1232, 3);
1661 break;
1662 }
1663 if (HasTag(CTAG.random_color))
1664 {
1665 DyeRandom();
1666 }
1667 SetAI(new NoGoal());
1668 if (!source.faith.IsEmpty())
1669 {
1670 SetFaith(source.faith);
1671 }
1672 else if (EClass.game.activeZone != null && EClass.game.activeZone.id == "foxtown")
1673 {
1675 }
1676 else if (EClass.game.activeZone != null && EClass.game.activeZone.id == "foxtown_nefu")
1677 {
1679 }
1680 else
1681 {
1682 SetFaith(EClass.game.religions.GetRandomReligion(onlyJoinable: true, EClass.rnd(10) == 0));
1683 }
1684 _affinity = 0;
1685 interest = 100;
1688 Refresh();
1689 stamina.value = stamina.max;
1690 mana.value = mana.max;
1691 isCreated = true;
1692 }
static int indexSister
void Generate(Chara c)
Definition: Biography.cs:323
void ClampInitialSkill()
Definition: Card.cs:2943
void DyeRandom()
Definition: Card.cs:6006
void ApplyBacker(int bid)
Definition: Card.cs:6994
int genLv
Definition: Card.cs:194
void SetOwner(Chara chara, bool deserialized=false)
Definition: CharaBody.cs:18
string IDPCCBodySet
Definition: Chara.cs:491
int _affinity
Definition: Chara.cs:303
void SetMainElement(string id, int v=0, bool elemental=false)
Definition: Chara.cs:2075
int happiness
Definition: Chara.cs:108
int contribution
Definition: Chara.cs:18
void CalculateMaxStamina()
Definition: Chara.cs:2007
bool isCreated
Definition: Chara.cs:136
int _idTimeTable
Definition: Chara.cs:341
void TryRestock(bool onCreate)
Definition: Chara.cs:4678
static List< SourceRace.Row > ListAdvRace
Definition: Chara.cs:166
void InitStats(bool onDeserialize=false)
Definition: Chara.cs:9221
bool bossText
Definition: Chara.cs:144
static List< SourceJob.Row > ListAdvJob
Definition: Chara.cs:168
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 1327 of file Chara.cs.

1328 {
1329 isCreated = true;
1330 _cbits1.Bits = (uint)_cints[0];
1331 InitStats(onDeserialize: true);
1332 body.SetOwner(this, deserialized: true);
1333 elements.ApplyElementMap(base.uid, SourceValueType.Chara, job.elementMap, base.DefaultLV);
1334 elements.ApplyElementMap(base.uid, SourceValueType.Chara, race.elementMap, base.DefaultLV);
1335 if (global != null && global.goal != null)
1336 {
1337 global.goal.SetOwner(this);
1338 }
1339 if (IsPCC)
1340 {
1341 pccData.state = (base.isCensored ? PCCState.Naked : PCCState.Normal);
1342 }
1343 if (tempElements != null)
1344 {
1345 tempElements.SetParent(this);
1346 }
1347 UpdateAngle();
1349 Refresh();
1350 if (source.tag.Contains("boss"))
1351 {
1352 bossText = true;
1353 }
1354 sharedCheckTurn = EClass.rnd(200);
1355 }
int sharedCheckTurn
Definition: Chara.cs:118
void UpdateAngle()
Definition: Chara.cs:3575
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 8353 of file Chara.cs.

8354 {
8355 Say("give_erohon", this);
8356 AddCondition<ConParalyze>(50, force: true);
8357 AddCondition<ConConfuse>(50, force: true);
8358 AddCondition<ConFear>(1000, force: true);
8359 ModAffinity(EClass.pc, 100);
8360 t.Destroy();
8361 Talk("pervert");
8362 }

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

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

◆ OnInsulted()

void Chara.OnInsulted ( )
inline

Definition at line 8159 of file Chara.cs.

8160 {
8161 if (!isDead)
8162 {
8163 if (HasElement(1231))
8164 {
8165 Talk("insulted");
8166 AddCondition<ConEuphoric>(100 * Evalue(1231));
8167 }
8168 else if (EClass.rnd(20) == 0)
8169 {
8170 SetFeat(1231, 1, msg: true);
8171 }
8172 }
8173 }

References EClass.rnd().

Referenced by AI_Idle.Run().

◆ OnSerializing()

override void Chara.OnSerializing ( )
inlineprotectedvirtual

Reimplemented from Card.

Definition at line 1312 of file Chara.cs.

1313 {
1314 if (enemy != null)
1315 {
1316 SetInt(55, enemy.uid);
1317 }
1318 _cints[0] = (int)_cbits1.Bits;
1319 List<BodySlot> slots = body.slots;
1320 rawSlots = new int[slots.Count];
1321 for (int i = 0; i < slots.Count; i++)
1322 {
1323 rawSlots[i] = slots[i].elementId;
1324 }
1325 }
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 9726 of file Chara.cs.

9727 {
9728 if (days < 1)
9729 {
9730 days = 1;
9731 }
9732 int num = power * days;
9733 if (stamina.value < 0)
9734 {
9735 stamina.Set(1);
9736 }
9737 if (isWeakToSunlight && isSunLit)
9738 {
9739 base.hp = 0;
9740 if (mana.value > 0)
9741 {
9742 mana.Set(0);
9743 }
9744 AddCondition<ConBurning>(1000, force: true);
9745 }
9746 else
9747 {
9748 HealHP(num);
9749 stamina.Mod(10 + 25 * num / 100 * (100 + elements.GetFeatRef(1642)) / 100);
9750 mana.Mod(num);
9751 }
9752 if (IsPCFaction)
9753 {
9754 hunger.Mod(20);
9755 }
9756 sleepiness.Set(0);
9757 if (!IsMinion)
9758 {
9759 interest = 100;
9760 }
9761 Cure(CureType.Sleep, power);
9762 }
virtual void HealHP(int a, HealSource origin=HealSource.None)
Definition: Card.cs:4003
bool isWeakToSunlight
Definition: Chara.cs:152
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 9706 of file Chara.cs.

9707 {
9708 bool isSunLit = pos.IsSunLit;
9709 TraitPillow traitPillow = pos.FindThing<TraitPillow>();
9710 int num = bed?.Power ?? 20;
9711 if (traitPillow != null)
9712 {
9713 num += traitPillow.owner.Power / 2;
9714 }
9715 if (bed != null)
9716 {
9717 num += bed.Evalue(750) * 5;
9718 if (bed.trait is TraitBedCoffin)
9719 {
9720 isSunLit = false;
9721 }
9722 }
9723 OnSleep(num, days, isSunLit);
9724 }
void OnSleep(Thing bed=null, int days=1)
Definition: Chara.cs:9706
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 2174 of file Chara.cs.

2175 {
2176 return s switch
2177 {
2178 "é ­" => 30,
2179 "首" => 31,
2180 "体" => 32,
2181 "背" => 33,
2182 "手" => 35,
2183 "指" => 36,
2184 "è…•" => 34,
2185 "è…°" => 37,
2186 "è¶³" => 39,
2187 _ => -1,
2188 };
2189 }

Referenced by ApplyRace(), and ResetBody().

◆ PerformWork()

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

Definition at line 9179 of file Chara.cs.

9180 {
9181 Hobby hobby = new Hobby();
9182 hobby.id = session.id;
9183 WorkSummary workSummary = _workSummary;
9184 hobby.GetAI(this).OnPerformWork(IsRealTime);
9185 if (!isHobby)
9186 {
9187 workSummary.progress += EClass.rnd(5) + 5;
9188 }
9189 int num = PerformWork(hobby, 0, isHobby);
9190 int num2 = PerformWork(hobby, 1, isHobby);
9191 int num3 = PerformWork(hobby, 2, isHobby);
9192 int num4 = PerformWork(hobby, 3, isHobby);
9193 workSummary.money += num;
9194 workSummary.food += num2;
9195 workSummary.knowledge += num3;
9196 workSummary.material += num4;
9197 int PerformWork(Hobby work, int idx, bool isHobby)
9198 {
9199 if (idx >= work.source.resources.Length)
9200 {
9201 return 0;
9202 }
9203 int num5 = work.source.resources[idx];
9204 int num6 = num5;
9205 num5 = Rand.Range(num5 * (100 - work.source.resources[idx]) / 100, num5);
9206 num5 = num5 * (isHobby ? 50 : 100) * session.efficiency / 10000;
9207 if (num6 > 0 && num5 <= 0)
9208 {
9209 num5 = 1;
9210 }
9211 return num5;
9212 }
9213 }
virtual void OnPerformWork(bool realtime)
Definition: AIWork.cs:150
void PerformWork(WorkSession session, bool isHobby=false, bool IsRealTime=false)
Definition: Chara.cs:9179
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 4303 of file Chara.cs.

4304 {
4305 if (t.trait is TraitCard && t.isNew && EClass.game.config.autoCollectCard && !t.c_idRefCard.IsEmpty())
4306 {
4308 return t;
4309 }
4310 if (t.parent == this)
4311 {
4312 return t;
4313 }
4314 t = TryPoisonPotion(t);
4315 ThingContainer.DestData dest = things.GetDest(t, tryStack);
4316 if (!dest.IsValid)
4317 {
4318 if (t.parent != EClass._zone)
4319 {
4320 if (IsPC)
4321 {
4322 Say("backpack_full_drop", t);
4323 SE.Drop();
4324 }
4325 return EClass._zone.AddCard(t, pos).Thing;
4326 }
4327 if (IsPC)
4328 {
4329 Say("backpack_full", t);
4330 }
4331 return t;
4332 }
4333 if (dest.stack != null)
4334 {
4335 if (msg)
4336 {
4337 PlaySound("pick_thing");
4338 Say("pick_thing", this, t);
4339 }
4340 t.TryStackTo(dest.stack);
4341 return dest.stack;
4342 }
4343 TryAbsorbRod(t);
4344 if (msg)
4345 {
4346 PlaySound("pick_thing");
4347 Say("pick_thing", this, t);
4348 }
4350 return dest.container.AddThing(t, tryStack);
4351 }
bool isNew
Definition: Card.cs:482
bool TryStackTo(Thing to)
Definition: Card.cs:3397
string c_idRefCard
Definition: Card.cs:1737
void TryReservePickupTutorial(Thing t)
Definition: Chara.cs:4397
Thing TryPoisonPotion(Thing t)
Definition: Chara.cs:4353
void TryAbsorbRod(Thing t)
Definition: Chara.cs:4367
static void Collect(Thing t)
bool autoCollectCard
Definition: Game.cs:51
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 4519 of file Chara.cs.

4520 {
4521 if (held == null)
4522 {
4523 return;
4524 }
4525 Card card = held;
4526 if (IsPC && held.invY == 1)
4527 {
4528 WidgetHotbar.dirtyCurrentItem = true;
4530 held = null;
4531 return;
4532 }
4533 if (held.isChara)
4534 {
4535 DropHeld();
4536 return;
4537 }
4539 {
4540 Say("canOnlyCarry", held);
4541 DropHeld();
4542 return;
4543 }
4544 bool flag = held != things.TryStack(held.Thing);
4545 if (!flag && things.IsOverflowing())
4546 {
4547 if (IsPC)
4548 {
4549 Say("backpack_full_drop", held);
4550 SE.Drop();
4551 }
4552 DropHeld();
4553 return;
4554 }
4555 if (msg)
4556 {
4557 PlaySound("pick_thing");
4558 Say("pick_held", this, card);
4559 if (IsPC && card.id == "statue_weird")
4560 {
4561 Say("statue_pick");
4562 }
4563 }
4564 if (IsPC)
4565 {
4566 WidgetHotbar.dirtyCurrentItem = true;
4567 if (!flag)
4568 {
4570 if (held.GetRootCard() != EClass.pc)
4571 {
4572 Pick(held.Thing, msg: false);
4573 }
4574 }
4575 }
4576 held = null;
4577 }
int invY
Definition: Card.cs:1955
bool IsHotItem
Definition: Card.cs:119
Card DropHeld(Point dropPos=null)
Definition: Chara.cs:4596
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 4283 of file Chara.cs.

4284 {
4285 if (num != 0)
4286 {
4287 PickOrDrop(p, ThingGen.Create(idThing, idMat).SetNum(num), msg);
4288 }
4289 }

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

Referenced by Map.MineObj(), OnBanish(), 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 4291 of file Chara.cs.

4292 {
4293 if (things.GetDest(t).IsValid)
4294 {
4295 Pick(t, msg);
4296 }
4297 else
4298 {
4299 EClass._zone.AddCard(t, p);
4300 }
4301 }

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

◆ Refresh()

void Chara.Refresh ( bool  calledRecursive = false)
inline

Definition at line 1725 of file Chara.cs.

1726 {
1727 if (source == null)
1728 {
1729 Debug.LogError("source is null");
1730 SetSource();
1731 }
1732 if (ride != null && ride.source != null)
1733 {
1734 ride.Refresh(calledRecursive: true);
1735 }
1736 hasTelepathy = false;
1737 isWet = false;
1738 _isLevitating = HasElement(401) || (ride != null && ride._isLevitating);
1740 isWeakToSunlight = HasElement(1251) && !HasElement(431);
1741 base.isHidden = HasElement(415);
1742 foreach (Condition condition in conditions)
1743 {
1744 condition.OnRefresh();
1745 }
1746 if (isWet)
1747 {
1748 base.isHidden = false;
1749 }
1751 SetDirtySpeed();
1752 if (host != null && !calledRecursive && host.source != null)
1753 {
1754 host.Refresh(calledRecursive: true);
1755 }
1756 }
virtual void OnRefresh()
void Refresh(bool calledRecursive=false)
Definition: Chara.cs:1725
bool isWet
Definition: Chara.cs:142
override void SetSource()
Definition: Chara.cs:2063
bool IsUndead
Definition: Chara.cs:891
bool IsHorror
Definition: Chara.cs:915
bool IsMachine
Definition: Chara.cs:903

References _isLevitating, canSeeInvisible, conditions, Debug, Card.HasElement(), hasTelepathy, host, IsHorror, IsMachine, IsMultisize, IsUndead, isWeakToSunlight, isWet, 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 10184 of file Chara.cs.

10185 {
10186 if (faithElements != null)
10187 {
10189 }
10191 if (idFaith == "eyth" && !HasElement(1228))
10192 {
10193 return;
10194 }
10195 SourceReligion.Row row = EClass.sources.religions.map.TryGetValue(idFaith);
10196 if (row == null)
10197 {
10198 return;
10199 }
10201 if (!HasCondition<ConExcommunication>())
10202 {
10203 SourceElement.Row row2 = EClass.sources.elements.alias.TryGetValue("featGod_" + row.id + "1");
10204 if (row2 != null)
10205 {
10206 faithElements.SetBase(row2.id, 1);
10207 }
10208 int[] array = row.elements;
10209 int num = GetPietyValue() * (120 + Evalue(1407) * 15 + Evalue(1228) * 20) / 100;
10210 for (int i = 0; i < array.Length; i += 2)
10211 {
10212 int num2 = array[i + 1] * num / 50;
10213 if (array[i] == 79)
10214 {
10215 num2 = EClass.curve(num2, array[i + 1] * 2, 10, 50);
10216 }
10217 if (num2 >= 20 && array[i] >= 950 && array[i] < 970)
10218 {
10219 num2 = 20;
10220 }
10221 faithElements.SetBase(array[i], Mathf.Max(num2, 1));
10222 }
10223 }
10225 }
string idFaith
Definition: Chara.cs:231
ElementContainer faithElements
Definition: Chara.cs:38
int GetPietyValue()
Definition: Chara.cs:10175
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 1868 of file Chara.cs.

1869 {
1870 if (ride != null && !ride.IsDeadOrSleeping)
1871 {
1873 _Speed = ride._Speed;
1874 info?.AddText("rideSpeed".lang(_Speed.ToString() ?? ""));
1875 }
1876 else if (host != null)
1877 {
1878 if (host.ride == this)
1879 {
1880 _Speed = Evalue(79);
1881 _Speed = _Speed * 100 / Mathf.Clamp(100 + (int)_Speed * ((!race.tag.Contains("noRide")) ? 1 : 5) - base.STR - host.EvalueRiding() * 2 - (race.tag.Contains("ride") ? 50 : 0), 100, 1000);
1882 }
1883 else
1884 {
1885 _Speed = (Evalue(79) + host.Evalue(79)) / 2;
1886 }
1887 }
1888 else
1889 {
1890 _Speed = Evalue(79) + Evalue(407) / 2;
1891 }
1892 if (body.GetSlot(37, onlyEmpty: false)?.thing != null && HasElement(1209) && !HasElement(419))
1893 {
1894 _Speed -= 25L;
1895 info?.AddText(-25L, EClass.sources.elements.map[1209].GetName());
1896 }
1897 if (parasite != null)
1898 {
1899 long speed = _Speed;
1900 _Speed = _Speed * 100 / Mathf.Clamp(120 + parasite.LV * 2 - base.STR - Evalue(227) * 2, 100, 1000);
1901 info?.AddText(_Speed - speed, "parasiteSpeed".lang());
1902 }
1903 if (_Speed < elements.ValueWithoutLink(79) / 3)
1904 {
1906 info?.AddText("minSpeed".lang((elements.ValueWithoutLink(79) / 3).ToString() ?? ""));
1907 }
1908 int num = 100;
1909 if (EClass._zone.map != null && EClass._zone.IsUnderwater)
1910 {
1911 int num2 = Evalue(200);
1912 num = 50 + Mathf.Clamp((int)Mathf.Sqrt(num2) * 5 - EClass._zone.DangerLv / 50, 0, 50) + Mathf.Clamp((int)Mathf.Sqrt(num2), 0, 25);
1913 if (info != null && num != 100)
1914 {
1915 info.AddFix(num - 100, EClass.sources.elements.map[200].GetName().ToTitleCase());
1916 }
1917 }
1918 if (IsPCFaction)
1919 {
1920 switch (burden.GetPhase())
1921 {
1922 case 1:
1923 num -= 10;
1924 info?.AddFix(-10, burden.GetPhaseStr());
1925 break;
1926 case 2:
1927 num -= 20;
1928 info?.AddFix(-20, burden.GetPhaseStr());
1929 break;
1930 case 3:
1931 num -= 30;
1932 info?.AddFix(-30, burden.GetPhaseStr());
1933 break;
1934 case 4:
1935 num -= (IsPC ? 50 : 100);
1936 info?.AddFix(IsPC ? (-50) : (-100), burden.GetPhaseStr());
1937 break;
1938 }
1939 if (IsPC)
1940 {
1941 switch (stamina.GetPhase())
1942 {
1943 case 1:
1944 num -= 10;
1945 info?.AddFix(-10, stamina.GetPhaseStr());
1946 break;
1947 case 0:
1948 num -= 20;
1949 info?.AddFix(-20, stamina.GetPhaseStr());
1950 break;
1951 }
1952 switch (sleepiness.GetPhase())
1953 {
1954 case 2:
1955 num -= 10;
1956 info?.AddFix(-10, sleepiness.GetPhaseStr());
1957 break;
1958 case 3:
1959 num -= 20;
1960 info?.AddFix(-20, sleepiness.GetPhaseStr());
1961 break;
1962 }
1963 switch (hunger.GetPhase())
1964 {
1965 case 3:
1966 case 4:
1967 num -= 10;
1968 info?.AddFix(-10, hunger.GetPhaseStr());
1969 break;
1970 case 5:
1971 num -= 30;
1972 info?.AddFix(-30, hunger.GetPhaseStr());
1973 break;
1974 }
1975 num += EClass.player.lastEmptyAlly * Evalue(1646);
1976 info?.AddFix(EClass.player.lastEmptyAlly * Evalue(1646), EClass.sources.elements.map[1646].GetName());
1977 }
1979 {
1980 num += EClass.player.lastEmptyAlly * 10 - 10;
1981 info?.AddFix(EClass.player.lastEmptyAlly * 10 - 10, "exceedParty".lang());
1982 }
1983 }
1984 else if (base.LV >= 1000 && !EClass.game.principal.disableVoidBlessing && !base.IsPCFactionOrMinion)
1985 {
1986 num += EClass.curve((base.LV - 900) / 100 * 10, 500, 100);
1987 info?.AddFix(EClass.curve((base.LV - 900) / 100 * 10, 500, 100), "enemySpeedBuff".lang());
1988 }
1989 if (HasCondition<ConGravity>())
1990 {
1991 num -= 30;
1992 info?.AddFix(-30, GetCondition<ConGravity>().Name);
1993 }
1994 if (_Speed < 10)
1995 {
1996 _Speed = 10L;
1997 }
1998 _Speed = _Speed * num / 100;
1999 if (_Speed < 10)
2000 {
2001 _Speed = 10L;
2002 info?.AddText("minSpeed".lang(10.ToString() ?? ""));
2003 }
2004 dirtySpeed = false;
2005 }
Thing thing
Definition: BodySlot.cs:8
override string ToString()
Definition: Chara.cs:1172
void RefreshSpeed(Element.BonusInfo info=null)
Definition: Chara.cs:1868
bool dirtySpeed
Definition: Chara.cs:170
long _Speed
Definition: Chara.cs:172
void AddText(string text, FontColor col=FontColor.Warning)
Definition: ELEMENT.cs:111
void AddFix(int v, string text)
Definition: ELEMENT.cs:132
bool disableVoidBlessing
int lastEmptyAlly
Definition: Player.cs:1193
virtual bool IsUnderwater
Definition: Zone.cs:269

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, 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 ConGravity.OnRefresh(), Player.RefreshEmptyAlly(), RefreshSpeed(), and Element.BonusInfo.WriteNote().

◆ RefreshWorkElements()

void Chara.RefreshWorkElements ( ElementContainer  parent = null)
inline

Definition at line 9004 of file Chara.cs.

9005 {
9006 if (workElements != null)
9007 {
9009 }
9010 workElements = null;
9011 if (IsPCParty || homeBranch == null || homeBranch.owner == null)
9012 {
9013 return;
9014 }
9015 foreach (Hobby item in ListHobbies())
9016 {
9017 TryAdd(item);
9018 }
9019 foreach (Hobby item2 in ListWorks())
9020 {
9021 TryAdd(item2);
9022 }
9023 if (workElements != null)
9024 {
9026 }
9027 void TryAdd(Hobby h)
9028 {
9029 if (!h.source.elements.IsEmpty())
9030 {
9031 if (workElements == null)
9032 {
9034 }
9035 for (int i = 0; i < h.source.elements.Length; i += 2)
9036 {
9037 int num = h.source.elements[i];
9038 int num2 = h.source.elements[i + 1];
9039 int num3 = 100;
9040 if (num != 2115 && num != 2207)
9041 {
9042 num3 = h.GetEfficiency(this) * homeBranch.efficiency / 100;
9043 if (num3 <= 0)
9044 {
9045 continue;
9046 }
9047 }
9048 workElements.ModBase(num, (num2 < 0) ? (num2 / 10) : Mathf.Max(1, h.source.elements[i + 1] * num3 / 1000));
9049 }
9050 }
9051 }
9052 }
ElementContainer workElements
Definition: Chara.cs:40
int GetEfficiency(Chara c)
Definition: Hobby.cs:31

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

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

◆ ReleaseMinion()

void Chara.ReleaseMinion ( )
inline

Definition at line 2362 of file Chara.cs.

2363 {
2364 base.c_uidMaster = 0;
2365 master = null;
2366 enemy = null;
2367 foreach (Chara chara in EClass._map.charas)
2368 {
2369 if (chara.enemy == this)
2370 {
2371 chara.SetEnemy();
2372 chara.ai.Cancel();
2373 }
2374 }
2375 ai.Cancel();
2376 Refresh();
2377 }

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

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

◆ RemoveAllStances()

void Chara.RemoveAllStances ( )
inline

Definition at line 9611 of file Chara.cs.

9612 {
9613 for (int num = conditions.Count - 1; num >= 0; num--)
9614 {
9615 Condition condition = conditions[num];
9616 if (condition.Type == ConditionType.Stance)
9617 {
9618 condition.Kill();
9619 }
9620 }
9621 }

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

◆ RemoveCondition< T >()

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

Definition at line 9472 of file Chara.cs.

9472 : Condition
9473 {
9474 for (int num = conditions.Count - 1; num >= 0; num--)
9475 {
9476 if (conditions[num] is T)
9477 {
9478 conditions[num].Kill();
9479 break;
9480 }
9481 }
9482 }

References Condition.Kill().

◆ RemoveGlobal()

void Chara.RemoveGlobal ( )
inline

Definition at line 1499 of file Chara.cs.

1500 {
1501 if (IsGlobal)
1502 {
1503 global = null;
1505 }
1506 }

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

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

◆ RemoveLastBodyPart()

void Chara.RemoveLastBodyPart ( bool  msg = false)
inline

Definition at line 2202 of file Chara.cs.

2203 {
2204 if (body.slots.Count != 0)
2205 {
2206 BodySlot bodySlot = body.slots.LastItem();
2207 body.RemoveBodyPartAt(body.slots.Count - 1);
2208 if (msg)
2209 {
2210 Say("lose_bodyparts", this, Element.Get(bodySlot.elementId).GetName().ToLower());
2211 PlaySound("offering");
2212 }
2213 }
2214 }
int elementId
Definition: BodySlot.cs:6
void RemoveBodyPartAt(int idx)
Definition: CharaBody.cs:329

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

Referenced by TraitFoodEggFertilized.Incubate().

◆ RequestProtection()

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

Definition at line 8374 of file Chara.cs.

8375 {
8376 if (HasCondition<StanceTaunt>() || base.isRestrained || attacker == this)
8377 {
8378 return false;
8379 }
8380 if (host != null && host.isRestrained)
8381 {
8382 return false;
8383 }
8384 if (base.IsPCFactionOrMinion && attacker.IsPCFactionOrMinion)
8385 {
8386 return false;
8387 }
8388 bool flag = false;
8389 foreach (Chara chara in EClass._map.charas)
8390 {
8391 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))
8392 {
8393 continue;
8394 }
8395 bool flag2 = chara.HasElement(1225) && !chara.GetBool(126);
8396 if ((!flag2 && (flag || EClass.rnd(2) == 0 || !chara.HasCondition<StanceTaunt>())) || chara.HasCooldown(1225))
8397 {
8398 continue;
8399 }
8400 int num = Mathf.Max(chara.Evalue(1649), (!chara.IsPC) ? ((!flag2) ? 1 : 3) : 0);
8401 int num2 = Dist(chara);
8402 if (num2 > 25)
8403 {
8404 continue;
8405 }
8406 if (num2 > num || !chara.CanSeeLos(pos, num2))
8407 {
8408 if (!flag2)
8409 {
8410 continue;
8411 }
8412 Point nearestPoint = pos.GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: true, ignoreCenter: true);
8413 if (!nearestPoint.IsValid)
8414 {
8415 continue;
8416 }
8417 chara.Teleport(nearestPoint);
8418 chara.AddCooldown(1225, 10);
8419 num2 = Dist(chara);
8420 Say("intercept_loyal", chara, this);
8421 chara.SetEnemy(attacker);
8422 attacker.SetEnemy(chara);
8423 if (num2 > num || !chara.CanSeeLos(pos, num2))
8424 {
8425 continue;
8426 }
8427 }
8428 if (!flag && !HasElement(1225))
8429 {
8430 Say("intercept", chara, this);
8431 if (EClass.rnd(10) == 0)
8432 {
8433 chara.Talk("intercept", base.NameSimple);
8434 }
8435 if (attacker.enemy == this)
8436 {
8437 attacker.SetEnemy(chara);
8438 }
8439 action(chara);
8440 flag = true;
8441 }
8442 }
8443 return flag;
8444 }
void Teleport(Point point, bool silent=false, bool force=false)
Definition: Card.cs:5859
void AddCooldown(int idEle, int turns=0)
Definition: Chara.cs:8655
bool HasCooldown(int idEle)
Definition: Chara.cs:8706

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

9099 {
9100 if (_hobbies != null && _works != null)
9101 {
9102 _hobbies.Clear();
9103 _works.Clear();
9104 }
9105 else
9106 {
9107 _hobbies = new List<int>();
9108 _works = new List<int>();
9109 }
9110 if (source.hobbies.IsEmpty())
9111 {
9112 AddHobby(EClass.sources.hobbies.listHobbies.RandomItem().id);
9113 }
9114 else
9115 {
9116 string[] hobbies = source.hobbies;
9117 foreach (string key in hobbies)
9118 {
9119 AddHobby(EClass.sources.hobbies.alias[key].id);
9120 }
9121 }
9122 if (source.works.IsEmpty())
9123 {
9124 AddWork(EClass.sources.hobbies.listWorks.RandomItem().id);
9125 }
9126 else
9127 {
9128 string[] hobbies = source.works;
9129 foreach (string key2 in hobbies)
9130 {
9131 AddWork(EClass.sources.hobbies.alias[key2].id);
9132 }
9133 }
9135 }
WorkSummary GetWorkSummary()
Definition: Chara.cs:9137
void AddWork(int id)
Definition: Chara.cs:9086
void AddHobby(int id)
Definition: Chara.cs:9074
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 2216 of file Chara.cs.

2217 {
2218 for (int num = body.slots.Count - 1; num >= 0; num--)
2219 {
2220 BodySlot bodySlot = body.slots[num];
2221 if (bodySlot.elementId == 45 || bodySlot.elementId == 40)
2222 {
2223 return;
2224 }
2225 body.RemoveBodyPart(num);
2226 }
2227 string[] array = race.figure.Split('|');
2228 foreach (string s in array)
2229 {
2230 int num2 = ParseBodySlot(s);
2231 if (num2 != -1)
2232 {
2233 body.AddBodyPart(num2);
2234 }
2235 }
2237 }

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

◆ ResetUpgrade()

void Chara.ResetUpgrade ( )
inline

Definition at line 8540 of file Chara.cs.

8541 {
8542 _ = base.c_upgrades;
8543 }

Referenced by CoreDebug.ResetPetUpgrades().

◆ ResistCon()

void Chara.ResistCon ( Condition  con)
inline

Definition at line 9668 of file Chara.cs.

9669 {
9670 if (con.power > 0 && resistCon != null)
9671 {
9672 int a = ClassExtension.TryGetValue<int, int>((IDictionary<int, int>)resistCon, con.id, 0);
9673 if (1000 < EClass.rnd(a))
9674 {
9675 con.power = 0;
9676 }
9677 else if (500 < EClass.rnd(a))
9678 {
9679 con.power /= 5;
9680 }
9681 else if (200 < EClass.rnd(a))
9682 {
9683 con.power /= 3;
9684 }
9685 else if (100 < EClass.rnd(a))
9686 {
9687 con.power /= 2;
9688 }
9689 }
9690 }

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

◆ RestockEquip()

void Chara.RestockEquip ( bool  onCreate)
inline

Definition at line 4688 of file Chara.cs.

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

4985 {
4986 switch (id)
4987 {
4988 case "lomias":
4989 if (ShouldRestock("_meat"))
4990 {
4991 AddCard(ThingGen.Create("_meat").MakeRefFrom("begger"));
4992 }
4993 break;
4994 case "fiama":
4995 Restock("book_story", 1);
4996 break;
4997 case "rock_thrower":
4998 Restock("stone", 10 + EClass.rnd(10));
4999 break;
5000 case "giant":
5001 Restock("rock", 2 + EClass.rnd(10));
5002 break;
5003 case "farris":
5004 Restock("lute", 1);
5005 Restock("book_story_home", 1);
5006 break;
5007 case "begger":
5008 break;
5009 }
5010 void Restock(string id, int num)
5011 {
5012 if (ShouldRestock(id))
5013 {
5014 AddCard(ThingGen.Create(id).SetNum(num));
5015 }
5016 }
5017 bool ShouldRestock(string id)
5018 {
5019 return things.Find(id) == null;
5020 }
5021 }

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

◆ Revive()

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

Definition at line 5136 of file Chara.cs.

5137 {
5138 if (!isDead)
5139 {
5140 return;
5141 }
5142 isDead = false;
5143 base.hp = MaxHP / 3;
5144 mana.value = 0;
5145 stamina.value = 0;
5146 if (hunger.value > 30)
5147 {
5148 hunger.value = 30;
5149 }
5150 sleepiness.value = 0;
5152 RemoveCondition<StanceTaunt>();
5153 if (id == "keeper_garden")
5154 {
5155 SaiyanRevive();
5156 }
5157 if (IsPC)
5158 {
5160 {
5161 Msg.Say("noDeathPenalty2", this);
5162 }
5164 {
5165 Msg.Say("noDeathPenalty", this);
5166 }
5167 else
5168 {
5170 }
5171 List<Thing> dropList = new List<Thing>();
5172 EClass.pc.things.Foreach(delegate(Thing t)
5173 {
5175 {
5176 t.ignoreAutoPick = true;
5177 dropList.Add(t);
5178 }
5179 }, onlyAccessible: false);
5180 foreach (Thing item in dropList)
5181 {
5183 Msg.Say("backpack_full_drop", item);
5184 }
5185 EClass.player.preventDeathPenalty = false;
5186 }
5187 if (IsPCFaction && homeBranch != null)
5188 {
5189 homeBranch.Log("bRevive", this);
5190 }
5191 if (p != null)
5192 {
5193 if (!p.IsInBounds)
5194 {
5196 }
5197 EClass._zone.AddCard(this, p);
5198 if (msg)
5199 {
5200 SE.Play("revive");
5201 Msg.Say("revive", this);
5202 PlayEffect("revive");
5203 }
5204 SetCensored(enable: false);
5205 }
5206 }
void SetCensored(bool enable)
Definition: Card.cs:7714
Card parentCard
Definition: Card.cs:103
void SaiyanRevive()
Definition: Chara.cs:5208
void ApplyDeathPenalty()
Definition: Chara.cs:5242
bool disableDeathPenaltyProtection
Point GetCenterPos()
Definition: MapBounds.cs:52
int days
Definition: Player.cs:75
bool preventDeathPenalty
Definition: Player.cs:1167
void Foreach(Action< Thing > action, bool onlyAccessible=true)
override int SelfWeight
Definition: Thing.cs:82

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

3515 {
3516 if (renderer.hasActor)
3517 {
3518 base.dir = (base.dir + ((!reverse) ? 1 : (-1))).Clamp(0, 3, loop: true);
3519 }
3520 else
3521 {
3522 base.dir = ((base.dir == 0) ? 1 : 0);
3523 }
3524 UpdateAngle();
3526 }

Referenced by AI_Dance.Run().

◆ SaiyanRevive()

void Chara.SaiyanRevive ( )
inline

Definition at line 5208 of file Chara.cs.

5209 {
5210 ModCorruption(-100000);
5211 if (base.LV < 10000000)
5212 {
5213 SetLv(base.LV * 10 + 9);
5214 }
5215 Refresh();
5216 base.hp = MaxHP;
5217 mana.value = mana.max;
5218 stamina.value = stamina.max;
5219 bossText = true;
5220 }
void ModCorruption(int a)
Definition: Chara.cs:9815

References Stats.max, and Refresh().

◆ ScaleByPrincipal()

Chara Chara.ScaleByPrincipal ( )
inline

◆ SetAI()

AIAct Chara.SetAI ( AIAct  g)
inline

Definition at line 8874 of file Chara.cs.

8875 {
8876 if (IsPC)
8877 {
8879 }
8880 if (ai.IsRunning)
8881 {
8882 if (ai == g && ai.IsNoGoal)
8883 {
8884 return g;
8885 }
8886 ai.Cancel();
8887 if (ai == g)
8888 {
8889 Debug.Log("goal is g:" + ai?.ToString() + "/" + this);
8890 return g;
8891 }
8892 }
8893 if (HasCondition<ConWait>())
8894 {
8895 RemoveCondition<ConWait>();
8896 }
8897 ai = g;
8898 ai.SetOwner(this);
8899 if (IsPC)
8900 {
8902 }
8903 return g;
8904 }
virtual bool IsNoGoal
Definition: AIAct.cs:74
void SetOwner(Chara c)
Definition: AIAct.cs:179
QueueManager queues
Definition: Player.cs:1209
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(), 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 8864 of file Chara.cs.

8865 {
8866 SetAI(new GoalCombat());
8867 }

Referenced by ZoneEventQuest.AggroEnemy().

◆ SetAIIdle()

void Chara.SetAIIdle ( )
inline

Definition at line 8860 of file Chara.cs.

8861 {
8862 }

◆ SetAIImmediate()

◆ SetCooldown()

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

Definition at line 8673 of file Chara.cs.

8674 {
8675 if (_cooldowns == null)
8676 {
8677 _cooldowns = new List<int>();
8678 }
8679 bool flag = false;
8680 for (int i = 0; i < _cooldowns.Count; i++)
8681 {
8682 if (_cooldowns[i] / 1000 == idEle)
8683 {
8684 if (turns == 0)
8685 {
8686 _cooldowns.RemoveAt(i);
8687 }
8688 else
8689 {
8690 _cooldowns[i] = idEle * 1000 + turns;
8691 }
8692 flag = true;
8693 break;
8694 }
8695 }
8696 if (!flag && turns > 0)
8697 {
8698 AddCooldown(idEle, turns);
8699 }
8700 if (_cooldowns.Count == 0)
8701 {
8702 _cooldowns = null;
8703 }
8704 }

Referenced by ConTransmuteBat.OnRemoved().

◆ SetDir()

override void Chara.SetDir ( int  d)
inlinevirtual

Reimplemented from Card.

Definition at line 3507 of file Chara.cs.

3508 {
3509 base.dir = d;
3510 UpdateAngle();
3512 }

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

◆ SetDirtySpeed()

void Chara.SetDirtySpeed ( )
inline

Definition at line 1859 of file Chara.cs.

1860 {
1861 dirtySpeed = true;
1862 if (host != null)
1863 {
1865 }
1866 }

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

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

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

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

◆ SetEQQuality()

void Chara.SetEQQuality ( )
inlineprivate

Definition at line 5023 of file Chara.cs.

5024 {
5026 Rarity rarity = Rarity.Normal;
5027 int num = ((base.LV >= 1000) ? 7 : ((base.LV >= 500) ? 5 : ((base.LV >= 250) ? 3 : ((base.LV >= 100) ? 2 : ((base.LV >= 50) ? 1 : 0)))));
5028 Rarity rarity2 = base.rarity;
5029 if (id == "big_sister")
5030 {
5031 num = (isOnCreate ? 8 : 4);
5032 }
5033 if (!isOnCreate && EClass.rnd(10) != 0)
5034 {
5035 num /= 2;
5036 }
5037 if (rarity2 == Rarity.Superior && EClass.rnd(10) <= num)
5038 {
5039 rarity = Rarity.Superior;
5040 }
5041 else if (rarity2 == Rarity.Legendary)
5042 {
5043 rarity = ((EClass.rnd(10) <= num) ? Rarity.Legendary : ((EClass.rnd(5) <= num) ? Rarity.Superior : Rarity.Normal));
5044 }
5045 else if (rarity2 >= Rarity.Mythical)
5046 {
5047 rarity = ((EClass.rnd(30) <= num) ? Rarity.Mythical : ((EClass.rnd(10) > num) ? Rarity.Superior : Rarity.Legendary));
5048 }
5049 if (rarity == Rarity.Normal && EClass.rnd(1000) == 0)
5050 {
5051 rarity = Rarity.Legendary;
5052 }
5053 CardBlueprint.current.rarity = rarity;
5054 }
static void Set(CardBlueprint _bp=null)
static CardBlueprint CharaGenEQ
static bool isOnCreate
Definition: Chara.cs:184

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

◆ SetFaction()

Chara Chara.SetFaction ( Faction  f)
inline

Definition at line 1419 of file Chara.cs.

1420 {
1421 _faction = null;
1422 faction = f;
1424 return this;
1425 }
Faction _faction
Definition: Chara.cs:156
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 1710 of file Chara.cs.

1711 {
1712 faith = r;
1714 }

References faith, and RefreshFaithElement().

◆ SetFaith() [2/2]

void Chara.SetFaith ( string  id)
inline

Definition at line 1705 of file Chara.cs.

1706 {
1708 }
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 9873 of file Chara.cs.

9874 {
9875 Feat feat = elements.GetElement(id) as Feat;
9876 int num = 0;
9877 if (feat != null && feat.Value > 0)
9878 {
9879 if (value == feat.Value)
9880 {
9881 return;
9882 }
9883 num = feat.Value;
9884 feat.Apply(-feat.Value, elements);
9885 }
9886 feat = elements.SetBase(id, value - (feat?.vSource ?? 0)) as Feat;
9887 if (feat.Value != 0)
9888 {
9889 feat.Apply(feat.Value, elements);
9890 }
9892 {
9893 Refresh();
9895 }
9896 if (!msg)
9897 {
9898 return;
9899 }
9900 if (feat.source.textInc.IsEmpty())
9901 {
9902 PlaySound("ding_skill");
9904 Say("gainFeat", this, feat.FullName);
9905 }
9906 else
9907 {
9908 bool flag = value < num;
9909 if (feat.source.tag.Contains("neg"))
9910 {
9911 flag = !flag;
9912 }
9913 switch (id)
9914 {
9915 case 1270:
9916 if (!flag)
9917 {
9918 PlaySound("chime_angel");
9919 }
9920 break;
9921 case 1271:
9922 if (!flag)
9923 {
9924 PlaySound("chime_devil");
9925 }
9926 break;
9927 default:
9928 PlaySound("mutation");
9929 break;
9930 }
9932 Say((value > num) ? feat.source.GetText("textInc") : feat.source.GetText("textDec"), this, feat.FullName);
9933 }
9935 }
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 LayerWorldSetting.Apply(), DNA.Apply(), ApplyEditorTags(), Card.LevelUp(), TraitFoodEggFertilized.MakeBaby(), Zone_Casino.OnActivate(), OnCreate(), TraitDrinkMilkMother.OnDrink(), ConSleep.OnRemoved(), FoodEffect.Proc(), CoreDebug.SetElement(), and DramaOutcome.upgrade_miscreation().

◆ SetGlobal() [1/2]

Chara Chara.SetGlobal ( )
inline

Definition at line 1486 of file Chara.cs.

1487 {
1488 if (!IsGlobal)
1489 {
1491 global = new GlobalData();
1492 base.isSubsetCard = false;
1493 enemy = null;
1494 base.c_uidMaster = 0;
1495 }
1496 return this;
1497 }

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

1472 {
1473 SetGlobal();
1474 homeZone = _home;
1475 _home.AddCard(this, x, z);
1476 global.transition = new ZoneTransition
1477 {
1478 state = ZoneTransition.EnterState.Exact,
1479 x = x,
1480 z = z
1481 };
1482 orgPos = new Point(x, z);
1483 return this;
1484 }

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

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

◆ SetHomeZone()

Chara Chara.SetHomeZone ( Zone  zone)
inline

Definition at line 1427 of file Chara.cs.

1428 {
1429 homeZone = zone;
1430 SetGlobal();
1431 return this;
1432 }

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

1435 {
1436 Hostility hostility2 = (base.c_originalHostility = h);
1437 this.hostility = hostility2;
1438 return this;
1439 }

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

2085 {
2086 if (base.c_idMainElement != 0)
2087 {
2088 SetElements(base.c_idMainElement, remove: true);
2089 base.c_idMainElement = 0;
2090 }
2091 if (id != 0)
2092 {
2093 _ = EClass.sources.elements.map[id];
2094 SetElements(id, remove: false);
2095 base.c_idMainElement = id;
2096 if (elemental)
2097 {
2098 base.isElemental = true;
2099 _colorInt = 0;
2100 Color colorSprite = EClass.setting.elements[MainElement.source.alias].colorSprite;
2101 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);
2102 }
2103 _ability = null;
2104 }
2105 void SetElements(int idEle, bool remove)
2106 {
2107 elements.SetBase(idEle, (!remove) ? ((v == 0) ? 10 : v) : 0);
2108 elements.ModBase(EClass.sources.elements.alias[EClass.sources.elements.map[idEle].aliasRef].id, remove ? (-20) : 20);
2109 switch (idEle)
2110 {
2111 case 910:
2112 elements.ModBase(951, remove ? 10 : (-10));
2113 break;
2114 case 911:
2115 elements.ModBase(950, remove ? 10 : (-10));
2116 break;
2117 case 912:
2118 elements.ModBase(953, remove ? 10 : (-10));
2119 break;
2120 case 913:
2121 elements.ModBase(952, remove ? 10 : (-10));
2122 break;
2123 case 916:
2124 elements.ModBase(960, remove ? 10 : (-10));
2125 break;
2126 case 919:
2127 elements.ModBase(956, remove ? 10 : (-10));
2128 break;
2129 case 925:
2130 elements.ModBase(962, remove ? 10 : (-10));
2131 break;
2132 case 922:
2133 elements.ModBase(965, remove ? 10 : (-10));
2134 break;
2135 case 921:
2136 elements.ModBase(971, remove ? 10 : (-10));
2137 break;
2138 case 926:
2139 elements.ModBase(961, remove ? 10 : (-10));
2140 break;
2141 case 914:
2142 case 915:
2143 case 917:
2144 case 918:
2145 case 920:
2146 case 923:
2147 case 924:
2148 break;
2149 }
2150 }
2151 }
int _colorInt
Definition: Card.cs:67
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 2075 of file Chara.cs.

2076 {
2077 if (!id.StartsWith("ele"))
2078 {
2079 id = "ele" + id;
2080 }
2081 SetMainElement(EClass.sources.elements.alias[id].id, v, elemental);
2082 }

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

9938 {
9939 SourceElement.Row row = EClass.sources.elements.map[idEle];
9941 Element element = elements.GetElement(idEle);
9942 Element element2 = elements.GetElement(row2.id);
9943 int num = element?.Value ?? 0;
9944 if (a < 0)
9945 {
9946 a = 0;
9947 }
9948 if (a > row.max)
9949 {
9950 a = row.max;
9951 }
9952 bool flag = (row.tag.Contains("neg") ? (a > num) : (a < num));
9953 if (a == 0 && (element == null || element.Value == 0))
9954 {
9956 return;
9957 }
9958 if (element != null && element.Value == a)
9959 {
9961 return;
9962 }
9963 if (element2 != null && element2.Value > 0)
9964 {
9965 SetFeat(element2.id, 0);
9966 }
9967 SetFeat(idEle, a);
9968 PlaySound("mutation");
9969 PlayEffect("mutation");
9971 Say(row.GetText(flag ? "textDec" : "textInc", returnNull: true) ?? row.alias, this);
9972 }

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

8870 {
8871 return SetAI(_NoGoalPC);
8872 }
static NoGoal _NoGoalPC
Definition: Chara.cs:196

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

◆ SetPCCState()

void Chara.SetPCCState ( PCCState  state)
inline

Definition at line 6680 of file Chara.cs.

6681 {
6682 if (IsPCC)
6683 {
6684 PCC.Get(pccData).Build(state);
6685 }
6686 }

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

6729 {
6730 p.mat = base.material;
6731 p.matColor = base.colorInt;
6732 if (!renderer.usePass)
6733 {
6734 return;
6735 }
6736 if (renderer.replacer != null)
6737 {
6738 p.tile = renderer.replacer.tile * ((!flipX) ? 1 : (-1));
6739 }
6740 else if (source._tiles_snow.Length != 0 && EClass._zone.IsSnowCovered)
6741 {
6742 if (source._tiles_snow.Length > 1)
6743 {
6744 int num = ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % source._tiles_snow.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6745 p.tile = source._tiles_snow[(num < source._tiles_snow.Length) ? num : 0] * ((!flipX) ? 1 : (-1));
6746 }
6747 else
6748 {
6749 p.tile = source._tiles_snow[0] * ((!flipX) ? 1 : (-1));
6750 }
6751 }
6752 else if (sourceCard._tiles.Length > 1)
6753 {
6754 int num2 = ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % sourceCard._tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6755 p.tile = sourceCard._tiles[(num2 >= 0 && num2 < sourceCard._tiles.Length) ? num2 : 0] * ((!flipX) ? 1 : (-1));
6756 }
6757 else
6758 {
6759 p.tile = sourceCard._tiles[0] * ((!flipX) ? 1 : (-1));
6760 }
6761 p.dir = base.dir;
6762 }
override bool flipX
Definition: Chara.cs:547
virtual bool IsSnowCovered
Definition: Spatial.cs:545

References RenderRow._tiles, SourceChara.Row._tiles_snow, EClass._zone, Spatial.IsSnowCovered, 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 7274 of file Chara.cs.

7275 {
7276 switch (m)
7277 {
7278 case UIList.SortMode.ByJob:
7279 sortVal = job._index * 10000 + sourceCard._index;
7280 break;
7281 case UIList.SortMode.ByRace:
7282 sortVal = race._index * 10000 * ((!IsHuman) ? 1 : (-1)) + sourceCard._index;
7283 break;
7284 case UIList.SortMode.ByFeat:
7285 sortVal = -GetTotalFeat();
7286 break;
7287 default:
7288 sortVal = sourceCard._index * ((!IsHuman) ? 1 : (-1));
7289 break;
7290 case UIList.SortMode.ByWorkk:
7291 break;
7292 }
7293 }
int sortVal
Definition: Card.cs:101
int GetTotalFeat()
Definition: Chara.cs:8092
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 2063 of file Chara.cs.

2064 {
2065 source = EClass.sources.charas.map.TryGetValue(id);
2066 if (source == null)
2067 {
2068 Debug.LogWarning("Chara " + id + " not found");
2069 id = "chicken";
2070 source = EClass.sources.charas.map[id];
2071 }
2072 path.walker = this;
2073 }

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

Referenced by Refresh().

◆ SetSummon()

void Chara.SetSummon ( int  duration)
inline

Definition at line 2379 of file Chara.cs.

2380 {
2381 base.c_summonDuration = duration;
2382 base.isSummon = true;
2383 }

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

7610 {
7611 if (t.IsRangedWeapon && t.category.slot == 0)
7612 {
7613 if (!CanEquipRanged(t))
7614 {
7615 return false;
7616 }
7617 int num = 0;
7618 foreach (Thing thing in things)
7619 {
7620 if (thing.IsRangedWeapon)
7621 {
7622 if (thing.category.slot != 0 && thing.isEquipped)
7623 {
7624 return false;
7625 }
7626 if (CanEquipRanged(thing) && thing.GetEquipValue() > num)
7627 {
7628 num = thing.GetEquipValue();
7629 }
7630 }
7631 }
7632 if (t.GetEquipValue() > num)
7633 {
7634 return true;
7635 }
7636 return false;
7637 }
7638 BodySlot bodySlot = body.GetSlot(t);
7639 if (bodySlot == null)
7640 {
7641 return false;
7642 }
7643 if (useFav)
7644 {
7645 switch (GetFavAttackStyle())
7646 {
7647 case AttackStyle.Default:
7648 case AttackStyle.TwoHand:
7649 if (t.IsMeleeWeapon)
7650 {
7651 bodySlot = body.slotMainHand;
7652 }
7653 else if (bodySlot.elementId == 35)
7654 {
7655 return false;
7656 }
7657 break;
7658 case AttackStyle.Shield:
7659 if (t.IsMeleeWeapon)
7660 {
7661 bodySlot = body.slotMainHand;
7662 }
7663 else if (bodySlot.elementId == 35 && t.IsMeleeWeapon)
7664 {
7665 return false;
7666 }
7667 break;
7668 case AttackStyle.TwoWield:
7669 if (bodySlot.elementId == 35 && !t.IsMeleeWeapon)
7670 {
7671 return false;
7672 }
7673 break;
7674 }
7675 }
7676 if (!body.IsEquippable(t, bodySlot, text: false))
7677 {
7678 return false;
7679 }
7680 if (bodySlot.thing != null && (bodySlot.thing.blessedState <= BlessedState.Cursed || bodySlot.thing.GetEquipValue() >= t.GetEquipValue()))
7681 {
7682 return false;
7683 }
7684 if (!base.IsPCFactionOrMinion)
7685 {
7686 int num2 = 0;
7687 foreach (Element value in t.elements.dict.Values)
7688 {
7689 if (value.Value <= 0)
7690 {
7691 int num3 = 100;
7692 switch (value.id)
7693 {
7694 case 418:
7695 num3 = 10;
7696 break;
7697 case 60:
7698 case 61:
7699 case 62:
7700 num3 = 200;
7701 break;
7702 case 962:
7703 num3 = 10000;
7704 break;
7705 }
7706 num2 += value.Value * num3 / 100;
7707 }
7708 }
7709 if (num2 < -40)
7710 {
7711 return false;
7712 }
7713 }
7714 if (t.HasTag(CTAG.gift))
7715 {
7716 return false;
7717 }
7718 return true;
7719 }
bool IsMeleeWeapon
Definition: Card.cs:2241
BlessedState blessedState
Definition: Card.cs:278
bool IsEquippable(Thing thing, BodySlot slot, bool text=true)
Definition: CharaBody.cs:110
AttackStyle GetFavAttackStyle()
Definition: Chara.cs:4644

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

◆ ShouldThrowAway()

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

Definition at line 8446 of file Chara.cs.

8447 {
8448 if (IsPCFaction)
8449 {
8450 if (t.IsFood && t.category.id != "fish" && !t.IsDecayed)
8451 {
8452 return false;
8453 }
8454 if (t.trait.GetHealAction(this) != null)
8455 {
8456 return false;
8457 }
8458 if (t.IsThrownWeapon || t.IsRangedWeapon || t.IsAmmo)
8459 {
8460 return false;
8461 }
8462 if (t.trait is TraitBlanket || t.trait is TraitItemProc || t.trait is TraitBookSkill)
8463 {
8464 return false;
8465 }
8466 }
8467 if (t.isEquipped || t.rarity >= Rarity.Legendary || !t.trait.CanBeDestroyed)
8468 {
8469 return false;
8470 }
8471 if (t.trait is TraitCurrency || t.trait is TraitTool)
8472 {
8473 return false;
8474 }
8475 switch (type)
8476 {
8477 case ClearInventoryType.SellAtTown:
8478 if (!t.isGifted && !t.isNPCProperty)
8479 {
8480 return false;
8481 }
8482 break;
8483 case ClearInventoryType.Purge:
8484 switch (t.category.id)
8485 {
8486 case "fish":
8487 if (EClass.rnd(3) == 0)
8488 {
8489 return true;
8490 }
8491 break;
8492 case "junk":
8493 case "garbage":
8494 if (EClass.rnd(3) != 0)
8495 {
8496 return true;
8497 }
8498 break;
8499 }
8500 if (t.id == "flyer")
8501 {
8502 return true;
8503 }
8504 if (!t.IsDecayed && EClass.rnd(3) == 0)
8505 {
8506 return false;
8507 }
8508 if (!things.IsFull() && t.IsRangedWeapon)
8509 {
8510 return false;
8511 }
8512 break;
8513 }
8514 return true;
8515 }
bool IsThrownWeapon
Definition: Card.cs:2245
bool IsFood
Definition: Card.cs:2175
bool isGifted
Definition: Card.cs:782
virtual Action GetHealAction(Chara c)
Definition: Trait.cs:604

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

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

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

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

◆ ShowDialog() [2/2]

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

Definition at line 7214 of file Chara.cs.

7215 {
7216 return _ShowDialog(book, null, step, tag);
7217 }
LayerDrama _ShowDialog(string book, string sheet, string step="main", string tag="")
Definition: Chara.cs:7219

References book.

◆ Sleep()

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

Definition at line 9692 of file Chara.cs.

9693 {
9694 RemoveCondition<ConAwakening>();
9695 AddCondition(Condition.Create(100, delegate(ConSleep con)
9696 {
9697 con.pcSleep = 15;
9698 con.pcBed = bed;
9699 con.pcPillow = pillow;
9700 con.pickup = pickup;
9701 con.posBed = posBed;
9702 con.posPillow = posPillow;
9703 }), force: true);
9704 }

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

8083 {
8084 Say("abCatSniff", this, c);
8085 AddCondition<ConHOT>(EClass.curve(50 + c.CHA * 5, 400, 100));
8086 c.ShowEmo(Emo.angry);
8087 ShowEmo(Emo.love);
8088 Talk("sniff");
8089 c.Talk(new string[4] { "labor", "disgust", "scold", "callGuards" }.RandomItem());
8090 }

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

4580 {
4581 return held.Split(a);
4582 }

References Card.Split().

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

◆ Stumble()

void Chara.Stumble ( int  mtp = 100)
inline

Definition at line 1842 of file Chara.cs.

1843 {
1844 bool flag = EClass._map.FindThing((Thing t) => t.IsInstalled && t.pos.Equals(EClass.pc.pos) && t.trait is TraitStairsUp) != null;
1845 Say(flag ? "dmgBurdenStairs" : "dmgBurdenFallDown", this);
1846 int num = MaxHP;
1847 if (Evalue(1421) > 0)
1848 {
1849 num = mana.max;
1850 }
1851 int num2 = (num * (base.ChildrenWeight * 100 / WeightLimit) / (flag ? 100 : 200) + 1) * mtp / 100;
1852 if (base.hp <= 0)
1853 {
1854 num2 *= 2;
1855 }
1856 DamageHP(num2, flag ? AttackSource.BurdenStairs : AttackSource.BurdenFallDown);
1857 }
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 3923 of file Chara.cs.

3924 {
3925 if (host != null)
3926 {
3927 host.SyncRide();
3928 }
3929 if (ride != null)
3930 {
3931 SyncRide(ride);
3932 }
3933 if (parasite != null)
3934 {
3936 }
3937 }

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

3940 {
3941 if (!c.pos.Equals(pos))
3942 {
3943 if (!pos.IsValid)
3944 {
3945 Debug.LogError("exception: pos is not valid:" + pos?.ToString() + "/" + this);
3946 pos = new Point();
3947 }
3948 EClass._map.MoveCard(pos, c);
3949 }
3950 }

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

◆ TalkTopic()

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

Definition at line 6961 of file Chara.cs.

6962 {
6963 if (host == null && !IsInActiveZone)
6964 {
6965 return null;
6966 }
6967 if (!isSynced && (host == null || !host.isSynced) && topic != "dead")
6968 {
6969 return null;
6970 }
6971 if (IsPCParty)
6972 {
6973 int num = EClass.pc.party.members.Count - 1;
6974 switch (topic)
6975 {
6976 case "calm":
6977 if (EClass.rnd(num * 5) != 0)
6978 {
6979 return null;
6980 }
6981 break;
6982 case "aggro":
6983 if (EClass.rnd(num * 10) != 0)
6984 {
6985 return null;
6986 }
6987 break;
6988 case "kill":
6989 if (EClass.rnd(num * 3) != 0)
6990 {
6991 return null;
6992 }
6993 break;
6994 case "fov":
6995 return null;
6996 }
6997 }
6998 string topicText = GetTopicText(topic);
6999 if (topicText.IsEmpty())
7000 {
7001 return null;
7002 }
7003 string text = "_bracketTalk".lang();
7004 bool flag = topicText.StartsWith("*");
7005 bool flag2 = topicText.StartsWith("(");
7006 bool flag3 = topicText.StartsWith(text) || (topicText.Length > 0 && topicText[0] == text[0]) || topicText[0] == '“';
7007 topicText = ApplyTone(topicText);
7008 topicText = topicText.Replace("~", "*");
7009 Msg.SetColor(flag2 ? Msg.colors.Thinking : (flag3 ? Msg.colors.Talk : Msg.colors.Ono));
7010 Msg.Say(topicText.Replace("&", ""));
7011 if (topic == "dead")
7012 {
7013 EClass.ui.popGame.PopText(ApplyNewLine(topicText.StripBrackets()), null, "PopTextDead", default(Color), pos.Position() + EClass.setting.render.tc.textPosDead);
7014 }
7015 else if (flag || flag3 || flag2)
7016 {
7017 (host ?? this).renderer.Say(ApplyNewLine(topicText.StripBrackets()), default(Color), IsPCParty ? 0.6f : 0f);
7018 }
7019 return topicText;
7020 }
void Say(string text, Color c=default(Color), float duration=0f)
string ApplyNewLine(string text)
Definition: Card.cs:6785
string ApplyTone(string text, bool stripPun=false)
Definition: Card.cs:6864
string GetTopicText(string topic="calm")
Definition: Chara.cs:6928
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 3952 of file Chara.cs.

3953 {
3954 SyncRide();
3955 combatCount--;
3956 ignoreSPAbsorb = false;
3957 if (IsPC)
3958 {
3959 if (hasMovedThisTurn)
3960 {
3961 pos.Things.ForeachReverse(delegate(Thing t)
3962 {
3964 {
3965 AI_Goto aI_Goto = ai.Current as AI_Goto;
3966 if ((aI_Goto == null && !(ai is GoalManualMove)) || (aI_Goto != null && !aI_Goto.dest.Equals(pos)))
3967 {
3968 return;
3969 }
3970 }
3971 t.trait.OnStepped(this);
3972 });
3973 if (isDead)
3974 {
3975 return;
3976 }
3977 hasMovedThisTurn = false;
3979 {
3980 EClass.player.haltMove = false;
3981 ActionMode.Adv.TryCancelInteraction(sound: false);
3982 EInput.Consume(1);
3983 return;
3984 }
3985 if (EClass._zone.IsRegion)
3986 {
3988 {
3989 foreach (Chara member in EClass.pc.party.members)
3990 {
3991 if (member.hunger.value > 65)
3992 {
3993 member.InstantEat(null, sound: false);
3994 }
3995 }
3996 }
3997 Chara chara = null;
3999 if (cell2 != null && (cell2.zone == null || (cell2.zone is Zone_Field && !cell2.zone.IsPCFaction)))
4000 {
4001 foreach (Chara chara2 in EClass._map.charas)
4002 {
4003 if (!chara2.IsPCFactionOrMinion && !chara2.IsGlobal && chara2.pos.Equals(EClass.pc.pos))
4004 {
4005 chara = chara2;
4006 break;
4007 }
4008 }
4009 }
4010 if (chara != null)
4011 {
4013 {
4014 EClass.player.safeTravel = 5 + EClass.rnd(5);
4015 }
4016 EClass._zone.RemoveCard(chara);
4017 Msg.Say("encounter");
4018 EClass.player.EnterLocalZone(encounter: true, chara);
4019 }
4020 else if (EClass.player.safeTravel <= 0)
4021 {
4022 if (cell2 != null && cell2.zone == null && !EClass.debug.ignoreEncounter)
4023 {
4025 if (!tileInfo.shore)
4026 {
4027 bool num = EClass.pc.HasCondition<ConWardMonster>();
4028 bool flag = EClass.pc.HasCondition<ConDrawMonster>();
4029 bool flag2 = EClass.game.quests.Get<QuestEscort>() != null;
4030 int num2 = (tileInfo.isRoad ? 22 : 12);
4031 if (flag2)
4032 {
4033 num2 = (tileInfo.isRoad ? 16 : 10);
4034 }
4035 if (num)
4036 {
4037 num2 *= (flag2 ? 2 : 20);
4038 }
4039 if (flag)
4040 {
4041 num2 /= 2;
4042 }
4043 if (EClass.rnd(num2) == 0)
4044 {
4045 Msg.Say("encounter");
4046 if (!flag)
4047 {
4048 EClass.player.safeTravel = 5 + EClass.rnd(5);
4049 }
4050 EClass.player.EnterLocalZone(encounter: true);
4051 }
4052 }
4053 }
4054 }
4055 else
4056 {
4058 }
4059 }
4060 }
4061 EClass.player.pickupDelay = 0f;
4062 if (EClass.player.returnInfo != null)
4063 {
4065 if (EClass.player.returnInfo.turns <= 0)
4066 {
4068 {
4069 EClass.player.returnInfo = null;
4071 }
4072 else
4073 {
4075 {
4076 int uidDest = EClass.player.returnInfo.uidDest;
4077 Zone zone = null;
4078 if (uidDest != 0)
4079 {
4080 zone = EClass.game.spatials.map.TryGetValue(uidDest) as Zone;
4081 }
4082 if (zone == null || zone.destryoed)
4083 {
4084 zone = EClass.world.region;
4085 }
4087 {
4088 Msg.Say("returnFail");
4089 }
4090 else
4091 {
4092 Msg.Say("returnComplete");
4093 EClass.player.uidLastTravelZone = 0;
4095 EClass.player.lastZonePos = null;
4096 }
4097 EClass.player.returnInfo = null;
4098 return;
4099 }
4100 EClass.player.returnInfo = null;
4101 Msg.Say("returnOverweight");
4102 }
4103 }
4104 }
4105 if ((HasNoGoal || !ai.IsRunning) && !WillConsumeTurn())
4106 {
4108 return;
4109 }
4112 {
4113 RecipeUpdater.dirty = true;
4114 }
4116 }
4117 else
4118 {
4119 actTime = EClass.player.baseActTime * Mathf.Max(0.1f, (float)EClass.pc.Speed / (float)Speed);
4120 hasMovedThisTurn = false;
4121 }
4124 {
4125 return;
4126 }
4128 if (host != null && !consumeTurn)
4129 {
4130 if (host.ride == this && ((host.hasMovedThisTurn && IsInCombat) || (enemy != null && turn % 3 != 0)))
4131 {
4132 consumeTurn = true;
4133 }
4134 if (host.parasite == this && enemy != null && EClass.rnd(10) > EClass.rnd(host.Evalue(227) + 10))
4135 {
4136 if (Dist(enemy) < 3 && EClass.rnd(2) == 0)
4137 {
4138 Say("parasite_fail", this, host);
4139 if (EClass.rnd(2) == 0 && GetInt(106) == 0)
4140 {
4141 Talk("parasite_fail");
4142 }
4143 }
4144 consumeTurn = true;
4145 }
4146 }
4147 if (consumeTurn)
4148 {
4149 if (IsPC)
4150 {
4152 }
4153 }
4154 else
4155 {
4156 if (base.isRestrained)
4157 {
4158 TryUnrestrain();
4159 }
4160 if (enemy != null)
4161 {
4163 {
4164 enemy = null;
4165 }
4166 else if (!IsPC && (ai.CancelOnAggro || !ai.IsRunning))
4167 {
4168 SetAIAggro();
4169 }
4170 }
4171 if (HasNoGoal || !ai.IsRunning)
4172 {
4173 ChooseNewGoal();
4174 }
4175 ai.Tick();
4176 }
4177 Cell cell = base.Cell;
4179 {
4180 AddCondition<ConWet>(50);
4181 if (pos.IsHotSpring)
4182 {
4183 hygiene.Mod(2);
4184 }
4185 }
4186 if (IsPC && !EClass._zone.IsRegion && cell.CanSuffocate() && !EClass.debug.godMode)
4187 {
4188 AddCondition<ConSuffocation>(800 / (100 + EvalueMax(200, -5) * 10), force: true);
4189 }
4190 CellEffect e;
4191 if (cell.effect != null)
4192 {
4193 e = cell.effect;
4194 switch (e.id)
4195 {
4196 case 1:
4197 case 2:
4198 case 4:
4199 if (IsLevitating)
4200 {
4201 Say("levitating");
4202 break;
4203 }
4204 AddCondition<ConWet>(50);
4205 ProcEffect();
4206 break;
4207 case 3:
4208 PlaySound("fire_step");
4209 AddCondition<ConBurning>(30);
4210 break;
4211 case 5:
4212 if (!isWet)
4213 {
4214 PlaySound("bubble");
4215 AddCondition<ConWet>(30);
4216 ProcEffect();
4217 }
4218 break;
4219 case 6:
4220 if (hasMovedThisTurn)
4221 {
4222 Say("abMistOfDarkness_step", this);
4223 }
4224 AddCondition<ConDark>(e.power);
4225 break;
4226 }
4227 }
4228 if (IsPC)
4229 {
4230 if (EClass.player.currentHotItem.Thing != null)
4231 {
4233 }
4235 }
4236 void ClearEffect()
4237 {
4238 EClass._map.SetLiquid(cell.x, cell.z, 0, 0);
4239 }
4240 void ProcEffect()
4241 {
4242 if (e.idEffect != 0)
4243 {
4244 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
4245 {
4246 aliasEle = EClass.sources.elements.map[e.idEle].alias,
4247 n1 = e.n1,
4248 refVal = e.refVal
4249 });
4250 ClearEffect();
4251 }
4252 }
4253 }
virtual bool CancelOnAggro
Definition: AIAct.cs:80
bool TryCancelInteraction(bool sound=true)
Definition: AM_Adv.cs:1069
void SetTurbo(int mtp=-1)
Definition: AM_Adv.cs:1040
virtual void OnEndPlayerTurn()
int turn
Definition: Card.cs:65
void TryUnrestrain(bool force=false, Chara c=null)
Definition: Card.cs:7098
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:7563
int Speed
Definition: Chara.cs:1083
static bool consumeTurn
Definition: Chara.cs:180
void SetAIAggro()
Definition: Chara.cs:8864
bool ignoreSPAbsorb
Definition: Chara.cs:146
void ChooseNewGoal()
Definition: Chara.cs:8745
bool WillConsumeTurn()
Definition: Chara.cs:3652
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:96
virtual Thing Thing
Definition: HotItem.cs:38
void SetLiquid(int x, int z, CellEffect effect=null)
Definition: Map.cs:1477
static string SayNothingHappen()
Definition: Msg.cs:96
int turns
Definition: Player.cs:84
bool haltMove
Definition: Player.cs:1171
float baseActTime
Definition: Player.cs:1199
void EnterLocalZone(bool encounter=false, Chara mob=null)
Definition: Player.cs:1946
HotItem currentHotItem
Definition: Player.cs:1100
int safeTravel
Definition: Player.cs:920
int eloY
Definition: Point.cs:81
int eloX
Definition: Point.cs:79
bool IsHotSpring
Definition: Point.cs:375
bool destryoed
Definition: Spatial.cs:45
virtual void OnTickHeld()
Definition: Trait.cs:1051
virtual bool IgnoreOnSteppedWhenMoving
Definition: Trait.cs:372
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 3664 of file Chara.cs.

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

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

Referenced by _Move().

◆ TickCooldown()

void Chara.TickCooldown ( )
inline

Definition at line 8726 of file Chara.cs.

8727 {
8728 for (int num = _cooldowns.Count - 1; num >= 0; num--)
8729 {
8730 if (_cooldowns[num] % 1000 == 1)
8731 {
8732 _cooldowns.RemoveAt(num);
8733 }
8734 else
8735 {
8736 _cooldowns[num]--;
8737 }
8738 }
8739 if (_cooldowns.Count == 0)
8740 {
8741 _cooldowns = null;
8742 }
8743 }

◆ TickWork()

void Chara.TickWork ( VirtualDate  date)
inline

Definition at line 9146 of file Chara.cs.

9147 {
9149 if (span != TimeTable.Span.Work && span != 0)
9150 {
9151 return;
9152 }
9153 WorkSummary workSummary = GetWorkSummary();
9154 if (span == TimeTable.Span.Work)
9155 {
9156 if (workSummary.work != null)
9157 {
9158 PerformWork(workSummary.work, isHobby: false, date.IsRealTime);
9159 }
9160 }
9161 else if (workSummary.hobbies.Count > 0)
9162 {
9163 PerformWork(workSummary.hobbies.RandomItem(), isHobby: true, date.IsRealTime);
9164 }
9165 }
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 1172 of file Chara.cs.

1173 {
1174 return base.Name + "(" + ai?.ToString() + ")" + pos?.ToString() + "/" + base.ExistsOnMap + "/" + isDead;
1175 }
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 4367 of file Chara.cs.

4368 {
4369 if (!IsPC || !(t.trait is TraitRod) || t.c_charges <= 0 || !HasElement(1564))
4370 {
4371 return;
4372 }
4373 Say("absorbRod", this, t);
4374 TraitRod rod = t.trait as TraitRod;
4375 bool flag = false;
4376 if (rod.source != null)
4377 {
4378 using IEnumerator<SourceElement.Row> enumerator = EClass.sources.elements.rows.Where((SourceElement.Row a) => a.id == rod.source.id).GetEnumerator();
4379 if (enumerator.MoveNext())
4380 {
4381 SourceElement.Row current = enumerator.Current;
4382 if (IsPC)
4383 {
4384 GainAbility(current.id, t.c_charges * 100, t);
4385 flag = true;
4386 }
4387 }
4388 }
4389 if (!flag)
4390 {
4391 mana.Mod(-50 * t.c_charges);
4392 }
4393 t.c_charges = 0;
4395 }
int c_charges
Definition: Card.cs:1269
void GainAbility(int ele, int mtp=100, Thing origin=null)
Definition: Chara.cs:10070

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

7323 {
7324 if (!IsPCFaction && !IsGuest())
7325 {
7326 return null;
7327 }
7328 foreach (Card item in EClass._map.props.installed.all)
7329 {
7330 if (item.trait is TraitBed traitBed && traitBed.CanAssign(this))
7331 {
7332 traitBed.AddHolder(this);
7333 Msg.Say("claimBed", this);
7334 return traitBed;
7335 }
7336 }
7337 return null;
7338 }
bool CanAssign(Chara c)
Definition: TraitBed.cs:160

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

5609 {
5611 {
5612 return;
5613 }
5614 int num = 0;
5615 bool flag = false;
5616 bool flag2 = false;
5617 Point point = pos.GetNearestPoint(allowBlock: true, allowChara: false, allowInstalled: false, ignoreCenter: true) ?? pos;
5618 TreasureType type = TreasureType.BossQuest;
5619 if (EClass._zone.Boss == this)
5620 {
5621 type = TreasureType.BossNefia;
5622 num = 2 + EClass.rnd(2);
5623 flag = (flag2 = true);
5624 EClass._zone.Boss = null;
5625 Msg.Say("boss_win", EClass._zone.Name);
5627 {
5628 Msg.Say("boss_win_void", EClass._zone.Name);
5629 EClass.player.flags.KilledBossInVoid = true;
5630 }
5631 if (EClass._zone.IsNefia)
5632 {
5635 SE.Play("Jingle/fanfare2");
5636 EClass._zone.SetBGM(114, refresh: true, 3f);
5637 }
5640 }
5641 switch (id)
5642 {
5643 case "azzrasizzle":
5644 num = 5;
5645 flag = (flag2 = true);
5646 EClass.Sound.StopBGM(3f);
5647 EClass._zone.SetBGM(1, refresh: false);
5648 if (EClass.game.quests.GetPhase<QuestIntoDarkness>() == 5)
5649 {
5650 EClass.game.quests.Get<QuestIntoDarkness>().UpdateOnTalk();
5651 }
5652 break;
5653 case "vernis_boss":
5654 num = 5;
5655 flag = (flag2 = true);
5656 EClass.Sound.StopBGM(3f);
5657 EClass._zone.SetBGM(1, refresh: false);
5658 if (EClass.game.quests.GetPhase<QuestVernis>() == 8)
5659 {
5660 EClass.game.quests.Get<QuestVernis>().UpdateOnTalk();
5661 }
5662 break;
5663 case "lurie_boss":
5664 if (!(EClass._zone is Zone_Exile))
5665 {
5666 num = 5;
5667 flag = (flag2 = true);
5668 EClass._zone.SetBGM(120, refresh: true, 3f);
5670 {
5671 EClass.game.quests.Get<QuestNegotiationDarkness>().ChangePhase(4);
5672 EClass.player.flags.killedDuponne = true;
5673 }
5674 }
5675 break;
5676 case "ungaga_pap":
5677 num = 5;
5678 flag = (flag2 = true);
5680 {
5681 EClass._zone.SetBGM(46, refresh: true, 3f);
5682 }
5683 break;
5684 case "melilith_boss":
5685 num = 5;
5686 flag = (flag2 = true);
5687 EClass.Sound.StopBGM(3f);
5688 EClass._zone.SetBGM(1, refresh: false);
5689 break;
5690 case "doga":
5691 {
5692 QuestCurry questCurry = EClass.game.quests.Get<QuestCurry>();
5693 if (questCurry != null)
5694 {
5695 num = 5;
5696 flag = (flag2 = true);
5697 EClass.Sound.StopBGM(3f);
5698 EClass._zone.SetBGM(1, refresh: false);
5699 questCurry.NextPhase();
5700 }
5701 break;
5702 }
5703 case "fairy_raina":
5704 case "fairy_poina":
5705 {
5706 bool num2 = EClass._map.FindChara((id == "fairy_raina") ? "fairy_poina" : "fairy_raina") == null;
5707 QuestNasu questNasu = EClass.game.quests.Get<QuestNasu>();
5708 if (num2 && questNasu != null && questNasu.phase <= 1)
5709 {
5710 if (questNasu.phase == 0)
5711 {
5712 questNasu.NextPhase();
5713 }
5714 num = 5;
5715 flag = (flag2 = true);
5716 EClass.Sound.StopBGM(3f);
5717 EClass._zone.SetBGM(1, refresh: false);
5718 EClass.player.DropReward(ThingGen.Create("backpack_holding"));
5719 questNasu.NextPhase();
5720 }
5721 break;
5722 }
5723 case "isygarad":
5724 {
5725 num = 5;
5726 flag = (flag2 = true);
5727 QuestExploration questExploration = EClass.game.quests.Get<QuestExploration>();
5728 if (questExploration != null)
5729 {
5730 SE.Play("kill_boss");
5731 questExploration.ChangePhase(3);
5732 EClass.Sound.StopBGM(3f);
5733 EClass._zone.SetBGM(1, refresh: false);
5734 }
5735 break;
5736 }
5737 case "swordkeeper":
5738 num = 10;
5739 flag = true;
5740 SE.Play("kill_boss");
5741 SoundManager.ForceBGM();
5742 LayerDrama.Activate("_event", "event", "swordkeeper_defeat");
5743 break;
5744 }
5745 if (flag)
5746 {
5747 SE.Play("kill_boss");
5748 }
5749 if (num != 0)
5750 {
5752 {
5753 EClass.player.stats.deepest = EClass._zone.DangerLv;
5754 Msg.Say("update_deepest", EClass.player.stats.deepest.ToString() ?? "");
5755 }
5757 {
5758 EClass.player.stats.deepestVoid = -EClass._zone.lv;
5759 Msg.Say("update_deepest_void", EClass.player.stats.deepestVoid.ToString() ?? "");
5760 }
5761 EClass.player.willAutoSave = true;
5762 Thing thing = ThingGen.CreateTreasure("chest_boss", base.LV, type);
5763 point.SetBlock();
5764 point.SetObj();
5765 EClass._zone.AddCard(thing, point).Install();
5766 ThingGen.TryLickChest(thing);
5767 }
5768 if (flag2)
5769 {
5771 }
5772 }
TreasureType
Definition: TreasureType.cs:2
bool KilledBossInVoid
Definition: Player.cs:419
int deepest
Definition: Player.cs:114
long nefiaBeaten
Definition: Player.cs:136
int deepestVoid
Definition: Player.cs:117
void ModFame(int a)
Definition: Player.cs:2094
void SetObj(int id=0, int value=1, int dir=0)
Definition: Point.cs:928
void SetBlock(int idMat=0, int idBlock=0)
Definition: Point.cs:918
int phase
Definition: Quest.cs:40
void NextPhase()
Definition: Quest.cs:572
void ChangePhase(int a)
Definition: Quest.cs:577
bool isConquered
Definition: Spatial.cs:382
static void TryLickChest(Thing chest)
Definition: ThingGen.cs:409
static Thing CreateTreasure(string id, int lv, TreasureType type=TreasureType.Map)
Definition: ThingGen.cs:256
static Thing CreateScroll(int ele, int num=1)
Definition: ThingGen.cs:182
virtual bool IsNefia
Definition: Zone.cs:285
void SetBGM(List< int > ids, bool refresh=true, float fadeDuration=0f)
Definition: Zone.cs:2959
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(), 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 4584 of file Chara.cs.

4585 {
4586 if (held != null && held.trait.CanOnlyCarry)
4587 {
4588 DropHeld();
4589 }
4590 foreach (Thing item in things.List((Thing t) => t.trait.CanOnlyCarry))
4591 {
4592 DropThing(item);
4593 }
4594 }
void DropThing(Thing t, int num=-1)
Definition: Chara.cs:4616

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

◆ TryEquip()

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

Definition at line 7721 of file Chara.cs.

7722 {
7723 if (!ShouldEquip(t, useFav))
7724 {
7725 return false;
7726 }
7727 if (t.category.slot == 0)
7728 {
7729 return false;
7730 }
7731 if (useFav)
7732 {
7733 BodySlot slot = body.GetSlot(t);
7734 switch (GetFavAttackStyle())
7735 {
7736 case AttackStyle.Default:
7737 case AttackStyle.TwoHand:
7738 if (t.IsMeleeWeapon)
7739 {
7740 slot = body.slotMainHand;
7741 }
7742 break;
7743 case AttackStyle.Shield:
7744 if (t.IsMeleeWeapon)
7745 {
7746 slot = body.slotMainHand;
7747 }
7748 break;
7749 }
7750 body.Equip(t, slot);
7751 }
7752 else
7753 {
7754 body.Equip(t);
7755 }
7756 Say("equip", this, t);
7757 return true;
7758 }
bool ShouldEquip(Thing t, bool useFav=false)
Definition: Chara.cs:7609

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

7842 {
7843 if (IsPC)
7844 {
7846 if (thing?.trait is TraitToolRange && CanEquipRanged(thing))
7847 {
7848 ranged = thing;
7849 return true;
7850 }
7851 return false;
7852 }
7853 if (ranged != null && ranged.parent == this)
7854 {
7855 return true;
7856 }
7858 return ranged != null;
7859 }
Thing GetBestRangedWeapon()
Definition: Chara.cs:7826

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

7766 {
7767 Thing dest = null;
7768 if (IsPC)
7769 {
7771 {
7772 return FindThrowable(hotbar: true);
7773 }
7774 return null;
7775 }
7776 things.Foreach(delegate(Thing t)
7777 {
7778 if (t.HasTag(CTAG.throwWeapon) || (!base.IsPCFactionOrMinion && t.HasTag(CTAG.throwWeaponEnemy)))
7779 {
7780 dest = t;
7781 }
7782 });
7783 return dest;
7784 Thing FindThrowable(bool hotbar)
7785 {
7786 things.Foreach(delegate(Thing t)
7787 {
7788 if (dest == null)
7789 {
7790 if (t.IsHotItem)
7791 {
7792 if (!hotbar)
7793 {
7794 return;
7795 }
7796 }
7797 else if (hotbar)
7798 {
7799 return;
7800 }
7801 if (t.HasTag(CTAG.throwWeapon))
7802 {
7803 dest = t;
7804 }
7805 }
7806 });
7807 return dest;
7808 }
7809 }

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

4446 {
4447 if (held == t)
4448 {
4449 return true;
4450 }
4451 if (t.isDestroyed || t.Num <= 0)
4452 {
4453 return false;
4454 }
4455 if (!CanPick(t))
4456 {
4457 if (t.parent == null)
4458 {
4459 EClass._zone.AddCard(t, pos);
4460 }
4461 return false;
4462 }
4463 HoldCard(t, num);
4464 return true;
4465 }
bool CanPick(Card c)
Definition: Chara.cs:4265
void HoldCard(Card t, int num=-1)
Definition: Chara.cs:4467

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

7988 {
7989 int num = Evalue(289);
7990 if (num == 0)
7991 {
7992 return false;
7993 }
7994 int lV = t.LV;
7995 if (EClass.rnd(num * num + 5) > EClass.rnd(lV * lV) * 20)
7996 {
7997 t.Identify(show, (num >= 20) ? IDTSource.SkillHigh : IDTSource.Skill);
7998 int num2 = 50;
7999 if (lV > num)
8000 {
8001 num2 += (lV - num) * 10;
8002 }
8003 elements.ModExp(289, Mathf.Min(num2, 1000));
8004 return true;
8005 }
8006 return false;
8007 }
IDTSource
Definition: IDTSource.cs:2
Thing Identify(bool show=true, IDTSource idtSource=IDTSource.Identify)
Definition: Thing.cs:2070

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

Referenced by Player.OnAdvanceHour().

◆ TryMove()

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

Definition at line 2718 of file Chara.cs.

2719 {
2720 foreach (Condition condition in conditions)
2721 {
2722 if (!condition.TryMove(newPoint))
2723 {
2724 return MoveResult.Fail;
2725 }
2726 }
2727 if (base.isRestrained)
2728 {
2729 if (!IsPC)
2730 {
2731 return MoveResult.Fail;
2732 }
2733 base.isRestrained = false;
2734 }
2735 if (!CanMoveTo(newPoint, allowDestroyPath))
2736 {
2737 return MoveResult.Fail;
2738 }
2739 return _Move(newPoint);
2740 }
virtual bool TryMove(Point p)

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

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

◆ TryMoveFrom()

MoveResult Chara.TryMoveFrom ( Point  p)
inline

Definition at line 2678 of file Chara.cs.

2679 {
2681 {
2682 return MoveResult.Fail;
2683 }
2684 Point point = p.Copy();
2685 int num = p.x - pos.x;
2686 int num2 = p.z - pos.z;
2687 if (num > 1)
2688 {
2689 num = 1;
2690 }
2691 else if (num < -1)
2692 {
2693 num = -1;
2694 }
2695 if (num2 > 1)
2696 {
2697 num2 = 1;
2698 }
2699 else if (num2 < -1)
2700 {
2701 num2 = -1;
2702 }
2703 if (num == 0 && num2 == 0)
2704 {
2705 num = EClass.rnd(3) - 1;
2706 num2 = EClass.rnd(3) - 1;
2707 }
2708 point.Set(pos);
2709 point.x -= num;
2710 point.z -= num2;
2711 if (point.IsValid && !point.HasChara)
2712 {
2713 return TryMove(point, allowDestroyPath: false);
2714 }
2715 return MoveResult.Fail;
2716 }
bool TooHeavyToMove()
Definition: Player.cs:2558

References Point.Copy(), Point.HasChara, IsPC, Point.IsValid, EClass.player, Card.pos, EClass.rnd(), Point.Set(), Player.TooHeavyToMove(), TryMove(), Point.x, and Point.z.

Referenced by ActMelee.Attack(), GoalCombat.Run(), ConFear.Tick(), and GoalCombat.TryMove().

◆ TryMoveTowards()

MoveResult Chara.TryMoveTowards ( Point  p)
inline

Definition at line 2616 of file Chara.cs.

2617 {
2618 if (p.Equals(pos))
2619 {
2620 return MoveResult.Success;
2621 }
2623 {
2624 return MoveResult.Fail;
2625 }
2626 bool flag = true;
2627 Point point = null;
2628 _sharedPos.Set(p);
2629 if (CanDestroyPath())
2630 {
2632 {
2633 return MoveResult.Success;
2634 }
2635 Debug.Log(CanMoveTo(pos));
2637 }
2638 int num = pos.Distance(p);
2639 PathProgress pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Default, num + 4, 1);
2640 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 4)
2641 {
2642 PathFinderNode pathFinderNode = pathProgress.nodes[pathProgress.nodes.Count - 1];
2643 if (TryMove(new Point(pathFinderNode.X, pathFinderNode.Z)) == MoveResult.Success)
2644 {
2645 return MoveResult.Success;
2646 }
2647 }
2648 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Combat, num + 4, 1);
2649 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 4)
2650 {
2651 PathFinderNode pathFinderNode2 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2652 if (TryMove(new Point(pathFinderNode2.X, pathFinderNode2.Z)) == MoveResult.Success)
2653 {
2654 return MoveResult.Success;
2655 }
2656 }
2657 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Default, num + 25, 2);
2658 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 25)
2659 {
2660 PathFinderNode pathFinderNode3 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2661 if (TryMove(new Point(pathFinderNode3.X, pathFinderNode3.Z)) == MoveResult.Success)
2662 {
2663 return MoveResult.Success;
2664 }
2665 }
2666 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Combat, num + 25, 2);
2667 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 25)
2668 {
2669 PathFinderNode pathFinderNode4 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2670 if (TryMove(new Point(pathFinderNode4.X, pathFinderNode4.Z)) == MoveResult.Success)
2671 {
2672 return MoveResult.Success;
2673 }
2674 }
2675 return MoveResult.Fail;
2676 }
static Point _sharedPos
Definition: Chara.cs:174
void RequestPathImmediate(PathProgress progress)
Definition: PathManager.cs:41
List< PathFinderNode > nodes
Definition: PathProgress.cs:16
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 9623 of file Chara.cs.

9624 {
9625 if (TC == null || TC.HasCondition<ConInvulnerable>() || TC.Evalue(1421) > 0 || !TC.ExistsOnMap)
9626 {
9627 return false;
9628 }
9629 if (TC.hp > (long)TC.MaxHP * (long)Mathf.Min(5 + (int)Mathf.Sqrt(power), harvest ? 35 : 25) / 100)
9630 {
9631 return false;
9632 }
9633 if (TC.HasElement(427))
9634 {
9635 return false;
9636 }
9637 if (TC.IsPC && EClass.player.invlunerable)
9638 {
9639 return false;
9640 }
9641 PlaySound("hit_finish");
9642 Say("finish");
9643 Say("finish2", this, TC);
9644 TC.DamageHP(TC.MaxHP, AttackSource.Finish, this);
9645 return false;
9646 }
@ harvest
bool invlunerable
Definition: Player.cs:1173
Definition: TC.cs:4

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

Referenced by ActEffect.Proc().

◆ TryNullifyCurse()

bool Chara.TryNullifyCurse ( )
inline

Definition at line 10094 of file Chara.cs.

10095 {
10096 if (IsPCParty)
10097 {
10098 foreach (Chara member in EClass.pc.party.members)
10099 {
10100 if (member.HasElement(1641) && EClass.rnd(3) != 0)
10101 {
10102 Msg.Say("curse_nullify", member);
10103 return true;
10104 }
10105 }
10106 }
10107 else if (HasElement(1641) && EClass.rnd(3) != 0)
10108 {
10109 Say("curse_nullify", this);
10110 return true;
10111 }
10112 if (GetCondition<ConHolyVeil>() != null && EClass.rnd(5) != 0)
10113 {
10114 Say("curse_nullify", this);
10115 return true;
10116 }
10117 return false;
10118 }

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

◆ TryPickGroundItem()

void Chara.TryPickGroundItem ( )
inline

Definition at line 4421 of file Chara.cs.

4422 {
4423 foreach (Card item in pos.ListCards())
4424 {
4425 if ((IsPC || !(EClass.pc.ai is AI_UseCrafter aI_UseCrafter) || !aI_UseCrafter.ings.Contains(item)) && item.isThing && item.placeState == PlaceState.roaming && CanPick(item))
4426 {
4427 Thing thing = Pick(item.Thing);
4428 if (thing != null && !IsPC)
4429 {
4430 thing.isNPCProperty = true;
4431 }
4432 break;
4433 }
4434 }
4435 }

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

Referenced by AI_Fish.Run().

◆ TryPoisonPotion()

Thing Chara.TryPoisonPotion ( Thing  t)
inline

Definition at line 4353 of file Chara.cs.

4354 {
4355 if (t.trait is TraitPotion && t.id != "1165" && !t.source.tag.Contains("neg") && EClass.rnd(2) == 0 && HasElement(1565))
4356 {
4357 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)
4358 .id;
4359 Say("poisonDrip", this);
4360 int num = t.Num;
4361 t.Destroy();
4362 t = ThingGen.Create(text).SetNum(num);
4363 }
4364 return t;
4365 }
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 3216 of file Chara.cs.

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

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

4438 {
4439 if (!EClass._zone.TryAddThingInSharedContainer(t, containers) && dropIfFail)
4440 {
4441 EClass._zone.AddCard(t, pos);
4442 }
4443 }
bool TryAddThingInSharedContainer(Thing t, List< Thing > containers=null, bool add=true, bool msg=false, Chara chara=null, bool sharedOnly=true)
Definition: Zone.cs:2120

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

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

7341 {
7342 if (GetInt(113) != 0)
7343 {
7344 return;
7345 }
7346 _ListItems.Clear();
7347 Thing bestRangedWeapon = GetBestRangedWeapon();
7348 foreach (Thing thing in things)
7349 {
7350 if (!thing.IsAmmo)
7351 {
7352 if (thing.category.slot != 0 && !thing.isEquipped && !thing.HasTag(CTAG.gift))
7353 {
7354 _ListItems.Add(thing);
7355 }
7356 else if (thing.IsRangedWeapon && thing.category.slot == 0 && bestRangedWeapon != thing)
7357 {
7358 _ListItems.Add(thing);
7359 }
7360 }
7361 }
7362 if (_ListItems.Count == 0)
7363 {
7364 return;
7365 }
7366 List<Thing> containers2 = containers.ToList();
7367 foreach (Thing listItem in _ListItems)
7368 {
7369 EClass._zone.TryAddThingInSharedContainer(listItem, containers2, add: true, msg: true, this);
7370 }
7371 }
void Add(Act a, string s="")
Definition: ActPlan.cs:11
static List< Thing > _ListItems
Definition: Chara.cs:190

References EClass._zone, 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 4397 of file Chara.cs.

4398 {
4399 if (t.id == "axe")
4400 {
4401 Tutorial.Reserve("tool");
4402 }
4403 if (t.category.id == "mushroom")
4404 {
4405 Tutorial.Reserve("food");
4406 }
4407 if (t.category.id == "herb")
4408 {
4409 Tutorial.Reserve("herb");
4410 }
4411 if (t.id == "pasture")
4412 {
4413 Tutorial.Reserve("pasture");
4414 }
4415 if (t.id == "log")
4416 {
4417 Tutorial.Reserve("process");
4418 }
4419 }

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

◆ TryRestock()

void Chara.TryRestock ( bool  onCreate)
inline

Definition at line 4678 of file Chara.cs.

4679 {
4680 isOnCreate = onCreate;
4681 if (onCreate || (!IsPCFaction && (base.IsUnique || trait is TraitAdventurer || trait is TraitGuard)))
4682 {
4683 RestockEquip((!EClass.core.IsGameStarted || !(EClass._zone is Zone_Music)) && onCreate);
4684 }
4685 RestockInventory(onCreate);
4686 }
void RestockInventory(bool onCreate)
Definition: Chara.cs:4984
void RestockEquip(bool onCreate)
Definition: Chara.cs:4688

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

6318 {
6319 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))
6320 {
6321 SetEnemy(c);
6322 }
6323 }

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

7379 {
7381 }
void TryTakeSharedItems(bool msg=true)
Definition: Chara.cs:7378

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

7384 {
7385 if (base.isSummon || (memberType == FactionMemberType.Livestock && homeBranch != null && !homeBranch.policies.IsActive(2715)))
7386 {
7387 return;
7388 }
7389 int num = 2;
7390 int num2 = 1;
7391 int num3 = 2;
7392 bool flag = GetInt(113) == 0;
7393 int num4 = 2;
7394 int num5 = 2;
7395 int num6 = 2;
7397 {
7398 num5 = 0;
7399 num6 = 0;
7400 }
7401 foreach (Thing thing3 in things)
7402 {
7403 if (CanEat(thing3, shouldEat))
7404 {
7405 if (thing3.HasElement(757))
7406 {
7407 num2 -= thing3.Num;
7408 num -= thing3.Num;
7409 }
7410 else
7411 {
7412 num -= thing3.Num;
7413 }
7414 }
7415 if (thing3.trait.GetHealAction(this) != null)
7416 {
7417 num3 -= thing3.Num;
7418 }
7419 if (thing3.id == "polish_powder")
7420 {
7421 num4 -= thing3.Num;
7422 }
7423 if (thing3.trait is TraitBlanketColdproof)
7424 {
7425 num5 -= thing3.Num;
7426 }
7427 if (thing3.trait is TraitBlanketFireproof)
7428 {
7429 num6 -= thing3.Num;
7430 }
7431 }
7432 _ListItems.Clear();
7433 foreach (Thing container in containers)
7434 {
7435 if (!container.IsSharedContainer)
7436 {
7437 continue;
7438 }
7439 foreach (Thing thing4 in container.things)
7440 {
7441 if (!thing4.c_isImportant && thing4.IsIdentified)
7442 {
7443 if (num4 > 0 && thing4.id == "polish_powder")
7444 {
7445 _ListItems.Add(thing4);
7446 num4 -= thing4.Num;
7447 }
7448 else if (num5 > 0 && !HasElement(1236) && thing4.trait is TraitBlanketColdproof)
7449 {
7450 _ListItems.Add(thing4);
7451 num5 -= thing4.Num;
7452 }
7453 else if (num6 > 0 && thing4.trait is TraitBlanketFireproof)
7454 {
7455 _ListItems.Add(thing4);
7456 num6 -= thing4.Num;
7457 }
7458 else if (num2 > 0 && CanEat(thing4, shouldEat) && !thing4.c_isImportant && thing4.HasElement(757))
7459 {
7460 _ListItems.Add(thing4);
7461 num2 -= thing4.Num;
7462 }
7463 else if (num > 0 && CanEat(thing4, shouldEat) && !thing4.c_isImportant)
7464 {
7465 _ListItems.Add(thing4);
7466 num -= thing4.Num;
7467 }
7468 else if (num3 > 0 && thing4.trait.GetHealAction(this) != null)
7469 {
7470 _ListItems.Add(thing4);
7471 num3 -= thing4.Num;
7472 }
7473 else if (flag && thing4.IsEquipmentOrRanged && !thing4.HasTag(CTAG.gift) && ShouldEquip(thing4, useFav: true))
7474 {
7475 _ListItems.Add(thing4);
7476 }
7477 }
7478 }
7479 }
7480 if (_ListItems.Count == 0)
7481 {
7482 return;
7483 }
7484 _ListItems.ForeachReverse(delegate(Thing t)
7485 {
7486 if (t.IsEquipmentOrRanged)
7487 {
7488 bool flag3 = false;
7489 int slot = t.category.slot;
7490 int equipValue = t.GetEquipValue();
7491 foreach (Thing listItem in _ListItems)
7492 {
7493 if (listItem.category.slot == slot && listItem.GetEquipValue() > equipValue)
7494 {
7495 flag3 = true;
7496 break;
7497 }
7498 }
7499 if (flag3)
7500 {
7501 _ListItems.Remove(t);
7502 }
7503 }
7504 });
7505 bool flag2 = false;
7506 foreach (Thing listItem2 in _ListItems)
7507 {
7508 Thing thing = listItem2;
7509 if (things.IsFull(thing))
7510 {
7511 break;
7512 }
7513 Thing thing2 = listItem2.parent as Thing;
7514 if (thing.HasElement(757))
7515 {
7516 if (thing.Num > 1)
7517 {
7518 thing = thing.Split(1);
7519 }
7520 }
7521 else if (thing.Num > 2)
7522 {
7523 thing = thing.Split(2);
7524 }
7525 if (msg)
7526 {
7527 Say("takeSharedItem", this, thing, thing2.GetName(NameStyle.Full));
7528 }
7529 AddCard(thing);
7530 if (ShouldEquip(thing, useFav: true) && thing.category.slot != 0)
7531 {
7532 TryEquip(thing, useFav: true);
7533 flag2 = true;
7534 }
7535 }
7536 if (flag2 && flag)
7537 {
7538 TryPutSharedItems(containers);
7539 }
7540 }
bool IsIdentified
Definition: Card.cs:2377
bool HasItemProtection
bool IsActive(int id, int days=-1)
override string GetName(NameStyle style, int _num=-1)
Definition: Thing.cs:531
bool IsSharedContainer
Definition: Thing.cs:112

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

◆ TryUpgrade()

void Chara.TryUpgrade ( bool  msg = true)
inline

Definition at line 8545 of file Chara.cs.

8546 {
8547 if (!EClass.debug.enable || IsPC || !IsGlobal || !IsPCFaction)
8548 {
8549 return;
8550 }
8551 for (int i = 0; i < 100; i++)
8552 {
8553 if (base.feat == 0)
8554 {
8555 break;
8556 }
8557 if (base.c_upgrades == null)
8558 {
8559 base.c_upgrades = new CharaUpgrade();
8560 }
8561 if (base.c_upgrades.halt)
8562 {
8563 break;
8564 }
8565 Rand.SetSeed(base.uid + base.c_upgrades.count);
8566 int num = EClass.rnd(100);
8567 int num2 = 0;
8568 int num3 = 1;
8569 int num4 = 0;
8570 bool flag = false;
8571 IEnumerable<SourceElement.Row> ie = EClass.sources.elements.rows.Where((SourceElement.Row a) => !elements.Has(a) && a.category == "skill" && !a.tag.Contains("noPet"));
8572 List<Element> list = ListAvailabeFeats(pet: true);
8573 if (num >= 90 && list.Count > 0)
8574 {
8575 Element element = list.RandomItem();
8576 num2 = element.id;
8577 num4 = element.CostLearn;
8578 }
8579 else if (num >= 60 && ie.Any())
8580 {
8581 num2 = ie.RandomItem().id;
8582 num4 = 3;
8583 }
8584 else
8585 {
8586 num2 = Element.List_MainAttributesMajor.RandomItem();
8587 num4 = 1;
8588 num3 = 2;
8589 flag = true;
8590 }
8591 Rand.SetSeed();
8592 if (num4 > base.feat)
8593 {
8594 break;
8595 }
8596 base.feat -= num4;
8597 base.c_upgrades.count++;
8598 base.c_upgrades.spent += num4;
8599 bool flag2 = false;
8600 if (flag)
8601 {
8602 foreach (CharaUpgrade.Item item in base.c_upgrades.items)
8603 {
8604 if (item.idEle == num2)
8605 {
8606 item.value += num3;
8607 item.cost += num4;
8608 flag2 = true;
8609 break;
8610 }
8611 }
8612 }
8613 if (!flag2)
8614 {
8615 base.c_upgrades.items.Add(new CharaUpgrade.Item
8616 {
8617 idEle = num2,
8618 value = num3,
8619 cost = num4
8620 });
8621 }
8622 SourceElement.Row row = EClass.sources.elements.map[num2];
8623 if (row.category == "feat")
8624 {
8625 SetFeat(num2, elements.ValueWithoutLink(num2) + 1, msg: true);
8626 }
8627 else if (elements.ValueWithoutLink(row.id) == 0)
8628 {
8629 elements.Learn(row.id);
8630 }
8631 else
8632 {
8633 elements.ModBase(num2, num3);
8634 }
8635 }
8636 }
List< Element > ListAvailabeFeats(bool pet=false, bool showAll=false)
Definition: Chara.cs:9858
void Learn(int ele, int v=1)
virtual int CostLearn
Definition: ELEMENT.cs:314
static int[] List_MainAttributesMajor
Definition: ELEMENT.cs:242
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 7870 of file Chara.cs.

7871 {
7872 if (t.id == "338")
7873 {
7874 Thing thing = things.Find((Thing a) => a.IsEquipmentOrRanged && !a.isAcidproof);
7875 if (thing != null)
7876 {
7877 Say("dip", this, thing, t.GetName(NameStyle.Full, 1));
7878 SE.Change();
7879 t.trait.OnBlend(thing, this);
7880 return true;
7881 }
7882 return false;
7883 }
7884 if (t.IsNegativeGift || t.source.HasTag(CTAG.ignoreUse))
7885 {
7886 return false;
7887 }
7888 if (t.id == "cigar")
7889 {
7890 (t.trait as TraitItemProc).OnUse(this);
7891 return true;
7892 }
7893 if (t.trait.CanEat(this) && hunger.GetPhase() > ((IsPCFaction || IsPCFactionMinion) ? 2 : 0))
7894 {
7896 {
7897 target = t
7898 });
7899 return true;
7900 }
7901 if (t.trait.CanDrink(this))
7902 {
7903 Drink(t);
7904 return true;
7905 }
7906 if (t.trait.CanRead(this))
7907 {
7909 {
7910 target = t
7911 });
7912 return true;
7913 }
7914 if (base.hp < MaxHP * 90 / 100)
7915 {
7916 Action healAction = t.trait.GetHealAction(this);
7917 if (healAction != null)
7918 {
7919 healAction();
7920 return true;
7921 }
7922 }
7923 return false;
7924 }
bool isAcidproof
Definition: Card.cs:686
void SetAIImmediate(AIAct g)
Definition: Chara.cs:8906
virtual bool CanRead(Chara c)
Definition: Trait.cs:970
virtual bool CanDrink(Chara c)
Definition: Trait.cs:988
virtual void OnBlend(Thing t, Chara c)
Definition: Trait.cs:614

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

9168 {
9169 if (EClass.world.date.IsExpired(GetInt(51)))
9170 {
9171 Expedition expedition = Expedition.Create(this, sourceWork.expedition.ToEnum<ExpeditionType>());
9172 SetInt(51, EClass.world.date.GetRaw() + 60 * (expedition.hours + 24));
9173 homeBranch.expeditions.Add(expedition);
9174 return true;
9175 }
9176 return false;
9177 }
ExpeditionType
void Add(Expedition ex)
static Expedition Create(Chara c, ExpeditionType type)
Definition: Expedition.cs:112
int hours
Definition: Expedition.cs:6
ExpeditionManager expeditions
string expedition
Definition: SourceHobby.cs:29

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

◆ UpdateAngle()

void Chara.UpdateAngle ( )
inline

Definition at line 3575 of file Chara.cs.

3576 {
3577 if (IsPCC)
3578 {
3579 if (base.dir == 0)
3580 {
3581 angle = 225f;
3582 }
3583 else if (base.dir == 1)
3584 {
3585 angle = 135f;
3586 }
3587 else if (base.dir == 2)
3588 {
3589 angle = 45f;
3590 }
3591 else if (base.dir == 3)
3592 {
3593 angle = -45f;
3594 }
3595 }
3596 else if (base.dir == 0)
3597 {
3598 angle = 165f;
3599 }
3600 else if (base.dir == 1)
3601 {
3602 angle = 300f;
3603 }
3604 else if (base.dir == 2)
3605 {
3606 angle = 0f;
3607 }
3608 else if (base.dir == 3)
3609 {
3610 angle = 120f;
3611 }
3612 }

Referenced by OnDeserialized().

◆ UpdateSight()

void Chara.UpdateSight ( )
inline

Definition at line 3636 of file Chara.cs.

3637 {
3638 int num = 4;
3639 for (int i = -num; i < num + 1; i++)
3640 {
3641 for (int j = -num; j < num + 1; j++)
3642 {
3643 shared.Set(pos.x + i, pos.z + j);
3644 if (shared.IsValid && !shared.cell.isSeen && i >= -1 && i <= 1 && j >= -1)
3645 {
3646 _ = 1;
3647 }
3648 }
3649 }
3650 }
bool isSeen
Definition: Cell.cs:282
static Point shared
Definition: Chara.cs:11

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

◆ UseAbility() [1/3]

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

Definition at line 5838 of file Chara.cs.

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

◆ UseAbility() [2/3]

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

◆ UseAbility() [3/3]

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

Definition at line 5833 of file Chara.cs.

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

References ACT.Create().

◆ ValidateWorks()

void Chara.ValidateWorks ( )
inline

Definition at line 9215 of file Chara.cs.

9216 {
9217 _goalWork.FindWork(this, setAI: false);
9219 }
static GoalHobby _goalHobby
Definition: Chara.cs:208
static GoalWork _goalWork
Definition: Chara.cs:206
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 5269 of file Chara.cs.

5270 {
5271 base.c_vomit++;
5272 Say("vomit", this);
5273 PlaySound("vomit");
5274 if (!EClass._zone.IsRegion)
5275 {
5276 Thing thing = ThingGen.Create("731");
5278 {
5279 thing.MakeRefFrom(this);
5280 }
5281 EClass._zone.AddCard(thing, pos);
5282 }
5283 if (HasCondition<ConAnorexia>())
5284 {
5285 ModExp(70, -50);
5286 ModExp(71, -75);
5287 ModExp(77, -100);
5288 }
5289 else if (base.c_vomit > 10)
5290 {
5291 AddCondition<ConAnorexia>();
5292 }
5293 AddCondition<ConDim>();
5294 if (HasCondition<ConAnorexia>())
5295 {
5296 ModWeight(-1 * (1 + EClass.rnd(5)));
5297 }
5298 if (hunger.GetPhase() >= 4)
5299 {
5300 DamageHP(9999L, AttackSource.Hunger);
5301 }
5302 hunger.Mod(30);
5303 }
void ModWeight(int a, bool ignoreLimit=false)
Definition: Chara.cs:9786

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

3653 {
3654 for (int num = conditions.Count - 1; num >= 0; num--)
3655 {
3656 if (conditions[num].ConsumeTurn)
3657 {
3658 return true;
3659 }
3660 }
3661 return false;
3662 }

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

7265 {
7266 n.Clear();
7267 UIItem uIItem = n.AddHeaderCard(base.Name.ToTitleCase());
7268 SetImage(uIItem.image2);
7269 uIItem.text2.SetText(race.GetText().ToTitleCase(wholeText: true) + " " + job.GetText().ToTitleCase(wholeText: true));
7270 n.AddText("");
7271 n.Build();
7272 }
void SetImage(Image image, int dir, int idSkin=0)
Definition: Card.cs:6106
Definition: UIItem.cs:5
Image image2
Definition: UIItem.cs:16
UIText text2
Definition: UIItem.cs:8
UIItem AddHeaderCard(string text, Sprite sprite=null)
Definition: UINote.cs:84
void Clear()
Definition: UINote.cs:35
UIItem AddText(string text, FontColor color=FontColor.DontChange)
Definition: UINote.cs:113
void Build()
Definition: UINote.cs:49
void SetText(string s)
Definition: UIText.cs:159

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

Member Data Documentation

◆ _ability

CharaAbility Chara._ability

Definition at line 96 of file Chara.cs.

Referenced by SetMainElement().

◆ _baseWorkElements

ElementContainer Chara._baseWorkElements

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

Referenced by SetFaction().

◆ _goalHobby

GoalHobby Chara._goalHobby = new GoalHobby()
staticprivate

Definition at line 208 of file Chara.cs.

◆ _goalWork

GoalWork Chara._goalWork = new GoalWork()
staticprivate

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

Referenced by HasHigherGround(), and Refresh().

◆ _job

SourceJob.Row Chara._job

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

◆ _listFavFood

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

Definition at line 192 of file Chara.cs.

◆ _ListItems

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

Definition at line 190 of file Chara.cs.

◆ _NoGoalPC

NoGoal Chara._NoGoalPC = new NoGoal()
static

Definition at line 196 of file Chara.cs.

◆ _NoGoalRepeat

NoGoal Chara._NoGoalRepeat = new NoGoal()
static

Definition at line 198 of file Chara.cs.

Referenced by ActPlan.Item.Perform().

◆ _pts

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

Definition at line 186 of file Chara.cs.

◆ _race

SourceRace.Row Chara._race

Definition at line 160 of file Chara.cs.

Referenced by ChangeRace(), and OnCreate().

◆ _sharedPos

Point Chara._sharedPos = new Point()
staticprivate

Definition at line 174 of file Chara.cs.

Referenced by TryMoveTowards().

◆ _Speed

long Chara._Speed
private

Definition at line 172 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 164 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 178 of file Chara.cs.

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

◆ ai

◆ body

◆ bossText

bool Chara.bossText

Definition at line 144 of file Chara.cs.

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

◆ calmCheckTurn

int Chara.calmCheckTurn

Definition at line 116 of file Chara.cs.

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

◆ canSeeInvisible

bool Chara.canSeeInvisible

Definition at line 138 of file Chara.cs.

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

◆ combatCount

int Chara.combatCount

Definition at line 114 of file Chara.cs.

◆ conditions

◆ conSleep

◆ consumeTurn

bool Chara.consumeTurn
static

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

Referenced by RefreshSpeed(), and SetDirtySpeed().

◆ emoIcon

Emo2 Chara.emoIcon

Definition at line 106 of file Chara.cs.

Referenced by TCOrbitChara.RefreshAll(), and BaseCondition.SetOwner().

◆ enemy

◆ faithElements

◆ global

◆ goalList

GoalList Chara.goalList = new GoalList()

Definition at line 200 of file Chara.cs.

◆ happiness

int Chara.happiness

Definition at line 108 of file Chara.cs.

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

◆ hasMovedThisTurn

bool Chara.hasMovedThisTurn
private

Definition at line 176 of file Chara.cs.

Referenced by _Move().

◆ hasTelepathy

bool Chara.hasTelepathy

◆ held

◆ host

◆ idleActTimer

int Chara.idleActTimer

Definition at line 112 of file Chara.cs.

Referenced by AI_Idle.Run().

◆ idleTimer

float Chara.idleTimer

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

◆ isBerserk

bool Chara.isBerserk

◆ isBlind

◆ isConfused

◆ isCreated

bool Chara.isCreated

Definition at line 136 of file Chara.cs.

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

◆ isDrunk

bool Chara.isDrunk

Definition at line 124 of file Chara.cs.

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

◆ isFainted

bool Chara.isFainted

Definition at line 128 of file Chara.cs.

◆ isOnCreate

bool Chara.isOnCreate
static

Definition at line 184 of file Chara.cs.

◆ isParalyzed

bool Chara.isParalyzed

Definition at line 132 of file Chara.cs.

Referenced by Point.ListWitnesses().

◆ isWeakToSunlight

bool Chara.isWeakToSunlight

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

Referenced by OnCreate().

◆ ListAdvRace

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

Definition at line 166 of file Chara.cs.

Referenced by OnCreate().

◆ listHobby

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

Definition at line 13 of file Chara.cs.

◆ master

Chara Chara.master

Definition at line 88 of file Chara.cs.

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

◆ memberType

◆ 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 182 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 214 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 118 of file Chara.cs.

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

◆ source

◆ spriteReplacer

SpriteReplacer Chara.spriteReplacer

Definition at line 154 of file Chara.cs.

Referenced by LayerEditSkin.RefreshImage().

◆ stealthSeen

int Chara.stealthSeen

Definition at line 188 of file Chara.cs.

◆ tempElements

◆ turnLastSeen

int Chara.turnLastSeen = -100

Definition at line 110 of file Chara.cs.

Referenced by AI_Idle.Run().

◆ visibleWithTelepathy

bool Chara.visibleWithTelepathy

◆ wasInWater

bool Chara.wasInWater

Definition at line 148 of file Chara.cs.

◆ workElements

ElementContainer Chara.workElements

Definition at line 40 of file Chara.cs.

Property Documentation

◆ _affinity

int Chara._affinity
getset

Definition at line 302 of file Chara.cs.

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

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

◆ _alias

string Chara._alias
getset

Definition at line 218 of file Chara.cs.

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

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

◆ _idTimeTable

int Chara._idTimeTable
getset

Definition at line 340 of file Chara.cs.

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

Referenced by OnCreate().

◆ _maxStamina

int Chara._maxStamina
getset

Definition at line 364 of file Chara.cs.

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

Referenced by CalculateMaxStamina().

◆ ability

◆ actorPrefab

override string Chara.actorPrefab
get

Definition at line 518 of file Chara.cs.

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

◆ affinity

◆ Aka

◆ AliasMaterialOnCreate

override string Chara.AliasMaterialOnCreate
get

Definition at line 558 of file Chara.cs.

◆ baseWorkElements

ElementContainer Chara.baseWorkElements
get

Definition at line 1110 of file Chara.cs.

1111 {
1112 get
1113 {
1114 if (_baseWorkElements == null)
1115 {
1117 foreach (Hobby item in ListHobbies())
1118 {
1119 Build(item);
1120 }
1121 foreach (Hobby item2 in ListWorks())
1122 {
1123 Build(item2);
1124 }
1125 }
1126 return _baseWorkElements;
1127 void Build(Hobby h)
1128 {
1129 if (!h.source.elements.IsEmpty())
1130 {
1131 for (int i = 0; i < h.source.elements.Length; i += 2)
1132 {
1133 int ele = h.source.elements[i];
1134 int v = h.source.elements[i + 1];
1135 _baseWorkElements.ModBase(ele, v);
1136 }
1137 }
1138 }
1139 }
1140 }
ElementContainer _baseWorkElements
Definition: Chara.cs:204

◆ bladder

Stats Chara.bladder
get

Definition at line 1150 of file Chara.cs.

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

◆ burden

◆ CanGainConResist

bool Chara.CanGainConResist
get

Definition at line 1160 of file Chara.cs.

1161 {
1162 get
1163 {
1164 if (base.rarity >= Rarity.Legendary)
1165 {
1166 return !IsPCFaction;
1167 }
1168 return false;
1169 }
1170 }

◆ CanOpenDoor

bool Chara.CanOpenDoor
get

Definition at line 818 of file Chara.cs.

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

◆ CanWitness

bool Chara.CanWitness
get

Definition at line 1002 of file Chara.cs.

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

Referenced by Point.ListWitnesses().

◆ corruption

int Chara.corruption
getset

Definition at line 376 of file Chara.cs.

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

Referenced by CanDuplicate().

◆ CurrentGeneSlot

int Chara.CurrentGeneSlot
get

Definition at line 1070 of file Chara.cs.

1071 {
1072 get
1073 {
1074 if (base.c_genes != null)
1075 {
1076 return base.c_genes.GetGeneSlot(this);
1077 }
1078 return 0;
1079 }
1080 }

Referenced by InvOwnerGene._OnProcess(), CanDuplicate(), InvOwnerGene.OnWriteNote(), and WindowCharaMini.Refresh().

◆ CurrentSpan

TimeTable.Span Chara.CurrentSpan
get

Definition at line 836 of file Chara.cs.

Referenced by ConSleep.Tick().

◆ currentZone

Zone Chara.currentZone
getset

Definition at line 254 of file Chara.cs.

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

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

◆ daysStarved

int Chara.daysStarved
getset

Definition at line 328 of file Chara.cs.

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

◆ depression

Stats Chara.depression
get

Definition at line 1148 of file Chara.cs.

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

◆ DestDist

int Chara.DestDist
get

Definition at line 998 of file Chara.cs.

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

◆ DV

override int Chara.DV
get

Definition at line 728 of file Chara.cs.

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

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

◆ faction

Faction Chara.faction
getset

Definition at line 426 of file Chara.cs.

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

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

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

Referenced by CharaActor.RefreshSprite().

◆ goalListType

GoalListType Chara.goalListType
getset

Definition at line 278 of file Chara.cs.

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

◆ HasHost

override bool Chara.HasHost
get

Definition at line 688 of file Chara.cs.

Referenced by ActEffect.Proc().

◆ HasNoGoal

◆ homeBranch

◆ homeZone

◆ hostility

◆ hunger

◆ hygiene

Stats Chara.hygiene
get

Definition at line 1152 of file Chara.cs.

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

◆ idFaction

string Chara.idFaction
getset

Definition at line 242 of file Chara.cs.

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

◆ idFaith

string Chara.idFaith
getset

Definition at line 230 of file Chara.cs.

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

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

◆ IDPCCBodySet

string Chara.IDPCCBodySet
get

Definition at line 490 of file Chara.cs.

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

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

◆ idTimeTable

string Chara.idTimeTable
get

Definition at line 468 of file Chara.cs.

Referenced by LayerQuestBoard.RefreshHire().

◆ interest

int Chara.interest
getset

Definition at line 316 of file Chara.cs.

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

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

◆ IsAdventurer

bool Chara.IsAdventurer
get

Definition at line 1040 of file Chara.cs.

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

◆ isAlawysVisible

bool Chara.isAlawysVisible
getset

Definition at line 400 of file Chara.cs.

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

◆ IsAliveInCurrentZone

◆ IsAnimal

bool Chara.IsAnimal
get

Definition at line 866 of file Chara.cs.

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

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

◆ IsCat

bool Chara.IsCat
get

Definition at line 986 of file Chara.cs.

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

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

◆ isChara

override bool Chara.isChara
get

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

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

◆ IsEyth

bool Chara.IsEyth
get

◆ IsFairy

bool Chara.IsFairy
get

Definition at line 938 of file Chara.cs.

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

Referenced by Faction.IsWearingPanty().

◆ IsFish

bool Chara.IsFish
get

Definition at line 926 of file Chara.cs.

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

◆ IsGlobal

◆ IsGod

bool Chara.IsGod
get

Definition at line 950 of file Chara.cs.

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

◆ IsHorror

bool Chara.IsHorror
get

Definition at line 914 of file Chara.cs.

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

Referenced by Refresh().

◆ IsHuman

bool Chara.IsHuman
get

Definition at line 878 of file Chara.cs.

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

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

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

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

◆ IsIdle

bool Chara.IsIdle
get

Definition at line 852 of file Chara.cs.

853 {
854 get
855 {
856 if (!IsDeadOrSleeping)
857 {
858 return ai.Current.IsIdle;
859 }
860 return false;
861 }
862 }
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 596 of file Chara.cs.

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

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

◆ IsLocalChara

bool Chara.IsLocalChara
get

Definition at line 840 of file Chara.cs.

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

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

◆ IsMachine

bool Chara.IsMachine
get

Definition at line 902 of file Chara.cs.

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

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

◆ IsMaid

bool Chara.IsMaid
get

Definition at line 1026 of file Chara.cs.

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

Referenced by FactionBranch.GetMaid().

◆ IsMinion

override bool Chara.IsMinion
get

Definition at line 626 of file Chara.cs.

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

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

◆ IsMofuable

bool Chara.IsMofuable
get

Definition at line 1098 of file Chara.cs.

1099 {
1100 get
1101 {
1102 if (!race.tag.Contains("mofu"))
1103 {
1104 return HasElement(419);
1105 }
1106 return true;
1107 }
1108 }

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

◆ IsMoving

override bool Chara.IsMoving
get

Definition at line 608 of file Chara.cs.

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

◆ IsMultisize

◆ IsPC

override bool Chara.IsPC
get

Definition at line 612 of file Chara.cs.

Referenced by _Move(), TraitShrine._OnUse(), ActPlan._Update(), Element._WriteNote(), TraitSwitch.ActivateTrap(), Zone.AddGlobalCharasOnActivate(), Feat.Apply(), ActMelee.Attack(), CalcBurden(), CalculateMaxStamina(), TraitTrolley.CanActivate(), Thing.CanAutoFire(), AIAct.Cancel(), TraitFoodPreparedPackage.CanEat(), CanMoveTo(), Act.CanPerform(), TraitScroll.CanRead(), 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(), FactionBranch.GetResidentTax(), Zone.GetSpawnPos(), HasAccess(), Party.HasElement(), TraitGamble.IdleUse(), Zone.IsCrime(), Party.IsCriticallyWounded(), CharaBody.IsEquippable(), Religion.JoinFaith(), 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(), RefreshSpeed(), CoreDebug.RegenerateNames(), RequestProtection(), AI_Eat.Run(), AI_Fish.Run(), AI_Goto.Run(), AI_Idle.Run(), AI_PassTime.Run(), AI_PlayMusic.Run(), AI_Torture.Run(), AI_Trolley.Run(), AIProgress.Run(), GoalCombat.Run(), TaskPoint.Run(), Map.Save(), WindowChara.SetChara(), CharaRenderer.SetFirst(), LayerDragGrid.SetInv(), AIAct.Start(), ConSleep.SuccubusVisit(), Player.TargetRanged(), ConFear.Tick(), ConSleep.Tick(), ConSuffocation.Tick(), AIAct.TryCancel(), TaskHarvest.TryGetAct(), AI_Goto.TryGoTo(), GoalCombat.TryMove(), TryMove(), TryMoveFrom(), 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 670 of file Chara.cs.

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

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

◆ IsPCFactionMinion

override bool Chara.IsPCFactionMinion
get

Definition at line 654 of file Chara.cs.

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

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

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

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

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

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

◆ IsPlant

bool Chara.IsPlant
get

Definition at line 974 of file Chara.cs.

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

Referenced by GoalCombat.Run().

◆ IsPrisoner

bool Chara.IsPrisoner
get

Definition at line 1038 of file Chara.cs.

◆ isSynced

override bool Chara.isSynced
get

◆ isThing

override bool Chara.isThing
get

Definition at line 684 of file Chara.cs.

◆ IsUndead

bool Chara.IsUndead
get

Definition at line 890 of file Chara.cs.

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

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

◆ IsWealthy

bool Chara.IsWealthy
get

Definition at line 1054 of file Chara.cs.

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

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

◆ job

◆ knowFav

bool Chara.knowFav
getset

Definition at line 412 of file Chara.cs.

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

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

◆ MainElement

Element Chara.MainElement
get

Definition at line 716 of file Chara.cs.

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

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

◆ mana

◆ MaxGeneSlot

int Chara.MaxGeneSlot
get

◆ MaxHP

◆ MaxSummon

int Chara.MaxSummon
get

◆ NameBraced

string Chara.NameBraced
get

◆ NameTitled

string Chara.NameTitled
get

Definition at line 516 of file Chara.cs.

Referenced by ActEffect.Proc().

◆ OriginalHostility

Hostility Chara.OriginalHostility
get

Definition at line 470 of file Chara.cs.

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

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

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

Referenced by BaseTileMap.DrawTile(), and LayerEditSkin.OnClickEdit().

◆ PrefIndex

override int Chara.PrefIndex
get

Definition at line 530 of file Chara.cs.

531 {
532 get
533 {
534 if (sourceCard._tiles.Length != 0 || renderer.replacer != null)
535 {
536 if (base.dir != 1 && base.dir != 2)
537 {
538 return 0;
539 }
540 return 1;
541 }
542 return base.dir;
543 }
544 }

◆ PV

override int Chara.PV
get

Definition at line 757 of file Chara.cs.

758 {
759 get
760 {
761 if (IsPCFaction)
762 {
763 return WeaknessMod(elements.Value(65));
764 }
765 int num = base.LV;
766 if (num > 50)
767 {
768 num = 50 + (num - 50) / 10;
769 }
770 return WeaknessMod(num + elements.Value(65) * (100 + num + race.PV * 5) / 100);
771 int WeaknessMod(int a)
772 {
773 if (HasCondition<ConWeakness>())
774 {
775 if (a <= 0)
776 {
777 return a * 2;
778 }
779 return a / 2;
780 }
781 return a;
782 }
783 }
784 }

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

◆ race

◆ SAN

◆ SelfWeight

override int Chara.SelfWeight
get

Definition at line 712 of file Chara.cs.

◆ sleepiness

Stats Chara.sleepiness
get

◆ sourceCard

override CardRow Chara.sourceCard
get

◆ sourceRenderCard

override CardRow Chara.sourceRenderCard
get

Definition at line 452 of file Chara.cs.

453 {
454 get
455 {
456 if (pccData != null && !(source.renderData is RenderDataPcc))
457 {
459 }
460 return source;
461 }
462 }
static Row rowDefaultPCC
Definition: SourceChara.cs:140

◆ Speed

int Chara.Speed
get

Definition at line 1082 of file Chara.cs.

1083 {
1084 get
1085 {
1086 if (dirtySpeed)
1087 {
1088 RefreshSpeed();
1089 }
1090 if (_Speed > 100000000)
1091 {
1092 return 100000000;
1093 }
1094 return (int)_Speed;
1095 }
1096 }

Referenced by GameUpdater.ConditionUpdater.FixedUpdate().

◆ stamina

◆ tactics

Tactics Chara.tactics
get

Definition at line 834 of file Chara.cs.

◆ trait

◆ uidEditor

int Chara.uidEditor
getset

Definition at line 352 of file Chara.cs.

353 {
354 get
355 {
356 return _cints[10];
357 }
358 set
359 {
360 _cints[10] = value;
361 }
362 }

Referenced by SerializedCards.Add().

◆ WeightLimit

override int Chara.WeightLimit
get

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