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

Public Member Functions

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

Public Attributes

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

Static Public Attributes

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

Protected Member Functions

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

Properties

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

Private Member Functions

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

Private Attributes

Faction _faction
 
long _Speed
 
bool hasMovedThisTurn
 

Static Private Attributes

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

Additional Inherited Members

- Public Types inherited from Card
enum  MoveResult { Fail , Success , Door , Event }
 
enum  MoveType { Walk , Force }
 
- Public Types inherited from IInspect
enum  NoteMode { Default , Recipe , Product , Info }
 
- Static Public Member Functions inherited from Card
static string ApplyTone (Chara c, ref string text, string _tones, int gender, bool stripPun=false)
 
static int GetTilePrice (TileRow row, SourceMaterial.Row mat)
 
- Static Public Member Functions inherited from EClass
static int rndSeed (int a, int seed)
 
static int rnd (long a)
 
static int rnd (int a)
 
static int curve (long _a, int start, int step, int rate=75)
 
static int sqrt (int a)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 

Detailed Description

Definition at line 9 of file Chara.cs.

Member Function Documentation

◆ _CreateRenderer()

override CardRenderer Chara._CreateRenderer ( )
inlinevirtual

Reimplemented from Card.

Definition at line 6707 of file Chara.cs.

6708 {
6709 CardRenderer cardRenderer = renderer;
6710 CharaRenderer charaRenderer = new CharaRenderer();
6711 if (source.skinAntiSpider != 0 && EClass.core.config.game.antiSpider)
6712 {
6713 base.idSkin = source.skinAntiSpider;
6714 }
6715 if (host != null)
6716 {
6717 charaRenderer.pccData = PCCData.Create("ride");
6718 string idPart = base.c_idRidePCC.IsEmpty(EClass.core.pccs.sets["ride"].map["body"].map.Keys.First());
6719 charaRenderer.pccData.SetPart("body", "ride", idPart);
6720 charaRenderer.pccData.ride = EClass.core.pccs.GetRideData(idPart);
6721 }
6722 else
6723 {
6724 foreach (Condition condition in conditions)
6725 {
6726 RendererReplacer rendererReplacer = condition.GetRendererReplacer();
6727 if (rendererReplacer != null)
6728 {
6729 charaRenderer.replacer = rendererReplacer;
6730 charaRenderer.data = rendererReplacer.data;
6731 break;
6732 }
6733 }
6734 if (charaRenderer.replacer == null)
6735 {
6736 charaRenderer.pccData = pccData;
6737 }
6738 }
6739 renderer = charaRenderer;
6740 renderer.SetOwner(this);
6741 if (cardRenderer != null)
6742 {
6743 renderer.SetFirst(first: false, cardRenderer.position);
6744 }
6745 return charaRenderer;
6746 }
virtual RendererReplacer GetRendererReplacer()
RendererReplacer replacer
Definition: CardRenderer.cs:29
Vector3 position
Definition: CardRenderer.cs:21
virtual void SetOwner(Card c)
Definition: CardRenderer.cs:38
virtual void SetFirst(bool first, Vector3 pos)
CardRenderer renderer
Definition: Card.cs:62
PCCData pccData
Chara host
Definition: Chara.cs:33
List< Condition > conditions
Definition: Chara.cs:213
SourceChara.Row source
Definition: Chara.cs:160
PCCData pccData
Definition: Chara.cs:67
new GameConfig game
Definition: CoreConfig.cs:609
PCCManager pccs
Definition: Core.cs:41
CoreConfig config
Definition: Core.cs:70
Definition: EClass.cs:6
static Core core
Definition: EClass.cs:7

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

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

◆ _MakeAlly()

void Chara._MakeAlly ( )
inline

Definition at line 2314 of file Chara.cs.

2315 {
2316 if (EClass.pc.homeBranch != null)
2317 {
2319 }
2320 else
2321 {
2322 SetGlobal();
2324 }
2325 Hostility hostility2 = (base.c_originalHostility = Hostility.Ally);
2326 this.hostility = hostility2;
2327 orgPos = null;
2328 base.c_summonDuration = 0;
2329 base.isSummon = false;
2330 ReleaseMinion();
2331 SetInt(32);
2332 Refresh();
2333 }
Hostility
Definition: Hostility.cs:2
list. Refresh()
void SetInt(int id, int value=0)
Definition: BaseCard.cs:39
void ReleaseMinion()
Definition: Chara.cs:2380
Chara SetFaction(Faction f)
Definition: Chara.cs:1425
Point orgPos
Definition: Chara.cs:21
FactionBranch homeBranch
Definition: Chara.cs:1068
Chara SetGlobal()
Definition: Chara.cs:1492
static Faction Home
Definition: EClass.cs:27
static Chara pc
Definition: EClass.cs:15
void AddMemeber(Chara c)

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

Referenced by MakeAlly(), and MakePartyMemeber().

◆ _Move()

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

Reimplemented from Card.

Definition at line 2760 of file Chara.cs.

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

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

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

◆ _ShowDialog()

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

Definition at line 7301 of file Chara.cs.

7302 {
7303 EClass.Sound.Play("pop_drama");
7304 if (book == "_chara" && IsPC)
7305 {
7306 step = "pc";
7307 }
7308 return LayerDrama.Activate(book, sheet, step, this, null, tag);
7309 }
static SoundManager Sound
Definition: EClass.cs:47
static LayerDrama Activate(string book, string idSheet, string idStep, Chara target=null, Card ref1=null, string tag="")
Definition: LayerDrama.cs:66

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

◆ AddCondition() [1/2]

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

Definition at line 9331 of file Chara.cs.

9332 {
9333 c.owner = this;
9334 if (!(c is ConBurning))
9335 {
9336 if (c is ConBleed && ResistLv(964) >= 3)
9337 {
9338 return null;
9339 }
9340 }
9341 else if (ResistLv(950) >= 3)
9342 {
9343 return null;
9344 }
9346 {
9347 if (c.GainResistFactor >= 400)
9348 {
9349 c.power /= 2;
9350 }
9351 ResistCon(c);
9352 if (c.power <= 0)
9353 {
9354 return null;
9355 }
9356 }
9357 if (!force)
9358 {
9359 if (c.source.negate.Length != 0)
9360 {
9361 string[] negate = c.source.negate;
9362 foreach (string text in negate)
9363 {
9364 if (HasElement(text))
9365 {
9366 return null;
9367 }
9368 }
9369 }
9370 Element defenseAttribute = c.GetDefenseAttribute(this);
9371 if (defenseAttribute != null)
9372 {
9373 c.power = 100 * c.power / Mathf.Max(100 + defenseAttribute.Value, 1);
9374 }
9375 if (c.source.resistance.Length != 0)
9376 {
9377 int num = ResistLv(EClass.sources.elements.alias[c.source.resistance[0]].id);
9378 if (num > 0)
9379 {
9380 c.power /= num * num + 1;
9381 if (c.power <= 40)
9382 {
9383 return null;
9384 }
9385 }
9386 }
9387 c.power = c.EvaluatePower(c.power);
9388 if (c.power <= 0)
9389 {
9390 return null;
9391 }
9392 }
9393 int num2 = c.EvaluateTurn(c.power);
9394 if (num2 == 0)
9395 {
9396 return null;
9397 }
9398 for (int j = 0; j < conditions.Count; j++)
9399 {
9400 if (conditions[j].id != c.id)
9401 {
9402 continue;
9403 }
9404 if (c.Type == ConditionType.Stance || c.IsToggle)
9405 {
9406 conditions[j].Kill();
9407 return null;
9408 }
9409 if (conditions[j].CanStack(c))
9410 {
9411 if (conditions[j].ShouldOverride(c))
9412 {
9413 if (conditions[j].IsOverrideConditionMet(c, num2))
9414 {
9415 conditions[j].Kill(silent: true);
9416 continue;
9417 }
9418 return null;
9419 }
9420 if (CanGainConResist)
9421 {
9422 AddResistCon(c);
9423 }
9424 conditions[j].OnStacked(c.power);
9425 conditions[j].OnStartOrStack();
9426 conditions[j].PlayEffect();
9427 }
9428 if (!conditions[j].AllowMultipleInstance)
9429 {
9430 return null;
9431 }
9432 }
9433 foreach (Condition condition in conditions)
9434 {
9435 if (condition.TryNullify(c))
9436 {
9437 return null;
9438 }
9439 }
9440 c.value = num2;
9441 conditions.Add(c);
9442 if (CanGainConResist)
9443 {
9444 AddResistCon(c);
9445 }
9446 c.SetOwner(this);
9447 c.Start();
9448 SetDirtySpeed();
9449 if (c.ShouldRefresh)
9450 {
9451 Refresh();
9452 }
9453 if (c.CancelAI)
9454 {
9455 ai.Cancel();
9456 }
9457 if (IsPC && c.ConsumeTurn && !EClass.pc.isRestrained)
9458 {
9460 }
9461 if (c.SyncRide && (ride != null || parasite != null))
9462 {
9463 if (ride != null)
9464 {
9466 }
9467 if (parasite != null)
9468 {
9470 }
9471 }
9472 return c;
9473 }
ConditionType
Definition: ConditionType.cs:2
virtual Status Cancel()
Definition: AIAct.cs:295
virtual bool SyncRide
virtual bool IsToggle
virtual bool ShouldRefresh
virtual bool CancelAI
virtual int EvaluatePower(int p)
virtual int GainResistFactor
virtual bool ConsumeTurn
Element GetDefenseAttribute(Chara c=null)
virtual int EvaluateTurn(int p)
virtual void SetOwner(Chara _owner, bool onDeserialize=false)
virtual bool TryNullify(Condition c)
virtual ConditionType Type
Definition: BaseStats.cs:19
SourceStat.Row source
Definition: BaseStats.cs:15
int id
Definition: BaseStats.cs:11
bool isRestrained
Definition: Card.cs:567
int ResistLv(int res)
Definition: Card.cs:5956
void SetDirtySpeed()
Definition: Chara.cs:1865
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:9326
bool CanGainConResist
Definition: Chara.cs:1163
void AddResistCon(Condition con)
Definition: Chara.cs:9740
void ResistCon(Condition con)
Definition: Chara.cs:9760
static Condition Create(string alias, int power=100, Action< Condition > onCreate=null)
Definition: Condition.cs:46
static SourceManager sources
Definition: EClass.cs:43
int Value
Definition: ELEMENT.cs:297
void EndTurn(bool consume=true)
Definition: Player.cs:2083
SourceElement elements

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

◆ AddCondition() [2/2]

◆ AddCondition< T >()

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

Definition at line 9321 of file Chara.cs.

9321 : Condition
9322 {
9323 return AddCondition(typeof(T).Name, p, force);
9324 }
string Name
Definition: Card.cs:2140

◆ AddCooldown()

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

Definition at line 8737 of file Chara.cs.

8738 {
8739 if (_cooldowns == null)
8740 {
8741 _cooldowns = new List<int>();
8742 }
8743 if (turns != 0)
8744 {
8745 _cooldowns.Add(idEle * 1000 + turns);
8746 return;
8747 }
8748 SourceElement.Row row = EClass.sources.elements.map[idEle];
8749 if (row.cooldown > 0)
8750 {
8751 _cooldowns.Add(idEle * 1000 + row.cooldown);
8752 }
8753 }
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 10230 of file Chara.cs.

10231 {
10232 if (!IsPCFaction || !IsGlobal)
10233 {
10234 _historyFood = null;
10235 return;
10236 }
10237 if (_historyFood == null)
10238 {
10239 _historyFood = new List<List<string>>
10240 {
10241 new List<string>()
10242 };
10243 }
10244 if (_historyFood[0].Count < 5)
10245 {
10246 _historyFood[0].Add(food.id);
10247 }
10248 }
override bool IsGlobal
Definition: Chara.cs:612
List< List< string > > _historyFood
Definition: Chara.cs:64

References food.

Referenced by FoodEffect.Proc().

◆ AddHobby()

void Chara.AddHobby ( int  id)
inline

Definition at line 9156 of file Chara.cs.

9157 {
9158 foreach (int hobby in _hobbies)
9159 {
9160 if (hobby == id)
9161 {
9162 return;
9163 }
9164 }
9165 _hobbies.Add(id);
9166 }
List< int > _hobbies
Definition: Chara.cs:49

◆ AddRandomBodyPart()

void Chara.AddRandomBodyPart ( bool  msg = false)
inline

Definition at line 2205 of file Chara.cs.

2206 {
2207 int ele = new int[9] { 30, 31, 33, 35, 35, 36, 34, 37, 39 }.RandomItem();
2208 body.AddBodyPart(ele);
2209 if (msg)
2210 {
2211 Say("gain_bodyparts", this, Element.Get(ele).GetName().ToLower());
2212 PlaySound("offering");
2213 }
2214 }
void AddBodyPart(int ele, Thing thing=null)
Definition: CharaBody.cs:268
CharaBody body
Definition: Chara.cs:94
static SourceElement.Row Get(int id)
Definition: ELEMENT.cs:406

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

Referenced by Feat.Apply().

◆ AddResistCon()

void Chara.AddResistCon ( Condition  con)
inline

Definition at line 9740 of file Chara.cs.

9741 {
9742 if (con.power > 0 && con.GainResistFactor > 0)
9743 {
9744 int key = con.id;
9745 if (resistCon == null)
9746 {
9747 resistCon = new Dictionary<int, int>();
9748 }
9749 if (resistCon.ContainsKey(key))
9750 {
9751 resistCon[key] += con.power * con.GainResistFactor / 100;
9752 }
9753 else
9754 {
9755 resistCon[key] = con.power * con.GainResistFactor / 100;
9756 }
9757 }
9758 }
Dictionary< int, int > resistCon
Definition: Chara.cs:216

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

◆ AddWork()

void Chara.AddWork ( int  id)
inline

Definition at line 9168 of file Chara.cs.

9169 {
9170 foreach (int work in _works)
9171 {
9172 if (work == id)
9173 {
9174 return;
9175 }
9176 }
9177 _works.Add(id);
9178 }
List< int > _works
Definition: Chara.cs:52

◆ ApplyDeathPenalty()

void Chara.ApplyDeathPenalty ( )
inline

Definition at line 5287 of file Chara.cs.

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

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

2041 {
2042 switch (tag)
2043 {
2044 case EditorTag.HostilityNeutral:
2045 {
2046 Hostility hostility2 = (base.c_originalHostility = Hostility.Neutral);
2047 this.hostility = hostility2;
2048 break;
2049 }
2050 case EditorTag.HostilityEnemy:
2051 {
2052 Hostility hostility2 = (base.c_originalHostility = Hostility.Enemy);
2053 this.hostility = hostility2;
2054 break;
2055 }
2056 case EditorTag.HostilityFriend:
2057 {
2058 Hostility hostility2 = (base.c_originalHostility = Hostility.Friend);
2059 this.hostility = hostility2;
2060 break;
2061 }
2062 case EditorTag.Male:
2063 bio.SetGender(2);
2064 base.c_idPortrait = Portrait.GetRandomPortrait(2, GetIdPortraitCat());
2065 break;
2066 case EditorTag.Female:
2067 bio.SetGender(1);
2068 base.c_idPortrait = Portrait.GetRandomPortrait(1, GetIdPortraitCat());
2069 break;
2070 case EditorTag.baby:
2071 SetFeat(1232);
2072 break;
2073 }
2074 base.ApplyEditorTags(tag);
2075 }
EditorTag
Definition: EditorTag.cs:2
void SetGender(int g)
Definition: Biography.cs:473
Biography bio
Definition: Card.cs:45
void SetFeat(int id, int value=1, bool msg=false)
Definition: Chara.cs:9965
string GetIdPortraitCat()
Definition: Chara.cs:8200
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 2167 of file Chara.cs.

2168 {
2169 elements.ApplyElementMap(base.uid, SourceValueType.Chara, job.elementMap, base.DefaultLV, remove, applyFeat: true);
2170 if (IsPCC)
2171 {
2172 EClass.game.uniforms.Apply(pccData, job.id, base.IsMale, canUseOtherGender: true);
2173 }
2174 }
SourceValueType
SourceJob.Row job
Definition: Chara.cs:468
void ApplyElementMap(int uid, SourceValueType type, Dictionary< int, int > map, int lv, bool invert=false, bool applyFeat=false)
PCCUniformManager uniforms
Definition: Game.cs:195

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

Referenced by ChangeJob(), and OnCreate().

◆ ApplyRace()

void Chara.ApplyRace ( bool  remove = false)
inline

Definition at line 2253 of file Chara.cs.

2254 {
2255 string[] array = race.figure.Split('|');
2256 foreach (string s in array)
2257 {
2258 int num = ParseBodySlot(s);
2259 if (num != -1)
2260 {
2261 if (remove)
2262 {
2263 body.RemoveBodyPart(num);
2264 }
2265 else
2266 {
2267 body.AddBodyPart(num);
2268 }
2269 }
2270 }
2272 elements.ApplyElementMap(base.uid, SourceValueType.Chara, race.elementMap, base.DefaultLV, remove, applyFeat: true);
2273 if (!remove && race.id == "bike" && id != "bike_cub")
2274 {
2275 SetFeat(1423, (id == "chara" || id == "player") ? 10 : (1 + EClass.rnd(10)));
2276 }
2277 }
void RefreshBodyParts()
Definition: CharaBody.cs:294
void RemoveBodyPart(int ele)
Definition: CharaBody.cs:323
int ParseBodySlot(string s)
Definition: Chara.cs:2188

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

Referenced by ChangeRace(), and OnCreate().

◆ Banish()

void Chara.Banish ( Chara  owner)
inline

Definition at line 2348 of file Chara.cs.

2349 {
2350 owner?.Say("summon_vanish", this);
2351 pos.PlayEffect("vanish");
2352 pos.PlaySound("vanish");
2353 pos.PlayEffect("teleport");
2354 Destroy();
2355 }
void Destroy()
Definition: Card.cs:5103
SoundSource PlaySound(string id, bool synced=true, float v=1f, bool spatial=true)
Definition: Point.cs:1253
Effect PlayEffect(string id)
Definition: Point.cs:1248

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

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

◆ CalcBurden()

void Chara.CalcBurden ( )
inline

Definition at line 1833 of file Chara.cs.

1834 {
1835 int num = base.ChildrenWeight * 100 / Mathf.Max(1, WeightLimit);
1836 if (num < 0)
1837 {
1838 num = 1000;
1839 }
1841 {
1842 num = 0;
1843 }
1844 burden.Set(num);
1845 SetDirtySpeed();
1846 }
override int WeightLimit
Definition: Chara.cs:712
bool ignoreWeight
Definition: CoreDebug.cs:187
static CoreDebug debug
Definition: EClass.cs:49
Stats Set(int[] _raw, int _rawIndex, Chara _CC)
Definition: Stats.cs:109

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

Referenced by Scene.OnUpdate().

◆ CalcCastingChance()

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

Definition at line 6229 of file Chara.cs.

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

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

2022 {
2023 int num = base.END;
2024 int num2 = 0;
2025 foreach (Element value in elements.dict.Values)
2026 {
2027 if (value.source.category == "skill")
2028 {
2029 num = ((!IsPC) ? (num + Mathf.Max(value.ValueWithoutLink, 0)) : (num + Mathf.Max(value.vBase, 0)));
2030 }
2031 }
2032 num2 = EClass.curve(num, 30, 10, 60);
2033 if (num2 < 10)
2034 {
2035 num2 = 10;
2036 }
2037 _maxStamina = num2 + 15;
2038 }
int _maxStamina
Definition: Chara.cs:367
static int curve(long _a, int start, int step, int rate=75)
Definition: EClass.cs:69
int ValueWithoutLink
Definition: ELEMENT.cs:299
int vBase
Definition: ELEMENT.cs:257

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

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

◆ CallHelp()

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

Definition at line 6491 of file Chara.cs.

6492 {
6493 foreach (Chara chara in EClass._map.charas)
6494 {
6495 if (!chara.IsPCFaction && chara.OriginalHostility == OriginalHostility && (fanatic || Dist(chara) <= 6) && (EClass.rnd(3) != 0 || fanatic))
6496 {
6497 chara.GoHostile(tg);
6498 }
6499 }
6500 }
Hostility OriginalHostility
Definition: Chara.cs:473
void GoHostile(Card _tg)
Definition: Chara.cs:6385
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 8288 of file Chara.cs.

8289 {
8290 if (things.IsFull())
8291 {
8292 return false;
8293 }
8294 if (t.c_isImportant)
8295 {
8296 return false;
8297 }
8298 if (t.id == "1084")
8299 {
8300 return true;
8301 }
8302 if (t.trait is TraitBookExp)
8303 {
8304 return true;
8305 }
8306 if (t.trait.CanOnlyCarry || !t.trait.CanBeDestroyed || t.trait.CanExtendBuild || t.rarity == Rarity.Artifact || t.IsContainer)
8307 {
8308 return false;
8309 }
8310 return true;
8311 }
Rarity
Definition: Rarity.cs:2
string id
Definition: Card.cs:36
Rarity rarity
Definition: Card.cs:315
bool c_isImportant
Definition: Card.cs:1025
ThingContainer things
Definition: Card.cs:39
bool IsContainer
Definition: Card.cs:2090
bool IsFull(int y=0)
virtual bool CanExtendBuild
Definition: Trait.cs:181
virtual bool CanBeDestroyed
Definition: Trait.cs:307
virtual bool CanOnlyCarry
Definition: Trait.cs:305

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

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

◆ CanAcceptItem()

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

Definition at line 8267 of file Chara.cs.

8268 {
8270 {
8271 return true;
8272 }
8273 if (!IsValidGiftWeight(t, num))
8274 {
8275 return false;
8276 }
8277 if (t.c_isImportant)
8278 {
8279 return false;
8280 }
8281 if ((t.category.IsChildOf("furniture") || t.category.IsChildOf("junk")) && !HasElement(1411))
8282 {
8283 return false;
8284 }
8285 return true;
8286 }
bool IsValidGiftWeight(Card t, int num=-1)
Definition: Chara.cs:8257

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

4300 {
4301 return true;
4302 }

◆ CanBeTempAlly()

bool Chara.CanBeTempAlly ( Chara  c)
inline

Definition at line 2335 of file Chara.cs.

2336 {
2337 if (IsPCFaction || IsGlobal || IsMinion || IsMultisize || EClass._zone.CountMinions(c) > c.MaxSummon || base.rarity >= Rarity.Legendary)
2338 {
2339 return false;
2340 }
2341 if (HasElement(1222))
2342 {
2343 return false;
2344 }
2345 return true;
2346 }
override bool IsMinion
Definition: Chara.cs:629
int MaxSummon
Definition: Chara.cs:716
override bool IsMultisize
Definition: Chara.cs:708
int CountMinions(Chara c)
Definition: Zone.cs:3760

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

Referenced by GoalCombat.Run().

◆ CanBloom()

bool Chara.CanBloom ( )
inline

Definition at line 8720 of file Chara.cs.

8721 {
8722 if (IsPC || base.isScaled || HasElement(1273))
8723 {
8724 return false;
8725 }
8726 if (!EClass.debug.godMode)
8727 {
8728 if (base.c_daysWithPC > 360)
8729 {
8730 return affinity.CanSleepBeside();
8731 }
8732 return false;
8733 }
8734 return true;
8735 }
bool CanSleepBeside()
Definition: Affinity.cs:77
Affinity affinity
Definition: Chara.cs:316
bool godMode
Definition: CoreDebug.cs:173

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

Referenced by WindowCharaMini.Refresh().

◆ CanDestroyPath()

bool Chara.CanDestroyPath ( )
inline

Definition at line 2428 of file Chara.cs.

2429 {
2430 if (!IsMultisize)
2431 {
2432 if (base.rarity >= Rarity.Superior && !base.IsPCFactionOrMinion && ai is GoalCombat && !EClass._zone.IsPCFaction)
2433 {
2434 return !(EClass._zone is Zone_Town);
2435 }
2436 return false;
2437 }
2438 return true;
2439 }

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

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

◆ CanDuplicate()

bool Chara.CanDuplicate ( )
inline

Definition at line 1764 of file Chara.cs.

1765 {
1766 if (EClass._zone.IsRegion || HasCondition<ConPoison>() || HasCondition<ConConfuse>() || HasCondition<ConDim>() || HasCondition<ConParalyze>() || HasCondition<ConSleep>() || HasCondition<ConBurning>() || HasCondition<ConFreeze>() || HasCondition<ConMiasma>() || corruption >= 100)
1767 {
1768 return false;
1769 }
1771 {
1772 return false;
1773 }
1774 string text = id;
1775 if (!(text == "mech_scarab"))
1776 {
1777 if (text == "spider_queen" && (pos.cell.light > 0 || pos.IsSunLit))
1778 {
1779 return false;
1780 }
1781 }
1782 else if (isSynced || pos.cell.light > 0 || (!EClass._map.IsIndoor && !pos.cell.HasRoof && !EClass.world.date.IsNight))
1783 {
1784 return false;
1785 }
1786 return true;
1787 }
byte light
Definition: Cell.cs:60
bool HasRoof
Definition: Cell.cs:648
int corruption
Definition: Chara.cs:379
int CurrentGeneSlot
Definition: Chara.cs:1073
bool IsNight
Definition: Date.cs:112
GamePrincipal principal
Definition: Game.cs:225
bool IsIndoor
Definition: Map.cs:131
bool IsSunLit
Definition: Point.cs:182

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

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

◆ CanEat()

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

Definition at line 7670 of file Chara.cs.

7671 {
7672 if (t.IsDecayed && !HasElement(480))
7673 {
7674 return false;
7675 }
7676 if (HasElement(1250) && !t.HasElement(710))
7677 {
7678 return false;
7679 }
7680 if (shouldEat && (!(t.trait is TraitFoodPrepared) || t.c_isImportant))
7681 {
7682 return false;
7683 }
7684 if (!t.IsNegativeGift && !t.HasTag(CTAG.ignoreUse) && !t.isEquipped)
7685 {
7686 return t.trait.CanEat(this);
7687 }
7688 return false;
7689 }
CTAG
Definition: CTAG.cs:2
bool IsNegativeGift
Definition: Card.cs:2399
bool HasTag(CTAG tag)
Definition: Card.cs:2598
bool isEquipped
Definition: Thing.cs:17
virtual bool CanEat(Chara c)
Definition: Trait.cs:1000

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

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

◆ CanEquipRanged()

bool Chara.CanEquipRanged ( Thing  t)
inline

Definition at line 7842 of file Chara.cs.

7843 {
7844 return !body.IsTooHeavyToEquip(t);
7845 }
bool IsTooHeavyToEquip(Thing thing)
Definition: CharaBody.cs:160

References CharaBody.IsTooHeavyToEquip().

Referenced by GoalAutoCombat.TryUseRanged().

◆ CanInsult()

bool Chara.CanInsult ( )
inline

Definition at line 8188 of file Chara.cs.

8189 {
8190 foreach (ActList.Item item in ability.list.items)
8191 {
8192 if (item.act.id == 6630)
8193 {
8194 return true;
8195 }
8196 }
8197 return false;
8198 }
List< Item > items
Definition: ActList.cs:14
ActList list
Definition: CharaAbility.cs:12
CharaAbility ability
Definition: Chara.cs:426

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

◆ CanInteractTo() [1/2]

bool Chara.CanInteractTo ( Card  c)
inline

Definition at line 2535 of file Chara.cs.

2536 {
2537 return CanInteractTo(c.pos);
2538 }
bool CanInteractTo(Card c)
Definition: Chara.cs:2535

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

2541 {
2542 if (!p.IsValid)
2543 {
2544 return false;
2545 }
2546 if (EClass._map.cells[p.x, p.z].blocked)
2547 {
2548 return true;
2549 }
2550 if (!IsMultisize)
2551 {
2552 int num = ((p.z >= pos.z) ? ((p.x > pos.x) ? 1 : ((p.z > pos.z) ? 2 : 3)) : 0);
2553 if (EClass._map.cells[pos.x, pos.z].weights[num] == 0)
2554 {
2555 return false;
2556 }
2557 if (p.x != pos.x && p.z != pos.z)
2558 {
2559 Cell[,] cells = EClass._map.cells;
2560 int x = p.x;
2561 int z = pos.z;
2562 int num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2563 if (cells[pos.x, pos.z].weights[num2] == 0)
2564 {
2565 return false;
2566 }
2567 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2568 if (cells[p.x, p.z].weights[num2] == 0)
2569 {
2570 return false;
2571 }
2572 x = pos.x;
2573 z = p.z;
2574 num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2575 if (cells[pos.x, pos.z].weights[num2] == 0)
2576 {
2577 return false;
2578 }
2579 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2580 if (cells[p.x, p.z].weights[num2] == 0)
2581 {
2582 return false;
2583 }
2584 }
2585 }
2586 return true;
2587 }
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 4294 of file Chara.cs.

4295 {
4296 return true;
4297 }

Referenced by HotItemNoItem._TrySetAct().

◆ CanMoveTo()

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

Definition at line 2441 of file Chara.cs.

2442 {
2443 if (!p.IsValid)
2444 {
2445 return false;
2446 }
2447 int num = ((p.z >= pos.z) ? ((p.x > pos.x) ? 1 : ((p.z > pos.z) ? 2 : 3)) : 0);
2448 if (allowDestroyPath && CanDestroyPath())
2449 {
2450 if (!p.IsInBounds)
2451 {
2452 return false;
2453 }
2454 }
2455 else
2456 {
2457 if (EClass._map.cells[p.x, p.z].blocked || EClass._map.cells[pos.x, pos.z].weights[num] == 0)
2458 {
2459 return false;
2460 }
2461 if (p.x != pos.x && p.z != pos.z)
2462 {
2463 Cell[,] cells = EClass._map.cells;
2464 int x = p.x;
2465 int z = pos.z;
2466 int num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2467 if (cells[pos.x, pos.z].weights[num2] == 0)
2468 {
2469 return false;
2470 }
2471 if (cells[x, z].blocked)
2472 {
2473 return false;
2474 }
2475 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2476 if (cells[p.x, p.z].weights[num2] == 0)
2477 {
2478 return false;
2479 }
2480 x = pos.x;
2481 z = p.z;
2482 num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2483 if (cells[pos.x, pos.z].weights[num2] == 0)
2484 {
2485 return false;
2486 }
2487 if (cells[x, z].blocked)
2488 {
2489 return false;
2490 }
2491 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2492 if (cells[p.x, p.z].weights[num2] == 0)
2493 {
2494 return false;
2495 }
2496 }
2497 }
2498 if (IsPC)
2499 {
2500 if (IsEnemyOnPath(p))
2501 {
2502 return false;
2503 }
2504 }
2505 else if (p.HasChara && !IsMultisize && !CanReplace(p.FirstChara))
2506 {
2507 return false;
2508 }
2509 return true;
2510 }
bool IsEnemyOnPath(Point p, bool cancelAI=true)
Definition: Chara.cs:2512
Chara FirstChara
Definition: Point.cs:288
bool IsInBounds
Definition: Point.cs:104

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

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

