Elin Decompiled Documentation EA 23.222 Stable nyan
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 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 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)
 
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
 
int _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 6496 of file Chara.cs.

6497 {
6498 CardRenderer cardRenderer = renderer;
6499 CharaRenderer charaRenderer = new CharaRenderer();
6500 if (source.skinAntiSpider != 0 && EClass.core.config.game.antiSpider)
6501 {
6502 base.idSkin = source.skinAntiSpider;
6503 }
6504 if (host != null)
6505 {
6506 charaRenderer.pccData = PCCData.Create("ride");
6507 string idPart = base.c_idRidePCC.IsEmpty(EClass.core.pccs.sets["ride"].map["body"].map.Keys.First());
6508 charaRenderer.pccData.SetPart("body", "ride", idPart);
6509 charaRenderer.pccData.ride = EClass.core.pccs.GetRideData(idPart);
6510 }
6511 else
6512 {
6513 foreach (Condition condition in conditions)
6514 {
6515 RendererReplacer rendererReplacer = condition.GetRendererReplacer();
6516 if (rendererReplacer != null)
6517 {
6518 charaRenderer.replacer = rendererReplacer;
6519 charaRenderer.data = rendererReplacer.data;
6520 break;
6521 }
6522 }
6523 if (charaRenderer.replacer == null)
6524 {
6525 charaRenderer.pccData = pccData;
6526 }
6527 }
6528 renderer = charaRenderer;
6529 renderer.SetOwner(this);
6530 if (cardRenderer != null)
6531 {
6532 renderer.SetFirst(first: false, cardRenderer.position);
6533 }
6534 return charaRenderer;
6535 }
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 2279 of file Chara.cs.

2280 {
2281 if (EClass.pc.homeBranch != null)
2282 {
2284 }
2285 else
2286 {
2287 SetGlobal();
2289 }
2290 Hostility hostility2 = (base.c_originalHostility = Hostility.Ally);
2291 this.hostility = hostility2;
2292 orgPos = null;
2293 base.c_summonDuration = 0;
2294 base.isSummon = false;
2295 ReleaseMinion();
2296 SetInt(32);
2297 Refresh();
2298 }
Hostility
Definition: Hostility.cs:2
list. Refresh()
void SetInt(int id, int value=0)
Definition: BaseCard.cs:39
void ReleaseMinion()
Definition: Chara.cs:2336
Chara SetFaction(Faction f)
Definition: Chara.cs:1413
Point orgPos
Definition: Chara.cs:21
FactionBranch homeBranch
Definition: Chara.cs:1064
Chara SetGlobal()
Definition: Chara.cs:1480
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 2716 of file Chara.cs.

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

7073 {
7074 EClass.Sound.Play("pop_drama");
7075 if (book == "_chara" && IsPC)
7076 {
7077 step = "pc";
7078 }
7079 return LayerDrama.Activate(book, sheet, step, this, null, tag);
7080 }
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 8991 of file Chara.cs.

8992 {
8993 c.owner = this;
8994 if (!(c is ConBurning))
8995 {
8996 if (c is ConBleed && ResistLv(964) >= 3)
8997 {
8998 return null;
8999 }
9000 }
9001 else if (ResistLv(950) >= 3)
9002 {
9003 return null;
9004 }
9006 {
9007 if (c.GainResistFactor >= 400)
9008 {
9009 c.power /= 2;
9010 }
9011 ResistCon(c);
9012 if (c.power <= 0)
9013 {
9014 return null;
9015 }
9016 }
9017 if (!force)
9018 {
9019 if (c.source.negate.Length != 0)
9020 {
9021 string[] negate = c.source.negate;
9022 foreach (string text in negate)
9023 {
9024 if (HasElement(text))
9025 {
9026 return null;
9027 }
9028 }
9029 }
9030 Element defenseAttribute = c.GetDefenseAttribute(this);
9031 if (defenseAttribute != null)
9032 {
9033 c.power = 100 * c.power / Mathf.Max(100 + defenseAttribute.Value, 1);
9034 }
9035 if (c.source.resistance.Length != 0)
9036 {
9037 int num = ResistLv(EClass.sources.elements.alias[c.source.resistance[0]].id);
9038 if (num > 0)
9039 {
9040 c.power /= num * num + 1;
9041 if (c.power <= 40)
9042 {
9043 return null;
9044 }
9045 }
9046 }
9047 c.power = c.EvaluatePower(c.power);
9048 if (c.power <= 0)
9049 {
9050 return null;
9051 }
9052 }
9053 for (int j = 0; j < conditions.Count; j++)
9054 {
9055 if (conditions[j].id != c.id)
9056 {
9057 continue;
9058 }
9059 if (c.Type == ConditionType.Stance || c.IsToggle)
9060 {
9061 conditions[j].Kill();
9062 return null;
9063 }
9064 if (conditions[j].CanStack(c))
9065 {
9066 if (conditions[j].WillOverride)
9067 {
9068 conditions[j].Kill(silent: true);
9069 continue;
9070 }
9071 if (CanGainConResist)
9072 {
9073 AddResistCon(c);
9074 }
9075 conditions[j].OnStacked(c.power);
9076 conditions[j].OnStartOrStack();
9077 conditions[j].PlayEffect();
9078 }
9079 if (!conditions[j].AllowMultipleInstance)
9080 {
9081 return null;
9082 }
9083 }
9084 foreach (Condition condition in conditions)
9085 {
9086 if (condition.TryNullify(c))
9087 {
9088 return null;
9089 }
9090 }
9091 int num2 = c.EvaluateTurn(c.power);
9092 if (num2 == 0)
9093 {
9094 return null;
9095 }
9096 c.value = num2;
9097 conditions.Add(c);
9098 if (CanGainConResist)
9099 {
9100 AddResistCon(c);
9101 }
9102 c.SetOwner(this);
9103 c.Start();
9104 SetDirtySpeed();
9105 if (c.ShouldRefresh)
9106 {
9107 Refresh();
9108 }
9109 if (c.CancelAI)
9110 {
9111 ai.Cancel();
9112 }
9113 if (IsPC && c.ConsumeTurn && !EClass.pc.isRestrained)
9114 {
9116 }
9117 if (c.SyncRide && (ride != null || parasite != null))
9118 {
9119 if (ride != null)
9120 {
9122 }
9123 if (parasite != null)
9124 {
9126 }
9127 }
9128 return c;
9129 }
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:5782
void SetDirtySpeed()
Definition: Chara.cs:1842
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:8986
bool CanGainConResist
Definition: Chara.cs:1155
void AddResistCon(Condition con)
Definition: Chara.cs:9386
void ResistCon(Condition con)
Definition: Chara.cs:9406
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:2061
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 8981 of file Chara.cs.

8981 : Condition
8982 {
8983 return AddCondition(typeof(T).Name, p, force);
8984 }
string Name
Definition: Card.cs:2125

◆ AddCooldown()

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

Definition at line 8430 of file Chara.cs.

8431 {
8432 if (_cooldowns == null)
8433 {
8434 _cooldowns = new List<int>();
8435 }
8436 if (turns != 0)
8437 {
8438 _cooldowns.Add(idEle * 1000 + turns);
8439 return;
8440 }
8441 SourceElement.Row row = EClass.sources.elements.map[idEle];
8442 if (row.cooldown > 0)
8443 {
8444 _cooldowns.Add(idEle * 1000 + row.cooldown);
8445 }
8446 }
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 9852 of file Chara.cs.

9853 {
9854 if (!IsPCFaction || !IsGlobal)
9855 {
9856 _historyFood = null;
9857 return;
9858 }
9859 if (_historyFood == null)
9860 {
9861 _historyFood = new List<List<string>>
9862 {
9863 new List<string>()
9864 };
9865 }
9866 if (_historyFood[0].Count < 5)
9867 {
9868 _historyFood[0].Add(food.id);
9869 }
9870 }
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 8816 of file Chara.cs.

8817 {
8818 foreach (int hobby in _hobbies)
8819 {
8820 if (hobby == id)
8821 {
8822 return;
8823 }
8824 }
8825 _hobbies.Add(id);
8826 }
List< int > _hobbies
Definition: Chara.cs:49

◆ AddRandomBodyPart()

void Chara.AddRandomBodyPart ( bool  msg = false)
inline

Definition at line 2174 of file Chara.cs.

2175 {
2176 int ele = new int[9] { 30, 31, 33, 35, 35, 36, 34, 37, 39 }.RandomItem();
2177 body.AddBodyPart(ele);
2178 if (msg)
2179 {
2180 Say("gain_bodyparts", this, Element.Get(ele).GetName().ToLower());
2181 PlaySound("offering");
2182 }
2183 }
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 9386 of file Chara.cs.

9387 {
9388 if (con.power > 0 && con.GainResistFactor > 0)
9389 {
9390 int key = con.id;
9391 if (resistCon == null)
9392 {
9393 resistCon = new Dictionary<int, int>();
9394 }
9395 if (resistCon.ContainsKey(key))
9396 {
9397 resistCon[key] += con.power * con.GainResistFactor / 100;
9398 }
9399 else
9400 {
9401 resistCon[key] = con.power * con.GainResistFactor / 100;
9402 }
9403 }
9404 }
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 8828 of file Chara.cs.

8829 {
8830 foreach (int work in _works)
8831 {
8832 if (work == id)
8833 {
8834 return;
8835 }
8836 }
8837 _works.Add(id);
8838 }
List< int > _works
Definition: Chara.cs:52

◆ ApplyDeathPenalty()

void Chara.ApplyDeathPenalty ( )
inline

Definition at line 5124 of file Chara.cs.

5125 {
5126 if (!IsPC)
5127 {
5128 return;
5129 }
5130 int currency = GetCurrency();
5131 if (currency > 0)
5132 {
5133 int num = currency / 3 + EClass.rnd(currency / 3 + 1);
5134 if (num <= 0)
5135 {
5136 num = 1;
5137 }
5138 Msg.Say("panaltyMoney", this, Lang._currency(num));
5139 ModCurrency(-num);
5141 }
5142 foreach (Element value in EClass.pc.elements.dict.Values)
5143 {
5144 if (EClass.rnd(5) == 0 && value.IsMainAttribute)
5145 {
5146 EClass.pc.elements.ModExp(value.id, -500f);
5147 }
5148 }
5149 }
@ currency
ElementContainerCard elements
Definition: Card.cs:41
int GetCurrency(string id="money")
Definition: Card.cs:3905
void ModCurrency(int a, string id="money")
Definition: Card.cs:3891
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:1950

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

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

2137 {
2138 elements.ApplyElementMap(base.uid, SourceValueType.Chara, job.elementMap, base.DefaultLV, remove, applyFeat: true);
2139 if (IsPCC)
2140 {
2141 EClass.game.uniforms.Apply(pccData, job.id, base.IsMale, canUseOtherGender: true);
2142 }
2143 }
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:191

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

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

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

Referenced by ChangeRace(), and OnCreate().

◆ CalcBurden()

void Chara.CalcBurden ( )
inline

Definition at line 1810 of file Chara.cs.

1811 {
1812 int num = base.ChildrenWeight * 100 / Mathf.Max(1, WeightLimit);
1813 if (num < 0)
1814 {
1815 num = 1000;
1816 }
1818 {
1819 num = 0;
1820 }
1821 burden.Set(num);
1822 SetDirtySpeed();
1823 }
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 6030 of file Chara.cs.

6031 {
6032 if (!(e is Spell))
6033 {
6034 return 100;
6035 }
6036 if (!IsPC)
6037 {
6038 int num2 = 95;
6039 if (host != null)
6040 {
6041 if (host.ride == this)
6042 {
6043 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.EvalueRiding()));
6044 }
6045 if (host.parasite == this)
6046 {
6047 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.Evalue(227)));
6048 }
6049 }
6050 return num2;
6051 }
6052 int num3 = Evalue(304);
6053 if (!IsPCFaction)
6054 {
6055 num3 = Mathf.Max(num3, base.LV + 5);
6056 }
6057 int num4 = 0;
6058 int num5 = 0;
6059 bool num6 = GetArmorSkill() == 122;
6060 AttackStyle attackStyle = body.GetAttackStyle();
6061 if (num6)
6062 {
6063 num4 = 20 - Evalue(122) / 5;
6064 num5 += 10 - Evalue(1654) * 4;
6065 }
6066 else
6067 {
6068 num4 = 10 - Evalue(120) / 5;
6069 }
6070 if (num4 < 5)
6071 {
6072 num4 = 5;
6073 }
6074 if (ride != null)
6075 {
6076 num4 += 5;
6077 }
6078 if (parasite != null)
6079 {
6080 num4 += 10;
6081 }
6082 if (attackStyle == AttackStyle.TwoWield)
6083 {
6084 num4 += 5;
6085 }
6086 if (attackStyle == AttackStyle.Shield)
6087 {
6088 num4 += 10;
6089 num5 += 20 - Evalue(1654) * 8;
6090 }
6091 if (isConfused)
6092 {
6093 num4 += 10000;
6094 }
6095 if (HasCondition<ConDim>())
6096 {
6097 num4 += ((Evalue(1654) >= 3) ? 1500 : 2500);
6098 }
6099 if (num > 1)
6100 {
6101 num4 += 5 * num;
6102 }
6103 if (num5 < 0)
6104 {
6105 num5 = 0;
6106 }
6107 return Mathf.Clamp(100 + e.Value - 10 - e.source.LV * e.source.cost[0] * num4 / Mathf.Max(10 + num3 * 10, 1), 0, 100 - num5);
6108 }
AttackStyle
Definition: AttackStyle.cs:2
AttackStyle GetAttackStyle()
Definition: CharaBody.cs:433
override int GetArmorSkill()
Definition: Chara.cs:7659
int EvalueRiding()
Definition: Chara.cs:6021
SourceElement.Row source
Definition: ELEMENT.cs:273
Definition: SPELL.cs:578

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

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

6293 {
6294 foreach (Chara chara in EClass._map.charas)
6295 {
6296 if (!chara.IsPCFaction && chara.OriginalHostility == OriginalHostility && (fanatic || Dist(chara) <= 6) && (EClass.rnd(3) != 0 || fanatic))
6297 {
6298 chara.GoHostile(tg);
6299 }
6300 }
6301 }
Hostility OriginalHostility
Definition: Chara.cs:469
void GoHostile(Card _tg)
Definition: Chara.cs:6186
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 7998 of file Chara.cs.

7999 {
8000 if (things.IsFull())
8001 {
8002 return false;
8003 }
8004 if (t.c_isImportant)
8005 {
8006 return false;
8007 }
8008 if (t.id == "1084")
8009 {
8010 return true;
8011 }
8012 if (t.trait is TraitBookSecret)
8013 {
8014 return true;
8015 }
8016 if (t.trait.CanOnlyCarry || !t.trait.CanBeDestroyed || t.trait.CanExtendBuild || t.rarity == Rarity.Artifact || t.IsContainer)
8017 {
8018 return false;
8019 }
8020 return true;
8021 }
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 7977 of file Chara.cs.

7978 {
7980 {
7981 return true;
7982 }
7983 if (!IsValidGiftWeight(t, num))
7984 {
7985 return false;
7986 }
7987 if (t.c_isImportant)
7988 {
7989 return false;
7990 }
7991 if ((t.category.IsChildOf("furniture") || t.category.IsChildOf("junk")) && !HasElement(1411))
7992 {
7993 return false;
7994 }
7995 return true;
7996 }
SourceCategory.Row category
Definition: Card.cs:2037
bool IsValidGiftWeight(Card t, int num=-1)
Definition: Chara.cs:7967

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

4189 {
4190 return true;
4191 }

◆ CanBeTempAlly()

bool Chara.CanBeTempAlly ( Chara  c)
inline

Definition at line 2300 of file Chara.cs.

2301 {
2302 if (IsPCFaction || IsGlobal || IsMinion || IsMultisize || EClass._zone.CountMinions(c) > c.MaxSummon || base.rarity >= Rarity.Legendary)
2303 {
2304 return false;
2305 }
2306 if (HasElement(1222))
2307 {
2308 return false;
2309 }
2310 return true;
2311 }
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:3683

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

Referenced by GoalCombat.Run().

◆ CanDestroyPath()

bool Chara.CanDestroyPath ( )
inline

Definition at line 2384 of file Chara.cs.

2385 {
2386 if (!IsMultisize)
2387 {
2388 if (base.rarity >= Rarity.Superior && !base.IsPCFactionOrMinion && ai is GoalCombat && !EClass._zone.IsPCFaction)
2389 {
2390 return !(EClass._zone is Zone_Town);
2391 }
2392 return false;
2393 }
2394 return true;
2395 }

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

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

◆ CanDuplicate()

bool Chara.CanDuplicate ( )
inline

Definition at line 1749 of file Chara.cs.

1750 {
1751 if (EClass._zone.IsRegion || HasCondition<ConPoison>() || HasCondition<ConConfuse>() || HasCondition<ConDim>() || HasCondition<ConParalyze>() || HasCondition<ConSleep>() || HasCondition<ConBurning>() || HasCondition<ConFreeze>() || HasCondition<ConMiasma>() || corruption >= 100)
1752 {
1753 return false;
1754 }
1756 {
1757 return false;
1758 }
1759 if (id == "mech_scarab" && (isSynced || pos.cell.light > 0 || (!EClass._map.IsIndoor && !pos.cell.HasRoof && !EClass.world.date.IsNight)))
1760 {
1761 return false;
1762 }
1763 return true;
1764 }
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:221
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 7420 of file Chara.cs.

7421 {
7422 if (t.IsDecayed && !HasElement(480))
7423 {
7424 return false;
7425 }
7426 if (shouldEat && (!(t.trait is TraitFoodPrepared) || t.c_isImportant))
7427 {
7428 return false;
7429 }
7430 if (!t.IsNegativeGift && !t.HasTag(CTAG.ignoreUse) && !t.isEquipped)
7431 {
7432 return t.trait.CanEat(this);
7433 }
7434 return false;
7435 }
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:975

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

7559 {
7560 return !body.IsTooHeavyToEquip(t);
7561 }
bool IsTooHeavyToEquip(Thing thing)
Definition: CharaBody.cs:156

References CharaBody.IsTooHeavyToEquip().

Referenced by GoalAutoCombat.TryUseRanged().

◆ CanInsult()

bool Chara.CanInsult ( )
inline

Definition at line 7898 of file Chara.cs.

7899 {
7900 foreach (ActList.Item item in ability.list.items)
7901 {
7902 if (item.act.id == 6630)
7903 {
7904 return true;
7905 }
7906 }
7907 return false;
7908 }
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 2491 of file Chara.cs.

2492 {
2493 return CanInteractTo(c.pos);
2494 }
bool CanInteractTo(Card c)
Definition: Chara.cs:2491

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

2497 {
2498 if (!p.IsValid)
2499 {
2500 return false;
2501 }
2502 if (EClass._map.cells[p.x, p.z].blocked)
2503 {
2504 return true;
2505 }
2506 if (!IsMultisize)
2507 {
2508 int num = ((p.z >= pos.z) ? ((p.x > pos.x) ? 1 : ((p.z > pos.z) ? 2 : 3)) : 0);
2509 if (EClass._map.cells[pos.x, pos.z].weights[num] == 0)
2510 {
2511 return false;
2512 }
2513 if (p.x != pos.x && p.z != pos.z)
2514 {
2515 Cell[,] cells = EClass._map.cells;
2516 int x = p.x;
2517 int z = pos.z;
2518 int num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2519 if (cells[pos.x, pos.z].weights[num2] == 0)
2520 {
2521 return false;
2522 }
2523 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2524 if (cells[p.x, p.z].weights[num2] == 0)
2525 {
2526 return false;
2527 }
2528 x = pos.x;
2529 z = p.z;
2530 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 }
2541 }
2542 return true;
2543 }
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 4183 of file Chara.cs.

4184 {
4185 return true;
4186 }

◆ CanMoveTo()

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

Definition at line 2397 of file Chara.cs.

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

4194 {
4195 if (c.isDestroyed)
4196 {
4197 return false;
4198 }
4199 Card rootCard = c.GetRootCard();
4200 if (rootCard.isDestroyed || (rootCard.ExistsOnMap && rootCard.pos.Distance(pos) > 1))
4201 {
4202 return false;
4203 }
4204 if (rootCard != this && things.IsFull(c.Thing))
4205 {
4206 return false;
4207 }
4208 return true;
4209 }
bool isDestroyed
Definition: Card.cs:75
bool ExistsOnMap
Definition: Card.cs:2073
virtual Thing Thing
Definition: Card.cs:2046
Card GetRootCard()
Definition: Card.cs:3356

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

3257 {
3259 {
3260 return false;
3261 }
3262 if (IsPC)
3263 {
3264 return true;
3265 }
3266 if (c.IsPC || c.pos.Equals(EClass.pc.pos) || c.host != null)
3267 {
3268 return false;
3269 }
3270 if (!IsHostile(c))
3271 {
3272 if (c.c_uidMaster != 0 || c.isSummon || base.IsPowerful || IsEscorted())
3273 {
3274 return true;
3275 }
3276 if (DestDist < c.DestDist)
3277 {
3278 return true;
3279 }
3280 if (IsPCParty && !c.IsPCParty)
3281 {
3282 return true;
3283 }
3284 if (IsPCFaction && !c.IsPCParty)
3285 {
3286 return true;
3287 }
3288 }
3289 return false;
3290 }
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:6387
bool IsEscorted()
Definition: Chara.cs:2368
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 5010 of file Chara.cs.

5011 {
5012 return EClass.world.date.IsExpired(base.c_dateDeathLock);
5013 }
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 1212 of file Chara.cs.

1213 {
1214 if (c == this)
1215 {
1216 return true;
1217 }
1218 if (!c.pos.IsValid)
1219 {
1220 return false;
1221 }
1222 if (c.isChara)
1223 {
1225 {
1226 return true;
1227 }
1228 if (c.isHidden && c != this && !canSeeInvisible)
1229 {
1230 return false;
1231 }
1232 }
1233 if (IsPC)
1234 {
1235 if (fov != null)
1236 {
1237 return fov.lastPoints.ContainsKey(c.pos.index);
1238 }
1239 return false;
1240 }
1241 return true;
1242 }
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 1253 of file Chara.cs.

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

1196 {
1197 if (!p.IsValid || p.IsHidden)
1198 {
1199 return false;
1200 }
1201 if (IsPC)
1202 {
1203 if (fov != null)
1204 {
1205 return fov.lastPoints.ContainsKey(p.index);
1206 }
1207 return false;
1208 }
1209 return true;
1210 }
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 1293 of file Chara.cs.

1294 {
1295 if (EClass._zone.events.GetEvent<ZoneEventQuest>() != null)
1296 {
1297 return false;
1298 }
1299 if (!EClass.debug.godMode && sleepiness.GetPhase() == 0)
1300 {
1301 return stamina.GetPhase() <= 1;
1302 }
1303 return true;
1304 }
Stats sleepiness
Definition: Chara.cs:1150
Stats stamina
Definition: Chara.cs:1140
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 2145 of file Chara.cs.

2146 {
2147 ApplyJob(remove: true);
2148 base.c_idJob = idNew;
2149 _job = null;
2150 ApplyJob();
2151 if (IsPCC)
2152 {
2153 PCC.Get(pccData).Build();
2154 }
2155 }
void ApplyJob(bool remove=false)
Definition: Chara.cs:2136
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 6880 of file Chara.cs.

6881 {
6882 memberType = type;
6883 }
FactionMemberType memberType
Definition: Chara.cs:46

◆ ChangeRace()

void Chara.ChangeRace ( string  idNew)
inline

Definition at line 2244 of file Chara.cs.

2245 {
2246 ApplyRace(remove: true);
2247 base.c_idRace = idNew;
2248 _race = null;
2249 ApplyRace();
2250 ChangeMaterial(source.defMat.IsEmpty(race.material));
2251 }
@ ChangeMaterial
void ApplyRace(bool remove=false)
Definition: Chara.cs:2222
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 1400 of file Chara.cs.

1401 {
1402 if (r != base.rarity)
1403 {
1404 base.rarity = r;
1405 if (renderer != null && renderer.isSynced)
1406 {
1408 }
1409 base.hp = MaxHP;
1410 }
1411 }
void RefreshExtra()

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

Referenced by ZonePreEnterBout.Execute().

◆ ChooseNewGoal()

void Chara.ChooseNewGoal ( )
inline

Definition at line 8487 of file Chara.cs.

8488 {
8489 if (IsPC && EClass.AdvMode)
8490 {
8491 SetNoGoal();
8492 return;
8493 }
8494 if (IsPCParty || base.noMove)
8495 {
8496 SetAI(new GoalIdle());
8497 return;
8498 }
8499 if ((IsHomeMember() && IsInHomeZone()) || IsGuest())
8500 {
8501 Goal goalFromTimeTable = GetGoalFromTimeTable(EClass.world.date.hour);
8502 if (goalFromTimeTable != null)
8503 {
8504 SetAI(goalFromTimeTable);
8505 if (goalFromTimeTable is GoalWork)
8506 {
8507 goalFromTimeTable.Tick();
8508 }
8509 return;
8510 }
8511 }
8512 if (goalList.index == -2)
8513 {
8515 }
8516 SetAI(goalList.Next());
8517 }
Status Tick()
Definition: AIAct.cs:352
Goal GetGoalFromTimeTable(int hour)
Definition: Chara.cs:8519
GoalListType goalListType
Definition: Chara.cs:277
AIAct SetNoGoal()
Definition: Chara.cs:8611
bool IsHomeMember()
Definition: Chara.cs:6445
bool IsGuest()
Definition: Chara.cs:6470
GoalList goalList
Definition: Chara.cs:198
bool IsInHomeZone()
Definition: Chara.cs:6450
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 7148 of file Chara.cs.

7149 {
7150 if (map == null)
7151 {
7152 map = EClass._map;
7153 }
7154 foreach (Card item in map.props.installed.all)
7155 {
7156 if (item.trait is TraitBed traitBed && traitBed.IsHolder(this))
7157 {
7158 traitBed.RemoveHolder(this);
7159 }
7160 }
7161 }
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 8309 of file Chara.cs.

