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

Public Member Functions

override string ToString ()
 
bool IsCriticallyWounded (bool includeRide=false)
 
bool HasHigherGround (Card c)
 
bool CanSeeSimple (Point p)
 
bool CanSee (Card c)
 
bool CanSeeLos (Card c, int dist=-1)
 
bool CanSeeLos (Point p, int dist=-1)
 
bool HasAccess (Card c)
 
bool HasAccess (Point p)
 
bool CanSleep ()
 
override string GetName (NameStyle style, int num=-1)
 
override void ChangeRarity (Rarity r)
 
Chara SetFaction (Faction f)
 
Chara SetHomeZone (Zone zone)
 
Chara SetHostility (Hostility h)
 
void OnBanish ()
 
Chara SetGlobal (Zone _home, int x, int z)
 
Chara SetGlobal ()
 
void RemoveGlobal ()
 
override void OnBeforeCreate ()
 
override void OnCreate (int genLv)
 
Chara ScaleByPrincipal ()
 
void SetFaith (string id)
 
void SetFaith (Religion r)
 
void HealAll ()
 
void Refresh (bool calledRecursive=false)
 
bool CanDuplicate ()
 
Chara Duplicate ()
 
int GetBurden (Card t=null, int num=-1)
 
void CalcBurden ()
 
void Stumble (int mtp=100)
 
void SetDirtySpeed ()
 
void RefreshSpeed (Element.BonusInfo info=null)
 
void CalculateMaxStamina ()
 
override void ApplyEditorTags (EditorTag tag)
 
override void SetSource ()
 
void SetMainElement (string id, int v=0, bool elemental=false)
 
void SetMainElement (int id, int v=0, bool elemental=false)
 
void ApplyJob (bool remove=false)
 
void ChangeJob (string idNew)
 
void AddRandomBodyPart (bool msg=false)
 
void RemoveLastBodyPart (bool msg=false)
 
void ResetBody ()
 
void ApplyRace (bool remove=false)
 
void ChangeRace (string idNew)
 
void MakePartyMemeber ()
 
void MakeAlly (bool msg=true)
 
void _MakeAlly ()
 
bool CanBeTempAlly (Chara c)
 
void Banish (Chara owner)
 
void MakeMinion (Chara _master, MinionType type=MinionType.Default)
 
bool HasMinion (string id)
 
void ReleaseMinion ()
 
void SetSummon (int duration)
 
Chara FindMaster ()
 
bool IsEscorted ()
 
bool CanDestroyPath ()
 
bool CanMoveTo (Point p, bool allowDestroyPath=true)
 
bool IsEnemyOnPath (Point p, bool cancelAI=true)
 
bool CanInteractTo (Card c)
 
bool CanInteractTo (Point p)
 
Point GetFirstStep (Point newPoint, PathManager.MoveType moveType=PathManager.MoveType.Default)
 
bool MoveRandom ()
 
bool MoveNeighborDefinitely ()
 
void MoveByForce (Point newPoint, Card c=null, bool checkWall=false)
 
MoveResult TryMoveTowards (Point p)
 
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 (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)
 
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)
 
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)
 
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 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)
 
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, int req=1)
 
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
 
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]
 
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 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 6546 of file Chara.cs.

6547 {
6548 CardRenderer cardRenderer = renderer;
6549 CharaRenderer charaRenderer = new CharaRenderer();
6550 if (source.skinAntiSpider != 0 && EClass.core.config.game.antiSpider)
6551 {
6552 base.idSkin = source.skinAntiSpider;
6553 }
6554 if (host != null)
6555 {
6556 charaRenderer.pccData = PCCData.Create("ride");
6557 string idPart = base.c_idRidePCC.IsEmpty(EClass.core.pccs.sets["ride"].map["body"].map.Keys.First());
6558 charaRenderer.pccData.SetPart("body", "ride", idPart);
6559 charaRenderer.pccData.ride = EClass.core.pccs.GetRideData(idPart);
6560 }
6561 else
6562 {
6563 foreach (Condition condition in conditions)
6564 {
6565 RendererReplacer rendererReplacer = condition.GetRendererReplacer();
6566 if (rendererReplacer != null)
6567 {
6568 charaRenderer.replacer = rendererReplacer;
6569 charaRenderer.data = rendererReplacer.data;
6570 break;
6571 }
6572 }
6573 if (charaRenderer.replacer == null)
6574 {
6575 charaRenderer.pccData = pccData;
6576 }
6577 }
6578 renderer = charaRenderer;
6579 renderer.SetOwner(this);
6580 if (cardRenderer != null)
6581 {
6582 renderer.SetFirst(first: false, cardRenderer.position);
6583 }
6584 return charaRenderer;
6585 }
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:209
SourceChara.Row source
Definition: Chara.cs:156
PCCData pccData
Definition: Chara.cs:67
new GameConfig game
Definition: CoreConfig.cs:605
PCCManager pccs
Definition: Core.cs:41
CoreConfig config
Definition: Core.cs:70
Definition: EClass.cs:5
static Core core
Definition: EClass.cs:6

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

2283 {
2284 if (EClass.pc.homeBranch != null)
2285 {
2287 }
2288 else
2289 {
2290 SetGlobal();
2292 }
2293 Hostility hostility2 = (base.c_originalHostility = Hostility.Ally);
2294 this.hostility = hostility2;
2295 orgPos = null;
2296 base.c_summonDuration = 0;
2297 base.isSummon = false;
2298 ReleaseMinion();
2299 SetInt(32);
2300 Refresh();
2301 }
Hostility
Definition: Hostility.cs:2
list. Refresh()
void SetInt(int id, int value=0)
Definition: BaseCard.cs:39
void ReleaseMinion()
Definition: Chara.cs:2348
Chara SetFaction(Faction f)
Definition: Chara.cs:1417
Point orgPos
Definition: Chara.cs:21
FactionBranch homeBranch
Definition: Chara.cs:1064
Chara SetGlobal()
Definition: Chara.cs:1484
static Faction Home
Definition: EClass.cs:26
static Chara pc
Definition: EClass.cs:14
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 2728 of file Chara.cs.

2729 {
2730 if (isDead)
2731 {
2732 return MoveResult.Fail;
2733 }
2734 if (IsPC)
2735 {
2736 float num = EClass.setting.defaultActPace;
2737 switch (burden.GetPhase())
2738 {
2739 case 3:
2740 num *= 1.5f;
2741 break;
2742 case 4:
2743 num *= 2f;
2744 break;
2745 }
2747 {
2748 int num2 = 30;
2749 if (!EClass.pc.HasElement(408))
2750 {
2752 {
2753 case Weather.Condition.Rain:
2754 num2 += 5;
2755 break;
2756 case Weather.Condition.RainHeavy:
2757 num2 += 10;
2758 num *= 1.5f;
2759 break;
2760 case Weather.Condition.Snow:
2761 num2 += 10;
2762 break;
2763 case Weather.Condition.SnowHeavy:
2764 num2 += 15;
2765 num *= 1.5f;
2766 break;
2767 }
2768 }
2769 if (newPoint.matFloor.id == 48)
2770 {
2771 num2 += 20;
2772 num *= 1.8f;
2773 }
2774 num2 = num2 * 100 / (100 + EvalueMax(240, -20) + EvalueMax(407, -5) * 5);
2775 EClass.world.date.AdvanceMin(num2 * 6);
2776 EClass.player.lastZonePos = null;
2778 int num3 = base.hp;
2779 for (int i = 0; i < num2 * 4; i++)
2780 {
2781 EClass.pc.party.members.ForeachReverse(delegate(Chara m)
2782 {
2783 if (!m.isDead)
2784 {
2785 m.TickConditions();
2786 }
2787 });
2788 if (base.hp < MaxHP / 5 && base.hp < num3 && !EClass.player.regionMoveWarned)
2789 {
2790 EClass.player.regionMoveWarned = true;
2791 Msg.Say("regionAbortMove");
2792 EInput.Consume(consumeAxis: true);
2793 SetAI(new NoGoal());
2794 return MoveResult.Fail;
2795 }
2796 }
2797 if (newPoint.cell.CanSuffocate())
2798 {
2799 AddCondition<ConSuffocation>((EClass.pc.Evalue(200) != 0) ? (2000 / (100 + EvalueMax(200, -5) * 10)) : 30, force: true);
2800 int num4 = GetCondition<ConSuffocation>()?.GetPhase() ?? 0;
2801 if (num4 >= 2)
2802 {
2803 DamageHP(EClass.rndHalf(10 + MaxHP / 5), AttackSource.Condition);
2804 }
2805 if (!isDead && !HasElement(429))
2806 {
2807 ModExp(200, 1 + num4 * 12);
2808 }
2809 }
2810 EClass.player.regionMoveWarned = false;
2811 if (isDead)
2812 {
2813 return MoveResult.Fail;
2814 }
2815 }
2816 if (num > EClass.setting.defaultActPace * 3f)
2817 {
2818 num = EClass.setting.defaultActPace * 3f;
2819 }
2820 actTime = num;
2821 }
2822 if (IsPCFaction && EClass.rnd(5) == 0 && newPoint.cell.CanSuffocate())
2823 {
2824 ModExp(200, EClass._zone.IsRegion ? 50 : 5);
2825 if (ride != null)
2826 {
2827 ride.ModExp(200, EClass._zone.IsRegion ? 50 : 5);
2828 }
2829 if (parasite != null)
2830 {
2831 parasite.ModExp(200, EClass._zone.IsRegion ? 50 : 5);
2832 }
2833 }
2834 Chara chara = ((ride == null) ? this : ride);
2835 if (!EClass._zone.IsRegion || chara.IsPC)
2836 {
2837 bool flag = (chara.isConfused && EClass.rnd(2) == 0) || (chara.isDrunk && EClass.rnd(IsIdle ? 2 : 8) == 0 && !chara.HasElement(1215));
2838 if (host != null && host.ride == this && ((host.isConfused && EClass.rnd(2) == 0) || (host.isDrunk && EClass.rnd(IsIdle ? 2 : 8) == 0 && !host.HasElement(1215))))
2839 {
2840 flag = true;
2841 }
2842 if (flag && newPoint.Distance(pos) <= 1)
2843 {
2844 Point randomNeighbor = pos.GetRandomNeighbor();
2845 if (CanMoveTo(randomNeighbor, allowDestroyPath: false))
2846 {
2847 newPoint = randomNeighbor;
2848 if (isDrunk)
2849 {
2850 Talk("drunk");
2851 }
2852 }
2853 }
2854 }
2855 if (newPoint.x != pos.x || newPoint.z != pos.z)
2856 {
2857 LookAt(newPoint);
2858 }
2859 CellEffect effect = base.Cell.effect;
2860 if (effect != null && effect.id == 7)
2861 {
2862 CellEffect effect2 = base.Cell.effect;
2863 if (race.height < 500 && !race.tag.Contains("webfree") && EClass.rnd(effect2.power + 25) > EClass.rnd(base.STR + base.DEX + 1))
2864 {
2865 Say("abWeb_caught", this);
2866 PlaySound("web");
2867 effect2.power = effect2.power * 3 / 4;
2868 renderer.PlayAnime(AnimeID.Shiver);
2869 return MoveResult.Fail;
2870 }
2871 Say("abWeb_pass", this);
2872 EClass._map.SetEffect(base.Cell.x, base.Cell.z);
2873 }
2874 if (IsPC)
2875 {
2876 if (EClass._zone.IsRegion)
2877 {
2879 }
2880 else if ((newPoint.x > pos.x && newPoint.z > pos.z) || (newPoint.x < pos.x && newPoint.z < pos.z))
2881 {
2883 }
2884 }
2885 if (newPoint.cell.hasDoor)
2886 {
2887 foreach (Thing thing in pos.Things)
2888 {
2889 if (thing.trait is TraitDoor traitDoor && traitDoor.owner.c_lockLv > 0)
2890 {
2891 if (base.INT < 10)
2892 {
2893 return MoveResult.Fail;
2894 }
2895 traitDoor.TryOpenLock(this);
2896 return MoveResult.Door;
2897 }
2898 }
2899 }
2900 Cell cell = newPoint.cell;
2901 Cell cell2 = pos.cell;
2902 bool flag2 = cell.HasLiquid && !IsLevitating;
2903 bool hasBridge = cell.HasBridge;
2904 bool hasRamp = cell.HasRamp;
2905 bool flag3 = EClass._zone.IsSnowCovered && !cell.HasRoof && !cell.isClearSnow;
2906 TileRow tileRow = (hasRamp ? ((TileRow)cell.sourceBlock) : ((TileRow)(hasBridge ? cell.sourceBridge : cell.sourceFloor)));
2907 SourceMaterial.Row row = (hasRamp ? cell.matBlock : (hasBridge ? cell.matBridge : cell.matFloor));
2908 bool flag4 = cell.IsTopWater && !cell.isFloating;
2909 if (!EClass._zone.IsRegion)
2910 {
2911 if (cell.hasDoorBoat)
2912 {
2913 tileRow = FLOOR.sourceWood;
2914 row = MATERIAL.sourceOak;
2915 flag4 = false;
2916 }
2917 else if (flag3 && !tileRow.ignoreSnow)
2918 {
2919 if (tileRow.tileType.IsWater)
2920 {
2921 tileRow = FLOOR.sourceIce;
2922 row = MATERIAL.sourceIce;
2923 }
2924 else
2925 {
2926 tileRow = FLOOR.sourceSnow;
2927 row = MATERIAL.sourceSnow;
2928 }
2929 flag4 = false;
2930 }
2931 }
2932 if ((pos.sourceFloor.isBeach || cell2.IsSnowTile) && !pos.HasObj)
2933 {
2934 EClass._map.SetFoormark(pos, 1, (int)Util.GetAngle(pos.x - newPoint.x, pos.z - newPoint.z), cell2.IsSnowTile ? 312 : 304);
2935 }
2936 if (isSynced)
2937 {
2938 string text = ((flag2 || flag4) ? "water" : tileRow.soundFoot.IsEmpty(row.soundFoot.IsEmpty("default")));
2939 if (cell.obj != 0 && cell.sourceObj.tileType.IsPlayFootSound && !cell.matObj.soundFoot.IsEmpty())
2940 {
2941 text = cell.matObj.soundFoot;
2942 }
2943 if (IsPC)
2944 {
2945 foreach (Thing thing2 in newPoint.Things)
2946 {
2947 if (thing2.IsInstalled && (thing2.trait.IsChangeFloorHeight || thing2.Pref.Surface))
2948 {
2949 text = thing2.material.soundFoot;
2950 }
2951 }
2952 }
2953 if (!text.IsEmpty())
2954 {
2955 SoundManager.altLastData = IsPC;
2956 PlaySound("Footstep/" + text, IsPC ? 1f : 0.9f);
2957 }
2958 if (!flag4)
2959 {
2961 PCOrbit pcOrbit = EClass.screen.pcOrbit;
2962 bool flag5 = scene.actionMode.gameSpeed > 1f;
2963 scene.psFoot.transform.position = renderer.position + pcOrbit.footPos;
2964 scene.psFoot.startColor = row.matColor;
2965 scene.psFoot.Emit(pcOrbit.emitFoot * ((!flag5) ? 1 : 2));
2966 if (flag5 && IsPC)
2967 {
2968 scene.psSmoke.transform.position = renderer.position + pcOrbit.smokePos;
2969 scene.psSmoke.Emit(pcOrbit.emitSmoke);
2970 }
2971 }
2972 if (flag2 || flag4)
2973 {
2974 Effect.Get("ripple").Play(0.4f * actTime * EClass.scene.actionMode.gameSpeed, newPoint);
2975 }
2976 }
2977 lastPos.Set(pos);
2978 if (type != MoveType.Force)
2979 {
2980 if (newPoint.HasChara && ai.Current.PushChara)
2981 {
2982 TryPush(newPoint);
2983 }
2984 if (newPoint.HasChara && newPoint.Charas.Count == 1)
2985 {
2986 Chara chara2 = newPoint.Charas[0];
2987 if (CanReplace(chara2))
2988 {
2989 chara2.MoveByForce(lastPos, this);
2990 if (chara.IsPC)
2991 {
2992 Say("replace_pc", chara, chara2);
2993 }
2994 }
2995 }
2996 }
2997 if (cell.hasDoor)
2998 {
2999 foreach (Thing thing3 in newPoint.Things)
3000 {
3001 if (thing3.trait is TraitDoor traitDoor2)
3002 {
3003 traitDoor2.TryOpen(this);
3004 }
3005 }
3006 }
3007 EClass._zone.map.MoveCard(newPoint, this);
3008 SyncRide();
3010 {
3011 foreach (Chara member in EClass.pc.party.members)
3012 {
3013 if (member.isLeashed && !member.IsPC && member.host == null && !member.IsDisabled && !member.HasCondition<ConEntangle>() && !member.IsInCombat && member.Dist(EClass.pc) > 1)
3014 {
3015 member.TryMoveTowards(EClass.pc.pos);
3016 }
3017 }
3018 }
3020 {
3022 }
3023 if (IsPC)
3024 {
3025 PlaySound("Footstep/Extra/pcfootstep");
3026 if (pos.HasThing)
3027 {
3028 foreach (Card item in pos.ListCards())
3029 {
3030 if (!item.isThing || item.placeState != 0 || item.ignoreAutoPick)
3031 {
3032 continue;
3033 }
3035 {
3037 ContainerFlag containerFlag = item.category.GetRoot().id.ToEnum<ContainerFlag>();
3038 if (containerFlag == ContainerFlag.none)
3039 {
3040 containerFlag = ContainerFlag.other;
3041 }
3042 if ((dataPick.noRotten && item.IsDecayed) || (dataPick.onlyRottable && item.trait.Decay == 0))
3043 {
3044 continue;
3045 }
3046 if (dataPick.userFilter)
3047 {
3048 switch (dataPick.IsFilterPass(item.GetName(NameStyle.Full, 1)))
3049 {
3050 case Window.SaveData.FilterResult.PassWithoutFurtherTest:
3051 Pick(item.Thing);
3052 continue;
3053 case Window.SaveData.FilterResult.Block:
3054 continue;
3055 }
3056 }
3057 if (dataPick.advDistribution)
3058 {
3059 foreach (int cat in dataPick.cats)
3060 {
3061 if (item.category.uid == cat)
3062 {
3063 Pick(item.Thing);
3064 }
3065 }
3066 }
3067 else if (!dataPick.flag.HasFlag(containerFlag))
3068 {
3069 Pick(item.Thing);
3070 }
3071 }
3072 else
3073 {
3074 Pick(item.Thing);
3075 }
3076 }
3077 }
3078 if (EClass._zone.IsRegion)
3079 {
3081 if (cell3?.zone != null && !cell3.zone.HiddenInRegionMap && (!(cell3.zone is Zone_Field) || cell3.zone.children.Count > 0 || cell3.zone.IsPCFaction))
3082 {
3083 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() ?? "");
3084 }
3085 if (pos.matFloor.alias == "snow" && EClass.rnd(3) == 0)
3086 {
3088 Msg.Say(Lang.GetList("walk_snow").RandomItem());
3089 }
3090 else if (EClass.world.weather.CurrentCondition == Weather.Condition.RainHeavy && EClass.rnd(3) == 0)
3091 {
3093 Msg.Say(Lang.GetList("walk_storm").RandomItem());
3094 }
3095 }
3097 }
3098 if (IsPCC)
3099 {
3100 int num5 = Mathf.Abs(cell2.topHeight - cell.topHeight);
3101 if ((num5 >= 3 && lastPos.sourceBlock.tileType.slopeHeight == 0 && newPoint.sourceBlock.tileType.slopeHeight == 0) || cell2.hasDoorBoat || cell.hasDoorBoat)
3102 {
3103 renderer.PlayAnime((cell2.topHeight >= cell.topHeight) ? AnimeID.JumpDown : ((num5 >= 6) ? AnimeID.Jump : AnimeID.JumpSmall));
3104 }
3105 else
3106 {
3107 float surfaceHeight = cell2.GetSurfaceHeight();
3108 float surfaceHeight2 = cell.GetSurfaceHeight();
3109 num5 = (int)Mathf.Abs((surfaceHeight - surfaceHeight2) * 100f);
3110 if (num5 >= 15)
3111 {
3112 renderer.PlayAnime((surfaceHeight >= surfaceHeight2) ? AnimeID.JumpDown : ((num5 >= 40) ? AnimeID.Jump : AnimeID.JumpSmall));
3113 }
3114 }
3115 }
3116 lastPos.Things.ForeachReverse(delegate(Thing t)
3117 {
3118 t.trait.OnSteppedOut(this);
3119 });
3120 if (!IsPC)
3121 {
3122 pos.Things.ForeachReverse(delegate(Thing t)
3123 {
3124 t.trait.OnStepped(this);
3125 });
3126 }
3127 if (CanDestroyPath())
3128 {
3130 }
3131 if (IsPC)
3132 {
3133 if (renderer.anime == null && renderer.replacer != null)
3134 {
3136 }
3138 {
3139 if (!FLOOR.IsTatami(pos.cell.sourceSurface.id) && pos.cell.room == null)
3140 {
3141 EClass.player.flags.isShoesOff = false;
3142 EClass.pc.Say("shoes_on", EClass.pc);
3143 EClass.pc.SetPCCState(PCCState.Normal);
3144 }
3145 }
3146 else if (FLOOR.IsTatami(pos.cell.sourceSurface.id) && pos.cell.room != null)
3147 {
3148 EClass.player.flags.isShoesOff = true;
3149 EClass.pc.Say("shoes_off", EClass.pc);
3150 EClass.pc.SetPCCState(PCCState.ShoesOff);
3151 }
3152 }
3153 hasMovedThisTurn = true;
3154 return MoveResult.Success;
3155 }
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:2573
bool HasElement(int ele, int req=1)
Definition: Card.cs:5845
SourceMaterial.Row material
Definition: Card.cs:2039
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:6077
int c_lockLv
Definition: Card.cs:964
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
Definition: Card.cs:6632
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:4012
MoveResult
Definition: Card.cs:13
bool IsInstalled
Definition: Card.cs:2369
int Evalue(int ele)
Definition: Card.cs:2559
int Dist(Card c)
Definition: Card.cs:7578
void ModExp(string alias, int a)
Definition: Card.cs:2636
bool isLeashed
Definition: Card.cs:842
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:6729
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:3649
bool IsLevitating
Definition: Chara.cs:595
AIAct ai
Definition: Chara.cs:200
override bool IsPC
Definition: Chara.cs:610
bool isDrunk
Definition: Chara.cs:124
Party party
Definition: Chara.cs:43
bool CanDestroyPath()
Definition: Chara.cs:2396
bool IsInCombat
Definition: Chara.cs:862
bool HasCondition(string alias)
Definition: Chara.cs:9246
AIAct SetAI(AIAct g)
Definition: Chara.cs:8719
bool IsIdle
Definition: Chara.cs:851
override bool IsDisabled
Definition: Chara.cs:583
bool hasMovedThisTurn
Definition: Chara.cs:174
override bool isSynced
Definition: Chara.cs:689
bool CanMoveTo(Point p, bool allowDestroyPath=true)
Definition: Chara.cs:2409
void DestroyPath(Point pos)
Definition: Chara.cs:3157
override bool IsPCFaction
Definition: Chara.cs:669
float actTime
Definition: Chara.cs:176
override int MaxHP
Definition: Chara.cs:706
Zone currentZone
Definition: Chara.cs:253
bool CanReplace(Chara c)
Definition: Chara.cs:3268
Point lastPos
Definition: Chara.cs:90
void MoveByForce(Point newPoint, Card c=null, bool checkWall=false)
Definition: Chara.cs:2594
Stats burden
Definition: Chara.cs:1142
Chara parasite
Definition: Chara.cs:30
Chara ride
Definition: Chara.cs:27
MoveResult TryMoveTowards(Point p)
Definition: Chara.cs:2602
void SyncRide()
Definition: Chara.cs:3865
bool isDead
Definition: Chara.cs:387
override void LookAt(Card c)
Definition: Chara.cs:3513
bool isConfused
Definition: Chara.cs:126
override bool IsPCC
Definition: Chara.cs:680
void TryPush(Point point)
Definition: Chara.cs:3201
void SetPCCState(PCCState state)
Definition: Chara.cs:6587
SourceRace.Row race
Definition: Chara.cs:462
bool allyKeepDistance
Definition: ConfigTactics.cs:6
static Game game
Definition: EClass.cs:8
static Scene scene
Definition: EClass.cs:30
static Zone _zone
Definition: EClass.cs:20
static World world
Definition: EClass.cs:40
static Map _map
Definition: EClass.cs:18
static int rnd(long a)
Definition: EClass.cs:58
static BaseGameScreen screen
Definition: EClass.cs:32
static int rndHalf(int a)
Definition: EClass.cs:87
static Player player
Definition: EClass.cs:12
static GameSetting setting
Definition: EClass.cs:34
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:43
static SourceMaterial.Row sourceSnow
Definition: MATERIAL.cs:37
static SourceMaterial.Row sourceIce
Definition: MATERIAL.cs:39
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:1039
Point Set(int _x, int _z)
Definition: Point.cs:491
List< Thing > Things
Definition: Point.cs:326
int x
Definition: Point.cs:36
int z
Definition: Point.cs:39
List< Chara > Charas
Definition: Point.cs:328
bool HasThing
Definition: Point.cs:239
SourceFloor.Row sourceFloor
Definition: Point.cs:65
bool HasObj
Definition: Point.cs:137
int Distance(Point p)
Definition: Point.cs:977
Cell cell
Definition: Point.cs:51
Point GetRandomNeighbor()
Definition: Point.cs:747
bool HasChara
Definition: Point.cs:226
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:1079
virtual bool IsChangeFloorHeight
Definition: Trait.cs:73
virtual void OnStepped(Chara c)
Definition: Trait.cs:1075
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:284
override int DangerLv
Definition: Zone.cs:107
bool IsPCFaction
Definition: Zone.cs:470
virtual bool KeepAllyDistance
Definition: Zone.cs:299
virtual bool HiddenInRegionMap
Definition: Zone.cs:410
Map map
Definition: Zone.cs:60

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

7123 {
7124 EClass.Sound.Play("pop_drama");
7125 if (book == "_chara" && IsPC)
7126 {
7127 step = "pc";
7128 }
7129 return LayerDrama.Activate(book, sheet, step, this, null, tag);
7130 }
static SoundManager Sound
Definition: EClass.cs:46
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 9094 of file Chara.cs.

9095 {
9096 c.owner = this;
9097 if (!(c is ConBurning))
9098 {
9099 if (c is ConBleed && ResistLv(964) >= 3)
9100 {
9101 return null;
9102 }
9103 }
9104 else if (ResistLv(950) >= 3)
9105 {
9106 return null;
9107 }
9109 {
9110 if (c.GainResistFactor >= 400)
9111 {
9112 c.power /= 2;
9113 }
9114 ResistCon(c);
9115 if (c.power <= 0)
9116 {
9117 return null;
9118 }
9119 }
9120 if (!force)
9121 {
9122 if (c.source.negate.Length != 0)
9123 {
9124 string[] negate = c.source.negate;
9125 foreach (string text in negate)
9126 {
9127 if (HasElement(text))
9128 {
9129 return null;
9130 }
9131 }
9132 }
9133 Element defenseAttribute = c.GetDefenseAttribute(this);
9134 if (defenseAttribute != null)
9135 {
9136 c.power = 100 * c.power / Mathf.Max(100 + defenseAttribute.Value, 1);
9137 }
9138 if (c.source.resistance.Length != 0)
9139 {
9140 int num = ResistLv(EClass.sources.elements.alias[c.source.resistance[0]].id);
9141 if (num > 0)
9142 {
9143 c.power /= num * num + 1;
9144 if (c.power <= 40)
9145 {
9146 return null;
9147 }
9148 }
9149 }
9150 c.power = c.EvaluatePower(c.power);
9151 if (c.power <= 0)
9152 {
9153 return null;
9154 }
9155 }
9156 for (int j = 0; j < conditions.Count; j++)
9157 {
9158 if (conditions[j].id != c.id)
9159 {
9160 continue;
9161 }
9162 if (c.Type == ConditionType.Stance || c.IsToggle)
9163 {
9164 conditions[j].Kill();
9165 return null;
9166 }
9167 if (conditions[j].CanStack(c))
9168 {
9169 if (conditions[j].WillOverride)
9170 {
9171 conditions[j].Kill(silent: true);
9172 continue;
9173 }
9174 if (CanGainConResist)
9175 {
9176 AddResistCon(c);
9177 }
9178 conditions[j].OnStacked(c.power);
9179 conditions[j].OnStartOrStack();
9180 conditions[j].PlayEffect();
9181 }
9182 if (!conditions[j].AllowMultipleInstance)
9183 {
9184 return null;
9185 }
9186 }
9187 foreach (Condition condition in conditions)
9188 {
9189 if (condition.TryNullify(c))
9190 {
9191 return null;
9192 }
9193 }
9194 int num2 = c.EvaluateTurn(c.power);
9195 if (num2 == 0)
9196 {
9197 return null;
9198 }
9199 c.value = num2;
9200 conditions.Add(c);
9201 if (CanGainConResist)
9202 {
9203 AddResistCon(c);
9204 }
9205 c.SetOwner(this);
9206 c.Start();
9207 SetDirtySpeed();
9208 if (c.ShouldRefresh)
9209 {
9210 Refresh();
9211 }
9212 if (c.CancelAI)
9213 {
9214 ai.Cancel();
9215 }
9216 if (IsPC && c.ConsumeTurn && !EClass.pc.isRestrained)
9217 {
9219 }
9220 if (c.SyncRide && (ride != null || parasite != null))
9221 {
9222 if (ride != null)
9223 {
9225 }
9226 if (parasite != null)
9227 {
9229 }
9230 }
9231 return c;
9232 }
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:5840
void SetDirtySpeed()
Definition: Chara.cs:1845
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:9089
bool CanGainConResist
Definition: Chara.cs:1159
void AddResistCon(Condition con)
Definition: Chara.cs:9489
void ResistCon(Condition con)
Definition: Chara.cs:9509
static Condition Create(string alias, int power=100, Action< Condition > onCreate=null)
Definition: Condition.cs:46
static SourceManager sources
Definition: EClass.cs:42
int Value
Definition: ELEMENT.cs:292
void EndTurn(bool consume=true)
Definition: Player.cs:2064
SourceElement elements

References AddCondition(), AIAct.Cancel(), Condition.Create(), SourceManager.elements, Player.EndTurn(), BaseCondition.EvaluatePower(), 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 9084 of file Chara.cs.

9084 : Condition
9085 {
9086 return AddCondition(typeof(T).Name, p, force);
9087 }
string Name
Definition: Card.cs:2125

◆ AddCooldown()

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

Definition at line 8533 of file Chara.cs.

8534 {
8535 if (_cooldowns == null)
8536 {
8537 _cooldowns = new List<int>();
8538 }
8539 if (turns != 0)
8540 {
8541 _cooldowns.Add(idEle * 1000 + turns);
8542 return;
8543 }
8544 SourceElement.Row row = EClass.sources.elements.map[idEle];
8545 if (row.cooldown > 0)
8546 {
8547 _cooldowns.Add(idEle * 1000 + row.cooldown);
8548 }
8549 }
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 9963 of file Chara.cs.

9964 {
9965 if (!IsPCFaction || !IsGlobal)
9966 {
9967 _historyFood = null;
9968 return;
9969 }
9970 if (_historyFood == null)
9971 {
9972 _historyFood = new List<List<string>>
9973 {
9974 new List<string>()
9975 };
9976 }
9977 if (_historyFood[0].Count < 5)
9978 {
9979 _historyFood[0].Add(food.id);
9980 }
9981 }
override bool IsGlobal
Definition: Chara.cs:608
List< List< string > > _historyFood
Definition: Chara.cs:64

References food.

Referenced by FoodEffect.Proc().

◆ AddHobby()

void Chara.AddHobby ( int  id)
inline

Definition at line 8919 of file Chara.cs.

8920 {
8921 foreach (int hobby in _hobbies)
8922 {
8923 if (hobby == id)
8924 {
8925 return;
8926 }
8927 }
8928 _hobbies.Add(id);
8929 }
List< int > _hobbies
Definition: Chara.cs:49

◆ AddRandomBodyPart()

void Chara.AddRandomBodyPart ( bool  msg = false)
inline

Definition at line 2177 of file Chara.cs.

2178 {
2179 int ele = new int[9] { 30, 31, 33, 35, 35, 36, 34, 37, 39 }.RandomItem();
2180 body.AddBodyPart(ele);
2181 if (msg)
2182 {
2183 Say("gain_bodyparts", this, Element.Get(ele).GetName().ToLower());
2184 PlaySound("offering");
2185 }
2186 }
void AddBodyPart(int ele, Thing thing=null)
Definition: CharaBody.cs:261
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 9489 of file Chara.cs.

9490 {
9491 if (con.power > 0 && con.GainResistFactor > 0)
9492 {
9493 int key = con.id;
9494 if (resistCon == null)
9495 {
9496 resistCon = new Dictionary<int, int>();
9497 }
9498 if (resistCon.ContainsKey(key))
9499 {
9500 resistCon[key] += con.power * con.GainResistFactor / 100;
9501 }
9502 else
9503 {
9504 resistCon[key] = con.power * con.GainResistFactor / 100;
9505 }
9506 }
9507 }
Dictionary< int, int > resistCon
Definition: Chara.cs:212

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

◆ AddWork()

void Chara.AddWork ( int  id)
inline

Definition at line 8931 of file Chara.cs.

8932 {
8933 foreach (int work in _works)
8934 {
8935 if (work == id)
8936 {
8937 return;
8938 }
8939 }
8940 _works.Add(id);
8941 }
List< int > _works
Definition: Chara.cs:52

◆ ApplyDeathPenalty()

void Chara.ApplyDeathPenalty ( )
inline

Definition at line 5170 of file Chara.cs.

5171 {
5172 if (!IsPC)
5173 {
5174 return;
5175 }
5176 int currency = GetCurrency();
5177 if (currency > 0)
5178 {
5179 int num = currency / 3 + EClass.rnd(currency / 3 + 1);
5180 if (num <= 0)
5181 {
5182 num = 1;
5183 }
5184 Msg.Say("panaltyMoney", this, Lang._currency(num));
5185 ModCurrency(-num);
5187 }
5188 foreach (Element value in EClass.pc.elements.dict.Values)
5189 {
5190 if (EClass.rnd(5) == 0 && value.IsMainAttribute)
5191 {
5192 EClass.pc.elements.ModExp(value.id, -500f);
5193 }
5194 }
5195 }
@ currency
ElementContainerCard elements
Definition: Card.cs:41
int GetCurrency(string id="money")
Definition: Card.cs:3924
void ModCurrency(int a, string id="money")
Definition: Card.cs:3910
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:1959

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

2013 {
2014 switch (tag)
2015 {
2016 case EditorTag.HostilityNeutral:
2017 {
2018 Hostility hostility2 = (base.c_originalHostility = Hostility.Neutral);
2019 this.hostility = hostility2;
2020 break;
2021 }
2022 case EditorTag.HostilityEnemy:
2023 {
2024 Hostility hostility2 = (base.c_originalHostility = Hostility.Enemy);
2025 this.hostility = hostility2;
2026 break;
2027 }
2028 case EditorTag.HostilityFriend:
2029 {
2030 Hostility hostility2 = (base.c_originalHostility = Hostility.Friend);
2031 this.hostility = hostility2;
2032 break;
2033 }
2034 case EditorTag.Male:
2035 bio.SetGender(2);
2036 base.c_idPortrait = Portrait.GetRandomPortrait(2, GetIdPortraitCat());
2037 break;
2038 case EditorTag.Female:
2039 bio.SetGender(1);
2040 base.c_idPortrait = Portrait.GetRandomPortrait(1, GetIdPortraitCat());
2041 break;
2042 case EditorTag.baby:
2043 SetFeat(1232);
2044 break;
2045 }
2046 base.ApplyEditorTags(tag);
2047 }
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:9697
string GetIdPortraitCat()
Definition: Chara.cs:7996
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 2139 of file Chara.cs.

2140 {
2141 elements.ApplyElementMap(base.uid, SourceValueType.Chara, job.elementMap, base.DefaultLV, remove, applyFeat: true);
2142 if (IsPCC)
2143 {
2144 EClass.game.uniforms.Apply(pccData, job.id, base.IsMale, canUseOtherGender: true);
2145 }
2146 }
SourceValueType
SourceJob.Row job
Definition: Chara.cs:464
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 2225 of file Chara.cs.