◆ CanPick()

bool Chara.CanPick ( Card  c)
inline

Definition at line 4304 of file Chara.cs.

4305 {
4306 if (c.isDestroyed)
4307 {
4308 return false;
4309 }
4310 Card rootCard = c.GetRootCard();
4311 if (rootCard.isDestroyed || (rootCard.ExistsOnMap && rootCard.pos.Distance(pos) > 1))
4312 {
4313 return false;
4314 }
4315 if (rootCard != this && things.IsFull(c.Thing))
4316 {
4317 return false;
4318 }
4319 return true;
4320 }
bool isDestroyed
Definition: Card.cs:76
bool ExistsOnMap
Definition: Card.cs:2086
Card GetRootCard()
Definition: Card.cs:3451

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

3320 {
3322 {
3323 return false;
3324 }
3325 if (IsPC)
3326 {
3327 return true;
3328 }
3329 if (c.IsPC || c.pos.Equals(EClass.pc.pos) || c.host != null)
3330 {
3331 return false;
3332 }
3333 if (!IsHostile(c))
3334 {
3335 if (c.c_uidMaster != 0 || c.isSummon || base.IsPowerful || IsEscorted())
3336 {
3337 return true;
3338 }
3339 if (DestDist < c.DestDist)
3340 {
3341 return true;
3342 }
3343 if (IsPCParty && !c.IsPCParty)
3344 {
3345 return true;
3346 }
3347 if (IsPCFaction && !c.IsPCParty)
3348 {
3349 return true;
3350 }
3351 }
3352 return false;
3353 }
bool IsPCFactionOrMinion
Definition: Card.cs:2275
bool isSummon
Definition: Card.cs:711
int c_uidMaster
Definition: Card.cs:1450
bool noMove
Definition: Card.cs:771
new TraitChara trait
Definition: Chara.cs:505
override bool IsPCParty
Definition: Chara.cs:617
int DestDist
Definition: Chara.cs:1000
bool IsHostile()
Definition: Chara.cs:6590
bool IsEscorted()
Definition: Chara.cs:2412
bool Equals(int _x, int _z)
Definition: Point.cs:960
virtual bool CanBePushed
Definition: TraitChara.cs:113

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

Referenced by _Move(), and CanMoveTo().

◆ CanRevive()

bool Chara.CanRevive ( )
inline

Definition at line 5155 of file Chara.cs.

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

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

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

◆ CanSee()

bool Chara.CanSee ( Card  c)
inline

Definition at line 1220 of file Chara.cs.

1221 {
1222 if (c == this)
1223 {
1224 return true;
1225 }
1226 if (!c.pos.IsValid)
1227 {
1228 return false;
1229 }
1230 if (c.isChara)
1231 {
1233 {
1234 return true;
1235 }
1236 if (c.isHidden && c != this && !canSeeInvisible)
1237 {
1238 return false;
1239 }
1240 }
1241 if (IsPC)
1242 {
1243 if (fov != null)
1244 {
1245 return fov.lastPoints.ContainsKey(c.pos.index);
1246 }
1247 return false;
1248 }
1249 return true;
1250 }
virtual Chara Chara
Definition: Card.cs:2071
Fov fov
Definition: Card.cs:58
virtual bool isChara
Definition: Card.cs:2084
bool isHidden
Definition: Card.cs:531
bool canSeeInvisible
Definition: Chara.cs:140
bool visibleWithTelepathy
Definition: Chara.cs:152
bool hasTelepathy
Definition: Chara.cs:142
Dictionary< int, byte > lastPoints
Definition: Fov.cs:36
int index
Definition: Point.cs:49

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

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

◆ CanSeeLos() [1/2]

◆ CanSeeLos() [2/2]

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

Definition at line 1261 of file Chara.cs.

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

1204 {
1205 if (!p.IsValid || p.IsHidden)
1206 {
1207 return false;
1208 }
1209 if (IsPC)
1210 {
1211 if (fov != null)
1212 {
1213 return fov.lastPoints.ContainsKey(p.index);
1214 }
1215 return false;
1216 }
1217 return true;
1218 }
bool IsHidden
Definition: Point.cs:347

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

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

◆ CanSleep()

bool Chara.CanSleep ( )
inline

Definition at line 1301 of file Chara.cs.

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

2177 {
2178 ApplyJob(remove: true);
2179 base.c_idJob = idNew;
2180 _job = null;
2181 ApplyJob();
2182 if (IsPCC)
2183 {
2184 PCC.Get(pccData).Build();
2185 }
2186 }
void ApplyJob(bool remove=false)
Definition: Chara.cs:2167
SourceJob.Row _job
Definition: Chara.cs:164

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

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

◆ ChangeMemberType()

void Chara.ChangeMemberType ( FactionMemberType  type)
inline

Definition at line 7109 of file Chara.cs.

7110 {
7111 memberType = type;
7112 }
FactionMemberType memberType
Definition: Chara.cs:46

◆ ChangeRace()

void Chara.ChangeRace ( string  idNew)
inline

Definition at line 2279 of file Chara.cs.

2280 {
2281 ApplyRace(remove: true);
2282 base.c_idRace = idNew;
2283 _race = null;
2284 ApplyRace();
2285 ChangeMaterial(source.defMat.IsEmpty(race.material));
2286 }
@ ChangeMaterial
void ApplyRace(bool remove=false)
Definition: Chara.cs:2253
SourceRace.Row _race
Definition: Chara.cs:162

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

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

◆ ChangeRarity()

override void Chara.ChangeRarity ( Rarity  r)
inlinevirtual

Reimplemented from Card.

Definition at line 1412 of file Chara.cs.

1413 {
1414 if (r != base.rarity)
1415 {
1416 base.rarity = r;
1417 if (renderer != null && renderer.isSynced)
1418 {
1420 }
1421 base.hp = MaxHP;
1422 }
1423 }
void RefreshExtra()

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

Referenced by ZonePreEnterBout.Execute().

◆ ChooseNewGoal()

void Chara.ChooseNewGoal ( )
inline

Definition at line 8827 of file Chara.cs.

8828 {
8829 if (IsPC && EClass.AdvMode)
8830 {
8831 SetNoGoal();
8832 return;
8833 }
8834 if (IsPCParty || base.noMove)
8835 {
8836 SetAI(new GoalIdle());
8837 return;
8838 }
8839 if ((IsHomeMember() && IsInHomeZone()) || IsGuest())
8840 {
8841 Goal goalFromTimeTable = GetGoalFromTimeTable(EClass.world.date.hour);
8842 if (goalFromTimeTable != null)
8843 {
8844 SetAI(goalFromTimeTable);
8845 if (goalFromTimeTable is GoalWork)
8846 {
8847 goalFromTimeTable.Tick();
8848 }
8849 return;
8850 }
8851 }
8852 if (goalList.index == -2)
8853 {
8855 }
8856 SetAI(goalList.Next());
8857 }
Status Tick()
Definition: AIAct.cs:356
Goal GetGoalFromTimeTable(int hour)
Definition: Chara.cs:8859
GoalListType goalListType
Definition: Chara.cs:281
AIAct SetNoGoal()
Definition: Chara.cs:8951
bool IsHomeMember()
Definition: Chara.cs:6656
bool IsGuest()
Definition: Chara.cs:6681
GoalList goalList
Definition: Chara.cs:202
bool IsInHomeZone()
Definition: Chara.cs:6661
int hour
Definition: Date.cs:74
static bool AdvMode
Definition: EClass.cs:11
int index
Definition: GoalList.cs:5
void Refresh(Chara owner, GoalListType type)
Definition: GoalList.cs:9
Goal Next()
Definition: GoalList.cs:39
Definition: Goal.cs:4

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

Referenced by Zone.Simulate().

◆ ClearBed()

void Chara.ClearBed ( Map  map = null)
inline

Definition at line 7377 of file Chara.cs.

7378 {
7379 if (map == null)
7380 {
7381 map = EClass._map;
7382 }
7383 foreach (Card item in map.props.installed.all)
7384 {
7385 if (item.trait is TraitBed traitBed && traitBed.IsHolder(this))
7386 {
7387 traitBed.RemoveHolder(this);
7388 }
7389 }
7390 }
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 8599 of file Chara.cs.

8600 {
8601 int num = 0;
8602 for (int num2 = things.Count - 1; num2 >= 0; num2--)
8603 {
8604 Thing thing = things[num2];
8605 if (ShouldThrowAway(thing, type))
8606 {
8607 num += thing.GetPrice(CurrencyType.Money, sell: true, PriceType.Default, this) * thing.Num;
8608 thing.Destroy();
8609 }
8610 }
8611 if (num > 0)
8612 {
8613 ModCurrency(num);
8614 if (type == ClearInventoryType.SellAtTown)
8615 {
8616 Msg.Say("party_sell", this, num.ToString() ?? "");
8617 PlaySound("pay");
8618 }
8619 }
8620 }
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:7343
int Num
Definition: Card.cs:159
bool ShouldThrowAway(Thing t, ClearInventoryType type)
Definition: Chara.cs:8528

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

10445 {
10446 if (tempElements != null)
10447 {
10449 tempElements = null;
10450 }
10451 }
ElementContainer tempElements
Definition: Chara.cs:36
void SetParent(Card c)

References ElementContainer.SetParent().

◆ CountDebuff()

int Chara.CountDebuff ( )
inline

Definition at line 9516 of file Chara.cs.

9517 {
9518 int num = 0;
9519 foreach (Condition condition in conditions)
9520 {
9521 if (condition.Type == ConditionType.Debuff)
9522 {
9523 num++;
9524 }
9525 }
9526 return num;
9527 }

References BaseStats.Type.

Referenced by GoalCombat.TryUseAbility().

◆ CountNumEaten()

int Chara.CountNumEaten ( Thing  food)
inline

Definition at line 10250 of file Chara.cs.

10251 {
10252 if (_historyFood == null)
10253 {
10254 return -1;
10255 }
10256 int num = 0;
10257 foreach (List<string> item in _historyFood)
10258 {
10259 foreach (string item2 in item)
10260 {
10261 if (item2 == food.id)
10262 {
10263 num++;
10264 }
10265 }
10266 }
10267 return num;
10268 }

References food, and item.

Referenced by FoodEffect.Proc().

◆ CreateReplacement()

Chara Chara.CreateReplacement ( )
inline

Definition at line 8091 of file Chara.cs.

8092 {
8093 Chara chara = CharaGen.Create(id);
8094 chara.c_originalHostility = base.c_originalHostility;
8095 if (chara.c_originalHostility != 0)
8096 {
8097 chara.hostility = chara.c_originalHostility;
8098 }
8099 if (orgPos != null)
8100 {
8101 chara.orgPos = orgPos.Copy();
8102 }
8103 chara.pos = pos.Copy();
8104 chara.isImported = true;
8105 chara.c_editorTags = base.c_editorTags;
8106 chara.c_editorTraitVal = base.c_editorTraitVal;
8107 chara.c_idTrait = base.c_idTrait;
8108 chara.homeZone = homeZone;
8109 return chara;
8110 }
Hostility c_originalHostility
Definition: Card.cs:977
static Chara Create(string id, int lv=-1)
Definition: CharaGen.cs:17
Zone homeZone
Definition: Chara.cs:269
Point Copy()
Definition: Point.cs:491

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

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

◆ Cuddle()

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

Definition at line 6321 of file Chara.cs.

6322 {
6323 Talk("goodBoy");
6324 Say(headpat ? "headpat" : "cuddle", this, c);
6325 c.ShowEmo(Emo.love);
6326 if (EClass.rnd(IsPC ? 100 : 5000) == 0)
6327 {
6328 c.MakeEgg();
6329 }
6330 if (headpat && this != c)
6331 {
6332 if (c.interest > 0)
6333 {
6334 c.ModAffinity(EClass.pc, 1 + EClass.rnd(3));
6335 c.interest -= 20 + EClass.rnd(10);
6336 }
6338 {
6339 foreach (Chara member in party.members)
6340 {
6341 if (!member.IsPC && CanSeeLos(member))
6342 {
6343 member.AddCondition<ConEuphoric>(100 + Evalue(6904) * 5);
6344 }
6345 }
6346 }
6347 }
6348 if (c.Evalue(1221) > 0)
6349 {
6350 int ele = ((c.MainElement == Element.Void) ? 924 : c.MainElement.id);
6351 if (c.id == "hedgehog_ether")
6352 {
6353 ele = 922;
6354 }
6355 Say("reflect_thorne", c, this);
6356 DamageHP(10L, ele, Power, AttackSource.Condition);
6357 }
6358 }
Emo
Definition: Emo.cs:2
virtual int Power
Definition: Card.cs:2298
void ShowEmo(Emo _emo=Emo.none, float duration=0f, bool skipSame=true)
Definition: Card.cs:6182
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
Definition: Card.cs:5761
Element MainElement
Definition: Chara.cs:719
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Definition: Chara.cs:8013
int interest
Definition: Chara.cs:319
Religion faith
Definition: Chara.cs:441
static Element Void
Definition: ELEMENT.cs:243
ReligionManager religions
Definition: Game.cs:159
ReligionMoonShadow MoonShadow

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

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

◆ Cure()

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

Definition at line 9579 of file Chara.cs.

9580 {
9581 bool flag = state == BlessedState.Blessed;
9582 switch (type)
9583 {
9584 case CureType.Heal:
9585 case CureType.Prayer:
9586 CureCondition<ConFear>();
9587 CureCondition<ConBlind>(2 * p / 100 + 5);
9588 CureCondition<ConPoison>(5 * p / 100 + 5);
9589 CureCondition<ConConfuse>(10 * p / 100 + 10);
9590 CureCondition<ConDim>(p / 100 + 5);
9591 CureCondition<ConBleed>(2 * p / 100 + 10);
9592 if (flag)
9593 {
9594 SAN.Mod(-15);
9595 }
9596 break;
9597 case CureType.CureBody:
9598 CureCondition<ConBlind>(5 * p / 100 + 15);
9599 CureCondition<ConPoison>(10 * p / 100 + 15);
9600 CureCondition<ConBleed>(5 * p / 100 + 20);
9601 CureTempElements(p, body: true, mind: false);
9602 break;
9603 case CureType.CureMind:
9604 CureCondition<ConFear>();
9605 CureCondition<ConDim>(3 * p / 100 + 10);
9606 CureTempElements(p, body: false, mind: true);
9607 break;
9608 case CureType.Sleep:
9609 {
9610 for (int num2 = conditions.Count - 1; num2 >= 0; num2--)
9611 {
9612 Condition condition2 = conditions[num2];
9613 if (!(condition2 is ConSleep) && !(condition2 is ConFaint))
9614 {
9615 if (condition2.isPerfume)
9616 {
9617 condition2.Mod(-1, force: true);
9618 }
9619 else if (condition2.Type == ConditionType.Bad || condition2.Type == ConditionType.Debuff)
9620 {
9621 condition2.Kill();
9622 }
9623 }
9624 }
9625 CureCondition<ConWait>();
9626 CureCondition<ConDisease>((EClass.rnd(20) + 10) * p / 100);
9627 bool flag2 = HasCondition<ConAnorexia>();
9628 base.c_vomit -= (flag2 ? 3 : 2) * p / 100;
9629 if (base.c_vomit < 0)
9630 {
9631 base.c_vomit = 0;
9632 if (flag2)
9633 {
9634 RemoveCondition<ConAnorexia>();
9635 }
9636 }
9637 break;
9638 }
9639 case CureType.HealComplete:
9640 case CureType.Death:
9641 case CureType.Jure:
9642 case CureType.Boss:
9643 case CureType.Unicorn:
9644 {
9645 CureTempElements(p * 100, body: true, mind: true);
9646 for (int num = conditions.Count - 1; num >= 0; num--)
9647 {
9648 Condition condition = conditions[num];
9649 if (condition is ConAnorexia && type != CureType.Death && type != CureType.Unicorn && type != CureType.Jure)
9650 {
9651 continue;
9652 }
9653 switch (condition.Type)
9654 {
9655 case ConditionType.Bad:
9656 case ConditionType.Debuff:
9657 case ConditionType.Disease:
9658 condition.Kill();
9659 continue;
9660 case ConditionType.Stance:
9661 if (type == CureType.Death)
9662 {
9663 condition.Kill();
9664 continue;
9665 }
9666 break;
9667 }
9668 if (type == CureType.Death && condition.isPerfume)
9669 {
9670 condition.Kill();
9671 }
9672 }
9673 CureCondition<ConWait>();
9674 CureCondition<ConSleep>();
9675 switch (type)
9676 {
9677 case CureType.Death:
9678 case CureType.Boss:
9679 case CureType.Unicorn:
9680 SAN.Mod(-20);
9681 RemoveCondition<ConBrightnessOfLife>();
9682 RemoveCondition<ConDeathSentense>();
9683 break;
9684 case CureType.Jure:
9685 SAN.Mod(-999);
9686 if (HasElement(1206))
9687 {
9688 SetFeat(1206, 0, msg: true);
9689 }
9690 RemoveCondition<ConBrightnessOfLife>();
9691 RemoveCondition<ConDeathSentense>();
9692 break;
9693 case CureType.CureBody:
9694 case CureType.CureMind:
9695 case CureType.Prayer:
9696 break;
9697 }
9698 break;
9699 }
9700 }
9701 }
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:10414
Stats SAN
Definition: Chara.cs:1160
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 9529 of file Chara.cs.

9529 : Condition
9530 {
9531 T condition = GetCondition<T>();
9532 if (condition != null)
9533 {
9534 condition.value -= v;
9535 if (condition.value <= 0)
9536 {
9537 condition.Kill();
9538 }
9539 }
9540 }
T GetCondition< T >()
Definition: Chara.cs:9542

◆ CureHost()

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

Definition at line 9566 of file Chara.cs.

9567 {
9568 if (parasite != null)
9569 {
9570 parasite.Cure(type, p, state);
9571 }
9572 if (ride != null)
9573 {
9574 ride.Cure(type, p, state);
9575 }
9576 Cure(type, p, state);
9577 }
void Cure(CureType type, int p=100, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:9579

References Cure().

Referenced by FactionBranch.DailyOutcome().

◆ CureTempElements()

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

Definition at line 10414 of file Chara.cs.

10415 {
10416 if (tempElements != null)
10417 {
10418 if (body)
10419 {
10421 }
10422 if (mind)
10423 {
10425 }
10426 }
10427 void Cure(int[] eles)
10428 {
10429 foreach (int ele in eles)
10430 {
10431 if (tempElements == null)
10432 {
10433 break;
10434 }
10435 Element element = tempElements.GetElement(ele);
10436 if (element != null && element.vBase < 0)
10437 {
10438 ModTempElement(ele, Mathf.Clamp(p / 20 + EClass.rnd(p / 20), 1, -element.vBase));
10439 }
10440 }
10441 }
10442 }
void ModTempElement(int ele, int a, bool naturalDecay=false, bool onlyRenew=false)
Definition: Chara.cs:10322
Element GetElement(string alias)
static int[] List_Body
Definition: ELEMENT.cs:249
static int[] List_Mind
Definition: ELEMENT.cs:251

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

◆ DamageTempElement()

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

Definition at line 10380 of file Chara.cs.

10381 {
10382 ModTempElement(ele, onlyRenew ? (-p / 20) : (-(p / 100 + EClass.rnd(p / 100 + 1) + 1)), naturalDecay: false, onlyRenew);
10383 }

References EClass.rnd().

◆ DamageTempElements()

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

Definition at line 10368 of file Chara.cs.

10369 {
10370 if (body)
10371 {
10372 DamageTempElement(Element.List_Body.RandomItem(), p, onlyRenew);
10373 }
10374 if (mind)
10375 {
10376 DamageTempElement(Element.List_Mind.RandomItem(), p, onlyRenew);
10377 }
10378 }
void DamageTempElement(int ele, int p, bool onlyRenew=false)
Definition: Chara.cs:10380

References Element.List_Body, and Element.List_Mind.

◆ DestroyPath()

void Chara.DestroyPath ( Point  pos)
inline

Definition at line 3208 of file Chara.cs.

3209 {
3210 bool broke = false;
3211 pos.ForeachMultiSize(base.W, base.H, delegate(Point _p, bool main)
3212 {
3213 if (_p.IsValid)
3214 {
3215 if (_p.HasBlock)
3216 {
3217 EClass._map.MineBlock(_p, recoverBlock: false, this);
3218 if (_p.HasObj)
3219 {
3220 EClass._map.MineObj(_p, null, this);
3221 }
3222 broke = true;
3223 }
3224 if (_p.HasObj && _p.IsBlocked)
3225 {
3226 EClass._map.MineObj(_p, null, this);
3227 broke = true;
3228 }
3229 _p.Things.ForeachReverse(delegate(Thing t)
3230 {
3231 if (t.IsInstalled && (t.trait.IsBlockPath || t.trait.IsDoor))
3232 {
3233 if (t.isNPCProperty && t.trait.CanBeDestroyed)
3234 {
3235 t.Destroy();
3236 }
3237 else if (!t.IsUnique && !t.trait.CanBeDestroyed)
3238 {
3239 t.SetPlaceState(PlaceState.roaming);
3240 }
3241 }
3242 });
3243 }
3244 });
3245 if (broke)
3246 {
3247 Msg.Say("stomp");
3248 Shaker.ShakeCam("stomp");
3249 }
3250 }
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
bool IsUnique
Definition: Card.cs:2092
void ForeachMultiSize(int w, int h, Action< Point, bool > action)
Definition: Point.cs:1385
bool IsBlocked
Definition: Point.cs:363
Definition: Shaker.cs:5
static void ShakeCam(string id="default", float magnitude=1f)
Definition: Shaker.cs:25
virtual bool IsBlockPath
Definition: Trait.cs:54
virtual bool IsDoor
Definition: Trait.cs:58

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

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

◆ Die()

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

Reimplemented from Card.

Definition at line 5350 of file Chara.cs.

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

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

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

◆ DiminishTempElements()

void Chara.DiminishTempElements ( int  a = 1)
inline

Definition at line 10399 of file Chara.cs.

10400 {
10401 if (tempElements == null)
10402 {
10403 return;
10404 }
10405 foreach (Element item in tempElements.dict.Values.ToList())
10406 {
10407 if (item.vBase > 0)
10408 {
10409 ModTempElement(item.id, -Mathf.Min(item.vBase * 5 / 100 + 1, item.vBase), naturalDecay: true);
10410 }
10411 }
10412 }

References ElementContainer.dict, and item.

◆ DoAI()

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

Definition at line 6309 of file Chara.cs.

6310 {
6311 SetAI(new DynamicAIAct("", delegate
6312 {
6313 onPerform();
6314 return true;
6315 })
6316 {
6317 wait = wait
6318 });
6319 }

◆ DoHostileAction()

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

Definition at line 6409 of file Chara.cs.

6410 {
6411 if (_tg == null || !_tg.isChara)
6412 {
6413 return;
6414 }
6415 Chara chara = _tg.Chara;
6416 if (chara.IsPC)
6417 {
6418 EClass.pc.combatCount = 10;
6419 }
6420 if (!chara.IsAliveInCurrentZone || !IsAliveInCurrentZone || chara == this)
6421 {
6422 return;
6423 }
6424 if ((IsPCFaction || IsPCFactionMinion) && (chara.IsPCFaction || chara.IsPCFactionMinion))
6425 {
6426 chara.Say("frown", this, chara);
6427 }
6428 else
6429 {
6430 if (EClass._zone.IsRegion)
6431 {
6432 return;
6433 }
6434 if (IsPC)
6435 {
6436 if (chara.IsFriendOrAbove() && !immediate)
6437 {
6438 chara.Say("frown", this, chara);
6439 chara.ShowEmo(Emo.sad);
6440 chara.hostility = Hostility.Neutral;
6441 return;
6442 }
6443 if (!chara.IsPCFaction && chara.hostility >= Hostility.Neutral && !EClass._zone.IsPCFaction)
6444 {
6445 bool flag = chara.id == "fanatic";
6446 if (EClass.rnd(4) == 0 || flag)
6447 {
6448 chara.Say("callHelp", chara);
6449 chara.CallHelp(this, flag);
6450 }
6451 }
6452 if (chara.hostility <= Hostility.Enemy)
6453 {
6454 foreach (Chara member in EClass.pc.party.members)
6455 {
6456 if (member != EClass.pc && member.enemy == null && member.CanSee(chara))
6457 {
6458 member.SetEnemy(chara);
6459 }
6460 }
6461 }
6462 }
6463 else if (chara.IsPC && hostility <= Hostility.Enemy)
6464 {
6465 foreach (Chara member2 in EClass.pc.party.members)
6466 {
6467 if (member2 != EClass.pc && member2.enemy == null && member2.CanSee(this))
6468 {
6469 member2.SetEnemy(this);
6470 }
6471 }
6472 }
6473 if (chara.calmCheckTurn <= 0 || IsPC)
6474 {
6475 chara.calmCheckTurn = (IsPC ? (20 + EClass.rnd(30)) : (10 + EClass.rnd(10)));
6476 }
6477 if (hostility != Hostility.Enemy || chara.hostility != Hostility.Enemy)
6478 {
6479 GoHostile(chara);
6480 chara.GoHostile(this);
6481 if (base.isHidden && !chara.CanSee(this) && !chara.IsDisabled && !chara.IsPCParty && !chara.IsPCPartyMinion && EClass.rnd(10 + Dist(chara) * 10) == 0)
6482 {
6483 Thing t = ThingGen.Create("49");
6484 ActThrow.Throw(chara, pos, t);
6485 Act.TC = chara;
6486 }
6487 }
6488 }
6489 }
static EffectIRenderer Throw(Card c, Point p, Thing t, ThrowMethod method=ThrowMethod.Default, float failChance=0f)
Definition: ActThrow.cs:97
override bool IsAliveInCurrentZone
Definition: Chara.cs:563
override bool IsPCPartyMinion
Definition: Chara.cs:641
int calmCheckTurn
Definition: Chara.cs:118
bool CanSee(Card c)
Definition: Chara.cs:1220
override bool IsPCFactionMinion
Definition: Chara.cs:657
bool IsFriendOrAbove()
Definition: Chara.cs:6686
Chara SetEnemy(Chara c=null)
Definition: Chara.cs:6360
void CallHelp(Chara tg, bool fanatic=false)
Definition: Chara.cs:6491
Hostility hostility
Definition: Chara.cs:293
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53

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

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

◆ Drink()

void Chara.Drink ( Card  t)
inline

Definition at line 5144 of file Chara.cs.

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

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

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

◆ DropHeld()

Card Chara.DropHeld ( Point  dropPos = null)
inline

Definition at line 4635 of file Chara.cs.

4636 {
4637 if (held == null)
4638 {
4639 return null;
4640 }
4641 if (IsPC)
4642 {
4643 WidgetHotbar.dirtyCurrentItem = true;
4645 }
4646 Card card = EClass._zone.AddCard(held, dropPos ?? pos);
4647 card.OnLand();
4648 if (card.trait.CanOnlyCarry)
4649 {
4650 card.SetPlaceState(PlaceState.installed);
4651 }
4652 return card;
4653 }
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 4655 of file Chara.cs.

4656 {
4657 if (t.c_isImportant)
4658 {
4659 Msg.Say("markedImportant");
4660 return;
4661 }
4662 if (!t.trait.CanBeDropped)
4663 {
4664 Msg.Say("cantDrop", t);
4665 return;
4666 }
4667 if (t.trait is TraitAbility)
4668 {
4669 SE.Trash();
4670 t.Destroy();
4671 return;
4672 }
4673 Msg.Say("dropItem", t.Name);
4674 t.ignoreAutoPick = true;
4675 PlaySound("drop");
4676 EClass._zone.AddCard(t, pos);
4677 if (t.trait.CanOnlyCarry)
4678 {
4679 t.Install();
4680 }
4681 }
Card Install()
Definition: Card.cs:3766
virtual bool CanBeDropped
Definition: Trait.cs:313

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

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

◆ Duplicate()

Chara Chara.Duplicate ( )
inline

Definition at line 1789 of file Chara.cs.

1790 {
1791 Chara chara = CharaGen.Create(id);
1792 chara.mana.value = mana.value;
1793 chara.stamina.value = stamina.value;
1794 foreach (KeyValuePair<int, Element> item in elements.dict)
1795 {
1796 Element orCreateElement = chara.elements.GetOrCreateElement(item.Key);
1797 orCreateElement.vBase = item.Value.ValueWithoutLink - orCreateElement.vSource;
1798 }
1799 chara.SetFaith(faith);
1800 chara.bio = IO.DeepCopy(bio);
1801 chara.LV = base.LV;
1802 chara.c_daysWithGod = base.c_daysWithGod;
1803 chara.RefreshFaithElement();
1804 chara.hp = (int)Mathf.Clamp((float)chara.MaxHP * ((float)base.hp / (float)MaxHP) * 0.99f, 0f, chara.MaxHP);
1805 chara.isCopy = true;
1806 chara.isScaled = base.isScaled;
1807 if (HaveFur())
1808 {
1809 chara.c_fur = -1;
1810 }
1811 return chara;
1812 }
bool HaveFur()
Definition: Card.cs:7943
Stats mana
Definition: Chara.cs:1156
void RefreshFaithElement()
Definition: Chara.cs:10279
void SetFaith(string id)
Definition: Chara.cs:1711
Element GetOrCreateElement(Element ele)
int vSource
Definition: ELEMENT.cs:267
Definition: IO.cs:11
virtual int value
Definition: Stats.cs:56

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

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

◆ EnhanceTempElement()

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

Definition at line 10394 of file Chara.cs.

10395 {
10396 ModTempElement(ele, onlyRenew ? (p / 20) : (p / 100 + EClass.rnd(p / 100 + 1)), naturalDecay: false, onlyRenew);
10397 }

References EClass.rnd().

◆ EnhanceTempElements()

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

Definition at line 10385 of file Chara.cs.

10386 {
10387 int[] array = (body ? Element.List_Body : Element.List_Mind);
10388 foreach (int ele in array)
10389 {
10390 EnhanceTempElement(ele, p, onlyRenew);
10391 }
10392 }
void EnhanceTempElement(int ele, int p, bool onlyRenew=false)
Definition: Chara.cs:10394

References Element.List_Mind.

◆ EQ_CAT()

void Chara.EQ_CAT ( string  s)
inline

Definition at line 5121 of file Chara.cs.

5122 {
5123 int slot = EClass.sources.categories.map[s].slot;
5124 BodySlot bodySlot = ((slot == 0) ? null : body.GetSlot(slot));
5125 if ((slot == 0 || bodySlot != null) && (slot != 37 || !HasElement(1209)))
5126 {
5127 SetEQQuality();
5128 Thing thing = ThingGen.CreateFromCategory(s, base.LV);
5129 AddThing(thing);
5130 if (bodySlot != null && !body.Equip(thing, bodySlot))
5131 {
5132 thing.Destroy();
5133 }
5134 }
5135 }
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:3123
bool Equip(Thing thing, BodySlot slot=null, bool msg=true)
Definition: CharaBody.cs:186
BodySlot GetSlot(Thing t, bool onlyEmpty=false, bool secondSlot=false)
Definition: CharaBody.cs:354
void SetEQQuality()
Definition: Chara.cs:5068
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 5101 of file Chara.cs.

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

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

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

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

◆ EvalueRiding()

int Chara.EvalueRiding ( )
inline

Definition at line 6220 of file Chara.cs.

6221 {
6222 if (ride != null && ride.HasCondition<ConTransmuteBroom>() && HasElement(1417))
6223 {
6224 return 25 + Evalue(226) * 125 / 100;
6225 }
6226 return Evalue(226);
6227 }

References HasCondition().

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

◆ FallFromZone()

void Chara.FallFromZone ( )
inline

Definition at line 3530 of file Chara.cs.

3531 {
3532 Msg.Say("skyFall", EClass.pc, EClass._zone.Name);
3533 Zone zone = (EClass._zone.isExternalZone ? null : EClass._zone.GetTopZone().FindZone(EClass._zone.lv - 1));
3534 zone = zone ?? EClass.world.region;
3536 {
3537 state = ZoneTransition.EnterState.Fall,
3538 x = pos.x,
3539 z = pos.z
3540 });
3541 }
void MoveZone(string alias)
Definition: Chara.cs:3355
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:1954

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