8310 {
8311 int num = 0;
8312 for (int num2 = things.Count - 1; num2 >= 0; num2--)
8313 {
8314 Thing thing = things[num2];
8315 if (ShouldThrowAway(thing, type))
8316 {
8317 num += thing.GetPrice(CurrencyType.Money, sell: true, PriceType.Default, this) * thing.Num;
8318 thing.Destroy();
8319 }
8320 }
8321 if (num > 0)
8322 {
8323 ModCurrency(num);
8324 if (type == ClearInventoryType.SellAtTown)
8325 {
8326 Msg.Say("party_sell", this, num.ToString() ?? "");
8327 PlaySound("pay");
8328 }
8329 }
8330 }
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:7113
void Destroy()
Definition: Card.cs:4981
int Num
Definition: Card.cs:158
bool ShouldThrowAway(Thing t, ClearInventoryType type)
Definition: Chara.cs:8238

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

10067 {
10068 if (tempElements != null)
10069 {
10071 tempElements = null;
10072 }
10073 }
ElementContainer tempElements
Definition: Chara.cs:36
void SetParent(Card c)

References ElementContainer.SetParent().

◆ CountDebuff()

int Chara.CountDebuff ( )
inline

Definition at line 9172 of file Chara.cs.

9173 {
9174 int num = 0;
9175 foreach (Condition condition in conditions)
9176 {
9177 if (condition.Type == ConditionType.Debuff)
9178 {
9179 num++;
9180 }
9181 }
9182 return num;
9183 }

References BaseStats.Type.

Referenced by GoalCombat.TryUseAbility().

◆ CountNumEaten()

int Chara.CountNumEaten ( Thing  food)
inline

Definition at line 9872 of file Chara.cs.

9873 {
9874 if (_historyFood == null)
9875 {
9876 return -1;
9877 }
9878 int num = 0;
9879 foreach (List<string> item in _historyFood)
9880 {
9881 foreach (string item2 in item)
9882 {
9883 if (item2 == food.id)
9884 {
9885 num++;
9886 }
9887 }
9888 }
9889 return num;
9890 }

References food, and item.

Referenced by FoodEffect.Proc().

◆ CreateReplacement()

Chara Chara.CreateReplacement ( )
inline

Definition at line 7801 of file Chara.cs.

7802 {
7803 Chara chara = CharaGen.Create(id);
7804 chara.c_originalHostility = base.c_originalHostility;
7805 if (chara.c_originalHostility != 0)
7806 {
7807 chara.hostility = chara.c_originalHostility;
7808 }
7809 if (orgPos != null)
7810 {
7811 chara.orgPos = orgPos.Copy();
7812 }
7813 chara.pos = pos.Copy();
7814 chara.isImported = true;
7815 chara.c_editorTags = base.c_editorTags;
7816 chara.c_editorTraitVal = base.c_editorTraitVal;
7817 chara.c_idTrait = base.c_idTrait;
7818 chara.homeZone = homeZone;
7819 return chara;
7820 }
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 6122 of file Chara.cs.

6123 {
6124 Talk("goodBoy");
6125 Say(headpat ? "headpat" : "cuddle", this, c);
6126 c.ShowEmo(Emo.love);
6127 if (EClass.rnd(IsPC ? 100 : 5000) == 0)
6128 {
6129 c.MakeEgg();
6130 }
6131 if (headpat && this != c)
6132 {
6133 if (c.interest > 0)
6134 {
6135 c.ModAffinity(EClass.pc, 1 + EClass.rnd(3));
6136 c.interest -= 20 + EClass.rnd(10);
6137 }
6139 {
6140 foreach (Chara member in party.members)
6141 {
6142 if (!member.IsPC && CanSeeLos(member))
6143 {
6144 member.AddCondition<ConEuphoric>(100 + Evalue(6904) * 5);
6145 }
6146 }
6147 }
6148 }
6149 if (c.Evalue(1221) > 0)
6150 {
6151 int ele = ((c.MainElement == Element.Void) ? 924 : c.MainElement.id);
6152 if (c.id == "hedgehog_ether")
6153 {
6154 ele = 922;
6155 }
6156 Say("reflect_thorne", c, this);
6157 DamageHP(10L, ele, Power, AttackSource.Condition);
6158 }
6159 }
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:5977
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
Definition: Card.cs:5624
Element MainElement
Definition: Chara.cs:715
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Definition: Chara.cs:7729
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 9235 of file Chara.cs.

9236 {
9237 bool flag = state == BlessedState.Blessed;
9238 switch (type)
9239 {
9240 case CureType.Heal:
9241 case CureType.Prayer:
9242 CureCondition<ConFear>();
9243 CureCondition<ConBlind>(2 * p / 100 + 5);
9244 CureCondition<ConPoison>(5 * p / 100 + 5);
9245 CureCondition<ConConfuse>(10 * p / 100 + 10);
9246 CureCondition<ConDim>(p / 100 + 5);
9247 CureCondition<ConBleed>(2 * p / 100 + 10);
9248 if (flag)
9249 {
9250 SAN.Mod(-15);
9251 }
9252 break;
9253 case CureType.CureBody:
9254 CureCondition<ConBlind>(5 * p / 100 + 15);
9255 CureCondition<ConPoison>(10 * p / 100 + 15);
9256 CureCondition<ConBleed>(5 * p / 100 + 20);
9257 CureTempElements(p, body: true, mind: false);
9258 break;
9259 case CureType.CureMind:
9260 CureCondition<ConFear>();
9261 CureCondition<ConDim>(3 * p / 100 + 10);
9262 CureTempElements(p, body: false, mind: true);
9263 break;
9264 case CureType.Sleep:
9265 {
9266 for (int num2 = conditions.Count - 1; num2 >= 0; num2--)
9267 {
9268 Condition condition2 = conditions[num2];
9269 if (!(condition2 is ConSleep) && !(condition2 is ConFaint))
9270 {
9271 if (condition2.isPerfume)
9272 {
9273 condition2.Mod(-1, force: true);
9274 }
9275 else if (condition2.Type == ConditionType.Bad || condition2.Type == ConditionType.Debuff)
9276 {
9277 condition2.Kill();
9278 }
9279 }
9280 }
9281 CureCondition<ConWait>();
9282 CureCondition<ConDisease>((EClass.rnd(20) + 10) * p / 100);
9283 bool flag3 = HasCondition<ConAnorexia>();
9284 base.c_vomit -= (flag3 ? 3 : 2) * p / 100;
9285 if (base.c_vomit < 0)
9286 {
9287 base.c_vomit = 0;
9288 if (flag3)
9289 {
9290 RemoveCondition<ConAnorexia>();
9291 }
9292 }
9293 break;
9294 }
9295 case CureType.HealComplete:
9296 case CureType.Death:
9297 case CureType.Jure:
9298 case CureType.Boss:
9299 {
9300 bool flag2 = type == CureType.Death;
9301 CureTempElements(p * 100, body: true, mind: true);
9302 for (int num = conditions.Count - 1; num >= 0; num--)
9303 {
9304 Condition condition = conditions[num];
9305 if (condition is ConAnorexia && !flag2)
9306 {
9307 continue;
9308 }
9309 switch (condition.Type)
9310 {
9311 case ConditionType.Bad:
9312 case ConditionType.Debuff:
9313 case ConditionType.Disease:
9314 condition.Kill();
9315 continue;
9316 case ConditionType.Stance:
9317 if (flag2)
9318 {
9319 condition.Kill();
9320 continue;
9321 }
9322 break;
9323 }
9324 if (flag2 && condition.isPerfume)
9325 {
9326 condition.Kill();
9327 }
9328 }
9329 CureCondition<ConWait>();
9330 CureCondition<ConSleep>();
9331 if (flag2 || type == CureType.Boss)
9332 {
9333 SAN.Mod(-20);
9334 RemoveCondition<ConBrightnessOfLife>();
9335 }
9336 if (type == CureType.Jure)
9337 {
9338 SAN.Mod(-999);
9339 if (HasElement(1206))
9340 {
9341 SetFeat(1206, 0, msg: true);
9342 }
9343 }
9344 break;
9345 }
9346 }
9347 }
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:10036
Stats SAN
Definition: Chara.cs:1152
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 9185 of file Chara.cs.

9185 : Condition
9186 {
9187 T condition = GetCondition<T>();
9188 if (condition != null)
9189 {
9190 condition.value -= v;
9191 if (condition.value <= 0)
9192 {
9193 condition.Kill();
9194 }
9195 }
9196 }
T GetCondition< T >()
Definition: Chara.cs:9198

◆ CureHost()

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

Definition at line 9222 of file Chara.cs.

9223 {
9224 if (parasite != null)
9225 {
9226 parasite.Cure(type, p, state);
9227 }
9228 if (ride != null)
9229 {
9230 ride.Cure(type, p, state);
9231 }
9232 Cure(type, p, state);
9233 }
void Cure(CureType type, int p=100, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:9235

References Cure().

Referenced by FactionBranch.DailyOutcome().

◆ CureTempElements()

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

Definition at line 10036 of file Chara.cs.

10037 {
10038 if (tempElements != null)
10039 {
10040 if (body)
10041 {
10043 }
10044 if (mind)
10045 {
10047 }
10048 }
10049 void Cure(int[] eles)
10050 {
10051 foreach (int ele in eles)
10052 {
10053 if (tempElements == null)
10054 {
10055 break;
10056 }
10057 Element element = tempElements.GetElement(ele);
10058 if (element != null && element.vBase < 0)
10059 {
10060 ModTempElement(ele, Mathf.Clamp(p / 20 + EClass.rnd(p / 20), 1, -element.vBase));
10061 }
10062 }
10063 }
10064 }
void ModTempElement(int ele, int a, bool naturalDecay=false, bool onlyRenew=false)
Definition: Chara.cs:9944
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 10002 of file Chara.cs.

10003 {
10004 ModTempElement(ele, onlyRenew ? (-p / 20) : (-(p / 100 + EClass.rnd(p / 100 + 1) + 1)), naturalDecay: false, onlyRenew);
10005 }

References EClass.rnd().

◆ DamageTempElements()

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

Definition at line 9990 of file Chara.cs.

9991 {
9992 if (body)
9993 {
9994 DamageTempElement(Element.List_Body.RandomItem(), p, onlyRenew);
9995 }
9996 if (mind)
9997 {
9998 DamageTempElement(Element.List_Mind.RandomItem(), p, onlyRenew);
9999 }
10000 }
void DamageTempElement(int ele, int p, bool onlyRenew=false)
Definition: Chara.cs:10002

References Element.List_Body, and Element.List_Mind.

◆ DestroyPath()

void Chara.DestroyPath ( Point  pos)
inline

Definition at line 3145 of file Chara.cs.

3146 {
3147 bool broke = false;
3148 pos.ForeachMultiSize(base.W, base.H, delegate(Point _p, bool main)
3149 {
3150 if (_p.IsValid)
3151 {
3152 if (_p.HasBlock)
3153 {
3154 EClass._map.MineBlock(_p, recoverBlock: false, this);
3155 if (_p.HasObj)
3156 {
3157 EClass._map.MineObj(_p, null, this);
3158 }
3159 broke = true;
3160 }
3161 if (_p.HasObj && _p.IsBlocked)
3162 {
3163 EClass._map.MineObj(_p, null, this);
3164 broke = true;
3165 }
3166 _p.Things.ForeachReverse(delegate(Thing t)
3167 {
3168 if (t.IsInstalled && (t.trait.IsBlockPath || t.trait.IsDoor))
3169 {
3170 if (t.isNPCProperty && t.trait.CanBeDestroyed)
3171 {
3172 t.Destroy();
3173 }
3174 else if (!t.IsUnique && !t.trait.CanBeDestroyed)
3175 {
3176 t.SetPlaceState(PlaceState.roaming);
3177 }
3178 }
3179 });
3180 }
3181 });
3182 if (broke)
3183 {
3184 Msg.Say("stomp");
3185 Shaker.ShakeCam("stomp");
3186 }
3187 }
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 5187 of file Chara.cs.

5188 {
5189 combatCount = 0;
5190 if (isDead || host != null)
5191 {
5192 return;
5193 }
5194 bool isInActiveZone = IsInActiveZone;
5195 if (isInActiveZone)
5196 {
5197 if (IsPC)
5198 {
5200 }
5201 if (base.isSummon)
5202 {
5203 if (id == "tsunami")
5204 {
5205 pos.PlaySound("water");
5206 }
5207 else
5208 {
5209 Say("summon_vanish", this);
5210 pos.PlayEffect("vanish");
5211 pos.PlaySound("vanish");
5212 }
5213 Destroy();
5214 return;
5215 }
5216 if (attackSource == AttackSource.DeathSentense)
5217 {
5218 if (trait is TraitLittleOne)
5219 {
5220 MakeEgg();
5221 if (IsPCFaction)
5222 {
5224 }
5225 }
5226 PlayEffect("revive");
5227 PlaySound("chime_angel");
5228 }
5229 else
5230 {
5231 Effect.Get("blood").Play((parent is Chara) ? (parent as Chara).pos : pos).SetParticleColor(EClass.Colors.matColors[base.material.alias].main)
5232 .Emit(50);
5233 AddBlood(AI_Slaughter.slaughtering ? 12 : (2 + EClass.rnd(2)));
5234 PlaySound(base.material.GetSoundDead(source));
5235 }
5238 ClearFOV();
5239 }
5240 string text = "";
5241 "dead_in".langGame(EClass._zone.Name);
5242 string text2 = ((origin == null) ? "" : origin.GetName(NameStyle.Full));
5243 if (LangGame.Has("dead_" + attackSource))
5244 {
5245 text = "dead_" + attackSource;
5246 }
5247 else
5248 {
5249 if (e != Element.Void && e != null)
5250 {
5251 text = "dead_" + e.source.alias;
5252 }
5253 if (text == "" || !LangGame.Has(text))
5254 {
5255 text = "dead";
5256 }
5257 }
5258 if (IsPC)
5259 {
5260 EClass._zone.isDeathLocation = true;
5261 string s = ((origin == null) ? text : "dead_by");
5263 if (attackSource == AttackSource.Wrath)
5264 {
5266 }
5267 EClass.player.deathMsg = GameLang.Parse(s.langGame(), thirdPerson: true, EClass.pc.NameBraced, "dead_in".langGame(EClass._zone.Name), text2);
5269 if (EClass._zone.instance is ZoneInstanceRandomQuest zoneInstanceRandomQuest)
5270 {
5271 zoneInstanceRandomQuest.status = ZoneInstance.Status.Fail;
5272 }
5273 AI_PlayMusic.keepPlaying = false;
5274 }
5275 if (isInActiveZone)
5276 {
5277 if (attackSource == AttackSource.DeathSentense)
5278 {
5279 Msg.Say("goto_heaven", this);
5280 }
5281 else
5282 {
5283 if (originalTarget != null || origin == null || !origin.isSynced || (attackSource != AttackSource.Melee && attackSource != AttackSource.Range))
5284 {
5285 Msg.Say(text, this, "", text2);
5286 }
5287 string text3 = TalkTopic("dead");
5288 if (!text3.IsEmpty())
5289 {
5290 text3 = text3.StripBrackets();
5291 }
5292 bool flag = base.rarity >= Rarity.Legendary && !IsPCFaction;
5293 if (!IsPC && flag)
5294 {
5295 MakeGrave(text3);
5296 }
5297 Msg.SetColor();
5298 SpawnLoot(origin);
5299 }
5300 if (IsPC)
5301 {
5303 }
5304 }
5305 if (IsPCFaction)
5306 {
5307 if (homeBranch != null)
5308 {
5309 homeBranch.Log(text, this, "");
5310 }
5311 WidgetPopText.Say("popDead".lang(base.Name), FontColor.Bad);
5312 if (!IsPC)
5313 {
5314 if (EClass.player.stats.allyDeath == 0)
5315 {
5316 Tutorial.Reserve("death_pet");
5317 }
5319 }
5320 }
5321 if (id == "mandrake" || HasElement(488))
5322 {
5323 Say("a_scream", this);
5324 ActEffect.ProcAt(EffectId.Scream, base.LV * 3 + 200, BlessedState.Normal, this, this, pos, isNeg: true);
5325 }
5326 daysStarved = 0;
5327 isDead = true;
5329 enemy = null;
5330 _cooldowns = null;
5331 base.isSale = false;
5332 SetInt(70);
5333 EClass._map.props.sales.Remove(this);
5334 Cure(CureType.Death);
5335 SetAI(new NoGoal());
5337 if (isInActiveZone && EClass._zone.HasLaw && IsHuman && OriginalHostility >= Hostility.Neutral)
5338 {
5339 pos.TalkWitnesses(origin?.Chara, "witness", 3, WitnessType.crime, (Chara c) => !c.IsPCParty && !c.IsUnique);
5340 }
5341 if (IsPC)
5342 {
5343 EClass.player.returnInfo = null;
5344 EClass.player.uidLastTravelZone = 0;
5345 foreach (Chara chara3 in EClass._map.charas)
5346 {
5347 if (chara3.IsHostile())
5348 {
5349 chara3.hostility = chara3.OriginalHostility;
5350 }
5351 if (chara3.enemy == EClass.pc)
5352 {
5353 chara3.enemy = null;
5354 }
5355 }
5356 if (EClass.pc.things.Find("letter_will") != null && EClass.rnd(10) == 0)
5357 {
5358 EClass.player.preventDeathPenalty = true;
5359 }
5360 }
5361 else
5362 {
5363 bool flag2 = currentZone.IsActiveZone && IsLocalChara && !currentZone.IsPCFaction;
5364 if (currentZone is Zone_LittleGarden && id == "littleOne")
5365 {
5366 flag2 = false;
5367 }
5368 if (flag2)
5369 {
5370 EClass._map.deadCharas.Add(this);
5371 }
5372 currentZone.RemoveCard(this);
5373 }
5374 if ((origin != null && origin.IsPCParty) || IsPCFaction)
5375 {
5376 int a = -10;
5377 if (IsPCFaction && !IsPCParty && (origin == null || !origin.IsPCParty))
5378 {
5379 a = -5;
5380 }
5381 ModAffinity(EClass.pc, a, show: false);
5382 string text4 = id;
5383 if (!(text4 == "quru"))
5384 {
5385 if (text4 == "corgon")
5386 {
5387 EClass.game.cards.globalCharas.Find("quru")?.ModAffinity(EClass.pc, -20, show: false);
5388 }
5389 }
5390 else
5391 {
5392 EClass.game.cards.globalCharas.Find("corgon")?.ModAffinity(EClass.pc, -20, show: false);
5393 }
5394 }
5395 if (origin != null)
5396 {
5397 if (origin.IsPCParty || origin.IsPCPartyMinion)
5398 {
5399 int num = 0;
5400 if (OriginalHostility >= Hostility.Friend && IsHuman && !base.IsPCFactionOrMinion)
5401 {
5402 num = -5;
5403 }
5404 else if (race.id == "cat" && OriginalHostility >= Hostility.Neutral)
5405 {
5406 EClass.pc.Say("killcat");
5407 num = -1;
5408 }
5409 if (EClass.pc.party.HasElement(1563) && num < 0)
5410 {
5411 num = num * 30 / 100;
5412 }
5413 if (num != 0)
5414 {
5415 EClass.player.ModKarma(num);
5416 }
5417 }
5418 if (origin == EClass.pc)
5419 {
5420 EClass.pc.faith.Revelation("kill", 10);
5421 }
5422 else if (origin.IsPCFaction)
5423 {
5424 origin.Chara.ModAffinity(EClass.pc, 1, show: false);
5425 origin.Chara.ShowEmo(Emo.love);
5426 }
5427 }
5428 if (base.sourceBacker != null && origin != null && origin.IsPCParty)
5429 {
5430 EClass.player.doneBackers.Add(base.sourceBacker.id);
5431 }
5432 if (base.IsPCFactionOrMinion)
5433 {
5435 {
5436 Msg.Say("abort_allyDead");
5437 }
5438 }
5440 {
5441 Msg.Say("abort_enemyDead");
5442 }
5443 if (IsPCParty && !IsPC)
5444 {
5446 base.c_wasInPcParty = true;
5447 EClass.pc.Say("allyDead");
5448 }
5449 switch (id)
5450 {
5451 case "littleOne":
5452 if (attackSource != AttackSource.DeathSentense && !IsPCFaction)
5453 {
5454 EClass.player.flags.little_killed = true;
5456 }
5457 break;
5458 case "big_daddy":
5459 if (!IsPCFaction)
5460 {
5461 Chara chara = CharaGen.Create("littleOne");
5462 EClass._zone.AddCard(chara, pos.Copy());
5463 Msg.Say("little_pop");
5465 }
5466 break;
5467 case "shark_sister":
5468 if (!IsPCFaction)
5469 {
5470 Chara t = CharaGen.Create("sister_shark");
5471 EClass._zone.AddCard(t, pos.Copy());
5472 Msg.Say("shark_pop");
5473 }
5474 break;
5475 }
5476 if (attackSource == AttackSource.Finish && origin != null && origin.Evalue(665) > 0)
5477 {
5478 Chara chara2 = CharaGen.CreateFromFilter("c_plant", base.LV);
5479 EClass._zone.AddCard(chara2, pos.Copy());
5480 if (chara2.LV < base.LV)
5481 {
5482 chara2.SetLv(base.LV);
5483 }
5484 chara2.MakeMinion((origin.IsPCParty || origin.IsPCPartyMinion) ? EClass.pc : origin.Chara, MinionType.Friend);
5485 Msg.Say("plant_pop", this, chara2);
5486 }
5488 }
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:440
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:5834
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:6427
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:6043
virtual bool IsPCFaction
Definition: Card.cs:2257
void SpawnLoot(Card origin)
Definition: Card.cs:5021
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:2313
string NameBraced
Definition: Chara.cs:512
void ClearTempElements()
Definition: Chara.cs:10066
string TalkTopic(string topic="calm")
Definition: Chara.cs:6814
void TryDropBossLoot()
Definition: Chara.cs:5490
bool IsLocalChara
Definition: Chara.cs:839
Chara enemy
Definition: Chara.cs:86
bool IsInActiveZone
Definition: Chara.cs:836
void TryDropCarryOnly()
Definition: Chara.cs:4512
void MakeGrave(string lastword)
Definition: Chara.cs:5104
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:125
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
void RemoveMember(Chara c)
Definition: Party.cs:101
bool HasElement(int ele)
Definition: Party.cs:180
int allyDeath
Definition: Player.cs:108
void ModKarma(int a)
Definition: Player.cs:2496
Stats stats
Definition: Player.cs:1013
int little_dead
Definition: Player.cs:923
HashSet< int > doneBackers
Definition: Player.cs:1070
bool TryAbortAutoCombat(bool immediate=true)
Definition: Player.cs:2390
string deathMsg
Definition: Player.cs:1182
SoundSource PlaySound(string id, bool synced=true, float v=1f, bool spatial=true)
Definition: Point.cs:1241
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
Effect PlayEffect(string id)
Definition: Point.cs:1236
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:1990
void ResetHostility()
Definition: Zone.cs:2661
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 10021 of file Chara.cs.

10022 {
10023 if (tempElements == null)
10024 {
10025 return;
10026 }
10027 foreach (Element item in tempElements.dict.Values.ToList())
10028 {
10029 if (item.vBase > 0)
10030 {
10031 ModTempElement(item.id, -Mathf.Min(item.vBase * 5 / 100 + 1, item.vBase), naturalDecay: true);
10032 }
10033 }
10034 }

References ElementContainer.dict, and item.

◆ DoAI()

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

Definition at line 6110 of file Chara.cs.

6111 {
6112 SetAI(new DynamicAIAct("", delegate
6113 {
6114 onPerform();
6115 return true;
6116 })
6117 {
6118 wait = wait
6119 });
6120 }

◆ DoHostileAction()

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

Definition at line 6210 of file Chara.cs.

6211 {
6212 if (_tg == null || !_tg.isChara)
6213 {
6214 return;
6215 }
6216 Chara chara = _tg.Chara;
6217 if (chara.IsPC)
6218 {
6219 EClass.pc.combatCount = 10;
6220 }
6221 if (!chara.IsAliveInCurrentZone || !IsAliveInCurrentZone || chara == this)
6222 {
6223 return;
6224 }
6225 if ((IsPCFaction || IsPCFactionMinion) && (chara.IsPCFaction || chara.IsPCFactionMinion))
6226 {
6227 chara.Say("frown", this, chara);
6228 }
6229 else
6230 {
6231 if (EClass._zone.IsRegion)
6232 {
6233 return;
6234 }
6235 if (IsPC)
6236 {
6237 if (chara.IsFriendOrAbove() && !immediate)
6238 {
6239 chara.Say("frown", this, chara);
6240 chara.ShowEmo(Emo.sad);
6241 chara.hostility = Hostility.Neutral;
6242 return;
6243 }
6244 if (!chara.IsPCFaction && chara.hostility >= Hostility.Neutral && !EClass._zone.IsPCFaction)
6245 {
6246 bool flag = chara.id == "fanatic";
6247 if (EClass.rnd(4) == 0 || flag)
6248 {
6249 chara.Say("callHelp", chara);
6250 chara.CallHelp(this, flag);
6251 }
6252 }
6253 if (chara.hostility <= Hostility.Enemy)
6254 {
6255 foreach (Chara member in EClass.pc.party.members)
6256 {
6257 if (member != EClass.pc && member.enemy == null && member.CanSee(chara))
6258 {
6259 member.SetEnemy(chara);
6260 }
6261 }
6262 }
6263 }
6264 else if (chara.IsPC && hostility <= Hostility.Enemy)
6265 {
6266 foreach (Chara member2 in EClass.pc.party.members)
6267 {
6268 if (member2 != EClass.pc && member2.enemy == null && member2.CanSee(this))
6269 {
6270 member2.SetEnemy(this);
6271 }
6272 }
6273 }
6274 if (chara.calmCheckTurn <= 0 || IsPC)
6275 {
6276 chara.calmCheckTurn = (IsPC ? (20 + EClass.rnd(30)) : (10 + EClass.rnd(10)));
6277 }
6278 if (hostility != Hostility.Enemy || chara.hostility != Hostility.Enemy)
6279 {
6280 GoHostile(chara);
6281 chara.GoHostile(this);
6282 if (base.isHidden && !chara.CanSee(this) && !chara.IsDisabled && !chara.IsPCParty && !chara.IsPCPartyMinion && EClass.rnd(10 + Dist(chara) * 10) == 0)
6283 {
6284 Thing t = ThingGen.Create("49");
6285 ActThrow.Throw(chara, pos, t);
6286 Act.TC = chara;
6287 }
6288 }
6289 }
6290 }
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:1212
override bool IsPCFactionMinion
Definition: Chara.cs:653
bool IsFriendOrAbove()
Definition: Chara.cs:6475
Chara SetEnemy(Chara c=null)
Definition: Chara.cs:6161
void CallHelp(Chara tg, bool fanatic=false)
Definition: Chara.cs:6292
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 4999 of file Chara.cs.

5000 {
5001 Say("drink", this, t.Duplicate(1));
5002 Say("quaff");
5003 PlaySound("drink");
5004 hunger.Mod(-2);
5005 t.ModNum(-1);
5006 t.trait.OnDrink(this);
5007 _ = IsPC;
5008 }
Thing Duplicate(int num)
Definition: Card.cs:3374
void ModNum(int a, bool notify=true)
Definition: Card.cs:3445
Stats hunger
Definition: Chara.cs:1136
virtual void OnDrink(Chara c)
Definition: Trait.cs:989

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

4525 {
4526 if (held == null)
4527 {
4528 return null;
4529 }
4530 if (IsPC)
4531 {
4532 WidgetHotbar.dirtyCurrentItem = true;
4534 }
4535 Card card = EClass._zone.AddCard(held, dropPos ?? pos);
4536 card.OnLand();
4537 if (card.trait.CanOnlyCarry)
4538 {
4539 card.SetPlaceState(PlaceState.installed);
4540 }
4541 return card;
4542 }
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 4544 of file Chara.cs.

4545 {
4546 if (t.c_isImportant)
4547 {
4548 Msg.Say("markedImportant");
4549 return;
4550 }
4551 if (!t.trait.CanBeDropped)
4552 {
4553 Msg.Say("cantDrop", t);
4554 return;
4555 }
4556 if (t.trait is TraitAbility)
4557 {
4558 SE.Trash();
4559 t.Destroy();
4560 return;
4561 }
4562 Msg.Say("dropItem", t.Name);
4563 t.ignoreAutoPick = true;
4564 PlaySound("drop");
4565 EClass._zone.AddCard(t, pos);
4566 if (t.trait.CanOnlyCarry)
4567 {
4568 t.Install();
4569 }
4570 }
Card Install()
Definition: Card.cs:3671
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 1766 of file Chara.cs.

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

10017 {
10018 ModTempElement(ele, onlyRenew ? (p / 20) : (p / 100 + EClass.rnd(p / 100 + 1)), naturalDecay: false, onlyRenew);
10019 }

References EClass.rnd().

◆ EnhanceTempElements()

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

Definition at line 10007 of file Chara.cs.

10008 {
10009 int[] array = (body ? Element.List_Body : Element.List_Mind);
10010 foreach (int ele in array)
10011 {
10012 EnhanceTempElement(ele, p, onlyRenew);
10013 }
10014 }
void EnhanceTempElement(int ele, int p, bool onlyRenew=false)
Definition: Chara.cs:10016

References Element.List_Mind.

◆ EQ_CAT()

void Chara.EQ_CAT ( string  s)
inline

Definition at line 4976 of file Chara.cs.

4977 {
4978 int slot = EClass.sources.categories.map[s].slot;
4979 BodySlot bodySlot = ((slot == 0) ? null : body.GetSlot(slot));
4980 if ((slot == 0 || bodySlot != null) && (slot != 37 || !HasElement(1209)))
4981 {
4982 SetEQQuality();
4983 Thing thing = ThingGen.CreateFromCategory(s, base.LV);
4984 AddThing(thing);
4985 if (bodySlot != null && !body.Equip(thing, bodySlot))
4986 {
4987 thing.Destroy();
4988 }
4989 }
4990 }
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:4923
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 4956 of file Chara.cs.

4957 {
4958 SetEQQuality();
4959 if (r != Rarity.Random)
4960 {
4961 CardBlueprint.current.rarity = r;
4962 }
4963 Thing thing = ThingGen.Create(s, mat, base.LV);
4964 if (body.GetSlot(thing, onlyEmpty: true) == null)
4965 {
4966 return thing;
4967 }
4968 AddThing(thing);
4969 if (!body.Equip(thing))
4970 {
4971 thing.Destroy();
4972 }
4973 return thing;
4974 }

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

4993 {
4994 SetEQQuality();
4995 Thing t = ThingGen.Create(s, -1, base.LV).SetNum(num);
4996 AddThing(t);
4997 }
Thing SetNum(int a)
Definition: Card.cs:3425

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

◆ EvalueRiding()

int Chara.EvalueRiding ( )
inline

Definition at line 6021 of file Chara.cs.

6022 {
6023 if (ride != null && ride.HasCondition<ConTransmuteBroom>() && HasElement(1417))
6024 {
6025 return 25 + Evalue(226) * 125 / 100;
6026 }
6027 return Evalue(226);
6028 }

References HasCondition().

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

◆ FallFromZone()

void Chara.FallFromZone ( )
inline

Definition at line 3467 of file Chara.cs.

3468 {
3469 Msg.Say("skyFall", EClass.pc, EClass._zone.Name);
3470 Zone zone = (EClass._zone.isExternalZone ? null : EClass._zone.GetTopZone().FindZone(EClass._zone.lv - 1));
3471 zone = zone ?? EClass.world.region;
3473 {
3474 state = ZoneTransition.EnterState.Fall,
3475 x = pos.x,
3476 z = pos.z
3477 });
3478 }
void MoveZone(string alias)
Definition: Chara.cs:3292
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:1911

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