2226 {
2227 string[] array = race.figure.Split('|');
2228 foreach (string s in array)
2229 {
2230 int num = ParseBodySlot(s);
2231 if (num != -1)
2232 {
2233 if (remove)
2234 {
2235 body.RemoveBodyPart(num);
2236 }
2237 else
2238 {
2239 body.AddBodyPart(num);
2240 }
2241 }
2242 }
2244 elements.ApplyElementMap(base.uid, SourceValueType.Chara, race.elementMap, base.DefaultLV, remove, applyFeat: true);
2245 }
void RefreshBodyParts()
Definition: CharaBody.cs:287
void RemoveBodyPart(int ele)
Definition: CharaBody.cs:316
int ParseBodySlot(string s)
Definition: Chara.cs:2160

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

2317 {
2318 owner?.Say("summon_vanish", this);
2319 pos.PlayEffect("vanish");
2320 pos.PlaySound("vanish");
2321 pos.PlayEffect("teleport");
2322 Destroy();
2323 }
void Destroy()
Definition: Card.cs:5015
SoundSource PlaySound(string id, bool synced=true, float v=1f, bool spatial=true)
Definition: Point.cs:1241
Effect PlayEffect(string id)
Definition: Point.cs:1236

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

1814 {
1815 int num = base.ChildrenWeight * 100 / Mathf.Max(1, WeightLimit);
1816 if (num < 0)
1817 {
1818 num = 1000;
1819 }
1821 {
1822 num = 0;
1823 }
1824 burden.Set(num);
1825 SetDirtySpeed();
1826 }
override int WeightLimit
Definition: Chara.cs:708
bool ignoreWeight
Definition: CoreDebug.cs:187
static CoreDebug debug
Definition: EClass.cs:48
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 6076 of file Chara.cs.

6077 {
6078 if (!(e is Spell))
6079 {
6080 return 100;
6081 }
6082 if (!IsPC)
6083 {
6084 int num2 = 95;
6085 if (host != null)
6086 {
6087 if (host.ride == this)
6088 {
6089 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.EvalueRiding()));
6090 }
6091 if (host.parasite == this)
6092 {
6093 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.Evalue(227)));
6094 }
6095 }
6096 return num2;
6097 }
6098 int num3 = Evalue(304);
6099 if (!IsPCFaction)
6100 {
6101 num3 = Mathf.Max(num3, base.LV + 5);
6102 }
6103 int num4 = 0;
6104 int num5 = 0;
6105 bool num6 = GetArmorSkill() == 122;
6106 AttackStyle attackStyle = body.GetAttackStyle();
6107 if (num6)
6108 {
6109 num4 = 20 - Evalue(122) / 5;
6110 num5 += 10 - Evalue(1654) * 4;
6111 }
6112 else
6113 {
6114 num4 = 10 - Evalue(120) / 5;
6115 }
6116 if (num4 < 5)
6117 {
6118 num4 = 5;
6119 }
6120 if (ride != null)
6121 {
6122 num4 += 5;
6123 }
6124 if (parasite != null)
6125 {
6126 num4 += 10;
6127 }
6128 if (attackStyle == AttackStyle.TwoWield)
6129 {
6130 num4 += 5;
6131 }
6132 if (attackStyle == AttackStyle.Shield)
6133 {
6134 num4 += 10;
6135 num5 += 20 - Evalue(1654) * 8;
6136 }
6137 if (isConfused)
6138 {
6139 num4 += 10000;
6140 }
6141 if (HasCondition<ConDim>())
6142 {
6143 num4 += ((Evalue(1654) >= 3) ? 1500 : 2500);
6144 }
6145 if (num > 1)
6146 {
6147 num4 += 5 * num;
6148 }
6149 if (num5 < 0)
6150 {
6151 num5 = 0;
6152 }
6153 return Mathf.Clamp(100 + e.Value - 10 - e.source.LV * e.source.cost[0] * num4 / Mathf.Max(10 + num3 * 10, 1), 0, 100 - num5);
6154 }
AttackStyle
Definition: AttackStyle.cs:2
AttackStyle GetAttackStyle()
Definition: CharaBody.cs:445
override int GetArmorSkill()
Definition: Chara.cs:7739
int EvalueRiding()
Definition: Chara.cs:6067
SourceElement.Row source
Definition: ELEMENT.cs:273
Definition: SPELL.cs:617

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

1994 {
1995 int num = base.END;
1996 int num2 = 0;
1997 foreach (Element value in elements.dict.Values)
1998 {
1999 if (value.source.category == "skill")
2000 {
2001 num = ((!IsPC) ? (num + Mathf.Max(value.ValueWithoutLink, 0)) : (num + Mathf.Max(value.vBase, 0)));
2002 }
2003 }
2004 num2 = EClass.curve(num, 30, 10, 60);
2005 if (num2 < 10)
2006 {
2007 num2 = 10;
2008 }
2009 _maxStamina = num2 + 15;
2010 }
int _maxStamina
Definition: Chara.cs:363
static int curve(int a, int start, int step, int rate=75)
Definition: EClass.cs:68
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 6338 of file Chara.cs.

6339 {
6340 foreach (Chara chara in EClass._map.charas)
6341 {
6342 if (!chara.IsPCFaction && chara.OriginalHostility == OriginalHostility && (fanatic || Dist(chara) <= 6) && (EClass.rnd(3) != 0 || fanatic))
6343 {
6344 chara.GoHostile(tg);
6345 }
6346 }
6347 }
Hostility OriginalHostility
Definition: Chara.cs:469
void GoHostile(Card _tg)
Definition: Chara.cs:6232
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 8084 of file Chara.cs.

8085 {
8086 if (things.IsFull())
8087 {
8088 return false;
8089 }
8090 if (t.c_isImportant)
8091 {
8092 return false;
8093 }
8094 if (t.id == "1084")
8095 {
8096 return true;
8097 }
8098 if (t.trait is TraitBookSecret)
8099 {
8100 return true;
8101 }
8102 if (t.trait.CanOnlyCarry || !t.trait.CanBeDestroyed || t.trait.CanExtendBuild || t.rarity == Rarity.Artifact || t.IsContainer)
8103 {
8104 return false;
8105 }
8106 return true;
8107 }
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:2077
bool IsFull(int y=0)
virtual bool CanExtendBuild
Definition: Trait.cs:168
virtual bool CanBeDestroyed
Definition: Trait.cs:294
virtual bool CanOnlyCarry
Definition: Trait.cs:292

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

8064 {
8066 {
8067 return true;
8068 }
8069 if (!IsValidGiftWeight(t, num))
8070 {
8071 return false;
8072 }
8073 if (t.c_isImportant)
8074 {
8075 return false;
8076 }
8077 if ((t.category.IsChildOf("furniture") || t.category.IsChildOf("junk")) && !HasElement(1411))
8078 {
8079 return false;
8080 }
8081 return true;
8082 }
SourceCategory.Row category
Definition: Card.cs:2037
bool IsValidGiftWeight(Card t, int num=-1)
Definition: Chara.cs:8053

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

4201 {
4202 return true;
4203 }

◆ CanBeTempAlly()

bool Chara.CanBeTempAlly ( Chara  c)
inline

Definition at line 2303 of file Chara.cs.

2304 {
2305 if (IsPCFaction || IsGlobal || IsMinion || IsMultisize || EClass._zone.CountMinions(c) > c.MaxSummon || base.rarity >= Rarity.Legendary)
2306 {
2307 return false;
2308 }
2309 if (HasElement(1222))
2310 {
2311 return false;
2312 }
2313 return true;
2314 }
override bool IsMinion
Definition: Chara.cs:625
int MaxSummon
Definition: Chara.cs:712
override bool IsMultisize
Definition: Chara.cs:704
int CountMinions(Chara c)
Definition: Zone.cs:3697

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

8517 {
8518 if (IsPC || base.isScaled || HasElement(1273))
8519 {
8520 return false;
8521 }
8522 if (!EClass.debug.enable)
8523 {
8524 if (base.c_daysWithPC > 360)
8525 {
8526 return affinity.CanSleepBeside();
8527 }
8528 return false;
8529 }
8530 return true;
8531 }
bool CanSleepBeside()
Definition: Affinity.cs:77
Affinity affinity
Definition: Chara.cs:312
bool enable
Definition: CoreDebug.cs:286

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

◆ CanDestroyPath()

bool Chara.CanDestroyPath ( )
inline

Definition at line 2396 of file Chara.cs.

2397 {
2398 if (!IsMultisize)
2399 {
2400 if (base.rarity >= Rarity.Superior && !base.IsPCFactionOrMinion && ai is GoalCombat && !EClass._zone.IsPCFaction)
2401 {
2402 return !(EClass._zone is Zone_Town);
2403 }
2404 return false;
2405 }
2406 return true;
2407 }

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

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

◆ CanDuplicate()

bool Chara.CanDuplicate ( )
inline

Definition at line 1752 of file Chara.cs.

1753 {
1754 if (EClass._zone.IsRegion || HasCondition<ConPoison>() || HasCondition<ConConfuse>() || HasCondition<ConDim>() || HasCondition<ConParalyze>() || HasCondition<ConSleep>() || HasCondition<ConBurning>() || HasCondition<ConFreeze>() || HasCondition<ConMiasma>() || corruption >= 100)
1755 {
1756 return false;
1757 }
1759 {
1760 return false;
1761 }
1762 if (id == "mech_scarab" && (isSynced || pos.cell.light > 0 || (!EClass._map.IsIndoor && !pos.cell.HasRoof && !EClass.world.date.IsNight)))
1763 {
1764 return false;
1765 }
1766 return true;
1767 }
byte light
Definition: Cell.cs:60
bool HasRoof
Definition: Cell.cs:648
int corruption
Definition: Chara.cs:375
int CurrentGeneSlot
Definition: Chara.cs:1069
bool IsNight
Definition: Date.cs:112
GamePrincipal principal
Definition: Game.cs:224
bool IsIndoor
Definition: Map.cs:131

References EClass._map, EClass._zone, Point.cell, corruption, CurrentGeneSlot, World.date, GamePrincipal.enableGeneDupe, EClass.game, Cell.HasRoof, Map.IsIndoor, Date.IsNight, Spatial.IsRegion, 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 7470 of file Chara.cs.

7471 {
7472 if (t.IsDecayed && !HasElement(480))
7473 {
7474 return false;
7475 }
7476 if (shouldEat && (!(t.trait is TraitFoodPrepared) || t.c_isImportant))
7477 {
7478 return false;
7479 }
7480 if (!t.IsNegativeGift && !t.HasTag(CTAG.ignoreUse) && !t.isEquipped)
7481 {
7482 return t.trait.CanEat(this);
7483 }
7484 return false;
7485 }
CTAG
Definition: CTAG.cs:2
bool IsNegativeGift
Definition: Card.cs:2384
bool IsDecayed
Definition: Card.cs:2275
bool HasTag(CTAG tag)
Definition: Card.cs:2583
bool isEquipped
Definition: Thing.cs:17
virtual bool CanEat(Chara c)
Definition: Trait.cs:977

References Card.c_isImportant, Trait.CanEat(), 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 7638 of file Chara.cs.

7639 {
7640 return !body.IsTooHeavyToEquip(t);
7641 }
bool IsTooHeavyToEquip(Thing thing)
Definition: CharaBody.cs:156

References CharaBody.IsTooHeavyToEquip().

Referenced by GoalAutoCombat.TryUseRanged().

◆ CanInsult()

bool Chara.CanInsult ( )
inline

Definition at line 7984 of file Chara.cs.

7985 {
7986 foreach (ActList.Item item in ability.list.items)
7987 {
7988 if (item.act.id == 6630)
7989 {
7990 return true;
7991 }
7992 }
7993 return false;
7994 }
List< Item > items
Definition: ActList.cs:14
ActList list
Definition: CharaAbility.cs:12
CharaAbility ability
Definition: Chara.cs:422

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

◆ CanInteractTo() [1/2]

bool Chara.CanInteractTo ( Card  c)
inline

Definition at line 2503 of file Chara.cs.

2504 {
2505 return CanInteractTo(c.pos);
2506 }
bool CanInteractTo(Card c)
Definition: Chara.cs:2503

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

2509 {
2510 if (!p.IsValid)
2511 {
2512 return false;
2513 }
2514 if (EClass._map.cells[p.x, p.z].blocked)
2515 {
2516 return true;
2517 }
2518 if (!IsMultisize)
2519 {
2520 int num = ((p.z >= pos.z) ? ((p.x > pos.x) ? 1 : ((p.z > pos.z) ? 2 : 3)) : 0);
2521 if (EClass._map.cells[pos.x, pos.z].weights[num] == 0)
2522 {
2523 return false;
2524 }
2525 if (p.x != pos.x && p.z != pos.z)
2526 {
2527 Cell[,] cells = EClass._map.cells;
2528 int x = p.x;
2529 int z = pos.z;
2530 int num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2531 if (cells[pos.x, pos.z].weights[num2] == 0)
2532 {
2533 return false;
2534 }
2535 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2536 if (cells[p.x, p.z].weights[num2] == 0)
2537 {
2538 return false;
2539 }
2540 x = pos.x;
2541 z = p.z;
2542 num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2543 if (cells[pos.x, pos.z].weights[num2] == 0)
2544 {
2545 return false;
2546 }
2547 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2548 if (cells[p.x, p.z].weights[num2] == 0)
2549 {
2550 return false;
2551 }
2552 }
2553 }
2554 return true;
2555 }
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 4195 of file Chara.cs.

4196 {
4197 return true;
4198 }

◆ CanMoveTo()

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

Definition at line 2409 of file Chara.cs.

2410 {
2411 if (!p.IsValid)
2412 {
2413 return false;
2414 }
2415 int num = ((p.z >= pos.z) ? ((p.x > pos.x) ? 1 : ((p.z > pos.z) ? 2 : 3)) : 0);
2416 if (allowDestroyPath && CanDestroyPath())
2417 {
2418 if (!p.IsInBounds)
2419 {
2420 return false;
2421 }
2422 }
2423 else
2424 {
2425 if (EClass._map.cells[p.x, p.z].blocked || EClass._map.cells[pos.x, pos.z].weights[num] == 0)
2426 {
2427 return false;
2428 }
2429 if (p.x != pos.x && p.z != pos.z)
2430 {
2431 Cell[,] cells = EClass._map.cells;
2432 int x = p.x;
2433 int z = pos.z;
2434 int num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2435 if (cells[pos.x, pos.z].weights[num2] == 0)
2436 {
2437 return false;
2438 }
2439 if (cells[x, z].blocked)
2440 {
2441 return false;
2442 }
2443 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2444 if (cells[p.x, p.z].weights[num2] == 0)
2445 {
2446 return false;
2447 }
2448 x = pos.x;
2449 z = p.z;
2450 num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2451 if (cells[pos.x, pos.z].weights[num2] == 0)
2452 {
2453 return false;
2454 }
2455 if (cells[x, z].blocked)
2456 {
2457 return false;
2458 }
2459 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2460 if (cells[p.x, p.z].weights[num2] == 0)
2461 {
2462 return false;
2463 }
2464 }
2465 }
2466 if (IsPC)
2467 {
2468 if (IsEnemyOnPath(p))
2469 {
2470 return false;
2471 }
2472 }
2473 else if (p.HasChara && !IsMultisize && !CanReplace(p.FirstChara))
2474 {
2475 return false;
2476 }
2477 return true;
2478 }
bool IsEnemyOnPath(Point p, bool cancelAI=true)
Definition: Chara.cs:2480
Chara FirstChara
Definition: Point.cs:276
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 4205 of file Chara.cs.

4206 {
4207 if (c.isDestroyed)
4208 {
4209 return false;
4210 }
4211 Card rootCard = c.GetRootCard();
4212 if (rootCard.isDestroyed || (rootCard.ExistsOnMap && rootCard.pos.Distance(pos) > 1))
4213 {
4214 return false;
4215 }
4216 if (rootCard != this && things.IsFull(c.Thing))
4217 {
4218 return false;
4219 }
4220 return true;
4221 }
bool isDestroyed
Definition: Card.cs:75
bool ExistsOnMap
Definition: Card.cs:2073
virtual Thing Thing
Definition: Card.cs:2046
Card GetRootCard()
Definition: Card.cs:3375

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

3269 {
3271 {
3272 return false;
3273 }
3274 if (IsPC)
3275 {
3276 return true;
3277 }
3278 if (c.IsPC || c.pos.Equals(EClass.pc.pos) || c.host != null)
3279 {
3280 return false;
3281 }
3282 if (!IsHostile(c))
3283 {
3284 if (c.c_uidMaster != 0 || c.isSummon || base.IsPowerful || IsEscorted())
3285 {
3286 return true;
3287 }
3288 if (DestDist < c.DestDist)
3289 {
3290 return true;
3291 }
3292 if (IsPCParty && !c.IsPCParty)
3293 {
3294 return true;
3295 }
3296 if (IsPCFaction && !c.IsPCParty)
3297 {
3298 return true;
3299 }
3300 }
3301 return false;
3302 }
bool IsPCFactionOrMinion
Definition: Card.cs:2260
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:501
override bool IsPCParty
Definition: Chara.cs:613
int DestDist
Definition: Chara.cs:996
bool IsHostile()
Definition: Chara.cs:6433
bool IsEscorted()
Definition: Chara.cs:2380
bool Equals(int _x, int _z)
Definition: Point.cs:948
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 5038 of file Chara.cs.

5039 {
5040 return EClass.world.date.IsExpired(base.c_dateDeathLock);
5041 }
bool IsExpired(int time)
Definition: Date.cs:332

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

1217 {
1218 if (c == this)
1219 {
1220 return true;
1221 }
1222 if (!c.pos.IsValid)
1223 {
1224 return false;
1225 }
1226 if (c.isChara)
1227 {
1229 {
1230 return true;
1231 }
1232 if (c.isHidden && c != this && !canSeeInvisible)
1233 {
1234 return false;
1235 }
1236 }
1237 if (IsPC)
1238 {
1239 if (fov != null)
1240 {
1241 return fov.lastPoints.ContainsKey(c.pos.index);
1242 }
1243 return false;
1244 }
1245 return true;
1246 }
virtual Chara Chara
Definition: Card.cs:2058
Fov fov
Definition: Card.cs:57
virtual bool isChara
Definition: Card.cs:2071
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 1257 of file Chara.cs.

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

1200 {
1201 if (!p.IsValid || p.IsHidden)
1202 {
1203 return false;
1204 }
1205 if (IsPC)
1206 {
1207 if (fov != null)
1208 {
1209 return fov.lastPoints.ContainsKey(p.index);
1210 }
1211 return false;
1212 }
1213 return true;
1214 }
bool IsHidden
Definition: Point.cs:335

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

1298 {
1299 if (EClass._zone.events.GetEvent<ZoneEventQuest>() != null)
1300 {
1301 return false;
1302 }
1303 if (!EClass.debug.godMode && sleepiness.GetPhase() == 0)
1304 {
1305 return stamina.GetPhase() <= 1;
1306 }
1307 return true;
1308 }
Stats sleepiness
Definition: Chara.cs:1154
Stats stamina
Definition: Chara.cs:1144
bool godMode
Definition: CoreDebug.cs:173
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 2148 of file Chara.cs.

2149 {
2150 ApplyJob(remove: true);
2151 base.c_idJob = idNew;
2152 _job = null;
2153 ApplyJob();
2154 if (IsPCC)
2155 {
2156 PCC.Get(pccData).Build();
2157 }
2158 }
void ApplyJob(bool remove=false)
Definition: Chara.cs:2139
SourceJob.Row _job
Definition: Chara.cs:160

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

6931 {
6932 memberType = type;
6933 }
FactionMemberType memberType
Definition: Chara.cs:46

◆ ChangeRace()

void Chara.ChangeRace ( string  idNew)
inline

Definition at line 2247 of file Chara.cs.

2248 {
2249 ApplyRace(remove: true);
2250 base.c_idRace = idNew;
2251 _race = null;
2252 ApplyRace();
2253 ChangeMaterial(source.defMat.IsEmpty(race.material));
2254 }
@ ChangeMaterial
void ApplyRace(bool remove=false)
Definition: Chara.cs:2225
SourceRace.Row _race
Definition: Chara.cs:158

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

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

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

Referenced by ZonePreEnterBout.Execute().

◆ ChooseNewGoal()

void Chara.ChooseNewGoal ( )
inline

Definition at line 8590 of file Chara.cs.

8591 {
8592 if (IsPC && EClass.AdvMode)
8593 {
8594 SetNoGoal();
8595 return;
8596 }
8597 if (IsPCParty || base.noMove)
8598 {
8599 SetAI(new GoalIdle());
8600 return;
8601 }
8602 if ((IsHomeMember() && IsInHomeZone()) || IsGuest())
8603 {
8604 Goal goalFromTimeTable = GetGoalFromTimeTable(EClass.world.date.hour);
8605 if (goalFromTimeTable != null)
8606 {
8607 SetAI(goalFromTimeTable);
8608 if (goalFromTimeTable is GoalWork)
8609 {
8610 goalFromTimeTable.Tick();
8611 }
8612 return;
8613 }
8614 }
8615 if (goalList.index == -2)
8616 {
8618 }
8619 SetAI(goalList.Next());
8620 }
Status Tick()
Definition: AIAct.cs:352
Goal GetGoalFromTimeTable(int hour)
Definition: Chara.cs:8622
GoalListType goalListType
Definition: Chara.cs:277
AIAct SetNoGoal()
Definition: Chara.cs:8714
bool IsHomeMember()
Definition: Chara.cs:6495
bool IsGuest()
Definition: Chara.cs:6520
GoalList goalList
Definition: Chara.cs:198
bool IsInHomeZone()
Definition: Chara.cs:6500
int hour
Definition: Date.cs:74
static bool AdvMode
Definition: EClass.cs:10
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 7198 of file Chara.cs.

7199 {
7200 if (map == null)
7201 {
7202 map = EClass._map;
7203 }
7204 foreach (Card item in map.props.installed.all)
7205 {
7206 if (item.trait is TraitBed traitBed && traitBed.IsHolder(this))
7207 {
7208 traitBed.RemoveHolder(this);
7209 }
7210 }
7211 }
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 8395 of file Chara.cs.

8396 {
8397 int num = 0;
8398 for (int num2 = things.Count - 1; num2 >= 0; num2--)
8399 {
8400 Thing thing = things[num2];
8401 if (ShouldThrowAway(thing, type))
8402 {
8403 num += thing.GetPrice(CurrencyType.Money, sell: true, PriceType.Default, this) * thing.Num;
8404 thing.Destroy();
8405 }
8406 }
8407 if (num > 0)
8408 {
8409 ModCurrency(num);
8410 if (type == ClearInventoryType.SellAtTown)
8411 {
8412 Msg.Say("party_sell", this, num.ToString() ?? "");
8413 PlaySound("pay");
8414 }
8415 }
8416 }
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:7181
int Num
Definition: Card.cs:158
bool ShouldThrowAway(Thing t, ClearInventoryType type)
Definition: Chara.cs:8324

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

10178 {
10179 if (tempElements != null)
10180 {
10182 tempElements = null;
10183 }
10184 }
ElementContainer tempElements
Definition: Chara.cs:36
void SetParent(Card c)

References ElementContainer.SetParent().

◆ CountDebuff()

int Chara.CountDebuff ( )
inline

Definition at line 9275 of file Chara.cs.

9276 {
9277 int num = 0;
9278 foreach (Condition condition in conditions)
9279 {
9280 if (condition.Type == ConditionType.Debuff)
9281 {
9282 num++;
9283 }
9284 }
9285 return num;
9286 }

References BaseStats.Type.

Referenced by GoalCombat.TryUseAbility().

◆ CountNumEaten()

int Chara.CountNumEaten ( Thing  food)
inline

Definition at line 9983 of file Chara.cs.

9984 {
9985 if (_historyFood == null)
9986 {
9987 return -1;
9988 }
9989 int num = 0;
9990 foreach (List<string> item in _historyFood)
9991 {
9992 foreach (string item2 in item)
9993 {
9994 if (item2 == food.id)
9995 {
9996 num++;
9997 }
9998 }
9999 }
10000 return num;
10001 }

References food, and item.

Referenced by FoodEffect.Proc().

◆ CreateReplacement()

Chara Chara.CreateReplacement ( )
inline

Definition at line 7887 of file Chara.cs.

7888 {
7889 Chara chara = CharaGen.Create(id);
7890 chara.c_originalHostility = base.c_originalHostility;
7891 if (chara.c_originalHostility != 0)
7892 {
7893 chara.hostility = chara.c_originalHostility;
7894 }
7895 if (orgPos != null)
7896 {
7897 chara.orgPos = orgPos.Copy();
7898 }
7899 chara.pos = pos.Copy();
7900 chara.isImported = true;
7901 chara.c_editorTags = base.c_editorTags;
7902 chara.c_editorTraitVal = base.c_editorTraitVal;
7903 chara.c_idTrait = base.c_idTrait;
7904 chara.homeZone = homeZone;
7905 return chara;
7906 }
Hostility c_originalHostility
Definition: Card.cs:976
static Chara Create(string id, int lv=-1)
Definition: CharaGen.cs:17
Zone homeZone
Definition: Chara.cs:265
Point Copy()
Definition: Point.cs:479

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

6169 {
6170 Talk("goodBoy");
6171 Say(headpat ? "headpat" : "cuddle", this, c);
6172 c.ShowEmo(Emo.love);
6173 if (EClass.rnd(IsPC ? 100 : 5000) == 0)
6174 {
6175 c.MakeEgg();
6176 }
6177 if (headpat && this != c)
6178 {
6179 if (c.interest > 0)
6180 {
6181 c.ModAffinity(EClass.pc, 1 + EClass.rnd(3));
6182 c.interest -= 20 + EClass.rnd(10);
6183 }
6185 {
6186 foreach (Chara member in party.members)
6187 {
6188 if (!member.IsPC && CanSeeLos(member))
6189 {
6190 member.AddCondition<ConEuphoric>(100 + Evalue(6904) * 5);
6191 }
6192 }
6193 }
6194 }
6195 if (c.Evalue(1221) > 0)
6196 {
6197 int ele = ((c.MainElement == Element.Void) ? 924 : c.MainElement.id);
6198 if (c.id == "hedgehog_ether")
6199 {
6200 ele = 922;
6201 }
6202 Say("reflect_thorne", c, this);
6203 DamageHP(10L, ele, Power, AttackSource.Condition);
6204 }
6205 }
Emo
Definition: Emo.cs:2
virtual int Power
Definition: Card.cs:2283
void ShowEmo(Emo _emo=Emo.none, float duration=0f, bool skipSame=true)
Definition: Card.cs:6045
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
Definition: Card.cs:5668
Element MainElement
Definition: Chara.cs:715
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Definition: Chara.cs:7809
int interest
Definition: Chara.cs:315
Religion faith
Definition: Chara.cs:437
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 9338 of file Chara.cs.

9339 {
9340 bool flag = state == BlessedState.Blessed;
9341 switch (type)
9342 {
9343 case CureType.Heal:
9344 case CureType.Prayer:
9345 CureCondition<ConFear>();
9346 CureCondition<ConBlind>(2 * p / 100 + 5);
9347 CureCondition<ConPoison>(5 * p / 100 + 5);
9348 CureCondition<ConConfuse>(10 * p / 100 + 10);
9349 CureCondition<ConDim>(p / 100 + 5);
9350 CureCondition<ConBleed>(2 * p / 100 + 10);
9351 if (flag)
9352 {
9353 SAN.Mod(-15);
9354 }
9355 break;
9356 case CureType.CureBody:
9357 CureCondition<ConBlind>(5 * p / 100 + 15);
9358 CureCondition<ConPoison>(10 * p / 100 + 15);
9359 CureCondition<ConBleed>(5 * p / 100 + 20);
9360 CureTempElements(p, body: true, mind: false);
9361 break;
9362 case CureType.CureMind:
9363 CureCondition<ConFear>();
9364 CureCondition<ConDim>(3 * p / 100 + 10);
9365 CureTempElements(p, body: false, mind: true);
9366 break;
9367 case CureType.Sleep:
9368 {
9369 for (int num2 = conditions.Count - 1; num2 >= 0; num2--)
9370 {
9371 Condition condition2 = conditions[num2];
9372 if (!(condition2 is ConSleep) && !(condition2 is ConFaint))
9373 {
9374 if (condition2.isPerfume)
9375 {
9376 condition2.Mod(-1, force: true);
9377 }
9378 else if (condition2.Type == ConditionType.Bad || condition2.Type == ConditionType.Debuff)
9379 {
9380 condition2.Kill();
9381 }
9382 }
9383 }
9384 CureCondition<ConWait>();
9385 CureCondition<ConDisease>((EClass.rnd(20) + 10) * p / 100);
9386 bool flag3 = HasCondition<ConAnorexia>();
9387 base.c_vomit -= (flag3 ? 3 : 2) * p / 100;
9388 if (base.c_vomit < 0)
9389 {
9390 base.c_vomit = 0;
9391 if (flag3)
9392 {
9393 RemoveCondition<ConAnorexia>();
9394 }
9395 }
9396 break;
9397 }
9398 case CureType.HealComplete:
9399 case CureType.Death:
9400 case CureType.Jure:
9401 case CureType.Boss:
9402 {
9403 bool flag2 = type == CureType.Death;
9404 CureTempElements(p * 100, body: true, mind: true);
9405 for (int num = conditions.Count - 1; num >= 0; num--)
9406 {
9407 Condition condition = conditions[num];
9408 if (condition is ConAnorexia && !flag2)
9409 {
9410 continue;
9411 }
9412 switch (condition.Type)
9413 {
9414 case ConditionType.Bad:
9415 case ConditionType.Debuff:
9416 case ConditionType.Disease:
9417 condition.Kill();
9418 continue;
9419 case ConditionType.Stance:
9420 if (flag2)
9421 {
9422 condition.Kill();
9423 continue;
9424 }
9425 break;
9426 }
9427 if (flag2 && condition.isPerfume)
9428 {
9429 condition.Kill();
9430 }
9431 }
9432 CureCondition<ConWait>();
9433 CureCondition<ConSleep>();
9434 if (flag2 || type == CureType.Boss)
9435 {
9436 SAN.Mod(-20);
9437 RemoveCondition<ConBrightnessOfLife>();
9438 }
9439 if (type == CureType.Jure)
9440 {
9441 SAN.Mod(-999);
9442 if (HasElement(1206))
9443 {
9444 SetFeat(1206, 0, msg: true);
9445 }
9446 }
9447 break;
9448 }
9449 }
9450 }
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:10147
Stats SAN
Definition: Chara.cs:1156
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 9288 of file Chara.cs.

9288 : Condition
9289 {
9290 T condition = GetCondition<T>();
9291 if (condition != null)
9292 {
9293 condition.value -= v;
9294 if (condition.value <= 0)
9295 {
9296 condition.Kill();
9297 }
9298 }
9299 }
T GetCondition< T >()
Definition: Chara.cs:9301

◆ CureHost()

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

Definition at line 9325 of file Chara.cs.