7894 {
7895 TraitToolRange ranged = weapon.trait as TraitToolRange;
7896 Thing thing = (IsPC ? EClass.pc.things.Find<TraitQuiver>() : null);
7897 if (thing != null)
7898 {
7899 Thing thing2 = thing.things.Find((Thing t) => ranged.IsAmmo(t));
7900 if (thing2 != null)
7901 {
7902 return thing2;
7903 }
7904 }
7905 return things.Find((Thing t) => ranged.IsAmmo(t));
7906 }
bool IsAmmo
Definition: Card.cs:2250
Thing ranged
Definition: Chara.cs:98

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

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

◆ FindBed()

TraitBed Chara.FindBed ( )
inline

Definition at line 7392 of file Chara.cs.

7393 {
7394 foreach (Card item in EClass._map.props.installed.all)
7395 {
7396 if (item.trait is TraitBed traitBed && traitBed.IsHolder(this))
7397 {
7398 return traitBed;
7399 }
7400 }
7401 return null;
7402 }

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

7625 {
7626 Thing result = null;
7627 int num = -1;
7628 if (IsPC)
7629 {
7630 return null;
7631 }
7632 foreach (Thing item in things.List((Thing t) => CanEat(t, shouldEat: true) && !t.c_isImportant, onlyAccessible: true))
7633 {
7634 int num2 = CountNumEaten(item);
7635 int num3 = 100 - num2 + (item.HasElement(757) ? 10 : 0);
7636 if (num3 > num)
7637 {
7638 result = item;
7639 num = num3;
7640 }
7641 }
7642 return result;
7643 }
bool CanEat(Thing t, bool shouldEat=false)
Definition: Chara.cs:7670
int CountNumEaten(Thing food)
Definition: Chara.cs:10250
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 2403 of file Chara.cs.

2404 {
2405 if (IsMinion)
2406 {
2407 master = EClass._map.FindChara(base.c_uidMaster);
2408 }
2409 return master;
2410 }
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 6575 of file Chara.cs.

6576 {
6577 for (int i = 0; i < EClass._map.charas.Count; i++)
6578 {
6579 Chara chara = EClass._map.charas[i];
6580 if (chara != this && chara != enemy && chara.mimicry == null && IsHostile(chara) && Dist(chara) <= 1 && CanInteractTo(chara.pos))
6581 {
6582 DoHostileAction(chara);
6583 enemy = chara;
6584 return true;
6585 }
6586 }
6587 return false;
6588 }
ConTransmuteMimic mimicry
Definition: Chara.cs:106
void DoHostileAction(Card _tg, bool immediate=false)
Definition: Chara.cs:6409

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

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

◆ FindNewEnemy()

bool Chara.FindNewEnemy ( )
inline

Definition at line 6502 of file Chara.cs.

6503 {
6504 if (EClass._zone.isPeace && base.IsPCFactionOrMinion && !IsPC)
6505 {
6506 return false;
6507 }
6508 if (enemy != null && !enemy.IsAliveInCurrentZone)
6509 {
6510 enemy = null;
6511 }
6512 if (enemy != null)
6513 {
6514 return false;
6515 }
6516 if (IsPCParty && EClass.pc.isHidden && base.isHidden)
6517 {
6518 return false;
6519 }
6520 if (mimicry != null)
6521 {
6522 return false;
6523 }
6524 bool flag = enemy != null || ai is GoalCombat;
6525 int num = (base.PER + Evalue(210) * 2) * ((!flag) ? 1 : 2);
6526 bool flag2 = IsPCParty && !IsPC && EClass.game.config.tactics.dontWander;
6527 bool flag3 = !IsPCParty;
6528 Chara chara = null;
6529 int num2 = 9999;
6530 for (int i = 0; i < EClass._map.charas.Count; i++)
6531 {
6532 Chara chara2 = EClass._map.charas[i];
6533 if (chara2 == this || !IsHostile(chara2) || !CanSee(chara2) || chara2.mimicry != null)
6534 {
6535 continue;
6536 }
6537 int num3 = Dist(chara2);
6538 int num4 = GetSightRadius() + (flag ? 1 : 0);
6539 if (num3 > num4)
6540 {
6541 continue;
6542 }
6543 if (flag3 && EClass.rnd(chara2.Evalue(152) + 5) * (100 + num3 * num3 * 10) / 100 > EClass.rnd(num))
6544 {
6545 if (this == pos.FirstChara)
6546 {
6547 chara2.ModExp(152, Mathf.Clamp((num - chara2.Evalue(152)) / 2, 1, Mathf.Max(30 - stealthSeen * 2, 1)));
6548 }
6549 stealthSeen++;
6550 }
6551 else if (CanSeeLos(chara2) && (!flag2 || EClass.pc.isBlind || EClass.pc.CanSeeLos(chara2)) && (!IsPCFaction || EClass.pc.ai.ShouldAllyAttack(chara2)))
6552 {
6553 if (!IsPCParty)
6554 {
6555 DoHostileAction(chara2);
6556 enemy = chara2;
6557 return true;
6558 }
6559 if (num3 < num2)
6560 {
6561 num2 = num3;
6562 chara = chara2;
6563 }
6564 }
6565 }
6566 if (chara != null)
6567 {
6568 DoHostileAction(chara);
6569 enemy = chara;
6570 return true;
6571 }
6572 return false;
6573 }
virtual bool ShouldAllyAttack(Chara tg)
Definition: AIAct.cs:134
int stealthSeen
Definition: Chara.cs:190
bool isPeace
Definition: Spatial.cs:406

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

Referenced by GoalCombat.Run().

◆ FindRoom()

Room Chara.FindRoom ( )
inline

Definition at line 8008 of file Chara.cs.

8009 {
8010 return FindBed()?.owner.pos.cell.room;
8011 }
TraitBed FindBed()
Definition: Chara.cs:7392

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

10166 {
10167 Element orCreateElement = elements.GetOrCreateElement(ele);
10168 if (orCreateElement.ValueWithoutLink == 0)
10169 {
10170 elements.ModBase(orCreateElement.id, 1);
10171 }
10172 if (orCreateElement is Spell)
10173 {
10174 int num = EClass.curve(Evalue(307), 50, 20) + (HasElement(307) ? 20 : 0);
10175 int num2 = origin?.Evalue(765) ?? 0;
10176 num = num * (100 - num2) / 100;
10177 int a = mtp * orCreateElement.source.charge * (100 + num) / 100 / 100;
10178 a = Mathf.Max(1, EClass.rndHalf(a));
10179 if (orCreateElement.source.charge == 1)
10180 {
10181 a = 1;
10182 }
10183 orCreateElement.vPotential += a;
10184 }
10185 Say("spell_gain", this, orCreateElement.Name);
10186 LayerAbility.SetDirty(orCreateElement);
10187 }
Element ModBase(int ele, int v)
virtual string Name
Definition: ELEMENT.cs:309
static void SetDirty(Element a)

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

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

◆ GetActionText()

string Chara.GetActionText ( )
inline

Definition at line 7336 of file Chara.cs.

7337 {
7338 string result = "?????";
7339 if (ai != null)
7340 {
7341 result = ai.GetCurrentActionText();
7342 }
7343 return result;
7344 }
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 7943 of file Chara.cs.

7944 {
7945 if (body.GetWeight(armorOnly: true) <= (HasElement(1204) ? 6000 : 30000))
7946 {
7947 return 120;
7948 }
7949 return 122;
7950 }
int GetWeight(bool armorOnly=false)
Definition: CharaBody.cs:421

References CharaBody.GetWeight().

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

◆ GetBestRangedWeapon()

Thing Chara.GetBestRangedWeapon ( )
inline

Definition at line 7908 of file Chara.cs.

7909 {
7910 Thing result = null;
7911 int num = 0;
7912 foreach (Thing thing in things)
7913 {
7914 if (thing.IsRangedWeapon && CanEquipRanged(thing) && thing.GetEquipValue() > num)
7915 {
7916 num = thing.GetEquipValue();
7917 result = thing;
7918 }
7919 }
7920 return result;
7921 }
int GetEquipValue()
Definition: Card.cs:7244
bool IsRangedWeapon
Definition: Card.cs:2246
bool CanEquipRanged(Thing t)
Definition: Chara.cs:7842

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

◆ GetBuffStats() [1/2]

Element Chara.GetBuffStats ( int  ele)
inline

Definition at line 9504 of file Chara.cs.

9505 {
9506 for (int i = 0; i < conditions.Count; i++)
9507 {
9508 if (conditions[i] is ConBuffStats conBuffStats && conBuffStats.refVal == ele)
9509 {
9510 return conBuffStats.elements.GetElement(ele);
9511 }
9512 }
9513 return null;
9514 }

References BaseCondition.refVal.

◆ GetBuffStats() [2/2]

Element Chara.GetBuffStats ( string  alias)
inline

Definition at line 9499 of file Chara.cs.

9500 {
9501 return GetBuffStats(EClass.sources.elements.alias[alias].id);
9502 }
Element GetBuffStats(string alias)
Definition: Chara.cs:9499

References SourceManager.elements, and EClass.sources.

Referenced by GoalCombat.TryUseAbility().

◆ GetBurden()

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

Definition at line 1814 of file Chara.cs.

1815 {
1816 int num2 = (base.ChildrenWeight + ((t != null) ? ((num == -1) ? t.ChildrenAndSelfWeight : (t.SelfWeight * num)) : 0)) * 100 / WeightLimit;
1817 if (num2 < 0)
1818 {
1819 num2 = 1000;
1820 }
1822 {
1823 num2 = 0;
1824 }
1825 int num3 = ((num2 >= 100) ? ((num2 - 100) / 10 + 1) : 0);
1826 if (num3 > 9)
1827 {
1828 num3 = 9;
1829 }
1830 return num3;
1831 }

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

◆ GetCondition< T >()

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

Definition at line 9542 of file Chara.cs.

9542 : Condition
9543 {
9544 for (int i = 0; i < conditions.Count; i++)
9545 {
9546 if (conditions[i] is T)
9547 {
9548 return conditions[i] as T;
9549 }
9550 }
9551 return null;
9552 }

◆ GetCooldown()

int Chara.GetCooldown ( int  idEle)
inline

Definition at line 8793 of file Chara.cs.

8794 {
8795 if (_cooldowns != null)
8796 {
8797 for (int i = 0; i < _cooldowns.Count; i++)
8798 {
8799 if (_cooldowns[i] / 1000 == idEle)
8800 {
8801 return _cooldowns[i] % 1000;
8802 }
8803 }
8804 }
8805 return 0;
8806 }

Referenced by NotificationCooldown.OnRefresh().

◆ GetCurrentDir()

int Chara.GetCurrentDir ( )
inline

Definition at line 3650 of file Chara.cs.

3651 {
3652 Debug.Log(angle);
3653 if (!renderer.hasActor)
3654 {
3655 if (angle == 0f || angle == 45f || angle == 90f)
3656 {
3657 return 2;
3658 }
3659 if (angle == -135f || angle == 180f || angle == -90f)
3660 {
3661 return 1;
3662 }
3663 if (angle == 135f)
3664 {
3665 return 0;
3666 }
3667 return 3;
3668 }
3669 return renderer.actor.currentDir;
3670 }
virtual int currentDir
Definition: CardActor.cs:41
float angle
Definition: Card.cs:72

References Debug.

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

◆ GetDestination()

Point Chara.GetDestination ( )
inline

Definition at line 7311 of file Chara.cs.

7312 {
7313 return (ai.IsRunning ? ai.GetDestination() : pos).Copy();
7314 }
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 4708 of file Chara.cs.

4709 {
4710 if (elements.Value(122) > elements.Value(120))
4711 {
4712 return elements.GetElement(122);
4713 }
4714 return elements.GetElement(120);
4715 }
int Value(int ele)

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

◆ GetFavAttackStyle()

AttackStyle Chara.GetFavAttackStyle ( )
inline

Definition at line 4683 of file Chara.cs.

4684 {
4685 int num = Evalue(131);
4686 int num2 = Evalue(130);
4687 int num3 = Evalue(123);
4688 if (num > num2 && num > num3)
4689 {
4690 return AttackStyle.TwoWield;
4691 }
4692 if (num2 > num && num2 > num3)
4693 {
4694 return AttackStyle.TwoHand;
4695 }
4696 if (num3 > num && num3 > num2)
4697 {
4698 return AttackStyle.Shield;
4699 }
4700 return AttackStyle.Default;
4701 }

Referenced by WindowChara.RefreshNote().

◆ GetFavCat()

SourceCategory.Row Chara.GetFavCat ( )
inline

Definition at line 8132 of file Chara.cs.

8133 {
8134 SourceCategory.Row r = null;
8135 if (_listFavCat.Count == 0)
8136 {
8137 foreach (SourceCategory.Row row in EClass.sources.categories.rows)
8138 {
8139 if (row.gift > 0)
8140 {
8141 _listFavCat.Add(row);
8142 }
8143 }
8144 }
8145 Rand.UseSeed(base.uid + EClass.game.seed, delegate
8146 {
8147 r = _listFavCat.RandomItem();
8148 });
8149 return r;
8150 }
static List< SourceCategory.Row > _listFavCat
Definition: Chara.cs:196
int seed
Definition: Game.cs:201
Definition: Rand.cs:4
static void UseSeed(int seed, Action action)
Definition: Rand.cs:22

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

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

◆ GetFavFood()

SourceThing.Row Chara.GetFavFood ( )
inline

Definition at line 8112 of file Chara.cs.

8113 {
8114 if (_listFavFood.Count == 0)
8115 {
8116 foreach (SourceThing.Row row in EClass.sources.things.rows)
8117 {
8118 if (row._origin == "dish" && row.value != 0 && row.chance != 0)
8119 {
8120 _listFavFood.Add(row);
8121 }
8122 }
8123 }
8124 SourceThing.Row r = null;
8125 Rand.UseSeed(base.uid + EClass.game.seed, delegate
8126 {
8127 r = _listFavFood.RandomItem();
8128 });
8129 return r;
8130 }
static List< SourceThing.Row > _listFavFood
Definition: Chara.cs:194
SourceThing things

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

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

◆ GetFavWeaponSkill()

Element Chara.GetFavWeaponSkill ( )
inline

Definition at line 4703 of file Chara.cs.

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

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

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

◆ GetFirstStep()

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

Definition at line 2589 of file Chara.cs.

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

8860 {
8861 if (IsPC)
8862 {
8863 return null;
8864 }
8865 switch (TimeTable.GetSpan(idTimeTable, hour))
8866 {
8867 case TimeTable.Span.Sleep:
8869 {
8870 return new GoalSleep();
8871 }
8872 break;
8873 case TimeTable.Span.Eat:
8874 return new GoalIdle();
8875 case TimeTable.Span.Work:
8876 if (IsGuest())
8877 {
8878 return new GoalIdle();
8879 }
8880 return GetGoalWork();
8881 case TimeTable.Span.Free:
8882 if (IsGuest())
8883 {
8884 return new GoalIdle();
8885 }
8886 return GetGoalHobby();
8887 }
8888 return null;
8889 }
Goal GetGoalWork()
Definition: Chara.cs:8891
Goal GetGoalHobby()
Definition: Chara.cs:8904
string idTimeTable
Definition: Chara.cs:470
static Span GetSpan(string id, int hour)
Definition: TimeTable.cs:45
bool isSimulating
Definition: Zone.cs:75

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

◆ GetGoalHobby()

Goal Chara.GetGoalHobby ( )
inline

Definition at line 8904 of file Chara.cs.

8905 {
8906 if (IsPrisoner)
8907 {
8908 return new GoalIdle();
8909 }
8910 if (memberType == FactionMemberType.Livestock)
8911 {
8912 return new GoalGraze();
8913 }
8914 return new GoalHobby();
8915 }
FactionMemberType
bool IsPrisoner
Definition: Chara.cs:1040

Referenced by Zone.Simulate().

◆ GetGoalWork()

Goal Chara.GetGoalWork ( )
inline

Definition at line 8891 of file Chara.cs.

8892 {
8893 if (IsPrisoner)
8894 {
8895 return new GoalIdle();
8896 }
8897 if (memberType == FactionMemberType.Livestock)
8898 {
8899 return new GoalGraze();
8900 }
8901 return new GoalWork();
8902 }

Referenced by Zone.Simulate().

◆ GetHappiness()

int Chara.GetHappiness ( )
inline

Definition at line 7321 of file Chara.cs.

7322 {
7323 int num = 50;
7324 if (FindBed() != null)
7325 {
7326 num += 50;
7327 }
7328 return num;
7329 }

◆ GetHireCost()

int Chara.GetHireCost ( )
inline

Definition at line 7316 of file Chara.cs.

7317 {
7318 return base.LV / 2 + 4;
7319 }

Referenced by CalcGold.Hire().

◆ GetHoverText()

override string Chara.GetHoverText ( )
inlinevirtual

Reimplemented from Card.

Definition at line 6838 of file Chara.cs.

6839 {
6840 if (mimicry != null)
6841 {
6842 return mimicry.thing.GetHoverText();
6843 }
6844 string text = base.Name;
6845 if (IsFriendOrAbove())
6846 {
6847 text = text.TagColor(EClass.Colors.colorFriend);
6848 }
6849 else if (IsHostile())
6850 {
6851 text = text.TagColor(EClass.Colors.colorHostile);
6852 }
6853 int num = 2;
6854 int lV = EClass.pc.LV;
6855 if (base.LV >= lV * 5)
6856 {
6857 num = 0;
6858 }
6859 else if (base.LV >= lV * 2)
6860 {
6861 num = 1;
6862 }
6863 else if (base.LV <= lV / 4)
6864 {
6865 num = 4;
6866 }
6867 else if (base.LV <= lV / 2)
6868 {
6869 num = 3;
6870 }
6871 string text2 = Lang.GetList("lvComparison")[num];
6872 text2 = (" (" + text2 + ") ").TagSize(14).TagColor(EClass.Colors.gradientLVComparison.Evaluate(0.25f * (float)num));
6873 string s = (IsFriendOrAbove() ? "HostilityAlly" : (IsNeutral() ? "HostilityNeutral" : "HostilityEnemy"));
6874 s = (" (" + s.lang() + ") ").TagSize(14);
6875 s = "";
6876 if (memberType == FactionMemberType.Guest)
6877 {
6878 s += (" (" + "guest".lang() + ") ").TagSize(14);
6879 }
6880 else if (memberType == FactionMemberType.Livestock)
6881 {
6882 s += (" (" + "livestock".lang() + ") ").TagSize(14);
6883 }
6884 if (!EClass.pc.IsMoving)
6885 {
6886 if (EClass.pc.HasHigherGround(this))
6887 {
6888 text2 += "lowerGround".lang();
6889 }
6890 else if (HasHigherGround(EClass.pc))
6891 {
6892 text2 += "higherGround".lang();
6893 }
6894 }
6895 if (Evalue(1232) > 0)
6896 {
6897 text2 = "milkBaby".lang().TagSize(14) + text2;
6898 }
6899 if (Guild.Fighter.ShowBounty(this) && Guild.Fighter.HasBounty(this))
6900 {
6901 text2 = "hasBounty".lang().TagSize(14) + text2;
6902 }
6903 if (EClass.pc.HasElement(481))
6904 {
6905 text2 += ("(" + faith.Name + ")").TagSize(14);
6906 }
6907 if (EClass.pc.HasElement(6607))
6908 {
6909 s += CraftUtil.GetBloodText(this).TagSize(14).TagColor(EClass.Colors.colorBlood);
6910 }
6911 return text + text2 + s;
6912 }
bool HasHigherGround(Card c)
Definition: Chara.cs:1192
override bool IsMoving
Definition: Chara.cs:610
bool IsNeutral()
Definition: Chara.cs:6637
Color colorHostile
Color colorBlood
Color colorFriend
Gradient gradientLVComparison
static string GetBloodText(Chara c)
Definition: CraftUtil.cs:117
bool ShowBounty(Chara c)
Definition: GuildFighter.cs:39
bool HasBounty(Chara c)
Definition: GuildFighter.cs:44
Definition: Guild.cs:2
static GuildFighter Fighter
Definition: Guild.cs:56
override string GetHoverText()
Definition: Thing.cs:790

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

Referenced by WidgetMouseover.Refresh().

◆ GetHoverText2()

override string Chara.GetHoverText2 ( )
inlinevirtual

Reimplemented from Card.

Definition at line 6914 of file Chara.cs.

6915 {
6916 if (mimicry != null)
6917 {
6918 return mimicry.thing.GetHoverText2();
6919 }
6920 string text = "";
6921 if (knowFav)
6922 {
6923 text += Environment.NewLine;
6924 text = text + "<size=14>" + "favgift".lang(GetFavCat().GetName().ToLower(), GetFavFood().GetName()) + "</size>";
6925 }
6926 string text2 = "";
6928 {
6929 text2 += Environment.NewLine;
6930 text2 = text2 + "Lv:" + base.LV + " HP:" + base.hp + "/" + MaxHP + " MP:" + mana.value + "/" + mana.max + " DV:" + DV + " PV:" + PV + " Hunger:" + hunger.value;
6931 text2 += Environment.NewLine;
6932 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");
6933 text2 += Environment.NewLine;
6934 text2 = text2 + base.uid + IsMinion + "/" + base.c_uidMaster + "/" + master;
6935 text2 = text2 + " dir:" + base.dir + " skin:" + base.idSkin + " scaled:" + base.isScaled;
6936 }
6938 {
6939 text2 += Environment.NewLine;
6940 text2 += "<size=14>";
6941 foreach (Hobby item in ListWorks())
6942 {
6943 text2 = text2 + item.Name + ", ";
6944 }
6945 foreach (Hobby item2 in ListHobbies())
6946 {
6947 text2 = text2 + item2.Name + ", ";
6948 }
6949 text2 = text2.TrimEnd(", ".ToCharArray()) + "</size>";
6950 }
6951 string text3 = "";
6952 IEnumerable<BaseStats> enumerable = conditions.Concat((!IsPCFaction) ? new BaseStats[0] : new BaseStats[2] { hunger, stamina });
6953 if (enumerable.Count() > 0)
6954 {
6955 text3 += Environment.NewLine;
6956 text3 += "<size=14>";
6957 int num = 0;
6958 foreach (BaseStats item3 in enumerable)
6959 {
6960 string text4 = item3.GetPhaseStr();
6961 if (text4.IsEmpty() || text4 == "#")
6962 {
6963 continue;
6964 }
6965 Color c = Color.white;
6966 switch (item3.source.group)
6967 {
6968 case "Bad":
6969 case "Debuff":
6970 case "Disease":
6972 break;
6973 case "Buff":
6975 break;
6976 }
6978 {
6979 text4 = text4 + "(" + item3.GetValue() + ")";
6980 if (resistCon != null && resistCon.ContainsKey(item3.id))
6981 {
6982 text4 = text4 + "{" + resistCon[item3.id] + "}";
6983 }
6984 }
6985 num++;
6986 text3 = text3 + text4.TagColor(c) + ", ";
6987 }
6988 if (num == 0)
6989 {
6990 text3 = "";
6991 }
6992 else
6993 {
6994 text = "";
6995 text3 = text3.TrimEnd(", ".ToCharArray()) + "</size>";
6996 }
6997 }
6999 {
7000 text3 += Environment.NewLine;
7001 foreach (ActList.Item item4 in ability.list.items)
7002 {
7003 text3 = text3 + item4.act.Name + ", ";
7004 }
7005 text3 = text3.TrimEnd(", ".ToCharArray());
7006 }
7007 return text + text2 + text3;
7008 }
override string ToString()
Definition: AIAct.cs:124
virtual string GetPhaseStr()
Definition: BaseStats.cs:47
virtual int GetValue()
Definition: BaseStats.cs:52
virtual string GetHoverText2()
Definition: Card.cs:7733
bool isScaled
Definition: Card.cs:915
SourceCategory.Row GetFavCat()
Definition: Chara.cs:8132
bool knowFav
Definition: Chara.cs:415
override string GetName(NameStyle style, int num=-1)
Definition: Chara.cs:1359
override int DV
Definition: Chara.cs:731
List< Hobby > ListHobbies(bool useMemberType=true)
Definition: Chara.cs:9047
override int PV
Definition: Chara.cs:760
SourceThing.Row GetFavFood()
Definition: Chara.cs:8112
List< Hobby > ListWorks(bool useMemberType=true)
Definition: Chara.cs:9020
Color colorDebuff
bool showExtra
Definition: CoreDebug.cs:168
Definition: Hobby.cs:5
SourceTactics tactics

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

Referenced by WidgetMouseover.Refresh().

◆ GetIdPortrait()

string Chara.GetIdPortrait ( )
inline

Definition at line 8214 of file Chara.cs.

8215 {
8216 if (id == "olderyoungersister")
8217 {
8218 if (base.idSkin != 2)
8219 {
8220 return "UN_olderyoungersister";
8221 }
8222 return "UN_olderyoungersister_alt";
8223 }
8224 if (Portrait.allIds.Contains("UN_" + id + ".png"))
8225 {
8226 return "UN_" + id;
8227 }
8228 return base.c_idPortrait;
8229 }
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 8200 of file Chara.cs.

8201 {
8202 string text = race.id;
8203 if ((text == "mifu" || text == "nefu") && EClass.rnd(2) == 0)
8204 {
8205 return "foxfolk";
8206 }
8207 if (trait is TraitGuard)
8208 {
8209 return "guard";
8210 }
8211 return "";
8212 }

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

7105 {
7106 return GetSprite();
7107 }
override Sprite GetSprite(int dir=0)
Definition: Chara.cs:6756

◆ GetName()

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

Reimplemented from Card.

Definition at line 1359 of file Chara.cs.

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

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

Referenced by TraitStoryBookHome.OnRead().

◆ GetNearbyCatToSniff()

Chara Chara.GetNearbyCatToSniff ( )
inline

Definition at line 8152 of file Chara.cs.

8153 {
8154 using (List<Chara>.Enumerator enumerator = pos.ListCharasInRadius(this, 3, (Chara c) => c != this && c.race.id == "cat").GetEnumerator())
8155 {
8156 if (enumerator.MoveNext())
8157 {
8158 return enumerator.Current;
8159 }
8160 }
8161 return null;
8162 }
List< Chara > ListCharasInRadius(Chara cc, int dist, Func< Chara, bool > func, bool onlyVisible=true)
Definition: Point.cs:1220

References race.

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

◆ GetPietyValue()

int Chara.GetPietyValue ( )
inline

Definition at line 10270 of file Chara.cs.

10271 {
10272 if (base._IsPC)
10273 {
10274 return 10 + (int)(Mathf.Sqrt(base.c_daysWithGod) * 2f + (float)Evalue(85)) / 2;
10275 }
10276 return 10 + (int)(Mathf.Sqrt(base.LV) * 5f + (float)Evalue(306)) / 2;
10277 }

◆ GetRevived()

void Chara.GetRevived ( )
inline

Definition at line 5160 of file Chara.cs.

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

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

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

◆ GetRoomWork()

BaseArea Chara.GetRoomWork ( )
inline

Definition at line 8998 of file Chara.cs.

8999 {
9000 BaseArea result = null;
9001 foreach (Hobby item in ListWorks())
9002 {
9003 AIWork aI = item.GetAI(this);
9004 if (aI.SetDestination())
9005 {
9006 if (aI.destArea != null)
9007 {
9008 result = aI.destArea;
9009 }
9010 else if (aI.destThing != null)
9011 {
9012 result = aI.destThing.pos.cell.room;
9013 }
9014 break;
9015 }
9016 }
9017 return result;
9018 }
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 6756 of file Chara.cs.

6757 {
6758 if (IsPCC)
6759 {
6760 PCC pCC = PCC.Get(pccData);
6761 pCC.Build();
6762 return pCC.variation.idle[0, 0];
6763 }
6764 if (spriteReplacer != null)
6765 {
6766 return spriteReplacer.data.GetSprite();
6767 }
6768 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);
6769 }
SpriteReplacer spriteReplacer
Definition: Chara.cs:156
override CardRow sourceCard
Definition: Chara.cs:452
int[] _tiles
Definition: RenderRow.cs:12
Sprite GetSprite(int dir=0, int skin=0, bool snow=false)
Definition: RenderRow.cs:261
Sprite GetSprite(bool snow=false)
Definition: SpriteData.cs:67
SpriteData data

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

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

◆ GetSubPassData()

override SubPassData Chara.GetSubPassData ( )
inlinevirtual

Reimplemented from Card.

Definition at line 6780 of file Chara.cs.