7610 {
7611 TraitToolRange ranged = weapon.trait as TraitToolRange;
7612 Thing thing = (IsPC ? EClass.pc.things.Find<TraitQuiver>() : null);
7613 if (thing != null)
7614 {
7615 Thing thing2 = thing.things.Find((Thing t) => ranged.IsAmmo(t));
7616 if (thing2 != null)
7617 {
7618 return thing2;
7619 }
7620 }
7621 return things.Find((Thing t) => ranged.IsAmmo(t));
7622 }
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 7163 of file Chara.cs.

7164 {
7165 foreach (Card item in EClass._map.props.installed.all)
7166 {
7167 if (item.trait is TraitBed traitBed && traitBed.IsHolder(this))
7168 {
7169 return traitBed;
7170 }
7171 }
7172 return null;
7173 }

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

7375 {
7376 Thing result = null;
7377 int num = -1;
7378 if (IsPC)
7379 {
7380 return null;
7381 }
7382 foreach (Thing item in things.List((Thing t) => CanEat(t, shouldEat: true) && !t.c_isImportant, onlyAccessible: true))
7383 {
7384 int num2 = CountNumEaten(item);
7385 int num3 = 100 - num2;
7386 if (num3 > num)
7387 {
7388 result = item;
7389 num = num3;
7390 }
7391 }
7392 return result;
7393 }
bool CanEat(Thing t, bool shouldEat=false)
Definition: Chara.cs:7420
int CountNumEaten(Thing food)
Definition: Chara.cs:9872
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 2359 of file Chara.cs.

2360 {
2361 if (IsMinion)
2362 {
2363 master = EClass._map.FindChara(base.c_uidMaster);
2364 }
2365 return master;
2366 }
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 6372 of file Chara.cs.

6373 {
6374 for (int i = 0; i < EClass._map.charas.Count; i++)
6375 {
6376 Chara chara = EClass._map.charas[i];
6377 if (chara != this && chara != enemy && IsHostile(chara) && Dist(chara) <= 1 && CanInteractTo(chara.pos))
6378 {
6379 DoHostileAction(chara);
6380 enemy = chara;
6381 return true;
6382 }
6383 }
6384 return false;
6385 }
void DoHostileAction(Card _tg, bool immediate=false)
Definition: Chara.cs:6210

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

6304 {
6305 if (EClass._zone.isPeace && base.IsPCFactionOrMinion && !IsPC)
6306 {
6307 return false;
6308 }
6309 if (enemy != null && !enemy.IsAliveInCurrentZone)
6310 {
6311 enemy = null;
6312 }
6313 if (enemy != null)
6314 {
6315 return false;
6316 }
6317 if (IsPCParty && EClass.pc.isHidden && base.isHidden)
6318 {
6319 return false;
6320 }
6321 bool flag = enemy != null || ai is GoalCombat;
6322 int num = (base.PER + Evalue(210) * 2) * ((!flag) ? 1 : 2);
6323 bool flag2 = IsPCParty && !IsPC && EClass.game.config.tactics.dontWander;
6324 bool flag3 = !IsPCParty;
6325 Chara chara = null;
6326 int num2 = 9999;
6327 for (int i = 0; i < EClass._map.charas.Count; i++)
6328 {
6329 Chara chara2 = EClass._map.charas[i];
6330 if (chara2 == this || !IsHostile(chara2) || !CanSee(chara2))
6331 {
6332 continue;
6333 }
6334 int num3 = Dist(chara2);
6335 int num4 = GetSightRadius() + (flag ? 1 : 0);
6336 if (num3 > num4)
6337 {
6338 continue;
6339 }
6340 if (flag3 && EClass.rnd(chara2.Evalue(152) + 5) * (100 + num3 * num3 * 10) / 100 > EClass.rnd(num))
6341 {
6342 if (this == pos.FirstChara)
6343 {
6344 chara2.ModExp(152, Mathf.Clamp((num - chara2.Evalue(152)) / 2, 1, Mathf.Max(30 - stealthSeen * 2, 1)));
6345 }
6346 stealthSeen++;
6347 }
6348 else if (CanSeeLos(chara2) && (!flag2 || EClass.pc.isBlind || EClass.pc.CanSeeLos(chara2)) && (!IsPCFaction || EClass.pc.ai.ShouldAllyAttack(chara2)))
6349 {
6350 if (!IsPCParty)
6351 {
6352 DoHostileAction(chara2);
6353 enemy = chara2;
6354 return true;
6355 }
6356 if (num3 < num2)
6357 {
6358 num2 = num3;
6359 chara = chara2;
6360 }
6361 }
6362 }
6363 if (chara != null)
6364 {
6365 DoHostileAction(chara);
6366 enemy = chara;
6367 return true;
6368 }
6369 return false;
6370 }
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 7724 of file Chara.cs.

7725 {
7726 return FindBed()?.owner.pos.cell.room;
7727 }
TraitBed FindBed()
Definition: Chara.cs:7163

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

9788 {
9789 Element orCreateElement = elements.GetOrCreateElement(ele);
9790 if (orCreateElement.ValueWithoutLink == 0)
9791 {
9792 elements.ModBase(orCreateElement.id, 1);
9793 }
9794 if (orCreateElement is Spell)
9795 {
9796 int num = EClass.curve(Evalue(307), 50, 20) + (HasElement(307) ? 20 : 0);
9797 int num2 = origin?.Evalue(765) ?? 0;
9798 num = num * (100 - num2) / 100;
9799 int a = mtp * orCreateElement.source.charge * (100 + num) / 100 / 100;
9800 a = Mathf.Max(1, EClass.rndHalf(a));
9801 if (orCreateElement.source.charge == 1)
9802 {
9803 a = 1;
9804 }
9805 orCreateElement.vPotential += a;
9806 }
9807 Say("spell_gain", this, orCreateElement.Name);
9808 LayerAbility.SetDirty(orCreateElement);
9809 }
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 7107 of file Chara.cs.

7108 {
7109 string result = "?????";
7110 if (ai != null)
7111 {
7112 result = ai.GetCurrentActionText();
7113 }
7114 return result;
7115 }
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 7659 of file Chara.cs.

7660 {
7661 if (body.GetWeight(armorOnly: true) <= 30000)
7662 {
7663 return 120;
7664 }
7665 return 122;
7666 }
int GetWeight(bool armorOnly=false)
Definition: CharaBody.cs:390

References CharaBody.GetWeight().

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

◆ GetBestRangedWeapon()

Thing Chara.GetBestRangedWeapon ( )
inline

Definition at line 7624 of file Chara.cs.

7625 {
7626 Thing result = null;
7627 int num = 0;
7628 foreach (Thing thing in things)
7629 {
7630 if (thing.IsRangedWeapon && CanEquipRanged(thing) && thing.GetEquipValue() > num)
7631 {
7632 num = thing.GetEquipValue();
7633 result = thing;
7634 }
7635 }
7636 return result;
7637 }
int GetEquipValue()
Definition: Card.cs:7014
bool IsRangedWeapon
Definition: Card.cs:2231
bool CanEquipRanged(Thing t)
Definition: Chara.cs:7558

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

◆ GetBuffStats() [1/2]

Element Chara.GetBuffStats ( int  ele)
inline

Definition at line 9160 of file Chara.cs.

9161 {
9162 for (int i = 0; i < conditions.Count; i++)
9163 {
9164 if (conditions[i] is ConBuffStats conBuffStats && conBuffStats.refVal == ele)
9165 {
9166 return conBuffStats.elements.GetElement(ele);
9167 }
9168 }
9169 return null;
9170 }

References BaseCondition.refVal.

◆ GetBuffStats() [2/2]

Element Chara.GetBuffStats ( string  alias)
inline

Definition at line 9155 of file Chara.cs.

9156 {
9157 return GetBuffStats(EClass.sources.elements.alias[alias].id);
9158 }
Element GetBuffStats(string alias)
Definition: Chara.cs:9155

References SourceManager.elements, and EClass.sources.

Referenced by GoalCombat.TryUseAbility().

◆ GetBurden()

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

Definition at line 1791 of file Chara.cs.

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

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

◆ GetCondition< T >()

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

Definition at line 9198 of file Chara.cs.

9198 : Condition
9199 {
9200 for (int i = 0; i < conditions.Count; i++)
9201 {
9202 if (conditions[i] is T)
9203 {
9204 return conditions[i] as T;
9205 }
9206 }
9207 return null;
9208 }

◆ GetCooldown()

int Chara.GetCooldown ( int  idEle)
inline

Definition at line 8453 of file Chara.cs.

8454 {
8455 if (_cooldowns != null)
8456 {
8457 for (int i = 0; i < _cooldowns.Count; i++)
8458 {
8459 if (_cooldowns[i] / 1000 == idEle)
8460 {
8461 return _cooldowns[i] % 1000;
8462 }
8463 }
8464 }
8465 return 0;
8466 }

Referenced by NotificationCooldown.OnRefresh().

◆ GetCurrentDir()

int Chara.GetCurrentDir ( )
inline

Definition at line 3587 of file Chara.cs.

3588 {
3589 Debug.Log(angle);
3590 if (!renderer.hasActor)
3591 {
3592 if (angle == 0f || angle == 45f || angle == 90f)
3593 {
3594 return 2;
3595 }
3596 if (angle == -135f || angle == 180f || angle == -90f)
3597 {
3598 return 1;
3599 }
3600 if (angle == 135f)
3601 {
3602 return 0;
3603 }
3604 return 3;
3605 }
3606 return renderer.actor.currentDir;
3607 }
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 7082 of file Chara.cs.

7083 {
7084 return (ai.IsRunning ? ai.GetDestination() : pos).Copy();
7085 }
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 4597 of file Chara.cs.

4598 {
4599 if (elements.Value(122) > elements.Value(120))
4600 {
4601 return elements.GetElement(122);
4602 }
4603 return elements.GetElement(120);
4604 }
int Value(int ele)

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

◆ GetFavAttackStyle()

AttackStyle Chara.GetFavAttackStyle ( )
inline

Definition at line 4572 of file Chara.cs.

4573 {
4574 int num = Evalue(131);
4575 int num2 = Evalue(130);
4576 int num3 = Evalue(123);
4577 if (num > num2 && num > num3)
4578 {
4579 return AttackStyle.TwoWield;
4580 }
4581 if (num2 > num && num2 > num3)
4582 {
4583 return AttackStyle.TwoHand;
4584 }
4585 if (num3 > num && num3 > num2)
4586 {
4587 return AttackStyle.Shield;
4588 }
4589 return AttackStyle.Default;
4590 }

Referenced by WindowChara.RefreshNote().

◆ GetFavCat()

SourceCategory.Row Chara.GetFavCat ( )
inline

Definition at line 7842 of file Chara.cs.

7843 {
7844 SourceCategory.Row r = null;
7845 if (_listFavCat.Count == 0)
7846 {
7847 foreach (SourceCategory.Row row in EClass.sources.categories.rows)
7848 {
7849 if (row.gift > 0)
7850 {
7851 _listFavCat.Add(row);
7852 }
7853 }
7854 }
7855 Rand.UseSeed(base.uid + EClass.game.seed, delegate
7856 {
7857 r = _listFavCat.RandomItem();
7858 });
7859 return r;
7860 }
static List< SourceCategory.Row > _listFavCat
Definition: Chara.cs:192
int seed
Definition: Game.cs:197
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 7822 of file Chara.cs.

7823 {
7824 if (_listFavFood.Count == 0)
7825 {
7826 foreach (SourceThing.Row row in EClass.sources.things.rows)
7827 {
7828 if (row._origin == "dish" && row.value != 0 && row.chance != 0)
7829 {
7830 _listFavFood.Add(row);
7831 }
7832 }
7833 }
7834 SourceThing.Row r = null;
7835 Rand.UseSeed(base.uid + EClass.game.seed, delegate
7836 {
7837 r = _listFavFood.RandomItem();
7838 });
7839 return r;
7840 }
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 4592 of file Chara.cs.

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

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

8520 {
8521 if (IsPC)
8522 {
8523 return null;
8524 }
8525 switch (TimeTable.GetSpan(idTimeTable, hour))
8526 {
8527 case TimeTable.Span.Sleep:
8529 {
8530 return new GoalSleep();
8531 }
8532 break;
8533 case TimeTable.Span.Eat:
8534 return new GoalIdle();
8535 case TimeTable.Span.Work:
8536 if (IsGuest())
8537 {
8538 return new GoalIdle();
8539 }
8540 return GetGoalWork();
8541 case TimeTable.Span.Free:
8542 if (IsGuest())
8543 {
8544 return new GoalIdle();
8545 }
8546 return GetGoalHobby();
8547 }
8548 return null;
8549 }
Goal GetGoalWork()
Definition: Chara.cs:8551
Goal GetGoalHobby()
Definition: Chara.cs:8564
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 8564 of file Chara.cs.

8565 {
8566 if (IsPrisoner)
8567 {
8568 return new GoalIdle();
8569 }
8570 if (memberType == FactionMemberType.Livestock)
8571 {
8572 return new GoalGraze();
8573 }
8574 return new GoalHobby();
8575 }
FactionMemberType
bool IsPrisoner
Definition: Chara.cs:1036

Referenced by Zone.Simulate().

◆ GetGoalWork()

Goal Chara.GetGoalWork ( )
inline

Definition at line 8551 of file Chara.cs.

8552 {
8553 if (IsPrisoner)
8554 {
8555 return new GoalIdle();
8556 }
8557 if (memberType == FactionMemberType.Livestock)
8558 {
8559 return new GoalGraze();
8560 }
8561 return new GoalWork();
8562 }

Referenced by Zone.Simulate().

◆ GetHappiness()

int Chara.GetHappiness ( )
inline

Definition at line 7092 of file Chara.cs.

7093 {
7094 int num = 50;
7095 if (FindBed() != null)
7096 {
7097 num += 50;
7098 }
7099 return num;
7100 }

◆ GetHireCost()

int Chara.GetHireCost ( )
inline

Definition at line 7087 of file Chara.cs.

7088 {
7089 return base.LV / 2 + 4;
7090 }

Referenced by CalcGold.Hire().

◆ GetHoverText()

override string Chara.GetHoverText ( )
inlinevirtual

Reimplemented from Card.

Definition at line 6621 of file Chara.cs.

6622 {
6623 string text = base.Name;
6624 if (IsFriendOrAbove())
6625 {
6626 text = text.TagColor(EClass.Colors.colorFriend);
6627 }
6628 else if (IsHostile())
6629 {
6630 text = text.TagColor(EClass.Colors.colorHostile);
6631 }
6632 int num = 2;
6633 int lV = EClass.pc.LV;
6634 if (base.LV >= lV * 5)
6635 {
6636 num = 0;
6637 }
6638 else if (base.LV >= lV * 2)
6639 {
6640 num = 1;
6641 }
6642 else if (base.LV <= lV / 4)
6643 {
6644 num = 4;
6645 }
6646 else if (base.LV <= lV / 2)
6647 {
6648 num = 3;
6649 }
6650 string text2 = Lang.GetList("lvComparison")[num];
6651 text2 = (" (" + text2 + ") ").TagSize(14).TagColor(EClass.Colors.gradientLVComparison.Evaluate(0.25f * (float)num));
6652 string s = (IsFriendOrAbove() ? "HostilityAlly" : (IsNeutral() ? "HostilityNeutral" : "HostilityEnemy"));
6653 s = (" (" + s.lang() + ") ").TagSize(14);
6654 s = "";
6655 if (memberType == FactionMemberType.Guest)
6656 {
6657 s += (" (" + "guest".lang() + ") ").TagSize(14);
6658 }
6659 else if (memberType == FactionMemberType.Livestock)
6660 {
6661 s += (" (" + "livestock".lang() + ") ").TagSize(14);
6662 }
6663 if (!EClass.pc.IsMoving)
6664 {
6665 if (EClass.pc.HasHigherGround(this))
6666 {
6667 text2 += "lowerGround".lang();
6668 }
6669 else if (HasHigherGround(EClass.pc))
6670 {
6671 text2 += "higherGround".lang();
6672 }
6673 }
6674 if (Evalue(1232) > 0)
6675 {
6676 text2 = "milkBaby".lang().TagSize(14) + text2;
6677 }
6678 if (Guild.Fighter.ShowBounty(this) && Guild.Fighter.HasBounty(this))
6679 {
6680 text2 = "hasBounty".lang().TagSize(14) + text2;
6681 }
6682 if (EClass.pc.HasElement(481))
6683 {
6684 text2 += ("(" + faith.Name + ")").TagSize(14);
6685 }
6686 return text + text2 + s;
6687 }
bool HasHigherGround(Card c)
Definition: Chara.cs:1184
override bool IsMoving
Definition: Chara.cs:606
bool IsNeutral()
Definition: Chara.cs:6426
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 6689 of file Chara.cs.

6690 {
6691 string text = "";
6692 if (knowFav)
6693 {
6694 text += Environment.NewLine;
6695 text = text + "<size=14>" + "favgift".lang(GetFavCat().GetName().ToLower(), GetFavFood().GetName()) + "</size>";
6696 }
6697 string text2 = "";
6699 {
6700 text2 += Environment.NewLine;
6701 text2 = text2 + "Lv:" + base.LV + " HP:" + base.hp + "/" + MaxHP + " MP:" + mana.value + "/" + mana.max + " DV:" + DV + " PV:" + PV + " Hunger:" + hunger.value;
6702 text2 += Environment.NewLine;
6703 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");
6704 text2 += Environment.NewLine;
6705 text2 = text2 + base.uid + IsMinion + "/" + base.c_uidMaster + "/" + master;
6706 text2 = text2 + " dir:" + base.dir + " skin:" + base.idSkin + " scaled:" + base.isScaled;
6707 }
6709 {
6710 text2 += Environment.NewLine;
6711 text2 += "<size=14>";
6712 foreach (Hobby item in ListWorks())
6713 {
6714 text2 = text2 + item.Name + ", ";
6715 }
6716 foreach (Hobby item2 in ListHobbies())
6717 {
6718 text2 = text2 + item2.Name + ", ";
6719 }
6720 text2 = text2.TrimEnd(", ".ToCharArray()) + "</size>";
6721 }
6722 string text3 = "";
6723 IEnumerable<BaseStats> enumerable = conditions.Concat((!IsPCFaction) ? new BaseStats[0] : new BaseStats[2] { hunger, stamina });
6724 if (enumerable.Count() > 0)
6725 {
6726 text3 += Environment.NewLine;
6727 text3 += "<size=14>";
6728 int num = 0;
6729 foreach (BaseStats item3 in enumerable)
6730 {
6731 string text4 = item3.GetPhaseStr();
6732 if (text4.IsEmpty() || text4 == "#")
6733 {
6734 continue;
6735 }
6736 Color c = Color.white;
6737 switch (item3.source.group)
6738 {
6739 case "Bad":
6740 case "Debuff":
6741 case "Disease":
6743 break;
6744 case "Buff":
6746 break;
6747 }
6749 {
6750 text4 = text4 + "(" + item3.GetValue() + ")";
6751 if (resistCon != null && resistCon.ContainsKey(item3.id))
6752 {
6753 text4 = text4 + "{" + resistCon[item3.id] + "}";
6754 }
6755 }
6756 num++;
6757 text3 = text3 + text4.TagColor(c) + ", ";
6758 }
6759 if (num == 0)
6760 {
6761 text3 = "";
6762 }
6763 else
6764 {
6765 text = "";
6766 text3 = text3.TrimEnd(", ".ToCharArray()) + "</size>";
6767 }
6768 }
6770 {
6771 text3 += Environment.NewLine;
6772 foreach (ActList.Item item4 in ability.list.items)
6773 {
6774 text3 = text3 + item4.act.Name + ", ";
6775 }
6776 text3 = text3.TrimEnd(", ".ToCharArray());
6777 }
6778 return text + text2 + text3;
6779 }
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:7842
bool knowFav
Definition: Chara.cs:411
override string GetName(NameStyle style, int num=-1)
Definition: Chara.cs:1351
override int DV
Definition: Chara.cs:727
List< Hobby > ListHobbies(bool useMemberType=true)
Definition: Chara.cs:8707
override int PV
Definition: Chara.cs:756
SourceThing.Row GetFavFood()
Definition: Chara.cs:7822
List< Hobby > ListWorks(bool useMemberType=true)
Definition: Chara.cs:8680
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 7924 of file Chara.cs.