9326 {
9327 if (parasite != null)
9328 {
9329 parasite.Cure(type, p, state);
9330 }
9331 if (ride != null)
9332 {
9333 ride.Cure(type, p, state);
9334 }
9335 Cure(type, p, state);
9336 }
void Cure(CureType type, int p=100, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:9338

References Cure().

Referenced by FactionBranch.DailyOutcome().

◆ CureTempElements()

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

Definition at line 10147 of file Chara.cs.

10148 {
10149 if (tempElements != null)
10150 {
10151 if (body)
10152 {
10154 }
10155 if (mind)
10156 {
10158 }
10159 }
10160 void Cure(int[] eles)
10161 {
10162 foreach (int ele in eles)
10163 {
10164 if (tempElements == null)
10165 {
10166 break;
10167 }
10168 Element element = tempElements.GetElement(ele);
10169 if (element != null && element.vBase < 0)
10170 {
10171 ModTempElement(ele, Mathf.Clamp(p / 20 + EClass.rnd(p / 20), 1, -element.vBase));
10172 }
10173 }
10174 }
10175 }
void ModTempElement(int ele, int a, bool naturalDecay=false, bool onlyRenew=false)
Definition: Chara.cs:10055
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 10113 of file Chara.cs.

10114 {
10115 ModTempElement(ele, onlyRenew ? (-p / 20) : (-(p / 100 + EClass.rnd(p / 100 + 1) + 1)), naturalDecay: false, onlyRenew);
10116 }

References EClass.rnd().

◆ DamageTempElements()

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

Definition at line 10101 of file Chara.cs.

10102 {
10103 if (body)
10104 {
10105 DamageTempElement(Element.List_Body.RandomItem(), p, onlyRenew);
10106 }
10107 if (mind)
10108 {
10109 DamageTempElement(Element.List_Mind.RandomItem(), p, onlyRenew);
10110 }
10111 }
void DamageTempElement(int ele, int p, bool onlyRenew=false)
Definition: Chara.cs:10113

References Element.List_Body, and Element.List_Mind.

◆ DestroyPath()

void Chara.DestroyPath ( Point  pos)
inline

Definition at line 3157 of file Chara.cs.

3158 {
3159 bool broke = false;
3160 pos.ForeachMultiSize(base.W, base.H, delegate(Point _p, bool main)
3161 {
3162 if (_p.IsValid)
3163 {
3164 if (_p.HasBlock)
3165 {
3166 EClass._map.MineBlock(_p, recoverBlock: false, this);
3167 if (_p.HasObj)
3168 {
3169 EClass._map.MineObj(_p, null, this);
3170 }
3171 broke = true;
3172 }
3173 if (_p.HasObj && _p.IsBlocked)
3174 {
3175 EClass._map.MineObj(_p, null, this);
3176 broke = true;
3177 }
3178 _p.Things.ForeachReverse(delegate(Thing t)
3179 {
3180 if (t.IsInstalled && (t.trait.IsBlockPath || t.trait.IsDoor))
3181 {
3182 if (t.isNPCProperty && t.trait.CanBeDestroyed)
3183 {
3184 t.Destroy();
3185 }
3186 else if (!t.IsUnique && !t.trait.CanBeDestroyed)
3187 {
3188 t.SetPlaceState(PlaceState.roaming);
3189 }
3190 }
3191 });
3192 }
3193 });
3194 if (broke)
3195 {
3196 Msg.Say("stomp");
3197 Shaker.ShakeCam("stomp");
3198 }
3199 }
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
bool IsUnique
Definition: Card.cs:2079
void ForeachMultiSize(int w, int h, Action< Point, bool > action)
Definition: Point.cs:1373
bool IsBlocked
Definition: Point.cs:351
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 5233 of file Chara.cs.

5234 {
5235 combatCount = 0;
5236 if (isDead || host != null)
5237 {
5238 return;
5239 }
5240 bool isInActiveZone = IsInActiveZone;
5241 if (isInActiveZone)
5242 {
5243 if (IsPC)
5244 {
5246 }
5247 if (base.isSummon)
5248 {
5249 if (id == "tsunami")
5250 {
5251 pos.PlaySound("water");
5252 }
5253 else
5254 {
5255 Say("summon_vanish", this);
5256 pos.PlayEffect("vanish");
5257 pos.PlaySound("vanish");
5258 }
5259 Destroy();
5260 return;
5261 }
5262 if (attackSource == AttackSource.DeathSentense)
5263 {
5264 if (trait is TraitLittleOne)
5265 {
5266 MakeEgg();
5267 if (IsPCFaction)
5268 {
5270 }
5271 }
5272 PlayEffect("revive");
5273 PlaySound("chime_angel");
5274 }
5275 else
5276 {
5277 Effect.Get("blood").Play((parent is Chara) ? (parent as Chara).pos : pos).SetParticleColor(EClass.Colors.matColors[base.material.alias].main)
5278 .Emit(50);
5279 AddBlood(AI_Slaughter.slaughtering ? 12 : (2 + EClass.rnd(2)));
5280 PlaySound(base.material.GetSoundDead(source));
5281 }
5284 ClearFOV();
5285 }
5286 string text = "";
5287 "dead_in".langGame(EClass._zone.Name);
5288 string text2 = ((origin == null) ? "" : origin.GetName(NameStyle.Full));
5289 if (LangGame.Has("dead_" + attackSource))
5290 {
5291 text = "dead_" + attackSource;
5292 }
5293 else
5294 {
5295 if (e != Element.Void && e != null)
5296 {
5297 text = "dead_" + e.source.alias;
5298 }
5299 if (text == "" || !LangGame.Has(text))
5300 {
5301 text = "dead";
5302 }
5303 }
5304 if (IsPC)
5305 {
5306 EClass._zone.isDeathLocation = true;
5307 string s = ((origin == null) ? text : "dead_by");
5309 if (attackSource == AttackSource.Wrath)
5310 {
5312 }
5313 EClass.player.deathMsg = GameLang.Parse(s.langGame(), thirdPerson: true, EClass.pc.NameBraced, "dead_in".langGame(EClass._zone.Name), text2);
5315 if (EClass._zone.instance is ZoneInstanceRandomQuest zoneInstanceRandomQuest)
5316 {
5317 zoneInstanceRandomQuest.status = ZoneInstance.Status.Fail;
5318 }
5319 AI_PlayMusic.keepPlaying = false;
5320 }
5321 if (isInActiveZone)
5322 {
5323 if (attackSource == AttackSource.DeathSentense)
5324 {
5325 Msg.Say("goto_heaven", this);
5326 }
5327 else
5328 {
5329 if (originalTarget != null || origin == null || !origin.isSynced || (attackSource != AttackSource.Melee && attackSource != AttackSource.Range))
5330 {
5331 Msg.Say(text, this, "", text2);
5332 }
5333 string text3 = TalkTopic("dead");
5334 if (!text3.IsEmpty())
5335 {
5336 text3 = text3.StripBrackets();
5337 }
5338 bool flag = base.rarity >= Rarity.Legendary && !IsPCFaction;
5339 if (!IsPC && flag)
5340 {
5341 MakeGrave(text3);
5342 }
5343 Msg.SetColor();
5344 SpawnLoot(origin);
5345 }
5346 if (IsPC)
5347 {
5349 }
5350 }
5351 if (IsPCFaction)
5352 {
5353 if (homeBranch != null)
5354 {
5355 homeBranch.Log(text, this, "");
5356 }
5357 WidgetPopText.Say("popDead".lang(base.Name), FontColor.Bad);
5358 if (!IsPC)
5359 {
5360 if (EClass.player.stats.allyDeath == 0)
5361 {
5362 Tutorial.Reserve("death_pet");
5363 }
5365 }
5366 }
5367 if (id == "mandrake" || HasElement(488))
5368 {
5369 Say("a_scream", this);
5370 ActEffect.ProcAt(EffectId.Scream, base.LV * 3 + 200, BlessedState.Normal, this, this, pos, isNeg: true);
5371 }
5372 daysStarved = 0;
5373 isDead = true;
5375 enemy = null;
5376 _cooldowns = null;
5377 base.isSale = false;
5378 SetInt(70);
5379 EClass._map.props.sales.Remove(this);
5380 Cure(CureType.Death);
5381 SetAI(new NoGoal());
5383 if (isInActiveZone && EClass._zone.HasLaw && IsHuman && OriginalHostility >= Hostility.Neutral)
5384 {
5385 pos.TalkWitnesses(origin?.Chara, "witness", 3, WitnessType.crime, (Chara c) => !c.IsPCParty && !c.IsUnique);
5386 }
5387 if (IsPC)
5388 {
5389 EClass.player.returnInfo = null;
5390 EClass.player.uidLastTravelZone = 0;
5391 foreach (Chara chara3 in EClass._map.charas)
5392 {
5393 if (chara3.IsHostile())
5394 {
5395 chara3.hostility = chara3.OriginalHostility;
5396 }
5397 if (chara3.enemy == EClass.pc)
5398 {
5399 chara3.enemy = null;
5400 }
5401 }
5402 if (EClass.pc.things.Find("letter_will") != null && EClass.rnd(10) == 0)
5403 {
5404 EClass.player.preventDeathPenalty = true;
5405 }
5406 }
5407 else
5408 {
5409 bool flag2 = currentZone.IsActiveZone && IsLocalChara && !currentZone.IsPCFaction;
5410 if (currentZone is Zone_LittleGarden && id == "littleOne")
5411 {
5412 flag2 = false;
5413 }
5414 if (flag2)
5415 {
5416 EClass._map.deadCharas.Add(this);
5417 }
5418 currentZone.RemoveCard(this);
5419 }
5420 if ((origin != null && origin.IsPCParty) || IsPCFaction)
5421 {
5422 int a = -10;
5423 if (IsPCFaction && !IsPCParty && (origin == null || !origin.IsPCParty))
5424 {
5425 a = -5;
5426 }
5427 ModAffinity(EClass.pc, a, show: false);
5428 string text4 = id;
5429 if (!(text4 == "quru"))
5430 {
5431 if (text4 == "corgon")
5432 {
5433 EClass.game.cards.globalCharas.Find("quru")?.ModAffinity(EClass.pc, -20, show: false);
5434 }
5435 }
5436 else
5437 {
5438 EClass.game.cards.globalCharas.Find("corgon")?.ModAffinity(EClass.pc, -20, show: false);
5439 }
5440 }
5441 if (origin != null)
5442 {
5443 if (origin.IsPCParty || origin.IsPCPartyMinion)
5444 {
5445 int num = 0;
5446 if (OriginalHostility >= Hostility.Friend && IsHuman && !base.IsPCFactionOrMinion)
5447 {
5448 num = -5;
5449 }
5450 else if (race.id == "cat" && OriginalHostility >= Hostility.Neutral)
5451 {
5452 EClass.pc.Say("killcat");
5453 num = -1;
5454 }
5455 if (EClass.pc.party.HasElement(1563) && num < 0)
5456 {
5457 num = num * 30 / 100;
5458 }
5459 if (num != 0)
5460 {
5461 EClass.player.ModKarma(num);
5462 }
5463 }
5464 if (origin == EClass.pc)
5465 {
5466 EClass.pc.faith.Revelation("kill", 10);
5467 }
5468 else if (origin.IsPCFaction)
5469 {
5470 origin.Chara.ModAffinity(EClass.pc, 1, show: false);
5471 origin.Chara.ShowEmo(Emo.love);
5472 }
5473 }
5474 if (base.sourceBacker != null && origin != null && origin.IsPCParty)
5475 {
5476 EClass.player.doneBackers.Add(base.sourceBacker.id);
5477 }
5478 if (base.IsPCFactionOrMinion)
5479 {
5481 {
5482 Msg.Say("abort_allyDead");
5483 }
5484 }
5486 {
5487 Msg.Say("abort_enemyDead");
5488 }
5489 if (IsPCParty && !IsPC)
5490 {
5492 base.c_wasInPcParty = true;
5493 EClass.pc.Say("allyDead");
5494 }
5495 switch (id)
5496 {
5497 case "littleOne":
5498 if (attackSource != AttackSource.DeathSentense && !IsPCFaction)
5499 {
5500 EClass.player.flags.little_killed = true;
5502 }
5503 break;
5504 case "big_daddy":
5505 if (!IsPCFaction)
5506 {
5507 Chara chara = CharaGen.Create("littleOne");
5508 EClass._zone.AddCard(chara, pos.Copy());
5509 Msg.Say("little_pop");
5511 }
5512 break;
5513 case "shark_sister":
5514 if (!IsPCFaction)
5515 {
5516 Chara t = CharaGen.Create("sister_shark");
5517 EClass._zone.AddCard(t, pos.Copy());
5518 Msg.Say("shark_pop");
5519 }
5520 break;
5521 }
5522 if (attackSource == AttackSource.Finish && origin != null && origin.Evalue(665) > 0)
5523 {
5524 Chara chara2 = CharaGen.CreateFromFilter("c_plant", base.LV);
5525 EClass._zone.AddCard(chara2, pos.Copy());
5526 if (chara2.LV < base.LV)
5527 {
5528 chara2.SetLv(base.LV);
5529 }
5530 chara2.MakeMinion((origin.IsPCParty || origin.IsPCPartyMinion) ? EClass.pc : origin.Chara, MinionType.Friend);
5531 Msg.Say("plant_pop", this, chara2);
5532 }
5534 }
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:2603
void AddBlood(int a=1, int id=-1)
Definition: Card.cs:5892
virtual bool IsPCParty
Definition: Card.cs:2137
Card SetLv(int a)
Definition: Card.cs:2885
ICardParent parent
Definition: Card.cs:55
virtual bool IsPCPartyMinion
Definition: Card.cs:2141
void ClearFOV()
Definition: Card.cs:6495
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:6111
virtual bool IsPCFaction
Definition: Card.cs:2257
void SpawnLoot(Card origin)
Definition: Card.cs:5055
int LV
Definition: Card.cs:386
virtual bool isSynced
Definition: Card.cs:2075
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:877
int daysStarved
Definition: Chara.cs:327
void MakeMinion(Chara _master, MinionType type=MinionType.Default)
Definition: Chara.cs:2325
string NameBraced
Definition: Chara.cs:512
void ClearTempElements()
Definition: Chara.cs:10177
string TalkTopic(string topic="calm")
Definition: Chara.cs:6864
void TryDropBossLoot()
Definition: Chara.cs:5536
bool IsLocalChara
Definition: Chara.cs:839
Chara enemy
Definition: Chara.cs:86
bool IsInActiveZone
Definition: Chara.cs:836
void TryDropCarryOnly()
Definition: Chara.cs:4524
void MakeGrave(string lastword)
Definition: Chara.cs:5150
UD_String_MatData matColors
static ColorProfile Colors
Definition: EClass.cs:38
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:2499
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:2393
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:803
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:226
void RemoveCard(Card t)
Definition: Zone.cs:1999
void ResetHostility()
Definition: Zone.cs:2670
ZoneInstance instance
Definition: Zone.cs:52

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

10133 {
10134 if (tempElements == null)
10135 {
10136 return;
10137 }
10138 foreach (Element item in tempElements.dict.Values.ToList())
10139 {
10140 if (item.vBase > 0)
10141 {
10142 ModTempElement(item.id, -Mathf.Min(item.vBase * 5 / 100 + 1, item.vBase), naturalDecay: true);
10143 }
10144 }
10145 }

References ElementContainer.dict, and item.

◆ DoAI()

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

Definition at line 6156 of file Chara.cs.

6157 {
6158 SetAI(new DynamicAIAct("", delegate
6159 {
6160 onPerform();
6161 return true;
6162 })
6163 {
6164 wait = wait
6165 });
6166 }

◆ DoHostileAction()

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

Definition at line 6256 of file Chara.cs.

6257 {
6258 if (_tg == null || !_tg.isChara)
6259 {
6260 return;
6261 }
6262 Chara chara = _tg.Chara;
6263 if (chara.IsPC)
6264 {
6265 EClass.pc.combatCount = 10;
6266 }
6267 if (!chara.IsAliveInCurrentZone || !IsAliveInCurrentZone || chara == this)
6268 {
6269 return;
6270 }
6271 if ((IsPCFaction || IsPCFactionMinion) && (chara.IsPCFaction || chara.IsPCFactionMinion))
6272 {
6273 chara.Say("frown", this, chara);
6274 }
6275 else
6276 {
6277 if (EClass._zone.IsRegion)
6278 {
6279 return;
6280 }
6281 if (IsPC)
6282 {
6283 if (chara.IsFriendOrAbove() && !immediate)
6284 {
6285 chara.Say("frown", this, chara);
6286 chara.ShowEmo(Emo.sad);
6287 chara.hostility = Hostility.Neutral;
6288 return;
6289 }
6290 if (!chara.IsPCFaction && chara.hostility >= Hostility.Neutral && !EClass._zone.IsPCFaction)
6291 {
6292 bool flag = chara.id == "fanatic";
6293 if (EClass.rnd(4) == 0 || flag)
6294 {
6295 chara.Say("callHelp", chara);
6296 chara.CallHelp(this, flag);
6297 }
6298 }
6299 if (chara.hostility <= Hostility.Enemy)
6300 {
6301 foreach (Chara member in EClass.pc.party.members)
6302 {
6303 if (member != EClass.pc && member.enemy == null && member.CanSee(chara))
6304 {
6305 member.SetEnemy(chara);
6306 }
6307 }
6308 }
6309 }
6310 else if (chara.IsPC && hostility <= Hostility.Enemy)
6311 {
6312 foreach (Chara member2 in EClass.pc.party.members)
6313 {
6314 if (member2 != EClass.pc && member2.enemy == null && member2.CanSee(this))
6315 {
6316 member2.SetEnemy(this);
6317 }
6318 }
6319 }
6320 if (chara.calmCheckTurn <= 0 || IsPC)
6321 {
6322 chara.calmCheckTurn = (IsPC ? (20 + EClass.rnd(30)) : (10 + EClass.rnd(10)));
6323 }
6324 if (hostility != Hostility.Enemy || chara.hostility != Hostility.Enemy)
6325 {
6326 GoHostile(chara);
6327 chara.GoHostile(this);
6328 if (base.isHidden && !chara.CanSee(this) && !chara.IsDisabled && !chara.IsPCParty && !chara.IsPCPartyMinion && EClass.rnd(10 + Dist(chara) * 10) == 0)
6329 {
6330 Thing t = ThingGen.Create("49");
6331 ActThrow.Throw(chara, pos, t);
6332 Act.TC = chara;
6333 }
6334 }
6335 }
6336 }
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:559
override bool IsPCPartyMinion
Definition: Chara.cs:637
int calmCheckTurn
Definition: Chara.cs:116
bool CanSee(Card c)
Definition: Chara.cs:1216
override bool IsPCFactionMinion
Definition: Chara.cs:653
bool IsFriendOrAbove()
Definition: Chara.cs:6525
Chara SetEnemy(Chara c=null)
Definition: Chara.cs:6207
void CallHelp(Chara tg, bool fanatic=false)
Definition: Chara.cs:6338
Hostility hostility
Definition: Chara.cs:289
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.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 5027 of file Chara.cs.

5028 {
5029 Say("drink", this, t.Duplicate(1));
5030 Say("quaff");
5031 PlaySound("drink");
5032 hunger.Mod(-2);
5033 t.ModNum(-1);
5034 t.trait.OnDrink(this);
5035 _ = IsPC;
5036 }
Thing Duplicate(int num)
Definition: Card.cs:3393
void ModNum(int a, bool notify=true)
Definition: Card.cs:3464
Stats hunger
Definition: Chara.cs:1140
virtual void OnDrink(Chara c)
Definition: Trait.cs:991

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

4537 {
4538 if (held == null)
4539 {
4540 return null;
4541 }
4542 if (IsPC)
4543 {
4544 WidgetHotbar.dirtyCurrentItem = true;
4546 }
4547 Card card = EClass._zone.AddCard(held, dropPos ?? pos);
4548 card.OnLand();
4549 if (card.trait.CanOnlyCarry)
4550 {
4551 card.SetPlaceState(PlaceState.installed);
4552 }
4553 return card;
4554 }
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 4556 of file Chara.cs.

4557 {
4558 if (t.c_isImportant)
4559 {
4560 Msg.Say("markedImportant");
4561 return;
4562 }
4563 if (!t.trait.CanBeDropped)
4564 {
4565 Msg.Say("cantDrop", t);
4566 return;
4567 }
4568 if (t.trait is TraitAbility)
4569 {
4570 SE.Trash();
4571 t.Destroy();
4572 return;
4573 }
4574 Msg.Say("dropItem", t.Name);
4575 t.ignoreAutoPick = true;
4576 PlaySound("drop");
4577 EClass._zone.AddCard(t, pos);
4578 if (t.trait.CanOnlyCarry)
4579 {
4580 t.Install();
4581 }
4582 }
Card Install()
Definition: Card.cs:3690
virtual bool CanBeDropped
Definition: Trait.cs:300

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

1770 {
1771 Chara chara = CharaGen.Create(id);
1772 chara.mana.value = mana.value;
1773 chara.stamina.value = stamina.value;
1774 foreach (KeyValuePair<int, Element> item in elements.dict)
1775 {
1776 Element orCreateElement = chara.elements.GetOrCreateElement(item.Key);
1777 orCreateElement.vBase = item.Value.ValueWithoutLink - orCreateElement.vSource;
1778 }
1779 chara.SetFaith(faith);
1780 chara.bio = IO.DeepCopy(bio);
1781 chara.LV = base.LV;
1782 chara.c_daysWithGod = base.c_daysWithGod;
1783 chara.RefreshFaithElement();
1784 chara.hp = (int)Mathf.Clamp((float)chara.MaxHP * ((float)base.hp / (float)MaxHP) * 0.99f, 0f, chara.MaxHP);
1785 chara.isCopy = true;
1786 chara.isScaled = base.isScaled;
1787 if (HaveFur())
1788 {
1789 chara.c_fur = -1;
1790 }
1791 return chara;
1792 }
bool HaveFur()
Definition: Card.cs:7783
Stats mana
Definition: Chara.cs:1152
void RefreshFaithElement()
Definition: Chara.cs:10012
void SetFaith(string id)
Definition: Chara.cs:1700
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 10127 of file Chara.cs.

10128 {
10129 ModTempElement(ele, onlyRenew ? (p / 20) : (p / 100 + EClass.rnd(p / 100 + 1)), naturalDecay: false, onlyRenew);
10130 }

References EClass.rnd().

◆ EnhanceTempElements()

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

Definition at line 10118 of file Chara.cs.

10119 {
10120 int[] array = (body ? Element.List_Body : Element.List_Mind);
10121 foreach (int ele in array)
10122 {
10123 EnhanceTempElement(ele, p, onlyRenew);
10124 }
10125 }
void EnhanceTempElement(int ele, int p, bool onlyRenew=false)
Definition: Chara.cs:10127

References Element.List_Mind.

◆ EQ_CAT()

void Chara.EQ_CAT ( string  s)
inline

Definition at line 5004 of file Chara.cs.

5005 {
5006 int slot = EClass.sources.categories.map[s].slot;
5007 BodySlot bodySlot = ((slot == 0) ? null : body.GetSlot(slot));
5008 if ((slot == 0 || bodySlot != null) && (slot != 37 || !HasElement(1209)))
5009 {
5010 SetEQQuality();
5011 Thing thing = ThingGen.CreateFromCategory(s, base.LV);
5012 AddThing(thing);
5013 if (bodySlot != null && !body.Equip(thing, bodySlot))
5014 {
5015 thing.Destroy();
5016 }
5017 }
5018 }
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:3085
bool Equip(Thing thing, BodySlot slot=null, bool msg=true)
Definition: CharaBody.cs:182
BodySlot GetSlot(Thing t, bool onlyEmpty=false, bool secondSlot=false)
Definition: CharaBody.cs:347
void SetEQQuality()
Definition: Chara.cs:4951
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 4984 of file Chara.cs.

4985 {
4986 SetEQQuality();
4987 if (r != Rarity.Random)
4988 {
4989 CardBlueprint.current.rarity = r;
4990 }
4991 Thing thing = ThingGen.Create(s, mat, base.LV);
4992 if (body.GetSlot(thing, onlyEmpty: true) == null)
4993 {
4994 return thing;
4995 }
4996 AddThing(thing);
4997 if (!body.Equip(thing))
4998 {
4999 thing.Destroy();
5000 }
5001 return thing;
5002 }

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

5021 {
5022 SetEQQuality();
5023 Thing t = ThingGen.Create(s, -1, base.LV).SetNum(num);
5024 AddThing(t);
5025 }
Thing SetNum(int a)
Definition: Card.cs:3444

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

◆ EvalueRiding()

int Chara.EvalueRiding ( )
inline

Definition at line 6067 of file Chara.cs.

6068 {
6069 if (ride != null && ride.HasCondition<ConTransmuteBroom>() && HasElement(1417))
6070 {
6071 return 25 + Evalue(226) * 125 / 100;
6072 }
6073 return Evalue(226);
6074 }

References HasCondition().

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

◆ FallFromZone()

void Chara.FallFromZone ( )
inline

Definition at line 3479 of file Chara.cs.

3480 {
3481 Msg.Say("skyFall", EClass.pc, EClass._zone.Name);
3482 Zone zone = (EClass._zone.isExternalZone ? null : EClass._zone.GetTopZone().FindZone(EClass._zone.lv - 1));
3483 zone = zone ?? EClass.world.region;
3485 {
3486 state = ZoneTransition.EnterState.Fall,
3487 x = pos.x,
3488 z = pos.z
3489 });
3490 }
void MoveZone(string alias)
Definition: Chara.cs:3304
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:1920

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

7690 {
7691 TraitToolRange ranged = weapon.trait as TraitToolRange;
7692 Thing thing = (IsPC ? EClass.pc.things.Find<TraitQuiver>() : null);
7693 if (thing != null)
7694 {
7695 Thing thing2 = thing.things.Find((Thing t) => ranged.IsAmmo(t));
7696 if (thing2 != null)
7697 {
7698 return thing2;
7699 }
7700 }
7701 return things.Find((Thing t) => ranged.IsAmmo(t));
7702 }
bool IsAmmo
Definition: Card.cs:2235
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 7213 of file Chara.cs.

7214 {
7215 foreach (Card item in EClass._map.props.installed.all)
7216 {
7217 if (item.trait is TraitBed traitBed && traitBed.IsHolder(this))
7218 {
7219 return traitBed;
7220 }
7221 }
7222 return null;
7223 }

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

7425 {
7426 Thing result = null;
7427 int num = -1;
7428 if (IsPC)
7429 {
7430 return null;
7431 }
7432 foreach (Thing item in things.List((Thing t) => CanEat(t, shouldEat: true) && !t.c_isImportant, onlyAccessible: true))
7433 {
7434 int num2 = CountNumEaten(item);
7435 int num3 = 100 - num2;
7436 if (num3 > num)
7437 {
7438 result = item;
7439 num = num3;
7440 }
7441 }
7442 return result;
7443 }
bool CanEat(Thing t, bool shouldEat=false)
Definition: Chara.cs:7470
int CountNumEaten(Thing food)
Definition: Chara.cs:9983
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 2371 of file Chara.cs.

2372 {
2373 if (IsMinion)
2374 {
2375 master = EClass._map.FindChara(base.c_uidMaster);
2376 }
2377 return master;
2378 }
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 6418 of file Chara.cs.

6419 {
6420 for (int i = 0; i < EClass._map.charas.Count; i++)
6421 {
6422 Chara chara = EClass._map.charas[i];
6423 if (chara != this && chara != enemy && IsHostile(chara) && Dist(chara) <= 1 && CanInteractTo(chara.pos))
6424 {
6425 DoHostileAction(chara);
6426 enemy = chara;
6427 return true;
6428 }
6429 }
6430 return false;
6431 }
void DoHostileAction(Card _tg, bool immediate=false)
Definition: Chara.cs:6256

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

6350 {
6351 if (EClass._zone.isPeace && base.IsPCFactionOrMinion && !IsPC)
6352 {
6353 return false;
6354 }
6355 if (enemy != null && !enemy.IsAliveInCurrentZone)
6356 {
6357 enemy = null;
6358 }
6359 if (enemy != null)
6360 {
6361 return false;
6362 }
6363 if (IsPCParty && EClass.pc.isHidden && base.isHidden)
6364 {
6365 return false;
6366 }
6367 bool flag = enemy != null || ai is GoalCombat;
6368 int num = (base.PER + Evalue(210) * 2) * ((!flag) ? 1 : 2);
6369 bool flag2 = IsPCParty && !IsPC && EClass.game.config.tactics.dontWander;
6370 bool flag3 = !IsPCParty;
6371 Chara chara = null;
6372 int num2 = 9999;
6373 for (int i = 0; i < EClass._map.charas.Count; i++)
6374 {
6375 Chara chara2 = EClass._map.charas[i];
6376 if (chara2 == this || !IsHostile(chara2) || !CanSee(chara2))
6377 {
6378 continue;
6379 }
6380 int num3 = Dist(chara2);
6381 int num4 = GetSightRadius() + (flag ? 1 : 0);
6382 if (num3 > num4)
6383 {
6384 continue;
6385 }
6386 if (flag3 && EClass.rnd(chara2.Evalue(152) + 5) * (100 + num3 * num3 * 10) / 100 > EClass.rnd(num))
6387 {
6388 if (this == pos.FirstChara)
6389 {
6390 chara2.ModExp(152, Mathf.Clamp((num - chara2.Evalue(152)) / 2, 1, Mathf.Max(30 - stealthSeen * 2, 1)));
6391 }
6392 stealthSeen++;
6393 }
6394 else if (CanSeeLos(chara2) && (!flag2 || EClass.pc.isBlind || EClass.pc.CanSeeLos(chara2)) && (!IsPCFaction || EClass.pc.ai.ShouldAllyAttack(chara2)))
6395 {
6396 if (!IsPCParty)
6397 {
6398 DoHostileAction(chara2);
6399 enemy = chara2;
6400 return true;
6401 }
6402 if (num3 < num2)
6403 {
6404 num2 = num3;
6405 chara = chara2;
6406 }
6407 }
6408 }
6409 if (chara != null)
6410 {
6411 DoHostileAction(chara);
6412 enemy = chara;
6413 return true;
6414 }
6415 return false;
6416 }
virtual bool ShouldAllyAttack(Chara tg)
Definition: AIAct.cs:134
int stealthSeen
Definition: Chara.cs:186
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 7804 of file Chara.cs.

7805 {
7806 return FindBed()?.owner.pos.cell.room;
7807 }
TraitBed FindBed()
Definition: Chara.cs:7213

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

9899 {
9900 Element orCreateElement = elements.GetOrCreateElement(ele);
9901 if (orCreateElement.ValueWithoutLink == 0)
9902 {
9903 elements.ModBase(orCreateElement.id, 1);
9904 }
9905 if (orCreateElement is Spell)
9906 {
9907 int num = EClass.curve(Evalue(307), 50, 20) + (HasElement(307) ? 20 : 0);
9908 int num2 = origin?.Evalue(765) ?? 0;
9909 num = num * (100 - num2) / 100;
9910 int a = mtp * orCreateElement.source.charge * (100 + num) / 100 / 100;
9911 a = Mathf.Max(1, EClass.rndHalf(a));
9912 if (orCreateElement.source.charge == 1)
9913 {
9914 a = 1;
9915 }
9916 orCreateElement.vPotential += a;
9917 }
9918 Say("spell_gain", this, orCreateElement.Name);
9919 LayerAbility.SetDirty(orCreateElement);
9920 }
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 7157 of file Chara.cs.

7158 {
7159 string result = "?????";
7160 if (ai != null)
7161 {
7162 result = ai.GetCurrentActionText();
7163 }
7164 return result;
7165 }
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 7739 of file Chara.cs.

7740 {
7741 if (body.GetWeight(armorOnly: true) <= 30000)
7742 {
7743 return 120;
7744 }
7745 return 122;
7746 }
int GetWeight(bool armorOnly=false)
Definition: CharaBody.cs:402

References CharaBody.GetWeight().

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

◆ GetBestRangedWeapon()

Thing Chara.GetBestRangedWeapon ( )
inline

Definition at line 7704 of file Chara.cs.

7705 {
7706 Thing result = null;
7707 int num = 0;
7708 foreach (Thing thing in things)
7709 {
7710 if (thing.IsRangedWeapon && CanEquipRanged(thing) && thing.GetEquipValue() > num)
7711 {
7712 num = thing.GetEquipValue();
7713 result = thing;
7714 }
7715 }
7716 return result;
7717 }
int GetEquipValue()
Definition: Card.cs:7082
bool IsRangedWeapon
Definition: Card.cs:2231
bool CanEquipRanged(Thing t)
Definition: Chara.cs:7638

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

◆ GetBuffStats() [1/2]

Element Chara.GetBuffStats ( int  ele)
inline

Definition at line 9263 of file Chara.cs.

9264 {
9265 for (int i = 0; i < conditions.Count; i++)
9266 {
9267 if (conditions[i] is ConBuffStats conBuffStats && conBuffStats.refVal == ele)
9268 {
9269 return conBuffStats.elements.GetElement(ele);
9270 }
9271 }
9272 return null;
9273 }

References BaseCondition.refVal.

◆ GetBuffStats() [2/2]

Element Chara.GetBuffStats ( string  alias)
inline

Definition at line 9258 of file Chara.cs.

9259 {
9260 return GetBuffStats(EClass.sources.elements.alias[alias].id);
9261 }
Element GetBuffStats(string alias)
Definition: Chara.cs:9258

References SourceManager.elements, and EClass.sources.

Referenced by GoalCombat.TryUseAbility().

◆ GetBurden()

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

Definition at line 1794 of file Chara.cs.

1795 {
1796 int num2 = (base.ChildrenWeight + ((t != null) ? ((num == -1) ? t.ChildrenAndSelfWeight : (t.SelfWeight * num)) : 0)) * 100 / WeightLimit;
1797 if (num2 < 0)
1798 {
1799 num2 = 1000;
1800 }
1802 {
1803 num2 = 0;
1804 }
1805 int num3 = ((num2 >= 100) ? ((num2 - 100) / 10 + 1) : 0);
1806 if (num3 > 9)
1807 {
1808 num3 = 9;
1809 }
1810 return num3;
1811 }

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

◆ GetCondition< T >()

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

Definition at line 9301 of file Chara.cs.

9301 : Condition
9302 {
9303 for (int i = 0; i < conditions.Count; i++)
9304 {
9305 if (conditions[i] is T)
9306 {
9307 return conditions[i] as T;
9308 }
9309 }
9310 return null;
9311 }

◆ GetCooldown()

int Chara.GetCooldown ( int  idEle)
inline

Definition at line 8556 of file Chara.cs.

8557 {
8558 if (_cooldowns != null)
8559 {
8560 for (int i = 0; i < _cooldowns.Count; i++)
8561 {
8562 if (_cooldowns[i] / 1000 == idEle)
8563 {
8564 return _cooldowns[i] % 1000;
8565 }
8566 }
8567 }
8568 return 0;
8569 }

Referenced by NotificationCooldown.OnRefresh().

◆ GetCurrentDir()

int Chara.GetCurrentDir ( )
inline

Definition at line 3599 of file Chara.cs.

3600 {
3601 Debug.Log(angle);
3602 if (!renderer.hasActor)
3603 {
3604 if (angle == 0f || angle == 45f || angle == 90f)
3605 {
3606 return 2;
3607 }
3608 if (angle == -135f || angle == 180f || angle == -90f)
3609 {
3610 return 1;
3611 }
3612 if (angle == 135f)
3613 {
3614 return 0;
3615 }
3616 return 3;
3617 }
3618 return renderer.actor.currentDir;
3619 }
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 7132 of file Chara.cs.

7133 {
7134 return (ai.IsRunning ? ai.GetDestination() : pos).Copy();
7135 }
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 4609 of file Chara.cs.

4610 {
4611 if (elements.Value(122) > elements.Value(120))
4612 {
4613 return elements.GetElement(122);
4614 }
4615 return elements.GetElement(120);
4616 }
int Value(int ele)

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

◆ GetFavAttackStyle()

AttackStyle Chara.GetFavAttackStyle ( )
inline

Definition at line 4584 of file Chara.cs.

4585 {
4586 int num = Evalue(131);
4587 int num2 = Evalue(130);
4588 int num3 = Evalue(123);
4589 if (num > num2 && num > num3)
4590 {
4591 return AttackStyle.TwoWield;
4592 }
4593 if (num2 > num && num2 > num3)
4594 {
4595 return AttackStyle.TwoHand;
4596 }
4597 if (num3 > num && num3 > num2)
4598 {
4599 return AttackStyle.Shield;
4600 }
4601 return AttackStyle.Default;
4602 }

Referenced by WindowChara.RefreshNote().

◆ GetFavCat()

SourceCategory.Row Chara.GetFavCat ( )
inline

Definition at line 7928 of file Chara.cs.

7929 {
7930 SourceCategory.Row r = null;
7931 if (_listFavCat.Count == 0)
7932 {
7933 foreach (SourceCategory.Row row in EClass.sources.categories.rows)
7934 {
7935 if (row.gift > 0)
7936 {
7937 _listFavCat.Add(row);
7938 }
7939 }
7940 }
7941 Rand.UseSeed(base.uid + EClass.game.seed, delegate
7942 {
7943 r = _listFavCat.RandomItem();
7944 });
7945 return r;
7946 }
static List< SourceCategory.Row > _listFavCat
Definition: Chara.cs:192
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 7908 of file Chara.cs.

7909 {
7910 if (_listFavFood.Count == 0)
7911 {
7912 foreach (SourceThing.Row row in EClass.sources.things.rows)
7913 {
7914 if (row._origin == "dish" && row.value != 0 && row.chance != 0)
7915 {
7916 _listFavFood.Add(row);
7917 }
7918 }
7919 }
7920 SourceThing.Row r = null;
7921 Rand.UseSeed(base.uid + EClass.game.seed, delegate
7922 {
7923 r = _listFavFood.RandomItem();
7924 });
7925 return r;
7926 }
static List< SourceThing.Row > _listFavFood
Definition: Chara.cs:190
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 4604 of file Chara.cs.

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

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

8623 {
8624 if (IsPC)
8625 {
8626 return null;
8627 }
8628 switch (TimeTable.GetSpan(idTimeTable, hour))
8629 {
8630 case TimeTable.Span.Sleep:
8632 {
8633 return new GoalSleep();
8634 }
8635 break;
8636 case TimeTable.Span.Eat:
8637 return new GoalIdle();
8638 case TimeTable.Span.Work:
8639 if (IsGuest())
8640 {
8641 return new GoalIdle();
8642 }
8643 return GetGoalWork();
8644 case TimeTable.Span.Free:
8645 if (IsGuest())
8646 {
8647 return new GoalIdle();
8648 }
8649 return GetGoalHobby();
8650 }
8651 return null;
8652 }
Goal GetGoalWork()
Definition: Chara.cs:8654
Goal GetGoalHobby()
Definition: Chara.cs:8667
string idTimeTable
Definition: Chara.cs:466
static Span GetSpan(string id, int hour)
Definition: TimeTable.cs:45
bool isSimulating
Definition: Zone.cs:72

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

◆ GetGoalHobby()

Goal Chara.GetGoalHobby ( )
inline

Definition at line 8667 of file Chara.cs.

8668 {
8669 if (IsPrisoner)
8670 {
8671 return new GoalIdle();
8672 }
8673 if (memberType == FactionMemberType.Livestock)
8674 {
8675 return new GoalGraze();
8676 }
8677 return new GoalHobby();
8678 }
FactionMemberType
bool IsPrisoner
Definition: Chara.cs:1036

Referenced by Zone.Simulate().

◆ GetGoalWork()

Goal Chara.GetGoalWork ( )
inline

Definition at line 8654 of file Chara.cs.

8655 {
8656 if (IsPrisoner)
8657 {
8658 return new GoalIdle();
8659 }
8660 if (memberType == FactionMemberType.Livestock)
8661 {
8662 return new GoalGraze();
8663 }
8664 return new GoalWork();
8665 }

Referenced by Zone.Simulate().

◆ GetHappiness()

int Chara.GetHappiness ( )
inline

Definition at line 7142 of file Chara.cs.

7143 {
7144 int num = 50;
7145 if (FindBed() != null)
7146 {
7147 num += 50;
7148 }
7149 return num;
7150 }

◆ GetHireCost()

int Chara.GetHireCost ( )
inline

Definition at line 7137 of file Chara.cs.

7138 {
7139 return base.LV / 2 + 4;
7140 }

Referenced by CalcGold.Hire().

◆ GetHoverText()

override string Chara.GetHoverText ( )
inlinevirtual

Reimplemented from Card.

Definition at line 6671 of file Chara.cs.