6781 {
6782 if (IsPCC)
6783 {
6785 {
6787 }
6788 }
6789 else if (conSleep != null && host == null && pos.Equals(EClass.pc.pos) && IsHuman && (GetBool(123) || affinity.CanSleepBeside()))
6790 {
6791 return EClass.setting.pass.subDead;
6792 }
6793 return SubPassData.Default;
6794 }
bool GetBool(int id)
Definition: BaseCard.cs:15
ConSleep conSleep
Definition: Chara.cs:102
override bool IsDeadOrSleeping
Definition: Chara.cs:575
PassSetting pass
Definition: GameSetting.cs:303
bool altHeldPos
Definition: Player.cs:1153
static SubPassData Default
Definition: SubPassData.cs:7

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

◆ GetTextHappiness()

string Chara.GetTextHappiness ( )
inline

Definition at line 7331 of file Chara.cs.

7332 {
7333 return GetHappiness().ToString() ?? "";
7334 }
int GetHappiness()
Definition: Chara.cs:7321

◆ GetTextHobby()

string Chara.GetTextHobby ( bool  simple = false)
inline

Definition at line 9136 of file Chara.cs.

9137 {
9138 string text = (simple ? "" : ("hobby".lang() + ":"));
9139 foreach (Hobby item in ListHobbies())
9140 {
9141 text = text + " " + item.Name.TagColor((item.GetEfficiency(this) > 0) ? FontColor.Good : FontColor.Warning) + ",";
9142 }
9143 return text.TrimEnd(',');
9144 }

References item.

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

◆ GetTextWork()

string Chara.GetTextWork ( bool  simple = false)
inline

Definition at line 9146 of file Chara.cs.

9147 {
9148 string text = (simple ? "" : ("work".lang() + ":"));
9149 foreach (Hobby item in ListWorks())
9150 {
9151 text = text + " " + item.Name.TagColor((item.GetEfficiency(this) > 0) ? FontColor.Good : FontColor.Warning) + ",";
9152 }
9153 return text.TrimEnd(',');
9154 }

References item.

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

◆ GetTopicText()

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

Definition at line 7010 of file Chara.cs.

7011 {
7012 string key = source.idText.IsEmpty(id);
7013 if (id == "littleOne" && EClass._zone is Zone_LittleGarden)
7014 {
7015 key = "littleOne2";
7016 }
7017 SourceCharaText.Row row = EClass.sources.charaText.map.TryGetValue(key);
7018 if (row == null)
7019 {
7020 return null;
7021 }
7022 string text = row.GetText(topic, returnNull: true);
7023 if (text.IsEmpty())
7024 {
7025 return null;
7026 }
7027 if (text.StartsWith("@"))
7028 {
7029 row = EClass.sources.charaText.map.TryGetValue(text.Replace("@", ""));
7030 if (row == null)
7031 {
7032 return null;
7033 }
7034 text = row.GetText(topic, returnNull: true);
7035 if (text.IsEmpty())
7036 {
7037 return null;
7038 }
7039 }
7040 return text.Split(Environment.NewLine.ToCharArray()).RandomItem();
7041 }
SourceCharaText charaText

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

◆ GetTotalFeat()

int Chara.GetTotalFeat ( )
inline

Definition at line 8174 of file Chara.cs.

8175 {
8176 int num = 0;
8177 if (base.c_upgrades != null)
8178 {
8179 num += base.c_upgrades.spent;
8180 }
8181 if (base.c_genes != null)
8182 {
8183 num += base.c_genes.GetTotalCost();
8184 }
8185 return num + base.feat;
8186 }

◆ GetWork()

Hobby Chara.GetWork ( string  id)
inline

Definition at line 9067 of file Chara.cs.

9068 {
9069 foreach (Hobby item in ListWorks())
9070 {
9071 if (item.source.alias == id)
9072 {
9073 return item;
9074 }
9075 }
9076 foreach (Hobby item2 in ListHobbies())
9077 {
9078 if (item2.source.alias == id)
9079 {
9080 return item2;
9081 }
9082 }
9083 return null;
9084 }
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 9219 of file Chara.cs.

9220 {
9221 if (_workSummary == null)
9222 {
9223 _workSummary = new WorkSummary();
9224 }
9225 return _workSummary;
9226 }
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 8313 of file Chara.cs.

8314 {
8315 if (c.IsHostile() || c.IsDeadOrSleeping)
8316 {
8317 Msg.Say("affinityNone", c, this);
8318 return;
8319 }
8320 if (!t.isCopy && t.IsCursed && t.IsEquipmentOrRanged && !t.IsAmmo && c.HasElement(1414))
8321 {
8322 bool num = t.blessedState == BlessedState.Doomed;
8323 int num2 = 200 + t.LV * 3;
8324 if (t.rarity == Rarity.Legendary)
8325 {
8326 num2 *= 3;
8327 }
8328 if (t.rarity >= Rarity.Mythical)
8329 {
8330 num2 *= 5;
8331 }
8332 if (num)
8333 {
8334 num2 *= 2;
8335 }
8336 EClass.pc.PlayEffect("identify");
8337 EClass.pc.PlaySound("identify");
8338 c.PlayEffect("mutation");
8339 c.Say("draw_curse", c, t);
8340 t.Destroy();
8341 List<Element> list = new List<Element>();
8342 foreach (Element value in EClass.pc.elements.dict.Values)
8343 {
8344 if (value is Spell)
8345 {
8346 list.Add(value);
8347 }
8348 }
8349 if (list.Count == 0)
8350 {
8352 return;
8353 }
8354 Element element = list.RandomItem();
8355 EClass.pc.ModExp(element.id, num2);
8356 EClass.pc.Say("draw_curse2", EClass.pc, element.Name);
8357 c.AddExp(Mathf.Min(num2 / 3, c.ExpToNext));
8358 return;
8359 }
8360 if ((t.id == "lovepotion" || t.id == "dreambug") && !Application.isEditor)
8361 {
8362 GiveLovePotion(c, t);
8363 return;
8364 }
8365 if (t.trait is TraitErohon && c.id == t.c_idRefName)
8366 {
8367 c.OnGiveErohon(t);
8368 return;
8369 }
8370 if (t.trait is TraitTicketMassage)
8371 {
8372 t.ModNum(-1);
8373 c.Talk("ticket");
8374 switch (t.id)
8375 {
8376 case "ticket_massage":
8377 c.ModAffinity(EClass.pc, 10);
8379 {
8380 target = c
8381 });
8382 break;
8383 case "ticket_armpillow":
8384 c.ModAffinity(EClass.pc, 20);
8385 EClass.pc.AddCondition<ConSleep>(300, force: true);
8386 c.SetAI(new AI_ArmPillow
8387 {
8388 target = EClass.pc
8389 });
8390 break;
8391 case "ticket_champagne":
8392 c.ModAffinity(EClass.pc, 10);
8394 break;
8395 }
8396 return;
8397 }
8398 if (t.id == "flyer")
8399 {
8400 stamina.Mod(-1);
8401 if (c.things.Find((Thing a) => a.id == "flyer") != null)
8402 {
8403 c.Talk("flyer_miss");
8404 DoHostileAction(c);
8405 return;
8406 }
8407 if (EClass.rnd(20) != 0 && c.CHA > EClass.rnd(base.CHA + Evalue(291) * 3 + 10))
8408 {
8409 Msg.Say("affinityNone", c, this);
8410 t.Destroy();
8411 elements.ModExp(291, 10f);
8412 return;
8413 }
8414 elements.ModExp(291, 50f);
8415 }
8416 if (t.id == "statue_weird")
8417 {
8418 EClass.pc.Say("statue_sell");
8419 }
8420 t.isGifted = true;
8421 c.nextUse = c.affinity.OnGift(t);
8422 if (!t.isDestroyed)
8423 {
8424 EClass.game.quests.list.ForeachReverse(delegate(Quest q)
8425 {
8426 q.OnGiveItem(c, t);
8427 });
8428 if (c.TryEquip(t))
8429 {
8430 c.nextUse = null;
8431 }
8432 }
8433 }
Thing OnGift(Thing t)
Definition: Affinity.cs:129
int ExpToNext
Definition: Card.cs:2009
bool isCopy
Definition: Card.cs:879
bool IsCursed
Definition: Card.cs:2258
int CHA
Definition: Card.cs:2350
bool IsEquipmentOrRanged
Definition: Card.cs:2221
void SayNothingHappans()
Definition: Card.cs:6886
string c_idRefName
Definition: Card.cs:1642
void AddExp(int a, bool applyMod=true)
Definition: Card.cs:2970
void GiveLovePotion(Chara c, Thing t)
Definition: Chara.cs:8446
bool TryEquip(Thing t, bool useFav=false)
Definition: Chara.cs:7803
void OnGiveErohon(Thing t)
Definition: Chara.cs:8435
QuestManager quests
Definition: Game.cs:183
List< Quest > list
Definition: QuestManager.cs:11
Definition: Quest.cs:7
virtual void OnGiveItem(Chara c, Thing t)
Definition: Quest.cs:536

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

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

◆ GiveLovePotion()

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

Definition at line 8446 of file Chara.cs.

8447 {
8448 c.Say("give_love", c, t);
8449 c.PlaySound(t.material.GetSoundDead());
8450 c.ShowEmo(Emo.angry);
8451 c.ModAffinity(EClass.pc, -20, show: false);
8452 c.Talk("pervert");
8453 t.Destroy();
8454 }

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

6386 {
6387 if (enemy == null && !IsPC)
6388 {
6389 if (GetInt(106) == 0)
6390 {
6391 TalkTopic("aggro");
6392 }
6393 if (OriginalHostility != Hostility.Enemy)
6394 {
6395 ShowEmo(Emo.angry);
6396 }
6397 SetEnemy(_tg.Chara);
6398 }
6400 {
6401 if (hostility >= Hostility.Neutral)
6402 {
6403 Say("angry", this);
6404 }
6405 hostility = Hostility.Enemy;
6406 }
6407 }
int GetInt(int id, int? defaultInt=null)
Definition: BaseCard.cs:25
virtual bool IsPCFactionMinion
Definition: Card.cs:2158

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

Referenced by CallHelp(), and DoHostileAction().

◆ HasAccess() [1/2]

bool Chara.HasAccess ( Card  c)
inline

Definition at line 1282 of file Chara.cs.

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

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

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

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

9476 {
9477 for (int i = 0; i < conditions.Count; i++)
9478 {
9479 if (conditions[i] is T)
9480 {
9481 return true;
9482 }
9483 }
9484 return false;
9485 }

◆ HasCooldown()

bool Chara.HasCooldown ( int  idEle)
inline

Definition at line 8788 of file Chara.cs.

8789 {
8790 return GetCooldown(idEle) != 0;
8791 }
int GetCooldown(int idEle)
Definition: Chara.cs:8793

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

◆ HasHigherGround()

bool Chara.HasHigherGround ( Card  c)
inline

Definition at line 1192 of file Chara.cs.

1193 {
1194 if (c == null)
1195 {
1196 return false;
1197 }
1198 float num = renderer.position.y - pos.Position(0).y + (_isLevitating ? 0.4f : 0f);
1199 float num2 = c.renderer.position.y - c.pos.Position(0).y + ((c.isChara && c.Chara._isLevitating) ? 0.4f : 0f);
1200 return num > num2 + 0.1f;
1201 }
bool _isLevitating
Definition: Chara.cs:136
ref Vector3 Position(int height)
Definition: Point.cs:548

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

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

◆ HasHobbyOrWork()

bool Chara.HasHobbyOrWork ( string  alias)
inline

Definition at line 8917 of file Chara.cs.

8918 {
8919 int num = EClass.sources.hobbies.alias.TryGetValue(alias)?.id ?? 0;
8920 listHobby.Clear();
8921 if (_works == null || _hobbies == null)
8922 {
8923 RerollHobby();
8924 }
8925 foreach (int work in _works)
8926 {
8927 if (work == num)
8928 {
8929 return true;
8930 }
8931 }
8932 foreach (int hobby in _hobbies)
8933 {
8934 if (hobby == num)
8935 {
8936 return true;
8937 }
8938 }
8939 return false;
8940 }
static List< Hobby > listHobby
Definition: Chara.cs:13
void RerollHobby(bool extraSlotChance=true)
Definition: Chara.cs:9180
SourceHobby hobbies

References SourceManager.hobbies, and EClass.sources.

Referenced by AI_Idle.Run().

◆ HasMinion()

bool Chara.HasMinion ( string  id)
inline

Definition at line 2368 of file Chara.cs.

2369 {
2370 foreach (Chara chara in EClass._map.charas)
2371 {
2372 if (chara.c_uidMaster == base.uid)
2373 {
2374 return true;
2375 }
2376 }
2377 return false;
2378 }

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

Referenced by ActEffect.ProcAt().

◆ HealAll()

void Chara.HealAll ( )
inline

Definition at line 1722 of file Chara.cs.

1723 {
1724 Cure(CureType.HealComplete);
1725 base.hp = MaxHP;
1726 mana.value = mana.max;
1727 stamina.value = stamina.max;
1728 Refresh();
1729 }
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 4506 of file Chara.cs.

4507 {
4508 if (held == t || t.isDestroyed || t.Num <= 0)
4509 {
4510 return;
4511 }
4512 if (IsPC && t.isNPCProperty)
4513 {
4514 t.isNPCProperty = false;
4516 pos.TryWitnessCrime(this);
4517 }
4518 PickHeld();
4519 if (t.isChara)
4520 {
4522 {
4523 t.ShowEmo(Emo.love);
4524 }
4525 EClass.player.altHeldPos = t.renderer.data.ForceAltHeldPosition || EClass.rnd(2) == 0;
4526 }
4527 else
4528 {
4529 if (num == -1 || num > t.Num)
4530 {
4531 num = t.Num;
4532 }
4533 if (num < t.Num)
4534 {
4535 t = t.Split(num);
4536 }
4537 }
4538 if (t.GetRootCard() != this)
4539 {
4540 t = Pick(t.Thing, msg: false, tryStack: false);
4541 if (t.GetRootCard() != this)
4542 {
4543 return;
4544 }
4545 }
4546 held = t;
4547 if (held.GetLightRadius() > 0)
4548 {
4550 }
4551 if (IsPC)
4552 {
4554 WidgetHotbar.dirtyCurrentItem = true;
4555 }
4556 }
Thing Split(int a)
Definition: Card.cs:3509
bool isNPCProperty
Definition: Card.cs:555
void RecalculateFOV()
Definition: Card.cs:6430
virtual bool IsAliveInCurrentZone
Definition: Card.cs:2128
int GetLightRadius()
Definition: Card.cs:6477
void PickHeld(bool msg=false)
Definition: Chara.cs:4558
bool TryWitnessCrime(Chara criminal, Chara target=null, int radius=4, Func< Chara, bool > funcWitness=null)
Definition: Point.cs:873

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

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

◆ InitStats()

void Chara.InitStats ( bool  onDeserialize = false)
inline

Definition at line 9303 of file Chara.cs.

9304 {
9305 if (!onDeserialize)
9306 {
9307 _cints[10] = 20;
9308 _cints[11] = 70;
9309 _cints[13] = 70;
9310 _cints[14] = 70;
9311 _cints[15] = 70;
9312 _cints[17] = 0;
9313 _cints[18] = 0;
9314 }
9315 foreach (Condition condition in conditions)
9316 {
9317 condition.SetOwner(this, onDeserialize);
9318 }
9319 }
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 7645 of file Chara.cs.

7646 {
7647 if (t == null)
7648 {
7649 t = FindBestFoodToEat();
7650 }
7651 if (t == null)
7652 {
7653 t = things.Find((Thing a) => CanEat(a, shouldEat: true) && !a.c_isImportant);
7654 }
7655 if (t == null)
7656 {
7657 t = things.Find((Thing a) => CanEat(a) && !a.c_isImportant);
7658 }
7659 if (t != null)
7660 {
7661 Say("eat_start", this, t.Duplicate(1));
7662 if (sound)
7663 {
7664 PlaySound("eat");
7665 }
7666 FoodEffect.Proc(this, t);
7667 }
7668 }
Thing FindBestFoodToEat()
Definition: Chara.cs:7624
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 6647 of file Chara.cs.

6648 {
6649 if (faction == EClass.Home)
6650 {
6651 return homeZone == EClass.game.activeZone;
6652 }
6653 return false;
6654 }
Faction faction
Definition: Chara.cs:429
Zone activeZone
Definition: Game.cs:252

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

◆ IsCriticallyWounded()

bool Chara.IsCriticallyWounded ( bool  includeRide = false)
inline

Definition at line 1179 of file Chara.cs.

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

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

2513 {
2514 if (!currentZone.IsRegion && p.IsValid)
2515 {
2516 CellDetail detail = p.detail;
2517 if (detail != null && detail.charas.Count > 0)
2518 {
2519 foreach (Chara chara in p.detail.charas)
2520 {
2521 if (chara.mimicry == null && (chara.IsHostile(this) || chara.IsHostile() || !chara.trait.CanBePushed))
2522 {
2523 if (cancelAI && EClass.pc.ai is GoalManualMove)
2524 {
2525 EClass.pc.ai.Cancel();
2526 }
2527 return true;
2528 }
2529 }
2530 }
2531 }
2532 return false;
2533 }
List< Chara > charas
Definition: CellDetail.cs:13
CellDetail detail
Definition: Point.cs:71

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

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

◆ IsEscorted()

bool Chara.IsEscorted ( )
inline

Definition at line 2412 of file Chara.cs.

2413 {
2414 if (!IsPCPartyMinion)
2415 {
2416 return false;
2417 }
2418 foreach (Quest item in EClass.game.quests.list)
2419 {
2420 if (item is QuestEscort questEscort && questEscort.uidChara == base.uid)
2421 {
2422 return true;
2423 }
2424 }
2425 return false;
2426 }
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 6691 of file Chara.cs.

6692 {
6693 if (base.IsPCFactionOrMinion || IsFriendOrAbove())
6694 {
6696 {
6697 return true;
6698 }
6699 }
6700 else if (IsHostile() && c.IsHostile())
6701 {
6702 return true;
6703 }
6704 return false;
6705 }

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

◆ IsGuest()

◆ IsHomeMember()

◆ IsHostile() [1/2]

◆ IsHostile() [2/2]

bool Chara.IsHostile ( Chara  c)
inline

Definition at line 6595 of file Chara.cs.

6596 {
6597 if (c == null)
6598 {
6599 return false;
6600 }
6601 if (base.IsPCFactionOrMinion)
6602 {
6603 if ((c == EClass.pc.enemy && !c.IsPCFactionOrMinion) || c.hostility <= Hostility.Enemy)
6604 {
6605 return true;
6606 }
6607 }
6608 else
6609 {
6611 {
6612 return true;
6613 }
6614 if (OriginalHostility >= Hostility.Friend)
6615 {
6616 if (hostility <= Hostility.Enemy && c.IsPCFactionOrMinion)
6617 {
6618 return true;
6619 }
6620 if (c.hostility <= Hostility.Enemy && c.OriginalHostility == Hostility.Enemy)
6621 {
6622 return true;
6623 }
6624 }
6625 else if (OriginalHostility <= Hostility.Enemy && (c.IsPCFactionOrMinion || (c.OriginalHostility != Hostility.Enemy && c.hostility >= Hostility.Friend)))
6626 {
6627 return true;
6628 }
6629 }
6630 if (id == "unicorn" && (Evalue(418) < 0 || (c.HasElement(1216) && c.Evalue(418) < 1)))
6631 {
6632 return true;
6633 }
6634 return false;
6635 }
bool IsCriminal
Definition: Player.cs:1339

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

◆ IsInHomeZone()

bool Chara.IsInHomeZone ( )
inline

Definition at line 6661 of file Chara.cs.

6662 {
6663 return EClass.game.activeZone == currentZone;
6664 }

Referenced by BaseListPeople.IsDisabled().

◆ IsInSpot< T >()

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

Definition at line 6666 of file Chara.cs.

6666 : TraitSpot
6667 {
6668 foreach (T item in EClass._map.props.installed.traits.List<T>())
6669 {
6670 foreach (Point item2 in item.ListPoints())
6671 {
6672 if (pos.Equals(item2))
6673 {
6674 return true;
6675 }
6676 }
6677 }
6678 return false;
6679 }
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 6637 of file Chara.cs.

6638 {
6639 return hostility == Hostility.Neutral;
6640 }

Referenced by ActPlan._Update().

◆ IsNeutralOrAbove()

bool Chara.IsNeutralOrAbove ( )
inline

◆ IsValidGiftWeight()

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

Definition at line 8257 of file Chara.cs.

8258 {
8259 int num2 = ((!HasElement(1411)) ? 1 : 3);
8260 if (GetBurden(t, num) >= num2)
8261 {
8262 return false;
8263 }
8264 return true;
8265 }
int GetBurden(Card t=null, int num=-1)
Definition: Chara.cs:1814

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

5839 {
5841 {
5842 return;
5843 }
5844 if (t.IsPC)
5845 {
5847 }
5848 if (t.host != null)
5849 {
5850 return;
5851 }
5852 if (t == this)
5853 {
5854 if (!ignoreSelf)
5855 {
5856 Debug.Log(t.pos.GetNearestPoint());
5857 if (TryMove(t.pos.GetNearestPoint()) != MoveResult.Success)
5858 {
5860 }
5861 }
5862 return;
5863 }
5864 if (show)
5865 {
5866 Say("kick", this, t);
5867 }
5868 PlaySound("kick");
5869 if ((t.conSuspend == null || t.conSuspend.uidMachine != 0) && t.trait.CanBePushed && (!t.IsHostile() || EClass.rnd(2) == 0) && !t.noMove && !t.isRestrained)
5870 {
5871 t.MoveByForce(t.pos.GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: true, ignoreCenter: true), this, checkWall && !t.pos.IsBlocked);
5872 }
5873 if (t.conSleep != null)
5874 {
5875 t.conSleep.Kill();
5876 }
5877 if (IsPC && t.IsFriendOrAbove() && !t.IsPCFactionOrMinion && karmaLoss)
5878 {
5880 }
5881 t.PlayEffect("kick");
5882 t.mimicry?.RevealMimicry(this, surprise: false);
5883 }
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:5874
ConSuspend conSuspend
Definition: Chara.cs:104
MoveResult TryMove(Point newPoint, bool allowDestroyPath=true)
Definition: Chara.cs:2736
int uidMachine
Definition: ConSuspend.cs:6
virtual void RevealMimicry(Card c, bool surprise)

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(), mimicry, Player.ModKarma(), MoveByForce(), Card.MoveImmediate(), Card.noMove, Card.PlayEffect(), EClass.player, Card.pos, ConTransmuteMimic.RevealMimicry(), EClass.rnd(), trait, and ConSuspend.uidMachine.

◆ Kick() [2/2]

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

Definition at line 5830 of file Chara.cs.

5831 {
5832 foreach (Chara item in p.ListCharas())
5833 {
5834 Kick(item, ignoreSelf, karmaLoss: true, show: true, checkWall);
5835 }
5836 }

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

9951 {
9952 List<Element> list = new List<Element>();
9953 foreach (SourceElement.Row item in EClass.sources.elements.rows.Where((SourceElement.Row a) => a.group == "FEAT" && a.cost[0] != -1 && !a.categorySub.IsEmpty()))
9954 {
9956 int num = ((feat.ValueWithoutLink <= 0) ? 1 : (feat.ValueWithoutLink + 1));
9957 if (num <= feat.source.max && !feat.HasTag("class") && !feat.HasTag("hidden") && !feat.HasTag("innate") && (!pet || !feat.HasTag("noPet")) && (showAll || feat.IsPurchaseFeatReqMet(elements)))
9958 {
9959 list.Add(Element.Create(feat.id, num) as Feat);
9960 }
9961 }
9962 return list;
9963 }
int feat
Definition: Card.cs:375
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1107
Definition: FEAT.cs:308

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

9048 {
9049 listHobby.Clear();
9050 if (!useMemberType || memberType != FactionMemberType.Livestock)
9051 {
9052 if (_hobbies == null)
9053 {
9054 RerollHobby();
9055 }
9056 foreach (int hobby in _hobbies)
9057 {
9058 listHobby.Add(new Hobby
9059 {
9060 id = hobby
9061 });
9062 }
9063 }
9064 return listHobby;
9065 }

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

9021 {
9022 listHobby.Clear();
9023 if (useMemberType && memberType == FactionMemberType.Livestock)
9024 {
9025 listHobby.Add(new Hobby
9026 {
9027 id = 45
9028 });
9029 }
9030 else
9031 {
9032 if (_works == null)
9033 {
9034 RerollHobby();
9035 }
9036 foreach (int work in _works)
9037 {
9038 listHobby.Add(new Hobby
9039 {
9040 id = work
9041 });
9042 }
9043 }
9044 return listHobby;
9045 }

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

3570 {
3571 angle = Util.GetAngle(p.x - pos.x, p.z - pos.z);
3572 if (EClass._zone.IsRegion)
3573 {
3574 if (angle > 100f && angle < 170f)
3575 {
3576 base.dir = 2;
3577 }
3578 else if (angle > 170f && angle < 190f)
3579 {
3580 base.dir = 0;
3581 }
3582 else if (angle > 190f || (angle < -10f && angle > -100f))
3583 {
3584 base.dir = 3;
3585 }
3586 else
3587 {
3588 base.dir = 1;
3589 }
3590 angle -= 45f;
3591 }
3592 else if (angle > 170f && angle < 235f)
3593 {
3594 base.dir = 0;
3595 }
3596 else if (angle > 80f && angle < 145f)
3597 {
3598 base.dir = 1;
3599 }
3600 else if (angle > -100f && angle < -35f)
3601 {
3602 base.dir = 3;
3603 }
3604 else if (angle > -10f && angle < 55f)
3605 {
3606 base.dir = 2;
3607 }
3609 }

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

◆ MakeAlly()

void Chara.MakeAlly ( bool  msg = true)
inline

Definition at line 2294 of file Chara.cs.

2295 {
2296 if (IsLocalChara && !base.IsUnique)
2297 {
2298 Debug.Log("Creating Replacement NPC for:" + this);
2300 }
2301 _MakeAlly();
2302 if (msg)
2303 {
2304 EClass.pc.Say("hire", this);
2305 EClass.Sound.Play("good");
2306 }
2307 EClass.pc.party.AddMemeber(this);
2308 if (EClass._zone.IsTown)
2309 {
2311 }
2312 }
Chara CreateReplacement()
Definition: Chara.cs:8091
void _MakeAlly()
Definition: Chara.cs:2314
virtual bool IsTown
Definition: Zone.cs:223
void RefreshListCitizen()
Definition: Zone.cs:3599

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

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

References DNA.GenerateGene().

◆ MakeGene()

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

Definition at line 8231 of file Chara.cs.

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

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

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

◆ MakeGrave()

void Chara.MakeGrave ( string  lastword)
inline

Definition at line 5267 of file Chara.cs.

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

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

2358 {
2359 ReleaseMinion();
2360 Hostility hostility2 = (base.c_originalHostility = (_master.IsPCFaction ? Hostility.Ally : _master.hostility));
2361 this.hostility = hostility2;
2362 base.c_uidMaster = _master.uid;
2363 base.c_minionType = type;
2364 master = _master;
2365 Refresh();
2366 }
int uid
Definition: Card.cs:123

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

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

◆ MakePartyMemeber()

void Chara.MakePartyMemeber ( )
inline

Definition at line 2288 of file Chara.cs.

2289 {
2290 _MakeAlly();
2291 EClass.pc.party.AddMemeber(this);
2292 }

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

8014 {
8015 if (c == this)
8016 {
8017 return;
8018 }
8019 if (IsPC)
8020 {
8021 c.ModAffinity(EClass.pc, a, show);
8022 }
8023 else
8024 {
8026 {
8027 return;
8028 }
8029 int num = StatsHygiene.GetAffinityMod(EClass.pc.hygiene.GetPhase()) + (HasElement(417) ? 30 : 0) + (EClass.pc.HasCondition<ConSmoking>() ? (-30) : 0);
8030 if (IsPCFaction && homeBranch != null)
8031 {
8032 num += (int)Mathf.Sqrt(homeBranch.Evalue(2117)) * 5;
8033 }
8034 bool flag = a > 0;
8035 if (flag)
8036 {
8037 a = a * num / 100;
8038 if (affinity.GetLunchChance() > EClass.rnd(100) && GetInt(71) >= 0 && GetInt(71) < EClass.world.date.GetRaw())
8039 {
8040 SetInt(71, -1);
8041 }
8042 }
8043 if (show)
8044 {
8045 if (a == 0)
8046 {
8047 if (!showOnlyEmo)
8048 {
8049 Say("affinityNone", this, c);
8050 }
8051 }
8052 else
8053 {
8054 ShowEmo((!flag) ? Emo.angry : Emo.love);
8055 c.ShowEmo(flag ? Emo.love : Emo.sad);
8056 if (!showOnlyEmo)
8057 {
8058 Say(flag ? "affinityPlus" : "affinityMinus", this, c);
8059 }
8060 }
8061 }
8062 if (c.IsPC)
8063 {
8064 a = affinity.Mod(a);
8065 }
8066 }
8067 }
int Mod(int a)
Definition: Affinity.cs:192
int GetLunchChance()
Definition: Affinity.cs:86
Stats hygiene
Definition: Chara.cs:1154
int GetRaw(int offsetHours=0)
Definition: Date.cs:326
int Evalue(int ele)
static int GetAffinityMod(int phase)
Definition: StatsHygiene.cs:19
virtual bool CanChangeAffinity
Definition: Trait.cs:571

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

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

◆ ModCorruption()

void Chara.ModCorruption ( int  a)
inline

Definition at line 9907 of file Chara.cs.