7925 {
7926 if (id == "olderyoungersister")
7927 {
7928 if (base.idSkin != 2)
7929 {
7930 return "UN_olderyoungersister";
7931 }
7932 return "UN_olderyoungersister_alt";
7933 }
7934 if (Portrait.allIds.Contains("UN_" + id + ".png"))
7935 {
7936 return "UN_" + id;
7937 }
7938 return base.c_idPortrait;
7939 }
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 7910 of file Chara.cs.

7911 {
7912 string text = race.id;
7913 if ((text == "mifu" || text == "nefu") && EClass.rnd(2) == 0)
7914 {
7915 return "foxfolk";
7916 }
7917 if (trait is TraitGuard)
7918 {
7919 return "guard";
7920 }
7921 return "";
7922 }

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

6876 {
6877 return GetSprite();
6878 }
override Sprite GetSprite(int dir=0)
Definition: Chara.cs:6545

◆ GetName()

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

Reimplemented from Card.

Definition at line 1351 of file Chara.cs.

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

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

7863 {
7864 using (List<Chara>.Enumerator enumerator = pos.ListCharasInRadius(this, 3, (Chara c) => c != this && c.race.id == "cat").GetEnumerator())
7865 {
7866 if (enumerator.MoveNext())
7867 {
7868 return enumerator.Current;
7869 }
7870 }
7871 return null;
7872 }
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 9892 of file Chara.cs.

9893 {
9894 if (base._IsPC)
9895 {
9896 return 10 + (int)(Mathf.Sqrt(base.c_daysWithGod) * 2f + (float)Evalue(85)) / 2;
9897 }
9898 return 10 + (int)(Mathf.Sqrt(base.LV) * 5f + (float)Evalue(306)) / 2;
9899 }

◆ GetRevived()

void Chara.GetRevived ( )
inline

Definition at line 5015 of file Chara.cs.

5016 {
5017 Revive(EClass.pc.pos.GetNearestPoint(allowBlock: false, allowChara: false), msg: true);
5018 if (!IsPCFaction)
5019 {
5020 return;
5021 }
5023 {
5024 if (homeZone != null && EClass._zone != homeZone)
5025 {
5026 Msg.Say("returnHome", this, homeZone.Name);
5028 }
5029 }
5030 else if (!EClass._zone.IsPCFaction || homeBranch != EClass.Branch || base.c_wasInPcParty)
5031 {
5032 EClass.pc.party.AddMemeber(this, showMsg: true);
5033 }
5034 }
static FactionBranch Branch
Definition: EClass.cs:22
void AddMemeber(Chara c, bool showMsg=false)
Definition: Party.cs:56
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 8658 of file Chara.cs.

8659 {
8660 BaseArea result = null;
8661 foreach (Hobby item in ListWorks())
8662 {
8663 AIWork aI = item.GetAI(this);
8664 if (aI.SetDestination())
8665 {
8666 if (aI.destArea != null)
8667 {
8668 result = aI.destArea;
8669 }
8670 else if (aI.destThing != null)
8671 {
8672 result = aI.destThing.pos.cell.room;
8673 }
8674 break;
8675 }
8676 }
8677 return result;
8678 }
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 6545 of file Chara.cs.

6546 {
6547 if (IsPCC)
6548 {
6549 PCC pCC = PCC.Get(pccData);
6550 pCC.Build();
6551 return pCC.variation.idle[0, 0];
6552 }
6553 if (spriteReplacer != null)
6554 {
6555 return spriteReplacer.data.GetSprite();
6556 }
6557 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);
6558 }
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 6569 of file Chara.cs.

6570 {
6571 if (IsPCC)
6572 {
6574 {
6576 }
6577 }
6578 else if (conSleep != null && host == null && pos.Equals(EClass.pc.pos) && IsHuman && (GetBool(123) || affinity.CanSleepBeside()))
6579 {
6580 return EClass.setting.pass.subDead;
6581 }
6582 return SubPassData.Default;
6583 }
bool CanSleepBeside()
Definition: Affinity.cs:77
bool GetBool(int id)
Definition: BaseCard.cs:15
ConSleep conSleep
Definition: Chara.cs:102
override bool IsDeadOrSleeping
Definition: Chara.cs:571
Affinity affinity
Definition: Chara.cs:312
PassSetting pass
Definition: GameSetting.cs:303
bool altHeldPos
Definition: Player.cs:1150
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 7102 of file Chara.cs.

7103 {
7104 return GetHappiness().ToString() ?? "";
7105 }
int GetHappiness()
Definition: Chara.cs:7092

◆ GetTextHobby()

string Chara.GetTextHobby ( bool  simple = false)
inline

Definition at line 8796 of file Chara.cs.

8797 {
8798 string text = (simple ? "" : ("hobby".lang() + ":"));
8799 foreach (Hobby item in ListHobbies())
8800 {
8801 text = text + " " + item.Name.TagColor((item.GetEfficiency(this) > 0) ? FontColor.Good : FontColor.Warning) + ",";
8802 }
8803 return text.TrimEnd(',');
8804 }

References item.

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

◆ GetTextWork()

string Chara.GetTextWork ( bool  simple = false)
inline

Definition at line 8806 of file Chara.cs.

8807 {
8808 string text = (simple ? "" : ("work".lang() + ":"));
8809 foreach (Hobby item in ListWorks())
8810 {
8811 text = text + " " + item.Name.TagColor((item.GetEfficiency(this) > 0) ? FontColor.Good : FontColor.Warning) + ",";
8812 }
8813 return text.TrimEnd(',');
8814 }

References item.

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

◆ GetTopicText()

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

Definition at line 6781 of file Chara.cs.

6782 {
6783 string key = source.idText.IsEmpty(id);
6784 if (id == "littleOne" && EClass._zone is Zone_LittleGarden)
6785 {
6786 key = "littleOne2";
6787 }
6788 SourceCharaText.Row row = EClass.sources.charaText.map.TryGetValue(key);
6789 if (row == null)
6790 {
6791 return null;
6792 }
6793 string text = row.GetText(topic, returnNull: true);
6794 if (text.IsEmpty())
6795 {
6796 return null;
6797 }
6798 if (text.StartsWith("@"))
6799 {
6800 row = EClass.sources.charaText.map.TryGetValue(text.Replace("@", ""));
6801 if (row == null)
6802 {
6803 return null;
6804 }
6805 text = row.GetText(topic, returnNull: true);
6806 if (text.IsEmpty())
6807 {
6808 return null;
6809 }
6810 }
6811 return text.Split(Environment.NewLine.ToCharArray()).RandomItem();
6812 }
SourceCharaText charaText

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

◆ GetTotalFeat()

int Chara.GetTotalFeat ( )
inline

Definition at line 7884 of file Chara.cs.

7885 {
7886 int num = 0;
7887 if (base.c_upgrades != null)
7888 {
7889 num += base.c_upgrades.spent;
7890 }
7891 if (base.c_genes != null)
7892 {
7893 num += base.c_genes.GetTotalCost();
7894 }
7895 return num + base.feat;
7896 }

◆ GetWork()

Hobby Chara.GetWork ( string  id)
inline

Definition at line 8727 of file Chara.cs.

8728 {
8729 foreach (Hobby item in ListWorks())
8730 {
8731 if (item.source.alias == id)
8732 {
8733 return item;
8734 }
8735 }
8736 foreach (Hobby item2 in ListHobbies())
8737 {
8738 if (item2.source.alias == id)
8739 {
8740 return item2;
8741 }
8742 }
8743 return null;
8744 }
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 8879 of file Chara.cs.

8880 {
8881 if (_workSummary == null)
8882 {
8883 _workSummary = new WorkSummary();
8884 }
8885 return _workSummary;
8886 }
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 8023 of file Chara.cs.

8024 {
8025 if (c.IsHostile() || c.IsDeadOrSleeping)
8026 {
8027 Msg.Say("affinityNone", c, this);
8028 return;
8029 }
8030 if (!t.isCopy && t.IsCursed && t.IsEquipmentOrRanged && !t.IsAmmo && c.HasElement(1414))
8031 {
8032 bool num = t.blessedState == BlessedState.Doomed;
8033 int num2 = 200 + t.LV * 3;
8034 if (t.rarity == Rarity.Legendary)
8035 {
8036 num2 *= 3;
8037 }
8038 if (t.rarity >= Rarity.Mythical)
8039 {
8040 num2 *= 5;
8041 }
8042 if (num)
8043 {
8044 num2 *= 2;
8045 }
8046 EClass.pc.PlayEffect("identify");
8047 EClass.pc.PlaySound("identify");
8048 c.PlayEffect("mutation");
8049 c.Say("draw_curse", c, t);
8050 t.Destroy();
8051 List<Element> list = new List<Element>();
8052 foreach (Element value in EClass.pc.elements.dict.Values)
8053 {
8054 if (value is Spell)
8055 {
8056 list.Add(value);
8057 }
8058 }
8059 if (list.Count == 0)
8060 {
8062 return;
8063 }
8064 Element element = list.RandomItem();
8065 EClass.pc.ModExp(element.id, num2);
8066 EClass.pc.Say("draw_curse2", EClass.pc, element.Name);
8067 c.AddExp(Mathf.Min(num2 / 3, c.ExpToNext));
8068 return;
8069 }
8070 if ((t.id == "lovepotion" || t.id == "dreambug") && !Application.isEditor)
8071 {
8072 GiveLovePotion(c, t);
8073 return;
8074 }
8075 if (t.trait is TraitErohon && c.id == t.c_idRefName)
8076 {
8077 c.OnGiveErohon(t);
8078 return;
8079 }
8080 if (t.trait is TraitTicketMassage)
8081 {
8082 t.ModNum(-1);
8083 c.Talk("ticket");
8084 switch (t.id)
8085 {
8086 case "ticket_massage":
8087 c.ModAffinity(EClass.pc, 10);
8089 {
8090 target = c
8091 });
8092 break;
8093 case "ticket_armpillow":
8094 c.ModAffinity(EClass.pc, 20);
8095 EClass.pc.AddCondition<ConSleep>(300, force: true);
8096 c.SetAI(new AI_ArmPillow
8097 {
8098 target = EClass.pc
8099 });
8100 break;
8101 case "ticket_champagne":
8102 c.ModAffinity(EClass.pc, 10);
8104 break;
8105 }
8106 return;
8107 }
8108 if (t.id == "flyer")
8109 {
8110 stamina.Mod(-1);
8111 if (c.things.Find((Thing a) => a.id == "flyer") != null)
8112 {
8113 c.Talk("flyer_miss");
8114 DoHostileAction(c);
8115 return;
8116 }
8117 if (EClass.rnd(20) != 0 && c.CHA > EClass.rnd(base.CHA + Evalue(291) * 3 + 10))
8118 {
8119 Msg.Say("affinityNone", c, this);
8120 t.Destroy();
8121 elements.ModExp(291, 10f);
8122 return;
8123 }
8124 elements.ModExp(291, 50f);
8125 }
8126 if (t.id == "statue_weird")
8127 {
8128 EClass.pc.Say("statue_sell");
8129 }
8130 t.isGifted = true;
8131 c.nextUse = c.affinity.OnGift(t);
8132 if (!t.isDestroyed)
8133 {
8134 EClass.game.quests.list.ForeachReverse(delegate(Quest q)
8135 {
8136 q.OnGiveItem(c, t);
8137 });
8138 if (c.TryEquip(t))
8139 {
8140 c.nextUse = null;
8141 }
8142 }
8143 }
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:6656
string c_idRefName
Definition: Card.cs:1641
void AddExp(int a)
Definition: Card.cs:2931
void GiveLovePotion(Chara c, Thing t)
Definition: Chara.cs:8156
bool TryEquip(Thing t, bool useFav=false)
Definition: Chara.cs:7519
void OnGiveErohon(Thing t)
Definition: Chara.cs:8145
QuestManager quests
Definition: Game.cs:179
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 8156 of file Chara.cs.

8157 {
8158 c.Say("give_love", c, t);
8159 c.PlaySound(t.material.GetSoundDead());
8160 c.ShowEmo(Emo.angry);
8161 c.ModAffinity(EClass.pc, -20, show: false);
8162 c.Talk("pervert");
8163 t.Destroy();
8164 }

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

6187 {
6188 if (enemy == null && !IsPC)
6189 {
6190 if (GetInt(106) == 0)
6191 {
6192 TalkTopic("aggro");
6193 }
6194 if (OriginalHostility != Hostility.Enemy)
6195 {
6196 ShowEmo(Emo.angry);
6197 }
6198 SetEnemy(_tg.Chara);
6199 }
6201 {
6202 if (hostility >= Hostility.Neutral)
6203 {
6204 Say("angry", this);
6205 }
6206 hostility = Hostility.Enemy;
6207 }
6208 }
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 1274 of file Chara.cs.

1275 {
1276 return HasAccess(c.pos);
1277 }
bool HasAccess(Card c)
Definition: Chara.cs:1274

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

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

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

9132 {
9133 for (int i = 0; i < conditions.Count; i++)
9134 {
9135 if (conditions[i] is T)
9136 {
9137 return true;
9138 }
9139 }
9140 return false;
9141 }

◆ HasCooldown()

bool Chara.HasCooldown ( int  idEle)
inline

Definition at line 8448 of file Chara.cs.

8449 {
8450 return GetCooldown(idEle) != 0;
8451 }
int GetCooldown(int idEle)
Definition: Chara.cs:8453

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

◆ HasHigherGround()

bool Chara.HasHigherGround ( Card  c)
inline

Definition at line 1184 of file Chara.cs.

1185 {
1186 if (c == null)
1187 {
1188 return false;
1189 }
1190 float num = renderer.position.y - pos.Position(0).y + (_isLevitating ? 0.4f : 0f);
1191 float num2 = c.renderer.position.y - c.pos.Position(0).y + ((c.isChara && c.Chara._isLevitating) ? 0.4f : 0f);
1192 return num > num2 + 0.1f;
1193 }
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 8577 of file Chara.cs.

8578 {
8579 int num = EClass.sources.hobbies.alias.TryGetValue(alias)?.id ?? 0;
8580 listHobby.Clear();
8581 if (_works == null || _hobbies == null)
8582 {
8583 RerollHobby();
8584 }
8585 foreach (int work in _works)
8586 {
8587 if (work == num)
8588 {
8589 return true;
8590 }
8591 }
8592 foreach (int hobby in _hobbies)
8593 {
8594 if (hobby == num)
8595 {
8596 return true;
8597 }
8598 }
8599 return false;
8600 }
static List< Hobby > listHobby
Definition: Chara.cs:13
void RerollHobby(bool extraSlotChance=true)
Definition: Chara.cs:8840
SourceHobby hobbies

References SourceManager.hobbies, and EClass.sources.

Referenced by AI_Idle.Run().

◆ HasMinion()

bool Chara.HasMinion ( string  id)
inline

Definition at line 2324 of file Chara.cs.

2325 {
2326 foreach (Chara chara in EClass._map.charas)
2327 {
2328 if (chara.c_uidMaster == base.uid)
2329 {
2330 return true;
2331 }
2332 }
2333 return false;
2334 }

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

Referenced by ActEffect.ProcAt().

◆ HealAll()

void Chara.HealAll ( )
inline

Definition at line 1708 of file Chara.cs.

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

4396 {
4397 if (held == t || t.isDestroyed || t.Num <= 0)
4398 {
4399 return;
4400 }
4401 if (IsPC && t.isNPCProperty)
4402 {
4403 t.isNPCProperty = false;
4405 pos.TryWitnessCrime(this);
4406 }
4407 PickHeld();
4408 if (t.isChara)
4409 {
4411 {
4412 t.ShowEmo(Emo.love);
4413 }
4414 EClass.player.altHeldPos = t.renderer.data.ForceAltHeldPosition || EClass.rnd(2) == 0;
4415 }
4416 else
4417 {
4418 if (num == -1 || num > t.Num)
4419 {
4420 num = t.Num;
4421 }
4422 if (num < t.Num)
4423 {
4424 t = t.Split(num);
4425 }
4426 }
4427 if (t.GetRootCard() != this)
4428 {
4429 t = Pick(t.Thing, msg: false, tryStack: false);
4430 if (t.GetRootCard() != this)
4431 {
4432 return;
4433 }
4434 }
4435 held = t;
4436 if (held.GetLightRadius() > 0)
4437 {
4439 }
4440 if (IsPC)
4441 {
4443 WidgetHotbar.dirtyCurrentItem = true;
4444 }
4445 }
Thing Split(int a)
Definition: Card.cs:3414
bool isNPCProperty
Definition: Card.cs:554
void RecalculateFOV()
Definition: Card.cs:6221
virtual bool IsAliveInCurrentZone
Definition: Card.cs:2115
int GetLightRadius()
Definition: Card.cs:6268
void PickHeld(bool msg=false)
Definition: Chara.cs:4447
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 8963 of file Chara.cs.

8964 {
8965 if (!onDeserialize)
8966 {
8967 _cints[10] = 20;
8968 _cints[11] = 70;
8969 _cints[13] = 70;
8970 _cints[14] = 70;
8971 _cints[15] = 70;
8972 _cints[17] = 0;
8973 _cints[18] = 0;
8974 }
8975 foreach (Condition condition in conditions)
8976 {
8977 condition.SetOwner(this, onDeserialize);
8978 }
8979 }
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 7395 of file Chara.cs.

7396 {
7397 if (t == null)
7398 {
7399 t = FindBestFoodToEat();
7400 }
7401 if (t == null)
7402 {
7403 t = things.Find((Thing a) => CanEat(a, shouldEat: true) && !a.c_isImportant);
7404 }
7405 if (t == null)
7406 {
7407 t = things.Find((Thing a) => CanEat(a) && !a.c_isImportant);
7408 }
7409 if (t != null)
7410 {
7411 Say("eat_start", this, t.Duplicate(1));
7412 if (sound)
7413 {
7414 PlaySound("eat");
7415 }
7416 FoodEffect.Proc(this, t);
7417 }
7418 }
Thing FindBestFoodToEat()
Definition: Chara.cs:7374
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 6436 of file Chara.cs.

6437 {
6438 if (faction == EClass.Home)
6439 {
6440 return homeZone == EClass.game.activeZone;
6441 }
6442 return false;
6443 }
Faction faction
Definition: Chara.cs:425
Zone activeZone
Definition: Game.cs:248

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

◆ IsCriticallyWounded()

bool Chara.IsCriticallyWounded ( bool  includeRide = false)
inline

Definition at line 1171 of file Chara.cs.

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

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

2469 {
2470 if (!currentZone.IsRegion && p.IsValid)
2471 {
2472 CellDetail detail = p.detail;
2473 if (detail != null && detail.charas.Count > 0)
2474 {
2475 foreach (Chara chara in p.detail.charas)
2476 {
2477 if (chara.IsHostile(this) || chara.IsHostile() || !chara.trait.CanBePushed)
2478 {
2479 if (cancelAI && EClass.pc.ai is GoalManualMove)
2480 {
2481 EClass.pc.ai.Cancel();
2482 }
2483 return true;
2484 }
2485 }
2486 }
2487 }
2488 return false;
2489 }
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 2368 of file Chara.cs.

2369 {
2370 if (!IsPCPartyMinion)
2371 {
2372 return false;
2373 }
2374 foreach (Quest item in EClass.game.quests.list)
2375 {
2376 if (item is QuestEscort questEscort && questEscort.uidChara == base.uid)
2377 {
2378 return true;
2379 }
2380 }
2381 return false;
2382 }
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 6480 of file Chara.cs.

6481 {
6482 if (base.IsPCFactionOrMinion || IsFriendOrAbove())
6483 {
6485 {
6486 return true;
6487 }
6488 }
6489 else if (IsHostile() && c.IsHostile())
6490 {
6491 return true;
6492 }
6493 return false;
6494 }

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

◆ IsGuest()

◆ IsHomeMember()

◆ IsHostile() [1/2]

◆ IsHostile() [2/2]

bool Chara.IsHostile ( Chara  c)
inline

Definition at line 6392 of file Chara.cs.

6393 {
6394 if (c == null)
6395 {
6396 return false;
6397 }
6398 if (base.IsPCFactionOrMinion)
6399 {
6400 if ((c == EClass.pc.enemy && !c.IsPCFactionOrMinion) || c.hostility <= Hostility.Enemy)
6401 {
6402 return true;
6403 }
6404 }
6405 else
6406 {
6408 {
6409 return true;
6410 }
6411 if (OriginalHostility >= Hostility.Friend)
6412 {
6413 if (c.hostility <= Hostility.Enemy && c.OriginalHostility == Hostility.Enemy)
6414 {
6415 return true;
6416 }
6417 }
6418 else if (OriginalHostility <= Hostility.Enemy && (c.IsPCFactionOrMinion || (c.OriginalHostility != Hostility.Enemy && c.hostility >= Hostility.Friend)))
6419 {
6420 return true;
6421 }
6422 }
6423 return false;
6424 }
bool IsCriminal
Definition: Player.cs:1334

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

6451 {
6452 return EClass.game.activeZone == currentZone;
6453 }

Referenced by BaseListPeople.IsDisabled().

◆ IsInSpot< T >()

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

Definition at line 6455 of file Chara.cs.

6455 : TraitSpot
6456 {
6457 foreach (T item in EClass._map.props.installed.traits.List<T>())
6458 {
6459 foreach (Point item2 in item.ListPoints())
6460 {
6461 if (pos.Equals(item2))
6462 {
6463 return true;
6464 }
6465 }
6466 }
6467 return false;
6468 }
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 6426 of file Chara.cs.

6427 {
6428 return hostility == Hostility.Neutral;
6429 }

Referenced by ActPlan._Update().

◆ IsNeutralOrAbove()

bool Chara.IsNeutralOrAbove ( )
inline

◆ IsValidGiftWeight()

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

Definition at line 7967 of file Chara.cs.

7968 {
7969 int num2 = ((!HasElement(1411)) ? 1 : 3);
7970 if (GetBurden(t, num) >= num2)
7971 {
7972 return false;
7973 }
7974 return true;
7975 }
int GetBurden(Card t=null, int num=-1)
Definition: Chara.cs:1791

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

5655 {
5657 {
5658 return;
5659 }
5660 if (t.IsPC)
5661 {
5663 }
5664 if (t.host != null)
5665 {
5666 return;
5667 }
5668 if (t == this)
5669 {
5670 if (!ignoreSelf)
5671 {
5672 Debug.Log(t.pos.GetNearestPoint());
5673 if (TryMove(t.pos.GetNearestPoint()) != MoveResult.Success)
5674 {
5676 }
5677 }
5678 return;
5679 }
5680 if (show)
5681 {
5682 Say("kick", this, t);
5683 }
5684 PlaySound("kick");
5685 if ((t.conSuspend == null || t.conSuspend.uidMachine != 0) && t.trait.CanBePushed && (!t.IsHostile() || EClass.rnd(2) == 0) && !t.noMove && !t.isRestrained)
5686 {
5687 t.MoveByForce(t.pos.GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: true, ignoreCenter: true), this, checkWall && !t.pos.IsBlocked);
5688 }
5689 if (t.conSleep != null)
5690 {
5691 t.conSleep.Kill();
5692 }
5693 if (IsPC && t.IsFriendOrAbove() && !t.IsPCFactionOrMinion && karmaLoss)
5694 {
5696 }
5697 t.PlayEffect("kick");
5698 }
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:5700
ConSuspend conSuspend
Definition: Chara.cs:104
MoveResult TryMove(Point newPoint, bool allowDestroyPath=true)
Definition: Chara.cs:2692
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 5646 of file Chara.cs.

5647 {
5648 foreach (Chara item in p.ListCharas())
5649 {
5650 Kick(item, ignoreSelf, karmaLoss: true, show: true, checkWall);
5651 }
5652 }
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 9571 of file Chara.cs.

9572 {
9573 List<Element> list = new List<Element>();
9574 foreach (SourceElement.Row item in EClass.sources.elements.rows.Where((SourceElement.Row a) => a.group == "FEAT" && a.cost[0] != -1 && !a.categorySub.IsEmpty()))
9575 {
9577 int num = ((feat.ValueWithoutLink <= 0) ? 1 : (feat.ValueWithoutLink + 1));
9578 if (num <= feat.source.max && !feat.HasTag("class") && !feat.HasTag("hidden") && !feat.HasTag("innate") && (!pet || !feat.HasTag("noPet")) && (showAll || feat.IsPurchaseFeatReqMet(elements)))
9579 {
9580 list.Add(Element.Create(feat.id, num) as Feat);
9581 }
9582 }
9583 return list;
9584 }
int feat
Definition: Card.cs:374
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1100
Definition: FEAT.cs:280

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

8708 {
8709 listHobby.Clear();
8710 if (!useMemberType || memberType != FactionMemberType.Livestock)
8711 {
8712 if (_hobbies == null)
8713 {
8714 RerollHobby();
8715 }
8716 foreach (int hobby in _hobbies)
8717 {
8718 listHobby.Add(new Hobby
8719 {
8720 id = hobby
8721 });
8722 }
8723 }
8724 return listHobby;
8725 }

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

8681 {
8682 listHobby.Clear();
8683 if (useMemberType && memberType == FactionMemberType.Livestock)
8684 {
8685 listHobby.Add(new Hobby
8686 {
8687 id = 45
8688 });
8689 }
8690 else
8691 {
8692 if (_works == null)
8693 {
8694 RerollHobby();
8695 }
8696 foreach (int work in _works)
8697 {
8698 listHobby.Add(new Hobby
8699 {
8700 id = work
8701 });
8702 }
8703 }
8704 return listHobby;
8705 }

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