6672 {
6673 string text = base.Name;
6674 if (IsFriendOrAbove())
6675 {
6676 text = text.TagColor(EClass.Colors.colorFriend);
6677 }
6678 else if (IsHostile())
6679 {
6680 text = text.TagColor(EClass.Colors.colorHostile);
6681 }
6682 int num = 2;
6683 int lV = EClass.pc.LV;
6684 if (base.LV >= lV * 5)
6685 {
6686 num = 0;
6687 }
6688 else if (base.LV >= lV * 2)
6689 {
6690 num = 1;
6691 }
6692 else if (base.LV <= lV / 4)
6693 {
6694 num = 4;
6695 }
6696 else if (base.LV <= lV / 2)
6697 {
6698 num = 3;
6699 }
6700 string text2 = Lang.GetList("lvComparison")[num];
6701 text2 = (" (" + text2 + ") ").TagSize(14).TagColor(EClass.Colors.gradientLVComparison.Evaluate(0.25f * (float)num));
6702 string s = (IsFriendOrAbove() ? "HostilityAlly" : (IsNeutral() ? "HostilityNeutral" : "HostilityEnemy"));
6703 s = (" (" + s.lang() + ") ").TagSize(14);
6704 s = "";
6705 if (memberType == FactionMemberType.Guest)
6706 {
6707 s += (" (" + "guest".lang() + ") ").TagSize(14);
6708 }
6709 else if (memberType == FactionMemberType.Livestock)
6710 {
6711 s += (" (" + "livestock".lang() + ") ").TagSize(14);
6712 }
6713 if (!EClass.pc.IsMoving)
6714 {
6715 if (EClass.pc.HasHigherGround(this))
6716 {
6717 text2 += "lowerGround".lang();
6718 }
6719 else if (HasHigherGround(EClass.pc))
6720 {
6721 text2 += "higherGround".lang();
6722 }
6723 }
6724 if (Evalue(1232) > 0)
6725 {
6726 text2 = "milkBaby".lang().TagSize(14) + text2;
6727 }
6728 if (Guild.Fighter.ShowBounty(this) && Guild.Fighter.HasBounty(this))
6729 {
6730 text2 = "hasBounty".lang().TagSize(14) + text2;
6731 }
6732 if (EClass.pc.HasElement(481))
6733 {
6734 text2 += ("(" + faith.Name + ")").TagSize(14);
6735 }
6736 return text + text2 + s;
6737 }
bool HasHigherGround(Card c)
Definition: Chara.cs:1188
override bool IsMoving
Definition: Chara.cs:606
bool IsNeutral()
Definition: Chara.cs:6476
Color colorHostile
Color colorFriend
Gradient gradientLVComparison
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.colorFriend, ColorProfile.colorHostile, EClass.Colors, Guild.Fighter, 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 6739 of file Chara.cs.

6740 {
6741 string text = "";
6742 if (knowFav)
6743 {
6744 text += Environment.NewLine;
6745 text = text + "<size=14>" + "favgift".lang(GetFavCat().GetName().ToLower(), GetFavFood().GetName()) + "</size>";
6746 }
6747 string text2 = "";
6749 {
6750 text2 += Environment.NewLine;
6751 text2 = text2 + "Lv:" + base.LV + " HP:" + base.hp + "/" + MaxHP + " MP:" + mana.value + "/" + mana.max + " DV:" + DV + " PV:" + PV + " Hunger:" + hunger.value;
6752 text2 += Environment.NewLine;
6753 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");
6754 text2 += Environment.NewLine;
6755 text2 = text2 + base.uid + IsMinion + "/" + base.c_uidMaster + "/" + master;
6756 text2 = text2 + " dir:" + base.dir + " skin:" + base.idSkin + " scaled:" + base.isScaled;
6757 }
6759 {
6760 text2 += Environment.NewLine;
6761 text2 += "<size=14>";
6762 foreach (Hobby item in ListWorks())
6763 {
6764 text2 = text2 + item.Name + ", ";
6765 }
6766 foreach (Hobby item2 in ListHobbies())
6767 {
6768 text2 = text2 + item2.Name + ", ";
6769 }
6770 text2 = text2.TrimEnd(", ".ToCharArray()) + "</size>";
6771 }
6772 string text3 = "";
6773 IEnumerable<BaseStats> enumerable = conditions.Concat((!IsPCFaction) ? new BaseStats[0] : new BaseStats[2] { hunger, stamina });
6774 if (enumerable.Count() > 0)
6775 {
6776 text3 += Environment.NewLine;
6777 text3 += "<size=14>";
6778 int num = 0;
6779 foreach (BaseStats item3 in enumerable)
6780 {
6781 string text4 = item3.GetPhaseStr();
6782 if (text4.IsEmpty() || text4 == "#")
6783 {
6784 continue;
6785 }
6786 Color c = Color.white;
6787 switch (item3.source.group)
6788 {
6789 case "Bad":
6790 case "Debuff":
6791 case "Disease":
6793 break;
6794 case "Buff":
6796 break;
6797 }
6799 {
6800 text4 = text4 + "(" + item3.GetValue() + ")";
6801 if (resistCon != null && resistCon.ContainsKey(item3.id))
6802 {
6803 text4 = text4 + "{" + resistCon[item3.id] + "}";
6804 }
6805 }
6806 num++;
6807 text3 = text3 + text4.TagColor(c) + ", ";
6808 }
6809 if (num == 0)
6810 {
6811 text3 = "";
6812 }
6813 else
6814 {
6815 text = "";
6816 text3 = text3.TrimEnd(", ".ToCharArray()) + "</size>";
6817 }
6818 }
6820 {
6821 text3 += Environment.NewLine;
6822 foreach (ActList.Item item4 in ability.list.items)
6823 {
6824 text3 = text3 + item4.act.Name + ", ";
6825 }
6826 text3 = text3.TrimEnd(", ".ToCharArray());
6827 }
6828 return text + text2 + text3;
6829 }
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:7928
bool knowFav
Definition: Chara.cs:411
override string GetName(NameStyle style, int num=-1)
Definition: Chara.cs:1355
override int DV
Definition: Chara.cs:727
List< Hobby > ListHobbies(bool useMemberType=true)
Definition: Chara.cs:8810
override int PV
Definition: Chara.cs:756
SourceThing.Row GetFavFood()
Definition: Chara.cs:7908
List< Hobby > ListWorks(bool useMemberType=true)
Definition: Chara.cs:8783
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 8010 of file Chara.cs.

8011 {
8012 if (id == "olderyoungersister")
8013 {
8014 if (base.idSkin != 2)
8015 {
8016 return "UN_olderyoungersister";
8017 }
8018 return "UN_olderyoungersister_alt";
8019 }
8020 if (Portrait.allIds.Contains("UN_" + id + ".png"))
8021 {
8022 return "UN_" + id;
8023 }
8024 return base.c_idPortrait;
8025 }
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 7996 of file Chara.cs.

7997 {
7998 string text = race.id;
7999 if ((text == "mifu" || text == "nefu") && EClass.rnd(2) == 0)
8000 {
8001 return "foxfolk";
8002 }
8003 if (trait is TraitGuard)
8004 {
8005 return "guard";
8006 }
8007 return "";
8008 }

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

6926 {
6927 return GetSprite();
6928 }
override Sprite GetSprite(int dir=0)
Definition: Chara.cs:6595

◆ GetName()

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

Reimplemented from Card.

Definition at line 1355 of file Chara.cs.

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

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

7949 {
7950 using (List<Chara>.Enumerator enumerator = pos.ListCharasInRadius(this, 3, (Chara c) => c != this && c.race.id == "cat").GetEnumerator())
7951 {
7952 if (enumerator.MoveNext())
7953 {
7954 return enumerator.Current;
7955 }
7956 }
7957 return null;
7958 }
List< Chara > ListCharasInRadius(Chara cc, int dist, Func< Chara, bool > func, bool onlyVisible=true)
Definition: Point.cs:1208

References race.

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

◆ GetPietyValue()

int Chara.GetPietyValue ( )
inline

Definition at line 10003 of file Chara.cs.

10004 {
10005 if (base._IsPC)
10006 {
10007 return 10 + (int)(Mathf.Sqrt(base.c_daysWithGod) * 2f + (float)Evalue(85)) / 2;
10008 }
10009 return 10 + (int)(Mathf.Sqrt(base.LV) * 5f + (float)Evalue(306)) / 2;
10010 }

◆ GetRevived()

void Chara.GetRevived ( )
inline

Definition at line 5043 of file Chara.cs.

5044 {
5045 Revive(EClass.pc.pos.GetNearestPoint(allowBlock: false, allowChara: false), msg: true);
5046 if (!IsPCFaction)
5047 {
5048 return;
5049 }
5051 {
5052 if (homeZone != null && EClass._zone != homeZone)
5053 {
5054 Msg.Say("returnHome", this, homeZone.Name);
5056 }
5057 }
5058 else if (!EClass._zone.IsPCFaction || homeBranch != EClass.Branch || base.c_wasInPcParty)
5059 {
5060 EClass.pc.party.AddMemeber(this, showMsg: true);
5061 }
5062 }
static FactionBranch Branch
Definition: EClass.cs:22
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:607
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 8761 of file Chara.cs.

8762 {
8763 BaseArea result = null;
8764 foreach (Hobby item in ListWorks())
8765 {
8766 AIWork aI = item.GetAI(this);
8767 if (aI.SetDestination())
8768 {
8769 if (aI.destArea != null)
8770 {
8771 result = aI.destArea;
8772 }
8773 else if (aI.destThing != null)
8774 {
8775 result = aI.destThing.pos.cell.room;
8776 }
8777 break;
8778 }
8779 }
8780 return result;
8781 }
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 6595 of file Chara.cs.

6596 {
6597 if (IsPCC)
6598 {
6599 PCC pCC = PCC.Get(pccData);
6600 pCC.Build();
6601 return pCC.variation.idle[0, 0];
6602 }
6603 if (spriteReplacer != null)
6604 {
6605 return spriteReplacer.data.GetSprite();
6606 }
6607 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);
6608 }
SpriteReplacer spriteReplacer
Definition: Chara.cs:152
override CardRow sourceCard
Definition: Chara.cs:448
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 6619 of file Chara.cs.

6620 {
6621 if (IsPCC)
6622 {
6624 {
6626 }
6627 }
6628 else if (conSleep != null && host == null && pos.Equals(EClass.pc.pos) && IsHuman && (GetBool(123) || affinity.CanSleepBeside()))
6629 {
6630 return EClass.setting.pass.subDead;
6631 }
6632 return SubPassData.Default;
6633 }
bool GetBool(int id)
Definition: BaseCard.cs:15
ConSleep conSleep
Definition: Chara.cs:102
override bool IsDeadOrSleeping
Definition: Chara.cs:571
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 7152 of file Chara.cs.

7153 {
7154 return GetHappiness().ToString() ?? "";
7155 }
int GetHappiness()
Definition: Chara.cs:7142

◆ GetTextHobby()

string Chara.GetTextHobby ( bool  simple = false)
inline

Definition at line 8899 of file Chara.cs.

8900 {
8901 string text = (simple ? "" : ("hobby".lang() + ":"));
8902 foreach (Hobby item in ListHobbies())
8903 {
8904 text = text + " " + item.Name.TagColor((item.GetEfficiency(this) > 0) ? FontColor.Good : FontColor.Warning) + ",";
8905 }
8906 return text.TrimEnd(',');
8907 }

References item.

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

◆ GetTextWork()

string Chara.GetTextWork ( bool  simple = false)
inline

Definition at line 8909 of file Chara.cs.

8910 {
8911 string text = (simple ? "" : ("work".lang() + ":"));
8912 foreach (Hobby item in ListWorks())
8913 {
8914 text = text + " " + item.Name.TagColor((item.GetEfficiency(this) > 0) ? FontColor.Good : FontColor.Warning) + ",";
8915 }
8916 return text.TrimEnd(',');
8917 }

References item.

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

◆ GetTopicText()

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

Definition at line 6831 of file Chara.cs.

6832 {
6833 string key = source.idText.IsEmpty(id);
6834 if (id == "littleOne" && EClass._zone is Zone_LittleGarden)
6835 {
6836 key = "littleOne2";
6837 }
6838 SourceCharaText.Row row = EClass.sources.charaText.map.TryGetValue(key);
6839 if (row == null)
6840 {
6841 return null;
6842 }
6843 string text = row.GetText(topic, returnNull: true);
6844 if (text.IsEmpty())
6845 {
6846 return null;
6847 }
6848 if (text.StartsWith("@"))
6849 {
6850 row = EClass.sources.charaText.map.TryGetValue(text.Replace("@", ""));
6851 if (row == null)
6852 {
6853 return null;
6854 }
6855 text = row.GetText(topic, returnNull: true);
6856 if (text.IsEmpty())
6857 {
6858 return null;
6859 }
6860 }
6861 return text.Split(Environment.NewLine.ToCharArray()).RandomItem();
6862 }
SourceCharaText charaText

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

◆ GetTotalFeat()

int Chara.GetTotalFeat ( )
inline

Definition at line 7970 of file Chara.cs.

7971 {
7972 int num = 0;
7973 if (base.c_upgrades != null)
7974 {
7975 num += base.c_upgrades.spent;
7976 }
7977 if (base.c_genes != null)
7978 {
7979 num += base.c_genes.GetTotalCost();
7980 }
7981 return num + base.feat;
7982 }

◆ GetWork()

Hobby Chara.GetWork ( string  id)
inline

Definition at line 8830 of file Chara.cs.

8831 {
8832 foreach (Hobby item in ListWorks())
8833 {
8834 if (item.source.alias == id)
8835 {
8836 return item;
8837 }
8838 }
8839 foreach (Hobby item2 in ListHobbies())
8840 {
8841 if (item2.source.alias == id)
8842 {
8843 return item2;
8844 }
8845 }
8846 return null;
8847 }
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 8982 of file Chara.cs.

8983 {
8984 if (_workSummary == null)
8985 {
8986 _workSummary = new WorkSummary();
8987 }
8988 return _workSummary;
8989 }
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 8109 of file Chara.cs.

8110 {
8111 if (c.IsHostile() || c.IsDeadOrSleeping)
8112 {
8113 Msg.Say("affinityNone", c, this);
8114 return;
8115 }
8116 if (!t.isCopy && t.IsCursed && t.IsEquipmentOrRanged && !t.IsAmmo && c.HasElement(1414))
8117 {
8118 bool num = t.blessedState == BlessedState.Doomed;
8119 int num2 = 200 + t.LV * 3;
8120 if (t.rarity == Rarity.Legendary)
8121 {
8122 num2 *= 3;
8123 }
8124 if (t.rarity >= Rarity.Mythical)
8125 {
8126 num2 *= 5;
8127 }
8128 if (num)
8129 {
8130 num2 *= 2;
8131 }
8132 EClass.pc.PlayEffect("identify");
8133 EClass.pc.PlaySound("identify");
8134 c.PlayEffect("mutation");
8135 c.Say("draw_curse", c, t);
8136 t.Destroy();
8137 List<Element> list = new List<Element>();
8138 foreach (Element value in EClass.pc.elements.dict.Values)
8139 {
8140 if (value is Spell)
8141 {
8142 list.Add(value);
8143 }
8144 }
8145 if (list.Count == 0)
8146 {
8148 return;
8149 }
8150 Element element = list.RandomItem();
8151 EClass.pc.ModExp(element.id, num2);
8152 EClass.pc.Say("draw_curse2", EClass.pc, element.Name);
8153 c.AddExp(Mathf.Min(num2 / 3, c.ExpToNext));
8154 return;
8155 }
8156 if ((t.id == "lovepotion" || t.id == "dreambug") && !Application.isEditor)
8157 {
8158 GiveLovePotion(c, t);
8159 return;
8160 }
8161 if (t.trait is TraitErohon && c.id == t.c_idRefName)
8162 {
8163 c.OnGiveErohon(t);
8164 return;
8165 }
8166 if (t.trait is TraitTicketMassage)
8167 {
8168 t.ModNum(-1);
8169 c.Talk("ticket");
8170 switch (t.id)
8171 {
8172 case "ticket_massage":
8173 c.ModAffinity(EClass.pc, 10);
8175 {
8176 target = c
8177 });
8178 break;
8179 case "ticket_armpillow":
8180 c.ModAffinity(EClass.pc, 20);
8181 EClass.pc.AddCondition<ConSleep>(300, force: true);
8182 c.SetAI(new AI_ArmPillow
8183 {
8184 target = EClass.pc
8185 });
8186 break;
8187 case "ticket_champagne":
8188 c.ModAffinity(EClass.pc, 10);
8190 break;
8191 }
8192 return;
8193 }
8194 if (t.id == "flyer")
8195 {
8196 stamina.Mod(-1);
8197 if (c.things.Find((Thing a) => a.id == "flyer") != null)
8198 {
8199 c.Talk("flyer_miss");
8200 DoHostileAction(c);
8201 return;
8202 }
8203 if (EClass.rnd(20) != 0 && c.CHA > EClass.rnd(base.CHA + Evalue(291) * 3 + 10))
8204 {
8205 Msg.Say("affinityNone", c, this);
8206 t.Destroy();
8207 elements.ModExp(291, 10f);
8208 return;
8209 }
8210 elements.ModExp(291, 50f);
8211 }
8212 if (t.id == "statue_weird")
8213 {
8214 EClass.pc.Say("statue_sell");
8215 }
8216 t.isGifted = true;
8217 c.nextUse = c.affinity.OnGift(t);
8218 if (!t.isDestroyed)
8219 {
8220 EClass.game.quests.list.ForeachReverse(delegate(Quest q)
8221 {
8222 q.OnGiveItem(c, t);
8223 });
8224 if (c.TryEquip(t))
8225 {
8226 c.nextUse = null;
8227 }
8228 }
8229 }
Thing OnGift(Thing t)
Definition: Affinity.cs:129
int ExpToNext
Definition: Card.cs:1996
bool isCopy
Definition: Card.cs:878
bool IsCursed
Definition: Card.cs:2243
int CHA
Definition: Card.cs:2335
bool IsEquipmentOrRanged
Definition: Card.cs:2206
void SayNothingHappans()
Definition: Card.cs:6724
string c_idRefName
Definition: Card.cs:1641
void AddExp(int a)
Definition: Card.cs:2931
void GiveLovePotion(Chara c, Thing t)
Definition: Chara.cs:8242
bool TryEquip(Thing t, bool useFav=false)
Definition: Chara.cs:7599
void OnGiveErohon(Thing t)
Definition: Chara.cs:8231
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 8242 of file Chara.cs.

8243 {
8244 c.Say("give_love", c, t);
8245 c.PlaySound(t.material.GetSoundDead());
8246 c.ShowEmo(Emo.angry);
8247 c.ModAffinity(EClass.pc, -20, show: false);
8248 c.Talk("pervert");
8249 t.Destroy();
8250 }

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

6233 {
6234 if (enemy == null && !IsPC)
6235 {
6236 if (GetInt(106) == 0)
6237 {
6238 TalkTopic("aggro");
6239 }
6240 if (OriginalHostility != Hostility.Enemy)
6241 {
6242 ShowEmo(Emo.angry);
6243 }
6244 SetEnemy(_tg.Chara);
6245 }
6247 {
6248 if (hostility >= Hostility.Neutral)
6249 {
6250 Say("angry", this);
6251 }
6252 hostility = Hostility.Enemy;
6253 }
6254 }
int GetInt(int id, int? defaultInt=null)
Definition: BaseCard.cs:25
virtual bool IsPCFactionMinion
Definition: Card.cs:2143

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

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

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

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

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

9235 {
9236 for (int i = 0; i < conditions.Count; i++)
9237 {
9238 if (conditions[i] is T)
9239 {
9240 return true;
9241 }
9242 }
9243 return false;
9244 }

◆ HasCooldown()

bool Chara.HasCooldown ( int  idEle)
inline

Definition at line 8551 of file Chara.cs.

8552 {
8553 return GetCooldown(idEle) != 0;
8554 }
int GetCooldown(int idEle)
Definition: Chara.cs:8556

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

◆ HasHigherGround()

bool Chara.HasHigherGround ( Card  c)
inline

Definition at line 1188 of file Chara.cs.

1189 {
1190 if (c == null)
1191 {
1192 return false;
1193 }
1194 float num = renderer.position.y - pos.Position(0).y + (_isLevitating ? 0.4f : 0f);
1195 float num2 = c.renderer.position.y - c.pos.Position(0).y + ((c.isChara && c.Chara._isLevitating) ? 0.4f : 0f);
1196 return num > num2 + 0.1f;
1197 }
bool _isLevitating
Definition: Chara.cs:134
ref Vector3 Position(int height)
Definition: Point.cs:536

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

8681 {
8682 int num = EClass.sources.hobbies.alias.TryGetValue(alias)?.id ?? 0;
8683 listHobby.Clear();
8684 if (_works == null || _hobbies == null)
8685 {
8686 RerollHobby();
8687 }
8688 foreach (int work in _works)
8689 {
8690 if (work == num)
8691 {
8692 return true;
8693 }
8694 }
8695 foreach (int hobby in _hobbies)
8696 {
8697 if (hobby == num)
8698 {
8699 return true;
8700 }
8701 }
8702 return false;
8703 }
static List< Hobby > listHobby
Definition: Chara.cs:13
void RerollHobby(bool extraSlotChance=true)
Definition: Chara.cs:8943
SourceHobby hobbies

References SourceManager.hobbies, and EClass.sources.

Referenced by AI_Idle.Run().

◆ HasMinion()

bool Chara.HasMinion ( string  id)
inline

Definition at line 2336 of file Chara.cs.

2337 {
2338 foreach (Chara chara in EClass._map.charas)
2339 {
2340 if (chara.c_uidMaster == base.uid)
2341 {
2342 return true;
2343 }
2344 }
2345 return false;
2346 }

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

Referenced by ActEffect.ProcAt().

◆ HealAll()

void Chara.HealAll ( )
inline

Definition at line 1711 of file Chara.cs.

1712 {
1713 Cure(CureType.HealComplete);
1714 base.hp = MaxHP;
1715 mana.value = mana.max;
1716 stamina.value = stamina.max;
1717 Refresh();
1718 }
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 4407 of file Chara.cs.

4408 {
4409 if (held == t || t.isDestroyed || t.Num <= 0)
4410 {
4411 return;
4412 }
4413 if (IsPC && t.isNPCProperty)
4414 {
4415 t.isNPCProperty = false;
4417 pos.TryWitnessCrime(this);
4418 }
4419 PickHeld();
4420 if (t.isChara)
4421 {
4423 {
4424 t.ShowEmo(Emo.love);
4425 }
4426 EClass.player.altHeldPos = t.renderer.data.ForceAltHeldPosition || EClass.rnd(2) == 0;
4427 }
4428 else
4429 {
4430 if (num == -1 || num > t.Num)
4431 {
4432 num = t.Num;
4433 }
4434 if (num < t.Num)
4435 {
4436 t = t.Split(num);
4437 }
4438 }
4439 if (t.GetRootCard() != this)
4440 {
4441 t = Pick(t.Thing, msg: false, tryStack: false);
4442 if (t.GetRootCard() != this)
4443 {
4444 return;
4445 }
4446 }
4447 held = t;
4448 if (held.GetLightRadius() > 0)
4449 {
4451 }
4452 if (IsPC)
4453 {
4455 WidgetHotbar.dirtyCurrentItem = true;
4456 }
4457 }
Thing Split(int a)
Definition: Card.cs:3433
bool isNPCProperty
Definition: Card.cs:554
void RecalculateFOV()
Definition: Card.cs:6289
virtual bool IsAliveInCurrentZone
Definition: Card.cs:2115
int GetLightRadius()
Definition: Card.cs:6336
void PickHeld(bool msg=false)
Definition: Chara.cs:4459
bool TryWitnessCrime(Chara criminal, Chara target=null, int radius=4, Func< Chara, bool > funcWitness=null)
Definition: Point.cs:861

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

9067 {
9068 if (!onDeserialize)
9069 {
9070 _cints[10] = 20;
9071 _cints[11] = 70;
9072 _cints[13] = 70;
9073 _cints[14] = 70;
9074 _cints[15] = 70;
9075 _cints[17] = 0;
9076 _cints[18] = 0;
9077 }
9078 foreach (Condition condition in conditions)
9079 {
9080 condition.SetOwner(this, onDeserialize);
9081 }
9082 }
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 7445 of file Chara.cs.

7446 {
7447 if (t == null)
7448 {
7449 t = FindBestFoodToEat();
7450 }
7451 if (t == null)
7452 {
7453 t = things.Find((Thing a) => CanEat(a, shouldEat: true) && !a.c_isImportant);
7454 }
7455 if (t == null)
7456 {
7457 t = things.Find((Thing a) => CanEat(a) && !a.c_isImportant);
7458 }
7459 if (t != null)
7460 {
7461 Say("eat_start", this, t.Duplicate(1));
7462 if (sound)
7463 {
7464 PlaySound("eat");
7465 }
7466 FoodEffect.Proc(this, t);
7467 }
7468 }
Thing FindBestFoodToEat()
Definition: Chara.cs:7424
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 6486 of file Chara.cs.

6487 {
6488 if (faction == EClass.Home)
6489 {
6490 return homeZone == EClass.game.activeZone;
6491 }
6492 return false;
6493 }
Faction faction
Definition: Chara.cs:425
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 1175 of file Chara.cs.

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

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

2481 {
2482 if (!currentZone.IsRegion && p.IsValid)
2483 {
2484 CellDetail detail = p.detail;
2485 if (detail != null && detail.charas.Count > 0)
2486 {
2487 foreach (Chara chara in p.detail.charas)
2488 {
2489 if (chara.IsHostile(this) || chara.IsHostile() || !chara.trait.CanBePushed)
2490 {
2491 if (cancelAI && EClass.pc.ai is GoalManualMove)
2492 {
2493 EClass.pc.ai.Cancel();
2494 }
2495 return true;
2496 }
2497 }
2498 }
2499 }
2500 return false;
2501 }
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 2380 of file Chara.cs.

2381 {
2382 if (!IsPCPartyMinion)
2383 {
2384 return false;
2385 }
2386 foreach (Quest item in EClass.game.quests.list)
2387 {
2388 if (item is QuestEscort questEscort && questEscort.uidChara == base.uid)
2389 {
2390 return true;
2391 }
2392 }
2393 return false;
2394 }
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 6530 of file Chara.cs.

6531 {
6532 if (base.IsPCFactionOrMinion || IsFriendOrAbove())
6533 {
6535 {
6536 return true;
6537 }
6538 }
6539 else if (IsHostile() && c.IsHostile())
6540 {
6541 return true;
6542 }
6543 return false;
6544 }

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

◆ IsGuest()

◆ IsHomeMember()

◆ IsHostile() [1/2]

◆ IsHostile() [2/2]

bool Chara.IsHostile ( Chara  c)
inline

Definition at line 6438 of file Chara.cs.

6439 {
6440 if (c == null)
6441 {
6442 return false;
6443 }
6444 if (base.IsPCFactionOrMinion)
6445 {
6446 if ((c == EClass.pc.enemy && !c.IsPCFactionOrMinion) || c.hostility <= Hostility.Enemy)
6447 {
6448 return true;
6449 }
6450 }
6451 else
6452 {
6454 {
6455 return true;
6456 }
6457 if (OriginalHostility >= Hostility.Friend)
6458 {
6459 if (hostility <= Hostility.Enemy && c.IsPCFactionOrMinion)
6460 {
6461 return true;
6462 }
6463 if (c.hostility <= Hostility.Enemy && c.OriginalHostility == Hostility.Enemy)
6464 {
6465 return true;
6466 }
6467 }
6468 else if (OriginalHostility <= Hostility.Enemy && (c.IsPCFactionOrMinion || (c.OriginalHostility != Hostility.Enemy && c.hostility >= Hostility.Friend)))
6469 {
6470 return true;
6471 }
6472 }
6473 return false;
6474 }
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 6500 of file Chara.cs.

6501 {
6502 return EClass.game.activeZone == currentZone;
6503 }

Referenced by BaseListPeople.IsDisabled().

◆ IsInSpot< T >()

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

Definition at line 6505 of file Chara.cs.

6505 : TraitSpot
6506 {
6507 foreach (T item in EClass._map.props.installed.traits.List<T>())
6508 {
6509 foreach (Point item2 in item.ListPoints())
6510 {
6511 if (pos.Equals(item2))
6512 {
6513 return true;
6514 }
6515 }
6516 }
6517 return false;
6518 }
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 6476 of file Chara.cs.

6477 {
6478 return hostility == Hostility.Neutral;
6479 }

Referenced by ActPlan._Update().

◆ IsNeutralOrAbove()

bool Chara.IsNeutralOrAbove ( )
inline

◆ IsValidGiftWeight()

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

Definition at line 8053 of file Chara.cs.

8054 {
8055 int num2 = ((!HasElement(1411)) ? 1 : 3);
8056 if (GetBurden(t, num) >= num2)
8057 {
8058 return false;
8059 }
8060 return true;
8061 }
int GetBurden(Card t=null, int num=-1)
Definition: Chara.cs:1794

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

5701 {
5703 {
5704 return;
5705 }
5706 if (t.IsPC)
5707 {
5709 }
5710 if (t.host != null)
5711 {
5712 return;
5713 }
5714 if (t == this)
5715 {
5716 if (!ignoreSelf)
5717 {
5718 Debug.Log(t.pos.GetNearestPoint());
5719 if (TryMove(t.pos.GetNearestPoint()) != MoveResult.Success)
5720 {
5722 }
5723 }
5724 return;
5725 }
5726 if (show)
5727 {
5728 Say("kick", this, t);
5729 }
5730 PlaySound("kick");
5731 if ((t.conSuspend == null || t.conSuspend.uidMachine != 0) && t.trait.CanBePushed && (!t.IsHostile() || EClass.rnd(2) == 0) && !t.noMove && !t.isRestrained)
5732 {
5733 t.MoveByForce(t.pos.GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: true, ignoreCenter: true), this, checkWall && !t.pos.IsBlocked);
5734 }
5735 if (t.conSleep != null)
5736 {
5737 t.conSleep.Kill();
5738 }
5739 if (IsPC && t.IsFriendOrAbove() && !t.IsPCFactionOrMinion && karmaLoss)
5740 {
5742 }
5743 t.PlayEffect("kick");
5744 }
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:5758
ConSuspend conSuspend
Definition: Chara.cs:104
MoveResult TryMove(Point newPoint, bool allowDestroyPath=true)
Definition: Chara.cs:2704
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 5692 of file Chara.cs.

5693 {
5694 foreach (Chara item in p.ListCharas())
5695 {
5696 Kick(item, ignoreSelf, karmaLoss: true, show: true, checkWall);
5697 }
5698 }
List< Chara > ListCharas()
Definition: Point.cs:1159

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

9683 {
9684 List<Element> list = new List<Element>();
9685 foreach (SourceElement.Row item in EClass.sources.elements.rows.Where((SourceElement.Row a) => a.group == "FEAT" && a.cost[0] != -1 && !a.categorySub.IsEmpty()))
9686 {
9688 int num = ((feat.ValueWithoutLink <= 0) ? 1 : (feat.ValueWithoutLink + 1));
9689 if (num <= feat.source.max && !feat.HasTag("class") && !feat.HasTag("hidden") && !feat.HasTag("innate") && (!pet || !feat.HasTag("noPet")) && (showAll || feat.IsPurchaseFeatReqMet(elements)))
9690 {
9691 list.Add(Element.Create(feat.id, num) as Feat);
9692 }
9693 }
9694 return list;
9695 }
int feat
Definition: Card.cs:374
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1100
Definition: FEAT.cs:291

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

8811 {
8812 listHobby.Clear();
8813 if (!useMemberType || memberType != FactionMemberType.Livestock)
8814 {
8815 if (_hobbies == null)
8816 {
8817 RerollHobby();
8818 }
8819 foreach (int hobby in _hobbies)
8820 {
8821 listHobby.Add(new Hobby
8822 {
8823 id = hobby
8824 });
8825 }
8826 }
8827 return listHobby;
8828 }

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

8784 {
8785 listHobby.Clear();
8786 if (useMemberType && memberType == FactionMemberType.Livestock)
8787 {
8788 listHobby.Add(new Hobby
8789 {
8790 id = 45
8791 });
8792 }
8793 else
8794 {
8795 if (_works == null)
8796 {
8797 RerollHobby();
8798 }
8799 foreach (int work in _works)
8800 {
8801 listHobby.Add(new Hobby
8802 {
8803 id = work
8804 });
8805 }
8806 }
8807 return listHobby;
8808 }

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

3519 {
3520 angle = Util.GetAngle(p.x - pos.x, p.z - pos.z);
3521 if (EClass._zone.IsRegion)
3522 {
3523 if (angle > 100f && angle < 170f)
3524 {
3525 base.dir = 2;
3526 }
3527 else if (angle > 170f && angle < 190f)
3528 {
3529 base.dir = 0;
3530 }
3531 else if (angle > 190f || (angle < -10f && angle > -100f))
3532 {
3533 base.dir = 3;
3534 }
3535 else
3536 {
3537 base.dir = 1;
3538 }
3539 angle -= 45f;
3540 }
3541 else if (angle > 170f && angle < 235f)
3542 {
3543 base.dir = 0;
3544 }
3545 else if (angle > 80f && angle < 145f)
3546 {
3547 base.dir = 1;
3548 }
3549 else if (angle > -100f && angle < -35f)
3550 {
3551 base.dir = 3;
3552 }
3553 else if (angle > -10f && angle < 55f)
3554 {
3555 base.dir = 2;
3556 }
3558 }

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

◆ MakeAlly()

void Chara.MakeAlly ( bool  msg = true)
inline

Definition at line 2262 of file Chara.cs.

2263 {
2264 if (IsLocalChara && !base.IsUnique)
2265 {
2266 Debug.Log("Creating Replacement NPC for:" + this);
2268 }
2269 _MakeAlly();
2270 if (msg)
2271 {
2272 EClass.pc.Say("hire", this);
2273 EClass.Sound.Play("good");
2274 }
2275 EClass.pc.party.AddMemeber(this);
2276 if (EClass._zone.IsTown)
2277 {
2279 }
2280 }
Chara CreateReplacement()
Definition: Chara.cs:7887
void _MakeAlly()
Definition: Chara.cs:2282
virtual bool IsTown
Definition: Zone.cs:220
void RefreshListCitizen()
Definition: Zone.cs:3536

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

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

References DNA.GenerateGene().

Referenced by CoreDebug.UpdateInput().

◆ MakeGene()

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

Definition at line 8027 of file Chara.cs.

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

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

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

◆ MakeGrave()

void Chara.MakeGrave ( string  lastword)
inline

Definition at line 5150 of file Chara.cs.

5151 {
5152 if (!EClass._zone.IsRegion)
5153 {
5154 List<string> list = new List<string> { "930", "931", "947", "948", "949", "950", "951", "952" };
5155 if (IsPC && EClass.rnd(2) == 0 && EClass.pc.things.Find("letter_will") != null)
5156 {
5157 list = new List<string> { "944", "946", "backerGrave", "backerGrave2" };
5158 }
5159 Thing thing = ThingGen.Create(list.RandomItem());
5160 thing.MakeRefFrom(this);
5161 if (!lastword.IsEmpty())
5162 {
5163 thing.c_note = lastword;
5164 }
5165 thing.isModified = true;
5166 EClass._zone.AddCard(thing, pos).Install();
5167 }
5168 }
Card MakeRefFrom(string id)
Definition: Card.cs:5650

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

2326 {
2327 ReleaseMinion();
2328 Hostility hostility2 = (base.c_originalHostility = (_master.IsPCFaction ? Hostility.Ally : _master.hostility));
2329 this.hostility = hostility2;
2330 base.c_uidMaster = _master.uid;
2331 base.c_minionType = type;
2332 master = _master;
2333 Refresh();
2334 }
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 2256 of file Chara.cs.

2257 {
2258 _MakeAlly();
2259 EClass.pc.party.AddMemeber(this);
2260 }

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

7810 {
7811 if (c == this)
7812 {
7813 return;
7814 }
7815 if (IsPC)
7816 {
7817 c.ModAffinity(EClass.pc, a, show);
7818 }
7819 else
7820 {
7822 {
7823 return;
7824 }
7825 int num = StatsHygiene.GetAffinityMod(EClass.pc.hygiene.GetPhase()) + (HasElement(417) ? 30 : 0) + (EClass.pc.HasCondition<ConSmoking>() ? (-30) : 0);
7826 if (IsPCFaction && homeBranch != null)
7827 {
7828 num += (int)Mathf.Sqrt(homeBranch.Evalue(2117)) * 5;
7829 }
7830 bool flag = a > 0;
7831 if (flag)
7832 {
7833 a = a * num / 100;
7834 if (affinity.GetLunchChance() > EClass.rnd(100) && GetInt(71) >= 0 && GetInt(71) < EClass.world.date.GetRaw())
7835 {
7836 SetInt(71, -1);
7837 }
7838 }
7839 if (show)
7840 {
7841 if (a == 0)
7842 {
7843 if (!showOnlyEmo)
7844 {
7845 Say("affinityNone", this, c);
7846 }
7847 }
7848 else
7849 {
7850 ShowEmo((!flag) ? Emo.angry : Emo.love);
7851 c.ShowEmo(flag ? Emo.love : Emo.sad);
7852 if (!showOnlyEmo)
7853 {
7854 Say(flag ? "affinityPlus" : "affinityMinus", this, c);
7855 }
7856 }
7857 }
7858 if (c.IsPC)
7859 {
7860 a = affinity.Mod(a);
7861 }
7862 }
7863 }
int Mod(int a)
Definition: Affinity.cs:192
int GetLunchChance()
Definition: Affinity.cs:86
Stats hygiene
Definition: Chara.cs:1150
int GetRaw(int offsetHours=0)
Definition: Date.cs:322
int Evalue(int ele)
static int GetAffinityMod(int phase)
Definition: StatsHygiene.cs:19
virtual bool CanChangeAffinity
Definition: Trait.cs:558

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(), AI_Slaughter.Run(), and CoreDebug.UpdateInput().