9908 {
9909 if (a > 0)
9910 {
9911 if (Evalue(962) >= 25 || (ResistLv(962) > 0 && EClass.rnd(ResistLv(962) + 1) != 0))
9912 {
9913 return;
9914 }
9915 int num = Evalue(412);
9916 if (num != 0)
9917 {
9918 float num2 = (float)a * 100f / (float)Mathf.Max(100 + num * 2, 10);
9919 a = (int)num2 + ((EClass.rndf(1f) < num2 % 1f) ? 1 : 0);
9920 }
9921 }
9922 if (a == 0)
9923 {
9924 return;
9925 }
9926 int num3 = (corruption + a) / 100 - corruption / 100;
9927 for (int i = 0; i < Mathf.Abs(num3); i++)
9928 {
9929 if (!MutateRandom((num3 > 0) ? 1 : (-1), 100, ether: true))
9930 {
9931 break;
9932 }
9933 }
9934 corruption += a;
9935 int num4 = 0;
9936 foreach (Element value in elements.dict.Values)
9937 {
9938 if (value.source.category == "ether")
9939 {
9940 num4 += value.Value;
9941 }
9942 }
9943 if (num4 > 0 && IsPC)
9944 {
9945 Tutorial.Reserve("ether");
9946 }
9947 corruption = num4 * 100 + corruption % 100;
9948 }
bool MutateRandom(int vec=0, int tries=100, bool ether=false, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:10066
static float rndf(float a)
Definition: EClass.cs:102

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

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

◆ ModHeight()

void Chara.ModHeight ( int  a)
inline

Definition at line 9856 of file Chara.cs.

9857 {
9858 if (!HasElement(450))
9859 {
9860 long num = bio.height;
9861 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
9862 if (num < 1)
9863 {
9864 num = 1L;
9865 }
9866 if (num > 999999999)
9867 {
9868 num = 999999999L;
9869 }
9870 if (num != bio.height)
9871 {
9872 bio.height = (int)num;
9873 Say((a > 0) ? "height_gain" : "height_lose", this);
9874 }
9875 }
9876 }
int height
Definition: Biography.cs:53

◆ ModTempElement()

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

Definition at line 10322 of file Chara.cs.

10323 {
10324 if (a < 0 && !naturalDecay && HasElement(EClass.sources.elements.alias["sustain_" + EClass.sources.elements.map[ele].alias]?.id ?? 0))
10325 {
10326 return;
10327 }
10328 bool flag = HasElement(1215);
10329 if (tempElements == null)
10330 {
10332 tempElements.SetParent(this);
10333 }
10334 if (a > 0 && flag)
10335 {
10336 a = a * 150 / 100;
10337 }
10338 int num = elements.ValueWithoutLink(ele);
10339 int num2 = Mathf.Abs(num) + 100;
10340 int num3 = num2 / (flag ? 2 : 4);
10341 int num4 = -num - 100;
10342 int num5 = tempElements.Base(ele);
10343 int num6 = num5 + a;
10344 if (onlyRenew)
10345 {
10346 num3 = Mathf.Min(a, num3);
10347 num4 = Mathf.Max(a, -num2 / 3);
10348 }
10349 if (a > 0 && num6 > num3)
10350 {
10351 a = ((num3 > num5) ? (num3 - num5) : 0);
10352 }
10353 if (a < 0 && num6 < num4)
10354 {
10355 a = ((num4 < num5) ? (num4 - num5) : 0);
10356 }
10357 Element element = tempElements.ModBase(ele, a);
10358 if (element.vBase == 0)
10359 {
10360 tempElements.Remove(element.id);
10361 if (tempElements.dict.Count == 0)
10362 {
10363 tempElements = null;
10364 }
10365 }
10366 }
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 9878 of file Chara.cs.

9879 {
9880 if (HasElement(450) || a == 0)
9881 {
9882 return;
9883 }
9884 long num = bio.weight;
9885 long num2 = bio.height;
9886 long num3 = num2 * num2 * 18 / 25000;
9887 long num4 = num2 * num2 * 24 / 10000;
9888 if (ignoreLimit || (num > num3 && num < num4))
9889 {
9890 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
9891 if (num < 1)
9892 {
9893 num = 1L;
9894 }
9895 if (num > 999999999)
9896 {
9897 num = 999999999L;
9898 }
9899 if (num != bio.weight)
9900 {
9901 bio.weight = (int)num;
9902 Say((a > 0) ? "weight_gain" : "weight_lose", this);
9903 }
9904 }
9905 }
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 2626 of file Chara.cs.

2627 {
2628 if (!newPoint.sourceBlock.tileType.IsBlockPass && (!checkWall || (Dist(newPoint) <= 1 && CanMoveTo(newPoint, allowDestroyPath: false))) && _Move(newPoint, MoveType.Force) == MoveResult.Success && ai.Current.CancelWhenMoved)
2629 {
2630 ai.Current.TryCancel(c);
2631 }
2632 }
bool TryCancel(Card c)
Definition: AIAct.cs:270
virtual bool CancelWhenMoved
Definition: AIAct.cs:96
override MoveResult _Move(Point newPoint, MoveType type=MoveType.Walk)
Definition: Chara.cs:2760

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

◆ MoveHome() [2/2]

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

Definition at line 3485 of file Chara.cs.

3486 {
3487 if (isDead)
3488 {
3489 Revive();
3490 }
3491 else
3492 {
3493 Cure(CureType.Death);
3494 }
3495 CureCondition<ConSuspend>();
3496 if (IsPCParty)
3497 {
3499 }
3500 FactionBranch factionBranch = homeBranch;
3501 if (x == -1)
3502 {
3503 x = 50;
3504 }
3505 if (z == -1)
3506 {
3507 z = 50;
3508 }
3509 Point point = new Point(x, z);
3510 if (zone.IsActiveZone)
3511 {
3512 point = point.GetNearestPoint(allowBlock: false, allowChara: false);
3513 }
3514 zone.AddCard(this, point);
3515 SetHomeZone(zone);
3516 global.transition = new ZoneTransition
3517 {
3518 state = ZoneTransition.EnterState.Dead,
3519 x = point.x,
3520 z = point.z
3521 };
3522 orgPos = new Point(x, z);
3523 if (factionBranch != null)
3524 {
3526 factionBranch.policies.Validate();
3527 }
3528 }
void RefreshWorkElements(ElementContainer parent=null)
Definition: Chara.cs:9086
Chara SetHomeZone(Zone zone)
Definition: Chara.cs:1433
PolicyManager policies
bool IsActiveZone
Definition: Zone.cs:495

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

◆ MoveNeighborDefinitely()

bool Chara.MoveNeighborDefinitely ( )
inline

Definition at line 2608 of file Chara.cs.

2609 {
2610 List<Point> list = new List<Point>();
2611 pos.ForeachNeighbor(delegate(Point p)
2612 {
2613 list.Add(p.Copy());
2614 });
2615 list.Shuffle();
2616 foreach (Point item in list)
2617 {
2618 if (!item.Equals(pos) && !item.HasChara && TryMove(item) == MoveResult.Success)
2619 {
2620 return true;
2621 }
2622 }
2623 return false;
2624 }
void ForeachNeighbor(Action< Point > action, bool diagonal=true)
Definition: Point.cs:1397

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

Referenced by AI_Idle.Run().

◆ MoveRandom()

bool Chara.MoveRandom ( )
inline

Definition at line 2594 of file Chara.cs.

2595 {
2596 Point randomNeighbor = pos.GetRandomNeighbor();
2597 if (!randomNeighbor.Equals(pos) && !randomNeighbor.HasChara && HasAccess(randomNeighbor))
2598 {
2599 if ((race.tag.Contains("water") || source.tag.Contains("water")) && pos.cell.IsTopWaterAndNoSnow && !randomNeighbor.IsDeepWater)
2600 {
2601 return false;
2602 }
2603 return TryMove(randomNeighbor) == MoveResult.Success;
2604 }
2605 return false;
2606 }
bool IsTopWaterAndNoSnow
Definition: Cell.cs:712
bool IsDeepWater
Definition: Point.cs:276

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

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

◆ MoveZone() [1/3]

◆ MoveZone() [2/3]

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

Definition at line 3368 of file Chara.cs.

3369 {
3370 if (z == currentZone)
3371 {
3372 return;
3373 }
3374 if (HasCondition<ConInvulnerable>())
3375 {
3376 RemoveCondition<ConInvulnerable>();
3377 }
3378 if (IsPC)
3379 {
3380 EClass.player.nextZone = z;
3382 {
3385 {
3386 if (EClass.player.returnInfo != null)
3387 {
3388 EClass.player.returnInfo.turns += 5;
3389 }
3391 {
3392 EClass.game.Save(isAutoSave: true);
3393 }
3394 }
3395 EClass.player.deathZoneMove = false;
3396 }
3398 if (currentZone.instance != null)
3399 {
3401 z = EClass.game.spatials.Find(instance.uidZone) ?? EClass.pc.homeZone;
3402 transition = new ZoneTransition
3403 {
3404 state = instance.ReturnState,
3405 x = instance.x,
3406 z = instance.z
3407 };
3408 instance.OnLeaveZone();
3409 Debug.Log(z);
3410 }
3411 EInput.Consume(consumeAxis: true);
3412 EClass.player.uidLastZone = currentZone.uid;
3414 {
3416 {
3417 Msg.Say("enterZone", z.Name);
3418 }
3419 else
3420 {
3421 if (z.IsRegion)
3422 {
3423 Msg.Say("leaveZone", currentZone.Name);
3424 }
3425 else if (z.id != currentZone.id)
3426 {
3427 Msg.Say("enterZone", z.Name);
3428 }
3429 EClass.player.lastZonePos = pos.Copy();
3430 }
3431 EClass.player.lastTransition = transition;
3432 }
3433 foreach (Chara item in EClass._map.charas.Where((Chara c) => c.IsPCPartyMinion && c.master != EClass.pc).ToList())
3434 {
3436 }
3437 EClass.player.listSummon = EClass._map.charas.Where((Chara c) => c.c_uidMaster != 0 && c.FindMaster() == EClass.pc && c.c_minionType == MinionType.Default).ToList();
3438 foreach (Chara item2 in EClass.player.listSummon)
3439 {
3440 EClass._zone.RemoveCard(item2);
3441 }
3442 }
3443 if (party != null && party.leader == this)
3444 {
3445 foreach (Chara member in party.members)
3446 {
3447 if (member != this && !member.isDead && member.parent is Zone)
3448 {
3449 member.MoveZone(z);
3450 }
3451 }
3452 }
3453 if (global == null)
3454 {
3455 Debug.Log(base.Name);
3456 return;
3457 }
3458 transition.uidLastZone = currentZone?.uid ?? 0;
3459 global.transition = transition;
3460 if (z.IsActiveZone)
3461 {
3462 Point spawnPos = z.GetSpawnPos(this);
3463 global.transition = null;
3464 if (IsPC)
3465 {
3466 EClass.player.lastTransition = null;
3467 }
3468 z.AddCard(this, spawnPos);
3469 if (IsBranchMember())
3470 {
3472 }
3473 }
3474 else
3475 {
3476 z.AddCard(this);
3477 }
3478 }
MinionType c_minionType
Definition: Card.cs:989
bool IsBranchMember()
Definition: Chara.cs:6647
GlobalData global
Definition: Chara.cs:76
Chara FindMaster()
Definition: Chara.cs:2403
bool ignoreAutoSave
Definition: CoreDebug.cs:126
bool Save(bool isAutoSave=false, bool silent=false)
Definition: Game.cs:1036
RoomManager rooms
Definition: Map.cs:31
Chara leader
Definition: Party.cs:31
bool deathZoneMove
Definition: Player.cs:1169
List< Chara > listSummon
Definition: Player.cs:1223
ReturnInfo returnInfo
Definition: Player.cs:866
bool simulatingZone
Definition: Player.cs:1179
void AssignCharas()
Definition: RoomManager.cs:39
int uid
Definition: Spatial.cs:70
string id
Definition: Spatial.cs:13
virtual ZoneTransition.EnterState ReturnState
Definition: ZoneInstance.cs:26
virtual void OnLeaveZone()
Definition: ZoneInstance.cs:36
virtual bool WillAutoSave
Definition: Zone.cs:263
Point GetSpawnPos(Chara c, ZoneTransition.EnterState destState=ZoneTransition.EnterState.Auto)
Definition: Zone.cs:1356

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

3361 {
3363 {
3364 state = state
3365 });
3366 }

◆ MutateRandom()

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

Definition at line 10066 of file Chara.cs.

10067 {
10068 if (!ether && vec >= 0 && HasElement(406) && EClass.rnd(5) != 0)
10069 {
10070 Say("resistMutation", this);
10071 return false;
10072 }
10073 IEnumerable<SourceElement.Row> ie = EClass.sources.elements.rows.Where((SourceElement.Row a) => a.category == (ether ? "ether" : "mutation") && !a.tag.Contains("noRandomMutation"));
10074 for (int i = 0; i < tries; i++)
10075 {
10076 SourceElement.Row row = ie.RandomItem();
10077 if (i == 0 && vec < 0 && ether && base.c_corruptionHistory != null && base.c_corruptionHistory.Count > 0)
10078 {
10079 if (EClass.sources.elements.map.ContainsKey(base.c_corruptionHistory.LastItem()))
10080 {
10081 row = EClass.sources.elements.map[base.c_corruptionHistory.LastItem()];
10082 }
10083 base.c_corruptionHistory.RemoveAt(base.c_corruptionHistory.Count - 1);
10084 if (base.c_corruptionHistory.Count == 0)
10085 {
10086 base.c_corruptionHistory = null;
10087 }
10088 }
10089 Element element = elements.GetElement(row.id);
10090 int num = 1;
10091 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))
10092 {
10093 continue;
10094 }
10095 if (element == null && !row.aliasParent.IsEmpty() && elements.Has(row.aliasParent))
10096 {
10097 row = EClass.sources.elements.alias[row.aliasParent];
10098 element = elements.GetElement(row.id);
10099 }
10100 bool flag = row.tag.Contains("neg");
10101 if (vec > 0)
10102 {
10103 if ((state >= BlessedState.Blessed && flag) || (state <= BlessedState.Cursed && !flag))
10104 {
10105 continue;
10106 }
10107 }
10108 else if (vec < 0 && ((state >= BlessedState.Blessed && !flag) || (state <= BlessedState.Cursed && flag)))
10109 {
10110 continue;
10111 }
10112 bool flag2 = true;
10113 if (element != null)
10114 {
10115 num = element.Value + ((vec != 0) ? vec : ((EClass.rnd(2) == 0) ? 1 : (-1)));
10116 if (num > element.source.max)
10117 {
10118 num = element.source.max - 1;
10119 }
10120 flag = (flag && num > element.Value) || (!flag && num < element.Value);
10121 flag2 = num > element.Value;
10122 if (vec > 0 && !flag2)
10123 {
10124 continue;
10125 }
10126 }
10127 Say(flag2 ? "mutation_gain" : "mutation_loose", this);
10128 SetFeat(row.id, num);
10129 if (flag2 && ether)
10130 {
10131 if (base.c_corruptionHistory == null)
10132 {
10133 base.c_corruptionHistory = new List<int>();
10134 }
10135 base.c_corruptionHistory.Add(row.id);
10136 if (IsPCFaction)
10137 {
10138 Element element2 = elements.GetElement(row.id);
10139 WidgetPopText.Say("popEther".lang(element2.Name, base.Name));
10140 }
10142 {
10143 EClass.player.flags.gotEtherDisease = true;
10144 Thing thing = ThingGen.Create("parchment");
10145 thing.SetStr(53, "letter_ether");
10146 Thing thing2 = ThingGen.Create("1165");
10147 thing2.SetBlessedState(BlessedState.Normal);
10148 Thing p = ThingGen.CreateParcel(null, thing2, thing);
10150 }
10151 }
10152 if (EClass.core.IsGameStarted && pos != null)
10153 {
10154 PlaySound(ether ? "mutation_ether" : "mutation");
10155 PlayEffect("mutation");
10157 Say(row.GetText(flag ? "textDec" : "textInc", returnNull: true) ?? row.alias, this);
10158 }
10159 return true;
10160 }
10161 Say("nothingHappens");
10162 return false;
10163 }
void SetStr(int id, string value=null)
Definition: BaseCard.cs:63
virtual void SetBlessedState(BlessedState s)
Definition: Card.cs:3920
bool IsGameStarted
Definition: Core.cs:84
bool Has(int ele)
Color MutateBad
Definition: MsgColors.cs:21
Color MutateGood
Definition: MsgColors.cs:19
bool gotEtherDisease
Definition: Player.cs:467
static Thing CreateParcel(string idLang=null, params Thing[] things)
Definition: ThingGen.cs:42
void SendPackage(Thing p)
Definition: World.cs:68

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

◆ OnAdvanceDay()

void Chara.OnAdvanceDay ( )
inline

Definition at line 10215 of file Chara.cs.

10216 {
10217 if (_historyFood != null)
10218 {
10219 while (_historyFood.Count > 5)
10220 {
10221 _historyFood.RemoveAt(_historyFood.Count - 1);
10222 }
10223 if (_historyFood[0].Count > 0)
10224 {
10225 _historyFood.Insert(0, new List<string>());
10226 }
10227 }
10228 }

Referenced by GameDate.AdvanceDay().

◆ OnBanish()

void Chara.OnBanish ( )
inline

Definition at line 1447 of file Chara.cs.

1448 {
1449 if (!IsGlobal)
1450 {
1451 return;
1452 }
1453 memberType = FactionMemberType.Default;
1454 foreach (Thing item in things.List((Thing a) => a.HasTag(CTAG.godArtifact)).ToList())
1455 {
1457 }
1458 UniqueData uniqueData = base.c_uniqueData;
1459 if (uniqueData != null)
1460 {
1461 Debug.Log(uniqueData.uidZone + "/" + EClass.game.spatials.map.ContainsKey(uniqueData.uidZone) + "/" + uniqueData.x + "/" + uniqueData.y);
1462 }
1463 if (uniqueData != null && EClass.game.spatials.map.ContainsKey(uniqueData.uidZone))
1464 {
1465 MoveHome(EClass.game.spatials.map[uniqueData.uidZone] as Zone, uniqueData.x, uniqueData.y);
1466 return;
1467 }
1468 Zone z = EClass.game.spatials.Find("somewhere");
1469 if (trait is TraitAdventurer)
1470 {
1471 z = EClass.world.region.ListTowns().RandomItem();
1472 SetHomeZone(z);
1473 }
1474 MoveZone(z, ZoneTransition.EnterState.RandomVisit);
1475 }
void PickOrDrop(Point p, string idThing, int idMat=-1, int num=1, bool msg=true)
Definition: Chara.cs:4322
List< Zone > ListTowns()
Definition: Region.cs:271
GlobalSpatialList map
int uidZone
Definition: UniqueData.cs:12

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

Referenced by FactionBranch.BanishMember().

◆ OnBeforeCreate()

override void Chara.OnBeforeCreate ( )
inlinevirtual

Reimplemented from Card.

Definition at line 1514 of file Chara.cs.

1515 {
1516 if (source.job == "*r")
1517 {
1518 base.c_idJob = EClass.sources.jobs.rows.Where((SourceJob.Row j) => j.playable < 4).RandomItem().id;
1519 }
1520 if (bp.idJob != null)
1521 {
1522 base.c_idJob = bp.idJob;
1523 }
1524 if (bp.idRace != null)
1525 {
1526 base.c_idRace = bp.idRace;
1527 }
1528 }
CardBlueprint bp
Definition: Card.cs:78
SourceJob jobs

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

◆ OnCreate()

override void Chara.OnCreate ( int  genLv)
inlinevirtual

Reimplemented from Card.

Definition at line 1530 of file Chara.cs.

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

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

◆ OnDeserialized()

override void Chara.OnDeserialized ( )
inlineprotectedvirtual

Reimplemented from Card.

Definition at line 1329 of file Chara.cs.

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

8436 {
8437 Say("give_erohon", this);
8438 AddCondition<ConParalyze>(50, force: true);
8439 AddCondition<ConConfuse>(50, force: true);
8440 AddCondition<ConFear>(1000, force: true);
8441 ModAffinity(EClass.pc, 100);
8442 t.Destroy();
8443 Talk("pervert");
8444 }

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

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

◆ OnInsulted()

void Chara.OnInsulted ( )
inline

Definition at line 8241 of file Chara.cs.

8242 {
8243 if (!isDead)
8244 {
8245 if (HasElement(1231))
8246 {
8247 Talk("insulted");
8248 AddCondition<ConEuphoric>(100 * Evalue(1231));
8249 }
8250 else if (EClass.rnd(20) == 0)
8251 {
8252 SetFeat(1231, 1, msg: true);
8253 }
8254 }
8255 }

References EClass.rnd().

Referenced by AI_Idle.Run().

◆ OnSerializing()

override void Chara.OnSerializing ( )
inlineprotectedvirtual

Reimplemented from Card.

Definition at line 1314 of file Chara.cs.

1315 {
1316 if (enemy != null)
1317 {
1318 SetInt(55, enemy.uid);
1319 }
1320 _cints[0] = (int)_cbits1.Bits;
1321 List<BodySlot> slots = body.slots;
1322 rawSlots = new int[slots.Count];
1323 for (int i = 0; i < slots.Count; i++)
1324 {
1325 rawSlots[i] = slots[i].elementId;
1326 }
1327 }
List< BodySlot > slots
Definition: CharaBody.cs:8
int[] rawSlots
Definition: Chara.cs:73
BitArray32 _cbits1
Definition: Chara.cs:84
uint Bits
Definition: BitArray32.cs:6

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

◆ OnSleep() [1/2]

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

Definition at line 9818 of file Chara.cs.

9819 {
9820 if (days < 1)
9821 {
9822 days = 1;
9823 }
9824 int num = power * days;
9825 if (stamina.value < 0)
9826 {
9827 stamina.Set(1);
9828 }
9829 if (isWeakToSunlight && isSunLit)
9830 {
9831 base.hp = 0;
9832 if (mana.value > 0)
9833 {
9834 mana.Set(0);
9835 }
9836 AddCondition<ConBurning>(1000, force: true);
9837 }
9838 else
9839 {
9840 HealHP(num);
9841 stamina.Mod(10 + 25 * num / 100 * (100 + elements.GetFeatRef(1642)) / 100);
9842 mana.Mod(num);
9843 }
9844 if (IsPCFaction)
9845 {
9846 hunger.Mod(20);
9847 }
9848 sleepiness.Set(0);
9849 if (!IsMinion)
9850 {
9851 interest = 100;
9852 }
9853 Cure(CureType.Sleep, power);
9854 }
virtual void HealHP(int a, HealSource origin=HealSource.None)
Definition: Card.cs:4028
bool isWeakToSunlight
Definition: Chara.cs:154
int GetFeatRef(int ele, int idx=0)

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

◆ OnSleep() [2/2]

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

Definition at line 9798 of file Chara.cs.

9799 {
9800 bool isSunLit = pos.IsSunLit;
9801 TraitPillow traitPillow = pos.FindThing<TraitPillow>();
9802 int num = bed?.Power ?? 20;
9803 if (traitPillow != null)
9804 {
9805 num += traitPillow.owner.Power / 2;
9806 }
9807 if (bed != null)
9808 {
9809 num += bed.Evalue(750) * 5;
9810 if (bed.trait is TraitBedCoffin)
9811 {
9812 isSunLit = false;
9813 }
9814 }
9815 OnSleep(num, days, isSunLit);
9816 }
void OnSleep(Thing bed=null, int days=1)
Definition: Chara.cs:9798
Thing FindThing(Func< Thing, bool > func)
Definition: Point.cs:1140

References bed.

Referenced by LayerSleep.Advance().

◆ ParseBodySlot()

int Chara.ParseBodySlot ( string  s)
inlineprivate

Definition at line 2188 of file Chara.cs.

2189 {
2190 return s switch
2191 {
2192 "é ­" => 30,
2193 "首" => 31,
2194 "体" => 32,
2195 "背" => 33,
2196 "手" => 35,
2197 "指" => 36,
2198 "è…•" => 34,
2199 "è…°" => 37,
2200 "è¶³" => 39,
2201 _ => -1,
2202 };
2203 }

Referenced by ApplyRace(), and ResetBody().

◆ PerformWork()

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

Definition at line 9261 of file Chara.cs.

9262 {
9263 Hobby hobby = new Hobby();
9264 hobby.id = session.id;
9265 WorkSummary workSummary = _workSummary;
9266 hobby.GetAI(this).OnPerformWork(IsRealTime);
9267 if (!isHobby)
9268 {
9269 workSummary.progress += EClass.rnd(5) + 5;
9270 }
9271 int num = PerformWork(hobby, 0, isHobby);
9272 int num2 = PerformWork(hobby, 1, isHobby);
9273 int num3 = PerformWork(hobby, 2, isHobby);
9274 int num4 = PerformWork(hobby, 3, isHobby);
9275 workSummary.money += num;
9276 workSummary.food += num2;
9277 workSummary.knowledge += num3;
9278 workSummary.material += num4;
9279 int PerformWork(Hobby work, int idx, bool isHobby)
9280 {
9281 if (idx >= work.source.resources.Length)
9282 {
9283 return 0;
9284 }
9285 int num5 = work.source.resources[idx];
9286 int num6 = num5;
9287 num5 = Rand.Range(num5 * (100 - work.source.resources[idx]) / 100, num5);
9288 num5 = num5 * (isHobby ? 50 : 100) * session.efficiency / 10000;
9289 if (num6 > 0 && num5 <= 0)
9290 {
9291 num5 = 1;
9292 }
9293 return num5;
9294 }
9295 }
virtual void OnPerformWork(bool realtime)
Definition: AIWork.cs:150
void PerformWork(WorkSession session, bool isHobby=false, bool IsRealTime=false)
Definition: Chara.cs:9261
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 4342 of file Chara.cs.

4343 {
4344 if (t.trait is TraitCard && t.isNew && EClass.game.config.autoCollectCard && !t.c_idRefCard.IsEmpty())
4345 {
4347 return t;
4348 }
4349 if (t.parent == this)
4350 {
4351 return t;
4352 }
4353 t = TryPoisonPotion(t);
4354 ThingContainer.DestData dest = things.GetDest(t, tryStack);
4355 if (!dest.IsValid)
4356 {
4357 if (t.parent != EClass._zone)
4358 {
4359 if (IsPC)
4360 {
4361 Say("backpack_full_drop", t);
4362 SE.Drop();
4363 }
4364 return EClass._zone.AddCard(t, pos).Thing;
4365 }
4366 if (IsPC)
4367 {
4368 Say("backpack_full", t);
4369 }
4370 return t;
4371 }
4372 if (dest.stack != null)
4373 {
4374 if (msg)
4375 {
4376 PlaySound("pick_thing");
4377 Say("pick_thing", this, t);
4378 }
4379 t.TryStackTo(dest.stack);
4380 return dest.stack;
4381 }
4382 TryAbsorbRod(t);
4383 if (msg)
4384 {
4385 PlaySound("pick_thing");
4386 Say("pick_thing", this, t);
4387 }
4389 return dest.container.AddThing(t, tryStack);
4390 }
bool isNew
Definition: Card.cs:483
bool TryStackTo(Thing to)
Definition: Card.cs:3422
string c_idRefCard
Definition: Card.cs:1738
void TryReservePickupTutorial(Thing t)
Definition: Chara.cs:4436
Thing TryPoisonPotion(Thing t)
Definition: Chara.cs:4392
void TryAbsorbRod(Thing t)
Definition: Chara.cs:4406
static void Collect(Thing t)
bool autoCollectCard
Definition: Game.cs:52
DestData GetDest(Thing t, bool tryStack=true)

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

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

◆ PickHeld()

void Chara.PickHeld ( bool  msg = false)
inline

Definition at line 4558 of file Chara.cs.

4559 {
4560 if (held == null)
4561 {
4562 return;
4563 }
4564 Card card = held;
4565 if (IsPC && held.invY == 1)
4566 {
4567 WidgetHotbar.dirtyCurrentItem = true;
4569 held = null;
4570 return;
4571 }
4572 if (held.isChara)
4573 {
4574 DropHeld();
4575 return;
4576 }
4578 {
4579 Say("canOnlyCarry", held);
4580 DropHeld();
4581 return;
4582 }
4583 bool flag = held != things.TryStack(held.Thing);
4584 if (!flag && things.IsOverflowing())
4585 {
4586 if (IsPC)
4587 {
4588 Say("backpack_full_drop", held);
4589 SE.Drop();
4590 }
4591 DropHeld();
4592 return;
4593 }
4594 if (msg)
4595 {
4596 PlaySound("pick_thing");
4597 Say("pick_held", this, card);
4598 if (IsPC && card.id == "statue_weird")
4599 {
4600 Say("statue_pick");
4601 }
4602 }
4603 if (IsPC)
4604 {
4605 WidgetHotbar.dirtyCurrentItem = true;
4606 if (!flag)
4607 {
4609 if (held.GetRootCard() != EClass.pc)
4610 {
4611 Pick(held.Thing, msg: false);
4612 }
4613 }
4614 }
4615 held = null;
4616 }
int invY
Definition: Card.cs:1956
bool IsHotItem
Definition: Card.cs:120
Card DropHeld(Point dropPos=null)
Definition: Chara.cs:4635
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 4322 of file Chara.cs.

4323 {
4324 if (num != 0)
4325 {
4326 PickOrDrop(p, ThingGen.Create(idThing, idMat).SetNum(num), msg);
4327 }
4328 }

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

4331 {
4332 if (things.GetDest(t).IsValid)
4333 {
4334 Pick(t, msg);
4335 }
4336 else
4337 {
4338 EClass._zone.AddCard(t, p);
4339 }
4340 }

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

◆ Refresh()

void Chara.Refresh ( bool  calledRecursive = false)
inline

Definition at line 1731 of file Chara.cs.

1732 {
1733 if (source == null)
1734 {
1735 Debug.LogError("source is null");
1736 SetSource();
1737 }
1738 if (ride != null && ride.source != null)
1739 {
1740 ride.Refresh(calledRecursive: true);
1741 }
1742 hasTelepathy = false;
1743 isWet = false;
1744 _isLevitating = HasElement(401) || (ride != null && ride._isLevitating);
1746 isWeakToSunlight = HasElement(1251) && !HasElement(431);
1747 base.isHidden = HasElement(415);
1748 foreach (Condition condition in conditions)
1749 {
1750 condition.OnRefresh();
1751 }
1752 if (isWet)
1753 {
1754 base.isHidden = false;
1755 }
1757 SetDirtySpeed();
1758 if (host != null && !calledRecursive && host.source != null)
1759 {
1760 host.Refresh(calledRecursive: true);
1761 }
1762 }
virtual void OnRefresh()
void Refresh(bool calledRecursive=false)
Definition: Chara.cs:1731
bool isWet
Definition: Chara.cs:144
override void SetSource()
Definition: Chara.cs:2077
bool IsUndead
Definition: Chara.cs:893
bool IsHorror
Definition: Chara.cs:917
bool IsMachine
Definition: Chara.cs:905

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

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

◆ RefreshFaithElement()

void Chara.RefreshFaithElement ( )
inline

Definition at line 10279 of file Chara.cs.