3507 {
3508 angle = Util.GetAngle(p.x - pos.x, p.z - pos.z);
3509 if (EClass._zone.IsRegion)
3510 {
3511 if (angle > 100f && angle < 170f)
3512 {
3513 base.dir = 2;
3514 }
3515 else if (angle > 170f && angle < 190f)
3516 {
3517 base.dir = 0;
3518 }
3519 else if (angle > 190f || (angle < -10f && angle > -100f))
3520 {
3521 base.dir = 3;
3522 }
3523 else
3524 {
3525 base.dir = 1;
3526 }
3527 angle -= 45f;
3528 }
3529 else if (angle > 170f && angle < 235f)
3530 {
3531 base.dir = 0;
3532 }
3533 else if (angle > 80f && angle < 145f)
3534 {
3535 base.dir = 1;
3536 }
3537 else if (angle > -100f && angle < -35f)
3538 {
3539 base.dir = 3;
3540 }
3541 else if (angle > -10f && angle < 55f)
3542 {
3543 base.dir = 2;
3544 }
3546 }

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

◆ MakeAlly()

void Chara.MakeAlly ( bool  msg = true)
inline

Definition at line 2259 of file Chara.cs.

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

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

7947 {
7948 return DNA.GenerateGene(this, DNA.Type.Brain);
7949 }
Definition: DNA.cs:8
Type
Definition: DNA.cs:10
static Thing GenerateGene(Chara c, Type? type=null)
Definition: DNA.cs:104

References DNA.GenerateGene().

Referenced by CoreDebug.UpdateInput().

◆ MakeGene()

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

Definition at line 7941 of file Chara.cs.

7942 {
7943 return DNA.GenerateGene(this, type);
7944 }

References DNA.GenerateGene().

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

◆ MakeGrave()

void Chara.MakeGrave ( string  lastword)
inline

Definition at line 5104 of file Chara.cs.

5105 {
5106 if (!EClass._zone.IsRegion)
5107 {
5108 List<string> list = new List<string> { "930", "931", "947", "948", "949", "950", "951", "952" };
5109 if (IsPC && EClass.rnd(2) == 0 && EClass.pc.things.Find("letter_will") != null)
5110 {
5111 list = new List<string> { "944", "946", "backerGrave", "backerGrave2" };
5112 }
5113 Thing thing = ThingGen.Create(list.RandomItem());
5114 thing.MakeRefFrom(this);
5115 if (!lastword.IsEmpty())
5116 {
5117 thing.c_note = lastword;
5118 }
5119 thing.isModified = true;
5120 EClass._zone.AddCard(thing, pos).Install();
5121 }
5122 }
Card MakeRefFrom(string id)
Definition: Card.cs:5606

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

2314 {
2315 ReleaseMinion();
2316 Hostility hostility2 = (base.c_originalHostility = (_master.IsPCFaction ? Hostility.Ally : _master.hostility));
2317 this.hostility = hostility2;
2318 base.c_uidMaster = _master.uid;
2319 base.c_minionType = type;
2320 master = _master;
2321 Refresh();
2322 }
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 2253 of file Chara.cs.

2254 {
2255 _MakeAlly();
2256 EClass.pc.party.AddMemeber(this);
2257 }

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

7730 {
7731 if (c == this)
7732 {
7733 return;
7734 }
7735 if (IsPC)
7736 {
7737 c.ModAffinity(EClass.pc, a, show);
7738 return;
7739 }
7740 int num = StatsHygiene.GetAffinityMod(EClass.pc.hygiene.GetPhase()) + (HasElement(417) ? 30 : 0) + (EClass.pc.HasCondition<ConSmoking>() ? (-30) : 0);
7741 if (IsPCFaction && homeBranch != null)
7742 {
7743 num += (int)Mathf.Sqrt(homeBranch.Evalue(2117)) * 5;
7744 }
7745 bool flag = a > 0;
7746 if (flag)
7747 {
7748 a = a * num / 100;
7749 if (affinity.GetLunchChance() > EClass.rnd(100) && GetInt(71) >= 0 && GetInt(71) < EClass.world.date.GetRaw())
7750 {
7751 SetInt(71, -1);
7752 }
7753 }
7754 if (show)
7755 {
7756 if (a == 0)
7757 {
7758 if (!showOnlyEmo)
7759 {
7760 Say("affinityNone", this, c);
7761 }
7762 }
7763 else
7764 {
7765 ShowEmo((!flag) ? Emo.angry : Emo.love);
7766 c.ShowEmo(flag ? Emo.love : Emo.sad);
7767 if (!showOnlyEmo)
7768 {
7769 Say(flag ? "affinityPlus" : "affinityMinus", this, c);
7770 }
7771 }
7772 }
7773 if (c.IsPC)
7774 {
7775 a = affinity.Mod(a);
7776 }
7777 }
int Mod(int a)
Definition: Affinity.cs:192
int GetLunchChance()
Definition: Affinity.cs:86
Stats hygiene
Definition: Chara.cs:1146
int GetRaw(int offsetHours=0)
Definition: Date.cs:322
int Evalue(int ele)
static int GetAffinityMod(int phase)
Definition: StatsHygiene.cs:19

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

9529 {
9530 if (a > 0)
9531 {
9532 if (ResistLv(962) > 0 && EClass.rnd(ResistLv(962) + 1) != 0)
9533 {
9534 return;
9535 }
9536 int num = Evalue(412);
9537 if (num != 0)
9538 {
9539 float num2 = (float)a * 100f / (float)Mathf.Max(100 + num * 2, 10);
9540 a = (int)num2 + ((EClass.rndf(1f) < num2 % 1f) ? 1 : 0);
9541 }
9542 }
9543 if (a == 0)
9544 {
9545 return;
9546 }
9547 int num3 = (corruption + a) / 100 - corruption / 100;
9548 for (int i = 0; i < Mathf.Abs(num3); i++)
9549 {
9550 if (!MutateRandom((num3 > 0) ? 1 : (-1), 100, ether: true))
9551 {
9552 break;
9553 }
9554 }
9555 corruption += a;
9556 int num4 = 0;
9557 foreach (Element value in elements.dict.Values)
9558 {
9559 if (value.source.category == "ether")
9560 {
9561 num4 += value.Value;
9562 }
9563 }
9564 if (num4 > 0 && IsPC)
9565 {
9566 Tutorial.Reserve("ether");
9567 }
9568 corruption = num4 * 100 + corruption % 100;
9569 }
bool MutateRandom(int vec=0, int tries=100, bool ether=false, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:9691
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 9485 of file Chara.cs.

9486 {
9487 if (!HasElement(450))
9488 {
9489 int height = bio.height;
9490 height = height * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
9491 if (height < 1)
9492 {
9493 height = 1;
9494 }
9495 if (height != bio.height)
9496 {
9497 bio.height = height;
9498 Say((a > 0) ? "height_gain" : "height_lose", this);
9499 }
9500 }
9501 }
int height
Definition: Biography.cs:53

◆ ModTempElement()

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

Definition at line 9944 of file Chara.cs.

9945 {
9946 if (a < 0 && !naturalDecay && HasElement(EClass.sources.elements.alias["sustain_" + EClass.sources.elements.map[ele].alias]?.id ?? 0))
9947 {
9948 return;
9949 }
9950 bool flag = HasElement(1215);
9951 if (tempElements == null)
9952 {
9954 tempElements.SetParent(this);
9955 }
9956 if (a > 0 && flag)
9957 {
9958 a = a * 150 / 100;
9959 }
9960 int num = elements.ValueWithoutLink(ele);
9961 int num2 = Mathf.Abs(num) + 100;
9962 int num3 = num2 / (flag ? 2 : 4);
9963 int num4 = -num - 100;
9964 int num5 = tempElements.Base(ele);
9965 int num6 = num5 + a;
9966 if (onlyRenew)
9967 {
9968 num3 = Mathf.Min(a, num3);
9969 num4 = Mathf.Max(a, -num2 / 3);
9970 }
9971 if (a > 0 && num6 > num3)
9972 {
9973 a = ((num3 > num5) ? (num3 - num5) : 0);
9974 }
9975 if (a < 0 && num6 < num4)
9976 {
9977 a = ((num4 < num5) ? (num4 - num5) : 0);
9978 }
9979 Element element = tempElements.ModBase(ele, a);
9980 if (element.vBase == 0)
9981 {
9982 tempElements.Remove(element.id);
9983 if (tempElements.dict.Count == 0)
9984 {
9985 tempElements = null;
9986 }
9987 }
9988 }
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 9503 of file Chara.cs.

9504 {
9505 if (HasElement(450) || a == 0)
9506 {
9507 return;
9508 }
9509 int weight = bio.weight;
9510 int height = bio.height;
9511 int num = height * height * 18 / 25000;
9512 int num2 = height * height * 24 / 10000;
9513 if (ignoreLimit || (weight > num && weight < num2))
9514 {
9515 weight = weight * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
9516 if (weight < 1)
9517 {
9518 weight = 1;
9519 }
9520 if (weight != bio.weight)
9521 {
9522 bio.weight = weight;
9523 Say((a > 0) ? "weight_gain" : "weight_lose", this);
9524 }
9525 }
9526 }
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 2582 of file Chara.cs.

2583 {
2584 if (!newPoint.sourceBlock.tileType.IsBlockPass && (!checkWall || (Dist(newPoint) <= 1 && CanMoveTo(newPoint, allowDestroyPath: false))) && _Move(newPoint, MoveType.Force) == MoveResult.Success && ai.Current.CancelWhenMoved)
2585 {
2586 ai.Current.TryCancel(c);
2587 }
2588 }
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:2716

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

3418 {
3419 MoveHome(EClass.game.world.FindZone(id), x, z);
3420 }
void MoveHome(string id, int x=-1, int z=-1)
Definition: Chara.cs:3417
new World world
Definition: Game.cs:173

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

3423 {
3424 if (isDead)
3425 {
3426 Revive();
3427 }
3428 else
3429 {
3430 Cure(CureType.Death);
3431 }
3432 CureCondition<ConSuspend>();
3433 if (IsPCParty)
3434 {
3436 }
3437 FactionBranch factionBranch = homeBranch;
3438 if (x == -1)
3439 {
3440 x = 50;
3441 }
3442 if (z == -1)
3443 {
3444 z = 50;
3445 }
3446 Point point = new Point(x, z);
3447 if (zone.IsActiveZone)
3448 {
3449 point = point.GetNearestPoint(allowBlock: false, allowChara: false);
3450 }
3451 zone.AddCard(this, point);
3452 SetHomeZone(zone);
3453 global.transition = new ZoneTransition
3454 {
3455 state = ZoneTransition.EnterState.Dead,
3456 x = point.x,
3457 z = point.z
3458 };
3459 orgPos = new Point(x, z);
3460 if (factionBranch != null)
3461 {
3463 factionBranch.policies.Validate();
3464 }
3465 }
void RefreshWorkElements(ElementContainer parent=null)
Definition: Chara.cs:8746
Chara SetHomeZone(Zone zone)
Definition: Chara.cs:1421
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 2564 of file Chara.cs.

2565 {
2566 List<Point> list = new List<Point>();
2567 pos.ForeachNeighbor(delegate(Point p)
2568 {
2569 list.Add(p.Copy());
2570 });
2571 list.Shuffle();
2572 foreach (Point item in list)
2573 {
2574 if (!item.Equals(pos) && !item.HasChara && TryMove(item) == MoveResult.Success)
2575 {
2576 return true;
2577 }
2578 }
2579 return false;
2580 }
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 2550 of file Chara.cs.

2551 {
2552 Point randomNeighbor = pos.GetRandomNeighbor();
2553 if (!randomNeighbor.Equals(pos) && !randomNeighbor.HasChara && HasAccess(randomNeighbor))
2554 {
2555 if ((race.tag.Contains("water") || source.tag.Contains("water")) && pos.cell.IsTopWaterAndNoSnow && !randomNeighbor.IsDeepWater)
2556 {
2557 return false;
2558 }
2559 return TryMove(randomNeighbor) == MoveResult.Success;
2560 }
2561 return false;
2562 }
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 3305 of file Chara.cs.

3306 {
3307 if (z == currentZone)
3308 {
3309 return;
3310 }
3311 if (HasCondition<ConInvulnerable>())
3312 {
3313 RemoveCondition<ConInvulnerable>();
3314 }
3315 if (IsPC)
3316 {
3317 EClass.player.nextZone = z;
3319 {
3322 {
3323 if (EClass.player.returnInfo != null)
3324 {
3325 EClass.player.returnInfo.turns += 5;
3326 }
3328 {
3329 EClass.game.Save(isAutoSave: true);
3330 }
3331 }
3332 EClass.player.deathZoneMove = false;
3333 }
3335 if (currentZone.instance != null)
3336 {
3338 z = EClass.game.spatials.Find(instance.uidZone) ?? EClass.pc.homeZone;
3339 transition = new ZoneTransition
3340 {
3341 state = instance.ReturnState,
3342 x = instance.x,
3343 z = instance.z
3344 };
3345 instance.OnLeaveZone();
3346 Debug.Log(z);
3347 }
3348 EInput.Consume(consumeAxis: true);
3349 EClass.player.uidLastZone = currentZone.uid;
3351 {
3353 {
3354 Msg.Say("enterZone", z.Name);
3355 }
3356 else
3357 {
3358 if (z.IsRegion)
3359 {
3360 Msg.Say("leaveZone", currentZone.Name);
3361 }
3362 else if (z.id != currentZone.id)
3363 {
3364 Msg.Say("enterZone", z.Name);
3365 }
3366 EClass.player.lastZonePos = pos.Copy();
3367 }
3368 EClass.player.lastTransition = transition;
3369 }
3370 foreach (Chara item in EClass._map.charas.Where((Chara c) => c.IsPCPartyMinion && c.master != EClass.pc).ToList())
3371 {
3373 }
3374 EClass.player.listSummon = EClass._map.charas.Where((Chara c) => c.c_uidMaster != 0 && c.FindMaster() == EClass.pc && c.c_minionType == MinionType.Default).ToList();
3375 foreach (Chara item2 in EClass.player.listSummon)
3376 {
3377 EClass._zone.RemoveCard(item2);
3378 }
3379 }
3380 if (party != null && party.leader == this)
3381 {
3382 foreach (Chara member in party.members)
3383 {
3384 if (member != this && !member.isDead && member.parent is Zone)
3385 {
3386 member.MoveZone(z);
3387 }
3388 }
3389 }
3390 if (global == null)
3391 {
3392 Debug.Log(base.Name);
3393 return;
3394 }
3395 transition.uidLastZone = currentZone?.uid ?? 0;
3396 global.transition = transition;
3397 if (z.IsActiveZone)
3398 {
3399 Point spawnPos = z.GetSpawnPos(this);
3400 global.transition = null;
3401 if (IsPC)
3402 {
3403 EClass.player.lastTransition = null;
3404 }
3405 z.AddCard(this, spawnPos);
3406 if (IsBranchMember())
3407 {
3409 }
3410 }
3411 else
3412 {
3413 z.AddCard(this);
3414 }
3415 }
MinionType c_minionType
Definition: Card.cs:988
bool IsBranchMember()
Definition: Chara.cs:6436
GlobalData global
Definition: Chara.cs:76
Chara FindMaster()
Definition: Chara.cs:2359
bool ignoreAutoSave
Definition: CoreDebug.cs:126
bool Save(bool isAutoSave=false, bool silent=false)
Definition: Game.cs:1024
RoomManager rooms
Definition: Map.cs:31
Chara leader
Definition: Party.cs:30
bool deathZoneMove
Definition: Player.cs:1166
List< Chara > listSummon
Definition: Player.cs:1218
ReturnInfo returnInfo
Definition: Player.cs:863
bool simulatingZone
Definition: Player.cs:1176
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:1319

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

3298 {
3300 {
3301 state = state
3302 });
3303 }

◆ MutateRandom()

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

Definition at line 9691 of file Chara.cs.

9692 {
9693 if (!ether && vec >= 0 && HasElement(406) && EClass.rnd(5) != 0)
9694 {
9695 Say("resistMutation", this);
9696 return false;
9697 }
9698 IEnumerable<SourceElement.Row> ie = EClass.sources.elements.rows.Where((SourceElement.Row a) => a.category == (ether ? "ether" : "mutation") && !a.tag.Contains("noRandomMutation"));
9699 for (int i = 0; i < tries; i++)
9700 {
9701 SourceElement.Row row = ie.RandomItem();
9702 if (i == 0 && vec < 0 && ether && base.c_corruptionHistory != null && base.c_corruptionHistory.Count > 0)
9703 {
9704 row = EClass.sources.elements.map[base.c_corruptionHistory.LastItem()];
9705 base.c_corruptionHistory.RemoveAt(base.c_corruptionHistory.Count - 1);
9706 if (base.c_corruptionHistory.Count == 0)
9707 {
9708 base.c_corruptionHistory = null;
9709 }
9710 }
9711 Element element = elements.GetElement(row.id);
9712 int num = 1;
9713 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))
9714 {
9715 continue;
9716 }
9717 if (element == null && !row.aliasParent.IsEmpty() && elements.Has(row.aliasParent))
9718 {
9719 row = EClass.sources.elements.alias[row.aliasParent];
9720 element = elements.GetElement(row.id);
9721 }
9722 bool flag = row.tag.Contains("neg");
9723 if (vec > 0)
9724 {
9725 if ((state >= BlessedState.Blessed && flag) || (state <= BlessedState.Cursed && !flag))
9726 {
9727 continue;
9728 }
9729 }
9730 else if (vec < 0 && ((state >= BlessedState.Blessed && !flag) || (state <= BlessedState.Cursed && flag)))
9731 {
9732 continue;
9733 }
9734 bool flag2 = true;
9735 if (element != null)
9736 {
9737 num = element.Value + ((vec != 0) ? vec : ((EClass.rnd(2) == 0) ? 1 : (-1)));
9738 if (num > element.source.max)
9739 {
9740 num = element.source.max - 1;
9741 }
9742 flag = (flag && num > element.Value) || (!flag && num < element.Value);
9743 flag2 = num > element.Value;
9744 if (vec > 0 && !flag2)
9745 {
9746 continue;
9747 }
9748 }
9749 Say(flag2 ? "mutation_gain" : "mutation_loose", this);
9750 SetFeat(row.id, num);
9751 if (flag2 && ether)
9752 {
9753 if (base.c_corruptionHistory == null)
9754 {
9755 base.c_corruptionHistory = new List<int>();
9756 }
9757 base.c_corruptionHistory.Add(row.id);
9758 if (IsPCFaction)
9759 {
9760 Element element2 = elements.GetElement(row.id);
9761 WidgetPopText.Say("popEther".lang(element2.Name, base.Name));
9762 }
9764 {
9765 EClass.player.flags.gotEtherDisease = true;
9766 Thing thing = ThingGen.Create("parchment");
9767 thing.SetStr(53, "letter_ether");
9768 Thing thing2 = ThingGen.Create("1165");
9769 thing2.SetBlessedState(BlessedState.Normal);
9770 Thing p = ThingGen.CreateParcel(null, thing2, thing);
9772 }
9773 }
9774 if (EClass.core.IsGameStarted && pos != null)
9775 {
9776 PlaySound(ether ? "mutation_ether" : "mutation");
9777 PlayEffect("mutation");
9779 Say(row.GetText(flag ? "textDec" : "textInc", returnNull: true) ?? row.alias, this);
9780 }
9781 return true;
9782 }
9783 Say("nothingHappens");
9784 return false;
9785 }
void SetStr(int id, string value=null)
Definition: BaseCard.cs:63
virtual void SetBlessedState(BlessedState s)
Definition: Card.cs:3825
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:464
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 9837 of file Chara.cs.

9838 {
9839 if (_historyFood != null)
9840 {
9841 while (_historyFood.Count > 5)
9842 {
9843 _historyFood.RemoveAt(_historyFood.Count - 1);
9844 }
9845 if (_historyFood[0].Count > 0)
9846 {
9847 _historyFood.Insert(0, new List<string>());
9848 }
9849 }
9850 }

Referenced by GameDate.AdvanceDay().

◆ OnBanish()

void Chara.OnBanish ( )
inline

Definition at line 1435 of file Chara.cs.

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

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

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

References _affinity, _alias, _idTimeTable, _job, _race, Game.activeZone, TraitChara.AdvType, Card.ApplyBacker(), ApplyJob(), ApplyRace(), SourceManager.backers, Card.bio, body, bossText, Card.bp, CalculateMaxStamina(), ChangeMaterial, Card.ClampInitialSkill(), Core.config, contribution, EClass.core, EClass.debug, 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 1321 of file Chara.cs.

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

8146 {
8147 Say("give_erohon", this);
8148 AddCondition<ConParalyze>(50, force: true);
8149 AddCondition<ConConfuse>(50, force: true);
8150 AddCondition<ConFear>(1000, force: true);
8151 ModAffinity(EClass.pc, 100);
8152 t.Destroy();
8153 Talk("pervert");
8154 }

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

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

◆ OnInsulted()

void Chara.OnInsulted ( )
inline

Definition at line 7951 of file Chara.cs.

7952 {
7953 if (!isDead)
7954 {
7955 if (HasElement(1231))
7956 {
7957 Talk("insulted");
7958 AddCondition<ConEuphoric>(100 * Evalue(1231));
7959 }
7960 else if (EClass.rnd(20) == 0)
7961 {
7962 SetFeat(1231, 1, msg: true);
7963 }
7964 }
7965 }

References EClass.rnd().

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

◆ OnSerializing()

override void Chara.OnSerializing ( )
inlineprotectedvirtual

Reimplemented from Card.

Definition at line 1306 of file Chara.cs.

1307 {
1308 if (enemy != null)
1309 {
1310 SetInt(55, enemy.uid);
1311 }
1312 _cints[0] = (int)_cbits1.Bits;
1313 List<BodySlot> slots = body.slots;
1314 rawSlots = new int[slots.Count];
1315 for (int i = 0; i < slots.Count; i++)
1316 {
1317 rawSlots[i] = slots[i].elementId;
1318 }
1319 }
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 9459 of file Chara.cs.

9460 {
9461 if (days < 1)
9462 {
9463 days = 1;
9464 }
9465 int num = power * days;
9466 if (stamina.value < 0)
9467 {
9468 stamina.Set(1);
9469 }
9470 HealHP(num);
9471 stamina.Mod(10 + 25 * num / 100 * (100 + elements.GetFeatRef(1642)) / 100);
9472 mana.Mod(num);
9473 if (IsPCFaction)
9474 {
9475 hunger.Mod(20);
9476 }
9477 sleepiness.Set(0);
9478 if (!IsMinion)
9479 {
9480 interest = 100;
9481 }
9482 Cure(CureType.Sleep, power);
9483 }
virtual void HealHP(int a, HealSource origin=HealSource.None)
Definition: Card.cs:3933
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 9444 of file Chara.cs.

9445 {
9446 TraitPillow traitPillow = pos.FindThing<TraitPillow>();
9447 int num = bed?.Power ?? 20;
9448 if (traitPillow != null)
9449 {
9450 num += traitPillow.owner.Power / 2;
9451 }
9452 if (bed != null)
9453 {
9454 num += bed.Evalue(750) * 5;
9455 }
9456 OnSleep(num, days);
9457 }
void OnSleep(Thing bed=null, int days=1)
Definition: Chara.cs:9444
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 2157 of file Chara.cs.

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

Referenced by ApplyRace(), and ResetBody().

◆ PerformWork()

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

Definition at line 8921 of file Chara.cs.

8922 {
8923 Hobby hobby = new Hobby();
8924 hobby.id = session.id;
8925 WorkSummary workSummary = _workSummary;
8926 hobby.GetAI(this).OnPerformWork(IsRealTime);
8927 if (!isHobby)
8928 {
8929 workSummary.progress += EClass.rnd(5) + 5;
8930 }
8931 int num = PerformWork(hobby, 0, isHobby);
8932 int num2 = PerformWork(hobby, 1, isHobby);
8933 int num3 = PerformWork(hobby, 2, isHobby);
8934 int num4 = PerformWork(hobby, 3, isHobby);
8935 workSummary.money += num;
8936 workSummary.food += num2;
8937 workSummary.knowledge += num3;
8938 workSummary.material += num4;
8939 int PerformWork(Hobby work, int idx, bool isHobby)
8940 {
8941 if (idx >= work.source.resources.Length)
8942 {
8943 return 0;
8944 }
8945 int num5 = work.source.resources[idx];
8946 int num6 = num5;
8947 num5 = Rand.Range(num5 * (100 - work.source.resources[idx]) / 100, num5);
8948 num5 = num5 * (isHobby ? 50 : 100) * session.efficiency / 10000;
8949 if (num6 > 0 && num5 <= 0)
8950 {
8951 num5 = 1;
8952 }
8953 return num5;
8954 }
8955 }
virtual void OnPerformWork(bool realtime)
Definition: AIWork.cs:150
void PerformWork(WorkSession session, bool isHobby=false, bool IsRealTime=false)
Definition: Chara.cs:8921
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 4231 of file Chara.cs.

4232 {
4233 if (t.trait is TraitCard && t.isNew && EClass.game.config.autoCollectCard && !t.c_idRefCard.IsEmpty())
4234 {
4236 return t;
4237 }
4238 if (t.parent == this)
4239 {
4240 return t;
4241 }
4242 t = TryPoisonPotion(t);
4243 ThingContainer.DestData dest = things.GetDest(t, tryStack);
4244 if (!dest.IsValid)
4245 {
4246 if (t.parent != EClass._zone)
4247 {
4248 if (IsPC)
4249 {
4250 Say("backpack_full_drop", t);
4251 SE.Drop();
4252 }
4253 return EClass._zone.AddCard(t, pos).Thing;
4254 }
4255 if (IsPC)
4256 {
4257 Say("backpack_full", t);
4258 }
4259 return t;
4260 }
4261 if (dest.stack != null)
4262 {
4263 if (msg)
4264 {
4265 PlaySound("pick_thing");
4266 Say("pick_thing", this, t);
4267 }
4268 t.TryStackTo(dest.stack);
4269 return dest.stack;
4270 }
4271 TryAbsorbRod(t);
4272 if (msg)
4273 {
4274 PlaySound("pick_thing");
4275 Say("pick_thing", this, t);
4276 }
4278 return dest.container.AddThing(t, tryStack);
4279 }
bool isNew
Definition: Card.cs:482
bool TryStackTo(Thing to)
Definition: Card.cs:3327
string c_idRefCard
Definition: Card.cs:1737
void TryReservePickupTutorial(Thing t)
Definition: Chara.cs:4325
Thing TryPoisonPotion(Thing t)
Definition: Chara.cs:4281
void TryAbsorbRod(Thing t)
Definition: Chara.cs:4295
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(), GrowSystem.PopHarvest(), 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 4447 of file Chara.cs.