◆ ModCorruption()

void Chara.ModCorruption ( int  a)
inline

Definition at line 9639 of file Chara.cs.

9640 {
9641 if (a > 0)
9642 {
9643 if (Evalue(962) >= 25 || (ResistLv(962) > 0 && EClass.rnd(ResistLv(962) + 1) != 0))
9644 {
9645 return;
9646 }
9647 int num = Evalue(412);
9648 if (num != 0)
9649 {
9650 float num2 = (float)a * 100f / (float)Mathf.Max(100 + num * 2, 10);
9651 a = (int)num2 + ((EClass.rndf(1f) < num2 % 1f) ? 1 : 0);
9652 }
9653 }
9654 if (a == 0)
9655 {
9656 return;
9657 }
9658 int num3 = (corruption + a) / 100 - corruption / 100;
9659 for (int i = 0; i < Mathf.Abs(num3); i++)
9660 {
9661 if (!MutateRandom((num3 > 0) ? 1 : (-1), 100, ether: true))
9662 {
9663 break;
9664 }
9665 }
9666 corruption += a;
9667 int num4 = 0;
9668 foreach (Element value in elements.dict.Values)
9669 {
9670 if (value.source.category == "ether")
9671 {
9672 num4 += value.Value;
9673 }
9674 }
9675 if (num4 > 0 && IsPC)
9676 {
9677 Tutorial.Reserve("ether");
9678 }
9679 corruption = num4 * 100 + corruption % 100;
9680 }
bool MutateRandom(int vec=0, int tries=100, bool ether=false, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:9802
static float rndf(float a)
Definition: EClass.cs:92

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

9589 {
9590 if (!HasElement(450))
9591 {
9592 long num = bio.height;
9593 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
9594 if (num < 1)
9595 {
9596 num = 1L;
9597 }
9598 if (num > 999999999)
9599 {
9600 num = 999999999L;
9601 }
9602 if (num != bio.height)
9603 {
9604 bio.height = (int)num;
9605 Say((a > 0) ? "height_gain" : "height_lose", this);
9606 }
9607 }
9608 }
int height
Definition: Biography.cs:53

◆ ModTempElement()

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

Definition at line 10055 of file Chara.cs.

10056 {
10057 if (a < 0 && !naturalDecay && HasElement(EClass.sources.elements.alias["sustain_" + EClass.sources.elements.map[ele].alias]?.id ?? 0))
10058 {
10059 return;
10060 }
10061 bool flag = HasElement(1215);
10062 if (tempElements == null)
10063 {
10065 tempElements.SetParent(this);
10066 }
10067 if (a > 0 && flag)
10068 {
10069 a = a * 150 / 100;
10070 }
10071 int num = elements.ValueWithoutLink(ele);
10072 int num2 = Mathf.Abs(num) + 100;
10073 int num3 = num2 / (flag ? 2 : 4);
10074 int num4 = -num - 100;
10075 int num5 = tempElements.Base(ele);
10076 int num6 = num5 + a;
10077 if (onlyRenew)
10078 {
10079 num3 = Mathf.Min(a, num3);
10080 num4 = Mathf.Max(a, -num2 / 3);
10081 }
10082 if (a > 0 && num6 > num3)
10083 {
10084 a = ((num3 > num5) ? (num3 - num5) : 0);
10085 }
10086 if (a < 0 && num6 < num4)
10087 {
10088 a = ((num4 < num5) ? (num4 - num5) : 0);
10089 }
10090 Element element = tempElements.ModBase(ele, a);
10091 if (element.vBase == 0)
10092 {
10093 tempElements.Remove(element.id);
10094 if (tempElements.dict.Count == 0)
10095 {
10096 tempElements = null;
10097 }
10098 }
10099 }
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 9610 of file Chara.cs.

9611 {
9612 if (HasElement(450) || a == 0)
9613 {
9614 return;
9615 }
9616 long num = bio.weight;
9617 long num2 = bio.height;
9618 long num3 = num2 * num2 * 18 / 25000;
9619 long num4 = num2 * num2 * 24 / 10000;
9620 if (ignoreLimit || (num > num3 && num < num4))
9621 {
9622 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
9623 if (num < 1)
9624 {
9625 num = 1L;
9626 }
9627 if (num > 999999999)
9628 {
9629 num = 999999999L;
9630 }
9631 if (num != bio.weight)
9632 {
9633 bio.weight = (int)num;
9634 Say((a > 0) ? "weight_gain" : "weight_lose", this);
9635 }
9636 }
9637 }
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 2594 of file Chara.cs.

2595 {
2596 if (!newPoint.sourceBlock.tileType.IsBlockPass && (!checkWall || (Dist(newPoint) <= 1 && CanMoveTo(newPoint, allowDestroyPath: false))) && _Move(newPoint, MoveType.Force) == MoveResult.Success && ai.Current.CancelWhenMoved)
2597 {
2598 ai.Current.TryCancel(c);
2599 }
2600 }
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:2728

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

3430 {
3431 MoveHome(EClass.game.world.FindZone(id), x, z);
3432 }
void MoveHome(string id, int x=-1, int z=-1)
Definition: Chara.cs:3429
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 3434 of file Chara.cs.

3435 {
3436 if (isDead)
3437 {
3438 Revive();
3439 }
3440 else
3441 {
3442 Cure(CureType.Death);
3443 }
3444 CureCondition<ConSuspend>();
3445 if (IsPCParty)
3446 {
3448 }
3449 FactionBranch factionBranch = homeBranch;
3450 if (x == -1)
3451 {
3452 x = 50;
3453 }
3454 if (z == -1)
3455 {
3456 z = 50;
3457 }
3458 Point point = new Point(x, z);
3459 if (zone.IsActiveZone)
3460 {
3461 point = point.GetNearestPoint(allowBlock: false, allowChara: false);
3462 }
3463 zone.AddCard(this, point);
3464 SetHomeZone(zone);
3465 global.transition = new ZoneTransition
3466 {
3467 state = ZoneTransition.EnterState.Dead,
3468 x = point.x,
3469 z = point.z
3470 };
3471 orgPos = new Point(x, z);
3472 if (factionBranch != null)
3473 {
3475 factionBranch.policies.Validate();
3476 }
3477 }
void RefreshWorkElements(ElementContainer parent=null)
Definition: Chara.cs:8849
Chara SetHomeZone(Zone zone)
Definition: Chara.cs:1425
PolicyManager policies
bool IsActiveZone
Definition: Zone.cs:492

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

2577 {
2578 List<Point> list = new List<Point>();
2579 pos.ForeachNeighbor(delegate(Point p)
2580 {
2581 list.Add(p.Copy());
2582 });
2583 list.Shuffle();
2584 foreach (Point item in list)
2585 {
2586 if (!item.Equals(pos) && !item.HasChara && TryMove(item) == MoveResult.Success)
2587 {
2588 return true;
2589 }
2590 }
2591 return false;
2592 }
void ForeachNeighbor(Action< Point > action, bool diagonal=true)
Definition: Point.cs:1385

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

Referenced by AI_Idle.Run().

◆ MoveRandom()

bool Chara.MoveRandom ( )
inline

Definition at line 2562 of file Chara.cs.

2563 {
2564 Point randomNeighbor = pos.GetRandomNeighbor();
2565 if (!randomNeighbor.Equals(pos) && !randomNeighbor.HasChara && HasAccess(randomNeighbor))
2566 {
2567 if ((race.tag.Contains("water") || source.tag.Contains("water")) && pos.cell.IsTopWaterAndNoSnow && !randomNeighbor.IsDeepWater)
2568 {
2569 return false;
2570 }
2571 return TryMove(randomNeighbor) == MoveResult.Success;
2572 }
2573 return false;
2574 }
bool IsTopWaterAndNoSnow
Definition: Cell.cs:712
bool IsDeepWater
Definition: Point.cs:264

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

3318 {
3319 if (z == currentZone)
3320 {
3321 return;
3322 }
3323 if (HasCondition<ConInvulnerable>())
3324 {
3325 RemoveCondition<ConInvulnerable>();
3326 }
3327 if (IsPC)
3328 {
3329 EClass.player.nextZone = z;
3331 {
3334 {
3335 if (EClass.player.returnInfo != null)
3336 {
3337 EClass.player.returnInfo.turns += 5;
3338 }
3340 {
3341 EClass.game.Save(isAutoSave: true);
3342 }
3343 }
3344 EClass.player.deathZoneMove = false;
3345 }
3347 if (currentZone.instance != null)
3348 {
3350 z = EClass.game.spatials.Find(instance.uidZone) ?? EClass.pc.homeZone;
3351 transition = new ZoneTransition
3352 {
3353 state = instance.ReturnState,
3354 x = instance.x,
3355 z = instance.z
3356 };
3357 instance.OnLeaveZone();
3358 Debug.Log(z);
3359 }
3360 EInput.Consume(consumeAxis: true);
3361 EClass.player.uidLastZone = currentZone.uid;
3363 {
3365 {
3366 Msg.Say("enterZone", z.Name);
3367 }
3368 else
3369 {
3370 if (z.IsRegion)
3371 {
3372 Msg.Say("leaveZone", currentZone.Name);
3373 }
3374 else if (z.id != currentZone.id)
3375 {
3376 Msg.Say("enterZone", z.Name);
3377 }
3378 EClass.player.lastZonePos = pos.Copy();
3379 }
3380 EClass.player.lastTransition = transition;
3381 }
3382 foreach (Chara item in EClass._map.charas.Where((Chara c) => c.IsPCPartyMinion && c.master != EClass.pc).ToList())
3383 {
3385 }
3386 EClass.player.listSummon = EClass._map.charas.Where((Chara c) => c.c_uidMaster != 0 && c.FindMaster() == EClass.pc && c.c_minionType == MinionType.Default).ToList();
3387 foreach (Chara item2 in EClass.player.listSummon)
3388 {
3389 EClass._zone.RemoveCard(item2);
3390 }
3391 }
3392 if (party != null && party.leader == this)
3393 {
3394 foreach (Chara member in party.members)
3395 {
3396 if (member != this && !member.isDead && member.parent is Zone)
3397 {
3398 member.MoveZone(z);
3399 }
3400 }
3401 }
3402 if (global == null)
3403 {
3404 Debug.Log(base.Name);
3405 return;
3406 }
3407 transition.uidLastZone = currentZone?.uid ?? 0;
3408 global.transition = transition;
3409 if (z.IsActiveZone)
3410 {
3411 Point spawnPos = z.GetSpawnPos(this);
3412 global.transition = null;
3413 if (IsPC)
3414 {
3415 EClass.player.lastTransition = null;
3416 }
3417 z.AddCard(this, spawnPos);
3418 if (IsBranchMember())
3419 {
3421 }
3422 }
3423 else
3424 {
3425 z.AddCard(this);
3426 }
3427 }
MinionType c_minionType
Definition: Card.cs:988
bool IsBranchMember()
Definition: Chara.cs:6486
GlobalData global
Definition: Chara.cs:76
Chara FindMaster()
Definition: Chara.cs:2371
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:260
Point GetSpawnPos(Chara c, ZoneTransition.EnterState destState=ZoneTransition.EnterState.Auto)
Definition: Zone.cs:1328

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

3310 {
3312 {
3313 state = state
3314 });
3315 }

◆ MutateRandom()

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

Definition at line 9802 of file Chara.cs.

9803 {
9804 if (!ether && vec >= 0 && HasElement(406) && EClass.rnd(5) != 0)
9805 {
9806 Say("resistMutation", this);
9807 return false;
9808 }
9809 IEnumerable<SourceElement.Row> ie = EClass.sources.elements.rows.Where((SourceElement.Row a) => a.category == (ether ? "ether" : "mutation") && !a.tag.Contains("noRandomMutation"));
9810 for (int i = 0; i < tries; i++)
9811 {
9812 SourceElement.Row row = ie.RandomItem();
9813 if (i == 0 && vec < 0 && ether && base.c_corruptionHistory != null && base.c_corruptionHistory.Count > 0)
9814 {
9815 row = EClass.sources.elements.map[base.c_corruptionHistory.LastItem()];
9816 base.c_corruptionHistory.RemoveAt(base.c_corruptionHistory.Count - 1);
9817 if (base.c_corruptionHistory.Count == 0)
9818 {
9819 base.c_corruptionHistory = null;
9820 }
9821 }
9822 Element element = elements.GetElement(row.id);
9823 int num = 1;
9824 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))
9825 {
9826 continue;
9827 }
9828 if (element == null && !row.aliasParent.IsEmpty() && elements.Has(row.aliasParent))
9829 {
9830 row = EClass.sources.elements.alias[row.aliasParent];
9831 element = elements.GetElement(row.id);
9832 }
9833 bool flag = row.tag.Contains("neg");
9834 if (vec > 0)
9835 {
9836 if ((state >= BlessedState.Blessed && flag) || (state <= BlessedState.Cursed && !flag))
9837 {
9838 continue;
9839 }
9840 }
9841 else if (vec < 0 && ((state >= BlessedState.Blessed && !flag) || (state <= BlessedState.Cursed && flag)))
9842 {
9843 continue;
9844 }
9845 bool flag2 = true;
9846 if (element != null)
9847 {
9848 num = element.Value + ((vec != 0) ? vec : ((EClass.rnd(2) == 0) ? 1 : (-1)));
9849 if (num > element.source.max)
9850 {
9851 num = element.source.max - 1;
9852 }
9853 flag = (flag && num > element.Value) || (!flag && num < element.Value);
9854 flag2 = num > element.Value;
9855 if (vec > 0 && !flag2)
9856 {
9857 continue;
9858 }
9859 }
9860 Say(flag2 ? "mutation_gain" : "mutation_loose", this);
9861 SetFeat(row.id, num);
9862 if (flag2 && ether)
9863 {
9864 if (base.c_corruptionHistory == null)
9865 {
9866 base.c_corruptionHistory = new List<int>();
9867 }
9868 base.c_corruptionHistory.Add(row.id);
9869 if (IsPCFaction)
9870 {
9871 Element element2 = elements.GetElement(row.id);
9872 WidgetPopText.Say("popEther".lang(element2.Name, base.Name));
9873 }
9875 {
9876 EClass.player.flags.gotEtherDisease = true;
9877 Thing thing = ThingGen.Create("parchment");
9878 thing.SetStr(53, "letter_ether");
9879 Thing thing2 = ThingGen.Create("1165");
9880 thing2.SetBlessedState(BlessedState.Normal);
9881 Thing p = ThingGen.CreateParcel(null, thing2, thing);
9883 }
9884 }
9885 if (EClass.core.IsGameStarted && pos != null)
9886 {
9887 PlaySound(ether ? "mutation_ether" : "mutation");
9888 PlayEffect("mutation");
9890 Say(row.GetText(flag ? "textDec" : "textInc", returnNull: true) ?? row.alias, this);
9891 }
9892 return true;
9893 }
9894 Say("nothingHappens");
9895 return false;
9896 }
void SetStr(int id, string value=null)
Definition: BaseCard.cs:63
virtual void SetBlessedState(BlessedState s)
Definition: Card.cs:3844
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 9948 of file Chara.cs.

9949 {
9950 if (_historyFood != null)
9951 {
9952 while (_historyFood.Count > 5)
9953 {
9954 _historyFood.RemoveAt(_historyFood.Count - 1);
9955 }
9956 if (_historyFood[0].Count > 0)
9957 {
9958 _historyFood.Insert(0, new List<string>());
9959 }
9960 }
9961 }

Referenced by GameDate.AdvanceDay().

◆ OnBanish()

void Chara.OnBanish ( )
inline

Definition at line 1439 of file Chara.cs.

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

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

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

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

8232 {
8233 Say("give_erohon", this);
8234 AddCondition<ConParalyze>(50, force: true);
8235 AddCondition<ConConfuse>(50, force: true);
8236 AddCondition<ConFear>(1000, force: true);
8237 ModAffinity(EClass.pc, 100);
8238 t.Destroy();
8239 Talk("pervert");
8240 }

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

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

◆ OnInsulted()

void Chara.OnInsulted ( )
inline

Definition at line 8037 of file Chara.cs.

8038 {
8039 if (!isDead)
8040 {
8041 if (HasElement(1231))
8042 {
8043 Talk("insulted");
8044 AddCondition<ConEuphoric>(100 * Evalue(1231));
8045 }
8046 else if (EClass.rnd(20) == 0)
8047 {
8048 SetFeat(1231, 1, msg: true);
8049 }
8050 }
8051 }

References EClass.rnd().

Referenced by DramaManager.ParseLine(), and AI_Idle.Run().

◆ OnSerializing()

override void Chara.OnSerializing ( )
inlineprotectedvirtual

Reimplemented from Card.

Definition at line 1310 of file Chara.cs.

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

Definition at line 9562 of file Chara.cs.

9563 {
9564 if (days < 1)
9565 {
9566 days = 1;
9567 }
9568 int num = power * days;
9569 if (stamina.value < 0)
9570 {
9571 stamina.Set(1);
9572 }
9573 HealHP(num);
9574 stamina.Mod(10 + 25 * num / 100 * (100 + elements.GetFeatRef(1642)) / 100);
9575 mana.Mod(num);
9576 if (IsPCFaction)
9577 {
9578 hunger.Mod(20);
9579 }
9580 sleepiness.Set(0);
9581 if (!IsMinion)
9582 {
9583 interest = 100;
9584 }
9585 Cure(CureType.Sleep, power);
9586 }
virtual void HealHP(int a, HealSource origin=HealSource.None)
Definition: Card.cs:3952
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 9547 of file Chara.cs.

9548 {
9549 TraitPillow traitPillow = pos.FindThing<TraitPillow>();
9550 int num = bed?.Power ?? 20;
9551 if (traitPillow != null)
9552 {
9553 num += traitPillow.owner.Power / 2;
9554 }
9555 if (bed != null)
9556 {
9557 num += bed.Evalue(750) * 5;
9558 }
9559 OnSleep(num, days);
9560 }
void OnSleep(Thing bed=null, int days=1)
Definition: Chara.cs:9547
Thing FindThing(Func< Thing, bool > func)
Definition: Point.cs:1128

References bed.

Referenced by LayerSleep.Advance().

◆ ParseBodySlot()

int Chara.ParseBodySlot ( string  s)
inlineprivate

Definition at line 2160 of file Chara.cs.

2161 {
2162 return s switch
2163 {
2164 "é ­" => 30,
2165 "首" => 31,
2166 "体" => 32,
2167 "背" => 33,
2168 "手" => 35,
2169 "指" => 36,
2170 "è…•" => 34,
2171 "è…°" => 37,
2172 "è¶³" => 39,
2173 _ => -1,
2174 };
2175 }

Referenced by ApplyRace(), and ResetBody().

◆ PerformWork()

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

Definition at line 9024 of file Chara.cs.

9025 {
9026 Hobby hobby = new Hobby();
9027 hobby.id = session.id;
9028 WorkSummary workSummary = _workSummary;
9029 hobby.GetAI(this).OnPerformWork(IsRealTime);
9030 if (!isHobby)
9031 {
9032 workSummary.progress += EClass.rnd(5) + 5;
9033 }
9034 int num = PerformWork(hobby, 0, isHobby);
9035 int num2 = PerformWork(hobby, 1, isHobby);
9036 int num3 = PerformWork(hobby, 2, isHobby);
9037 int num4 = PerformWork(hobby, 3, isHobby);
9038 workSummary.money += num;
9039 workSummary.food += num2;
9040 workSummary.knowledge += num3;
9041 workSummary.material += num4;
9042 int PerformWork(Hobby work, int idx, bool isHobby)
9043 {
9044 if (idx >= work.source.resources.Length)
9045 {
9046 return 0;
9047 }
9048 int num5 = work.source.resources[idx];
9049 int num6 = num5;
9050 num5 = Rand.Range(num5 * (100 - work.source.resources[idx]) / 100, num5);
9051 num5 = num5 * (isHobby ? 50 : 100) * session.efficiency / 10000;
9052 if (num6 > 0 && num5 <= 0)
9053 {
9054 num5 = 1;
9055 }
9056 return num5;
9057 }
9058 }
virtual void OnPerformWork(bool realtime)
Definition: AIWork.cs:150
void PerformWork(WorkSession session, bool isHobby=false, bool IsRealTime=false)
Definition: Chara.cs:9024
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 4243 of file Chara.cs.

4244 {
4245 if (t.trait is TraitCard && t.isNew && EClass.game.config.autoCollectCard && !t.c_idRefCard.IsEmpty())
4246 {
4248 return t;
4249 }
4250 if (t.parent == this)
4251 {
4252 return t;
4253 }
4254 t = TryPoisonPotion(t);
4255 ThingContainer.DestData dest = things.GetDest(t, tryStack);
4256 if (!dest.IsValid)
4257 {
4258 if (t.parent != EClass._zone)
4259 {
4260 if (IsPC)
4261 {
4262 Say("backpack_full_drop", t);
4263 SE.Drop();
4264 }
4265 return EClass._zone.AddCard(t, pos).Thing;
4266 }
4267 if (IsPC)
4268 {
4269 Say("backpack_full", t);
4270 }
4271 return t;
4272 }
4273 if (dest.stack != null)
4274 {
4275 if (msg)
4276 {
4277 PlaySound("pick_thing");
4278 Say("pick_thing", this, t);
4279 }
4280 t.TryStackTo(dest.stack);
4281 return dest.stack;
4282 }
4283 TryAbsorbRod(t);
4284 if (msg)
4285 {
4286 PlaySound("pick_thing");
4287 Say("pick_thing", this, t);
4288 }
4290 return dest.container.AddThing(t, tryStack);
4291 }
bool isNew
Definition: Card.cs:482
bool TryStackTo(Thing to)
Definition: Card.cs:3346
string c_idRefCard
Definition: Card.cs:1737
void TryReservePickupTutorial(Thing t)
Definition: Chara.cs:4337
Thing TryPoisonPotion(Thing t)
Definition: Chara.cs:4293
void TryAbsorbRod(Thing t)
Definition: Chara.cs:4307
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 4459 of file Chara.cs.

4460 {
4461 if (held == null)
4462 {
4463 return;
4464 }
4465 Card card = held;
4466 if (IsPC && held.invY == 1)
4467 {
4468 WidgetHotbar.dirtyCurrentItem = true;
4470 held = null;
4471 return;
4472 }
4473 if (held.isChara)
4474 {
4475 DropHeld();
4476 return;
4477 }
4479 {
4480 Say("canOnlyCarry", held);
4481 DropHeld();
4482 return;
4483 }
4484 bool flag = held != things.TryStack(held.Thing);
4485 if (!flag && things.IsOverflowing())
4486 {
4487 if (IsPC)
4488 {
4489 Say("backpack_full_drop", held);
4490 SE.Drop();
4491 }
4492 DropHeld();
4493 return;
4494 }
4495 if (msg)
4496 {
4497 PlaySound("pick_thing");
4498 Say("pick_held", this, card);
4499 if (IsPC && card.id == "statue_weird")
4500 {
4501 Say("statue_pick");
4502 }
4503 }
4504 if (IsPC)
4505 {
4506 WidgetHotbar.dirtyCurrentItem = true;
4507 if (!flag)
4508 {
4510 if (held.GetRootCard() != EClass.pc)
4511 {
4512 Pick(held.Thing, msg: false);
4513 }
4514 }
4515 }
4516 held = null;
4517 }
int invY
Definition: Card.cs:1943
bool IsHotItem
Definition: Card.cs:119
Card DropHeld(Point dropPos=null)
Definition: Chara.cs:4536
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 4223 of file Chara.cs.

4224 {
4225 if (num != 0)
4226 {
4227 PickOrDrop(p, ThingGen.Create(idThing, idMat).SetNum(num), msg);
4228 }
4229 }

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

4232 {
4233 if (things.GetDest(t).IsValid)
4234 {
4235 Pick(t, msg);
4236 }
4237 else
4238 {
4239 EClass._zone.AddCard(t, p);
4240 }
4241 }

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

◆ Refresh()

void Chara.Refresh ( bool  calledRecursive = false)
inline

Definition at line 1720 of file Chara.cs.

1721 {
1722 if (source == null)
1723 {
1724 Debug.LogError("source is null");
1725 SetSource();
1726 }
1727 if (ride != null && ride.source != null)
1728 {
1729 ride.Refresh(calledRecursive: true);
1730 }
1731 hasTelepathy = false;
1732 isWet = false;
1733 _isLevitating = HasElement(401) || (ride != null && ride._isLevitating);
1735 base.isHidden = HasElement(415);
1736 foreach (Condition condition in conditions)
1737 {
1738 condition.OnRefresh();
1739 }
1740 if (isWet)
1741 {
1742 base.isHidden = false;
1743 }
1745 SetDirtySpeed();
1746 if (host != null && !calledRecursive && host.source != null)
1747 {
1748 host.Refresh(calledRecursive: true);
1749 }
1750 }
virtual void OnRefresh()
void Refresh(bool calledRecursive=false)
Definition: Chara.cs:1720
bool isWet
Definition: Chara.cs:142
override void SetSource()
Definition: Chara.cs:2049
bool IsUndead
Definition: Chara.cs:889
bool IsHorror
Definition: Chara.cs:913
bool IsMachine
Definition: Chara.cs:901

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

10013 {
10014 if (faithElements != null)
10015 {
10017 }
10019 if (idFaith == "eyth" && !HasElement(1228))
10020 {
10021 return;
10022 }
10023 SourceReligion.Row row = EClass.sources.religions.map.TryGetValue(idFaith);
10024 if (row == null)
10025 {
10026 return;
10027 }
10029 if (!HasCondition<ConExcommunication>())
10030 {
10031 SourceElement.Row row2 = EClass.sources.elements.alias.TryGetValue("featGod_" + row.id + "1");
10032 if (row2 != null)
10033 {
10034 faithElements.SetBase(row2.id, 1);
10035 }
10036 int[] array = row.elements;
10037 int num = GetPietyValue() * (120 + Evalue(1407) * 15 + Evalue(1228) * 20) / 100;
10038 for (int i = 0; i < array.Length; i += 2)
10039 {
10040 int num2 = array[i + 1] * num / 50;
10041 if (array[i] == 79)
10042 {
10043 num2 = EClass.curve(num2, array[i + 1] * 2, 10, 50);
10044 }
10045 if (num2 >= 20 && array[i] >= 950 && array[i] < 970)
10046 {
10047 num2 = 20;
10048 }
10049 faithElements.SetBase(array[i], Mathf.Max(num2, 1));
10050 }
10051 }
10053 }
string idFaith
Definition: Chara.cs:229
ElementContainer faithElements
Definition: Chara.cs:38
int GetPietyValue()
Definition: Chara.cs:10003
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 1854 of file Chara.cs.

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

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

8850 {
8851 if (workElements != null)
8852 {
8854 }
8855 workElements = null;
8856 if (IsPCParty || homeBranch == null || homeBranch.owner == null)
8857 {
8858 return;
8859 }
8860 foreach (Hobby item in ListHobbies())
8861 {
8862 TryAdd(item);
8863 }
8864 foreach (Hobby item2 in ListWorks())
8865 {
8866 TryAdd(item2);
8867 }
8868 if (workElements != null)
8869 {
8871 }
8872 void TryAdd(Hobby h)
8873 {
8874 if (!h.source.elements.IsEmpty())
8875 {
8876 if (workElements == null)
8877 {
8879 }
8880 for (int i = 0; i < h.source.elements.Length; i += 2)
8881 {
8882 int num = h.source.elements[i];
8883 int num2 = h.source.elements[i + 1];
8884 int num3 = 100;
8885 if (num != 2115 && num != 2207)
8886 {
8887 num3 = h.GetEfficiency(this) * homeBranch.efficiency / 100;
8888 if (num3 <= 0)
8889 {
8890 continue;
8891 }
8892 }
8893 workElements.ModBase(num, (num2 < 0) ? (num2 / 10) : Mathf.Max(1, h.source.elements[i + 1] * num3 / 1000));
8894 }
8895 }
8896 }
8897 }
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 2348 of file Chara.cs.

2349 {
2350 base.c_uidMaster = 0;
2351 master = null;
2352 enemy = null;
2353 foreach (Chara chara in EClass._map.charas)
2354 {
2355 if (chara.enemy == this)
2356 {
2357 chara.SetEnemy();
2358 chara.ai.Cancel();
2359 }
2360 }
2361 ai.Cancel();
2362 Refresh();
2363 }

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

9453 {
9454 for (int num = conditions.Count - 1; num >= 0; num--)
9455 {
9456 Condition condition = conditions[num];
9457 if (condition.Type == ConditionType.Stance)
9458 {
9459 condition.Kill();
9460 }
9461 }
9462 }

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

◆ RemoveCondition< T >()

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

Definition at line 9313 of file Chara.cs.

9313 : Condition
9314 {
9315 for (int num = conditions.Count - 1; num >= 0; num--)
9316 {
9317 if (conditions[num] is T)
9318 {
9319 conditions[num].Kill();
9320 break;
9321 }
9322 }
9323 }

References Condition.Kill().

◆ RemoveGlobal()

void Chara.RemoveGlobal ( )
inline

Definition at line 1497 of file Chara.cs.

1498 {
1499 if (IsGlobal)
1500 {
1501 global = null;
1503 }
1504 }

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

2189 {
2190 if (body.slots.Count != 0)
2191 {
2192 BodySlot bodySlot = body.slots.LastItem();
2193 body.RemoveBodyPartAt(body.slots.Count - 1);
2194 if (msg)
2195 {
2196 Say("lose_bodyparts", this, Element.Get(bodySlot.elementId).GetName().ToLower());
2197 PlaySound("offering");
2198 }
2199 }
2200 }
int elementId
Definition: BodySlot.cs:6
void RemoveBodyPartAt(int idx)
Definition: CharaBody.cs:322

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

8253 {
8254 if (HasCondition<StanceTaunt>() || base.isRestrained || attacker == this)
8255 {
8256 return false;
8257 }
8258 if (host != null && host.isRestrained)
8259 {
8260 return false;
8261 }
8262 if (base.IsPCFactionOrMinion && attacker.IsPCFactionOrMinion)
8263 {
8264 return false;
8265 }
8266 bool flag = false;
8267 foreach (Chara chara in EClass._map.charas)
8268 {
8269 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))
8270 {
8271 continue;
8272 }
8273 bool flag2 = chara.HasElement(1225) && !chara.GetBool(126);
8274 if ((!flag2 && (flag || EClass.rnd(2) == 0 || !chara.HasCondition<StanceTaunt>())) || chara.HasCooldown(1225))
8275 {
8276 continue;
8277 }
8278 int num = Mathf.Max(chara.Evalue(1649), (!chara.IsPC) ? ((!flag2) ? 1 : 3) : 0);
8279 int num2 = Dist(chara);
8280 if (num2 > 25)
8281 {
8282 continue;
8283 }
8284 if (num2 > num || !chara.CanSeeLos(pos, num2))
8285 {
8286 if (!flag2)
8287 {
8288 continue;
8289 }
8290 Point nearestPoint = pos.GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: true, ignoreCenter: true);
8291 if (!nearestPoint.IsValid)
8292 {
8293 continue;
8294 }
8295 chara.Teleport(nearestPoint);
8296 chara.AddCooldown(1225, 10);
8297 num2 = Dist(chara);
8298 Say("intercept_loyal", chara, this);
8299 chara.SetEnemy(attacker);
8300 attacker.SetEnemy(chara);
8301 if (num2 > num || !chara.CanSeeLos(pos, num2))
8302 {
8303 continue;
8304 }
8305 }
8306 if (!flag && !HasElement(1225))
8307 {
8308 Say("intercept", chara, this);
8309 if (EClass.rnd(10) == 0)
8310 {
8311 chara.Talk("intercept", base.NameSimple);
8312 }
8313 if (attacker.enemy == this)
8314 {
8315 attacker.SetEnemy(chara);
8316 }
8317 action(chara);
8318 flag = true;
8319 }
8320 }
8321 return flag;
8322 }
void Teleport(Point point, bool silent=false, bool force=false)
Definition: Card.cs:5784
void AddCooldown(int idEle, int turns=0)
Definition: Chara.cs:8533
bool HasCooldown(int idEle)
Definition: Chara.cs:8551

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

8944 {
8945 if (_hobbies != null && _works != null)
8946 {
8947 _hobbies.Clear();
8948 _works.Clear();
8949 }
8950 else
8951 {
8952 _hobbies = new List<int>();
8953 _works = new List<int>();
8954 }
8955 if (source.hobbies.IsEmpty())
8956 {
8957 AddHobby(EClass.sources.hobbies.listHobbies.RandomItem().id);
8958 }
8959 else
8960 {
8961 string[] hobbies = source.hobbies;
8962 foreach (string key in hobbies)
8963 {
8964 AddHobby(EClass.sources.hobbies.alias[key].id);
8965 }
8966 }
8967 if (source.works.IsEmpty())
8968 {
8969 AddWork(EClass.sources.hobbies.listWorks.RandomItem().id);
8970 }
8971 else
8972 {
8973 string[] hobbies = source.works;
8974 foreach (string key2 in hobbies)
8975 {
8976 AddWork(EClass.sources.hobbies.alias[key2].id);
8977 }
8978 }
8980 }
WorkSummary GetWorkSummary()
Definition: Chara.cs:8982
void AddWork(int id)
Definition: Chara.cs:8931
void AddHobby(int id)
Definition: Chara.cs:8919
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 2202 of file Chara.cs.

2203 {
2204 for (int num = body.slots.Count - 1; num >= 0; num--)
2205 {
2206 BodySlot bodySlot = body.slots[num];
2207 if (bodySlot.elementId == 45 || bodySlot.elementId == 40)
2208 {
2209 return;
2210 }
2211 body.RemoveBodyPart(num);
2212 }
2213 string[] array = race.figure.Split('|');
2214 foreach (string s in array)
2215 {
2216 int num2 = ParseBodySlot(s);
2217 if (num2 != -1)
2218 {
2219 body.AddBodyPart(num2);
2220 }
2221 }
2223 }

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

◆ ResetUpgrade()

void Chara.ResetUpgrade ( )
inline

Definition at line 8418 of file Chara.cs.

8419 {
8420 _ = base.c_upgrades;
8421 }

Referenced by CoreDebug.ResetPetUpgrades().

◆ ResistCon()

void Chara.ResistCon ( Condition  con)
inline

Definition at line 9509 of file Chara.cs.

9510 {
9511 if (con.power > 0 && resistCon != null)
9512 {
9513 int a = ClassExtension.TryGetValue<int, int>((IDictionary<int, int>)resistCon, con.id, 0);
9514 if (1000 < EClass.rnd(a))
9515 {
9516 con.power = 0;
9517 }
9518 else if (500 < EClass.rnd(a))
9519 {
9520 con.power /= 5;
9521 }
9522 else if (200 < EClass.rnd(a))
9523 {
9524 con.power /= 3;
9525 }
9526 else if (100 < EClass.rnd(a))
9527 {
9528 con.power /= 2;
9529 }
9530 }
9531 }

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

◆ RestockEquip()

void Chara.RestockEquip ( bool  onCreate)
inline

Definition at line 4628 of file Chara.cs.