10280 {
10281 if (faithElements != null)
10282 {
10284 }
10286 if (idFaith == "eyth" && !HasElement(1228))
10287 {
10288 return;
10289 }
10290 SourceReligion.Row row = EClass.sources.religions.map.TryGetValue(idFaith);
10291 if (row == null)
10292 {
10293 return;
10294 }
10296 if (!HasCondition<ConExcommunication>())
10297 {
10298 SourceElement.Row row2 = EClass.sources.elements.alias.TryGetValue("featGod_" + row.id + "1");
10299 if (row2 != null)
10300 {
10301 faithElements.SetBase(row2.id, 1);
10302 }
10303 int[] array = row.elements;
10304 int num = GetPietyValue() * (120 + Evalue(1407) * 15 + Evalue(1228) * 20) / 100;
10305 for (int i = 0; i < array.Length; i += 2)
10306 {
10307 int num2 = array[i + 1] * num / 50;
10308 if (array[i] == 79)
10309 {
10310 num2 = EClass.curve(num2, array[i + 1] * 2, 10, 50);
10311 }
10312 if (num2 >= 20 && array[i] >= 950 && array[i] < 970)
10313 {
10314 num2 = 20;
10315 }
10316 faithElements.SetBase(array[i], Mathf.Max(num2, 1));
10317 }
10318 }
10320 }
string idFaith
Definition: Chara.cs:233
ElementContainer faithElements
Definition: Chara.cs:38
int GetPietyValue()
Definition: Chara.cs:10270
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 1874 of file Chara.cs.

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

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

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

◆ RefreshWorkElements()

void Chara.RefreshWorkElements ( ElementContainer  parent = null)
inline

Definition at line 9086 of file Chara.cs.

9087 {
9088 if (workElements != null)
9089 {
9091 }
9092 workElements = null;
9093 if (IsPCParty || homeBranch == null || homeBranch.owner == null)
9094 {
9095 return;
9096 }
9097 foreach (Hobby item in ListHobbies())
9098 {
9099 TryAdd(item);
9100 }
9101 foreach (Hobby item2 in ListWorks())
9102 {
9103 TryAdd(item2);
9104 }
9105 if (workElements != null)
9106 {
9108 }
9109 void TryAdd(Hobby h)
9110 {
9111 if (!h.source.elements.IsEmpty())
9112 {
9113 if (workElements == null)
9114 {
9116 }
9117 for (int i = 0; i < h.source.elements.Length; i += 2)
9118 {
9119 int num = h.source.elements[i];
9120 int num2 = h.source.elements[i + 1];
9121 int num3 = 100;
9122 if (num != 2115 && num != 2207)
9123 {
9124 num3 = h.GetEfficiency(this) * homeBranch.efficiency / 100;
9125 if (num3 <= 0)
9126 {
9127 continue;
9128 }
9129 }
9130 workElements.ModBase(num, (num2 < 0) ? (num2 / 10) : Mathf.Max(1, h.source.elements[i + 1] * num3 / 1000));
9131 }
9132 }
9133 }
9134 }
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 2380 of file Chara.cs.

2381 {
2382 base.c_uidMaster = 0;
2383 master = null;
2384 enemy = null;
2385 foreach (Chara chara in EClass._map.charas)
2386 {
2387 if (chara.enemy == this)
2388 {
2389 chara.SetEnemy();
2390 chara.ai.Cancel();
2391 }
2392 }
2393 ai.Cancel();
2394 Refresh();
2395 }

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

9704 {
9705 for (int num = conditions.Count - 1; num >= 0; num--)
9706 {
9707 Condition condition = conditions[num];
9708 if (condition.Type == ConditionType.Stance)
9709 {
9710 condition.Kill();
9711 }
9712 }
9713 }

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

◆ RemoveCondition< T >()

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

Definition at line 9554 of file Chara.cs.

9554 : Condition
9555 {
9556 for (int num = conditions.Count - 1; num >= 0; num--)
9557 {
9558 if (conditions[num] is T)
9559 {
9560 conditions[num].Kill();
9561 break;
9562 }
9563 }
9564 }

References Condition.Kill().

◆ RemoveGlobal()

void Chara.RemoveGlobal ( )
inline

◆ RemoveLastBodyPart()

void Chara.RemoveLastBodyPart ( bool  msg = false)
inline

Definition at line 2216 of file Chara.cs.

2217 {
2218 if (body.slots.Count != 0)
2219 {
2220 BodySlot bodySlot = body.slots.LastItem();
2221 body.RemoveBodyPartAt(body.slots.Count - 1);
2222 if (msg)
2223 {
2224 Say("lose_bodyparts", this, Element.Get(bodySlot.elementId).GetName().ToLower());
2225 PlaySound("offering");
2226 }
2227 }
2228 }
int elementId
Definition: BodySlot.cs:6
void RemoveBodyPartAt(int idx)
Definition: CharaBody.cs:329

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

Referenced by TraitFoodEggFertilized.Incubate().

◆ RequestProtection()

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

Definition at line 8456 of file Chara.cs.

8457 {
8458 if (HasCondition<StanceTaunt>() || base.isRestrained || attacker == this)
8459 {
8460 return false;
8461 }
8462 if (host != null && host.isRestrained)
8463 {
8464 return false;
8465 }
8466 if (base.IsPCFactionOrMinion && attacker.IsPCFactionOrMinion)
8467 {
8468 return false;
8469 }
8470 bool flag = false;
8471 foreach (Chara chara in EClass._map.charas)
8472 {
8473 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))
8474 {
8475 continue;
8476 }
8477 bool flag2 = chara.HasElement(1225) && !chara.GetBool(126);
8478 if ((!flag2 && (flag || EClass.rnd(2) == 0 || !chara.HasCondition<StanceTaunt>())) || chara.HasCooldown(1225))
8479 {
8480 continue;
8481 }
8482 int num = Mathf.Max(chara.Evalue(1649), (!chara.IsPC) ? ((!flag2) ? 1 : 3) : 0);
8483 int num2 = Dist(chara);
8484 if (num2 > 25)
8485 {
8486 continue;
8487 }
8488 if (num2 > num || !chara.CanSeeLos(pos, num2))
8489 {
8490 if (!flag2)
8491 {
8492 continue;
8493 }
8494 Point nearestPoint = pos.GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: true, ignoreCenter: true);
8495 if (!nearestPoint.IsValid)
8496 {
8497 continue;
8498 }
8499 chara.Teleport(nearestPoint);
8500 chara.AddCooldown(1225, 10);
8501 num2 = Dist(chara);
8502 Say("intercept_loyal", chara, this);
8503 chara.SetEnemy(attacker);
8504 attacker.SetEnemy(chara);
8505 if (num2 > num || !chara.CanSeeLos(pos, num2))
8506 {
8507 continue;
8508 }
8509 }
8510 if (!flag && !HasElement(1225))
8511 {
8512 Say("intercept", chara, this);
8513 if (EClass.rnd(10) == 0)
8514 {
8515 chara.Talk("intercept", base.NameSimple);
8516 }
8517 if (attacker.enemy == this)
8518 {
8519 attacker.SetEnemy(chara);
8520 }
8521 action(chara);
8522 flag = true;
8523 }
8524 }
8525 return flag;
8526 }
void Teleport(Point point, bool silent=false, bool force=false)
Definition: Card.cs:5900
void AddCooldown(int idEle, int turns=0)
Definition: Chara.cs:8737
bool HasCooldown(int idEle)
Definition: Chara.cs:8788

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

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

◆ RerollHobby()

void Chara.RerollHobby ( bool  extraSlotChance = true)
inline

Definition at line 9180 of file Chara.cs.

9181 {
9182 if (_hobbies != null && _works != null)
9183 {
9184 _hobbies.Clear();
9185 _works.Clear();
9186 }
9187 else
9188 {
9189 _hobbies = new List<int>();
9190 _works = new List<int>();
9191 }
9192 if (source.hobbies.IsEmpty())
9193 {
9194 AddHobby(EClass.sources.hobbies.listHobbies.RandomItem().id);
9195 }
9196 else
9197 {
9198 string[] hobbies = source.hobbies;
9199 foreach (string key in hobbies)
9200 {
9201 AddHobby(EClass.sources.hobbies.alias[key].id);
9202 }
9203 }
9204 if (source.works.IsEmpty())
9205 {
9206 AddWork(EClass.sources.hobbies.listWorks.RandomItem().id);
9207 }
9208 else
9209 {
9210 string[] hobbies = source.works;
9211 foreach (string key2 in hobbies)
9212 {
9213 AddWork(EClass.sources.hobbies.alias[key2].id);
9214 }
9215 }
9217 }
WorkSummary GetWorkSummary()
Definition: Chara.cs:9219
void AddWork(int id)
Definition: Chara.cs:9168
void AddHobby(int id)
Definition: Chara.cs:9156
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 2230 of file Chara.cs.

2231 {
2232 for (int num = body.slots.Count - 1; num >= 0; num--)
2233 {
2234 BodySlot bodySlot = body.slots[num];
2235 if (bodySlot.elementId == 45 || bodySlot.elementId == 40)
2236 {
2237 return;
2238 }
2239 body.RemoveBodyPart(num);
2240 }
2241 string[] array = race.figure.Split('|');
2242 foreach (string s in array)
2243 {
2244 int num2 = ParseBodySlot(s);
2245 if (num2 != -1)
2246 {
2247 body.AddBodyPart(num2);
2248 }
2249 }
2251 }

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

◆ ResetUpgrade()

void Chara.ResetUpgrade ( )
inline

Definition at line 8622 of file Chara.cs.

8623 {
8624 _ = base.c_upgrades;
8625 }

Referenced by CoreDebug.ResetPetUpgrades().

◆ ResistCon()

void Chara.ResistCon ( Condition  con)
inline

Definition at line 9760 of file Chara.cs.

9761 {
9762 if (con.power > 0 && resistCon != null)
9763 {
9764 int a = ClassExtension.TryGetValue<int, int>((IDictionary<int, int>)resistCon, con.id, 0);
9765 if (1000 < EClass.rnd(a))
9766 {
9767 con.power = 0;
9768 }
9769 else if (500 < EClass.rnd(a))
9770 {
9771 con.power /= 5;
9772 }
9773 else if (200 < EClass.rnd(a))
9774 {
9775 con.power /= 3;
9776 }
9777 else if (100 < EClass.rnd(a))
9778 {
9779 con.power /= 2;
9780 }
9781 }
9782 }

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

◆ RestockEquip()

void Chara.RestockEquip ( bool  onCreate)
inline

Definition at line 4727 of file Chara.cs.

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

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

Referenced by CoreDebug.QuickStart().

◆ RestockInventory()

void Chara.RestockInventory ( bool  onCreate)
inline

Definition at line 5029 of file Chara.cs.

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

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

◆ Revive()

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

Definition at line 5181 of file Chara.cs.

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

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

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

◆ Rotate()

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

Reimplemented from Card.

Definition at line 3550 of file Chara.cs.

3551 {
3552 if (renderer.hasActor)
3553 {
3554 base.dir = (base.dir + ((!reverse) ? 1 : (-1))).Clamp(0, 3, loop: true);
3555 }
3556 else
3557 {
3558 base.dir = ((base.dir == 0) ? 1 : 0);
3559 }
3560 UpdateAngle();
3562 }

Referenced by AI_Dance.Run().

◆ SaiyanRevive()

void Chara.SaiyanRevive ( )
inline

Definition at line 5253 of file Chara.cs.

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

References Stats.max, and Refresh().

◆ ScaleByPrincipal()

Chara Chara.ScaleByPrincipal ( )
inline

◆ SetAI()

AIAct Chara.SetAI ( AIAct  g)
inline

Definition at line 8956 of file Chara.cs.

8957 {
8958 if (IsPC)
8959 {
8961 }
8962 if (ai.IsRunning)
8963 {
8964 if (ai == g && ai.IsNoGoal)
8965 {
8966 return g;
8967 }
8968 ai.Cancel();
8969 if (ai == g)
8970 {
8971 Debug.Log("goal is g:" + ai?.ToString() + "/" + this);
8972 return g;
8973 }
8974 }
8975 if (HasCondition<ConWait>())
8976 {
8977 RemoveCondition<ConWait>();
8978 }
8979 ai = g;
8980 ai.SetOwner(this);
8981 if (IsPC)
8982 {
8984 }
8985 return g;
8986 }
virtual bool IsNoGoal
Definition: AIAct.cs:74
void SetOwner(Chara c)
Definition: AIAct.cs:179
QueueManager queues
Definition: Player.cs:1211
void OnSetGoal(AIAct newGoal)
Definition: QueueManager.cs:23

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

Referenced by _Move(), Zone.AddCard(), Thing.DoAct(), UIInventory.DoAct(), Player.EndTurn(), GiveGift(), TraitTrolley.OnActivateTrap(), BaseListPeople.OnClick(), LayerCraft.OnClickCraft(), OnCreate(), ZoneInstanceBout.OnLeaveZone(), AM_Paint.OnUpdateInput(), ActBloodsuck.Perform(), ActNTR.Perform(), ActRanged.Perform(), ActRestrain.Perform(), 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 8946 of file Chara.cs.

8947 {
8948 SetAI(new GoalCombat());
8949 }

Referenced by ZoneEventQuest.AggroEnemy().

◆ SetAIIdle()

void Chara.SetAIIdle ( )
inline

Definition at line 8942 of file Chara.cs.

8943 {
8944 }

◆ SetAIImmediate()

◆ SetCooldown()

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

Definition at line 8755 of file Chara.cs.

8756 {
8757 if (_cooldowns == null)
8758 {
8759 _cooldowns = new List<int>();
8760 }
8761 bool flag = false;
8762 for (int i = 0; i < _cooldowns.Count; i++)
8763 {
8764 if (_cooldowns[i] / 1000 == idEle)
8765 {
8766 if (turns == 0)
8767 {
8768 _cooldowns.RemoveAt(i);
8769 }
8770 else
8771 {
8772 _cooldowns[i] = idEle * 1000 + turns;
8773 }
8774 flag = true;
8775 break;
8776 }
8777 }
8778 if (!flag && turns > 0)
8779 {
8780 AddCooldown(idEle, turns);
8781 }
8782 if (_cooldowns.Count == 0)
8783 {
8784 _cooldowns = null;
8785 }
8786 }

Referenced by ConTransmuteBat.OnRemoved().

◆ SetDir()

override void Chara.SetDir ( int  d)
inlinevirtual

Reimplemented from Card.

Definition at line 3543 of file Chara.cs.

3544 {
3545 base.dir = d;
3546 UpdateAngle();
3548 }

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

◆ SetDirtySpeed()

void Chara.SetDirtySpeed ( )
inline

Definition at line 1865 of file Chara.cs.

1866 {
1867 dirtySpeed = true;
1868 if (host != null)
1869 {
1871 }
1872 }

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

6361 {
6362 enemy = c;
6363 if (c == null)
6364 {
6365 if (ai is GoalCombat)
6366 {
6367 ai.Cancel();
6368 }
6369 }
6370 else
6371 {
6372 calmCheckTurn = 10 + EClass.rnd(30);
6373 }
6374 return c;
6375 }

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

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

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

◆ SetFaction()

Chara Chara.SetFaction ( Faction  f)
inline

Definition at line 1425 of file Chara.cs.

1426 {
1427 _faction = null;
1428 faction = f;
1430 return this;
1431 }
Faction _faction
Definition: Chara.cs:158
Hostility GetHostility()
Definition: FACTION.cs:255

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

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

◆ SetFaith() [1/2]

void Chara.SetFaith ( Religion  r)
inline

Definition at line 1716 of file Chara.cs.

1717 {
1718 faith = r;
1720 }

References faith, and RefreshFaithElement().

◆ SetFaith() [2/2]

void Chara.SetFaith ( string  id)
inline

Definition at line 1711 of file Chara.cs.

1712 {
1714 }
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 9965 of file Chara.cs.

9966 {
9967 Feat feat = elements.GetElement(id) as Feat;
9968 int num = 0;
9969 if (feat != null && feat.Value > 0)
9970 {
9971 if (value == feat.Value)
9972 {
9973 return;
9974 }
9975 num = feat.Value;
9976 feat.Apply(-feat.Value, elements);
9977 }
9978 feat = elements.SetBase(id, value - (feat?.vSource ?? 0)) as Feat;
9979 if (feat.Value != 0)
9980 {
9981 feat.Apply(feat.Value, elements);
9982 }
9984 {
9985 Refresh();
9987 }
9988 if (!msg)
9989 {
9990 return;
9991 }
9992 if (feat.source.textInc.IsEmpty())
9993 {
9994 PlaySound("ding_skill");
9996 Say("gainFeat", this, feat.FullName);
9997 }
9998 else
9999 {
10000 bool flag = value < num;
10001 if (feat.source.tag.Contains("neg"))
10002 {
10003 flag = !flag;
10004 }
10005 switch (id)
10006 {
10007 case 1270:
10008 if (!flag)
10009 {
10010 PlaySound("chime_angel");
10011 }
10012 break;
10013 case 1271:
10014 if (!flag)
10015 {
10016 PlaySound("chime_devil");
10017 }
10018 break;
10019 default:
10020 PlaySound("mutation");
10021 break;
10022 }
10024 Say((value > num) ? feat.source.GetText("textInc") : feat.source.GetText("textDec"), this, feat.FullName);
10025 }
10027 }
Color Negative
Definition: MsgColors.cs:15
Color Ding
Definition: MsgColors.cs:11

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

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

◆ SetGlobal() [1/2]

Chara Chara.SetGlobal ( )
inline

Definition at line 1492 of file Chara.cs.

1493 {
1494 if (!IsGlobal)
1495 {
1497 global = new GlobalData();
1498 base.isSubsetCard = false;
1499 enemy = null;
1500 base.c_uidMaster = 0;
1501 }
1502 return this;
1503 }

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

1478 {
1479 SetGlobal();
1480 homeZone = _home;
1481 _home.AddCard(this, x, z);
1482 global.transition = new ZoneTransition
1483 {
1484 state = ZoneTransition.EnterState.Exact,
1485 x = x,
1486 z = z
1487 };
1488 orgPos = new Point(x, z);
1489 return this;
1490 }

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

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

◆ SetHomeZone()

Chara Chara.SetHomeZone ( Zone  zone)
inline

Definition at line 1433 of file Chara.cs.

1434 {
1435 homeZone = zone;
1436 SetGlobal();
1437 return this;
1438 }

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

1441 {
1442 Hostility hostility2 = (base.c_originalHostility = h);
1443 this.hostility = hostility2;
1444 return this;
1445 }

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

◆ SetMainElement() [1/2]

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

Definition at line 2098 of file Chara.cs.

2099 {
2100 if (base.c_idMainElement != 0)
2101 {
2102 SetElements(base.c_idMainElement, remove: true);
2103 base.c_idMainElement = 0;
2104 }
2105 if (id != 0)
2106 {
2107 _ = EClass.sources.elements.map[id];
2108 SetElements(id, remove: false);
2109 base.c_idMainElement = id;
2110 if (elemental)
2111 {
2112 base.isElemental = true;
2113 _colorInt = 0;
2114 Color colorSprite = EClass.setting.elements[MainElement.source.alias].colorSprite;
2115 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);
2116 }
2117 _ability = null;
2118 }
2119 void SetElements(int idEle, bool remove)
2120 {
2121 elements.SetBase(idEle, (!remove) ? ((v == 0) ? 10 : v) : 0);
2122 elements.ModBase(EClass.sources.elements.alias[EClass.sources.elements.map[idEle].aliasRef].id, remove ? (-20) : 20);
2123 switch (idEle)
2124 {
2125 case 910:
2126 elements.ModBase(951, remove ? 10 : (-10));
2127 break;
2128 case 911:
2129 elements.ModBase(950, remove ? 10 : (-10));
2130 break;
2131 case 912:
2132 elements.ModBase(953, remove ? 10 : (-10));
2133 break;
2134 case 913:
2135 elements.ModBase(952, remove ? 10 : (-10));
2136 break;
2137 case 916:
2138 elements.ModBase(960, remove ? 10 : (-10));
2139 break;
2140 case 919:
2141 elements.ModBase(956, remove ? 10 : (-10));
2142 break;
2143 case 925:
2144 elements.ModBase(962, remove ? 10 : (-10));
2145 break;
2146 case 922:
2147 elements.ModBase(965, remove ? 10 : (-10));
2148 break;
2149 case 921:
2150 elements.ModBase(971, remove ? 10 : (-10));
2151 break;
2152 case 926:
2153 elements.ModBase(961, remove ? 10 : (-10));
2154 break;
2155 case 914:
2156 case 915:
2157 case 917:
2158 case 918:
2159 case 920:
2160 case 923:
2161 case 924:
2162 break;
2163 }
2164 }
2165 }
int _colorInt
Definition: Card.cs:68
CharaAbility _ability
Definition: Chara.cs:96
UD_String_ElementRef elements
Definition: GameSetting.cs:315

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

◆ SetMainElement() [2/2]

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

Definition at line 2089 of file Chara.cs.

2090 {
2091 if (!id.StartsWith("ele"))
2092 {
2093 id = "ele" + id;
2094 }
2095 SetMainElement(EClass.sources.elements.alias[id].id, v, elemental);
2096 }

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

10030 {
10031 SourceElement.Row row = EClass.sources.elements.map[idEle];
10033 Element element = elements.GetElement(idEle);
10034 Element element2 = elements.GetElement(row2.id);
10035 int num = element?.Value ?? 0;
10036 if (a < 0)
10037 {
10038 a = 0;
10039 }
10040 if (a > row.max)
10041 {
10042 a = row.max;
10043 }
10044 bool flag = (row.tag.Contains("neg") ? (a > num) : (a < num));
10045 if (a == 0 && (element == null || element.Value == 0))
10046 {
10048 return;
10049 }
10050 if (element != null && element.Value == a)
10051 {
10053 return;
10054 }
10055 if (element2 != null && element2.Value > 0)
10056 {
10057 SetFeat(element2.id, 0);
10058 }
10059 SetFeat(idEle, a);
10060 PlaySound("mutation");
10061 PlayEffect("mutation");
10063 Say(row.GetText(flag ? "textDec" : "textInc", returnNull: true) ?? row.alias, this);
10064 }

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

8952 {
8953 return SetAI(_NoGoalPC);
8954 }
static NoGoal _NoGoalPC
Definition: Chara.cs:198

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

◆ SetPCCState()

void Chara.SetPCCState ( PCCState  state)
inline

Definition at line 6748 of file Chara.cs.

6749 {
6750 if (IsPCC)
6751 {
6752 PCC.Get(pccData).Build(state);
6753 }
6754 }

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

6797 {
6798 p.mat = base.material;
6799 p.matColor = base.colorInt;
6800 if (!renderer.usePass)
6801 {
6802 return;
6803 }
6804 if (renderer.replacer != null)
6805 {
6806 p.tile = renderer.replacer.tile * ((!flipX) ? 1 : (-1));
6807 if (renderer.replacer.mat != -1)
6808 {
6809 p.mat = EClass.sources.materials.rows.TryGet(renderer.replacer.mat, 0);
6810 p.matColor = BaseTileMap.GetColorInt(ref p.mat.matColor, 100);
6811 p.color -= 1048576f;
6812 }
6813 }
6814 else if (source._tiles_snow.Length != 0 && EClass._zone.IsSnowCovered)
6815 {
6816 if (source._tiles_snow.Length > 1)
6817 {
6818 int num = ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % source._tiles_snow.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6819 p.tile = source._tiles_snow[(num < source._tiles_snow.Length) ? num : 0] * ((!flipX) ? 1 : (-1));
6820 }
6821 else
6822 {
6823 p.tile = source._tiles_snow[0] * ((!flipX) ? 1 : (-1));
6824 }
6825 }
6826 else if (sourceCard._tiles.Length > 1)
6827 {
6828 int num2 = ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % sourceCard._tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6829 p.tile = sourceCard._tiles[(num2 >= 0 && num2 < sourceCard._tiles.Length) ? num2 : 0] * ((!flipX) ? 1 : (-1));
6830 }
6831 else
6832 {
6833 p.tile = sourceCard._tiles[0] * ((!flipX) ? 1 : (-1));
6834 }
6835 p.dir = base.dir;
6836 }
static int GetColorInt(ref Color matColor, int p)
override bool flipX
Definition: Chara.cs:549
SourceMaterial.Row mat
Definition: RenderParam.cs:17
SourceMaterial materials
virtual bool IsSnowCovered
Definition: Spatial.cs:545

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

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

◆ SetSortVal()

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

Reimplemented from Card.

Definition at line 7356 of file Chara.cs.

7357 {
7358 switch (m)
7359 {
7360 case UIList.SortMode.ByJob:
7361 sortVal = job._index * 10000 + sourceCard._index;
7362 break;
7363 case UIList.SortMode.ByRace:
7364 sortVal = race._index * 10000 * ((!IsHuman) ? 1 : (-1)) + sourceCard._index;
7365 break;
7366 case UIList.SortMode.ByFeat:
7367 sortVal = -GetTotalFeat();
7368 break;
7369 default:
7370 sortVal = sourceCard._index * ((!IsHuman) ? 1 : (-1));
7371 break;
7372 case UIList.SortMode.ByWorkk:
7373 break;
7374 }
7375 }
int sortVal
Definition: Card.cs:102
int GetTotalFeat()
Definition: Chara.cs:8174
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 2077 of file Chara.cs.

2078 {
2079 source = EClass.sources.charas.map.TryGetValue(id);
2080 if (source == null)
2081 {
2082 Debug.LogWarning("Chara " + id + " not found");
2083 id = "chicken";
2084 source = EClass.sources.charas.map[id];
2085 }
2086 path.walker = this;
2087 }

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

Referenced by Refresh().

◆ SetSummon()

void Chara.SetSummon ( int  duration)
inline

Definition at line 2397 of file Chara.cs.

2398 {
2399 base.c_summonDuration = duration;
2400 base.isSummon = true;
2401 }

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

7692 {
7693 if (t.IsRangedWeapon && t.category.slot == 0)
7694 {
7695 if (!CanEquipRanged(t))
7696 {
7697 return false;
7698 }
7699 int num = 0;
7700 foreach (Thing thing in things)
7701 {
7702 if (thing.IsRangedWeapon)
7703 {
7704 if (thing.category.slot != 0 && thing.isEquipped)
7705 {
7706 return false;
7707 }
7708 if (CanEquipRanged(thing) && thing.GetEquipValue() > num)
7709 {
7710 num = thing.GetEquipValue();
7711 }
7712 }
7713 }
7714 if (t.GetEquipValue() > num)
7715 {
7716 return true;
7717 }
7718 return false;
7719 }
7720 BodySlot bodySlot = body.GetSlot(t);
7721 if (bodySlot == null)
7722 {
7723 return false;
7724 }
7725 if (useFav)
7726 {
7727 switch (GetFavAttackStyle())
7728 {
7729 case AttackStyle.Default:
7730 case AttackStyle.TwoHand:
7731 if (t.IsMeleeWeapon)
7732 {
7733 bodySlot = body.slotMainHand;
7734 }
7735 else if (bodySlot.elementId == 35)
7736 {
7737 return false;
7738 }
7739 break;
7740 case AttackStyle.Shield:
7741 if (t.IsMeleeWeapon)
7742 {
7743 bodySlot = body.slotMainHand;
7744 }
7745 else if (bodySlot.elementId == 35 && t.IsMeleeWeapon)
7746 {
7747 return false;
7748 }
7749 break;
7750 case AttackStyle.TwoWield:
7751 if (bodySlot.elementId == 35 && !t.IsMeleeWeapon)
7752 {
7753 return false;
7754 }
7755 break;
7756 }
7757 }
7758 if (!body.IsEquippable(t, bodySlot, text: false))
7759 {
7760 return false;
7761 }
7762 if (bodySlot.thing != null && (bodySlot.thing.blessedState <= BlessedState.Cursed || bodySlot.thing.GetEquipValue() >= t.GetEquipValue()))
7763 {
7764 return false;
7765 }
7766 if (!base.IsPCFactionOrMinion)
7767 {
7768 int num2 = 0;
7769 foreach (Element value in t.elements.dict.Values)
7770 {
7771 if (value.Value <= 0)
7772 {
7773 int num3 = 100;
7774 switch (value.id)
7775 {
7776 case 418:
7777 num3 = 10;
7778 break;
7779 case 60:
7780 case 61:
7781 case 62:
7782 num3 = 200;
7783 break;
7784 case 962:
7785 num3 = 10000;
7786 break;
7787 }
7788 num2 += value.Value * num3 / 100;
7789 }
7790 }
7791 if (num2 < -40)
7792 {
7793 return false;
7794 }
7795 }
7796 if (t.HasTag(CTAG.gift))
7797 {
7798 return false;
7799 }
7800 return true;
7801 }
bool IsMeleeWeapon
Definition: Card.cs:2244
BlessedState blessedState
Definition: Card.cs:279
bool IsEquippable(Thing thing, BodySlot slot, bool text=true)
Definition: CharaBody.cs:110
AttackStyle GetFavAttackStyle()
Definition: Chara.cs:4683

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

◆ ShouldThrowAway()

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

Definition at line 8528 of file Chara.cs.

8529 {
8530 if (IsPCFaction)
8531 {
8532 if (t.IsFood && t.category.id != "fish" && !t.IsDecayed)
8533 {
8534 return false;
8535 }
8536 if (t.trait.GetHealAction(this) != null)
8537 {
8538 return false;
8539 }
8540 if (t.IsThrownWeapon || t.IsRangedWeapon || t.IsAmmo)
8541 {
8542 return false;
8543 }
8544 if (t.trait is TraitBlanket || t.trait is TraitItemProc || t.trait is TraitBookSkill)
8545 {
8546 return false;
8547 }
8548 }
8549 if (t.isEquipped || t.rarity >= Rarity.Legendary || !t.trait.CanBeDestroyed)
8550 {
8551 return false;
8552 }
8553 if (t.trait is TraitCurrency || t.trait is TraitTool)
8554 {
8555 return false;
8556 }
8557 switch (type)
8558 {
8559 case ClearInventoryType.SellAtTown:
8560 if (!t.isGifted && !t.isNPCProperty)
8561 {
8562 return false;
8563 }
8564 break;
8565 case ClearInventoryType.Purge:
8566 switch (t.category.id)
8567 {
8568 case "fish":
8569 if (EClass.rnd(3) == 0)
8570 {
8571 return true;
8572 }
8573 break;
8574 case "junk":
8575 case "garbage":
8576 if (EClass.rnd(3) != 0)
8577 {
8578 return true;
8579 }
8580 break;
8581 }
8582 if (t.id == "flyer")
8583 {
8584 return true;
8585 }
8586 if (!t.IsDecayed && EClass.rnd(3) == 0)
8587 {
8588 return false;
8589 }
8590 if (!things.IsFull() && t.IsRangedWeapon)
8591 {
8592 return false;
8593 }
8594 break;
8595 }
8596 return true;
8597 }
bool IsThrownWeapon
Definition: Card.cs:2248
bool IsFood
Definition: Card.cs:2178
bool isGifted
Definition: Card.cs:783
virtual Action GetHealAction(Chara c)
Definition: Trait.cs:625

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