4448 {
4449 if (held == null)
4450 {
4451 return;
4452 }
4453 Card card = held;
4454 if (IsPC && held.invY == 1)
4455 {
4456 WidgetHotbar.dirtyCurrentItem = true;
4458 held = null;
4459 return;
4460 }
4461 if (held.isChara)
4462 {
4463 DropHeld();
4464 return;
4465 }
4467 {
4468 Say("canOnlyCarry", held);
4469 DropHeld();
4470 return;
4471 }
4472 bool flag = held != things.TryStack(held.Thing);
4473 if (!flag && things.IsOverflowing())
4474 {
4475 if (IsPC)
4476 {
4477 Say("backpack_full_drop", held);
4478 SE.Drop();
4479 }
4480 DropHeld();
4481 return;
4482 }
4483 if (msg)
4484 {
4485 PlaySound("pick_thing");
4486 Say("pick_held", this, card);
4487 if (IsPC && card.id == "statue_weird")
4488 {
4489 Say("statue_pick");
4490 }
4491 }
4492 if (IsPC)
4493 {
4494 WidgetHotbar.dirtyCurrentItem = true;
4495 if (!flag)
4496 {
4498 if (held.GetRootCard() != EClass.pc)
4499 {
4500 Pick(held.Thing, msg: false);
4501 }
4502 }
4503 }
4504 held = null;
4505 }
int invY
Definition: Card.cs:1943
bool IsHotItem
Definition: Card.cs:119
Card DropHeld(Point dropPos=null)
Definition: Chara.cs:4524
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 4211 of file Chara.cs.

4212 {
4213 if (num != 0)
4214 {
4215 PickOrDrop(p, ThingGen.Create(idThing, idMat).SetNum(num), msg);
4216 }
4217 }

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

4220 {
4221 if (things.GetDest(t).IsValid)
4222 {
4223 Pick(t, msg);
4224 }
4225 else
4226 {
4227 EClass._zone.AddCard(t, p);
4228 }
4229 }

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

◆ Refresh()

void Chara.Refresh ( bool  calledRecursive = false)
inline

Definition at line 1717 of file Chara.cs.

1718 {
1719 if (source == null)
1720 {
1721 Debug.LogError("source is null");
1722 SetSource();
1723 }
1724 if (ride != null && ride.source != null)
1725 {
1726 ride.Refresh(calledRecursive: true);
1727 }
1728 hasTelepathy = false;
1729 isWet = false;
1730 _isLevitating = HasElement(401) || (ride != null && ride._isLevitating);
1732 base.isHidden = HasElement(415);
1733 foreach (Condition condition in conditions)
1734 {
1735 condition.OnRefresh();
1736 }
1737 if (isWet)
1738 {
1739 base.isHidden = false;
1740 }
1742 SetDirtySpeed();
1743 if (host != null && !calledRecursive && host.source != null)
1744 {
1745 host.Refresh(calledRecursive: true);
1746 }
1747 }
virtual void OnRefresh()
void Refresh(bool calledRecursive=false)
Definition: Chara.cs:1717
bool isWet
Definition: Chara.cs:142
override void SetSource()
Definition: Chara.cs:2046
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 9901 of file Chara.cs.

9902 {
9903 if (faithElements != null)
9904 {
9906 }
9908 if (idFaith == "eyth" && !HasElement(1228))
9909 {
9910 return;
9911 }
9912 SourceReligion.Row row = EClass.sources.religions.map.TryGetValue(idFaith);
9913 if (row == null)
9914 {
9915 return;
9916 }
9918 if (!HasCondition<ConExcommunication>())
9919 {
9920 SourceElement.Row row2 = EClass.sources.elements.alias.TryGetValue("featGod_" + row.id + "1");
9921 if (row2 != null)
9922 {
9923 faithElements.SetBase(row2.id, 1);
9924 }
9925 int[] array = row.elements;
9926 int num = GetPietyValue() * (120 + Evalue(1407) * 15) / 100;
9927 for (int i = 0; i < array.Length; i += 2)
9928 {
9929 int num2 = array[i + 1] * num / 50;
9930 if (array[i] == 79)
9931 {
9932 num2 = EClass.curve(num2, array[i + 1] * 2, 10, 50);
9933 }
9934 if (num2 >= 20 && array[i] >= 950 && array[i] < 970)
9935 {
9936 num2 = 20;
9937 }
9938 faithElements.SetBase(array[i], Mathf.Max(num2, 1));
9939 }
9940 }
9942 }
string idFaith
Definition: Chara.cs:229
ElementContainer faithElements
Definition: Chara.cs:38
int GetPietyValue()
Definition: Chara.cs:9892
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 1851 of file Chara.cs.

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

8747 {
8748 if (workElements != null)
8749 {
8751 }
8752 workElements = null;
8753 if (IsPCParty || homeBranch == null || homeBranch.owner == null)
8754 {
8755 return;
8756 }
8757 foreach (Hobby item in ListHobbies())
8758 {
8759 TryAdd(item);
8760 }
8761 foreach (Hobby item2 in ListWorks())
8762 {
8763 TryAdd(item2);
8764 }
8765 if (workElements != null)
8766 {
8768 }
8769 void TryAdd(Hobby h)
8770 {
8771 if (!h.source.elements.IsEmpty())
8772 {
8773 if (workElements == null)
8774 {
8776 }
8777 for (int i = 0; i < h.source.elements.Length; i += 2)
8778 {
8779 int num = h.source.elements[i];
8780 int num2 = h.source.elements[i + 1];
8781 int num3 = 100;
8782 if (num != 2115 && num != 2207)
8783 {
8784 num3 = h.GetEfficiency(this) * homeBranch.efficiency / 100;
8785 if (num3 <= 0)
8786 {
8787 continue;
8788 }
8789 }
8790 workElements.ModBase(num, (num2 < 0) ? (num2 / 10) : Mathf.Max(1, h.source.elements[i + 1] * num3 / 1000));
8791 }
8792 }
8793 }
8794 }
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 2336 of file Chara.cs.

2337 {
2338 base.c_uidMaster = 0;
2339 master = null;
2340 enemy = null;
2341 foreach (Chara chara in EClass._map.charas)
2342 {
2343 if (chara.enemy == this)
2344 {
2345 chara.SetEnemy();
2346 chara.ai.Cancel();
2347 }
2348 }
2349 ai.Cancel();
2350 Refresh();
2351 }

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

9350 {
9351 for (int num = conditions.Count - 1; num >= 0; num--)
9352 {
9353 Condition condition = conditions[num];
9354 if (condition.Type == ConditionType.Stance)
9355 {
9356 condition.Kill();
9357 }
9358 }
9359 }

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

◆ RemoveCondition< T >()

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

Definition at line 9210 of file Chara.cs.

9210 : Condition
9211 {
9212 for (int num = conditions.Count - 1; num >= 0; num--)
9213 {
9214 if (conditions[num] is T)
9215 {
9216 conditions[num].Kill();
9217 break;
9218 }
9219 }
9220 }

References Condition.Kill().

◆ RemoveGlobal()

void Chara.RemoveGlobal ( )
inline

Definition at line 1493 of file Chara.cs.

1494 {
1495 if (IsGlobal)
1496 {
1497 global = null;
1499 }
1500 }

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

2186 {
2187 if (body.slots.Count != 0)
2188 {
2189 BodySlot bodySlot = body.slots.LastItem();
2190 body.RemoveBodyPartAt(body.slots.Count - 1);
2191 if (msg)
2192 {
2193 Say("lose_bodyparts", this, Element.Get(bodySlot.elementId).GetName().ToLower());
2194 PlaySound("offering");
2195 }
2196 }
2197 }
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 8166 of file Chara.cs.

8167 {
8168 if (HasCondition<StanceTaunt>() || base.isRestrained || attacker == this)
8169 {
8170 return false;
8171 }
8172 if (host != null && host.isRestrained)
8173 {
8174 return false;
8175 }
8176 if (base.IsPCFactionOrMinion && attacker.IsPCFactionOrMinion)
8177 {
8178 return false;
8179 }
8180 bool flag = false;
8181 foreach (Chara chara in EClass._map.charas)
8182 {
8183 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))
8184 {
8185 continue;
8186 }
8187 bool flag2 = chara.HasElement(1225);
8188 if ((!flag2 && (flag || EClass.rnd(2) == 0 || !chara.HasCondition<StanceTaunt>())) || chara.HasCooldown(1225))
8189 {
8190 continue;
8191 }
8192 int num = Mathf.Max(chara.Evalue(1649), (!chara.IsPC) ? ((!flag2) ? 1 : 3) : 0);
8193 int num2 = Dist(chara);
8194 if (num2 > 25)
8195 {
8196 continue;
8197 }
8198 if (num2 > num || !chara.CanSeeLos(pos, num2))
8199 {
8200 if (!flag2)
8201 {
8202 continue;
8203 }
8204 Point nearestPoint = pos.GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: true, ignoreCenter: true);
8205 if (!nearestPoint.IsValid)
8206 {
8207 continue;
8208 }
8209 chara.Teleport(nearestPoint);
8210 chara.AddCooldown(1225, 10);
8211 num2 = Dist(chara);
8212 Say("intercept_loyal", chara, this);
8213 chara.SetEnemy(attacker);
8214 attacker.SetEnemy(chara);
8215 if (num2 > num || !chara.CanSeeLos(pos, num2))
8216 {
8217 continue;
8218 }
8219 }
8220 if (!flag && !HasElement(1225))
8221 {
8222 Say("intercept", chara, this);
8223 if (EClass.rnd(10) == 0)
8224 {
8225 chara.Talk("intercept", base.NameSimple);
8226 }
8227 if (attacker.enemy == this)
8228 {
8229 attacker.SetEnemy(chara);
8230 }
8231 action(chara);
8232 flag = true;
8233 }
8234 }
8235 return flag;
8236 }
void Teleport(Point point, bool silent=false, bool force=false)
Definition: Card.cs:5726
void AddCooldown(int idEle, int turns=0)
Definition: Chara.cs:8430
bool HasCooldown(int idEle)
Definition: Chara.cs:8448

References EClass._map, AddCooldown(), CanSeeLos(), Map.charas, conSuspend, enemy, Card.Evalue(), 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 8840 of file Chara.cs.

8841 {
8842 if (_hobbies != null && _works != null)
8843 {
8844 _hobbies.Clear();
8845 _works.Clear();
8846 }
8847 else
8848 {
8849 _hobbies = new List<int>();
8850 _works = new List<int>();
8851 }
8852 if (source.hobbies.IsEmpty())
8853 {
8854 AddHobby(EClass.sources.hobbies.listHobbies.RandomItem().id);
8855 }
8856 else
8857 {
8858 string[] hobbies = source.hobbies;
8859 foreach (string key in hobbies)
8860 {
8861 AddHobby(EClass.sources.hobbies.alias[key].id);
8862 }
8863 }
8864 if (source.works.IsEmpty())
8865 {
8866 AddWork(EClass.sources.hobbies.listWorks.RandomItem().id);
8867 }
8868 else
8869 {
8870 string[] hobbies = source.works;
8871 foreach (string key2 in hobbies)
8872 {
8873 AddWork(EClass.sources.hobbies.alias[key2].id);
8874 }
8875 }
8877 }
WorkSummary GetWorkSummary()
Definition: Chara.cs:8879
void AddWork(int id)
Definition: Chara.cs:8828
void AddHobby(int id)
Definition: Chara.cs:8816
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 2199 of file Chara.cs.

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

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

◆ ResetUpgrade()

void Chara.ResetUpgrade ( )
inline

Definition at line 8332 of file Chara.cs.

8333 {
8334 _ = base.c_upgrades;
8335 }

Referenced by CoreDebug.ResetPetUpgrades().

◆ ResistCon()

void Chara.ResistCon ( Condition  con)
inline

Definition at line 9406 of file Chara.cs.

9407 {
9408 if (con.power > 0 && resistCon != null)
9409 {
9410 int a = ClassExtension.TryGetValue<int, int>((IDictionary<int, int>)resistCon, con.id, 0);
9411 if (1000 < EClass.rnd(a))
9412 {
9413 con.power = 0;
9414 }
9415 else if (500 < EClass.rnd(a))
9416 {
9417 con.power /= 5;
9418 }
9419 else if (200 < EClass.rnd(a))
9420 {
9421 con.power /= 3;
9422 }
9423 else if (100 < EClass.rnd(a))
9424 {
9425 con.power /= 2;
9426 }
9427 }
9428 }

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

◆ RestockEquip()

void Chara.RestockEquip ( bool  onCreate)
inline

Definition at line 4616 of file Chara.cs.

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

References RenderRow.ContainsTag(), ThingGen.Create(), ThingGen.CreateFromCategory(), ThingGen.CreateSpellbook(), EClass.debug, Card.elements, CoreDebug.enable, CharaBody.Equip(), SourceChara.Row.equip, SourceJob.Row.equip, 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 4884 of file Chara.cs.

4885 {
4886 switch (id)
4887 {
4888 case "lomias":
4889 if (ShouldRestock("_meat"))
4890 {
4891 AddCard(ThingGen.Create("_meat").MakeRefFrom("begger"));
4892 }
4893 break;
4894 case "fiama":
4895 Restock("book_story", 1);
4896 break;
4897 case "rock_thrower":
4898 Restock("stone", 10 + EClass.rnd(10));
4899 break;
4900 case "giant":
4901 Restock("rock", 2 + EClass.rnd(10));
4902 break;
4903 case "farris":
4904 Restock("lute", 1);
4905 Restock("book_story_home", 1);
4906 break;
4907 case "begger":
4908 break;
4909 }
4910 void Restock(string id, int num)
4911 {
4912 if (ShouldRestock(id))
4913 {
4914 AddCard(ThingGen.Create(id).SetNum(num));
4915 }
4916 }
4917 bool ShouldRestock(string id)
4918 {
4919 return things.Find(id) == null;
4920 }
4921 }

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

◆ Revive()

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

Definition at line 5036 of file Chara.cs.

5037 {
5038 if (!isDead)
5039 {
5040 return;
5041 }
5042 isDead = false;
5043 base.hp = MaxHP / 3;
5044 mana.value = 0;
5045 stamina.value = 0;
5046 if (hunger.value > 30)
5047 {
5048 hunger.value = 30;
5049 }
5050 sleepiness.value = 0;
5052 RemoveCondition<StanceTaunt>();
5053 if (IsPC)
5054 {
5056 {
5057 Msg.Say("noDeathPenalty2", this);
5058 }
5060 {
5061 Msg.Say("noDeathPenalty", this);
5062 }
5063 else
5064 {
5066 }
5067 List<Thing> dropList = new List<Thing>();
5068 EClass.pc.things.Foreach(delegate(Thing t)
5069 {
5071 {
5072 t.ignoreAutoPick = true;
5073 dropList.Add(t);
5074 }
5075 }, onlyAccessible: false);
5076 foreach (Thing item in dropList)
5077 {
5079 Msg.Say("backpack_full_drop", item);
5080 }
5081 EClass.player.preventDeathPenalty = false;
5082 }
5083 if (IsPCFaction && homeBranch != null)
5084 {
5085 homeBranch.Log("bRevive", this);
5086 }
5087 if (p != null)
5088 {
5089 if (!p.IsInBounds)
5090 {
5092 }
5093 EClass._zone.AddCard(this, p);
5094 if (msg)
5095 {
5096 SE.Play("revive");
5097 Msg.Say("revive", this);
5098 PlayEffect("revive");
5099 }
5100 SetCensored(enable: false);
5101 }
5102 }
void SetCensored(bool enable)
Definition: Card.cs:7553
Card parentCard
Definition: Card.cs:103
void ApplyDeathPenalty()
Definition: Chara.cs:5124
bool disableDeathPenaltyProtection
Point GetCenterPos()
Definition: MapBounds.cs:52
int days
Definition: Player.cs:75
bool preventDeathPenalty
Definition: Player.cs:1164
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 3487 of file Chara.cs.

3488 {
3489 if (renderer.hasActor)
3490 {
3491 base.dir = (base.dir + ((!reverse) ? 1 : (-1))).Clamp(0, 3, loop: true);
3492 }
3493 else
3494 {
3495 base.dir = ((base.dir == 0) ? 1 : 0);
3496 }
3497 UpdateAngle();
3499 }

Referenced by AI_Dance.Run().

◆ ScaleByPrincipal()

Chara Chara.ScaleByPrincipal ( )
inline

◆ SetAI()

AIAct Chara.SetAI ( AIAct  g)
inline

Definition at line 8616 of file Chara.cs.

8617 {
8618 if (IsPC)
8619 {
8621 }
8622 if (ai.IsRunning)
8623 {
8624 if (ai == g && ai.IsNoGoal)
8625 {
8626 return g;
8627 }
8628 ai.Cancel();
8629 if (ai == g)
8630 {
8631 Debug.Log("goal is g:" + ai?.ToString() + "/" + this);
8632 return g;
8633 }
8634 }
8635 if (HasCondition<ConWait>())
8636 {
8637 RemoveCondition<ConWait>();
8638 }
8639 ai = g;
8640 ai.SetOwner(this);
8641 if (IsPC)
8642 {
8644 }
8645 return g;
8646 }
virtual bool IsNoGoal
Definition: AIAct.cs:74
void SetOwner(Chara c)
Definition: AIAct.cs:179
QueueManager queues
Definition: Player.cs:1206
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 8606 of file Chara.cs.

8607 {
8608 SetAI(new GoalCombat());
8609 }

Referenced by ZoneEventQuest.AggroEnemy().

◆ SetAIIdle()

void Chara.SetAIIdle ( )
inline

Definition at line 8602 of file Chara.cs.

8603 {
8604 }

◆ SetAIImmediate()

void Chara.SetAIImmediate ( AIAct  g)
inline

◆ SetDir()

override void Chara.SetDir ( int  d)
inlinevirtual

Reimplemented from Card.

Definition at line 3480 of file Chara.cs.

3481 {
3482 base.dir = d;
3483 UpdateAngle();
3485 }

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

◆ SetDirtySpeed()

void Chara.SetDirtySpeed ( )
inline

Definition at line 1842 of file Chara.cs.

1843 {
1844 dirtySpeed = true;
1845 if (host != null)
1846 {
1848 }
1849 }

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

6162 {
6163 enemy = c;
6164 if (c == null)
6165 {
6166 if (ai is GoalCombat)
6167 {
6168 ai.Cancel();
6169 }
6170 }
6171 else
6172 {
6173 calmCheckTurn = 10 + EClass.rnd(30);
6174 }
6175 return c;
6176 }

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

4924 {
4926 Rarity rarity = Rarity.Normal;
4927 int num = ((base.LV >= 1000) ? 7 : ((base.LV >= 500) ? 5 : ((base.LV >= 250) ? 3 : ((base.LV >= 100) ? 2 : ((base.LV >= 50) ? 1 : 0)))));
4928 Rarity rarity2 = base.rarity;
4929 if (id == "big_sister")
4930 {
4931 num = (isOnCreate ? 8 : 4);
4932 }
4933 if (!isOnCreate && EClass.rnd(10) != 0)
4934 {
4935 num /= 2;
4936 }
4937 if (rarity2 == Rarity.Superior && EClass.rnd(10) <= num)
4938 {
4939 rarity = Rarity.Superior;
4940 }
4941 else if (rarity2 == Rarity.Legendary)
4942 {
4943 rarity = ((EClass.rnd(10) <= num) ? Rarity.Legendary : ((EClass.rnd(5) <= num) ? Rarity.Superior : Rarity.Normal));
4944 }
4945 else if (rarity2 >= Rarity.Mythical)
4946 {
4947 rarity = ((EClass.rnd(30) <= num) ? Rarity.Mythical : ((EClass.rnd(10) > num) ? Rarity.Superior : Rarity.Legendary));
4948 }
4949 if (rarity == Rarity.Normal && EClass.rnd(1000) == 0)
4950 {
4951 rarity = Rarity.Legendary;
4952 }
4953 CardBlueprint.current.rarity = rarity;
4954 }
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 1413 of file Chara.cs.

1414 {
1415 _faction = null;
1416 faction = f;
1418 return this;
1419 }
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 1702 of file Chara.cs.

1703 {
1704 faith = r;
1706 }

References faith, and RefreshFaithElement().

◆ SetFaith() [2/2]

void Chara.SetFaith ( string  id)
inline

Definition at line 1697 of file Chara.cs.

1698 {
1700 }
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 9586 of file Chara.cs.

9587 {
9588 Feat feat = elements.GetElement(id) as Feat;
9589 int num = 0;
9590 if (feat != null && feat.Value > 0)
9591 {
9592 if (value == feat.Value)
9593 {
9594 return;
9595 }
9596 num = feat.Value;
9597 feat.Apply(-feat.Value, elements);
9598 }
9599 if (value > 0)
9600 {
9601 feat = elements.SetBase(id, value - (feat?.vSource ?? 0)) as Feat;
9602 feat.Apply(feat.Value, elements);
9603 }
9604 else
9605 {
9606 elements.Remove(id);
9607 }
9609 {
9610 Refresh();
9612 }
9613 if (!msg)
9614 {
9615 return;
9616 }
9617 if (feat.source.textInc.IsEmpty())
9618 {
9619 PlaySound("ding_skill");
9621 Say("gainFeat", this, feat.FullName);
9622 }
9623 else
9624 {
9625 bool flag = value < num;
9626 if (feat.source.tag.Contains("neg"))
9627 {
9628 flag = !flag;
9629 }
9630 switch (id)
9631 {
9632 case 1270:
9633 if (!flag)
9634 {
9635 PlaySound("chime_angel");
9636 }
9637 break;
9638 case 1271:
9639 if (!flag)
9640 {
9641 PlaySound("chime_devil");
9642 }
9643 break;
9644 default:
9645 PlaySound("mutation");
9646 break;
9647 }
9649 Say((value > num) ? feat.source.GetText("textInc") : feat.source.GetText("textDec"), this, feat.FullName);
9650 }
9652 }
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(), and CoreDebug.SetElement().

◆ SetGlobal() [1/2]

Chara Chara.SetGlobal ( )
inline

Definition at line 1480 of file Chara.cs.

1481 {
1482 if (!IsGlobal)
1483 {
1485 global = new GlobalData();
1486 base.isSubsetCard = false;
1487 enemy = null;
1488 base.c_uidMaster = 0;
1489 }
1490 return this;
1491 }

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

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

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

1422 {
1423 homeZone = zone;
1424 SetGlobal();
1425 return this;
1426 }

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

1429 {
1430 Hostility hostility2 = (base.c_originalHostility = h);
1431 this.hostility = hostility2;
1432 return this;
1433 }

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

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

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

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

9655 {
9656 SourceElement.Row row = EClass.sources.elements.map[idEle];
9658 Element element = elements.GetElement(idEle);
9659 Element element2 = elements.GetElement(row2.id);
9660 int num = element?.Value ?? 0;
9661 if (a < 0)
9662 {
9663 a = 0;
9664 }
9665 if (a > row.max)
9666 {
9667 a = row.max;
9668 }
9669 bool flag = (row.tag.Contains("neg") ? (a > num) : (a < num));
9670 if (a == 0 && (element == null || element.Value == 0))
9671 {
9673 return;
9674 }
9675 if (element != null && element.Value == a)
9676 {
9678 return;
9679 }
9680 if (element2 != null && element2.Value > 0)
9681 {
9682 SetFeat(element2.id, 0);
9683 }
9684 SetFeat(idEle, a);
9685 PlaySound("mutation");
9686 PlayEffect("mutation");
9688 Say(row.GetText(flag ? "textDec" : "textInc", returnNull: true) ?? row.alias, this);
9689 }

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

8612 {
8613 return SetAI(_NoGoalPC);
8614 }
static NoGoal _NoGoalPC
Definition: Chara.cs:194

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

◆ SetPCCState()

void Chara.SetPCCState ( PCCState  state)
inline

Definition at line 6537 of file Chara.cs.

6538 {
6539 if (IsPCC)
6540 {
6541 PCC.Get(pccData).Build(state);
6542 }
6543 }

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

6586 {
6587 p.mat = base.material;
6588 p.matColor = base.colorInt;
6589 if (!renderer.usePass)
6590 {
6591 return;
6592 }
6593 if (renderer.replacer != null)
6594 {
6595 p.tile = renderer.replacer.tile * ((!flipX) ? 1 : (-1));
6596 }
6597 else if (source._tiles_snow.Length != 0 && EClass._zone.IsSnowCovered)
6598 {
6599 if (source._tiles_snow.Length > 1)
6600 {
6601 int num = ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % source._tiles_snow.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6602 p.tile = source._tiles_snow[(num < source._tiles_snow.Length) ? num : 0] * ((!flipX) ? 1 : (-1));
6603 }
6604 else
6605 {
6606 p.tile = source._tiles_snow[0] * ((!flipX) ? 1 : (-1));
6607 }
6608 }
6609 else if (sourceCard._tiles.Length > 1)
6610 {
6611 int num2 = ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % sourceCard._tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6612 p.tile = sourceCard._tiles[(num2 >= 0 && num2 < sourceCard._tiles.Length) ? num2 : 0] * ((!flipX) ? 1 : (-1));
6613 }
6614 else
6615 {
6616 p.tile = sourceCard._tiles[0] * ((!flipX) ? 1 : (-1));
6617 }
6618 p.dir = base.dir;
6619 }
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 7127 of file Chara.cs.