4629 {
4630 string equip = source.equip;
4631 if (equip.IsEmpty())
4632 {
4633 equip = job.equip;
4634 }
4635 if (equip == "none")
4636 {
4637 return;
4638 }
4639 bool flag = true;
4640 switch (id)
4641 {
4642 case "kettle":
4643 case "quru":
4644 case "loytel":
4645 case "shojo":
4646 EQ_ID("staff_long", 1);
4647 EQ_CAT("head");
4648 EQ_CAT("torso");
4649 EQ_CAT("arm");
4650 return;
4651 case "adv_yukiimo":
4652 if (onCreate)
4653 {
4654 EQ_ID("tail_snowleopard");
4655 }
4656 break;
4657 case "adv_kiria":
4658 if (onCreate)
4659 {
4660 EQ_ID("sword_zephir");
4661 }
4662 break;
4663 case "adv_mesherada":
4664 if (onCreate)
4665 {
4666 EQ_ID("dagger_hathaway");
4667 }
4668 break;
4669 case "adv_verna":
4670 if (onCreate)
4671 {
4672 EQ_ID("staff_long", -1, Rarity.Legendary);
4673 }
4674 if (onCreate)
4675 {
4676 EQ_ID("cloak_wing", -1, Rarity.Mythical);
4677 }
4678 break;
4679 case "big_sister":
4680 if (onCreate)
4681 {
4682 EQ_ID("sword_muramasa");
4683 }
4684 break;
4685 case "adv_gaki":
4686 if (onCreate)
4687 {
4688 EQ_ID("dagger_gaki");
4689 }
4690 if (onCreate)
4691 {
4692 EQ_ID("dagger_ninto");
4693 }
4694 break;
4695 case "adv_ivory":
4696 EQ_ID("dagger", -1, Rarity.Legendary);
4697 AddThing("60");
4698 break;
4699 case "adv_wini":
4700 if (onCreate)
4701 {
4702 EQ_ID("staff_Cat", -1, Rarity.Mythical);
4703 }
4705 if (onCreate)
4706 {
4707 AddThing("1071");
4708 }
4709 break;
4710 case "namamani":
4711 if (onCreate)
4712 {
4713 AddThing("gun_gravity2");
4714 }
4715 break;
4716 case "lomias":
4717 if (onCreate)
4718 {
4719 AddThing("bow_vindale");
4720 }
4721 break;
4722 case "larnneire":
4723 if (onCreate)
4724 {
4725 EQ_ID("EtherDagger2");
4726 }
4727 break;
4728 case "keeper_garden":
4729 if (!body.HasWeapon())
4730 {
4731 EQ_ID("sword_ragnarok");
4732 }
4733 break;
4734 case "ungaga_pap":
4735 if (onCreate)
4736 {
4737 EQ_ID("axe_destruction");
4738 }
4739 break;
4740 case "lurie_boss":
4741 if (onCreate)
4742 {
4743 EQ_ID("ribbon_duponne");
4744 }
4745 break;
4746 case "seeker":
4747 if (onCreate)
4748 {
4749 EQ_ID("helm_seeker");
4750 }
4751 EQ_ID("robe_pope");
4752 EQ_ID("sword_katana");
4753 EQ_ID("staff");
4754 EQ_ID("sword_katana");
4755 if (onCreate)
4756 {
4757 EQ_ID("boots_seven");
4758 }
4759 if (onCreate)
4760 {
4761 for (int i = 0; i < 20; i++)
4762 {
4764 }
4765 EQ_Item("panty");
4766 AddThing("plat").SetNum(6);
4767 }
4768 break;
4769 case "ephrond":
4770 if (onCreate)
4771 {
4772 AddThing("guitar_efrond");
4773 }
4774 break;
4775 case "ashland":
4776 if (onCreate)
4777 {
4778 AddThing("guitar_ash");
4779 }
4780 break;
4781 case "swordkeeper":
4782 if (onCreate)
4783 {
4784 EQ_ID("EtherDagger");
4785 }
4786 break;
4787 case "mech_angel":
4788 if (onCreate)
4789 {
4790 Thing thing = ThingGen.Create("pole_holy");
4791 thing.SetReplica(on: true);
4792 thing.rarity = Rarity.Normal;
4793 thing.elements.SetTo(60, -15);
4794 thing.elements.SetTo(418, -100);
4795 thing.elements.SetTo(93, 50);
4796 AddThing(thing);
4797 body.Equip(thing);
4798 flag = false;
4799 }
4800 break;
4801 }
4802 if (!TryEquipRanged())
4803 {
4804 switch (id)
4805 {
4806 case "tyche":
4807 case "trooper":
4808 case "mech_scarab":
4809 AddThing("gun_laser");
4810 break;
4811 case "rocketman":
4812 {
4813 Thing thing2 = AddThing("panzerfaust");
4814 thing2.ChangeMaterial("iron");
4815 thing2.c_ammo = 0;
4816 break;
4817 }
4818 default:
4819 switch (equip)
4820 {
4821 case "archer":
4822 EQ_CAT((EClass.rnd(4) == 0) ? "crossbow" : "bow");
4823 break;
4824 case "inquisitor":
4825 case "gunner":
4826 EQ_CAT("gun");
4827 break;
4828 }
4829 break;
4830 }
4831 }
4832 int num = ((base.rarity >= Rarity.Mythical) ? (base.LV * 3) : ((base.rarity >= Rarity.Legendary) ? (base.LV * 2) : base.LV));
4833 if (trait is TraitAdventurer)
4834 {
4835 num *= 3;
4836 }
4837 if (race.id == "asura")
4838 {
4839 for (int j = 0; j < 4; j++)
4840 {
4841 EQ_CAT(job.weapon.RandomItem());
4842 }
4843 }
4844 for (int k = 0; k < ((!(race.id == "mutant")) ? 1 : (2 + base.LV / 30)); k++)
4845 {
4846 if (flag)
4847 {
4848 if (source.ContainsTag("boxer"))
4849 {
4850 EQ_CAT("martial");
4851 }
4852 else if (!job.weapon.IsEmpty())
4853 {
4854 if (race.id == "mutant" || (body.slotMainHand != null && body.slotMainHand.thing == null))
4855 {
4856 EQ_CAT(job.weapon.RandomItem());
4857 }
4858 if (race.id == "mutant" || (Evalue(131) > 0 && EClass.rnd(2) == 0))
4859 {
4860 EQ_CAT(job.weapon.RandomItem());
4861 }
4862 }
4863 }
4864 EQ_CAT("torso");
4865 if (EClass.rnd(num) > 5)
4866 {
4867 EQ_CAT("arm");
4868 }
4869 if (EClass.rnd(num) > 10)
4870 {
4871 EQ_CAT("head");
4872 }
4873 if (EClass.rnd(num) > 15)
4874 {
4875 EQ_CAT("back");
4876 }
4877 if (EClass.rnd(num) > 20)
4878 {
4879 EQ_CAT("ring");
4880 }
4881 if (EClass.rnd(num) > 25)
4882 {
4883 EQ_CAT("amulet");
4884 }
4885 if (EClass.rnd(num) > 30)
4886 {
4887 EQ_CAT("foot");
4888 }
4889 if (EClass.rnd(num) > 35)
4890 {
4891 EQ_CAT("waist");
4892 }
4893 if (EClass.rnd(num) > 40)
4894 {
4895 EQ_CAT("ring");
4896 }
4897 }
4898 if (trait is TraitBard)
4899 {
4900 AddThing(ThingGen.Create("lute"));
4901 if (EClass.debug.enable || EClass.rnd(100) == 0)
4902 {
4903 EQ_ID("shield_lute");
4904 }
4905 }
4906 if (HasTag(CTAG.shield))
4907 {
4908 EQ_CAT("shield");
4909 }
4910 }
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
Definition: Card.cs:3022
Card AddCard(Card c)
Definition: Card.cs:3071
void SetReplica(bool on)
Definition: Card.cs:3056
bool HasWeapon()
Definition: CharaBody.cs:378
BodySlot slotMainHand
Definition: CharaBody.cs:10
void EQ_Item(string s, int num=1)
Definition: Chara.cs:5020
Thing EQ_ID(string s, int mat=-1, Rarity r=Rarity.Random)
Definition: Chara.cs:4984
bool TryEquipRanged()
Definition: Chara.cs:7719
void EQ_CAT(string s)
Definition: Chara.cs:5004
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 4912 of file Chara.cs.

4913 {
4914 switch (id)
4915 {
4916 case "lomias":
4917 if (ShouldRestock("_meat"))
4918 {
4919 AddCard(ThingGen.Create("_meat").MakeRefFrom("begger"));
4920 }
4921 break;
4922 case "fiama":
4923 Restock("book_story", 1);
4924 break;
4925 case "rock_thrower":
4926 Restock("stone", 10 + EClass.rnd(10));
4927 break;
4928 case "giant":
4929 Restock("rock", 2 + EClass.rnd(10));
4930 break;
4931 case "farris":
4932 Restock("lute", 1);
4933 Restock("book_story_home", 1);
4934 break;
4935 case "begger":
4936 break;
4937 }
4938 void Restock(string id, int num)
4939 {
4940 if (ShouldRestock(id))
4941 {
4942 AddCard(ThingGen.Create(id).SetNum(num));
4943 }
4944 }
4945 bool ShouldRestock(string id)
4946 {
4947 return things.Find(id) == null;
4948 }
4949 }

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

◆ Revive()

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

Definition at line 5064 of file Chara.cs.

5065 {
5066 if (!isDead)
5067 {
5068 return;
5069 }
5070 isDead = false;
5071 base.hp = MaxHP / 3;
5072 mana.value = 0;
5073 stamina.value = 0;
5074 if (hunger.value > 30)
5075 {
5076 hunger.value = 30;
5077 }
5078 sleepiness.value = 0;
5080 RemoveCondition<StanceTaunt>();
5081 if (id == "keeper_garden")
5082 {
5083 SaiyanRevive();
5084 }
5085 if (IsPC)
5086 {
5088 {
5089 Msg.Say("noDeathPenalty2", this);
5090 }
5092 {
5093 Msg.Say("noDeathPenalty", this);
5094 }
5095 else
5096 {
5098 }
5099 List<Thing> dropList = new List<Thing>();
5100 EClass.pc.things.Foreach(delegate(Thing t)
5101 {
5103 {
5104 t.ignoreAutoPick = true;
5105 dropList.Add(t);
5106 }
5107 }, onlyAccessible: false);
5108 foreach (Thing item in dropList)
5109 {
5111 Msg.Say("backpack_full_drop", item);
5112 }
5113 EClass.player.preventDeathPenalty = false;
5114 }
5115 if (IsPCFaction && homeBranch != null)
5116 {
5117 homeBranch.Log("bRevive", this);
5118 }
5119 if (p != null)
5120 {
5121 if (!p.IsInBounds)
5122 {
5124 }
5125 EClass._zone.AddCard(this, p);
5126 if (msg)
5127 {
5128 SE.Play("revive");
5129 Msg.Say("revive", this);
5130 PlayEffect("revive");
5131 }
5132 SetCensored(enable: false);
5133 }
5134 }
void SetCensored(bool enable)
Definition: Card.cs:7627
Card parentCard
Definition: Card.cs:103
void SaiyanRevive()
Definition: Chara.cs:5136
void ApplyDeathPenalty()
Definition: Chara.cs:5170
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 3499 of file Chara.cs.

3500 {
3501 if (renderer.hasActor)
3502 {
3503 base.dir = (base.dir + ((!reverse) ? 1 : (-1))).Clamp(0, 3, loop: true);
3504 }
3505 else
3506 {
3507 base.dir = ((base.dir == 0) ? 1 : 0);
3508 }
3509 UpdateAngle();
3511 }

Referenced by AI_Dance.Run().

◆ SaiyanRevive()

void Chara.SaiyanRevive ( )
inline

Definition at line 5136 of file Chara.cs.

5137 {
5138 ModCorruption(-100000);
5139 if (base.LV < 10000000)
5140 {
5141 SetLv(base.LV * 10 + 9);
5142 }
5143 Refresh();
5144 base.hp = MaxHP;
5145 mana.value = mana.max;
5146 stamina.value = stamina.max;
5147 bossText = true;
5148 }
void ModCorruption(int a)
Definition: Chara.cs:9639

References Stats.max, and Refresh().

◆ ScaleByPrincipal()

Chara Chara.ScaleByPrincipal ( )
inline

◆ SetAI()

AIAct Chara.SetAI ( AIAct  g)
inline

Definition at line 8719 of file Chara.cs.

8720 {
8721 if (IsPC)
8722 {
8724 }
8725 if (ai.IsRunning)
8726 {
8727 if (ai == g && ai.IsNoGoal)
8728 {
8729 return g;
8730 }
8731 ai.Cancel();
8732 if (ai == g)
8733 {
8734 Debug.Log("goal is g:" + ai?.ToString() + "/" + this);
8735 return g;
8736 }
8737 }
8738 if (HasCondition<ConWait>())
8739 {
8740 RemoveCondition<ConWait>();
8741 }
8742 ai = g;
8743 ai.SetOwner(this);
8744 if (IsPC)
8745 {
8747 }
8748 return g;
8749 }
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(), 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 8709 of file Chara.cs.

8710 {
8711 SetAI(new GoalCombat());
8712 }

Referenced by ZoneEventQuest.AggroEnemy().

◆ SetAIIdle()

void Chara.SetAIIdle ( )
inline

Definition at line 8705 of file Chara.cs.

8706 {
8707 }

◆ SetAIImmediate()

void Chara.SetAIImmediate ( AIAct  g)
inline

◆ SetDir()

override void Chara.SetDir ( int  d)
inlinevirtual

Reimplemented from Card.

Definition at line 3492 of file Chara.cs.

3493 {
3494 base.dir = d;
3495 UpdateAngle();
3497 }

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

◆ SetDirtySpeed()

void Chara.SetDirtySpeed ( )
inline

Definition at line 1845 of file Chara.cs.

1846 {
1847 dirtySpeed = true;
1848 if (host != null)
1849 {
1851 }
1852 }

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

6208 {
6209 enemy = c;
6210 if (c == null)
6211 {
6212 if (ai is GoalCombat)
6213 {
6214 ai.Cancel();
6215 }
6216 }
6217 else
6218 {
6219 calmCheckTurn = 10 + EClass.rnd(30);
6220 }
6221 return c;
6222 }

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

4952 {
4954 Rarity rarity = Rarity.Normal;
4955 int num = ((base.LV >= 1000) ? 7 : ((base.LV >= 500) ? 5 : ((base.LV >= 250) ? 3 : ((base.LV >= 100) ? 2 : ((base.LV >= 50) ? 1 : 0)))));
4956 Rarity rarity2 = base.rarity;
4957 if (id == "big_sister")
4958 {
4959 num = (isOnCreate ? 8 : 4);
4960 }
4961 if (!isOnCreate && EClass.rnd(10) != 0)
4962 {
4963 num /= 2;
4964 }
4965 if (rarity2 == Rarity.Superior && EClass.rnd(10) <= num)
4966 {
4967 rarity = Rarity.Superior;
4968 }
4969 else if (rarity2 == Rarity.Legendary)
4970 {
4971 rarity = ((EClass.rnd(10) <= num) ? Rarity.Legendary : ((EClass.rnd(5) <= num) ? Rarity.Superior : Rarity.Normal));
4972 }
4973 else if (rarity2 >= Rarity.Mythical)
4974 {
4975 rarity = ((EClass.rnd(30) <= num) ? Rarity.Mythical : ((EClass.rnd(10) > num) ? Rarity.Superior : Rarity.Legendary));
4976 }
4977 if (rarity == Rarity.Normal && EClass.rnd(1000) == 0)
4978 {
4979 rarity = Rarity.Legendary;
4980 }
4981 CardBlueprint.current.rarity = rarity;
4982 }
static void Set(CardBlueprint _bp=null)
static CardBlueprint CharaGenEQ
static bool isOnCreate
Definition: Chara.cs:182

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

◆ SetFaction()

Chara Chara.SetFaction ( Faction  f)
inline

Definition at line 1417 of file Chara.cs.

1418 {
1419 _faction = null;
1420 faction = f;
1422 return this;
1423 }
Faction _faction
Definition: Chara.cs:154
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 1705 of file Chara.cs.

1706 {
1707 faith = r;
1709 }

References faith, and RefreshFaithElement().

◆ SetFaith() [2/2]

void Chara.SetFaith ( string  id)
inline

Definition at line 1700 of file Chara.cs.

1701 {
1703 }
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 9697 of file Chara.cs.

9698 {
9699 Feat feat = elements.GetElement(id) as Feat;
9700 int num = 0;
9701 if (feat != null && feat.Value > 0)
9702 {
9703 if (value == feat.Value)
9704 {
9705 return;
9706 }
9707 num = feat.Value;
9708 feat.Apply(-feat.Value, elements);
9709 }
9710 if (value > 0)
9711 {
9712 feat = elements.SetBase(id, value - (feat?.vSource ?? 0)) as Feat;
9713 feat.Apply(feat.Value, elements);
9714 }
9715 else
9716 {
9717 elements.Remove(id);
9718 }
9720 {
9721 Refresh();
9723 }
9724 if (!msg)
9725 {
9726 return;
9727 }
9728 if (feat.source.textInc.IsEmpty())
9729 {
9730 PlaySound("ding_skill");
9732 Say("gainFeat", this, feat.FullName);
9733 }
9734 else
9735 {
9736 bool flag = value < num;
9737 if (feat.source.tag.Contains("neg"))
9738 {
9739 flag = !flag;
9740 }
9741 switch (id)
9742 {
9743 case 1270:
9744 if (!flag)
9745 {
9746 PlaySound("chime_angel");
9747 }
9748 break;
9749 case 1271:
9750 if (!flag)
9751 {
9752 PlaySound("chime_devil");
9753 }
9754 break;
9755 default:
9756 PlaySound("mutation");
9757 break;
9758 }
9760 Say((value > num) ? feat.source.GetText("textInc") : feat.source.GetText("textDec"), this, feat.FullName);
9761 }
9763 }
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 1484 of file Chara.cs.

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

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

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

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

1426 {
1427 homeZone = zone;
1428 SetGlobal();
1429 return this;
1430 }

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

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

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

◆ SetMainElement() [1/2]

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

Definition at line 2070 of file Chara.cs.

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

2062 {
2063 if (!id.StartsWith("ele"))
2064 {
2065 id = "ele" + id;
2066 }
2067 SetMainElement(EClass.sources.elements.alias[id].id, v, elemental);
2068 }

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

9766 {
9767 SourceElement.Row row = EClass.sources.elements.map[idEle];
9769 Element element = elements.GetElement(idEle);
9770 Element element2 = elements.GetElement(row2.id);
9771 int num = element?.Value ?? 0;
9772 if (a < 0)
9773 {
9774 a = 0;
9775 }
9776 if (a > row.max)
9777 {
9778 a = row.max;
9779 }
9780 bool flag = (row.tag.Contains("neg") ? (a > num) : (a < num));
9781 if (a == 0 && (element == null || element.Value == 0))
9782 {
9784 return;
9785 }
9786 if (element != null && element.Value == a)
9787 {
9789 return;
9790 }
9791 if (element2 != null && element2.Value > 0)
9792 {
9793 SetFeat(element2.id, 0);
9794 }
9795 SetFeat(idEle, a);
9796 PlaySound("mutation");
9797 PlayEffect("mutation");
9799 Say(row.GetText(flag ? "textDec" : "textInc", returnNull: true) ?? row.alias, this);
9800 }

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

8715 {
8716 return SetAI(_NoGoalPC);
8717 }
static NoGoal _NoGoalPC
Definition: Chara.cs:194

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

◆ SetPCCState()

void Chara.SetPCCState ( PCCState  state)
inline

Definition at line 6587 of file Chara.cs.

6588 {
6589 if (IsPCC)
6590 {
6591 PCC.Get(pccData).Build(state);
6592 }
6593 }

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

6636 {
6637 p.mat = base.material;
6638 p.matColor = base.colorInt;
6639 if (!renderer.usePass)
6640 {
6641 return;
6642 }
6643 if (renderer.replacer != null)
6644 {
6645 p.tile = renderer.replacer.tile * ((!flipX) ? 1 : (-1));
6646 }
6647 else if (source._tiles_snow.Length != 0 && EClass._zone.IsSnowCovered)
6648 {
6649 if (source._tiles_snow.Length > 1)
6650 {
6651 int num = ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % source._tiles_snow.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6652 p.tile = source._tiles_snow[(num < source._tiles_snow.Length) ? num : 0] * ((!flipX) ? 1 : (-1));
6653 }
6654 else
6655 {
6656 p.tile = source._tiles_snow[0] * ((!flipX) ? 1 : (-1));
6657 }
6658 }
6659 else if (sourceCard._tiles.Length > 1)
6660 {
6661 int num2 = ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % sourceCard._tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6662 p.tile = sourceCard._tiles[(num2 >= 0 && num2 < sourceCard._tiles.Length) ? num2 : 0] * ((!flipX) ? 1 : (-1));
6663 }
6664 else
6665 {
6666 p.tile = sourceCard._tiles[0] * ((!flipX) ? 1 : (-1));
6667 }
6668 p.dir = base.dir;
6669 }
override bool flipX
Definition: Chara.cs:545
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 7177 of file Chara.cs.

7178 {
7179 switch (m)
7180 {
7181 case UIList.SortMode.ByJob:
7182 sortVal = job._index * 10000 + sourceCard._index;
7183 break;
7184 case UIList.SortMode.ByRace:
7185 sortVal = race._index * 10000 * ((!IsHuman) ? 1 : (-1)) + sourceCard._index;
7186 break;
7187 case UIList.SortMode.ByFeat:
7188 sortVal = -GetTotalFeat();
7189 break;
7190 default:
7191 sortVal = sourceCard._index * ((!IsHuman) ? 1 : (-1));
7192 break;
7193 case UIList.SortMode.ByWorkk:
7194 break;
7195 }
7196 }
int sortVal
Definition: Card.cs:101
int GetTotalFeat()
Definition: Chara.cs:7970
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 2049 of file Chara.cs.

2050 {
2051 source = EClass.sources.charas.map.TryGetValue(id);
2052 if (source == null)
2053 {
2054 Debug.LogWarning("Chara " + id + " not found");
2055 id = "chicken";
2056 source = EClass.sources.charas.map[id];
2057 }
2058 path.walker = this;
2059 }

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

Referenced by Refresh().

◆ SetSummon()

void Chara.SetSummon ( int  duration)
inline

Definition at line 2365 of file Chara.cs.

2366 {
2367 base.c_summonDuration = duration;
2368 base.isSummon = true;
2369 }

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

7488 {
7489 if (t.IsRangedWeapon && t.category.slot == 0)
7490 {
7491 if (!CanEquipRanged(t))
7492 {
7493 return false;
7494 }
7495 int num = 0;
7496 foreach (Thing thing in things)
7497 {
7498 if (thing.IsRangedWeapon)
7499 {
7500 if (thing.category.slot != 0 && thing.isEquipped)
7501 {
7502 return false;
7503 }
7504 if (CanEquipRanged(thing) && thing.GetEquipValue() > num)
7505 {
7506 num = thing.GetEquipValue();
7507 }
7508 }
7509 }
7510 if (t.GetEquipValue() > num)
7511 {
7512 return true;
7513 }
7514 return false;
7515 }
7516 BodySlot bodySlot = body.GetSlot(t);
7517 if (bodySlot == null)
7518 {
7519 return false;
7520 }
7521 if (useFav)
7522 {
7523 switch (GetFavAttackStyle())
7524 {
7525 case AttackStyle.Default:
7526 case AttackStyle.TwoHand:
7527 if (t.IsMeleeWeapon)
7528 {
7529 bodySlot = body.slotMainHand;
7530 }
7531 else if (bodySlot.elementId == 35)
7532 {
7533 return false;
7534 }
7535 break;
7536 case AttackStyle.Shield:
7537 if (t.IsMeleeWeapon)
7538 {
7539 bodySlot = body.slotMainHand;
7540 }
7541 else if (bodySlot.elementId == 35 && t.IsMeleeWeapon)
7542 {
7543 return false;
7544 }
7545 break;
7546 case AttackStyle.TwoWield:
7547 if (bodySlot.elementId == 35 && !t.IsMeleeWeapon)
7548 {
7549 return false;
7550 }
7551 break;
7552 }
7553 }
7554 if (!body.IsEquippable(t, bodySlot, text: false))
7555 {
7556 return false;
7557 }
7558 if (bodySlot.thing != null && (bodySlot.thing.blessedState <= BlessedState.Cursed || bodySlot.thing.GetEquipValue() >= t.GetEquipValue()))
7559 {
7560 return false;
7561 }
7562 if (!base.IsPCFactionOrMinion)
7563 {
7564 int num2 = 0;
7565 foreach (Element value in t.elements.dict.Values)
7566 {
7567 if (value.Value <= 0)
7568 {
7569 int num3 = 100;
7570 switch (value.id)
7571 {
7572 case 418:
7573 num3 = 10;
7574 break;
7575 case 60:
7576 case 61:
7577 case 62:
7578 num3 = 200;
7579 break;
7580 case 962:
7581 num3 = 10000;
7582 break;
7583 }
7584 num2 += value.Value * num3 / 100;
7585 }
7586 }
7587 if (num2 < -40)
7588 {
7589 return false;
7590 }
7591 }
7592 if (t.HasTag(CTAG.gift))
7593 {
7594 return false;
7595 }
7596 return true;
7597 }
bool IsMeleeWeapon
Definition: Card.cs:2229
BlessedState blessedState
Definition: Card.cs:278
bool IsEquippable(Thing thing, BodySlot slot, bool text=true)
Definition: CharaBody.cs:106
AttackStyle GetFavAttackStyle()
Definition: Chara.cs:4584

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

8325 {
8326 if (IsPCFaction)
8327 {
8328 if (t.IsFood && t.category.id != "fish" && !t.IsDecayed)
8329 {
8330 return false;
8331 }
8332 if (t.trait.GetHealAction(this) != null)
8333 {
8334 return false;
8335 }
8336 if (t.IsThrownWeapon || t.IsRangedWeapon || t.IsAmmo)
8337 {
8338 return false;
8339 }
8340 if (t.trait is TraitBlanket || t.trait is TraitItemProc || t.trait is TraitBookSkill)
8341 {
8342 return false;
8343 }
8344 }
8345 if (t.isEquipped || t.rarity >= Rarity.Legendary || !t.trait.CanBeDestroyed)
8346 {
8347 return false;
8348 }
8349 if (t.trait is TraitCurrency || t.trait is TraitTool)
8350 {
8351 return false;
8352 }
8353 switch (type)
8354 {
8355 case ClearInventoryType.SellAtTown:
8356 if (!t.isGifted && !t.isNPCProperty)
8357 {
8358 return false;
8359 }
8360 break;
8361 case ClearInventoryType.Purge:
8362 switch (t.category.id)
8363 {
8364 case "fish":
8365 if (EClass.rnd(3) == 0)
8366 {
8367 return true;
8368 }
8369 break;
8370 case "junk":
8371 case "garbage":
8372 if (EClass.rnd(3) != 0)
8373 {
8374 return true;
8375 }
8376 break;
8377 }
8378 if (t.id == "flyer")
8379 {
8380 return true;
8381 }
8382 if (!t.IsDecayed && EClass.rnd(3) == 0)
8383 {
8384 return false;
8385 }
8386 if (!things.IsFull() && t.IsRangedWeapon)
8387 {
8388 return false;
8389 }
8390 break;
8391 }
8392 return true;
8393 }
bool IsThrownWeapon
Definition: Card.cs:2233
bool IsFood
Definition: Card.cs:2163
bool isGifted
Definition: Card.cs:782
virtual Action GetHealAction(Chara c)
Definition: Trait.cs:602

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

6936 {
6937 Zone_Nymelle zone_Nymelle = EClass._zone as Zone_Nymelle;
6938 if (conSuspend != null && IsPCParty)
6939 {
6940 RemoveCondition<ConSuspend>();
6941 }
6942 if (LayerDrama.forceJump == null)
6943 {
6944 if (IsDeadOrSleeping)
6945 {
6946 ShowDialog("_chara", "sleep");
6947 return;
6948 }
6949 if (EClass.pc.isHidden && !CanSee(EClass.pc))
6950 {
6951 ShowDialog("_chara", "invisible");
6952 return;
6953 }
6955 {
6957 ShowDialog("_chara", "give_card");
6958 Thing thing = ThingGen.Create("figure");
6959 thing.MakeFigureFrom(id);
6960 EClass.player.DropReward(thing);
6961 thing = ThingGen.Create("figure3");
6962 thing.MakeFigureFrom(id);
6963 EClass.player.DropReward(thing);
6964 return;
6965 }
6966 if (GetInt(71) == -2)
6967 {
6968 ShowDialog("_chara", "give_lunch");
6969 Thing t = CraftUtil.MakeLoveLunch(this);
6971 SetInt(71, EClass.world.date.GetRaw() + 43200);
6972 return;
6973 }
6974 if (base.isRestrained)
6975 {
6976 ShowDialog("_chara", "strain");
6977 return;
6978 }
6979 if (IsEscorted())
6980 {
6981 ShowDialog("_chara", "escort");
6982 return;
6983 }
6984 if (EClass._zone is Zone_Music)
6985 {
6986 ShowDialog("_chara", "party");
6987 return;
6988 }
6989 if (EClass.game.quests.OnShowDialog(this))
6990 {
6991 return;
6992 }
6993 switch (id)
6994 {
6995 case "loytel":
6996 {
6998 {
6999 EClass.game.quests.Get("pre_debt_runaway").Complete();
7000 EClass.player.flags.loytelEscaped = false;
7001 EClass.game.quests.Add("debt", "loytel");
7002 ShowDialog("loytel", "loytelEscaped");
7003 return;
7004 }
7005 QuestDebt questDebt = EClass.game.quests.Get<QuestDebt>();
7006 if (questDebt != null && questDebt.paid)
7007 {
7008 questDebt.stage++;
7009 if (questDebt.stage > 7)
7010 {
7011 questDebt.stage = 7;
7012 }
7013 ShowDialog("loytel", "debt" + questDebt.stage);
7014 return;
7015 }
7016 break;
7017 }
7018 case "farris":
7019 if (EClass._zone.id == "startVillage" || EClass._zone.id == "startVillage3" || EClass.game.IsSurvival)
7020 {
7021 ShowDialog("farris");
7022 return;
7023 }
7024 switch (EClass.game.quests.GetPhase<QuestExploration>())
7025 {
7026 case -1:
7027 ShowDialog("farris", "nymelle_noQuest");
7028 break;
7029 case 0:
7030 ShowDialog("farris", "nymelle_first");
7031 break;
7032 case 1:
7033 ShowDialog("farris", "home_first");
7034 break;
7035 default:
7036 ShowDialog("farris");
7037 break;
7038 }
7039 return;
7040 case "ashland":
7041 ShowDialog("ashland");
7042 return;
7043 case "fiama":
7044 if (zone_Nymelle != null && zone_Nymelle.IsCrystalLv && EClass.game.quests.GetPhase<QuestExploration>() == 3)
7045 {
7046 SoundManager.ForceBGM();
7047 LayerDrama.ActivateMain("mono", "nymelle_crystal");
7048 }
7050 {
7052 {
7053 EClass.player.flags.fiamaFirstDream = true;
7054 ShowDialog("fiama", "firstDream");
7055 }
7057 {
7058 ShowDialog("fiama", "giveStoryBook").SetOnKill(delegate
7059 {
7060 EClass.player.flags.fiamaStoryBookGiven = true;
7061 EClass.player.DropReward(ThingGen.Create("book_story"));
7062 });
7063 }
7064 else
7065 {
7066 ShowDialog("fiama");
7067 }
7068 }
7069 else
7070 {
7071 ShowDialog("fiama");
7072 }
7073 return;
7074 case "big_sister":
7076 {
7077 ShowDialog("big_sister", "little_saved");
7078 EClass.player.flags.little_saved = false;
7079 return;
7080 }
7082 {
7083 ShowDialog("big_sister", "little_dead");
7084 EClass.player.flags.little_killed = false;
7085 return;
7086 }
7087 break;
7088 }
7089 if (trait is TraitGuildDoorman)
7090 {
7091 string tag = ((trait is TraitDoorman_Fighter) ? "fighter" : ((trait is TraitDoorman_Mage) ? "mage" : "thief"));
7092 ShowDialog("guild_doorman", "main", tag);
7093 return;
7094 }
7095 if (trait is TraitGuildClerk)
7096 {
7097 string tag2 = ((trait is TraitClerk_Fighter) ? "fighter" : ((trait is TraitClerk_Mage) ? "mage" : "thief"));
7098 ShowDialog("guild_clerk", "main", tag2);
7099 return;
7100 }
7101 }
7102 bool flag = true;
7103 if (id == "parttimer_jure" && (!EClass._zone.IsFestival || !(EClass._zone is Zone_Noyel) || EClass.pc.faith == EClass.game.religions.Healing))
7104 {
7105 flag = false;
7106 }
7107 if (flag && File.Exists(CorePath.DramaData + id + ".xlsx"))
7108 {
7109 ShowDialog(id);
7110 }
7111 else
7112 {
7113 ShowDialog("_chara");
7114 }
7115 }
bool CanGiveCard()
Definition: Affinity.cs:63
void MakeFigureFrom(string id)
Definition: Card.cs:5645
void ShowDialog()
Definition: Chara.cs:6935
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:122
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:2530
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:206

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

7118 {
7119 return _ShowDialog(book, null, step, tag);
7120 }
LayerDrama _ShowDialog(string book, string sheet, string step="main", string tag="")
Definition: Chara.cs:7122

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

9534 {
9535 RemoveCondition<ConAwakening>();
9536 AddCondition(Condition.Create(100, delegate(ConSleep con)
9537 {
9538 con.pcSleep = 15;
9539 con.pcBed = bed;
9540 con.pcPillow = pillow;
9541 con.pickup = pickup;
9542 con.posBed = posBed;
9543 con.posPillow = posPillow;
9544 }), force: true);
9545 }

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

7961 {
7962 Say("abCatSniff", this, c);
7963 AddCondition<ConHOT>(EClass.curve(50 + c.CHA * 5, 400, 100));
7964 c.ShowEmo(Emo.angry);
7965 ShowEmo(Emo.love);
7966 Talk("sniff");
7967 c.Talk(new string[4] { "labor", "disgust", "scold", "callGuards" }.RandomItem());
7968 }

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

4520 {
4521 return held.Split(a);
4522 }

References Card.Split().

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

◆ Stumble()

void Chara.Stumble ( int  mtp = 100)
inline

Definition at line 1828 of file Chara.cs.

1829 {
1830 bool flag = EClass._map.FindThing((Thing t) => t.IsInstalled && t.pos.Equals(EClass.pc.pos) && t.trait is TraitStairsUp) != null;
1831 Say(flag ? "dmgBurdenStairs" : "dmgBurdenFallDown", this);
1832 int num = MaxHP;
1833 if (Evalue(1421) > 0)
1834 {
1835 num = mana.max;
1836 }
1837 int num2 = (num * (base.ChildrenWeight * 100 / WeightLimit) / (flag ? 100 : 200) + 1) * mtp / 100;
1838 if (base.hp <= 0)
1839 {
1840 num2 *= 2;
1841 }
1842 DamageHP(num2, flag ? AttackSource.BurdenStairs : AttackSource.BurdenFallDown);
1843 }
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 3865 of file Chara.cs.

3866 {
3867 if (host != null)
3868 {
3869 host.SyncRide();
3870 }
3871 if (ride != null)
3872 {
3873 SyncRide(ride);
3874 }
3875 if (parasite != null)
3876 {
3878 }
3879 }

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

3882 {
3883 if (!c.pos.Equals(pos))
3884 {
3885 if (!pos.IsValid)
3886 {
3887 Debug.LogError("exception: pos is not valid:" + pos?.ToString() + "/" + this);
3888 pos = new Point();
3889 }
3890 EClass._map.MoveCard(pos, c);
3891 }
3892 }

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

◆ TalkTopic()

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

Definition at line 6864 of file Chara.cs.

6865 {
6866 if (host == null && !IsInActiveZone)
6867 {
6868 return null;
6869 }
6870 if (!isSynced && (host == null || !host.isSynced) && topic != "dead")
6871 {
6872 return null;
6873 }
6874 if (IsPCParty)
6875 {
6876 int num = EClass.pc.party.members.Count - 1;
6877 switch (topic)
6878 {
6879 case "calm":
6880 if (EClass.rnd(num * 5) != 0)
6881 {
6882 return null;
6883 }
6884 break;
6885 case "aggro":
6886 if (EClass.rnd(num * 10) != 0)
6887 {
6888 return null;
6889 }
6890 break;
6891 case "kill":
6892 if (EClass.rnd(num * 3) != 0)
6893 {
6894 return null;
6895 }
6896 break;
6897 case "fov":
6898 return null;
6899 }
6900 }
6901 string topicText = GetTopicText(topic);
6902 if (topicText.IsEmpty())
6903 {
6904 return null;
6905 }
6906 string text = "_bracketTalk".lang();
6907 bool flag = topicText.StartsWith("*");
6908 bool flag2 = topicText.StartsWith("(");
6909 bool flag3 = topicText.StartsWith(text) || (topicText.Length > 0 && topicText[0] == text[0]) || topicText[0] == '“';
6910 topicText = ApplyTone(topicText);
6911 topicText = topicText.Replace("~", "*");
6912 Msg.SetColor(flag2 ? Msg.colors.Thinking : (flag3 ? Msg.colors.Talk : Msg.colors.Ono));
6913 Msg.Say(topicText.Replace("&", ""));
6914 if (topic == "dead")
6915 {
6916 EClass.ui.popGame.PopText(ApplyNewLine(topicText.StripBrackets()), null, "PopTextDead", default(Color), pos.Position() + EClass.setting.render.tc.textPosDead);
6917 }
6918 else if (flag || flag3 || flag2)
6919 {
6920 (host ?? this).renderer.Say(ApplyNewLine(topicText.StripBrackets()), default(Color), IsPCParty ? 0.6f : 0f);
6921 }
6922 return topicText;
6923 }
void Say(string text, Color c=default(Color), float duration=0f)
string ApplyNewLine(string text)
Definition: Card.cs:6696
string ApplyTone(string text, bool stripPun=false)
Definition: Card.cs:6775
string GetTopicText(string topic="calm")
Definition: Chara.cs:6831
static UI ui
Definition: EClass.cs:16
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 3894 of file Chara.cs.