7115 {
7116 Zone_Nymelle zone_Nymelle = EClass._zone as Zone_Nymelle;
7117 if (conSuspend != null && IsPCParty)
7118 {
7119 RemoveCondition<ConSuspend>();
7120 }
7121 if (LayerDrama.forceJump == null)
7122 {
7123 if (IsDeadOrSleeping)
7124 {
7125 ShowDialog("_chara", "sleep");
7126 return;
7127 }
7128 if (EClass.pc.isHidden && !CanSee(EClass.pc))
7129 {
7130 ShowDialog("_chara", "invisible");
7131 return;
7132 }
7134 {
7136 ShowDialog("_chara", "give_card");
7137 Thing thing = ThingGen.Create("figure");
7138 thing.MakeFigureFrom(id);
7139 EClass.player.DropReward(thing);
7140 thing = ThingGen.Create("figure3");
7141 thing.MakeFigureFrom(id);
7142 EClass.player.DropReward(thing);
7143 return;
7144 }
7145 if (GetInt(71) == -2)
7146 {
7147 ShowDialog("_chara", "give_lunch");
7148 Thing t = CraftUtil.MakeLoveLunch(this);
7150 SetInt(71, EClass.world.date.GetRaw() + 43200);
7151 return;
7152 }
7153 if (base.isRestrained)
7154 {
7155 ShowDialog("_chara", "strain");
7156 return;
7157 }
7158 if (IsEscorted())
7159 {
7160 ShowDialog("_chara", "escort");
7161 return;
7162 }
7163 if (EClass._zone is Zone_Music)
7164 {
7165 ShowDialog("_chara", "party");
7166 return;
7167 }
7168 if (EClass.game.quests.OnShowDialog(this))
7169 {
7170 return;
7171 }
7172 switch (id)
7173 {
7174 case "loytel":
7175 {
7177 {
7178 EClass.game.quests.Get("pre_debt_runaway").Complete();
7179 EClass.player.flags.loytelEscaped = false;
7180 EClass.game.quests.Add("debt", "loytel");
7181 ShowDialog("loytel", "loytelEscaped");
7182 return;
7183 }
7184 QuestDebt questDebt = EClass.game.quests.Get<QuestDebt>();
7185 if (questDebt != null && questDebt.paid)
7186 {
7187 questDebt.stage++;
7188 if (questDebt.stage > 7)
7189 {
7190 questDebt.stage = 7;
7191 }
7192 ShowDialog("loytel", "debt" + questDebt.stage);
7193 return;
7194 }
7195 break;
7196 }
7197 case "farris":
7198 if (EClass._zone.id == "startVillage" || EClass._zone.id == "startVillage3" || EClass.game.IsSurvival)
7199 {
7200 ShowDialog("farris");
7201 return;
7202 }
7203 switch (EClass.game.quests.GetPhase<QuestExploration>())
7204 {
7205 case -1:
7206 ShowDialog("farris", "nymelle_noQuest");
7207 break;
7208 case 0:
7209 ShowDialog("farris", "nymelle_first");
7210 break;
7211 case 1:
7212 ShowDialog("farris", "home_first");
7213 break;
7214 default:
7215 ShowDialog("farris");
7216 break;
7217 }
7218 return;
7219 case "ashland":
7220 ShowDialog("ashland");
7221 return;
7222 case "fiama":
7223 if (zone_Nymelle != null && zone_Nymelle.IsCrystalLv && EClass.game.quests.GetPhase<QuestExploration>() == 3)
7224 {
7225 SoundManager.ForceBGM();
7226 LayerDrama.ActivateMain("mono", "nymelle_crystal");
7227 }
7229 {
7231 {
7232 EClass.player.flags.fiamaFirstDream = true;
7233 ShowDialog("fiama", "firstDream");
7234 }
7236 {
7237 ShowDialog("fiama", "giveStoryBook").SetOnKill(delegate
7238 {
7239 EClass.player.flags.fiamaStoryBookGiven = true;
7240 EClass.player.DropReward(ThingGen.Create("book_story"));
7241 });
7242 }
7243 else
7244 {
7245 ShowDialog("fiama");
7246 }
7247 }
7248 else
7249 {
7250 ShowDialog("fiama");
7251 }
7252 return;
7253 case "big_sister":
7255 {
7256 ShowDialog("big_sister", "little_saved");
7257 EClass.player.flags.little_saved = false;
7258 return;
7259 }
7261 {
7262 ShowDialog("big_sister", "little_dead");
7263 EClass.player.flags.little_killed = false;
7264 return;
7265 }
7266 break;
7267 }
7268 if (trait is TraitGuildDoorman)
7269 {
7270 string tag = ((trait is TraitDoorman_Fighter) ? "fighter" : ((trait is TraitDoorman_Mage) ? "mage" : "thief"));
7271 ShowDialog("guild_doorman", "main", tag);
7272 return;
7273 }
7274 if (trait is TraitGuildClerk)
7275 {
7276 string tag2 = ((trait is TraitClerk_Fighter) ? "fighter" : ((trait is TraitClerk_Mage) ? "mage" : "thief"));
7277 ShowDialog("guild_clerk", "main", tag2);
7278 return;
7279 }
7280 }
7281 bool flag = true;
7282 if (id == "parttimer_jure" && (!EClass._zone.IsFestival || !(EClass._zone is Zone_Noyel) || EClass.pc.faith == EClass.game.religions.Healing))
7283 {
7284 flag = false;
7285 }
7286 if (flag && File.Exists(CorePath.DramaData + id + ".xlsx"))
7287 {
7288 ShowDialog(id);
7289 }
7290 else
7291 {
7292 ShowDialog("_chara");
7293 }
7294 }
bool CanGiveCard()
Definition: Affinity.cs:63
void MakeFigureFrom(string id)
Definition: Card.cs:5738
void ShowDialog()
Definition: Chara.cs:7114
bool DroppedCard(string id)
Definition: CodexManager.cs:46
void MarkCardDrop(string id)
Definition: CodexManager.cs:41
static string DramaData
Definition: CorePath.cs:178
static Thing MakeLoveLunch(Chara c)
Definition: CraftUtil.cs:220
bool IsSurvival
Definition: Game.cs:276
static string forceJump
Definition: LayerDrama.cs:18
static LayerDrama ActivateMain(string idSheet, string idStep=null, Chara target=null, Card ref1=null, string tag="")
Definition: LayerDrama.cs:61
bool loytelEscaped
Definition: Player.cs:479
int storyFiama
Definition: Player.cs:623
bool little_saved
Definition: Player.cs:443
bool fiamaStoryBookGiven
Definition: Player.cs:299
bool fiamaFirstDream
Definition: Player.cs:311
bool little_killed
Definition: Player.cs:455
CodexManager codex
Definition: Player.cs:1115
bool EnableDreamStory
Definition: Player.cs:1270
Thing DropReward(Thing t, bool silent=false)
Definition: Player.cs:2549
bool paid
Definition: QuestDebt.cs:10
int stage
Definition: QuestDebt.cs:13
bool OnShowDialog(Chara c)
Quest Add(string id, string idGlobalChara=null)
Definition: QuestManager.cs:29
Quest Get(string id)
void Complete()
Definition: Quest.cs:473
ReligionHealing Healing
bool IsCrystalLv
Definition: Zone_Nymelle.cs:25
virtual bool IsFestival
Definition: Zone.cs:209

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

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

◆ ShowDialog() [2/2]

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

Definition at line 7296 of file Chara.cs.

7297 {
7298 return _ShowDialog(book, null, step, tag);
7299 }
LayerDrama _ShowDialog(string book, string sheet, string step="main", string tag="")
Definition: Chara.cs:7301

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

9785 {
9786 RemoveCondition<ConAwakening>();
9787 AddCondition(Condition.Create(100, delegate(ConSleep con)
9788 {
9789 con.pcSleep = 15;
9790 con.pcBed = bed;
9791 con.pcPillow = pillow;
9792 con.pickup = pickup;
9793 con.posBed = posBed;
9794 con.posPillow = posPillow;
9795 }), force: true);
9796 }

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

8165 {
8166 Say("abCatSniff", this, c);
8167 AddCondition<ConHOT>(EClass.curve(50 + c.CHA * 5, 400, 100));
8168 c.ShowEmo(Emo.angry);
8169 ShowEmo(Emo.love);
8170 Talk("sniff");
8171 c.Talk(new string[4] { "labor", "disgust", "scold", "callGuards" }.RandomItem());
8172 }

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

4619 {
4620 return held.Split(a);
4621 }

References Card.Split().

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

◆ Stumble()

void Chara.Stumble ( int  mtp = 100)
inline

Definition at line 1848 of file Chara.cs.

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

3963 {
3964 if (host != null)
3965 {
3966 host.SyncRide();
3967 }
3968 if (ride != null)
3969 {
3970 SyncRide(ride);
3971 }
3972 if (parasite != null)
3973 {
3975 }
3976 }

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

3979 {
3980 if (!c.pos.Equals(pos))
3981 {
3982 if (!pos.IsValid)
3983 {
3984 Debug.LogError("exception: pos is not valid:" + pos?.ToString() + "/" + this);
3985 pos = new Point();
3986 }
3987 EClass._map.MoveCard(pos, c);
3988 }
3989 }

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

◆ TalkTopic()

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

Definition at line 7043 of file Chara.cs.

7044 {
7045 if (host == null && !IsInActiveZone)
7046 {
7047 return null;
7048 }
7049 if (!isSynced && (host == null || !host.isSynced) && topic != "dead")
7050 {
7051 return null;
7052 }
7053 if (IsPCParty)
7054 {
7055 int num = EClass.pc.party.members.Count - 1;
7056 switch (topic)
7057 {
7058 case "calm":
7059 if (EClass.rnd(num * 5) != 0)
7060 {
7061 return null;
7062 }
7063 break;
7064 case "aggro":
7065 if (EClass.rnd(num * 10) != 0)
7066 {
7067 return null;
7068 }
7069 break;
7070 case "kill":
7071 if (EClass.rnd(num * 3) != 0)
7072 {
7073 return null;
7074 }
7075 break;
7076 case "fov":
7077 return null;
7078 }
7079 }
7080 string topicText = GetTopicText(topic);
7081 if (topicText.IsEmpty())
7082 {
7083 return null;
7084 }
7085 string text = "_bracketTalk".lang();
7086 bool flag = topicText.StartsWith("*");
7087 bool flag2 = topicText.StartsWith("(");
7088 bool flag3 = topicText.StartsWith(text) || (topicText.Length > 0 && topicText[0] == text[0]) || topicText[0] == '“';
7089 topicText = ApplyTone(topicText);
7090 topicText = topicText.Replace("~", "*");
7091 Msg.SetColor(flag2 ? Msg.colors.Thinking : (flag3 ? Msg.colors.Talk : Msg.colors.Ono));
7092 Msg.Say(StripTalkSpeiclaCharacters(topicText.Replace("&", "")));
7093 if (topic == "dead")
7094 {
7095 EClass.ui.popGame.PopText(ApplyNewLine(topicText.StripBrackets()), null, "PopTextDead", default(Color), pos.Position() + EClass.setting.render.tc.textPosDead);
7096 }
7097 else if (flag || flag3 || flag2)
7098 {
7099 (host ?? this).renderer.Say(ApplyNewLine(topicText.StripBrackets()), default(Color), IsPCParty ? 0.6f : 0f);
7100 }
7101 return topicText;
7102 }
void Say(string text, Color c=default(Color), float duration=0f)
string ApplyNewLine(string text)
Definition: Card.cs:6858
string StripTalkSpeiclaCharacters(string text)
Definition: Card.cs:6839
string ApplyTone(string text, bool stripPun=false)
Definition: Card.cs:6937
string GetTopicText(string topic="calm")
Definition: Chara.cs:7010
static UI ui
Definition: EClass.cs:17
Color Thinking
Definition: MsgColors.cs:17
Color Talk
Definition: MsgColors.cs:7

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

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

◆ Tick()

override void Chara.Tick ( )
inlinevirtual

Reimplemented from Card.

Definition at line 3991 of file Chara.cs.

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

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

◆ TickConditions()

void Chara.TickConditions ( )
inline

Definition at line 3700 of file Chara.cs.

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

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

Referenced by _Move().

◆ TickCooldown()

void Chara.TickCooldown ( )
inline

Definition at line 8808 of file Chara.cs.

8809 {
8810 for (int num = _cooldowns.Count - 1; num >= 0; num--)
8811 {
8812 if (_cooldowns[num] % 1000 == 1)
8813 {
8814 _cooldowns.RemoveAt(num);
8815 }
8816 else
8817 {
8818 _cooldowns[num]--;
8819 }
8820 }
8821 if (_cooldowns.Count == 0)
8822 {
8823 _cooldowns = null;
8824 }
8825 }

◆ TickWork()

void Chara.TickWork ( VirtualDate  date)
inline

Definition at line 9228 of file Chara.cs.

9229 {
9231 if (span != TimeTable.Span.Work && span != 0)
9232 {
9233 return;
9234 }
9235 WorkSummary workSummary = GetWorkSummary();
9236 if (span == TimeTable.Span.Work)
9237 {
9238 if (workSummary.work != null)
9239 {
9240 PerformWork(workSummary.work, isHobby: false, date.IsRealTime);
9241 }
9242 }
9243 else if (workSummary.hobbies.Count > 0)
9244 {
9245 PerformWork(workSummary.hobbies.RandomItem(), isHobby: true, date.IsRealTime);
9246 }
9247 }
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 1174 of file Chara.cs.

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

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

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

◆ TryAbsorbRod()

void Chara.TryAbsorbRod ( Thing  t)
inline

Definition at line 4406 of file Chara.cs.

4407 {
4408 if (!IsPC || !(t.trait is TraitRod) || t.c_charges <= 0 || !HasElement(1564))
4409 {
4410 return;
4411 }
4412 Say("absorbRod", this, t);
4413 TraitRod rod = t.trait as TraitRod;
4414 bool flag = false;
4415 if (rod.source != null)
4416 {
4417 using IEnumerator<SourceElement.Row> enumerator = EClass.sources.elements.rows.Where((SourceElement.Row a) => a.id == rod.source.id).GetEnumerator();
4418 if (enumerator.MoveNext())
4419 {
4420 SourceElement.Row current = enumerator.Current;
4421 if (IsPC)
4422 {
4423 GainAbility(current.id, t.c_charges * 100, t);
4424 flag = true;
4425 }
4426 }
4427 }
4428 if (!flag)
4429 {
4430 mana.Mod(-50 * t.c_charges);
4431 }
4432 t.c_charges = 0;
4434 }
int c_charges
Definition: Card.cs:1270
void GainAbility(int ele, int mtp=100, Thing origin=null)
Definition: Chara.cs:10165

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

7405 {
7406 if (!IsPCFaction && !IsGuest())
7407 {
7408 return null;
7409 }
7410 foreach (Card item in EClass._map.props.installed.all)
7411 {
7412 if (item.trait is TraitBed traitBed && traitBed.CanAssign(this))
7413 {
7414 traitBed.AddHolder(this);
7415 Msg.Say("claimBed", this);
7416 return traitBed;
7417 }
7418 }
7419 return null;
7420 }
bool CanAssign(Chara c)
Definition: TraitBed.cs:165

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

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

◆ TryDropBossLoot()

void Chara.TryDropBossLoot ( )
inline

Definition at line 5664 of file Chara.cs.

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

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

Referenced by ActEffect.Proc().

◆ TryDropCarryOnly()

void Chara.TryDropCarryOnly ( )
inline

Definition at line 4623 of file Chara.cs.

4624 {
4625 if (held != null && held.trait.CanOnlyCarry)
4626 {
4627 DropHeld();
4628 }
4629 foreach (Thing item in things.List((Thing t) => t.trait.CanOnlyCarry))
4630 {
4631 DropThing(item);
4632 }
4633 }
void DropThing(Thing t, int num=-1)
Definition: Chara.cs:4655

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

◆ TryEquip()

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

Definition at line 7803 of file Chara.cs.

7804 {
7805 if (!ShouldEquip(t, useFav))
7806 {
7807 return false;
7808 }
7809 if (t.category.slot == 0)
7810 {
7811 return false;
7812 }
7813 if (useFav)
7814 {
7815 BodySlot slot = body.GetSlot(t);
7816 switch (GetFavAttackStyle())
7817 {
7818 case AttackStyle.Default:
7819 case AttackStyle.TwoHand:
7820 if (t.IsMeleeWeapon)
7821 {
7822 slot = body.slotMainHand;
7823 }
7824 break;
7825 case AttackStyle.Shield:
7826 if (t.IsMeleeWeapon)
7827 {
7828 slot = body.slotMainHand;
7829 }
7830 break;
7831 }
7832 body.Equip(t, slot);
7833 }
7834 else
7835 {
7836 body.Equip(t);
7837 }
7838 Say("equip", this, t);
7839 return true;
7840 }
bool ShouldEquip(Thing t, bool useFav=false)
Definition: Chara.cs:7691

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

7924 {
7925 if (IsPC)
7926 {
7928 if (thing?.trait is TraitToolRange && CanEquipRanged(thing))
7929 {
7930 ranged = thing;
7931 return true;
7932 }
7933 return false;
7934 }
7935 if (ranged != null && ranged.parent == this)
7936 {
7937 return true;
7938 }
7940 return ranged != null;
7941 }
Thing GetBestRangedWeapon()
Definition: Chara.cs:7908

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

7848 {
7849 Thing dest = null;
7850 if (IsPC)
7851 {
7853 {
7854 return FindThrowable(hotbar: true);
7855 }
7856 return null;
7857 }
7858 things.Foreach(delegate(Thing t)
7859 {
7860 if (t.HasTag(CTAG.throwWeapon) || (!base.IsPCFactionOrMinion && t.HasTag(CTAG.throwWeaponEnemy)))
7861 {
7862 dest = t;
7863 }
7864 });
7865 return dest;
7866 Thing FindThrowable(bool hotbar)
7867 {
7868 things.Foreach(delegate(Thing t)
7869 {
7870 if (dest == null)
7871 {
7872 if (t.IsHotItem)
7873 {
7874 if (!hotbar)
7875 {
7876 return;
7877 }
7878 }
7879 else if (hotbar)
7880 {
7881 return;
7882 }
7883 if (t.HasTag(CTAG.throwWeapon))
7884 {
7885 dest = t;
7886 }
7887 }
7888 });
7889 return dest;
7890 }
7891 }

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

4485 {
4486 if (held == t)
4487 {
4488 return true;
4489 }
4490 if (t.isDestroyed || t.Num <= 0)
4491 {
4492 return false;
4493 }
4494 if (!CanPick(t))
4495 {
4496 if (t.parent == null)
4497 {
4498 EClass._zone.AddCard(t, pos);
4499 }
4500 return false;
4501 }
4502 HoldCard(t, num);
4503 return true;
4504 }
bool CanPick(Card c)
Definition: Chara.cs:4304
void HoldCard(Card t, int num=-1)
Definition: Chara.cs:4506

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

8070 {
8071 int num = Evalue(289);
8072 if (num == 0)
8073 {
8074 return false;
8075 }
8076 int lV = t.LV;
8077 if (EClass.rnd(num * num + 5) > EClass.rnd(lV * lV) * 20)
8078 {
8079 t.Identify(show, (num >= 20) ? IDTSource.SkillHigh : IDTSource.Skill);
8080 int num2 = 50;
8081 if (lV > num)
8082 {
8083 num2 += (lV - num) * 10;
8084 }
8085 elements.ModExp(289, Mathf.Min(num2, 1000));
8086 return true;
8087 }
8088 return false;
8089 }
IDTSource
Definition: IDTSource.cs:2
Thing Identify(bool show=true, IDTSource idtSource=IDTSource.Identify)
Definition: Thing.cs:2087

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

Referenced by Player.OnAdvanceHour().

◆ TryMove()

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

Definition at line 2736 of file Chara.cs.

2737 {
2738 foreach (Condition condition in conditions)
2739 {
2740 if (!condition.TryMove(newPoint))
2741 {
2742 return MoveResult.Fail;
2743 }
2744 }
2745 if (base.isRestrained)
2746 {
2747 if (!IsPC)
2748 {
2749 return MoveResult.Fail;
2750 }
2751 base.isRestrained = false;
2752 }
2753 if (!CanMoveTo(newPoint, allowDestroyPath))
2754 {
2755 return MoveResult.Fail;
2756 }
2757 return _Move(newPoint);
2758 }
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 2696 of file Chara.cs.

2697 {
2699 {
2700 return MoveResult.Fail;
2701 }
2702 Point point = p.Copy();
2703 int num = p.x - pos.x;
2704 int num2 = p.z - pos.z;
2705 if (num > 1)
2706 {
2707 num = 1;
2708 }
2709 else if (num < -1)
2710 {
2711 num = -1;
2712 }
2713 if (num2 > 1)
2714 {
2715 num2 = 1;
2716 }
2717 else if (num2 < -1)
2718 {
2719 num2 = -1;
2720 }
2721 if (num == 0 && num2 == 0)
2722 {
2723 num = EClass.rnd(3) - 1;
2724 num2 = EClass.rnd(3) - 1;
2725 }
2726 point.Set(pos);
2727 point.x -= num;
2728 point.z -= num2;
2729 if (point.IsValid && !point.HasChara)
2730 {
2731 return TryMove(point, allowDestroyPath: false);
2732 }
2733 return MoveResult.Fail;
2734 }
bool TooHeavyToMove()
Definition: Player.cs:2560

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

2635 {
2636 if (p.Equals(pos))
2637 {
2638 return MoveResult.Success;
2639 }
2641 {
2642 return MoveResult.Fail;
2643 }
2644 bool flag = true;
2645 Point point = null;
2646 _sharedPos.Set(p);
2647 if (CanDestroyPath())
2648 {
2650 {
2651 return MoveResult.Success;
2652 }
2653 Debug.Log(CanMoveTo(pos));
2655 }
2656 int num = pos.Distance(p);
2657 PathProgress pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Default, num + 4, 1);
2658 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 4)
2659 {
2660 PathFinderNode pathFinderNode = pathProgress.nodes[pathProgress.nodes.Count - 1];
2661 if (TryMove(new Point(pathFinderNode.X, pathFinderNode.Z)) == MoveResult.Success)
2662 {
2663 return MoveResult.Success;
2664 }
2665 }
2666 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Combat, num + 4, 1);
2667 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 4)
2668 {
2669 PathFinderNode pathFinderNode2 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2670 if (TryMove(new Point(pathFinderNode2.X, pathFinderNode2.Z)) == MoveResult.Success)
2671 {
2672 return MoveResult.Success;
2673 }
2674 }
2675 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Default, num + 25, 2);
2676 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 25)
2677 {
2678 PathFinderNode pathFinderNode3 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2679 if (TryMove(new Point(pathFinderNode3.X, pathFinderNode3.Z)) == MoveResult.Success)
2680 {
2681 return MoveResult.Success;
2682 }
2683 }
2684 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Combat, num + 25, 2);
2685 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 25)
2686 {
2687 PathFinderNode pathFinderNode4 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2688 if (TryMove(new Point(pathFinderNode4.X, pathFinderNode4.Z)) == MoveResult.Success)
2689 {
2690 return MoveResult.Success;
2691 }
2692 }
2693 return MoveResult.Fail;
2694 }
static Point _sharedPos
Definition: Chara.cs:176
void RequestPathImmediate(PathProgress progress)
Definition: PathManager.cs:41
List< PathFinderNode > nodes
Definition: PathProgress.cs:16
Point GetPointTowards(Point dest)
Definition: Point.cs:801

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

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

◆ TryNeckHunt()

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

Definition at line 9715 of file Chara.cs.

9716 {
9717 if (TC == null || TC.HasCondition<ConInvulnerable>() || TC.Evalue(1421) > 0 || !TC.ExistsOnMap)
9718 {
9719 return false;
9720 }
9721 if (TC.hp > (long)TC.MaxHP * (long)(Mathf.Min(5 + (int)Mathf.Sqrt(power), harvest ? 35 : 25) + Evalue(1426) * 5) / 100)
9722 {
9723 return false;
9724 }
9725 if (TC.HasElement(427))
9726 {
9727 return false;
9728 }
9729 if (TC.IsPC && EClass.player.invlunerable)
9730 {
9731 return false;
9732 }
9733 PlaySound("hit_finish");
9734 Say("finish");
9735 Say("finish2", this, TC);
9736 TC.DamageHP(TC.MaxHP, AttackSource.Finish, this);
9737 return false;
9738 }
@ harvest
bool invlunerable
Definition: Player.cs:1173
Definition: TC.cs:4

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

Referenced by ActEffect.Proc().

◆ TryNullifyCurse()

bool Chara.TryNullifyCurse ( )
inline

Definition at line 10189 of file Chara.cs.

10190 {
10191 if (IsPCParty)
10192 {
10193 foreach (Chara member in EClass.pc.party.members)
10194 {
10195 if (member.HasElement(1641) && EClass.rnd(3) != 0)
10196 {
10197 Msg.Say("curse_nullify", member);
10198 return true;
10199 }
10200 }
10201 }
10202 else if (HasElement(1641) && EClass.rnd(3) != 0)
10203 {
10204 Say("curse_nullify", this);
10205 return true;
10206 }
10207 if (GetCondition<ConHolyVeil>() != null && EClass.rnd(5) != 0)
10208 {
10209 Say("curse_nullify", this);
10210 return true;
10211 }
10212 return false;
10213 }

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

◆ TryPickGroundItem()

void Chara.TryPickGroundItem ( )
inline

Definition at line 4460 of file Chara.cs.

4461 {
4462 foreach (Card item in pos.ListCards())
4463 {
4464 if ((IsPC || !(EClass.pc.ai is AI_UseCrafter aI_UseCrafter) || !aI_UseCrafter.ings.Contains(item)) && item.isThing && item.placeState == PlaceState.roaming && CanPick(item))
4465 {
4466 Thing thing = Pick(item.Thing);
4467 if (thing != null && !IsPC)
4468 {
4469 thing.isNPCProperty = true;
4470 }
4471 break;
4472 }
4473 }
4474 }

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

Referenced by AI_Fish.Run().

◆ TryPoisonPotion()

Thing Chara.TryPoisonPotion ( Thing  t)
inline

Definition at line 4392 of file Chara.cs.

4393 {
4394 if (t.trait is TraitPotion && t.id != "1165" && !t.source.tag.Contains("neg") && EClass.rnd(2) == 0 && HasElement(1565))
4395 {
4396 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)
4397 .id;
4398 Say("poisonDrip", this);
4399 int num = t.Num;
4400 t.Destroy();
4401 t = ThingGen.Create(text).SetNum(num);
4402 }
4403 return t;
4404 }
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 3252 of file Chara.cs.

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

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

Referenced by _Move().

◆ TryPutShared()

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

Definition at line 4476 of file Chara.cs.

4477 {
4478 if (!EClass._zone.TryAddThingInSharedContainer(t, containers) && dropIfFail)
4479 {
4480 EClass._zone.AddCard(t, pos);
4481 }
4482 }
bool TryAddThingInSharedContainer(Thing t, List< Thing > containers=null, bool add=true, bool msg=false, Chara chara=null, bool sharedOnly=true)
Definition: Zone.cs:2141

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

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

7423 {
7424 if (GetInt(113) != 0)
7425 {
7426 return;
7427 }
7428 _ListItems.Clear();
7429 Thing bestRangedWeapon = GetBestRangedWeapon();
7430 foreach (Thing thing in things)
7431 {
7432 if (!thing.IsAmmo)
7433 {
7434 if (thing.category.slot != 0 && !thing.isEquipped && !thing.HasTag(CTAG.gift))
7435 {
7436 _ListItems.Add(thing);
7437 }
7438 else if (thing.IsRangedWeapon && thing.category.slot == 0 && bestRangedWeapon != thing)
7439 {
7440 _ListItems.Add(thing);
7441 }
7442 }
7443 }
7444 if (_ListItems.Count == 0)
7445 {
7446 return;
7447 }
7448 List<Thing> containers2 = containers.ToList();
7449 foreach (Thing listItem in _ListItems)
7450 {
7451 EClass._zone.TryAddThingInSharedContainer(listItem, containers2, add: true, msg: true, this);
7452 }
7453 }
void Add(Act a, string s="")
Definition: ActPlan.cs:11
static List< Thing > _ListItems
Definition: Chara.cs:192

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

4437 {
4438 if (t.id == "axe")
4439 {
4440 Tutorial.Reserve("tool");
4441 }
4442 if (t.category.id == "mushroom")
4443 {
4444 Tutorial.Reserve("food");
4445 }
4446 if (t.category.id == "herb")
4447 {
4448 Tutorial.Reserve("herb");
4449 }
4450 if (t.id == "pasture")
4451 {
4452 Tutorial.Reserve("pasture");
4453 }
4454 if (t.id == "log")
4455 {
4456 Tutorial.Reserve("process");
4457 }
4458 }

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

◆ TryRestock()

void Chara.TryRestock ( bool  onCreate)
inline

Definition at line 4717 of file Chara.cs.

4718 {
4719 isOnCreate = onCreate;
4720 if (onCreate || (!IsPCFaction && (base.IsUnique || trait is TraitAdventurer || trait is TraitGuard)))
4721 {
4722 RestockEquip((!EClass.core.IsGameStarted || !(EClass._zone is Zone_Music)) && onCreate);
4723 }
4724 RestockInventory(onCreate);
4725 }
void RestockInventory(bool onCreate)
Definition: Chara.cs:5029
void RestockEquip(bool onCreate)
Definition: Chara.cs:4727

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

6378 {
6379 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))
6380 {
6381 SetEnemy(c);
6382 }
6383 }

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

7461 {
7463 }
void TryTakeSharedItems(bool msg=true)
Definition: Chara.cs:7460

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