7128 {
7129 switch (m)
7130 {
7131 case UIList.SortMode.ByJob:
7132 sortVal = job._index * 10000 + sourceCard._index;
7133 break;
7134 case UIList.SortMode.ByRace:
7135 sortVal = race._index * 10000 * ((!IsHuman) ? 1 : (-1)) + sourceCard._index;
7136 break;
7137 case UIList.SortMode.ByFeat:
7138 sortVal = -GetTotalFeat();
7139 break;
7140 default:
7141 sortVal = sourceCard._index * ((!IsHuman) ? 1 : (-1));
7142 break;
7143 case UIList.SortMode.ByWorkk:
7144 break;
7145 }
7146 }
int sortVal
Definition: Card.cs:101
int GetTotalFeat()
Definition: Chara.cs:7884
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 2046 of file Chara.cs.

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

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

Referenced by Refresh().

◆ SetSummon()

void Chara.SetSummon ( int  duration)
inline

Definition at line 2353 of file Chara.cs.

2354 {
2355 base.c_summonDuration = duration;
2356 base.isSummon = true;
2357 }

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

7438 {
7439 if (t.IsRangedWeapon && t.category.slot == 0)
7440 {
7441 if (!CanEquipRanged(t))
7442 {
7443 return false;
7444 }
7445 int num = 0;
7446 foreach (Thing thing in things)
7447 {
7448 if (thing.IsRangedWeapon)
7449 {
7450 if (thing.category.slot != 0 && thing.isEquipped)
7451 {
7452 return false;
7453 }
7454 if (CanEquipRanged(thing) && thing.GetEquipValue() > num)
7455 {
7456 num = thing.GetEquipValue();
7457 }
7458 }
7459 }
7460 if (t.GetEquipValue() > num)
7461 {
7462 return true;
7463 }
7464 return false;
7465 }
7466 BodySlot bodySlot = body.GetSlot(t);
7467 if (bodySlot == null)
7468 {
7469 return false;
7470 }
7471 if (useFav)
7472 {
7473 switch (GetFavAttackStyle())
7474 {
7475 case AttackStyle.Default:
7476 case AttackStyle.TwoHand:
7477 if (t.IsMeleeWeapon)
7478 {
7479 bodySlot = body.slotMainHand;
7480 }
7481 else if (bodySlot.elementId == 35)
7482 {
7483 return false;
7484 }
7485 break;
7486 case AttackStyle.Shield:
7487 if (t.IsMeleeWeapon)
7488 {
7489 bodySlot = body.slotMainHand;
7490 }
7491 else if (bodySlot.elementId == 35 && t.IsMeleeWeapon)
7492 {
7493 return false;
7494 }
7495 break;
7496 case AttackStyle.TwoWield:
7497 if (bodySlot.elementId == 35 && !t.IsMeleeWeapon)
7498 {
7499 return false;
7500 }
7501 break;
7502 }
7503 }
7504 if (!body.IsEquippable(t, bodySlot, text: false))
7505 {
7506 return false;
7507 }
7508 if (bodySlot.thing != null && (bodySlot.thing.blessedState <= BlessedState.Cursed || bodySlot.thing.GetEquipValue() >= t.GetEquipValue()))
7509 {
7510 return false;
7511 }
7512 if (t.HasTag(CTAG.gift))
7513 {
7514 return false;
7515 }
7516 return true;
7517 }
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:4572

References Card.blessedState, Card.category, BodySlot.elementId, Card.GetEquipValue(), CharaBody.GetSlot(), Card.HasTag(), CharaBody.IsEquippable(), Thing.isEquipped, Card.IsMeleeWeapon, Card.IsRangedWeapon, CharaBody.slotMainHand, and BodySlot.thing.

◆ ShouldThrowAway()

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

Definition at line 8238 of file Chara.cs.

8239 {
8240 if (IsPCFaction)
8241 {
8242 if (t.IsFood && t.category.id != "fish" && !t.IsDecayed)
8243 {
8244 return false;
8245 }
8246 if (t.trait.GetHealAction(this) != null)
8247 {
8248 return false;
8249 }
8250 if (t.IsThrownWeapon || t.IsRangedWeapon || t.IsAmmo)
8251 {
8252 return false;
8253 }
8254 if (t.trait is TraitBlanket || t.trait is TraitItemProc || t.trait is TraitBookSkill)
8255 {
8256 return false;
8257 }
8258 }
8259 if (t.isEquipped || t.rarity >= Rarity.Legendary || !t.trait.CanBeDestroyed)
8260 {
8261 return false;
8262 }
8263 if (t.trait is TraitCurrency || t.trait is TraitTool)
8264 {
8265 return false;
8266 }
8267 switch (type)
8268 {
8269 case ClearInventoryType.SellAtTown:
8270 if (!t.isGifted && !t.isNPCProperty)
8271 {
8272 return false;
8273 }
8274 break;
8275 case ClearInventoryType.Purge:
8276 switch (t.category.id)
8277 {
8278 case "fish":
8279 if (EClass.rnd(3) == 0)
8280 {
8281 return true;
8282 }
8283 break;
8284 case "junk":
8285 case "garbage":
8286 if (EClass.rnd(3) != 0)
8287 {
8288 return true;
8289 }
8290 break;
8291 }
8292 if (t.id == "flyer")
8293 {
8294 return true;
8295 }
8296 if (!t.IsDecayed && EClass.rnd(3) == 0)
8297 {
8298 return false;
8299 }
8300 if (!things.IsFull() && t.IsRangedWeapon)
8301 {
8302 return false;
8303 }
8304 break;
8305 }
8306 return true;
8307 }
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:600

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

6886 {
6887 Zone_Nymelle zone_Nymelle = EClass._zone as Zone_Nymelle;
6888 if (conSuspend != null && IsPCParty)
6889 {
6890 RemoveCondition<ConSuspend>();
6891 }
6892 if (LayerDrama.forceJump == null)
6893 {
6894 if (IsDeadOrSleeping)
6895 {
6896 ShowDialog("_chara", "sleep");
6897 return;
6898 }
6899 if (EClass.pc.isHidden && !CanSee(EClass.pc))
6900 {
6901 ShowDialog("_chara", "invisible");
6902 return;
6903 }
6905 {
6907 ShowDialog("_chara", "give_card");
6908 Thing thing = ThingGen.Create("figure");
6909 thing.MakeFigureFrom(id);
6910 EClass.player.DropReward(thing);
6911 thing = ThingGen.Create("figure3");
6912 thing.MakeFigureFrom(id);
6913 EClass.player.DropReward(thing);
6914 return;
6915 }
6916 if (GetInt(71) == -2)
6917 {
6918 ShowDialog("_chara", "give_lunch");
6919 Thing t = CraftUtil.MakeLoveLunch(this);
6921 SetInt(71, EClass.world.date.GetRaw() + 43200);
6922 return;
6923 }
6924 if (base.isRestrained)
6925 {
6926 ShowDialog("_chara", "strain");
6927 return;
6928 }
6929 if (IsEscorted())
6930 {
6931 ShowDialog("_chara", "escort");
6932 return;
6933 }
6934 if (EClass._zone is Zone_Music)
6935 {
6936 ShowDialog("_chara", "party");
6937 return;
6938 }
6939 if (EClass.game.quests.OnShowDialog(this))
6940 {
6941 return;
6942 }
6943 switch (id)
6944 {
6945 case "loytel":
6946 {
6948 {
6949 EClass.game.quests.Get("pre_debt_runaway").Complete();
6950 EClass.player.flags.loytelEscaped = false;
6951 EClass.game.quests.Add("debt", "loytel");
6952 ShowDialog("loytel", "loytelEscaped");
6953 return;
6954 }
6955 QuestDebt questDebt = EClass.game.quests.Get<QuestDebt>();
6956 if (questDebt != null && questDebt.paid)
6957 {
6958 questDebt.stage++;
6959 if (questDebt.stage > 7)
6960 {
6961 questDebt.stage = 7;
6962 }
6963 ShowDialog("loytel", "debt" + questDebt.stage);
6964 return;
6965 }
6966 break;
6967 }
6968 case "farris":
6969 if (EClass._zone.id == "startVillage" || EClass._zone.id == "startVillage3" || EClass.game.IsSurvival)
6970 {
6971 ShowDialog("farris");
6972 return;
6973 }
6974 switch (EClass.game.quests.GetPhase<QuestExploration>())
6975 {
6976 case -1:
6977 ShowDialog("farris", "nymelle_noQuest");
6978 break;
6979 case 0:
6980 ShowDialog("farris", "nymelle_first");
6981 break;
6982 case 1:
6983 ShowDialog("farris", "home_first");
6984 break;
6985 default:
6986 ShowDialog("farris");
6987 break;
6988 }
6989 return;
6990 case "ashland":
6991 ShowDialog("ashland");
6992 return;
6993 case "fiama":
6994 if (zone_Nymelle != null && zone_Nymelle.IsCrystalLv && EClass.game.quests.GetPhase<QuestExploration>() == 3)
6995 {
6996 SoundManager.ForceBGM();
6997 LayerDrama.ActivateMain("mono", "nymelle_crystal");
6998 }
7000 {
7002 {
7003 EClass.player.flags.fiamaFirstDream = true;
7004 ShowDialog("fiama", "firstDream");
7005 }
7007 {
7008 ShowDialog("fiama", "giveStoryBook").SetOnKill(delegate
7009 {
7010 EClass.player.flags.fiamaStoryBookGiven = true;
7011 EClass.player.DropReward(ThingGen.Create("book_story"));
7012 });
7013 }
7014 else
7015 {
7016 ShowDialog("fiama");
7017 }
7018 }
7019 else
7020 {
7021 ShowDialog("fiama");
7022 }
7023 return;
7024 case "big_sister":
7026 {
7027 ShowDialog("big_sister", "little_saved");
7028 EClass.player.flags.little_saved = false;
7029 return;
7030 }
7032 {
7033 ShowDialog("big_sister", "little_dead");
7034 EClass.player.flags.little_killed = false;
7035 return;
7036 }
7037 break;
7038 }
7039 if (trait is TraitGuildDoorman)
7040 {
7041 string tag = ((trait is TraitDoorman_Fighter) ? "fighter" : ((trait is TraitDoorman_Mage) ? "mage" : "thief"));
7042 ShowDialog("guild_doorman", "main", tag);
7043 return;
7044 }
7045 if (trait is TraitGuildClerk)
7046 {
7047 string tag2 = ((trait is TraitClerk_Fighter) ? "fighter" : ((trait is TraitClerk_Mage) ? "mage" : "thief"));
7048 ShowDialog("guild_clerk", "main", tag2);
7049 return;
7050 }
7051 }
7052 bool flag = true;
7053 if (id == "parttimer_jure" && (!EClass._zone.IsFestival || !(EClass._zone is Zone_Noyel) || EClass.pc.faith == EClass.game.religions.Healing))
7054 {
7055 flag = false;
7056 }
7057 if (flag && File.Exists(CorePath.DramaData + id + ".xlsx"))
7058 {
7059 ShowDialog(id);
7060 }
7061 else
7062 {
7063 ShowDialog("_chara");
7064 }
7065 }
bool CanGiveCard()
Definition: Affinity.cs:63
void MakeFigureFrom(string id)
Definition: Card.cs:5601
void ShowDialog()
Definition: Chara.cs:6885
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:272
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:476
int storyFiama
Definition: Player.cs:620
bool little_saved
Definition: Player.cs:440
bool fiamaStoryBookGiven
Definition: Player.cs:296
bool fiamaFirstDream
Definition: Player.cs:308
bool little_killed
Definition: Player.cs:452
CodexManager codex
Definition: Player.cs:1112
bool EnableDreamStory
Definition: Player.cs:1265
Thing DropReward(Thing t, bool silent=false)
Definition: Player.cs:2527
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 7067 of file Chara.cs.

7068 {
7069 return _ShowDialog(book, null, step, tag);
7070 }
LayerDrama _ShowDialog(string book, string sheet, string step="main", string tag="")
Definition: Chara.cs:7072

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

9431 {
9432 RemoveCondition<ConAwakening>();
9433 AddCondition(Condition.Create(100, delegate(ConSleep con)
9434 {
9435 con.pcSleep = 15;
9436 con.pcBed = bed;
9437 con.pcPillow = pillow;
9438 con.pickup = pickup;
9439 con.posBed = posBed;
9440 con.posPillow = posPillow;
9441 }), force: true);
9442 }

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

7875 {
7876 Say("abCatSniff", this, c);
7877 AddCondition<ConHOT>(EClass.curve(50 + c.CHA * 5, 400, 100));
7878 c.ShowEmo(Emo.angry);
7879 ShowEmo(Emo.love);
7880 Talk("sniff");
7881 c.Talk(new string[4] { "labor", "disgust", "scold", "callGuards" }.RandomItem());
7882 }

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

4508 {
4509 return held.Split(a);
4510 }

References Card.Split().

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

◆ Stumble()

void Chara.Stumble ( int  mtp = 100)
inline

Definition at line 1825 of file Chara.cs.

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

3854 {
3855 if (host != null)
3856 {
3857 host.SyncRide();
3858 }
3859 if (ride != null)
3860 {
3861 SyncRide(ride);
3862 }
3863 if (parasite != null)
3864 {
3866 }
3867 }

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

3870 {
3871 if (!c.pos.Equals(pos))
3872 {
3873 if (!pos.IsValid)
3874 {
3875 Debug.LogError("exception: pos is not valid:" + pos?.ToString() + "/" + this);
3876 pos = new Point();
3877 }
3878 EClass._map.MoveCard(pos, c);
3879 }
3880 }

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

◆ TalkTopic()

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

Definition at line 6814 of file Chara.cs.

6815 {
6816 if (host == null && !IsInActiveZone)
6817 {
6818 return null;
6819 }
6820 if (!isSynced && (host == null || !host.isSynced) && topic != "dead")
6821 {
6822 return null;
6823 }
6824 if (IsPCParty)
6825 {
6826 int num = EClass.pc.party.members.Count - 1;
6827 switch (topic)
6828 {
6829 case "calm":
6830 if (EClass.rnd(num * 5) != 0)
6831 {
6832 return null;
6833 }
6834 break;
6835 case "aggro":
6836 if (EClass.rnd(num * 10) != 0)
6837 {
6838 return null;
6839 }
6840 break;
6841 case "kill":
6842 if (EClass.rnd(num * 3) != 0)
6843 {
6844 return null;
6845 }
6846 break;
6847 case "fov":
6848 return null;
6849 }
6850 }
6851 string topicText = GetTopicText(topic);
6852 if (topicText.IsEmpty())
6853 {
6854 return null;
6855 }
6856 string text = "_bracketTalk".lang();
6857 bool flag = topicText.StartsWith("*");
6858 bool flag2 = topicText.StartsWith("(");
6859 bool flag3 = topicText.StartsWith(text) || (topicText.Length > 0 && topicText[0] == text[0]) || topicText[0] == '“';
6860 topicText = ApplyTone(topicText);
6861 topicText = topicText.Replace("~", "*");
6862 Msg.SetColor(flag2 ? Msg.colors.Thinking : (flag3 ? Msg.colors.Talk : Msg.colors.Ono));
6863 Msg.Say(topicText.Replace("&", ""));
6864 if (topic == "dead")
6865 {
6866 EClass.ui.popGame.PopText(ApplyNewLine(topicText.StripBrackets()), null, "PopTextDead", default(Color), pos.Position() + EClass.setting.render.tc.textPosDead);
6867 }
6868 else if (flag || flag3 || flag2)
6869 {
6870 (host ?? this).renderer.Say(ApplyNewLine(topicText.StripBrackets()), default(Color), IsPCParty ? 0.6f : 0f);
6871 }
6872 return topicText;
6873 }
void Say(string text, Color c=default(Color), float duration=0f)
string ApplyNewLine(string text)
Definition: Card.cs:6628
string ApplyTone(string text, bool stripPun=false)
Definition: Card.cs:6707
string GetTopicText(string topic="calm")
Definition: Chara.cs:6781
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 3882 of file Chara.cs.

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

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

8469 {
8470 for (int num = _cooldowns.Count - 1; num >= 0; num--)
8471 {
8472 if (_cooldowns[num] % 1000 == 1)
8473 {
8474 _cooldowns.RemoveAt(num);
8475 }
8476 else
8477 {
8478 _cooldowns[num]--;
8479 }
8480 }
8481 if (_cooldowns.Count == 0)
8482 {
8483 _cooldowns = null;
8484 }
8485 }

◆ TickWork()

void Chara.TickWork ( VirtualDate  date)
inline

Definition at line 8888 of file Chara.cs.

8889 {
8891 if (span != TimeTable.Span.Work && span != 0)
8892 {
8893 return;
8894 }
8895 WorkSummary workSummary = GetWorkSummary();
8896 if (span == TimeTable.Span.Work)
8897 {
8898 if (workSummary.work != null)
8899 {
8900 PerformWork(workSummary.work, isHobby: false, date.IsRealTime);
8901 }
8902 }
8903 else if (workSummary.hobbies.Count > 0)
8904 {
8905 PerformWork(workSummary.hobbies.RandomItem(), isHobby: true, date.IsRealTime);
8906 }
8907 }
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 1166 of file Chara.cs.

1167 {
1168 return base.Name + "(" + ai?.ToString() + ")" + pos?.ToString() + "/" + base.ExistsOnMap + "/" + isDead;
1169 }
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 4295 of file Chara.cs.

4296 {
4297 if (!IsPC || !(t.trait is TraitRod) || t.c_charges <= 0 || !HasElement(1564))
4298 {
4299 return;
4300 }
4301 Say("absorbRod", this, t);
4302 TraitRod rod = t.trait as TraitRod;
4303 bool flag = false;
4304 if (rod.source != null)
4305 {
4306 using IEnumerator<SourceElement.Row> enumerator = EClass.sources.elements.rows.Where((SourceElement.Row a) => a.id == rod.source.id).GetEnumerator();
4307 if (enumerator.MoveNext())
4308 {
4309 SourceElement.Row current = enumerator.Current;
4310 if (IsPC)
4311 {
4312 GainAbility(current.id, t.c_charges * 100, t);
4313 flag = true;
4314 }
4315 }
4316 }
4317 if (!flag)
4318 {
4319 mana.Mod(-50 * t.c_charges);
4320 }
4321 t.c_charges = 0;
4323 }
int c_charges
Definition: Card.cs:1269
void GainAbility(int ele, int mtp=100, Thing origin=null)
Definition: Chara.cs:9787

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

7176 {
7177 if (!IsPCFaction && !IsGuest())
7178 {
7179 return null;
7180 }
7181 foreach (Card item in EClass._map.props.installed.all)
7182 {
7183 if (item.trait is TraitBed traitBed && traitBed.CanAssign(this))
7184 {
7185 traitBed.AddHolder(this);
7186 Msg.Say("claimBed", this);
7187 return traitBed;
7188 }
7189 }
7190 return null;
7191 }
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 5490 of file Chara.cs.

5491 {
5493 {
5494 return;
5495 }
5496 int num = 0;
5497 bool flag = false;
5498 bool flag2 = false;
5499 Point point = pos.GetNearestPoint(allowBlock: true, allowChara: false, allowInstalled: false, ignoreCenter: true) ?? pos;
5500 TreasureType type = TreasureType.BossQuest;
5501 if (EClass._zone.Boss == this)
5502 {
5503 type = TreasureType.BossNefia;
5504 num = 2 + EClass.rnd(2);
5505 flag = (flag2 = true);
5506 EClass._zone.Boss = null;
5507 Msg.Say("boss_win", EClass._zone.Name);
5509 {
5510 Msg.Say("boss_win_void", EClass._zone.Name);
5511 EClass.player.flags.KilledBossInVoid = true;
5512 }
5513 if (EClass._zone.IsNefia)
5514 {
5517 SE.Play("Jingle/fanfare2");
5518 EClass._zone.SetBGM(114, refresh: true, 3f);
5519 }
5522 }
5523 switch (id)
5524 {
5525 case "vernis_boss":
5526 num = 5;
5527 flag = (flag2 = true);
5528 EClass.Sound.StopBGM(3f);
5529 EClass._zone.SetBGM(1, refresh: false);
5530 if (EClass.game.quests.GetPhase<QuestVernis>() == 8)
5531 {
5532 EClass.game.quests.Get<QuestVernis>().UpdateOnTalk();
5533 }
5534 break;
5535 case "lurie_boss":
5536 if (!(EClass._zone is Zone_Exile))
5537 {
5538 num = 5;
5539 flag = (flag2 = true);
5540 EClass._zone.SetBGM(120, refresh: true, 3f);
5542 {
5543 EClass.game.quests.Get<QuestNegotiationDarkness>().ChangePhase(4);
5544 EClass.player.flags.killedDuponne = true;
5545 }
5546 }
5547 break;
5548 case "ungaga_pap":
5549 num = 5;
5550 flag = (flag2 = true);
5552 {
5553 EClass._zone.SetBGM(46, refresh: true, 3f);
5554 }
5555 break;
5556 case "melilith_boss":
5557 num = 5;
5558 flag = (flag2 = true);
5559 EClass.Sound.StopBGM(3f);
5560 EClass._zone.SetBGM(1, refresh: false);
5561 break;
5562 case "doga":
5563 {
5564 QuestCurry questCurry = EClass.game.quests.Get<QuestCurry>();
5565 if (questCurry != null)
5566 {
5567 num = 5;
5568 flag = (flag2 = true);
5569 EClass.Sound.StopBGM(3f);
5570 EClass._zone.SetBGM(1, refresh: false);
5571 questCurry.NextPhase();
5572 }
5573 break;
5574 }
5575 case "fairy_raina":
5576 case "fairy_poina":
5577 {
5578 bool num2 = EClass._map.FindChara((id == "fairy_raina") ? "fairy_poina" : "fairy_raina") == null;
5579 QuestNasu questNasu = EClass.game.quests.Get<QuestNasu>();
5580 if (num2 && questNasu != null && questNasu.phase <= 1)
5581 {
5582 if (questNasu.phase == 0)
5583 {
5584 questNasu.NextPhase();
5585 }
5586 num = 5;
5587 flag = (flag2 = true);
5588 EClass.Sound.StopBGM(3f);
5589 EClass._zone.SetBGM(1, refresh: false);
5590 EClass.player.DropReward(ThingGen.Create("backpack_holding"));
5591 questNasu.NextPhase();
5592 }
5593 break;
5594 }
5595 case "isygarad":
5596 {
5597 num = 5;
5598 flag = (flag2 = true);
5599 QuestExploration questExploration = EClass.game.quests.Get<QuestExploration>();
5600 if (questExploration != null)
5601 {
5602 SE.Play("kill_boss");
5603 questExploration.ChangePhase(3);
5604 EClass.Sound.StopBGM(3f);
5605 EClass._zone.SetBGM(1, refresh: false);
5606 }
5607 break;
5608 }
5609 case "swordkeeper":
5610 num = 10;
5611 flag = true;
5612 SE.Play("kill_boss");
5613 SoundManager.ForceBGM();
5614 LayerDrama.Activate("_event", "event", "swordkeeper_defeat");
5615 break;
5616 }
5617 if (flag)
5618 {
5619 SE.Play("kill_boss");
5620 }
5621 if (num != 0)
5622 {
5624 {
5625 EClass.player.stats.deepest = EClass._zone.DangerLv;
5626 Msg.Say("update_deepest", EClass.player.stats.deepest.ToString() ?? "");
5627 }
5629 {
5630 EClass.player.stats.deepestVoid = -EClass._zone.lv;
5631 Msg.Say("update_deepest_void", EClass.player.stats.deepestVoid.ToString() ?? "");
5632 }
5633 EClass.player.willAutoSave = true;
5634 Thing thing = ThingGen.CreateTreasure("chest_boss", base.LV, type);
5635 point.SetBlock();
5636 point.SetObj();
5637 EClass._zone.AddCard(thing, point).Install();
5638 ThingGen.TryLickChest(thing);
5639 }
5640 if (flag2)
5641 {
5643 }
5644 }
TreasureType
Definition: TreasureType.cs:2
bool KilledBossInVoid
Definition: Player.cs:416
int deepest
Definition: Player.cs:111
long nefiaBeaten
Definition: Player.cs:133
int deepestVoid
Definition: Player.cs:114
void ModFame(int a)
Definition: Player.cs:2074
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:2909
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 4512 of file Chara.cs.

4513 {
4514 if (held != null && held.trait.CanOnlyCarry)
4515 {
4516 DropHeld();
4517 }
4518 foreach (Thing item in things.List((Thing t) => t.trait.CanOnlyCarry))
4519 {
4520 DropThing(item);
4521 }
4522 }
void DropThing(Thing t, int num=-1)
Definition: Chara.cs:4544

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

◆ TryEquip()

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

Definition at line 7519 of file Chara.cs.

7520 {
7521 if (!ShouldEquip(t, useFav))
7522 {
7523 return false;
7524 }
7525 if (t.category.slot == 0)
7526 {
7527 return false;
7528 }
7529 if (useFav)
7530 {
7531 BodySlot slot = body.GetSlot(t);
7532 switch (GetFavAttackStyle())
7533 {
7534 case AttackStyle.Default:
7535 case AttackStyle.TwoHand:
7536 if (t.IsMeleeWeapon)
7537 {
7538 slot = body.slotMainHand;
7539 }
7540 break;
7541 case AttackStyle.Shield:
7542 if (t.IsMeleeWeapon)
7543 {
7544 slot = body.slotMainHand;
7545 }
7546 break;
7547 }
7548 body.Equip(t, slot);
7549 }
7550 else
7551 {
7552 body.Equip(t);
7553 }
7554 Say("equip", this, t);
7555 return true;
7556 }
bool ShouldEquip(Thing t, bool useFav=false)
Definition: Chara.cs:7437

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

7640 {
7641 if (IsPC)
7642 {
7644 if (thing?.trait is TraitToolRange && CanEquipRanged(thing))
7645 {
7646 ranged = thing;
7647 return true;
7648 }
7649 return false;
7650 }
7651 if (ranged != null && ranged.parent == this)
7652 {
7653 return true;
7654 }
7656 return ranged != null;
7657 }
Thing GetBestRangedWeapon()
Definition: Chara.cs:7624

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