3895 {
3896 SyncRide();
3897 combatCount--;
3898 ignoreSPAbsorb = false;
3899 if (IsPC)
3900 {
3901 if (hasMovedThisTurn)
3902 {
3903 pos.Things.ForeachReverse(delegate(Thing t)
3904 {
3906 {
3907 AI_Goto aI_Goto = ai.Current as AI_Goto;
3908 if ((aI_Goto == null && !(ai is GoalManualMove)) || (aI_Goto != null && !aI_Goto.dest.Equals(pos)))
3909 {
3910 return;
3911 }
3912 }
3913 t.trait.OnStepped(this);
3914 });
3915 if (isDead)
3916 {
3917 return;
3918 }
3919 hasMovedThisTurn = false;
3921 {
3922 EClass.player.haltMove = false;
3923 ActionMode.Adv.TryCancelInteraction(sound: false);
3924 EInput.Consume(1);
3925 return;
3926 }
3927 if (EClass._zone.IsRegion)
3928 {
3930 {
3931 foreach (Chara member in EClass.pc.party.members)
3932 {
3933 if (member.hunger.value > 65)
3934 {
3935 member.InstantEat(null, sound: false);
3936 }
3937 }
3938 }
3939 Chara chara = null;
3941 if (cell2 != null && (cell2.zone == null || (cell2.zone is Zone_Field && !cell2.zone.IsPCFaction)))
3942 {
3943 foreach (Chara chara2 in EClass._map.charas)
3944 {
3945 if (!chara2.IsPCFactionOrMinion && !chara2.IsGlobal && chara2.pos.Equals(EClass.pc.pos))
3946 {
3947 chara = chara2;
3948 break;
3949 }
3950 }
3951 }
3952 if (chara != null)
3953 {
3955 {
3956 EClass.player.safeTravel = 5 + EClass.rnd(5);
3957 }
3958 EClass._zone.RemoveCard(chara);
3959 Msg.Say("encounter");
3960 EClass.player.EnterLocalZone(encounter: true, chara);
3961 }
3962 else if (EClass.player.safeTravel <= 0)
3963 {
3964 if (cell2 != null && cell2.zone == null && !EClass.debug.ignoreEncounter)
3965 {
3967 if (!tileInfo.shore)
3968 {
3969 bool num = EClass.pc.HasCondition<ConWardMonster>();
3970 bool flag = EClass.pc.HasCondition<ConDrawMonster>();
3971 bool flag2 = EClass.game.quests.Get<QuestEscort>() != null;
3972 int num2 = (tileInfo.isRoad ? 22 : 12);
3973 if (flag2)
3974 {
3975 num2 = (tileInfo.isRoad ? 16 : 10);
3976 }
3977 if (num)
3978 {
3979 num2 *= (flag2 ? 2 : 20);
3980 }
3981 if (flag)
3982 {
3983 num2 /= 2;
3984 }
3985 if (EClass.rnd(num2) == 0)
3986 {
3987 Msg.Say("encounter");
3988 if (!flag)
3989 {
3990 EClass.player.safeTravel = 5 + EClass.rnd(5);
3991 }
3992 EClass.player.EnterLocalZone(encounter: true);
3993 }
3994 }
3995 }
3996 }
3997 else
3998 {
4000 }
4001 }
4002 }
4003 EClass.player.pickupDelay = 0f;
4004 if (EClass.player.returnInfo != null)
4005 {
4007 if (EClass.player.returnInfo.turns <= 0)
4008 {
4010 {
4011 EClass.player.returnInfo = null;
4013 }
4014 else
4015 {
4017 {
4018 int uidDest = EClass.player.returnInfo.uidDest;
4019 Zone zone = null;
4020 if (uidDest != 0)
4021 {
4022 zone = EClass.game.spatials.map.TryGetValue(uidDest) as Zone;
4023 }
4024 if (zone == null || zone.destryoed)
4025 {
4026 zone = EClass.world.region;
4027 }
4029 {
4030 Msg.Say("returnFail");
4031 }
4032 else
4033 {
4034 Msg.Say("returnComplete");
4035 EClass.player.uidLastTravelZone = 0;
4037 EClass.player.lastZonePos = null;
4038 }
4039 EClass.player.returnInfo = null;
4040 return;
4041 }
4042 EClass.player.returnInfo = null;
4043 Msg.Say("returnOverweight");
4044 }
4045 }
4046 }
4047 if ((HasNoGoal || !ai.IsRunning) && !WillConsumeTurn())
4048 {
4050 return;
4051 }
4054 {
4055 RecipeUpdater.dirty = true;
4056 }
4058 }
4059 else
4060 {
4061 actTime = EClass.player.baseActTime * Mathf.Max(0.1f, (float)EClass.pc.Speed / (float)Speed);
4062 hasMovedThisTurn = false;
4063 }
4066 {
4067 return;
4068 }
4070 if (host != null && !consumeTurn)
4071 {
4072 if (host.ride == this && ((host.hasMovedThisTurn && IsInCombat) || (enemy != null && turn % 3 != 0)))
4073 {
4074 consumeTurn = true;
4075 }
4076 if (host.parasite == this && enemy != null && EClass.rnd(10) > EClass.rnd(host.Evalue(227) + 10))
4077 {
4078 if (Dist(enemy) < 3 && EClass.rnd(2) == 0)
4079 {
4080 Say("parasite_fail", this, host);
4081 if (EClass.rnd(2) == 0 && GetInt(106) == 0)
4082 {
4083 Talk("parasite_fail");
4084 }
4085 }
4086 consumeTurn = true;
4087 }
4088 }
4089 if (consumeTurn)
4090 {
4091 if (IsPC)
4092 {
4094 }
4095 }
4096 else
4097 {
4098 if (base.isRestrained)
4099 {
4100 TryUnrestrain();
4101 }
4102 if (enemy != null)
4103 {
4105 {
4106 enemy = null;
4107 }
4108 else if (!IsPC && (ai.CancelOnAggro || !ai.IsRunning))
4109 {
4110 SetAIAggro();
4111 }
4112 }
4113 if (HasNoGoal || !ai.IsRunning)
4114 {
4115 ChooseNewGoal();
4116 }
4117 ai.Tick();
4118 }
4119 Cell cell = base.Cell;
4121 {
4122 AddCondition<ConWet>(50);
4123 if (pos.IsHotSpring)
4124 {
4125 hygiene.Mod(2);
4126 }
4127 }
4128 if (IsPC && !EClass._zone.IsRegion && cell.CanSuffocate() && !EClass.debug.godMode)
4129 {
4130 AddCondition<ConSuffocation>(800 / (100 + EvalueMax(200, -5) * 10), force: true);
4131 }
4132 CellEffect e;
4133 if (cell.effect != null)
4134 {
4135 e = cell.effect;
4136 switch (e.id)
4137 {
4138 case 1:
4139 case 2:
4140 case 4:
4141 if (IsLevitating)
4142 {
4143 Say("levitating");
4144 break;
4145 }
4146 AddCondition<ConWet>(50);
4147 ProcEffect();
4148 break;
4149 case 3:
4150 PlaySound("fire_step");
4151 AddCondition<ConBurning>(30);
4152 break;
4153 case 5:
4154 if (!isWet)
4155 {
4156 PlaySound("bubble");
4157 AddCondition<ConWet>(30);
4158 ProcEffect();
4159 }
4160 break;
4161 case 6:
4162 if (hasMovedThisTurn)
4163 {
4164 Say("abMistOfDarkness_step", this);
4165 }
4166 break;
4167 }
4168 }
4169 if (IsPC)
4170 {
4171 if (EClass.player.currentHotItem.Thing != null)
4172 {
4174 }
4176 }
4177 void ClearEffect()
4178 {
4179 EClass._map.SetLiquid(cell.x, cell.z, 0, 0);
4180 }
4181 void ProcEffect()
4182 {
4183 if (e.idEffect != 0)
4184 {
4185 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
4186 {
4187 aliasEle = EClass.sources.elements.map[e.idEle].alias,
4188 n1 = e.n1
4189 });
4190 ClearEffect();
4191 }
4192 }
4193 }
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:7009
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:7445
int Speed
Definition: Chara.cs:1081
static bool consumeTurn
Definition: Chara.cs:178
void SetAIAggro()
Definition: Chara.cs:8709
bool ignoreSPAbsorb
Definition: Chara.cs:146
void ChooseNewGoal()
Definition: Chara.cs:8590
bool WillConsumeTurn()
Definition: Chara.cs:3637
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:1929
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:363
bool destryoed
Definition: Spatial.cs:45
virtual void OnTickHeld()
Definition: Trait.cs:1049
virtual bool IgnoreOnSteppedWhenMoving
Definition: Trait.cs:370
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 3649 of file Chara.cs.

3650 {
3651 if (_cooldowns != null)
3652 {
3653 TickCooldown();
3654 }
3655 turn++;
3656 consumeTurn = false;
3657 preventRegen = false;
3658 emoIcon = Emo2.none;
3659 if (base.isSummon)
3660 {
3661 base.c_summonDuration--;
3662 if (base.c_summonDuration <= 0)
3663 {
3664 Die();
3665 return;
3666 }
3667 }
3669 {
3670 AddCondition<ConWet>(20);
3671 }
3672 switch (turn % 50)
3673 {
3674 case 0:
3675 happiness = (hunger.value + stamina.value + depression.value + bladder.value + hygiene.value) / 5;
3676 break;
3677 case 1:
3678 if (!IsPC || !EClass.debug.godMode)
3679 {
3680 if (EClass.rnd(2) == 0 && !HasCondition<ConAwakening>())
3681 {
3682 sleepiness.Mod(1);
3683 }
3684 if (EClass.rnd(3) == 0)
3685 {
3686 hunger.Mod(1);
3687 }
3688 if (IsPC && (sleepiness.GetPhase() != 0 || stamina.GetPhase() <= 1))
3689 {
3690 Tutorial.Play("sleep");
3691 }
3692 }
3693 break;
3694 case 2:
3695 if (parasite != null)
3696 {
3697 ModExp(227, (EClass._zone.IsRegion ? 5 : 40) * 100 / Mathf.Max(100, 100 + (elements.Base(227) - parasite.LV) * 25));
3698 }
3699 if (ride != null)
3700 {
3701 ModExp(226, (EClass._zone.IsRegion ? 5 : 40) * 100 / Mathf.Max(100, 100 + (elements.Base(226) - ride.LV) * 25));
3702 }
3703 break;
3704 case 3:
3705 {
3706 int phase = hygiene.GetPhase();
3707 int num = 0;
3708 num = ((!IsPC) ? ((phase > 3) ? 50 : 0) : ((phase > 3) ? 50 : 0));
3709 if (num > EClass.rnd(100))
3710 {
3711 hygiene.Mod(-1);
3712 }
3713 break;
3714 }
3715 }
3716 if (turn % 200 == 0)
3717 {
3719 }
3720 if (IsPCParty)
3721 {
3722 if (dirtyWeight)
3723 {
3724 CalcBurden();
3725 }
3726 int phase2 = burden.GetPhase();
3727 int phase3 = hunger.GetPhase();
3728 if (phase3 >= 4)
3729 {
3730 preventRegen = true;
3731 }
3732 if (EClass.rnd(EClass._zone.IsRegion ? 100 : 30) == 0 && phase2 >= 3)
3733 {
3734 Say("dmgBurden", this);
3735 DamageHP(MaxHP * (base.ChildrenWeight * 100 / WeightLimit) / 1000 + 1, AttackSource.Burden);
3736 if (isDead)
3737 {
3738 return;
3739 }
3740 }
3741 if (EClass.rnd(12) == 0)
3742 {
3743 if (IsPC)
3744 {
3745 if (phase2 > 0)
3746 {
3747 ModExp(207, 1 + phase2 * phase2);
3748 }
3749 }
3750 else
3751 {
3752 ModExp(207, 4);
3753 }
3754 }
3755 if (IsPC)
3756 {
3757 if (phase3 >= 5)
3758 {
3759 if (!(ai is AI_Eat) && EClass.rnd(5) == 0)
3760 {
3761 DamageHP(1 + EClass.rnd(2) + MaxHP / 50, AttackSource.Hunger);
3762 }
3763 if (!isDead && EClass.rnd(3) == 0)
3764 {
3765 stamina.Mod(-1);
3766 }
3767 }
3768 if (isDead)
3769 {
3770 return;
3771 }
3772 phase3 = stamina.GetPhase();
3773 if (phase3 <= 0)
3774 {
3775 preventRegen = true;
3776 }
3778 {
3779 if (EClass.rnd(100) == 0 && !isConfused)
3780 {
3781 Msg.Say("rain_confuse");
3782 AddCondition<ConConfuse>(500);
3783 }
3784 if (EClass.rnd(300) == 0 && !isBlind)
3785 {
3786 Msg.Say("rain_confuse");
3787 AddCondition<ConBlind>(200);
3788 }
3789 }
3790 if (turn % (200000 / Mathf.Max(100 + Evalue(409) * 10, 50)) == 0)
3791 {
3792 ModCorruption(1);
3793 }
3794 }
3795 }
3796 if (!IsPC)
3797 {
3798 int num2 = Evalue(409);
3799 if (num2 > 0 && turn % (200000 / Mathf.Max(100 + num2 * 10, 50)) == 0)
3800 {
3801 ModCorruption(1);
3802 }
3803 }
3804 for (int num3 = conditions.Count - 1; num3 >= 0; num3--)
3805 {
3806 if (num3 < conditions.Count)
3807 {
3808 Condition condition = conditions[num3];
3809 if (!condition.TimeBased)
3810 {
3811 condition.Tick();
3812 }
3813 if (!condition.IsKilled)
3814 {
3815 if (condition.ConsumeTurn)
3816 {
3817 consumeTurn = true;
3818 }
3819 if (condition.PreventRegen)
3820 {
3821 preventRegen = true;
3822 }
3823 if (condition.EmoIcon != 0 && condition.EmoIcon > emoIcon)
3824 {
3825 emoIcon = condition.EmoIcon;
3826 }
3827 }
3828 if (isDead)
3829 {
3830 return;
3831 }
3832 }
3833 }
3834 if (id == "tsunami")
3835 {
3836 if (elements.Base(79) < 30)
3837 {
3838 Die();
3839 return;
3840 }
3841 if (IsInCombat)
3842 {
3843 elements.SetTo(79, elements.Base(79) * 3 / 4);
3844 }
3845 }
3846 if (!preventRegen)
3847 {
3848 if (EClass.rnd(25) == 0 && base.hp < MaxHP)
3849 {
3850 HealHP(EClass.rnd(Evalue(300) / 3 + 1) + 1);
3851 elements.ModExp(300, 8f);
3852 }
3853 if (EClass.rnd(8) == 0 && mana.value < mana.max)
3854 {
3855 mana.Mod(EClass.rnd(Evalue(301) / 2 + 1) + 1);
3856 elements.ModExp(301, 8f);
3857 }
3858 if (EClass.rnd(20) == 0 && !IsPC && stamina.value < stamina.max)
3859 {
3860 stamina.Mod(EClass.rnd(5) + 1);
3861 }
3862 }
3863 }
Emo2
Definition: Emo2.cs:2
Definition: AI_Eat.cs:5
virtual bool PreventRegen
virtual bool TimeBased
virtual Emo2 EmoIcon
Definition: BaseStats.cs:17
bool dirtyWeight
Definition: Card.cs:85
void TickCooldown()
Definition: Chara.cs:8571
void DiminishTempElements(int a=1)
Definition: Chara.cs:10132
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:5233
bool isBlind
Definition: Chara.cs:130
static bool preventRegen
Definition: Chara.cs:180
void CalcBurden()
Definition: Chara.cs:1813
virtual bool IsKilled
Definition: Condition.cs:7
override void Tick()
Definition: Condition.cs:70
static void Play(string idStep)
Definition: Tutorial.cs:7
bool IsRaining
Definition: Weather.cs:117

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

Referenced by _Move().

◆ TickCooldown()

void Chara.TickCooldown ( )
inline

Definition at line 8571 of file Chara.cs.

8572 {
8573 for (int num = _cooldowns.Count - 1; num >= 0; num--)
8574 {
8575 if (_cooldowns[num] % 1000 == 1)
8576 {
8577 _cooldowns.RemoveAt(num);
8578 }
8579 else
8580 {
8581 _cooldowns[num]--;
8582 }
8583 }
8584 if (_cooldowns.Count == 0)
8585 {
8586 _cooldowns = null;
8587 }
8588 }

◆ TickWork()

void Chara.TickWork ( VirtualDate  date)
inline

Definition at line 8991 of file Chara.cs.

8992 {
8994 if (span != TimeTable.Span.Work && span != 0)
8995 {
8996 return;
8997 }
8998 WorkSummary workSummary = GetWorkSummary();
8999 if (span == TimeTable.Span.Work)
9000 {
9001 if (workSummary.work != null)
9002 {
9003 PerformWork(workSummary.work, isHobby: false, date.IsRealTime);
9004 }
9005 }
9006 else if (workSummary.hobbies.Count > 0)
9007 {
9008 PerformWork(workSummary.hobbies.RandomItem(), isHobby: true, date.IsRealTime);
9009 }
9010 }
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 1170 of file Chara.cs.

1171 {
1172 return base.Name + "(" + ai?.ToString() + ")" + pos?.ToString() + "/" + base.ExistsOnMap + "/" + isDead;
1173 }
override string ToString()
Definition: Point.cs:512

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

4308 {
4309 if (!IsPC || !(t.trait is TraitRod) || t.c_charges <= 0 || !HasElement(1564))
4310 {
4311 return;
4312 }
4313 Say("absorbRod", this, t);
4314 TraitRod rod = t.trait as TraitRod;
4315 bool flag = false;
4316 if (rod.source != null)
4317 {
4318 using IEnumerator<SourceElement.Row> enumerator = EClass.sources.elements.rows.Where((SourceElement.Row a) => a.id == rod.source.id).GetEnumerator();
4319 if (enumerator.MoveNext())
4320 {
4321 SourceElement.Row current = enumerator.Current;
4322 if (IsPC)
4323 {
4324 GainAbility(current.id, t.c_charges * 100, t);
4325 flag = true;
4326 }
4327 }
4328 }
4329 if (!flag)
4330 {
4331 mana.Mod(-50 * t.c_charges);
4332 }
4333 t.c_charges = 0;
4335 }
int c_charges
Definition: Card.cs:1269
void GainAbility(int ele, int mtp=100, Thing origin=null)
Definition: Chara.cs:9898

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

7226 {
7227 if (!IsPCFaction && !IsGuest())
7228 {
7229 return null;
7230 }
7231 foreach (Card item in EClass._map.props.installed.all)
7232 {
7233 if (item.trait is TraitBed traitBed && traitBed.CanAssign(this))
7234 {
7235 traitBed.AddHolder(this);
7236 Msg.Say("claimBed", this);
7237 return traitBed;
7238 }
7239 }
7240 return null;
7241 }
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 5536 of file Chara.cs.

5537 {
5539 {
5540 return;
5541 }
5542 int num = 0;
5543 bool flag = false;
5544 bool flag2 = false;
5545 Point point = pos.GetNearestPoint(allowBlock: true, allowChara: false, allowInstalled: false, ignoreCenter: true) ?? pos;
5546 TreasureType type = TreasureType.BossQuest;
5547 if (EClass._zone.Boss == this)
5548 {
5549 type = TreasureType.BossNefia;
5550 num = 2 + EClass.rnd(2);
5551 flag = (flag2 = true);
5552 EClass._zone.Boss = null;
5553 Msg.Say("boss_win", EClass._zone.Name);
5555 {
5556 Msg.Say("boss_win_void", EClass._zone.Name);
5557 EClass.player.flags.KilledBossInVoid = true;
5558 }
5559 if (EClass._zone.IsNefia)
5560 {
5563 SE.Play("Jingle/fanfare2");
5564 EClass._zone.SetBGM(114, refresh: true, 3f);
5565 }
5568 }
5569 switch (id)
5570 {
5571 case "vernis_boss":
5572 num = 5;
5573 flag = (flag2 = true);
5574 EClass.Sound.StopBGM(3f);
5575 EClass._zone.SetBGM(1, refresh: false);
5576 if (EClass.game.quests.GetPhase<QuestVernis>() == 8)
5577 {
5578 EClass.game.quests.Get<QuestVernis>().UpdateOnTalk();
5579 }
5580 break;
5581 case "lurie_boss":
5582 if (!(EClass._zone is Zone_Exile))
5583 {
5584 num = 5;
5585 flag = (flag2 = true);
5586 EClass._zone.SetBGM(120, refresh: true, 3f);
5588 {
5589 EClass.game.quests.Get<QuestNegotiationDarkness>().ChangePhase(4);
5590 EClass.player.flags.killedDuponne = true;
5591 }
5592 }
5593 break;
5594 case "ungaga_pap":
5595 num = 5;
5596 flag = (flag2 = true);
5598 {
5599 EClass._zone.SetBGM(46, refresh: true, 3f);
5600 }
5601 break;
5602 case "melilith_boss":
5603 num = 5;
5604 flag = (flag2 = true);
5605 EClass.Sound.StopBGM(3f);
5606 EClass._zone.SetBGM(1, refresh: false);
5607 break;
5608 case "doga":
5609 {
5610 QuestCurry questCurry = EClass.game.quests.Get<QuestCurry>();
5611 if (questCurry != null)
5612 {
5613 num = 5;
5614 flag = (flag2 = true);
5615 EClass.Sound.StopBGM(3f);
5616 EClass._zone.SetBGM(1, refresh: false);
5617 questCurry.NextPhase();
5618 }
5619 break;
5620 }
5621 case "fairy_raina":
5622 case "fairy_poina":
5623 {
5624 bool num2 = EClass._map.FindChara((id == "fairy_raina") ? "fairy_poina" : "fairy_raina") == null;
5625 QuestNasu questNasu = EClass.game.quests.Get<QuestNasu>();
5626 if (num2 && questNasu != null && questNasu.phase <= 1)
5627 {
5628 if (questNasu.phase == 0)
5629 {
5630 questNasu.NextPhase();
5631 }
5632 num = 5;
5633 flag = (flag2 = true);
5634 EClass.Sound.StopBGM(3f);
5635 EClass._zone.SetBGM(1, refresh: false);
5636 EClass.player.DropReward(ThingGen.Create("backpack_holding"));
5637 questNasu.NextPhase();
5638 }
5639 break;
5640 }
5641 case "isygarad":
5642 {
5643 num = 5;
5644 flag = (flag2 = true);
5645 QuestExploration questExploration = EClass.game.quests.Get<QuestExploration>();
5646 if (questExploration != null)
5647 {
5648 SE.Play("kill_boss");
5649 questExploration.ChangePhase(3);
5650 EClass.Sound.StopBGM(3f);
5651 EClass._zone.SetBGM(1, refresh: false);
5652 }
5653 break;
5654 }
5655 case "swordkeeper":
5656 num = 10;
5657 flag = true;
5658 SE.Play("kill_boss");
5659 SoundManager.ForceBGM();
5660 LayerDrama.Activate("_event", "event", "swordkeeper_defeat");
5661 break;
5662 }
5663 if (flag)
5664 {
5665 SE.Play("kill_boss");
5666 }
5667 if (num != 0)
5668 {
5670 {
5671 EClass.player.stats.deepest = EClass._zone.DangerLv;
5672 Msg.Say("update_deepest", EClass.player.stats.deepest.ToString() ?? "");
5673 }
5675 {
5676 EClass.player.stats.deepestVoid = -EClass._zone.lv;
5677 Msg.Say("update_deepest_void", EClass.player.stats.deepestVoid.ToString() ?? "");
5678 }
5679 EClass.player.willAutoSave = true;
5680 Thing thing = ThingGen.CreateTreasure("chest_boss", base.LV, type);
5681 point.SetBlock();
5682 point.SetObj();
5683 EClass._zone.AddCard(thing, point).Install();
5684 ThingGen.TryLickChest(thing);
5685 }
5686 if (flag2)
5687 {
5689 }
5690 }
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:2077
void SetObj(int id=0, int value=1, int dir=0)
Definition: Point.cs:916
void SetBlock(int idMat=0, int idBlock=0)
Definition: Point.cs:906
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:282
void SetBGM(List< int > ids, bool refresh=true, float fadeDuration=0f)
Definition: Zone.cs:2923
Chara Boss
Definition: Zone.cs:83

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

4525 {
4526 if (held != null && held.trait.CanOnlyCarry)
4527 {
4528 DropHeld();
4529 }
4530 foreach (Thing item in things.List((Thing t) => t.trait.CanOnlyCarry))
4531 {
4532 DropThing(item);
4533 }
4534 }
void DropThing(Thing t, int num=-1)
Definition: Chara.cs:4556

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

◆ TryEquip()

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

Definition at line 7599 of file Chara.cs.

7600 {
7601 if (!ShouldEquip(t, useFav))
7602 {
7603 return false;
7604 }
7605 if (t.category.slot == 0)
7606 {
7607 return false;
7608 }
7609 if (useFav)
7610 {
7611 BodySlot slot = body.GetSlot(t);
7612 switch (GetFavAttackStyle())
7613 {
7614 case AttackStyle.Default:
7615 case AttackStyle.TwoHand:
7616 if (t.IsMeleeWeapon)
7617 {
7618 slot = body.slotMainHand;
7619 }
7620 break;
7621 case AttackStyle.Shield:
7622 if (t.IsMeleeWeapon)
7623 {
7624 slot = body.slotMainHand;
7625 }
7626 break;
7627 }
7628 body.Equip(t, slot);
7629 }
7630 else
7631 {
7632 body.Equip(t);
7633 }
7634 Say("equip", this, t);
7635 return true;
7636 }
bool ShouldEquip(Thing t, bool useFav=false)
Definition: Chara.cs:7487

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

7720 {
7721 if (IsPC)
7722 {
7724 if (thing?.trait is TraitToolRange && CanEquipRanged(thing))
7725 {
7726 ranged = thing;
7727 return true;
7728 }
7729 return false;
7730 }
7731 if (ranged != null && ranged.parent == this)
7732 {
7733 return true;
7734 }
7736 return ranged != null;
7737 }
Thing GetBestRangedWeapon()
Definition: Chara.cs:7704

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

7644 {
7645 Thing dest = null;
7646 if (IsPC)
7647 {
7649 {
7650 return FindThrowable(hotbar: true);
7651 }
7652 return null;
7653 }
7654 things.Foreach(delegate(Thing t)
7655 {
7656 if (t.HasTag(CTAG.throwWeapon) || (!base.IsPCFactionOrMinion && t.HasTag(CTAG.throwWeaponEnemy)))
7657 {
7658 dest = t;
7659 }
7660 });
7661 return dest;
7662 Thing FindThrowable(bool hotbar)
7663 {
7664 things.Foreach(delegate(Thing t)
7665 {
7666 if (dest == null)
7667 {
7668 if (t.IsHotItem)
7669 {
7670 if (!hotbar)
7671 {
7672 return;
7673 }
7674 }
7675 else if (hotbar)
7676 {
7677 return;
7678 }
7679 if (t.HasTag(CTAG.throwWeapon))
7680 {
7681 dest = t;
7682 }
7683 }
7684 });
7685 return dest;
7686 }
7687 }

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

4386 {
4387 if (held == t)
4388 {
4389 return true;
4390 }
4391 if (t.isDestroyed || t.Num <= 0)
4392 {
4393 return false;
4394 }
4395 if (!CanPick(t))
4396 {
4397 if (t.parent == null)
4398 {
4399 EClass._zone.AddCard(t, pos);
4400 }
4401 return false;
4402 }
4403 HoldCard(t, num);
4404 return true;
4405 }
bool CanPick(Card c)
Definition: Chara.cs:4205
void HoldCard(Card t, int num=-1)
Definition: Chara.cs:4407

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

7866 {
7867 int num = Evalue(289);
7868 if (num == 0)
7869 {
7870 return false;
7871 }
7872 int lV = t.LV;
7873 if (EClass.rnd(num * num + 5) > EClass.rnd(lV * lV) * 20)
7874 {
7875 t.Identify(show, (num >= 20) ? IDTSource.SkillHigh : IDTSource.Skill);
7876 int num2 = 50;
7877 if (lV > num)
7878 {
7879 num2 += (lV - num) * 10;
7880 }
7881 elements.ModExp(289, Mathf.Min(num2, 1000));
7882 return true;
7883 }
7884 return false;
7885 }
IDTSource
Definition: IDTSource.cs:2
Thing Identify(bool show=true, IDTSource idtSource=IDTSource.Identify)
Definition: Thing.cs:2059

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

2705 {
2706 foreach (Condition condition in conditions)
2707 {
2708 if (!condition.TryMove(newPoint))
2709 {
2710 return MoveResult.Fail;
2711 }
2712 }
2713 if (base.isRestrained)
2714 {
2715 if (!IsPC)
2716 {
2717 return MoveResult.Fail;
2718 }
2719 base.isRestrained = false;
2720 }
2721 if (!CanMoveTo(newPoint, allowDestroyPath))
2722 {
2723 return MoveResult.Fail;
2724 }
2725 return _Move(newPoint);
2726 }
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 2664 of file Chara.cs.

2665 {
2667 {
2668 return MoveResult.Fail;
2669 }
2670 Point point = p.Copy();
2671 int num = p.x - pos.x;
2672 int num2 = p.z - pos.z;
2673 if (num > 1)
2674 {
2675 num = 1;
2676 }
2677 else if (num < -1)
2678 {
2679 num = -1;
2680 }
2681 if (num2 > 1)
2682 {
2683 num2 = 1;
2684 }
2685 else if (num2 < -1)
2686 {
2687 num2 = -1;
2688 }
2689 if (num == 0 && num2 == 0)
2690 {
2691 num = EClass.rnd(3) - 1;
2692 num2 = EClass.rnd(3) - 1;
2693 }
2694 point.Set(pos);
2695 point.x -= num;
2696 point.z -= num2;
2697 if (point.IsValid && !point.HasChara)
2698 {
2699 return TryMove(point, allowDestroyPath: false);
2700 }
2701 return MoveResult.Fail;
2702 }
bool TooHeavyToMove()
Definition: Player.cs:2541

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

2603 {
2604 if (p.Equals(pos))
2605 {
2606 return MoveResult.Success;
2607 }
2609 {
2610 return MoveResult.Fail;
2611 }
2612 bool flag = true;
2613 Point point = null;
2614 _sharedPos.Set(p);
2615 if (CanDestroyPath())
2616 {
2618 {
2619 return MoveResult.Success;
2620 }
2621 Debug.Log(CanMoveTo(pos));
2623 }
2624 int num = pos.Distance(p);
2625 PathProgress pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Default, num + 4, 1);
2626 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 4)
2627 {
2628 PathFinderNode pathFinderNode = pathProgress.nodes[pathProgress.nodes.Count - 1];
2629 if (TryMove(new Point(pathFinderNode.X, pathFinderNode.Z)) == MoveResult.Success)
2630 {
2631 return MoveResult.Success;
2632 }
2633 }
2634 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Combat, num + 4, 1);
2635 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 4)
2636 {
2637 PathFinderNode pathFinderNode2 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2638 if (TryMove(new Point(pathFinderNode2.X, pathFinderNode2.Z)) == MoveResult.Success)
2639 {
2640 return MoveResult.Success;
2641 }
2642 }
2643 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Default, num + 25, 2);
2644 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 25)
2645 {
2646 PathFinderNode pathFinderNode3 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2647 if (TryMove(new Point(pathFinderNode3.X, pathFinderNode3.Z)) == MoveResult.Success)
2648 {
2649 return MoveResult.Success;
2650 }
2651 }
2652 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Combat, num + 25, 2);
2653 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 25)
2654 {
2655 PathFinderNode pathFinderNode4 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2656 if (TryMove(new Point(pathFinderNode4.X, pathFinderNode4.Z)) == MoveResult.Success)
2657 {
2658 return MoveResult.Success;
2659 }
2660 }
2661 return MoveResult.Fail;
2662 }
static Point _sharedPos
Definition: Chara.cs:172
void RequestPathImmediate(PathProgress progress)
Definition: PathManager.cs:41
List< PathFinderNode > nodes
Definition: PathProgress.cs:16
Point GetPointTowards(Point dest)
Definition: Point.cs:789

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

9465 {
9466 if (TC == null || TC.HasCondition<ConInvulnerable>() || TC.Evalue(1421) > 0 || !TC.ExistsOnMap)
9467 {
9468 return false;
9469 }
9470 if (TC.hp > (long)TC.MaxHP * (long)Mathf.Min(5 + (int)Mathf.Sqrt(power), harvest ? 35 : 25) / 100)
9471 {
9472 return false;
9473 }
9474 if (TC.HasElement(427))
9475 {
9476 return false;
9477 }
9478 if (TC.IsPC && EClass.player.invlunerable)
9479 {
9480 return false;
9481 }
9482 PlaySound("hit_finish");
9483 Say("finish");
9484 Say("finish2", this, TC);
9485 TC.DamageHP(TC.MaxHP, AttackSource.Finish, this);
9486 return false;
9487 }
@ 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 9922 of file Chara.cs.

9923 {
9924 if (IsPCParty)
9925 {
9926 foreach (Chara member in EClass.pc.party.members)
9927 {
9928 if (member.HasElement(1641) && EClass.rnd(3) != 0)
9929 {
9930 Msg.Say("curse_nullify", member);
9931 return true;
9932 }
9933 }
9934 }
9935 else if (HasElement(1641) && EClass.rnd(3) != 0)
9936 {
9937 Say("curse_nullify", this);
9938 return true;
9939 }
9940 if (GetCondition<ConHolyVeil>() != null && EClass.rnd(5) != 0)
9941 {
9942 Say("curse_nullify", this);
9943 return true;
9944 }
9945 return false;
9946 }

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

◆ TryPickGroundItem()

void Chara.TryPickGroundItem ( )
inline

Definition at line 4361 of file Chara.cs.

4362 {
4363 foreach (Card item in pos.ListCards())
4364 {
4365 if ((IsPC || !(EClass.pc.ai is AI_UseCrafter aI_UseCrafter) || !aI_UseCrafter.ings.Contains(item)) && item.isThing && item.placeState == PlaceState.roaming && CanPick(item))
4366 {
4367 Thing thing = Pick(item.Thing);
4368 if (thing != null && !IsPC)
4369 {
4370 thing.isNPCProperty = true;
4371 }
4372 break;
4373 }
4374 }
4375 }

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

Referenced by AI_Fish.Run().

◆ TryPoisonPotion()

Thing Chara.TryPoisonPotion ( Thing  t)
inline

Definition at line 4293 of file Chara.cs.

4294 {
4295 if (t.trait is TraitPotion && t.id != "1165" && !t.source.tag.Contains("neg") && EClass.rnd(2) == 0 && HasElement(1565))
4296 {
4297 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)
4298 .id;
4299 Say("poisonDrip", this);
4300 int num = t.Num;
4301 t.Destroy();
4302 t = ThingGen.Create(text).SetNum(num);
4303 }
4304 return t;
4305 }
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 3201 of file Chara.cs.

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

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

4378 {
4379 if (!EClass._zone.TryAddThingInSharedContainer(t, containers) && dropIfFail)
4380 {
4381 EClass._zone.AddCard(t, pos);
4382 }
4383 }
bool TryAddThingInSharedContainer(Thing t, List< Thing > containers=null, bool add=true, bool msg=false, Chara chara=null, bool sharedOnly=true)
Definition: Zone.cs:2102

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

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

7244 {
7245 if (GetInt(113) != 0)
7246 {
7247 return;
7248 }
7249 _ListItems.Clear();
7250 Thing bestRangedWeapon = GetBestRangedWeapon();
7251 foreach (Thing thing in things)
7252 {
7253 if (!thing.IsAmmo)
7254 {
7255 if (thing.category.slot != 0 && !thing.isEquipped && !thing.HasTag(CTAG.gift))
7256 {
7257 _ListItems.Add(thing);
7258 }
7259 else if (thing.IsRangedWeapon && thing.category.slot == 0 && bestRangedWeapon != thing)
7260 {
7261 _ListItems.Add(thing);
7262 }
7263 }
7264 }
7265 if (_ListItems.Count == 0)
7266 {
7267 return;
7268 }
7269 List<Thing> containers2 = containers.ToList();
7270 foreach (Thing listItem in _ListItems)
7271 {
7272 EClass._zone.TryAddThingInSharedContainer(listItem, containers2, add: true, msg: true, this);
7273 }
7274 }
void Add(Act a, string s="")
Definition: ActPlan.cs:11
static List< Thing > _ListItems
Definition: Chara.cs:188

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

4338 {
4339 if (t.id == "axe")
4340 {
4341 Tutorial.Reserve("tool");
4342 }
4343 if (t.category.id == "mushroom")
4344 {
4345 Tutorial.Reserve("food");
4346 }
4347 if (t.category.id == "herb")
4348 {
4349 Tutorial.Reserve("herb");
4350 }
4351 if (t.id == "pasture")
4352 {
4353 Tutorial.Reserve("pasture");
4354 }
4355 if (t.id == "log")
4356 {
4357 Tutorial.Reserve("process");
4358 }
4359 }

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

◆ TryRestock()

void Chara.TryRestock ( bool  onCreate)
inline

Definition at line 4618 of file Chara.cs.

4619 {
4620 isOnCreate = onCreate;
4621 if (onCreate || (!IsPCFaction && (base.IsUnique || trait is TraitAdventurer || trait is TraitGuard)))
4622 {
4623 RestockEquip((!EClass.core.IsGameStarted || !(EClass._zone is Zone_Music)) && onCreate);
4624 }
4625 RestockInventory(onCreate);
4626 }
void RestockInventory(bool onCreate)
Definition: Chara.cs:4912
void RestockEquip(bool onCreate)
Definition: Chara.cs:4628

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

6225 {
6226 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))
6227 {
6228 SetEnemy(c);
6229 }
6230 }

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

7282 {
7284 }
void TryTakeSharedItems(bool msg=true)
Definition: Chara.cs:7281

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

7287 {
7288 if (base.isSummon || (memberType == FactionMemberType.Livestock && homeBranch != null && !homeBranch.policies.IsActive(2715)))
7289 {
7290 return;
7291 }
7292 int num = 2;
7293 int num2 = 2;
7294 bool flag = GetInt(113) == 0;
7295 int num3 = 2;
7296 int num4 = 2;
7297 int num5 = 2;
7299 {
7300 num4 = 0;
7301 num5 = 0;
7302 }
7303 foreach (Thing thing3 in things)
7304 {
7305 if (CanEat(thing3, shouldEat))
7306 {
7307 num -= thing3.Num;
7308 }
7309 if (thing3.trait.GetHealAction(this) != null)
7310 {
7311 num2 -= thing3.Num;
7312 }
7313 if (thing3.id == "polish_powder")
7314 {
7315 num3 -= thing3.Num;
7316 }
7317 if (thing3.trait is TraitBlanketColdproof)
7318 {
7319 num4 -= thing3.Num;
7320 }
7321 if (thing3.trait is TraitBlanketFireproof)
7322 {
7323 num5 -= thing3.Num;
7324 }
7325 }
7326 _ListItems.Clear();
7327 foreach (Thing container in containers)
7328 {
7329 if (!container.IsSharedContainer)
7330 {
7331 continue;
7332 }
7333 foreach (Thing thing4 in container.things)
7334 {
7335 if (!thing4.c_isImportant && thing4.IsIdentified)
7336 {
7337 if (num3 > 0 && thing4.id == "polish_powder")
7338 {
7339 _ListItems.Add(thing4);
7340 num3 -= thing4.Num;
7341 }
7342 else if (num4 > 0 && !HasElement(1236) && thing4.trait is TraitBlanketColdproof)
7343 {
7344 _ListItems.Add(thing4);
7345 num4 -= thing4.Num;
7346 }
7347 else if (num5 > 0 && thing4.trait is TraitBlanketFireproof)
7348 {
7349 _ListItems.Add(thing4);
7350 num5 -= thing4.Num;
7351 }
7352 else if (num > 0 && CanEat(thing4, shouldEat) && !thing4.c_isImportant)
7353 {
7354 _ListItems.Add(thing4);
7355 num -= thing4.Num;
7356 }
7357 else if (num2 > 0 && thing4.trait.GetHealAction(this) != null)
7358 {
7359 _ListItems.Add(thing4);
7360 num2 -= thing4.Num;
7361 }
7362 else if (flag && thing4.IsEquipmentOrRanged && !thing4.HasTag(CTAG.gift) && ShouldEquip(thing4, useFav: true))
7363 {
7364 _ListItems.Add(thing4);
7365 }
7366 }
7367 }
7368 }
7369 if (_ListItems.Count == 0)
7370 {
7371 return;
7372 }
7373 _ListItems.ForeachReverse(delegate(Thing t)
7374 {
7375 if (t.IsEquipmentOrRanged)
7376 {
7377 bool flag3 = false;
7378 int slot = t.category.slot;
7379 int equipValue = t.GetEquipValue();
7380 foreach (Thing listItem in _ListItems)
7381 {
7382 if (listItem.category.slot == slot && listItem.GetEquipValue() > equipValue)
7383 {
7384 flag3 = true;
7385 break;
7386 }
7387 }
7388 if (flag3)
7389 {
7390 _ListItems.Remove(t);
7391 }
7392 }
7393 });
7394 bool flag2 = false;
7395 foreach (Thing listItem2 in _ListItems)
7396 {
7397 Thing thing = listItem2;
7398 if (things.IsFull(thing))
7399 {
7400 break;
7401 }
7402 Thing thing2 = listItem2.parent as Thing;
7403 if (thing.Num > 2)
7404 {
7405 thing = thing.Split(2);
7406 }
7407 if (msg)
7408 {
7409 Say("takeSharedItem", this, thing, thing2.GetName(NameStyle.Full));
7410 }
7411 AddCard(thing);
7412 if (ShouldEquip(thing, useFav: true) && thing.category.slot != 0)
7413 {
7414 TryEquip(thing, useFav: true);
7415 flag2 = true;
7416 }
7417 }
7418 if (flag2 && flag)
7419 {
7420 TryPutSharedItems(containers);
7421 }
7422 }
bool IsIdentified
Definition: Card.cs:2365
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(), 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 8423 of file Chara.cs.

8424 {
8425 if (!EClass.debug.enable || IsPC || !IsGlobal || !IsPCFaction)
8426 {
8427 return;
8428 }
8429 for (int i = 0; i < 100; i++)
8430 {
8431 if (base.feat == 0)
8432 {
8433 break;
8434 }
8435 if (base.c_upgrades == null)
8436 {
8437 base.c_upgrades = new CharaUpgrade();
8438 }
8439 if (base.c_upgrades.halt)
8440 {
8441 break;
8442 }
8443 Rand.SetSeed(base.uid + base.c_upgrades.count);
8444 int num = EClass.rnd(100);
8445 int num2 = 0;
8446 int num3 = 1;
8447 int num4 = 0;
8448 bool flag = false;
8449 IEnumerable<SourceElement.Row> ie = EClass.sources.elements.rows.Where((SourceElement.Row a) => !elements.Has(a) && a.category == "skill" && !a.tag.Contains("noPet"));
8450 List<Element> list = ListAvailabeFeats(pet: true);
8451 if (num >= 90 && list.Count > 0)
8452 {
8453 Element element = list.RandomItem();
8454 num2 = element.id;
8455 num4 = element.CostLearn;
8456 }
8457 else if (num >= 60 && ie.Any())
8458 {
8459 num2 = ie.RandomItem().id;
8460 num4 = 3;
8461 }
8462 else
8463 {
8464 num2 = Element.List_MainAttributesMajor.RandomItem();
8465 num4 = 1;
8466 num3 = 2;
8467 flag = true;
8468 }
8469 Rand.SetSeed();
8470 if (num4 > base.feat)
8471 {
8472 break;
8473 }
8474 base.feat -= num4;
8475 base.c_upgrades.count++;
8476 base.c_upgrades.spent += num4;
8477 bool flag2 = false;
8478 if (flag)
8479 {
8480 foreach (CharaUpgrade.Item item in base.c_upgrades.items)
8481 {
8482 if (item.idEle == num2)
8483 {
8484 item.value += num3;
8485 item.cost += num4;
8486 flag2 = true;
8487 break;
8488 }
8489 }
8490 }
8491 if (!flag2)
8492 {
8493 base.c_upgrades.items.Add(new CharaUpgrade.Item
8494 {
8495 idEle = num2,
8496 value = num3,
8497 cost = num4
8498 });
8499 }
8500 SourceElement.Row row = EClass.sources.elements.map[num2];
8501 if (row.category == "feat")
8502 {
8503 SetFeat(num2, elements.ValueWithoutLink(num2) + 1, msg: true);
8504 }
8505 else if (elements.ValueWithoutLink(row.id) == 0)
8506 {
8507 elements.Learn(row.id);
8508 }
8509 else
8510 {
8511 elements.ModBase(num2, num3);
8512 }
8513 }
8514 }
List< Element > ListAvailabeFeats(bool pet=false, bool showAll=false)
Definition: Chara.cs:9682
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 Card.LevelUp(), and WindowCharaMini.Refresh().

◆ TryUse()

bool Chara.TryUse ( Thing  t)
inline

Definition at line 7748 of file Chara.cs.

7749 {
7750 if (t.id == "338")
7751 {
7752 Thing thing = things.Find((Thing a) => a.IsEquipmentOrRanged && !a.isAcidproof);
7753 if (thing != null)
7754 {
7755 Say("dip", this, thing, t.GetName(NameStyle.Full, 1));
7756 SE.Change();
7757 t.trait.OnBlend(thing, this);
7758 return true;
7759 }
7760 return false;
7761 }
7762 if (t.IsNegativeGift || t.source.HasTag(CTAG.ignoreUse))
7763 {
7764 return false;
7765 }
7766 if (t.id == "cigar")
7767 {
7768 (t.trait as TraitItemProc).OnUse(this);
7769 return true;
7770 }
7771 if (t.trait.CanEat(this) && hunger.GetPhase() > ((IsPCFaction || IsPCFactionMinion) ? 2 : 0))
7772 {
7774 {
7775 target = t
7776 });
7777 return true;
7778 }
7779 if (t.trait.CanDrink(this))
7780 {
7781 Drink(t);
7782 return true;
7783 }
7784 if (t.trait.CanRead(this))
7785 {
7787 {
7788 target = t
7789 });
7790 return true;
7791 }
7792 if (base.hp < MaxHP * 90 / 100)
7793 {
7794 Action healAction = t.trait.GetHealAction(this);
7795 if (healAction != null)
7796 {
7797 healAction();
7798 return true;
7799 }
7800 }
7801 return false;
7802 }
bool isAcidproof
Definition: Card.cs:686
void SetAIImmediate(AIAct g)
Definition: Chara.cs:8751
virtual bool CanRead(Chara c)
Definition: Trait.cs:968
virtual bool CanDrink(Chara c)
Definition: Trait.cs:986
virtual void OnBlend(Thing t, Chara c)
Definition: Trait.cs:612

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

9013 {
9014 if (EClass.world.date.IsExpired(GetInt(51)))
9015 {
9016 Expedition expedition = Expedition.Create(this, sourceWork.expedition.ToEnum<ExpeditionType>());
9017 SetInt(51, EClass.world.date.GetRaw() + 60 * (expedition.hours + 24));
9018 homeBranch.expeditions.Add(expedition);
9019 return true;
9020 }
9021 return false;
9022 }
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 3560 of file Chara.cs.

3561 {
3562 if (IsPCC)
3563 {
3564 if (base.dir == 0)
3565 {
3566 angle = 225f;
3567 }
3568 else if (base.dir == 1)
3569 {
3570 angle = 135f;
3571 }
3572 else if (base.dir == 2)
3573 {
3574 angle = 45f;
3575 }
3576 else if (base.dir == 3)
3577 {
3578 angle = -45f;
3579 }
3580 }
3581 else if (base.dir == 0)
3582 {
3583 angle = 165f;
3584 }
3585 else if (base.dir == 1)
3586 {
3587 angle = 300f;
3588 }
3589 else if (base.dir == 2)
3590 {
3591 angle = 0f;
3592 }
3593 else if (base.dir == 3)
3594 {
3595 angle = 120f;
3596 }
3597 }

Referenced by OnDeserialized().

◆ UpdateSight()

void Chara.UpdateSight ( )
inline

Definition at line 3621 of file Chara.cs.

3622 {
3623 int num = 4;
3624 for (int i = -num; i < num + 1; i++)
3625 {
3626 for (int j = -num; j < num + 1; j++)
3627 {
3628 shared.Set(pos.x + i, pos.z + j);
3629 if (shared.IsValid && !shared.cell.isSeen && i >= -1 && i <= 1 && j >= -1)
3630 {
3631 _ = 1;
3632 }
3633 }
3634 }
3635 }
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/2]

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

Definition at line 5751 of file Chara.cs.

5752 {
5753 if (HasCooldown(a.id))
5754 {
5755 return false;
5756 }
5757 if (a.source.proc.TryGet(0) == "Heal" && HasElement(1422) && !IsPC)
5758 {
5759 List<int> list = new List<int> { 8400, 8401, 8402, 8403, 8404, 8405 };
5760 int num = list.IndexOf(a.id);
5761 if (num != -1)
5762 {
5763 int num2 = list.TryGet(num + Evalue(1422));
5764 a = elements.GetElement(num2)?.act ?? ACT.Create(num2);
5765 }
5766 }
5767 int num3 = 1;
5768 Act.Cost cost = a.GetCost(this);
5769 a.GetPower(this);
5770 int i = 1;
5771 int num4 = 0;
5772 bool flag = a.IsTargetHostileParty();
5773 if (IsPC && HasCondition<StanceManaCost>())
5774 {
5775 num4 = Evalue(1657);
5776 }
5777 _pts.Clear();
5778 if (a.TargetType.ForceParty)
5779 {
5780 pt = true;
5781 }
5782 if (pt)
5783 {
5784 i = 0;
5785 if (flag)
5786 {
5787 ForeachEnemy(delegate
5788 {
5789 i++;
5790 });
5791 }
5792 else
5793 {
5794 ForeachParty(delegate
5795 {
5796 i++;
5797 });
5798 }
5799 }
5800 if (a is Spell && IsPC && a.vPotential < i)
5801 {
5802 i = 1;
5803 _pts.Clear();
5804 _pts.Add(this);
5805 pt = false;
5806 }
5807 int num5 = 100;
5808 if (!a.TargetType.ForceParty && i > 1)
5809 {
5810 num5 = (IsPC ? (i * 100) : (50 + i * 50));
5811 }
5812 int num6 = cost.cost * num5 / 100;
5813 if (cost.type == Act.CostType.MP && Evalue(483) > 0)
5814 {
5815 num6 = num6 * 100 / (100 + (int)Mathf.Sqrt(Evalue(483) * 10) * 3);
5816 }
5817 if (i == 0)
5818 {
5819 if (IsPC)
5820 {
5822 }
5823 return false;
5824 }
5825 if (!IsPC && cost.type == Act.CostType.MP && mana.value < 0 && (EClass.rnd(4) != 0 || IsPCFaction || (base.IsPowerful && mana.value < -20)))
5826 {
5827 return false;
5828 }
5829 if (IsPC)
5830 {
5831 if (!Dialog.warned && cost.type == Act.CostType.MP && cost.cost > 0 && mana.value < num6 && !EClass.debug.godMode)
5832 {
5833 ActPlan.warning = true;
5834 Dialog.TryWarnMana(delegate
5835 {
5836 if (UseAbility(a, tc, pos, pt))
5837 {
5839 }
5840 });
5841 return false;
5842 }
5843 EClass.ui.CloseLayers();
5844 }
5845 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))
5846 {
5847 Say("shakeHead", this);
5848 return true;
5849 }
5850 if (tc != null && tc != this)
5851 {
5852 LookAt(tc.pos);
5853 }
5854 if (pos != null && !base.pos.Equals(pos))
5855 {
5856 LookAt(pos);
5857 }
5858 if (a.CanRapidFire && HasElement(1648))
5859 {
5860 num3 = 1 + Evalue(1648);
5861 }
5862 if (IsPC && cost.cost > 0 && a.Value == 0)
5863 {
5865 return false;
5866 }
5867 if (a is Spell)
5868 {
5869 string s = (isConfused ? "_cast_confuse" : (HasCondition<ConDim>() ? "_cast_dim" : ""));
5870 if (!a.source.tag.Contains("useHand"))
5871 {
5872 Say(race.castStyle.IsEmpty("cast"), this, a.source.GetName().ToLower(), s.lang());
5873 }
5874 if (IsPC)
5875 {
5876 _ = (i + 1) / 2;
5877 if (a.vPotential < i)
5878 {
5879 Msg.Say("noSpellStock");
5880 EInput.Consume();
5881 return false;
5882 }
5883 if (num4 > 0 && a.vPotential >= i * 2)
5884 {
5885 a.vPotential -= i * 2;
5886 num6 = num6 * (100 - num4 * 20) / 100;
5887 }
5888 else
5889 {
5890 a.vPotential -= i;
5891 }
5893 }
5894 }
5895 else if (a.source.langAct.Length != 0 && tc != null)
5896 {
5897 string text = a.source.langAct[0];
5898 string text2 = ((a.source.langAct.Length >= 2) ? a.source.langAct[1] : "");
5899 if (text == "spell_hand")
5900 {
5901 string[] list2 = Lang.GetList("attack" + race.meleeStyle.IsEmpty("Touch"));
5902 string @ref = text2.lang(list2[4]);
5903 Say(tc.IsPCParty ? "cast_hand_ally" : "cast_hand", this, tc, @ref, tc.IsPCParty ? list2[1] : list2[2]);
5904 }
5905 else
5906 {
5907 Say(text, this, tc, text2.IsEmpty() ? "" : text2.lang());
5908 }
5909 if (a.source.id == 6630)
5910 {
5911 Talk("insult_" + (base.IsMale ? "m" : "f"));
5912 }
5913 }
5914 switch (cost.type)
5915 {
5916 case Act.CostType.MP:
5917 if (Evalue(1421) >= 2 && base.hp <= MaxHP / (9 - Evalue(1421) * 2))
5918 {
5919 num6 /= 2;
5920 }
5921 PlayEffect("cast");
5922 mana.Mod(-num6);
5923 if (isDead)
5924 {
5925 return true;
5926 }
5927 elements.ModExp(304, Mathf.Clamp(num6 * 2, 1, 200));
5928 break;
5929 case Act.CostType.SP:
5930 stamina.Mod(-num6);
5931 ignoreSPAbsorb = true;
5932 break;
5933 }
5934 if (a is Spell && GetCondition<ConSilence>() != null)
5935 {
5936 Say("cast_silence", this);
5937 return true;
5938 }
5939 if (isDead)
5940 {
5941 return true;
5942 }
5943 int spellExp = elements.GetSpellExp(this, a, num5);
5944 if (EClass.rnd(100) >= CalcCastingChance(a, i) && !EClass.debug.godMode)
5945 {
5946 Say("fizzle", this);
5947 PlayEffect("fizzle");
5948 PlaySound("fizzle");
5949 if (cost.cost > 0 && a.source.lvFactor > 0)
5950 {
5951 ModExp(a.id, spellExp / 5);
5952 }
5953 RemoveCondition<ConInvisibility>();
5954 return true;
5955 }
5956 bool flag2 = true;
5957 if (HasTalk("phrase_" + a.source.alias))
5958 {
5959 EClass.player.forceTalk = true;
5960 Talk("phrase_" + a.source.alias);
5961 }
5962 if (pt)
5963 {
5964 Act.forcePt = true;
5965 if (flag)
5966 {
5967 ForeachEnemy(delegate(Chara c)
5968 {
5969 a.Perform(this, c, c.pos);
5970 });
5971 }
5972 else
5973 {
5974 ForeachParty(delegate(Chara c)
5975 {
5976 a.Perform(this, c, c.pos);
5977 });
5978 }
5979 Act.forcePt = false;
5980 }
5981 else
5982 {
5983 for (int j = 0; j < num3; j++)
5984 {
5985 if (a.TargetType != TargetType.SelfParty && tc != null && !tc.IsAliveInCurrentZone)
5986 {
5987 break;
5988 }
5989 ActEffect.RapidCount = j;
5990 ActEffect.RapidDelay = a.RapidDelay;
5991 flag2 = a.Perform(this, tc, pos);
5992 }
5993 }
5994 if (flag2 && !isDead)
5995 {
5996 if (cost.cost > 0 && a.source.lvFactor > 0)
5997 {
5998 ModExp(a.id, spellExp);
5999 }
6000 if (a.source.alias.StartsWith("sword_"))
6001 {
6002 ModExp(101, 50);
6003 }
6004 }
6005 ActEffect.RapidCount = 0;
6006 if (a.source.cooldown > 0 && (!IsPC || !a.source.tag.Contains("CD_npc")))
6007 {
6008 AddCooldown(a.id, a.source.cooldown);
6009 }
6010 if (flag2 && !a.source.tag.Contains("keepInvisi") && EClass.rnd(2) == 0)
6011 {
6012 RemoveCondition<ConInvisibility>();
6013 }
6014 return flag2;
6015 void ForeachEnemy(Action<Chara> action)
6016 {
6017 if (_pts.Count == 0)
6018 {
6019 for (int num10 = EClass._map.charas.Count - 1; num10 >= 0; num10--)
6020 {
6021 Chara chara3 = EClass._map.charas[num10];
6022 if (chara3 != this && CanSeeLos(chara3) && chara3.IsHostile(this))
6023 {
6024 _pts.Add(chara3);
6025 }
6026 }
6027 }
6028 for (int num11 = _pts.Count - 1; num11 >= 0; num11--)
6029 {
6030 action(_pts[num11]);
6031 }
6032 }
6033 void ForeachParty(Action<Chara> action)
6034 {
6035 if (_pts.Count == 0)
6036 {
6037 if (IsPCParty)
6038 {
6039 for (int num7 = EClass.pc.party.members.Count - 1; num7 >= 0; num7--)
6040 {
6041 Chara chara = EClass.pc.party.members[num7];
6042 if (chara == this || chara.host != null || CanSeeLos(chara))
6043 {
6044 _pts.Add(chara);
6045 }
6046 }
6047 }
6048 else
6049 {
6050 for (int num8 = EClass._map.charas.Count - 1; num8 >= 0; num8--)
6051 {
6052 Chara chara2 = EClass._map.charas[num8];
6053 if ((chara2 == this || (chara2.IsFriendOrAbove(this) && CanSeeLos(chara2))) && (chara2 == tc || _pts.Count < 3 || EClass.rnd(_pts.Count * _pts.Count) > 6))
6054 {
6055 _pts.Add(chara2);
6056 }
6057 }
6058 }
6059 }
6060 for (int num9 = _pts.Count - 1; num9 >= 0; num9--)
6061 {
6062 action(_pts[num9]);
6063 }
6064 }
6065 }
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:6627
bool UseAbility(string idAct, Card tc=null, Point pos=null, bool pt=false)
Definition: Chara.cs:5746
static List< Chara > _pts
Definition: Chara.cs:184
int CalcCastingChance(Element e, int num=1)
Definition: Chara.cs:6076
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:1071
virtual Act.Cost GetCost(Chara c)
Definition: ELEMENT.cs:1024
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, host, Element.id, IsFriendOrAbove(), IsHostile(), Act.IsTargetHostileParty(), SourceRace.Row.meleeStyle, Party.members, Stats.Mod(), 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/2]

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

◆ ValidateWorks()

void Chara.ValidateWorks ( )
inline

Definition at line 9060 of file Chara.cs.

9061 {
9062 _goalWork.FindWork(this, setAI: false);
9064 }
static GoalHobby _goalHobby
Definition: Chara.cs:206
static GoalWork _goalWork
Definition: Chara.cs:204
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 5197 of file Chara.cs.

5198 {
5199 base.c_vomit++;
5200 Say("vomit", this);
5201 PlaySound("vomit");
5202 if (!EClass._zone.IsRegion)
5203 {
5204 Thing thing = ThingGen.Create("731");
5206 {
5207 thing.MakeRefFrom(this);
5208 }
5209 EClass._zone.AddCard(thing, pos);
5210 }
5211 if (HasCondition<ConAnorexia>())
5212 {
5213 ModExp(70, -50);
5214 ModExp(71, -75);
5215 ModExp(77, -100);
5216 }
5217 else if (base.c_vomit > 10)
5218 {
5219 AddCondition<ConAnorexia>();
5220 }
5221 AddCondition<ConDim>();
5222 if (HasCondition<ConAnorexia>())
5223 {
5224 ModWeight(-1 * (1 + EClass.rnd(5)));
5225 }
5226 if (hunger.GetPhase() >= 4)
5227 {
5228 DamageHP(9999L, AttackSource.Hunger);
5229 }
5230 hunger.Mod(30);
5231 }
void ModWeight(int a, bool ignoreLimit=false)
Definition: Chara.cs:9610

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

3638 {
3639 for (int num = conditions.Count - 1; num >= 0; num--)
3640 {
3641 if (conditions[num].ConsumeTurn)
3642 {
3643 return true;
3644 }
3645 }
3646 return false;
3647 }

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

7168 {
7169 n.Clear();
7170 UIItem uIItem = n.AddHeaderCard(base.Name.ToTitleCase());
7171 SetImage(uIItem.image2);
7172 uIItem.text2.SetText(race.GetText().ToTitleCase(wholeText: true) + " " + job.GetText().ToTitleCase(wholeText: true));
7173 n.AddText("");
7174 n.Build();
7175 }
void SetImage(Image image, int dir, int idSkin=0)
Definition: Card.cs:6018
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 202 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 154 of file Chara.cs.

Referenced by SetFaction().

◆ _goalHobby

GoalHobby Chara._goalHobby = new GoalHobby()
staticprivate

Definition at line 206 of file Chara.cs.

◆ _goalWork

GoalWork Chara._goalWork = new GoalWork()
staticprivate

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

◆ _listFavFood

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

Definition at line 190 of file Chara.cs.

◆ _ListItems

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

Definition at line 188 of file Chara.cs.

◆ _NoGoalPC

NoGoal Chara._NoGoalPC = new NoGoal()
static

Definition at line 194 of file Chara.cs.

◆ _NoGoalRepeat

NoGoal Chara._NoGoalRepeat = new NoGoal()
static

Definition at line 196 of file Chara.cs.

Referenced by ActPlan.Item.Perform().

◆ _pts

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

Definition at line 184 of file Chara.cs.

◆ _race

SourceRace.Row Chara._race

Definition at line 158 of file Chara.cs.

Referenced by ChangeRace(), and OnCreate().

◆ _sharedPos

Point Chara._sharedPos = new Point()
staticprivate

Definition at line 172 of file Chara.cs.

Referenced by TryMoveTowards().

◆ _Speed

long Chara._Speed
private

Definition at line 170 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 162 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 176 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 178 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 168 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 198 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 174 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 182 of file Chara.cs.

◆ isParalyzed

bool Chara.isParalyzed

Definition at line 132 of file Chara.cs.

Referenced by Point.ListWitnesses().

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

Referenced by OnCreate().

◆ ListAdvRace

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

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

Referenced by LayerEditSkin.RefreshImage().

◆ stealthSeen

int Chara.stealthSeen

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

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

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

◆ _alias

string Chara._alias
getset

Definition at line 216 of file Chara.cs.

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

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

◆ _idTimeTable

int Chara._idTimeTable
getset

Definition at line 338 of file Chara.cs.

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

Referenced by OnCreate().

◆ _maxStamina

int Chara._maxStamina
getset

Definition at line 362 of file Chara.cs.

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

Referenced by CalculateMaxStamina().

◆ ability

◆ actorPrefab

override string Chara.actorPrefab
get

Definition at line 516 of file Chara.cs.

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

◆ affinity

◆ Aka

◆ AliasMaterialOnCreate

override string Chara.AliasMaterialOnCreate
get

Definition at line 556 of file Chara.cs.

◆ baseWorkElements

ElementContainer Chara.baseWorkElements
get

Definition at line 1108 of file Chara.cs.

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

◆ bladder

Stats Chara.bladder
get

Definition at line 1148 of file Chara.cs.

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

◆ burden

◆ CanGainConResist

bool Chara.CanGainConResist
get

Definition at line 1158 of file Chara.cs.

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

◆ CanOpenDoor

bool Chara.CanOpenDoor
get

Definition at line 816 of file Chara.cs.

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

◆ CanWitness

bool Chara.CanWitness
get

Definition at line 1000 of file Chara.cs.

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

Referenced by Point.ListWitnesses().

◆ corruption

int Chara.corruption
getset

Definition at line 374 of file Chara.cs.

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

Referenced by CanDuplicate().

◆ CurrentGeneSlot

int Chara.CurrentGeneSlot
get

Definition at line 1068 of file Chara.cs.

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

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

◆ CurrentSpan

TimeTable.Span Chara.CurrentSpan
get

Definition at line 834 of file Chara.cs.

Referenced by ConSleep.Tick().

◆ currentZone

Zone Chara.currentZone
getset

Definition at line 252 of file Chara.cs.

253 {
254 get
255 {
256 return RefZone.Get(_cints[1]);
257 }
258 set
259 {
260 _cints[1] = RefZone.Set(value);
261 }
262 }
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 326 of file Chara.cs.

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

◆ depression

Stats Chara.depression
get

Definition at line 1146 of file Chara.cs.

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

◆ DestDist

int Chara.DestDist
get

Definition at line 996 of file Chara.cs.

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

◆ DV

override int Chara.DV
get

Definition at line 726 of file Chara.cs.

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

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

◆ faction

Faction Chara.faction
getset

Definition at line 424 of file Chara.cs.

425 {
426 get
427 {
428 return _faction ?? (_faction = EClass.game.factions.dictAll.TryGetValue(idFaction));
429 }
430 set
431 {
432 idFaction = value?.uid;
433 }
434 }
string idFaction
Definition: Chara.cs:241
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(), 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 544 of file Chara.cs.

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

Referenced by CharaActor.RefreshSprite().

◆ goalListType

GoalListType Chara.goalListType
getset

Definition at line 276 of file Chara.cs.

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

◆ HasHost

override bool Chara.HasHost
get

Definition at line 686 of file Chara.cs.

Referenced by ActEffect.Proc().

◆ HasNoGoal

◆ homeBranch

◆ homeZone

◆ hostility

◆ hunger

◆ hygiene

Stats Chara.hygiene
get

Definition at line 1150 of file Chara.cs.

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

◆ idFaction

string Chara.idFaction
getset

Definition at line 240 of file Chara.cs.

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

◆ idFaith

string Chara.idFaith
getset

Definition at line 228 of file Chara.cs.

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

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

◆ IDPCCBodySet

string Chara.IDPCCBodySet
get

Definition at line 488 of file Chara.cs.

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

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

◆ idTimeTable

string Chara.idTimeTable
get

Definition at line 466 of file Chara.cs.

Referenced by LayerQuestBoard.RefreshHire().

◆ interest

int Chara.interest
getset

Definition at line 314 of file Chara.cs.

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

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

◆ IsAdventurer

bool Chara.IsAdventurer
get

Definition at line 1038 of file Chara.cs.

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

◆ isAlawysVisible

bool Chara.isAlawysVisible
getset

Definition at line 398 of file Chara.cs.

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

◆ IsAliveInCurrentZone

◆ IsAnimal

bool Chara.IsAnimal
get

Definition at line 864 of file Chara.cs.

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

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

◆ IsCat

bool Chara.IsCat
get

Definition at line 984 of file Chara.cs.

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

Referenced by Affinity.OnGift(), AI_Eat.Run(), and AI_Idle.Run().

◆ isChara

override bool Chara.isChara
get

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

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

◆ IsEyth

bool Chara.IsEyth
get

◆ IsFairy

bool Chara.IsFairy
get

Definition at line 936 of file Chara.cs.

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

Referenced by Faction.IsWearingPanty().

◆ IsFish

bool Chara.IsFish
get

Definition at line 924 of file Chara.cs.

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

◆ IsGlobal

◆ IsGod

bool Chara.IsGod
get

Definition at line 948 of file Chara.cs.

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

◆ IsHorror

bool Chara.IsHorror
get

Definition at line 912 of file Chara.cs.

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

Referenced by Refresh().

◆ IsHuman

bool Chara.IsHuman
get

Definition at line 876 of file Chara.cs.

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

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

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

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

◆ IsIdle

bool Chara.IsIdle
get

Definition at line 850 of file Chara.cs.

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

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

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

◆ IsLocalChara

bool Chara.IsLocalChara
get

Definition at line 838 of file Chara.cs.

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

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

◆ IsMachine

bool Chara.IsMachine
get

Definition at line 900 of file Chara.cs.

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

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

◆ IsMaid

bool Chara.IsMaid
get

Definition at line 1024 of file Chara.cs.

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

Referenced by FactionBranch.GetMaid().

◆ IsMinion

override bool Chara.IsMinion
get

Definition at line 624 of file Chara.cs.

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

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

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

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

◆ IsMoving

override bool Chara.IsMoving
get

Definition at line 606 of file Chara.cs.

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

◆ IsMultisize

◆ IsPC

override bool Chara.IsPC
get

Definition at line 610 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(), 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 668 of file Chara.cs.

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

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

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

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

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

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

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

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

◆ IsPlant

bool Chara.IsPlant
get

Definition at line 972 of file Chara.cs.

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

Referenced by GoalCombat.Run().

◆ IsPrisoner

bool Chara.IsPrisoner
get

Definition at line 1036 of file Chara.cs.

◆ isSynced

override bool Chara.isSynced
get

◆ isThing

override bool Chara.isThing
get

Definition at line 682 of file Chara.cs.

◆ IsUndead

bool Chara.IsUndead
get

Definition at line 888 of file Chara.cs.

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

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

◆ IsWealthy

bool Chara.IsWealthy
get

Definition at line 1052 of file Chara.cs.

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

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

◆ job

◆ knowFav

bool Chara.knowFav
getset

Definition at line 410 of file Chara.cs.

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

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

◆ MainElement

Element Chara.MainElement
get

Definition at line 714 of file Chara.cs.

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

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

Referenced by ActEffect.Proc().

◆ OriginalHostility

Hostility Chara.OriginalHostility
get

Definition at line 468 of file Chara.cs.

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

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

◆ Pref

override SourcePref Chara.Pref
get

Definition at line 784 of file Chara.cs.

785 {
786 get
787 {
788 if (spriteReplacer != null)
789 {
791 }
792 if (base.idSkin > 0)
793 {
794 switch (sourceCard.tiles.TryGet(base.idSkin))
795 {
796 case 2319:
797 case 2619:
798 case 2621:
799 case 2623:
800 case 2625:
802 case 2320:
803 case 2611:
804 case 2620:
805 case 2622:
806 case 2624:
807 case 2626:
808 case 2828:
810 }
811 }
812 return sourceCard.pref;
813 }
814 }
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 CharaRenderer.Draw(), BaseTileMap.DrawTile(), and LayerEditSkin.OnClickEdit().

◆ PrefIndex

override int Chara.PrefIndex
get

Definition at line 528 of file Chara.cs.

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

◆ PV

override int Chara.PV
get

Definition at line 755 of file Chara.cs.

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

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

◆ race

◆ SAN

◆ SelfWeight

override int Chara.SelfWeight
get

Definition at line 710 of file Chara.cs.

◆ sleepiness

Stats Chara.sleepiness
get

◆ sourceCard

override CardRow Chara.sourceCard
get

◆ sourceRenderCard

override CardRow Chara.sourceRenderCard
get

Definition at line 450 of file Chara.cs.

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

◆ Speed

int Chara.Speed
get

Definition at line 1080 of file Chara.cs.

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

Referenced by GameUpdater.ConditionUpdater.FixedUpdate().

◆ stamina

◆ tactics

Tactics Chara.tactics
get

Definition at line 832 of file Chara.cs.

◆ trait

◆ uidEditor

int Chara.uidEditor
getset

Definition at line 350 of file Chara.cs.

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

Referenced by SerializedCards.Add().

◆ WeightLimit

override int Chara.WeightLimit
get

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