7466 {
7467 if (base.isSummon || (memberType == FactionMemberType.Livestock && homeBranch != null && !homeBranch.policies.IsActive(2715)))
7468 {
7469 return;
7470 }
7471 int num = 2;
7472 int num2 = 1;
7473 int num3 = 2;
7474 bool flag = GetInt(113) == 0;
7475 int num4 = 2;
7476 int num5 = 2;
7477 int num6 = 2;
7479 {
7480 num5 = 0;
7481 num6 = 0;
7482 }
7483 foreach (Thing thing3 in things)
7484 {
7485 if (CanEat(thing3, shouldEat))
7486 {
7487 if (thing3.HasElement(757))
7488 {
7489 num2 -= thing3.Num;
7490 num -= thing3.Num;
7491 }
7492 else
7493 {
7494 num -= thing3.Num;
7495 }
7496 }
7497 if (thing3.trait.GetHealAction(this) != null)
7498 {
7499 num3 -= thing3.Num;
7500 }
7501 if (thing3.id == "polish_powder")
7502 {
7503 num4 -= thing3.Num;
7504 }
7505 if (thing3.trait is TraitBlanketColdproof)
7506 {
7507 num5 -= thing3.Num;
7508 }
7509 if (thing3.trait is TraitBlanketFireproof)
7510 {
7511 num6 -= thing3.Num;
7512 }
7513 }
7514 _ListItems.Clear();
7515 foreach (Thing container in containers)
7516 {
7517 if (!container.IsSharedContainer)
7518 {
7519 continue;
7520 }
7521 foreach (Thing thing4 in container.things)
7522 {
7523 if (!thing4.c_isImportant && thing4.IsIdentified && thing4 != EClass.pc.held)
7524 {
7525 if (num4 > 0 && thing4.id == "polish_powder")
7526 {
7527 _ListItems.Add(thing4);
7528 num4 -= thing4.Num;
7529 }
7530 else if (num5 > 0 && !HasElement(1236) && thing4.trait is TraitBlanketColdproof)
7531 {
7532 _ListItems.Add(thing4);
7533 num5 -= thing4.Num;
7534 }
7535 else if (num6 > 0 && thing4.trait is TraitBlanketFireproof)
7536 {
7537 _ListItems.Add(thing4);
7538 num6 -= thing4.Num;
7539 }
7540 else if (num2 > 0 && CanEat(thing4, shouldEat) && !thing4.c_isImportant && thing4.HasElement(757))
7541 {
7542 _ListItems.Add(thing4);
7543 num2 -= thing4.Num;
7544 }
7545 else if (num > 0 && CanEat(thing4, shouldEat) && !thing4.c_isImportant)
7546 {
7547 _ListItems.Add(thing4);
7548 num -= thing4.Num;
7549 }
7550 else if (num3 > 0 && thing4.trait.GetHealAction(this) != null)
7551 {
7552 _ListItems.Add(thing4);
7553 num3 -= thing4.Num;
7554 }
7555 else if (flag && thing4.IsEquipmentOrRanged && !thing4.HasTag(CTAG.gift) && ShouldEquip(thing4, useFav: true))
7556 {
7557 _ListItems.Add(thing4);
7558 }
7559 }
7560 }
7561 }
7562 if (_ListItems.Count == 0)
7563 {
7564 return;
7565 }
7566 _ListItems.ForeachReverse(delegate(Thing t)
7567 {
7568 if (t.IsEquipmentOrRanged)
7569 {
7570 bool flag3 = false;
7571 int slot = t.category.slot;
7572 int equipValue = t.GetEquipValue();
7573 foreach (Thing listItem in _ListItems)
7574 {
7575 if (listItem.category.slot == slot && listItem.GetEquipValue() > equipValue)
7576 {
7577 flag3 = true;
7578 break;
7579 }
7580 }
7581 if (flag3)
7582 {
7583 _ListItems.Remove(t);
7584 }
7585 }
7586 });
7587 bool flag2 = false;
7588 foreach (Thing listItem2 in _ListItems)
7589 {
7590 Thing thing = listItem2;
7591 if (things.IsFull(thing))
7592 {
7593 break;
7594 }
7595 Thing thing2 = listItem2.parent as Thing;
7596 if (thing.HasElement(757))
7597 {
7598 if (thing.Num > 1)
7599 {
7600 thing = thing.Split(1);
7601 }
7602 }
7603 else if (thing.Num > 2)
7604 {
7605 thing = thing.Split(2);
7606 }
7607 if (msg)
7608 {
7609 Say("takeSharedItem", this, thing, thing2.GetName(NameStyle.Full));
7610 }
7611 AddCard(thing);
7612 if (ShouldEquip(thing, useFav: true) && thing.category.slot != 0)
7613 {
7614 TryEquip(thing, useFav: true);
7615 flag2 = true;
7616 }
7617 }
7618 if (flag2 && flag)
7619 {
7620 TryPutSharedItems(containers);
7621 }
7622 }
bool IsIdentified
Definition: Card.cs:2380
bool HasItemProtection
bool IsActive(int id, int days=-1)
bool IsSharedContainer
Definition: Thing.cs:113

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

◆ TryUpgrade()

void Chara.TryUpgrade ( bool  msg = true)
inline

Definition at line 8627 of file Chara.cs.

8628 {
8629 if (!EClass.debug.enable || IsPC || !IsGlobal || !IsPCFaction)
8630 {
8631 return;
8632 }
8633 for (int i = 0; i < 100; i++)
8634 {
8635 if (base.feat == 0)
8636 {
8637 break;
8638 }
8639 if (base.c_upgrades == null)
8640 {
8641 base.c_upgrades = new CharaUpgrade();
8642 }
8643 if (base.c_upgrades.halt)
8644 {
8645 break;
8646 }
8647 Rand.SetSeed(base.uid + base.c_upgrades.count);
8648 int num = EClass.rnd(100);
8649 int num2 = 0;
8650 int num3 = 1;
8651 int num4 = 0;
8652 bool flag = false;
8653 IEnumerable<SourceElement.Row> ie = EClass.sources.elements.rows.Where((SourceElement.Row a) => !elements.Has(a) && a.category == "skill" && !a.tag.Contains("noPet"));
8654 List<Element> list = ListAvailabeFeats(pet: true);
8655 if (num >= 90 && list.Count > 0)
8656 {
8657 Element element = list.RandomItem();
8658 num2 = element.id;
8659 num4 = element.CostLearn;
8660 }
8661 else if (num >= 60 && ie.Any())
8662 {
8663 num2 = ie.RandomItem().id;
8664 num4 = 3;
8665 }
8666 else
8667 {
8668 num2 = Element.List_MainAttributesMajor.RandomItem();
8669 num4 = 1;
8670 num3 = 2;
8671 flag = true;
8672 }
8673 Rand.SetSeed();
8674 if (num4 > base.feat)
8675 {
8676 break;
8677 }
8678 base.feat -= num4;
8679 base.c_upgrades.count++;
8680 base.c_upgrades.spent += num4;
8681 bool flag2 = false;
8682 if (flag)
8683 {
8684 foreach (CharaUpgrade.Item item in base.c_upgrades.items)
8685 {
8686 if (item.idEle == num2)
8687 {
8688 item.value += num3;
8689 item.cost += num4;
8690 flag2 = true;
8691 break;
8692 }
8693 }
8694 }
8695 if (!flag2)
8696 {
8697 base.c_upgrades.items.Add(new CharaUpgrade.Item
8698 {
8699 idEle = num2,
8700 value = num3,
8701 cost = num4
8702 });
8703 }
8704 SourceElement.Row row = EClass.sources.elements.map[num2];
8705 if (row.category == "feat")
8706 {
8707 SetFeat(num2, elements.ValueWithoutLink(num2) + 1, msg: true);
8708 }
8709 else if (elements.ValueWithoutLink(row.id) == 0)
8710 {
8711 elements.Learn(row.id);
8712 }
8713 else
8714 {
8715 elements.ModBase(num2, num3);
8716 }
8717 }
8718 }
List< Element > ListAvailabeFeats(bool pet=false, bool showAll=false)
Definition: Chara.cs:9950
void Learn(int ele, int v=1)
virtual int CostLearn
Definition: ELEMENT.cs:319
static int[] List_MainAttributesMajor
Definition: ELEMENT.cs:247
static void SetSeed(int a=-1)
Definition: Rand.cs:37

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

Referenced by WindowCharaMini.Refresh().

◆ TryUse()

bool Chara.TryUse ( Thing  t)
inline

Definition at line 7952 of file Chara.cs.

7953 {
7954 if (t.id == "338" && t.blessedState >= BlessedState.Normal)
7955 {
7956 Thing thing = things.Find((Thing a) => a.IsEquipmentOrRanged && !a.isAcidproof);
7957 if (thing != null)
7958 {
7959 Say("dip", this, thing, t.GetName(NameStyle.Full, 1));
7960 SE.Change();
7961 t.trait.OnBlend(thing, this);
7962 return true;
7963 }
7964 return false;
7965 }
7966 if (t.IsNegativeGift || t.source.HasTag(CTAG.ignoreUse))
7967 {
7968 return false;
7969 }
7970 if (t.id == "cigar")
7971 {
7972 (t.trait as TraitItemProc).OnUse(this);
7973 return true;
7974 }
7975 if (t.trait.CanEat(this) && hunger.GetPhase() > ((IsPCFaction || IsPCFactionMinion) ? 2 : 0))
7976 {
7978 {
7979 target = t
7980 });
7981 return true;
7982 }
7983 if (t.trait.CanDrink(this))
7984 {
7985 Drink(t);
7986 return true;
7987 }
7988 if (t.trait.CanRead(this))
7989 {
7991 {
7992 target = t
7993 });
7994 return true;
7995 }
7996 if (base.hp < MaxHP * 90 / 100)
7997 {
7998 Action healAction = t.trait.GetHealAction(this);
7999 if (healAction != null)
8000 {
8001 healAction();
8002 return true;
8003 }
8004 }
8005 return false;
8006 }
bool isAcidproof
Definition: Card.cs:687
void SetAIImmediate(AIAct g)
Definition: Chara.cs:8988
virtual bool CanRead(Chara c)
Definition: Trait.cs:991
virtual bool CanDrink(Chara c)
Definition: Trait.cs:1009
virtual void OnBlend(Thing t, Chara c)
Definition: Trait.cs:635

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

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

◆ TryWorkOutside()

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

Definition at line 9249 of file Chara.cs.

9250 {
9251 if (EClass.world.date.IsExpired(GetInt(51)))
9252 {
9253 Expedition expedition = Expedition.Create(this, sourceWork.expedition.ToEnum<ExpeditionType>());
9254 SetInt(51, EClass.world.date.GetRaw() + 60 * (expedition.hours + 24));
9255 homeBranch.expeditions.Add(expedition);
9256 return true;
9257 }
9258 return false;
9259 }
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 3611 of file Chara.cs.

3612 {
3613 if (IsPCC)
3614 {
3615 if (base.dir == 0)
3616 {
3617 angle = 225f;
3618 }
3619 else if (base.dir == 1)
3620 {
3621 angle = 135f;
3622 }
3623 else if (base.dir == 2)
3624 {
3625 angle = 45f;
3626 }
3627 else if (base.dir == 3)
3628 {
3629 angle = -45f;
3630 }
3631 }
3632 else if (base.dir == 0)
3633 {
3634 angle = 165f;
3635 }
3636 else if (base.dir == 1)
3637 {
3638 angle = 300f;
3639 }
3640 else if (base.dir == 2)
3641 {
3642 angle = 0f;
3643 }
3644 else if (base.dir == 3)
3645 {
3646 angle = 120f;
3647 }
3648 }

Referenced by OnDeserialized().

◆ UpdateSight()

void Chara.UpdateSight ( )
inline

Definition at line 3672 of file Chara.cs.

3673 {
3674 int num = 4;
3675 for (int i = -num; i < num + 1; i++)
3676 {
3677 for (int j = -num; j < num + 1; j++)
3678 {
3679 shared.Set(pos.x + i, pos.z + j);
3680 if (shared.IsValid && !shared.cell.isSeen && i >= -1 && i <= 1 && j >= -1)
3681 {
3682 _ = 1;
3683 }
3684 }
3685 }
3686 }
bool isSeen
Definition: Cell.cs:282
static Point shared
Definition: Chara.cs:11

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

◆ UseAbility() [1/3]

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

Definition at line 5895 of file Chara.cs.

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

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

◆ UseAbility() [2/3]

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

◆ UseAbility() [3/3]

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

Definition at line 5890 of file Chara.cs.

5891 {
5892 return UseAbility(elements.GetElement(idAct)?.act ?? ACT.Create(idAct), tc, pos, pt);
5893 }

References ACT.Create().

◆ ValidateWorks()

void Chara.ValidateWorks ( )
inline

Definition at line 9297 of file Chara.cs.

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

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

Referenced by Zone.Deactivate().

◆ Vomit()

void Chara.Vomit ( )
inline

Definition at line 5314 of file Chara.cs.

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

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

3689 {
3690 for (int num = conditions.Count - 1; num >= 0; num--)
3691 {
3692 if (conditions[num].ConsumeTurn)
3693 {
3694 return true;
3695 }
3696 }
3697 return false;
3698 }

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

7347 {
7348 n.Clear();
7349 UIItem uIItem = n.AddHeaderCard(base.Name.ToTitleCase());
7350 SetImage(uIItem.image2);
7351 uIItem.text2.SetText(race.GetText().ToTitleCase(wholeText: true) + " " + job.GetText().ToTitleCase(wholeText: true));
7352 n.AddText("");
7353 n.Build();
7354 }
void SetImage(Image image, int dir, int idSkin=0)
Definition: Card.cs:6155
Definition: UIItem.cs:5
Image image2
Definition: UIItem.cs:16
UIText text2
Definition: UIItem.cs:8
UIItem AddHeaderCard(string text, Sprite sprite=null)
Definition: UINote.cs:84
void Clear()
Definition: UINote.cs:35
UIItem AddText(string text, FontColor color=FontColor.DontChange)
Definition: UINote.cs:113
void Build()
Definition: UINote.cs:49
void SetText(string s)
Definition: UIText.cs:159

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

Member Data Documentation

◆ _ability

CharaAbility Chara._ability

Definition at line 96 of file Chara.cs.

Referenced by SetMainElement().

◆ _baseWorkElements

ElementContainer Chara._baseWorkElements

Definition at line 206 of file Chara.cs.

◆ _cbits1

BitArray32 Chara._cbits1

Definition at line 84 of file Chara.cs.

Referenced by OnSerializing().

◆ _cints

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

Definition at line 82 of file Chara.cs.

Referenced by OnDeserialized(), and OnSerializing().

◆ _cooldowns

List<int> Chara._cooldowns

◆ _faction

Faction Chara._faction
private

Definition at line 158 of file Chara.cs.

Referenced by SetFaction().

◆ _goalHobby

GoalHobby Chara._goalHobby = new GoalHobby()
staticprivate

Definition at line 210 of file Chara.cs.

◆ _goalWork

GoalWork Chara._goalWork = new GoalWork()
staticprivate

Definition at line 208 of file Chara.cs.

◆ _historyFood

List<List<string> > Chara._historyFood

Definition at line 64 of file Chara.cs.

◆ _hobbies

List<int> Chara._hobbies

Definition at line 49 of file Chara.cs.

◆ _isLevitating

bool Chara._isLevitating

Definition at line 136 of file Chara.cs.

Referenced by HasHigherGround(), and Refresh().

◆ _job

SourceJob.Row Chara._job

Definition at line 164 of file Chara.cs.

Referenced by ChangeJob(), and OnCreate().

◆ _listAbility

List<int> Chara._listAbility

◆ _listFavCat

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

Definition at line 196 of file Chara.cs.

◆ _listFavFood

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

Definition at line 194 of file Chara.cs.

◆ _ListItems

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

Definition at line 192 of file Chara.cs.

◆ _NoGoalPC

NoGoal Chara._NoGoalPC = new NoGoal()
static

Definition at line 198 of file Chara.cs.

◆ _NoGoalRepeat

NoGoal Chara._NoGoalRepeat = new NoGoal()
static

Definition at line 200 of file Chara.cs.

Referenced by ActPlan.Item.Perform().

◆ _pts

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

Definition at line 188 of file Chara.cs.

◆ _race

SourceRace.Row Chara._race

Definition at line 162 of file Chara.cs.

Referenced by ChangeRace(), and OnCreate().

◆ _sharedPos

Point Chara._sharedPos = new Point()
staticprivate

Definition at line 176 of file Chara.cs.

Referenced by TryMoveTowards().

◆ _Speed

long Chara._Speed
private

Definition at line 174 of file Chara.cs.

Referenced by RefreshSpeed().

◆ _strs

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

Definition at line 79 of file Chara.cs.

◆ _tactics

Tactics Chara._tactics

Definition at line 166 of file Chara.cs.

◆ _works

List<int> Chara._works

Definition at line 52 of file Chara.cs.

◆ _workSummary

WorkSummary Chara._workSummary

Definition at line 55 of file Chara.cs.

◆ actTime

float Chara.actTime = 0.3f

Definition at line 180 of file Chara.cs.

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

◆ ai

◆ body

◆ bossText

bool Chara.bossText

Definition at line 146 of file Chara.cs.

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

◆ calmCheckTurn

int Chara.calmCheckTurn

Definition at line 118 of file Chara.cs.

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

◆ canSeeInvisible

bool Chara.canSeeInvisible

Definition at line 140 of file Chara.cs.

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

◆ combatCount

int Chara.combatCount

Definition at line 116 of file Chara.cs.

◆ conditions

◆ conSleep

◆ consumeTurn

bool Chara.consumeTurn
static

Definition at line 182 of file Chara.cs.

◆ conSuspend

◆ contribution

int Chara.contribution

Definition at line 18 of file Chara.cs.

Referenced by OnCreate().

◆ dirtySpeed

bool Chara.dirtySpeed = true

Definition at line 172 of file Chara.cs.

Referenced by RefreshSpeed(), and SetDirtySpeed().

◆ emoIcon

Emo2 Chara.emoIcon

Definition at line 108 of file Chara.cs.

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

◆ enemy

◆ faithElements

◆ global

◆ goalList

GoalList Chara.goalList = new GoalList()

Definition at line 202 of file Chara.cs.

◆ happiness

int Chara.happiness

Definition at line 110 of file Chara.cs.

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

◆ hasMovedThisTurn

bool Chara.hasMovedThisTurn
private

Definition at line 178 of file Chara.cs.

Referenced by _Move().

◆ hasTelepathy

bool Chara.hasTelepathy

◆ held

◆ host

◆ idleActTimer

int Chara.idleActTimer

Definition at line 114 of file Chara.cs.

Referenced by AI_Idle.Run().

◆ idleTimer

float Chara.idleTimer

Definition at line 122 of file Chara.cs.

Referenced by CharaRenderer.UpdatePosition().

◆ IDTimeTable

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

Definition at line 15 of file Chara.cs.

◆ ignoreSPAbsorb

bool Chara.ignoreSPAbsorb

Definition at line 148 of file Chara.cs.

◆ isBerserk

bool Chara.isBerserk

◆ isBlind

◆ isConfused

◆ isCreated

bool Chara.isCreated

Definition at line 138 of file Chara.cs.

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

◆ isDrunk

bool Chara.isDrunk

Definition at line 126 of file Chara.cs.

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

◆ isFainted

bool Chara.isFainted

Definition at line 130 of file Chara.cs.

◆ isOnCreate

bool Chara.isOnCreate
static

Definition at line 186 of file Chara.cs.

◆ isParalyzed

bool Chara.isParalyzed

Definition at line 134 of file Chara.cs.

Referenced by Point.ListWitnesses().

◆ isWeakToSunlight

bool Chara.isWeakToSunlight

Definition at line 154 of file Chara.cs.

Referenced by Refresh().

◆ isWet

bool Chara.isWet

◆ lastPos

Point Chara.lastPos = new Point()

Definition at line 90 of file Chara.cs.

Referenced by _Move().

◆ ListAdvJob

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

Definition at line 170 of file Chara.cs.

Referenced by OnCreate().

◆ ListAdvRace

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

Definition at line 168 of file Chara.cs.

Referenced by OnCreate().

◆ listHobby

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

Definition at line 13 of file Chara.cs.

◆ master

Chara Chara.master

Definition at line 88 of file Chara.cs.

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

◆ memberType

◆ mimicry

◆ nextUse

Thing Chara.nextUse

Definition at line 100 of file Chara.cs.

Referenced by AI_Idle.Run().

◆ orgPos

◆ parasite

◆ party

◆ path

PathProgress Chara.path = new PathProgress()

Definition at line 92 of file Chara.cs.

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

◆ pccData

◆ preventRegen

bool Chara.preventRegen
static

Definition at line 184 of file Chara.cs.

◆ quest

◆ ranged

◆ rawSlots

int [] Chara.rawSlots

Definition at line 73 of file Chara.cs.

Referenced by OnSerializing().

◆ resistCon

Dictionary<int, int> Chara.resistCon

Definition at line 216 of file Chara.cs.

◆ ride

◆ shared

Point Chara.shared = new Point()
staticprivate

Definition at line 11 of file Chara.cs.

◆ sharedCheckTurn

int Chara.sharedCheckTurn

Definition at line 120 of file Chara.cs.

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

◆ source

◆ spriteReplacer

SpriteReplacer Chara.spriteReplacer

Definition at line 156 of file Chara.cs.

Referenced by LayerEditSkin.RefreshImage().

◆ stealthSeen

int Chara.stealthSeen

Definition at line 190 of file Chara.cs.

◆ tempElements

◆ turnLastSeen

int Chara.turnLastSeen = -100

Definition at line 112 of file Chara.cs.

Referenced by AI_Idle.Run().

◆ visibleWithTelepathy

bool Chara.visibleWithTelepathy

◆ wasInWater

bool Chara.wasInWater

Definition at line 150 of file Chara.cs.

Referenced by _Move().

◆ workElements

ElementContainer Chara.workElements

Definition at line 40 of file Chara.cs.

Property Documentation

◆ _affinity

int Chara._affinity
getset

Definition at line 304 of file Chara.cs.

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

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

◆ _alias

string Chara._alias
getset

Definition at line 220 of file Chara.cs.

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

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

◆ _idTimeTable

int Chara._idTimeTable
getset

Definition at line 342 of file Chara.cs.

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

Referenced by OnCreate().

◆ _maxStamina

int Chara._maxStamina
getset

Definition at line 366 of file Chara.cs.

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

Referenced by CalculateMaxStamina().

◆ ability

◆ actorPrefab

override string Chara.actorPrefab
get

Definition at line 520 of file Chara.cs.

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

◆ affinity

◆ Aka

◆ AliasMaterialOnCreate

override string Chara.AliasMaterialOnCreate
get

Definition at line 560 of file Chara.cs.

◆ baseWorkElements

ElementContainer Chara.baseWorkElements
get

Definition at line 1112 of file Chara.cs.

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

◆ bladder

Stats Chara.bladder
get

Definition at line 1152 of file Chara.cs.

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

◆ burden

◆ CanGainConResist

bool Chara.CanGainConResist
get

Definition at line 1162 of file Chara.cs.

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

◆ CanOpenDoor

bool Chara.CanOpenDoor
get

Definition at line 820 of file Chara.cs.

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

◆ CanWitness

bool Chara.CanWitness
get

Definition at line 1004 of file Chara.cs.

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

Referenced by Point.ListWitnesses().

◆ corruption

int Chara.corruption
getset

Definition at line 378 of file Chara.cs.

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

Referenced by CanDuplicate().

◆ CurrentGeneSlot

int Chara.CurrentGeneSlot
get

Definition at line 1072 of file Chara.cs.

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

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

◆ CurrentSpan

TimeTable.Span Chara.CurrentSpan
get

Definition at line 838 of file Chara.cs.

Referenced by ConSleep.Tick().

◆ currentZone

Zone Chara.currentZone
getset

Definition at line 256 of file Chara.cs.

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

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

◆ daysStarved

int Chara.daysStarved
getset

Definition at line 330 of file Chara.cs.

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

◆ depression

Stats Chara.depression
get

Definition at line 1150 of file Chara.cs.

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

◆ DestDist

int Chara.DestDist
get

Definition at line 1000 of file Chara.cs.

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

◆ DV

override int Chara.DV
get

Definition at line 730 of file Chara.cs.

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

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

◆ faction

Faction Chara.faction
getset

Definition at line 428 of file Chara.cs.

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

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

◆ faith

◆ flipX

override bool Chara.flipX
get

Definition at line 548 of file Chara.cs.

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

Referenced by CharaActor.RefreshSprite().

◆ goalListType

GoalListType Chara.goalListType
getset

Definition at line 280 of file Chara.cs.

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

◆ HasHost

override bool Chara.HasHost
get

Definition at line 690 of file Chara.cs.

Referenced by ActEffect.Proc().

◆ HasNoGoal

◆ homeBranch

◆ homeZone

◆ hostility

◆ hunger

◆ hygiene

Stats Chara.hygiene
get

Definition at line 1154 of file Chara.cs.

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

◆ idFaction

string Chara.idFaction
getset

Definition at line 244 of file Chara.cs.

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

◆ idFaith

string Chara.idFaith
getset

Definition at line 232 of file Chara.cs.

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

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

◆ IDPCCBodySet

string Chara.IDPCCBodySet
get

Definition at line 492 of file Chara.cs.

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

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

◆ idTimeTable

string Chara.idTimeTable
get

Definition at line 470 of file Chara.cs.

Referenced by LayerQuestBoard.RefreshHire().

◆ interest

int Chara.interest
getset

Definition at line 318 of file Chara.cs.

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

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

◆ IsAdventurer

bool Chara.IsAdventurer
get

Definition at line 1042 of file Chara.cs.

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

◆ isAlawysVisible

bool Chara.isAlawysVisible
getset

Definition at line 402 of file Chara.cs.

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

◆ IsAliveInCurrentZone

◆ IsAnimal

bool Chara.IsAnimal
get

Definition at line 868 of file Chara.cs.

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

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

◆ IsCat

bool Chara.IsCat
get

Definition at line 988 of file Chara.cs.

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

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

◆ isChara

override bool Chara.isChara
get

Definition at line 688 of file Chara.cs.

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

◆ isDead

◆ IsDeadOrSleeping

override bool Chara.IsDeadOrSleeping
get

◆ IsDisabled

override bool Chara.IsDisabled
get

◆ IsDragon

bool Chara.IsDragon
get

Definition at line 964 of file Chara.cs.

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

◆ IsEyth

bool Chara.IsEyth
get

Definition at line 1054 of file Chara.cs.

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

◆ IsFairy

bool Chara.IsFairy
get

Definition at line 940 of file Chara.cs.

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

Referenced by Faction.IsWearingPanty().

◆ IsFish

bool Chara.IsFish
get

Definition at line 928 of file Chara.cs.

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

◆ IsGlobal

◆ IsGod

bool Chara.IsGod
get

Definition at line 952 of file Chara.cs.

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

◆ IsHorror

bool Chara.IsHorror
get

Definition at line 916 of file Chara.cs.

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

Referenced by Refresh().

◆ IsHuman

bool Chara.IsHuman
get

Definition at line 880 of file Chara.cs.

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

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

◆ IsHumanSpeak

bool Chara.IsHumanSpeak
get

Definition at line 1016 of file Chara.cs.

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

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

◆ IsIdle

bool Chara.IsIdle
get

Definition at line 854 of file Chara.cs.

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

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

◆ IsInActiveZone

◆ IsInCombat

◆ IsLevitating

bool Chara.IsLevitating
get

Definition at line 598 of file Chara.cs.

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

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

◆ IsLocalChara

bool Chara.IsLocalChara
get

Definition at line 842 of file Chara.cs.

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

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

◆ IsMachine

bool Chara.IsMachine
get

Definition at line 904 of file Chara.cs.

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

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

◆ IsMaid

bool Chara.IsMaid
get

Definition at line 1028 of file Chara.cs.

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

Referenced by FactionBranch.GetMaid().

◆ IsMinion

override bool Chara.IsMinion
get

Definition at line 628 of file Chara.cs.

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

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

◆ IsMofuable

bool Chara.IsMofuable
get

Definition at line 1100 of file Chara.cs.

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

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

◆ IsMoving

override bool Chara.IsMoving
get

Definition at line 610 of file Chara.cs.

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

◆ IsMultisize

◆ IsPC

override bool Chara.IsPC
get

Definition at line 614 of file Chara.cs.

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

◆ IsPCC

◆ IsPCFaction

override bool Chara.IsPCFaction
get

Definition at line 672 of file Chara.cs.

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

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

◆ IsPCFactionMinion

override bool Chara.IsPCFactionMinion
get

Definition at line 656 of file Chara.cs.

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

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

◆ IsPCParty

override bool Chara.IsPCParty
get

Definition at line 616 of file Chara.cs.

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

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

◆ IsPCPartyMinion

override bool Chara.IsPCPartyMinion
get

Definition at line 640 of file Chara.cs.

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

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

◆ IsPlant

bool Chara.IsPlant
get

Definition at line 976 of file Chara.cs.

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

Referenced by GoalCombat.Run().

◆ IsPrisoner

bool Chara.IsPrisoner
get

Definition at line 1040 of file Chara.cs.

◆ isSynced

override bool Chara.isSynced
get

◆ isThing

override bool Chara.isThing
get

Definition at line 686 of file Chara.cs.

◆ IsUndead

bool Chara.IsUndead
get

Definition at line 892 of file Chara.cs.

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

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

◆ IsWealthy

bool Chara.IsWealthy
get

Definition at line 1056 of file Chara.cs.

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

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

◆ job

◆ knowFav

bool Chara.knowFav
getset

Definition at line 414 of file Chara.cs.

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

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

◆ MainElement

Element Chara.MainElement
get

Definition at line 718 of file Chara.cs.

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

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

◆ mana

◆ MaxGeneSlot

int Chara.MaxGeneSlot
get

◆ MaxHP

◆ MaxSummon

int Chara.MaxSummon
get

◆ NameBraced

string Chara.NameBraced
get

◆ NameTitled

string Chara.NameTitled
get

Definition at line 518 of file Chara.cs.

Referenced by ActEffect.Proc().

◆ OriginalHostility

Hostility Chara.OriginalHostility
get

Definition at line 472 of file Chara.cs.

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

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

◆ Pref

override SourcePref Chara.Pref
get

Definition at line 788 of file Chara.cs.

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

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

◆ PrefIndex

override int Chara.PrefIndex
get

Definition at line 532 of file Chara.cs.

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

◆ PV

override int Chara.PV
get

Definition at line 759 of file Chara.cs.

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

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

◆ race

◆ SAN

◆ SelfWeight

override int Chara.SelfWeight
get

Definition at line 714 of file Chara.cs.

◆ sleepiness

Stats Chara.sleepiness
get

◆ sourceCard

override CardRow Chara.sourceCard
get

◆ sourceRenderCard

override CardRow Chara.sourceRenderCard
get

Definition at line 454 of file Chara.cs.

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

◆ Speed

int Chara.Speed
get

Definition at line 1084 of file Chara.cs.

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

Referenced by GameUpdater.ConditionUpdater.FixedUpdate().

◆ stamina

◆ tactics

Tactics Chara.tactics
get

Definition at line 836 of file Chara.cs.

◆ trait

◆ uidEditor

int Chara.uidEditor
getset

Definition at line 354 of file Chara.cs.

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

Referenced by SerializedCards.Add().

◆ WeightLimit

override int Chara.WeightLimit
get

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