7564 {
7565 Thing dest = null;
7566 if (IsPC)
7567 {
7569 {
7570 return FindThrowable(hotbar: true);
7571 }
7572 return null;
7573 }
7574 things.Foreach(delegate(Thing t)
7575 {
7576 if (t.HasTag(CTAG.throwWeapon) || (!base.IsPCFactionOrMinion && t.HasTag(CTAG.throwWeaponEnemy)))
7577 {
7578 dest = t;
7579 }
7580 });
7581 return dest;
7582 Thing FindThrowable(bool hotbar)
7583 {
7584 things.Foreach(delegate(Thing t)
7585 {
7586 if (dest == null)
7587 {
7588 if (t.IsHotItem)
7589 {
7590 if (!hotbar)
7591 {
7592 return;
7593 }
7594 }
7595 else if (hotbar)
7596 {
7597 return;
7598 }
7599 if (t.HasTag(CTAG.throwWeapon))
7600 {
7601 dest = t;
7602 }
7603 }
7604 });
7605 return dest;
7606 }
7607 }

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

4374 {
4375 if (held == t)
4376 {
4377 return true;
4378 }
4379 if (t.isDestroyed || t.Num <= 0)
4380 {
4381 return false;
4382 }
4383 if (!CanPick(t))
4384 {
4385 if (t.parent == null)
4386 {
4387 EClass._zone.AddCard(t, pos);
4388 }
4389 return false;
4390 }
4391 HoldCard(t, num);
4392 return true;
4393 }
bool CanPick(Card c)
Definition: Chara.cs:4193
void HoldCard(Card t, int num=-1)
Definition: Chara.cs:4395

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

7780 {
7781 int num = Evalue(289);
7782 if (num == 0)
7783 {
7784 return false;
7785 }
7786 int lV = t.LV;
7787 if (EClass.rnd(num * num + 5) > EClass.rnd(lV * lV) * 20)
7788 {
7789 t.Identify(show, (num >= 20) ? IDTSource.SkillHigh : IDTSource.Skill);
7790 int num2 = 50;
7791 if (lV > num)
7792 {
7793 num2 += (lV - num) * 10;
7794 }
7795 elements.ModExp(289, Mathf.Min(num2, 1000));
7796 return true;
7797 }
7798 return false;
7799 }
IDTSource
Definition: IDTSource.cs:2
Thing Identify(bool show=true, IDTSource idtSource=IDTSource.Identify)
Definition: Thing.cs:2048

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

2693 {
2694 foreach (Condition condition in conditions)
2695 {
2696 if (!condition.TryMove(newPoint))
2697 {
2698 return MoveResult.Fail;
2699 }
2700 }
2701 if (base.isRestrained)
2702 {
2703 if (!IsPC)
2704 {
2705 return MoveResult.Fail;
2706 }
2707 base.isRestrained = false;
2708 }
2709 if (!CanMoveTo(newPoint, allowDestroyPath))
2710 {
2711 return MoveResult.Fail;
2712 }
2713 return _Move(newPoint);
2714 }
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 2652 of file Chara.cs.

2653 {
2655 {
2656 return MoveResult.Fail;
2657 }
2658 Point point = p.Copy();
2659 int num = p.x - pos.x;
2660 int num2 = p.z - pos.z;
2661 if (num > 1)
2662 {
2663 num = 1;
2664 }
2665 else if (num < -1)
2666 {
2667 num = -1;
2668 }
2669 if (num2 > 1)
2670 {
2671 num2 = 1;
2672 }
2673 else if (num2 < -1)
2674 {
2675 num2 = -1;
2676 }
2677 if (num == 0 && num2 == 0)
2678 {
2679 num = EClass.rnd(3) - 1;
2680 num2 = EClass.rnd(3) - 1;
2681 }
2682 point.Set(pos);
2683 point.x -= num;
2684 point.z -= num2;
2685 if (point.IsValid && !point.HasChara)
2686 {
2687 return TryMove(point, allowDestroyPath: false);
2688 }
2689 return MoveResult.Fail;
2690 }
bool TooHeavyToMove()
Definition: Player.cs:2538

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

2591 {
2592 if (p.Equals(pos))
2593 {
2594 return MoveResult.Success;
2595 }
2597 {
2598 return MoveResult.Fail;
2599 }
2600 bool flag = true;
2601 Point point = null;
2602 _sharedPos.Set(p);
2603 if (CanDestroyPath())
2604 {
2606 {
2607 return MoveResult.Success;
2608 }
2609 Debug.Log(CanMoveTo(pos));
2611 }
2612 int num = pos.Distance(p);
2613 PathProgress pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Default, num + 4, 1);
2614 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 4)
2615 {
2616 PathFinderNode pathFinderNode = pathProgress.nodes[pathProgress.nodes.Count - 1];
2617 if (TryMove(new Point(pathFinderNode.X, pathFinderNode.Z)) == MoveResult.Success)
2618 {
2619 return MoveResult.Success;
2620 }
2621 }
2622 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Combat, num + 4, 1);
2623 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 4)
2624 {
2625 PathFinderNode pathFinderNode2 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2626 if (TryMove(new Point(pathFinderNode2.X, pathFinderNode2.Z)) == MoveResult.Success)
2627 {
2628 return MoveResult.Success;
2629 }
2630 }
2631 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Default, num + 25, 2);
2632 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 25)
2633 {
2634 PathFinderNode pathFinderNode3 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2635 if (TryMove(new Point(pathFinderNode3.X, pathFinderNode3.Z)) == MoveResult.Success)
2636 {
2637 return MoveResult.Success;
2638 }
2639 }
2640 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Combat, num + 25, 2);
2641 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 25)
2642 {
2643 PathFinderNode pathFinderNode4 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2644 if (TryMove(new Point(pathFinderNode4.X, pathFinderNode4.Z)) == MoveResult.Success)
2645 {
2646 return MoveResult.Success;
2647 }
2648 }
2649 return MoveResult.Fail;
2650 }
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 9361 of file Chara.cs.

9362 {
9363 if (TC == null || TC.HasCondition<ConInvulnerable>() || TC.Evalue(1421) > 0 || !TC.ExistsOnMap)
9364 {
9365 return false;
9366 }
9367 if (TC.hp > (long)TC.MaxHP * (long)Mathf.Min(5 + (int)Mathf.Sqrt(power), harvest ? 35 : 25) / 100)
9368 {
9369 return false;
9370 }
9371 if (TC.HasElement(427))
9372 {
9373 return false;
9374 }
9375 if (TC.IsPC && EClass.player.invlunerable)
9376 {
9377 return false;
9378 }
9379 PlaySound("hit_finish");
9380 Say("finish");
9381 Say("finish2", this, TC);
9382 TC.DamageHP(TC.MaxHP, AttackSource.Finish, this);
9383 return false;
9384 }
@ harvest
bool invlunerable
Definition: Player.cs:1170
Definition: TC.cs:4

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

Referenced by ActEffect.Proc().

◆ TryNullifyCurse()

bool Chara.TryNullifyCurse ( )
inline

Definition at line 9811 of file Chara.cs.

9812 {
9813 if (IsPCParty)
9814 {
9815 foreach (Chara member in EClass.pc.party.members)
9816 {
9817 if (member.HasElement(1641) && EClass.rnd(3) != 0)
9818 {
9819 Msg.Say("curse_nullify", member);
9820 return true;
9821 }
9822 }
9823 }
9824 else if (HasElement(1641) && EClass.rnd(3) != 0)
9825 {
9826 Say("curse_nullify", this);
9827 return true;
9828 }
9829 if (GetCondition<ConHolyVeil>() != null && EClass.rnd(5) != 0)
9830 {
9831 Say("curse_nullify", this);
9832 return true;
9833 }
9834 return false;
9835 }

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

◆ TryPickGroundItem()

void Chara.TryPickGroundItem ( )
inline

Definition at line 4349 of file Chara.cs.

4350 {
4351 foreach (Card item in pos.ListCards())
4352 {
4353 if ((IsPC || !(EClass.pc.ai is AI_UseCrafter aI_UseCrafter) || !aI_UseCrafter.ings.Contains(item)) && item.isThing && item.placeState == PlaceState.roaming && CanPick(item))
4354 {
4355 Thing thing = Pick(item.Thing);
4356 if (thing != null && !IsPC)
4357 {
4358 thing.isNPCProperty = true;
4359 }
4360 break;
4361 }
4362 }
4363 }

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

Referenced by AI_Fish.Run().

◆ TryPoisonPotion()

Thing Chara.TryPoisonPotion ( Thing  t)
inline

Definition at line 4281 of file Chara.cs.

4282 {
4283 if (t.trait is TraitPotion && t.id != "1165" && !t.source.tag.Contains("neg") && EClass.rnd(2) == 0 && HasElement(1565))
4284 {
4285 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)
4286 .id;
4287 Say("poisonDrip", this);
4288 int num = t.Num;
4289 t.Destroy();
4290 t = ThingGen.Create(text).SetNum(num);
4291 }
4292 return t;
4293 }
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 3189 of file Chara.cs.

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

4366 {
4367 if (!EClass._zone.TryAddThingInSharedContainer(t, containers) && dropIfFail)
4368 {
4369 EClass._zone.AddCard(t, pos);
4370 }
4371 }
bool TryAddThingInSharedContainer(Thing t, List< Thing > containers=null, bool add=true, bool msg=false, Chara chara=null, bool sharedOnly=true)
Definition: Zone.cs:2093

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

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

7194 {
7195 if (GetInt(113) != 0)
7196 {
7197 return;
7198 }
7199 _ListItems.Clear();
7200 Thing bestRangedWeapon = GetBestRangedWeapon();
7201 foreach (Thing thing in things)
7202 {
7203 if (!thing.IsAmmo)
7204 {
7205 if (thing.category.slot != 0 && !thing.isEquipped && !thing.HasTag(CTAG.gift))
7206 {
7207 _ListItems.Add(thing);
7208 }
7209 else if (thing.IsRangedWeapon && thing.category.slot == 0 && bestRangedWeapon != thing)
7210 {
7211 _ListItems.Add(thing);
7212 }
7213 }
7214 }
7215 if (_ListItems.Count == 0)
7216 {
7217 return;
7218 }
7219 List<Thing> containers2 = containers.ToList();
7220 foreach (Thing listItem in _ListItems)
7221 {
7222 EClass._zone.TryAddThingInSharedContainer(listItem, containers2, add: true, msg: true, this);
7223 }
7224 }
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 4325 of file Chara.cs.

4326 {
4327 if (t.id == "axe")
4328 {
4329 Tutorial.Reserve("tool");
4330 }
4331 if (t.category.id == "mushroom")
4332 {
4333 Tutorial.Reserve("food");
4334 }
4335 if (t.category.id == "herb")
4336 {
4337 Tutorial.Reserve("herb");
4338 }
4339 if (t.id == "pasture")
4340 {
4341 Tutorial.Reserve("pasture");
4342 }
4343 if (t.id == "log")
4344 {
4345 Tutorial.Reserve("process");
4346 }
4347 }

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

◆ TryRestock()

void Chara.TryRestock ( bool  onCreate)
inline

Definition at line 4606 of file Chara.cs.

4607 {
4608 isOnCreate = onCreate;
4609 if (onCreate || (!IsPCFaction && (base.IsUnique || trait is TraitAdventurer || trait is TraitGuard)))
4610 {
4611 RestockEquip((!EClass.core.IsGameStarted || !(EClass._zone is Zone_Music)) && onCreate);
4612 }
4613 RestockInventory(onCreate);
4614 }
void RestockInventory(bool onCreate)
Definition: Chara.cs:4884
void RestockEquip(bool onCreate)
Definition: Chara.cs:4616

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

6179 {
6180 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))
6181 {
6182 SetEnemy(c);
6183 }
6184 }

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

7232 {
7234 }
void TryTakeSharedItems(bool msg=true)
Definition: Chara.cs:7231

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

7237 {
7238 if (base.isSummon || (memberType == FactionMemberType.Livestock && homeBranch != null && !homeBranch.policies.IsActive(2715)))
7239 {
7240 return;
7241 }
7242 int num = 2;
7243 int num2 = 2;
7244 bool flag = GetInt(113) == 0;
7245 int num3 = 2;
7246 int num4 = 2;
7247 int num5 = 2;
7249 {
7250 num4 = 0;
7251 num5 = 0;
7252 }
7253 foreach (Thing thing3 in things)
7254 {
7255 if (CanEat(thing3, shouldEat))
7256 {
7257 num -= thing3.Num;
7258 }
7259 if (thing3.trait.GetHealAction(this) != null)
7260 {
7261 num2 -= thing3.Num;
7262 }
7263 if (thing3.id == "polish_powder")
7264 {
7265 num3 -= thing3.Num;
7266 }
7267 if (thing3.trait is TraitBlanketColdproof)
7268 {
7269 num4 -= thing3.Num;
7270 }
7271 if (thing3.trait is TraitBlanketFireproof)
7272 {
7273 num5 -= thing3.Num;
7274 }
7275 }
7276 _ListItems.Clear();
7277 foreach (Thing container in containers)
7278 {
7279 if (!container.IsSharedContainer)
7280 {
7281 continue;
7282 }
7283 foreach (Thing thing4 in container.things)
7284 {
7285 if (!thing4.c_isImportant && thing4.IsIdentified)
7286 {
7287 if (num3 > 0 && thing4.id == "polish_powder")
7288 {
7289 _ListItems.Add(thing4);
7290 num3 -= thing4.Num;
7291 }
7292 else if (num4 > 0 && !HasElement(1236) && thing4.trait is TraitBlanketColdproof)
7293 {
7294 _ListItems.Add(thing4);
7295 num4 -= thing4.Num;
7296 }
7297 else if (num5 > 0 && thing4.trait is TraitBlanketFireproof)
7298 {
7299 _ListItems.Add(thing4);
7300 num5 -= thing4.Num;
7301 }
7302 else if (num > 0 && CanEat(thing4, shouldEat) && !thing4.c_isImportant)
7303 {
7304 _ListItems.Add(thing4);
7305 num -= thing4.Num;
7306 }
7307 else if (num2 > 0 && thing4.trait.GetHealAction(this) != null)
7308 {
7309 _ListItems.Add(thing4);
7310 num2 -= thing4.Num;
7311 }
7312 else if (flag && thing4.IsEquipmentOrRanged && !thing4.HasTag(CTAG.gift) && ShouldEquip(thing4, useFav: true))
7313 {
7314 _ListItems.Add(thing4);
7315 }
7316 }
7317 }
7318 }
7319 if (_ListItems.Count == 0)
7320 {
7321 return;
7322 }
7323 _ListItems.ForeachReverse(delegate(Thing t)
7324 {
7325 if (t.IsEquipmentOrRanged)
7326 {
7327 bool flag3 = false;
7328 int slot = t.category.slot;
7329 int equipValue = t.GetEquipValue();
7330 foreach (Thing listItem in _ListItems)
7331 {
7332 if (listItem.category.slot == slot && listItem.GetEquipValue() > equipValue)
7333 {
7334 flag3 = true;
7335 break;
7336 }
7337 }
7338 if (flag3)
7339 {
7340 _ListItems.Remove(t);
7341 }
7342 }
7343 });
7344 bool flag2 = false;
7345 foreach (Thing listItem2 in _ListItems)
7346 {
7347 Thing thing = listItem2;
7348 if (things.IsFull(thing))
7349 {
7350 break;
7351 }
7352 Thing thing2 = listItem2.parent as Thing;
7353 if (thing.Num > 2)
7354 {
7355 thing = thing.Split(2);
7356 }
7357 if (msg)
7358 {
7359 Say("takeSharedItem", this, thing, thing2.GetName(NameStyle.Full));
7360 }
7361 AddCard(thing);
7362 if (ShouldEquip(thing, useFav: true) && thing.category.slot != 0)
7363 {
7364 TryEquip(thing, useFav: true);
7365 flag2 = true;
7366 }
7367 }
7368 if (flag2 && flag)
7369 {
7370 TryPutSharedItems(containers);
7371 }
7372 }
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:527
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 8337 of file Chara.cs.

8338 {
8339 if (!EClass.debug.enable || IsPC || !IsGlobal || !IsPCFaction)
8340 {
8341 return;
8342 }
8343 for (int i = 0; i < 100; i++)
8344 {
8345 if (base.feat == 0)
8346 {
8347 break;
8348 }
8349 if (base.c_upgrades == null)
8350 {
8351 base.c_upgrades = new CharaUpgrade();
8352 }
8353 if (base.c_upgrades.halt)
8354 {
8355 break;
8356 }
8357 Rand.SetSeed(base.uid + base.c_upgrades.count);
8358 int num = EClass.rnd(100);
8359 int num2 = 0;
8360 int num3 = 1;
8361 int num4 = 0;
8362 bool flag = false;
8363 IEnumerable<SourceElement.Row> ie = EClass.sources.elements.rows.Where((SourceElement.Row a) => !elements.Has(a) && a.category == "skill" && !a.tag.Contains("noPet"));
8364 List<Element> list = ListAvailabeFeats(pet: true);
8365 if (num >= 90 && list.Count > 0)
8366 {
8367 Element element = list.RandomItem();
8368 num2 = element.id;
8369 num4 = element.CostLearn;
8370 }
8371 else if (num >= 60 && ie.Any())
8372 {
8373 num2 = ie.RandomItem().id;
8374 num4 = 3;
8375 }
8376 else
8377 {
8378 num2 = Element.List_MainAttributesMajor.RandomItem();
8379 num4 = 1;
8380 num3 = 2;
8381 flag = true;
8382 }
8383 Rand.SetSeed();
8384 if (num4 > base.feat)
8385 {
8386 break;
8387 }
8388 base.feat -= num4;
8389 base.c_upgrades.count++;
8390 base.c_upgrades.spent += num4;
8391 bool flag2 = false;
8392 if (flag)
8393 {
8394 foreach (CharaUpgrade.Item item in base.c_upgrades.items)
8395 {
8396 if (item.idEle == num2)
8397 {
8398 item.value += num3;
8399 item.cost += num4;
8400 flag2 = true;
8401 break;
8402 }
8403 }
8404 }
8405 if (!flag2)
8406 {
8407 base.c_upgrades.items.Add(new CharaUpgrade.Item
8408 {
8409 idEle = num2,
8410 value = num3,
8411 cost = num4
8412 });
8413 }
8414 SourceElement.Row row = EClass.sources.elements.map[num2];
8415 if (row.category == "feat")
8416 {
8417 SetFeat(num2, elements.ValueWithoutLink(num2) + 1, msg: true);
8418 }
8419 else if (elements.ValueWithoutLink(row.id) == 0)
8420 {
8421 elements.Learn(row.id);
8422 }
8423 else
8424 {
8425 elements.ModBase(num2, num3);
8426 }
8427 }
8428 }
List< Element > ListAvailabeFeats(bool pet=false, bool showAll=false)
Definition: Chara.cs:9571
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 7668 of file Chara.cs.

7669 {
7670 if (t.id == "338")
7671 {
7672 Thing thing = things.Find((Thing a) => a.IsEquipmentOrRanged && !a.isAcidproof);
7673 if (thing != null)
7674 {
7675 Say("dip", this, thing, t.GetName(NameStyle.Full, 1));
7676 SE.Change();
7677 t.trait.OnBlend(thing, this);
7678 return true;
7679 }
7680 return false;
7681 }
7682 if (t.IsNegativeGift || t.source.HasTag(CTAG.ignoreUse))
7683 {
7684 return false;
7685 }
7686 if (t.id == "cigar")
7687 {
7688 (t.trait as TraitItemProc).OnUse(this);
7689 return true;
7690 }
7691 if (t.trait.CanEat(this) && hunger.GetPhase() > ((IsPCFaction || IsPCFactionMinion) ? 2 : 0))
7692 {
7694 {
7695 target = t
7696 });
7697 return true;
7698 }
7699 if (t.trait.CanDrink(this))
7700 {
7701 Drink(t);
7702 return true;
7703 }
7704 if (t.trait.CanRead(this))
7705 {
7707 {
7708 target = t
7709 });
7710 return true;
7711 }
7712 if (base.hp < MaxHP * 90 / 100)
7713 {
7714 Action healAction = t.trait.GetHealAction(this);
7715 if (healAction != null)
7716 {
7717 healAction();
7718 return true;
7719 }
7720 }
7721 return false;
7722 }
bool isAcidproof
Definition: Card.cs:686
void SetAIImmediate(AIAct g)
Definition: Chara.cs:8648
virtual bool CanRead(Chara c)
Definition: Trait.cs:966
virtual bool CanDrink(Chara c)
Definition: Trait.cs:984
virtual void OnBlend(Thing t, Chara c)
Definition: Trait.cs:610

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

8910 {
8911 if (EClass.world.date.IsExpired(GetInt(51)))
8912 {
8913 Expedition expedition = Expedition.Create(this, sourceWork.expedition.ToEnum<ExpeditionType>());
8914 SetInt(51, EClass.world.date.GetRaw() + 60 * (expedition.hours + 24));
8915 homeBranch.expeditions.Add(expedition);
8916 return true;
8917 }
8918 return false;
8919 }
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 3548 of file Chara.cs.

3549 {
3550 if (IsPCC)
3551 {
3552 if (base.dir == 0)
3553 {
3554 angle = 225f;
3555 }
3556 else if (base.dir == 1)
3557 {
3558 angle = 135f;
3559 }
3560 else if (base.dir == 2)
3561 {
3562 angle = 45f;
3563 }
3564 else if (base.dir == 3)
3565 {
3566 angle = -45f;
3567 }
3568 }
3569 else if (base.dir == 0)
3570 {
3571 angle = 165f;
3572 }
3573 else if (base.dir == 1)
3574 {
3575 angle = 300f;
3576 }
3577 else if (base.dir == 2)
3578 {
3579 angle = 0f;
3580 }
3581 else if (base.dir == 3)
3582 {
3583 angle = 120f;
3584 }
3585 }

Referenced by OnDeserialized().

◆ UpdateSight()

void Chara.UpdateSight ( )
inline

Definition at line 3609 of file Chara.cs.

3610 {
3611 int num = 4;
3612 for (int i = -num; i < num + 1; i++)
3613 {
3614 for (int j = -num; j < num + 1; j++)
3615 {
3616 shared.Set(pos.x + i, pos.z + j);
3617 if (shared.IsValid && !shared.cell.isSeen && i >= -1 && i <= 1 && j >= -1)
3618 {
3619 _ = 1;
3620 }
3621 }
3622 }
3623 }
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 5705 of file Chara.cs.

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

8958 {
8959 _goalWork.FindWork(this, setAI: false);
8961 }
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 5151 of file Chara.cs.

5152 {
5153 base.c_vomit++;
5154 Say("vomit", this);
5155 PlaySound("vomit");
5156 if (!EClass._zone.IsRegion)
5157 {
5158 Thing thing = ThingGen.Create("731");
5160 {
5161 thing.MakeRefFrom(this);
5162 }
5163 EClass._zone.AddCard(thing, pos);
5164 }
5165 if (HasCondition<ConAnorexia>())
5166 {
5167 ModExp(70, -50);
5168 ModExp(71, -75);
5169 ModExp(77, -100);
5170 }
5171 else if (base.c_vomit > 10)
5172 {
5173 AddCondition<ConAnorexia>();
5174 }
5175 AddCondition<ConDim>();
5176 if (HasCondition<ConAnorexia>())
5177 {
5178 ModWeight(-1 * (1 + EClass.rnd(5)));
5179 }
5180 if (hunger.GetPhase() >= 4)
5181 {
5182 DamageHP(9999L, AttackSource.Hunger);
5183 }
5184 hunger.Mod(30);
5185 }
void ModWeight(int a, bool ignoreLimit=false)
Definition: Chara.cs:9503

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

3626 {
3627 for (int num = conditions.Count - 1; num >= 0; num--)
3628 {
3629 if (conditions[num].ConsumeTurn)
3630 {
3631 return true;
3632 }
3633 }
3634 return false;
3635 }

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

7118 {
7119 n.Clear();
7120 UIItem uIItem = n.AddHeaderCard(base.Name.ToTitleCase());
7121 SetImage(uIItem.image2);
7122 uIItem.text2.SetText(race.GetText().ToTitleCase(wholeText: true) + " " + job.GetText().ToTitleCase(wholeText: true));
7123 n.AddText("");
7124 n.Build();
7125 }
void SetImage(Image image, int dir, int idSkin=0)
Definition: Card.cs:5960
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

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

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

◆ bladder

Stats Chara.bladder
get

Definition at line 1144 of file Chara.cs.

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

◆ burden

◆ CanGainConResist

bool Chara.CanGainConResist
get

Definition at line 1154 of file Chara.cs.

1155 {
1156 get
1157 {
1158 if (base.rarity >= Rarity.Legendary)
1159 {
1160 return !IsPCFaction;
1161 }
1162 return false;
1163 }
1164 }

◆ 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 1142 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 1146 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(), Card.SpawnLoot(), and CoreDebug.UpdateInput().

◆ 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

Definition at line 1050 of file Chara.cs.

Referenced by TraitAltar.OnOffer().

◆ 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(), AI_PlayMusic.Run(), and GoalCombat.Run().

◆ IsMofuable

bool Chara.IsMofuable
get

Definition at line 1092 of file Chara.cs.

1093 {
1094 get
1095 {
1096 if (!race.tag.Contains("mofu"))
1097 {
1098 return HasElement(419);
1099 }
1100 return true;
1101 }
1102 }

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(), 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(), GoalCombat.TryUseAbility(), CharaBody.Unequip(), CharaBody.UnqeuipIfTooHeavy(), and CharaRenderer.UpdatePosition().

◆ 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 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(), TraitHitchingPost.OnActivateTrap(), FactionBranch.OnAdvanceDay(), FactionBranch.OnAfterSimulate(), ZoneEventDefenseGame.OnCharaDie(), BaseListPeople.OnClick(), Zone_CursedManor.OnGenerateMap(), ListPeopleExpedition.OnList(), TraitBaseSpellbook.OnRead(), AI_Read.OnSetOwner(), FactionBranch.OnSimulateDay(), FactionBranch.OnSimulateHour(), TraitGeneMachine.OnUse(), 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:138

◆ 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 return _Speed;
1089 }
1090 }

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: