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

Public Member Functions

override string ToString ()
 
bool IsCriticallyWounded (bool includeRide=false)
 
bool HasHigherGround (Card c)
 
bool CanSeeSimple (Point p)
 
bool CanSee (Card c)
 
bool CanSeeLos (Card c, int dist=-1)
 
bool CanSeeLos (Point p, int dist=-1)
 
bool HasAccess (Card c)
 
bool HasAccess (Point p)
 
bool CanSleep ()
 
override string GetName (NameStyle style, int num=-1)
 
override void ChangeRarity (Rarity r)
 
Chara SetFaction (Faction f)
 
Chara SetHomeZone (Zone zone)
 
Chara SetHostility (Hostility h)
 
void OnBanish ()
 
Chara SetGlobal (Zone _home, int x, int z)
 
Chara SetGlobal ()
 
void RemoveGlobal ()
 
override void OnBeforeCreate ()
 
override void OnCreate (int genLv)
 
Chara ScaleByPrincipal ()
 
void SetFaith (string id)
 
void SetFaith (Religion r)
 
void HealAll ()
 
void Refresh (bool calledRecursive=false)
 
bool TryFuse (float chance=1f)
 
bool IsFusable (Chara c)
 
List< CharaListFussableCharas (int radius=2)
 
bool CanDuplicate (DuplicateCondition con=DuplicateCondition.Default)
 
Chara TryDuplicate (DuplicateCondition con=DuplicateCondition.Default, Point dest=null)
 
Chara Duplicate ()
 
int GetBurden (Card t=null, int num=-1)
 
void CalcBurden ()
 
void Stumble (int mtp=100)
 
void SetDirtySpeed ()
 
void RefreshSpeed (Element.BonusInfo info=null)
 
void CalculateMaxStamina ()
 
override void ApplyEditorTags (EditorTag tag)
 
override void SetSource ()
 
void SetMainElement (string id, int v=0, bool elemental=false)
 
void SetMainElement (int id, int v=0, bool elemental=false)
 
void ApplyJob (bool remove=false)
 
void ChangeJob (string idNew)
 
void AddRandomBodyPart (bool msg=false)
 
void RemoveLastBodyPart (bool msg=false)
 
void ResetBody ()
 
void ApplyRace (bool remove=false)
 
void ChangeRace (string idNew)
 
void MakePartyMemeber ()
 
void MakeAlly (bool msg=true)
 
void _MakeAlly ()
 
bool CanBeTempAlly (Chara c)
 
void Banish (Chara owner)
 
void MakeMinion (Chara _master, MinionType type=MinionType.Default)
 
void UnmakeMinion ()
 
void BanishAllMinions ()
 
bool HasMinion (string id)
 
void SetSummon (int duration)
 
Chara FindMaster ()
 
bool IsEscorted ()
 
bool CanDestroyPath ()
 
bool CanMoveTo (Point p, bool allowDestroyPath=true)
 
bool IsEnemyOnPath (Point p, bool cancelAI=true)
 
bool CanInteractTo (Card c)
 
bool CanInteractTo (Point p)
 
Point GetFirstStep (Point newPoint, PathManager.MoveType moveType=PathManager.MoveType.Default)
 
bool MoveRandom ()
 
bool MoveNeighborDefinitely ()
 
void MoveByForce (Point newPoint, Card c=null, bool checkWall=false)
 
MoveResult TryMoveTowards (Point p)
 
override MoveResult TryMove (Point newPoint, bool allowDestroyPath=true)
 
override MoveResult _Move (Point newPoint, MoveType type=MoveType.Walk)
 
void DestroyPath (Point pos)
 
void TryPush (Point point)
 
bool CanReplace (Chara c)
 
void MoveZone (string alias)
 
void MoveZone (Zone z, ZoneTransition.EnterState state=ZoneTransition.EnterState.Auto)
 
void MoveZone (Zone z, ZoneTransition transition)
 
void MoveHome (string id, int x=-1, int z=-1)
 
void MoveHome (Zone zone, int x=-1, int z=-1)
 
void FallFromZone ()
 
override void SetDir (int d)
 
override void Rotate (bool reverse=false)
 
override void LookAt (Card c)
 
override void LookAt (Point p)
 
void UpdateAngle ()
 
int GetCurrentDir ()
 
void UpdateSight ()
 
bool WillConsumeTurn ()
 
void TickConditions ()
 
void SyncRide ()
 
void SyncRide (Chara c)
 
override void Tick ()
 
bool CanLift (Card c)
 
bool CanAutoPick (Card c)
 
bool CanPick (Card c)
 
void PickOrDrop (Point p, string idThing, int idMat=-1, int num=1, bool msg=true)
 
void PickOrDrop (Point p, Thing t, bool msg=true)
 
Thing Pick (Thing t, bool msg=true, bool tryStack=true)
 
Thing TryPoisonPotion (Thing t)
 
void TryAbsorbRod (Thing t)
 
void TryReservePickupTutorial (Thing t)
 
void TryPickGroundItem (Func< Card, bool > func=null)
 
void TryPutShared (Thing t, List< Thing > containers=null, bool dropIfFail=true)
 
bool TryHoldCard (Card t, int num=-1, bool pickHeld=false)
 
void HoldCard (Card t, int num=-1)
 
void PickHeld (bool msg=false)
 
Card SplitHeld (int a)
 
void TryDropCarryOnly ()
 
Card DropHeld (Point dropPos=null)
 
void DropThing (Thing t, int num=-1)
 
AttackStyle GetFavAttackStyle ()
 
Element GetFavWeaponSkill ()
 
Element GetFavArmorSkill ()
 
void TryRestock (bool onCreate)
 
void RestockEquip (bool onCreate)
 
void RestockInventory (bool onCreate)
 
Thing EQ_ID (string s, int mat=-1, Rarity r=Rarity.Random)
 
void EQ_CAT (string s)
 
void EQ_Item (string s, int num=1)
 
void Drink (Card t)
 
bool CanRevive ()
 
void GetRevived ()
 
void Revive (Point p=null, bool msg=false)
 
void SaiyanRevive ()
 
void MakeGrave (string lastword)
 
void ApplyDeathPenalty ()
 
void Vomit ()
 
override void Die (Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None, Chara originalTarget=null)
 
void TryDropBossLoot ()
 
bool UseAbility (int idAct, Card tc=null, Point pos=null, bool pt=false)
 
bool UseAbility (string idAct, Card tc=null, Point pos=null, bool pt=false)
 
bool UseAbility (Act a, Card tc=null, Point pos=null, bool pt=false)
 
int EvalueRiding ()
 
int CalcCastingChance (Element e, int num=1)
 
void DoAI (int wait, Action onPerform)
 
void Cuddle (Chara c, bool headpat=false)
 
void Kiss (Chara c)
 
void Slap (Chara c, bool slapToDeath=false)
 
Chara SetEnemy (Chara c=null)
 
void TrySetEnemy (Chara c)
 
void GoHostile (Card _tg)
 
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 ()
 
Thing GetRandomRangedWeapon ()
 
bool TryEquipRanged ()
 
override int GetArmorSkill ()
 
bool TryUse (Thing t)
 
Room FindRoom ()
 
void ModAffinity (Chara c, int a, bool show=true, bool showOnlyEmo=false)
 
bool TryIdentify (Thing t, int count=1, bool show=true)
 
Chara CreateReplacement ()
 
SourceThing.Row GetFavFood ()
 
SourceCategory.Row GetFavCat ()
 
void Marry (Chara c)
 
void Divorce (Chara c)
 
Chara GetNearbyCatToSniff ()
 
void Sniff (Chara c)
 
int GetTotalFeat ()
 
bool CanInsult ()
 
string GetIdPortraitCat ()
 
string GetIdPortrait ()
 
Thing MakeGene (DNA.Type? type=null)
 
Thing MakeBraineCell ()
 
void OnInsulted ()
 
bool IsValidGiftWeight (Card t, int num=-1)
 
bool CanAcceptItem (Card t, int num=-1, bool skipImportantCheck=false)
 
bool CanAcceptGift (Chara c, Card t)
 
void GiveGift (Chara c, Thing t)
 
void OnGiveErohon (Thing t)
 
void GiveLovePotion (Chara c, Thing t)
 
bool RequestProtection (Chara attacker, Action< Chara > action)
 
bool ShouldThrowAway (Thing t, ClearInventoryType type)
 
void TryClearInventory ()
 
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)
 
BaseCondition GetCondition (string idCon)
 
override T GetCondition< T > ()
 
void RemoveCondition< T > ()
 
void CureHost (CureType type, int p=100, BlessedState state=BlessedState.Normal)
 
void Cure (CureType type, int p=100, BlessedState state=BlessedState.Normal)
 
void RemoveAllStances ()
 
bool TryNeckHunt (Chara TC, int power, bool harvest=false)
 
void AddResistCon (Condition con)
 
void ResistCon (Condition con)
 
void Sleep (Thing bed=null, Thing pillow=null, bool pickup=false, ItemPosition posBed=null, ItemPosition posPillow=null)
 
void OnSleep (Thing bed=null, int days=1)
 
void OnSleep (int power, int days=1, bool isSunLit=false)
 
void ModHeight (int a)
 
void ModWeight (int a, bool ignoreLimit=false)
 
void ModCorruption (int a)
 
List< ElementListAvailabeFeats (bool pet=false, bool showAll=false)
 
void SetFeat (int id, int value=1, bool msg=false)
 
void SetMutation (int idEle, int a=0)
 
bool MutateRandom (int vec=0, int tries=100, bool ether=false, BlessedState state=BlessedState.Normal)
 
void GainAbility (int ele, int mtp=100, Thing origin=null)
 
bool TryNullifyCurse ()
 
void OnAdvanceDay ()
 
void AddFoodHistory (Thing food)
 
int CountNumEaten (Thing food)
 
int GetPietyValue ()
 
void RefreshFaithElement ()
 
void ModTempElement (int ele, int a, bool naturalDecay=false, bool onlyRenew=false)
 
void DamageTempElements (int p, bool body, bool mind, bool onlyRenew=false)
 
void DamageTempElement (int ele, int p, bool onlyRenew=false)
 
void EnhanceTempElements (int p, bool body, bool mind, bool onlyRenew=false)
 
void EnhanceTempElement (int ele, int p, bool onlyRenew=false)
 
void DiminishTempElements (int a=1)
 
void CureTempElements (int p, bool body, bool mind)
 
void ClearTempElements ()
 
- Public Member Functions inherited from Card
bool GetBool (string id)
 
void SetBool (string id, bool enable)
 
int GetInt (string id, int? defaultInt=null)
 
void AddInt (string id, int value)
 
void SetInt (string id, int value=0)
 
string GetStr (string id, string defaultStr=null)
 
void SetStr (string id, string value=null)
 
GetObj< T > (string id)
 
void SetObj (string id, object o)
 
SetObj< T > (string id, object o)
 
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)
 
void ModExpParty (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 (long a, HealSource origin=HealSource.None)
 
virtual void HealHP (long a, HealSource origin=HealSource.None)
 
virtual int GetArmorSkill ()
 
virtual long ApplyProtection (long dmg, int mod=100)
 
int GetResistPenetrationLevel (int idEle, AttackSource attackSource, Card origin=null)
 
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, int resistPenetrationLevel=0)
 
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, bool makeRef=true)
 
void MakeFoodRef (Card c1, Card c2=null)
 
string TryGetFoodName (Card c)
 
string GetFoodName (string s)
 
void MakeFigureFrom (string id)
 
Card MakeRefFrom (string id)
 
void MakeRefFrom (Card c1, Card c2=null, bool simple=false)
 
Thing MakeEgg (bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
 
Thing MakeMilk (bool effect=true, int num=1, bool addToZone=true, BlessedState? state=null)
 
Thing GiveBirth (Thing t, bool effect)
 
void HatchEgg ()
 
Card SetHidden (bool hide=true)
 
virtual MoveResult _Move (Point p, MoveType type=MoveType.Walk)
 
void MoveImmediate (Point p, bool focus=true, bool cancelAI=true)
 
void Teleport (Point point, bool silent=false, bool force=false)
 
virtual void OnLand ()
 
MoveResult TryMoveFrom (Point p)
 
virtual MoveResult TryMove (Point newPoint, bool allowDestroyPath=true)
 
void Kick (Point p, bool ignoreSelf=false, bool checkWall=true)
 
void Kick (Chara t, bool ignoreSelf=false, bool karmaLoss=true, bool show=true, bool checkWall=true)
 
int ResistLvFrom (int ele)
 
int ResistLv (int res)
 
bool HasElement (int ele, bool includeNagative=false)
 
bool HasElement (int ele, int req)
 
bool HasElement (string id, int req=1)
 
bool HasGlobalElement (int ele)
 
bool HasElementNoCopy ()
 
virtual CardRenderer _CreateRenderer ()
 
void AddBlood (int a=1, int id=-1)
 
RenderParam GetRenderParam ()
 
virtual void SetRenderParam (RenderParam p)
 
void DyeRandom ()
 
void Dye (string idMat)
 
void Dye (SourceMaterial.Row mat)
 
int 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 StripTalkSpecialCharacters (string text)
 
string ApplyNewLine (string text)
 
void SayRaw (string text, string ref1=null, string ref2=null)
 
void SayNothingHappans ()
 
void Say (string lang, string ref1=null, string ref2=null)
 
void Say (string lang, Card c1, Card c2, string ref1=null, string ref2=null)
 
void Say (string lang, Card c1, string ref1=null, string ref2=null)
 
string GetTalkText (string idTopic, bool stripPun=false, bool useDefault=true)
 
string ApplyTone (string text, bool stripPun=false)
 
void SetRandomTalk ()
 
void SetRandomTone ()
 
bool HasCraftBonusTrait ()
 
List< ElementListCraftBonusTraits ()
 
void TryStack (Thing t)
 
void ApplyBacker (int bid)
 
void RemoveBacker ()
 
void SetPaintData ()
 
byte[] GetPaintData ()
 
void ClearPaintSprite ()
 
Sprite GetPaintSprite ()
 
void TryUnrestrain (bool force=false, Chara c=null)
 
TraitShackle GetRestrainer ()
 
virtual void Tick ()
 
Thing SetPriceFix (int a)
 
int GetEquipValue ()
 
void SetSale (bool sale)
 
int GetValue (PriceType priceType=PriceType.Default, bool sell=false)
 
virtual int GetPrice (CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
 
virtual string GetHoverText ()
 
virtual string GetHoverText2 ()
 
int Dist (Card c)
 
int Dist (Point p)
 
bool IsInMutterDistance (int d=10)
 
void SetCensored (bool enable)
 
void SetDeconstruct (bool deconstruct)
 
virtual bool MatchEncSearch (string s)
 
virtual void SetSortVal (UIList.SortMode m, CurrencyType currency=CurrencyType.Money)
 
virtual int SecondaryCompare (UIList.SortMode m, Card c)
 
void ForeachFOV (Func< Point, bool > func)
 
void ForeachPoint (Action< Point, bool > action)
 
void OnInspect ()
 
virtual void WriteNote (UINote n, Action< UINote > onWriteNote=null, IInspect.NoteMode mode=IInspect.NoteMode.Default, Recipe recipe=null)
 
void Inspect ()
 
virtual bool HasCondition< T > ()
 
virtual T GetCondition< T > ()
 
bool HaveFur ()
 
bool CanBeSheared ()
 
- Public Member Functions inherited from BaseCard
bool GetBool (int id)
 
void SetBool (int id, bool enable)
 
int GetInt (int id, int? defaultInt=null)
 
void AddInt (int id, int value)
 
void SetInt (int id, int value=0)
 
string GetStr (int id, string defaultStr=null)
 
void SetStr (int id, string value=null)
 
GetObj< T > (int id)
 
void SetObj (int id, object o)
 
SetObj< T > (int id, object o)
 
ICardParent GetRoot ()
 
void RemoveCard (Card c)
 
void OnChildNumChange (Card c)
 
string ReferenceId ()
 
void WriteNote (UINote n, Action< UINote > onWriteNote=null, NoteMode mode=NoteMode.Default, Recipe recipe=null)
 
void OnInspect ()
 

Public Attributes

int contribution
 
Point orgPos
 
Quest quest
 
Chara ride
 
Chara parasite
 
Chara host
 
ElementContainer tempElements
 
ElementContainer faithElements
 
ElementContainer workElements
 
Party party
 
FactionMemberType memberType
 
List< int > _hobbies
 
List< int > _works
 
WorkSummary _workSummary
 
List< int > _cooldowns
 
List< int > _listAbility
 
List< List< string > > _historyFood
 
PCCData pccData
 
Card held
 
int[] rawSlots
 
GlobalData global
 
string[] _strs = new string[5]
 
int[] _cints = new int[30]
 
BitArray32 _cbits1
 
Chara enemy
 
Chara master
 
new Point lastPos = new Point()
 
PathProgress path = new PathProgress()
 
CharaBody body = new CharaBody()
 
CharaAbility _ability
 
Thing ranged
 
Thing nextUse
 
ConSleep conSleep
 
ConSuspend conSuspend
 
ConBaseTransmuteMimic 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
 
bool isAstralBody
 
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()
 
Point lastPos = 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]
 
bool IsAstralBody [get]
 
new TraitChara trait [get, set]
 
string NameBraced [get]
 
string NameTitled [get]
 
override string actorPrefab [get]
 
override int PrefIndex [get]
 
override bool flipX [get]
 
override string AliasMaterialOnCreate [get]
 
override bool IsAliveInCurrentZone [get]
 
override bool IsDeadOrSleeping [get]
 
override bool IsDisabled [get]
 
bool IsLevitating [get]
 
bool IsMarried [get]
 
override bool IsMoving [get]
 
override bool IsGlobal [get]
 
override bool IsPC [get]
 
override bool IsPCParty [get]
 
override bool IsMinion [get]
 
override bool IsPCPartyMinion [get]
 
override bool IsPCFactionMinion [get]
 
override bool IsPCFaction [get]
 
override bool IsPCC [get]
 
override bool isThing [get]
 
override bool isChara [get]
 
override bool HasHost [get]
 
override bool isSynced [get]
 
override bool IsMultisize [get]
 
override int MaxHP [get]
 
override int WeightLimit [get]
 
override int SelfWeight [get]
 
int MaxSummon [get]
 
Element MainElement [get]
 
override int DV [get]
 
override int PV [get]
 
override SourcePref Pref [get]
 
bool CanOpenDoor [get]
 
Tactics tactics [get]
 
TimeTable.Span CurrentSpan [get]
 
Ridability Ridability [get]
 
bool IsInActiveZone [get]
 
bool IsLocalChara [get]
 
bool IsIdle [get]
 
bool IsInCombat [get]
 
bool IsAnimal [get]
 
bool IsHuman [get]
 
bool IsUndead [get]
 
bool IsMachine [get]
 
bool IsHorror [get]
 
bool IsFish [get]
 
bool IsFairy [get]
 
bool IsGod [get]
 
bool IsDragon [get]
 
bool IsPlant [get]
 
bool IsCat [get]
 
int DestDist [get]
 
bool HasNoGoal [get]
 
bool CanWitness [get]
 
bool IsHumanSpeak [get]
 
bool IsMaid [get]
 
bool IsPrisoner [get]
 
bool IsAdventurer [get]
 
bool IsEyth [get]
 
bool IsWealthy [get]
 
FactionBranch homeBranch [get]
 
int MaxGeneSlot [get]
 
int GeneCostMTP [get]
 
int CurrentGeneSlot [get]
 
int Speed [get]
 
bool IsMofuable [get]
 
ElementContainer baseWorkElements [get]
 
Stats hunger [get]
 
Stats burden [get]
 
Stats stamina [get]
 
Stats depression [get]
 
Stats bladder [get]
 
Stats hygiene [get]
 
Stats mana [get]
 
Stats sleepiness [get]
 
Stats SAN [get]
 
bool CanGainConResist [get]
 
- Properties inherited from Card
Card parentCard [get]
 
Thing parentThing [get]
 
int colorInt [get]
 
bool IsHotItem [get]
 
int uid [get, set]
 
int idMaterial [get, set]
 
int dir [get, set]
 
int Num [get, set]
 
int _x [get, set]
 
int _z [get, set]
 
int genLv [get, set]
 
int refVal [get, set]
 
int decay [get, set]
 
int altitude [get, set]
 
int hp [get, set]
 
float fx [get, set]
 
float fy [get, set]
 
BlessedState blessedState [get, set]
 
PlaceState _placeState [get, set]
 
int rarityLv [get, set]
 
Rarity rarity [get, set]
 
int encLV [get, set]
 
int posInvX [get, set]
 
int posInvY [get, set]
 
int idSkin [get, set]
 
int feat [get, set]
 
int LV [get, set]
 
int exp [get, set]
 
int tier [get, set]
 
int version [get, set]
 
bool isCensored [get, set]
 
bool isDeconstructing [get, set]
 
bool isDyed [get, set]
 
bool isModified [get, set]
 
bool isNew [get, set]
 
bool isPlayerCreation [get, set]
 
bool ignoreAutoPick [get, set]
 
bool freePos [get, set]
 
bool isHidden [get, set]
 
bool isOn [get, set]
 
bool isNPCProperty [get, set]
 
bool isRestrained [get, set]
 
bool isRoofItem [get, set]
 
bool isMasked [get, set]
 
bool disableAutoToggle [get, set]
 
bool isImported [get, set]
 
bool autoRefuel [get, set]
 
bool ignoreStackHeight [get, set]
 
bool isFloating [get, set]
 
bool isWeightChanged [get, set]
 
bool isFireproof [get, set]
 
bool isAcidproof [get, set]
 
bool isReplica [get, set]
 
bool isSummon [get, set]
 
bool isElemental [get, set]
 
bool isBroken [get, set]
 
bool isSubsetCard [get, set]
 
bool noSnow [get, set]
 
bool noMove [get, set]
 
bool isGifted [get, set]
 
bool isCrafted [get, set]
 
bool isLostProperty [get, set]
 
bool noShadow [get, set]
 
bool noSell [get, set]
 
bool isLeashed [get, set]
 
bool isStolen [get, set]
 
bool isSale [get, set]
 
bool isCopy [get, set]
 
bool isRestocking [get, set]
 
bool hasSpawned [get, set]
 
bool isScaled [get, set]
 
bool isFav [get, set]
 
bool isHatchling [get, set]
 
bool isBackerContent [get]
 
SourceBacker.Row sourceBacker [get]
 
BedType c_bedType [get, set]
 
int c_equippedSlot [get, set]
 
int c_lockLv [get, set]
 
Hostility c_originalHostility [get, set]
 
MinionType c_minionType [get, set]
 
int c_vomit [get, set]
 
bool c_wasInPcParty [get, set]
 
bool c_isImportant [get, set]
 
bool c_lockedHard [get, set]
 
bool c_revealLock [get, set]
 
bool c_isTrained [get, set]
 
bool c_isPrayed [get, set]
 
bool c_isDisableStockUse [get, set]
 
int c_lightColor [get, set]
 
Color LightColor [get]
 
int c_uidZone [get, set]
 
int c_uidRefCard [get, set]
 
int c_priceFix [get, set]
 
int c_priceAdd [get, set]
 
int c_priceCopy [get, set]
 
int c_fixedValue [get, set]
 
int c_uidAttune [get, set]
 
int c_dyeMat [get, set]
 
VisitorState visitorState [get, set]
 
RescueState c_rescueState [get, set]
 
BossType c_bossType [get, set]
 
int c_dateStockExpire [get, set]
 
int c_dateDeathLock [get, set]
 
int c_IDTState [get, set]
 
int c_charges [get, set]
 
int c_bill [get, set]
 
int c_invest [get, set]
 
int c_seed [get, set]
 
int c_allowance [get, set]
 
int c_fur [get, set]
 
int c_dateCooked [get, set]
 
int c_lockedAge [get, set]
 
int c_containerSize [get, set]
 
int c_weight [get, set]
 
int c_diceDim [get, set]
 
int c_indexContainerIcon [get, set]
 
int c_idMainElement [get, set]
 
int c_summonDuration [get, set]
 
int c_idBacker [get, set]
 
int c_uidMaster [get, set]
 
int c_ammo [get, set]
 
int c_daysWithGod [get, set]
 
int c_daysWithPC [get, set]
 
string c_idPortrait [get, set]
 
string c_idRace [get, set]
 
string c_idJob [get, set]
 
string c_idTone [get, set]
 
string c_color [get, set]
 
string c_idSpriteReplacer [get, set]
 
string c_idTalk [get, set]
 
string c_idDeity [get, set]
 
string c_altName [get, set]
 
string c_altName2 [get, set]
 
string c_extraNameRef [get, set]
 
string c_refText [get, set]
 
string c_idRefName [get, set]
 
string c_idRidePCC [get, set]
 
string c_idAbility [get, set]
 
string c_context [get, set]
 
string c_idEditor [get, set]
 
string c_editorTags [get, set]
 
string c_editorTraitVal [get, set]
 
string c_idTrait [get, set]
 
string c_idRefCard [get, set]
 
string c_idRefCard2 [get, set]
 
string c_note [get, set]
 
UniqueData c_uniqueData [get, set]
 
Thing ammoData [get, set]
 
List< SocketDatasocketList [get, set]
 
Thing c_copyContainer [get, set]
 
Window.SaveData c_windowSaveData [get, set]
 
CharaUpgrade c_upgrades [get, set]
 
LoveData c_love [get, set]
 
CharaGenes c_genes [get, set]
 
List< int > c_corruptionHistory [get, set]
 
ContainerUpgrade c_containerUpgrade [get, set]
 
DNA c_DNA [get, set]
 
CharaList c_charaList [get, set]
 
MixedFoodData c_mixedFoodData [get, set]
 
Thing c_bloodData [get, set]
 
byte[] c_textureData [get, set]
 
SourceMaterial.Row DyeMat [get]
 
int invX [get, set]
 
int invY [get, set]
 
CardRow refCard [get]
 
CardRow refCard2 [get]
 
int ExpToNext [get]
 
int DefaultLV [get]
 
int ChildrenWeight [get]
 
int ChildrenAndSelfWeight [get]
 
int ChildrenAndSelfWeightSingle [get]
 
virtual int SelfWeight [get]
 
virtual int WeightLimit [get]
 
SourceCategory.Row category [get]
 
SourceMaterial.Row material [get]
 
virtual string AliasMaterialOnCreate [get]
 
Cell Cell [get]
 
virtual Thing Thing [get]
 
virtual Chara Chara [get]
 
virtual bool isThing [get]
 
virtual bool isChara [get]
 
bool ExistsOnMap [get]
 
virtual bool isSynced [get]
 
bool IsContainer [get]
 
bool IsUnique [get]
 
bool IsPowerful [get]
 
bool IsImportant [get]
 
virtual SourcePref Pref [get]
 
virtual bool IsDeadOrSleeping [get]
 
virtual bool IsDisabled [get]
 
virtual bool IsMoving [get]
 
virtual bool flipX [get]
 
virtual bool IsAliveInCurrentZone [get]
 
virtual string actorPrefab [get]
 
virtual CardRow sourceCard [get]
 
virtual CardRow sourceRenderCard [get]
 
virtual RenderRow TileRow [get]
 
TileType TileType [get]
 
string Name [get]
 
string NameSimple [get]
 
string NameOne [get]
 
virtual bool IsPC [get]
 
bool _IsPC [get]
 
virtual bool IsPCC [get]
 
virtual bool IsPCParty [get]
 
virtual bool IsMinion [get]
 
virtual bool IsPCPartyMinion [get]
 
virtual bool IsPCFactionMinion [get]
 
virtual bool IsMultisize [get]
 
bool IsToolbelt [get]
 
bool IsLightsource [get]
 
bool IsEquipment [get]
 
bool IsFood [get]
 
bool IsInheritFoodTraits [get]
 
bool ShowFoodEnc [get]
 
bool IsWeapon [get]
 
bool IsEquipmentOrRanged [get]
 
bool IsEquipmentOrRangedOrAmmo [get]
 
bool IsMeleeWeapon [get]
 
bool IsRangedWeapon [get]
 
bool IsThrownWeapon [get]
 
bool IsAmmo [get]
 
bool IsAgent [get]
 
bool IsFurniture [get]
 
bool IsBlessed [get]
 
bool IsCursed [get]
 
bool IsSlimeEvolvable [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]
 
- Properties inherited from IPathfindWalker
bool IsAstralBody [get]
 

Private Member Functions

int ParseBodySlot (string s)
 
void SetEQQuality ()
 
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 6966 of file Chara.cs.

6967 {
6968 CardRenderer cardRenderer = renderer;
6969 CharaRenderer charaRenderer = new CharaRenderer();
6970 if (source.skinAntiSpider != 0 && EClass.core.config.game.antiSpider)
6971 {
6972 base.idSkin = source.skinAntiSpider;
6973 }
6974 if (host != null)
6975 {
6976 charaRenderer.pccData = PCCData.Create("ride");
6977 string idPart = base.c_idRidePCC.IsEmpty(EClass.core.pccs.sets["ride"].map["body"].map.Keys.First());
6978 charaRenderer.pccData.SetPart("body", "ride", idPart);
6979 charaRenderer.pccData.ride = EClass.core.pccs.GetRideData(idPart);
6980 }
6981 else
6982 {
6983 foreach (Condition condition in conditions)
6984 {
6985 RendererReplacer rendererReplacer = condition.GetRendererReplacer();
6986 if (rendererReplacer != null)
6987 {
6988 charaRenderer.replacer = rendererReplacer;
6989 charaRenderer.data = rendererReplacer.data;
6990 charaRenderer.pccData = rendererReplacer.pccData;
6991 break;
6992 }
6993 }
6994 if (charaRenderer.replacer == null)
6995 {
6996 charaRenderer.pccData = pccData;
6997 }
6998 }
6999 renderer = charaRenderer;
7000 renderer.SetOwner(this);
7001 if (cardRenderer != null)
7002 {
7003 renderer.SetFirst(first: false, cardRenderer.position);
7004 }
7005 return charaRenderer;
7006 }
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:64
PCCData pccData
Chara host
Definition: Chara.cs:33
List< Condition > conditions
Definition: Chara.cs:215
SourceChara.Row source
Definition: Chara.cs:162
PCCData pccData
Definition: Chara.cs:67
new GameConfig game
Definition: CoreConfig.cs:617
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, RendererReplacer.pccData, Core.pccs, CardRenderer.position, CardRenderer.replacer, CharaRenderer.SetOwner(), and SourceChara.Row.skinAntiSpider.

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

◆ _MakeAlly()

void Chara._MakeAlly ( )
inline

Definition at line 2498 of file Chara.cs.

2499 {
2500 if (EClass.pc.homeBranch != null)
2501 {
2503 }
2504 else
2505 {
2506 SetGlobal();
2508 }
2509 Hostility hostility2 = (base.c_originalHostility = Hostility.Ally);
2510 this.hostility = hostility2;
2511 orgPos = null;
2512 base.c_summonDuration = 0;
2513 base.isSummon = false;
2514 UnmakeMinion();
2515 SetInt(32);
2516 Refresh();
2517 }
Hostility
Definition: Hostility.cs:2
void SetInt(string id, int value=0)
Definition: Card.cs:2586
void Refresh(bool calledRecursive=false)
Definition: Chara.cs:1796
void UnmakeMinion()
Definition: Chara.cs:2552
Chara SetFaction(Faction f)
Definition: Chara.cs:1490
Point orgPos
Definition: Chara.cs:21
FactionBranch homeBranch
Definition: Chara.cs:1113
Chara SetGlobal()
Definition: Chara.cs:1557
static Faction Home
Definition: EClass.cs:27
static Chara pc
Definition: EClass.cs:15
void AddMemeber(Chara c)

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

Referenced by MakeAlly(), and MakePartyMemeber().

◆ _Move()

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

Reimplemented from Card.

Definition at line 2920 of file Chara.cs.

2921 {
2922 if (isDead)
2923 {
2924 return MoveResult.Fail;
2925 }
2926 if (IsPC)
2927 {
2928 float num = EClass.setting.defaultActPace;
2929 switch (burden.GetPhase())
2930 {
2931 case 3:
2932 num *= 1.5f;
2933 break;
2934 case 4:
2935 num *= 2f;
2936 break;
2937 }
2939 {
2940 int num2 = 30;
2941 if (!EClass.pc.HasElement(408))
2942 {
2944 {
2945 case Weather.Condition.Rain:
2946 num2 += 5;
2947 break;
2948 case Weather.Condition.RainHeavy:
2949 num2 += 10;
2950 num *= 1.5f;
2951 break;
2952 case Weather.Condition.Snow:
2953 num2 += 10;
2954 break;
2955 case Weather.Condition.SnowHeavy:
2956 num2 += 15;
2957 num *= 1.5f;
2958 break;
2959 }
2960 }
2961 if (newPoint.matFloor.id == 48)
2962 {
2963 num2 += 20;
2964 num *= 1.8f;
2965 }
2966 num2 = num2 * 100 / (100 + EClass.sqrt(EvalueMax(240, -20) * 10) + EvalueMax(407, -5) * 5);
2967 EClass.world.date.AdvanceMin(num2 * 6);
2968 EClass.player.lastZonePos = null;
2970 int num3 = base.hp;
2971 for (int i = 0; i < num2 * 4; i++)
2972 {
2973 EClass.pc.party.members.ForeachReverse(delegate(Chara m)
2974 {
2975 if (!m.isDead)
2976 {
2977 m.TickConditions();
2978 }
2979 });
2980 if (base.hp < MaxHP / 5 && base.hp < num3 && !EClass.player.regionMoveWarned)
2981 {
2982 EClass.player.regionMoveWarned = true;
2983 Msg.Say("regionAbortMove");
2984 EInput.Consume(consumeAxis: true);
2985 SetAI(new NoGoal());
2986 return MoveResult.Fail;
2987 }
2988 }
2989 if (newPoint.cell.CanSuffocate())
2990 {
2991 bool flag = HasElement(1252);
2992 if (!flag)
2993 {
2994 AddCondition<ConSuffocation>((Evalue(200) != 0) ? (2000 / (100 + EvalueMax(200, -5) * 10)) : 30, force: true);
2995 }
2996 int num4 = GetCondition<ConSuffocation>()?.GetPhase() ?? 0;
2997 if (num4 >= 2)
2998 {
2999 DamageHP(EClass.rndHalf(10 + MaxHP / 5), AttackSource.Condition);
3000 }
3001 if (!isDead && !HasElement(429))
3002 {
3003 ModExp(200, ((!flag) ? 1 : 10) + num4 * 12);
3004 }
3005 }
3006 EClass.player.regionMoveWarned = false;
3007 if (isDead)
3008 {
3009 return MoveResult.Fail;
3010 }
3011 }
3012 if (num > EClass.setting.defaultActPace * 3f)
3013 {
3014 num = EClass.setting.defaultActPace * 3f;
3015 }
3016 actTime = num;
3017 }
3018 if (IsPCFaction && EClass.rnd(5) == 0 && newPoint.cell.CanSuffocate())
3019 {
3020 int num5 = Mathf.Min(5 + EClass._zone.DangerLv / 10, 200);
3021 ModExp(200, EClass._zone.IsRegion ? 50 : num5);
3022 if (ride != null)
3023 {
3024 ride.ModExp(200, EClass._zone.IsRegion ? 50 : num5);
3025 }
3026 if (parasite != null)
3027 {
3028 parasite.ModExp(200, EClass._zone.IsRegion ? 50 : num5);
3029 }
3030 }
3031 Chara chara = ((ride == null) ? this : ride);
3032 if (!EClass._zone.IsRegion || chara.IsPC)
3033 {
3034 bool flag2 = (chara.isConfused && EClass.rnd(2) == 0) || (chara.isDrunk && EClass.rnd(IsIdle ? 2 : 8) == 0 && !chara.HasElement(1215));
3035 if (host != null && host.ride == this && ((host.isConfused && EClass.rnd(2) == 0) || (host.isDrunk && EClass.rnd(IsIdle ? 2 : 8) == 0 && !host.HasElement(1215))))
3036 {
3037 flag2 = true;
3038 }
3039 if (flag2 && !HasElement(493) && newPoint.Distance(pos) <= 1)
3040 {
3041 Point randomNeighbor = pos.GetRandomNeighbor();
3042 if (CanMoveTo(randomNeighbor, allowDestroyPath: false))
3043 {
3044 newPoint = randomNeighbor;
3045 if (isDrunk)
3046 {
3047 Talk("drunk");
3048 }
3049 }
3050 }
3051 }
3052 if (newPoint.x != pos.x || newPoint.z != pos.z)
3053 {
3054 LookAt(newPoint);
3055 }
3056 CellEffect effect = base.Cell.effect;
3057 if (effect != null && effect.id == 7)
3058 {
3059 CellEffect effect2 = base.Cell.effect;
3060 if (race.height < 500 && !race.tag.Contains("webfree") && !HasElement(493) && EClass.rnd(effect2.power + 25) > EClass.rnd(base.STR + base.DEX + 1))
3061 {
3062 Say("abWeb_caught", this);
3063 PlaySound("web");
3064 effect2.power = effect2.power * 3 / 4;
3065 renderer.PlayAnime(AnimeID.Shiver);
3066 return MoveResult.Fail;
3067 }
3068 Say("abWeb_pass", this);
3069 EClass._map.SetEffect(base.Cell.x, base.Cell.z);
3070 }
3071 if (IsPC)
3072 {
3073 EClass.player.renderExtraTime = 0f;
3074 if (EClass._zone.IsRegion)
3075 {
3077 }
3078 else if ((newPoint.x > pos.x && newPoint.z > pos.z) || (newPoint.x < pos.x && newPoint.z < pos.z))
3079 {
3080 EClass.player.renderExtraTime = actTime * EClass.setting.render.anime.diagonalSpeed;
3081 }
3082 }
3083 if (newPoint.HasChara)
3084 {
3085 foreach (Chara item in newPoint.ListCharas())
3086 {
3087 if (item.mimicry != null && item.IsHostile(this))
3088 {
3089 if (item.mimicry.ShouldRevealOnPush)
3090 {
3091 item.mimicry.Reveal(this, surprise: true);
3092 }
3093 return MoveResult.Event;
3094 }
3095 }
3096 }
3097 if (newPoint.cell.hasDoor)
3098 {
3099 foreach (Thing thing in pos.Things)
3100 {
3101 if (thing.trait is TraitDoor traitDoor && traitDoor.owner.c_lockLv > 0)
3102 {
3103 if (base.INT < 10)
3104 {
3105 return MoveResult.Fail;
3106 }
3107 traitDoor.TryOpenLock(this);
3108 return MoveResult.Door;
3109 }
3110 }
3111 }
3112 Cell cell = newPoint.cell;
3113 Cell cell2 = pos.cell;
3114 bool flag3 = cell.HasLiquid && !IsLevitating;
3115 bool hasBridge = cell.HasBridge;
3116 bool hasRamp = cell.HasRamp;
3117 bool flag4 = EClass._zone.IsSnowCovered && !cell.HasRoof && !cell.isClearSnow;
3118 TileRow tileRow = (hasRamp ? ((TileRow)cell.sourceBlock) : ((TileRow)(hasBridge ? cell.sourceBridge : cell.sourceFloor)));
3119 SourceMaterial.Row row = (hasRamp ? cell.matBlock : (hasBridge ? cell.matBridge : cell.matFloor));
3120 bool flag5 = cell.IsTopWater && !cell.isFloating;
3121 if (!EClass._zone.IsRegion)
3122 {
3123 if (cell.hasDoorBoat)
3124 {
3125 tileRow = FLOOR.sourceWood;
3126 row = MATERIAL.sourceOak;
3127 flag5 = false;
3128 }
3129 else if (flag4 && !tileRow.ignoreSnow)
3130 {
3131 if (tileRow.tileType.IsWater)
3132 {
3133 tileRow = FLOOR.sourceIce;
3134 row = MATERIAL.sourceIce;
3135 }
3136 else
3137 {
3138 tileRow = FLOOR.sourceSnow;
3139 row = MATERIAL.sourceSnow;
3140 }
3141 flag5 = false;
3142 }
3143 }
3144 if ((pos.sourceFloor.isBeach || cell2.IsSnowTile) && !pos.HasObj)
3145 {
3146 EClass._map.SetFoormark(pos, 1, (int)Util.GetAngle(pos.x - newPoint.x, pos.z - newPoint.z), cell2.IsSnowTile ? 312 : 304);
3147 }
3148 if (isSynced)
3149 {
3150 string text = ((flag3 || flag5) ? "water" : tileRow.soundFoot.IsEmpty(row.soundFoot.IsEmpty("default")));
3151 if (cell.obj != 0 && cell.sourceObj.tileType.IsPlayFootSound && !cell.matObj.soundFoot.IsEmpty())
3152 {
3153 text = cell.matObj.soundFoot;
3154 }
3155 if (IsPC)
3156 {
3157 foreach (Thing thing2 in newPoint.Things)
3158 {
3159 if (thing2.IsInstalled && (thing2.trait.IsChangeFloorHeight || thing2.Pref.Surface))
3160 {
3161 text = thing2.material.soundFoot;
3162 }
3163 }
3164 }
3165 if (!text.IsEmpty())
3166 {
3167 SoundManager.altLastData = IsPC;
3168 PlaySound("Footstep/" + text, IsPC ? 1f : 0.9f);
3169 }
3170 if (!flag5)
3171 {
3173 PCOrbit pcOrbit = EClass.screen.pcOrbit;
3174 bool flag6 = scene.actionMode.gameSpeed > 1f;
3175 scene.psFoot.transform.position = renderer.position + pcOrbit.footPos;
3176 scene.psFoot.startColor = row.matColor;
3177 scene.psFoot.Emit(pcOrbit.emitFoot * ((!flag6) ? 1 : 2));
3178 if (flag6 && IsPC)
3179 {
3180 scene.psSmoke.transform.position = renderer.position + pcOrbit.smokePos;
3181 scene.psSmoke.Emit(pcOrbit.emitSmoke);
3182 }
3183 }
3184 if (flag3 || flag5)
3185 {
3186 Effect.Get("ripple").Play(newPoint);
3187 }
3188 }
3189 lastPos.Set(pos);
3190 if (type != MoveType.Force)
3191 {
3192 if (newPoint.HasChara && ai.Current.PushChara)
3193 {
3194 TryPush(newPoint);
3195 }
3196 if (newPoint.HasChara && newPoint.Charas.Count == 1)
3197 {
3198 Chara chara2 = newPoint.Charas[0];
3199 if (CanReplace(chara2))
3200 {
3201 chara2.MoveByForce(lastPos, this);
3202 if (chara.IsPC)
3203 {
3204 Say("replace_pc", chara, chara2);
3205 }
3206 }
3207 }
3208 }
3209 if (cell.hasDoor)
3210 {
3211 foreach (Thing thing3 in newPoint.Things)
3212 {
3213 if (thing3.trait is TraitDoor traitDoor2)
3214 {
3215 traitDoor2.TryOpen(this);
3216 }
3217 }
3218 }
3219 EClass._zone.map.MoveCard(newPoint, this);
3220 SyncRide();
3222 {
3223 foreach (Chara member in EClass.pc.party.members)
3224 {
3225 if (member.isLeashed && !member.IsPC && member.host == null && !member.IsDisabled && !member.HasCondition<ConEntangle>() && !member.IsInCombat && member.Dist(EClass.pc) > 1)
3226 {
3227 member.TryMoveTowards(EClass.pc.pos);
3228 }
3229 }
3230 }
3232 {
3234 }
3235 if (IsPC)
3236 {
3237 PlaySound("Footstep/Extra/pcfootstep");
3238 if (pos.HasThing)
3239 {
3240 foreach (Card item2 in pos.ListCards())
3241 {
3242 if (!item2.isThing || item2.placeState != 0 || item2.ignoreAutoPick)
3243 {
3244 continue;
3245 }
3247 {
3249 ContainerFlag containerFlag = item2.category.GetRoot().id.ToEnum<ContainerFlag>();
3250 if (containerFlag == ContainerFlag.none)
3251 {
3252 containerFlag = ContainerFlag.other;
3253 }
3254 if ((dataPick.noRotten && item2.IsDecayed) || (dataPick.onlyRottable && item2.trait.Decay == 0))
3255 {
3256 continue;
3257 }
3258 if (dataPick.userFilter)
3259 {
3260 switch (dataPick.IsFilterPass(item2.GetName(NameStyle.Full, 1)))
3261 {
3262 case Window.SaveData.FilterResult.PassWithoutFurtherTest:
3263 Pick(item2.Thing);
3264 continue;
3265 case Window.SaveData.FilterResult.Block:
3266 continue;
3267 }
3268 }
3269 if (dataPick.advDistribution)
3270 {
3271 foreach (int cat in dataPick.cats)
3272 {
3273 if (item2.category.uid == cat)
3274 {
3275 Pick(item2.Thing);
3276 }
3277 }
3278 }
3279 else if (!dataPick.flag.HasFlag(containerFlag))
3280 {
3281 Pick(item2.Thing);
3282 }
3283 }
3284 else
3285 {
3286 Pick(item2.Thing);
3287 }
3288 }
3289 }
3290 if (EClass._zone.IsRegion)
3291 {
3293 if (cell3?.zone != null && !cell3.zone.HiddenInRegionMap && (!(cell3.zone is Zone_Field) || cell3.zone.children.Count > 0 || cell3.zone.IsPCFaction))
3294 {
3295 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() ?? "");
3296 }
3297 if (pos.matFloor.alias == "snow" && EClass.rnd(3) == 0)
3298 {
3300 Msg.Say(Lang.GetList("walk_snow").RandomItem());
3301 }
3302 else if (EClass.world.weather.CurrentCondition == Weather.Condition.RainHeavy && EClass.rnd(3) == 0)
3303 {
3305 Msg.Say(Lang.GetList("walk_storm").RandomItem());
3306 }
3307 }
3309 }
3310 if (IsPCC)
3311 {
3312 int num6 = Mathf.Abs(cell2.topHeight - cell.topHeight);
3313 if ((num6 >= 3 && lastPos.sourceBlock.tileType.slopeHeight == 0 && newPoint.sourceBlock.tileType.slopeHeight == 0) || cell2.hasDoorBoat || cell.hasDoorBoat)
3314 {
3315 renderer.PlayAnime((cell2.topHeight >= cell.topHeight) ? AnimeID.JumpDown : ((num6 >= 6) ? AnimeID.Jump : AnimeID.JumpSmall));
3316 }
3317 else
3318 {
3319 float surfaceHeight = cell2.GetSurfaceHeight();
3320 float surfaceHeight2 = cell.GetSurfaceHeight();
3321 num6 = (int)Mathf.Abs((surfaceHeight - surfaceHeight2) * 100f);
3322 if (num6 >= 15)
3323 {
3324 renderer.PlayAnime((surfaceHeight >= surfaceHeight2) ? AnimeID.JumpDown : ((num6 >= 40) ? AnimeID.Jump : AnimeID.JumpSmall));
3325 }
3326 }
3327 }
3328 if (IsPC)
3329 {
3330 if (renderer.anime == null && renderer.replacer != null && renderer.replacer.pccData == null)
3331 {
3333 }
3335 {
3336 if (!FLOOR.IsTatami(pos.cell.sourceSurface.id) && pos.cell.room == null)
3337 {
3338 EClass.player.flags.isShoesOff = false;
3339 EClass.pc.Say("shoes_on", EClass.pc);
3340 EClass.pc.SetPCCState(PCCState.Normal);
3341 }
3342 }
3343 else if (FLOOR.IsTatami(pos.cell.sourceSurface.id) && pos.cell.room != null)
3344 {
3345 EClass.player.flags.isShoesOff = true;
3346 EClass.pc.Say("shoes_off", EClass.pc);
3347 EClass.pc.SetPCCState(PCCState.ShoesOff);
3348 }
3349 }
3350 bool flag7 = flag5 || EClass._zone.IsUnderwater;
3351 if (wasInWater != flag7)
3352 {
3353 wasInWater = flag7;
3354 RefreshSpeed();
3355 }
3356 lastPos.Things.ForeachReverse(delegate(Thing t)
3357 {
3358 t.trait.OnSteppedOut(this);
3359 });
3360 if (!IsPC)
3361 {
3362 pos.Things.ForeachReverse(delegate(Thing t)
3363 {
3364 t.trait.OnStepped(this);
3365 });
3366 }
3367 if (CanDestroyPath())
3368 {
3370 }
3371 if (!isDead)
3372 {
3373 if (Evalue(492) > 0 && EClass.rnd(10000 / (80 + Evalue(492) * 2)) == 0)
3374 {
3375 AddExp(Mathf.Clamp((int)Mathf.Sqrt(base.ExpToNext / 100), 1, 1000));
3376 }
3377 if (pos.IsBlocked && EClass.rnd(IsPC ? 2 : 20) == 0)
3378 {
3379 stamina.Mod(-1);
3380 }
3381 }
3382 hasMovedThisTurn = true;
3383 return MoveResult.Success;
3384 }
AnimeID
Definition: AnimeID.cs:2
AttackSource
Definition: AttackSource.cs:2
ContainerFlag
Definition: ContainerFlag.cs:5
NameStyle
Definition: NameStyle.cs:2
AIAct Current
Definition: AIAct.cs:103
virtual bool PushChara
Definition: AIAct.cs:82
static void Search(Chara c, bool manual=false)
Definition: ActWait.cs:46
virtual bool isPCC
Definition: CardActor.cs:39
void PlayAnime(AnimeID id, bool force)
TransAnime anime
Definition: CardRenderer.cs:23
virtual void NextFrame()
CardActor actor
Definition: CardRenderer.cs:11
Definition: Card.cs:11
virtual string GetName(NameStyle style, int num=-1)
Definition: Card.cs:2748
bool IsDecayed
Definition: Card.cs:2357
virtual bool isThing
Definition: Card.cs:2133
int EvalueMax(int ele, int min=0)
Definition: Card.cs:2718
SourceMaterial.Row material
Definition: Card.cs:2103
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:6606
int c_lockLv
Definition: Card.cs:991
bool ignoreAutoPick
Definition: Card.cs:509
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
Definition: Card.cs:7166
PlaceState placeState
Definition: Card.cs:86
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:4269
MoveResult
Definition: Card.cs:13
bool IsInstalled
Definition: Card.cs:2451
virtual Thing Thing
Definition: Card.cs:2110
int Evalue(int ele)
Definition: Card.cs:2704
int Dist(Card c)
Definition: Card.cs:8165
void ModExp(string alias, int a)
Definition: Card.cs:2781
SourceCategory.Row category
Definition: Card.cs:2101
virtual RenderRow TileRow
Definition: Card.cs:2187
bool isLeashed
Definition: Card.cs:845
void AddExp(int a, bool applyMod=true)
Definition: Card.cs:3116
bool HasElement(int ele, bool includeNagative=false)
Definition: Card.cs:6344
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:7284
Definition: Cell.cs:7
SourceBlock.Row sourceBlock
Definition: Cell.cs:1062
bool IsSnowTile
Definition: Cell.cs:790
bool hasDoorBoat
Definition: Cell.cs:506
bool HasBridge
Definition: Cell.cs:679
bool isClearSnow
Definition: Cell.cs:458
bool isFloating
Definition: Cell.cs:482
SourceMaterial.Row matObj
Definition: Cell.cs:1046
byte topHeight
Definition: Cell.cs:86
SourceMaterial.Row matFloor
Definition: Cell.cs:1040
byte obj
Definition: Cell.cs:40
SourceObj.Row sourceObj
Definition: Cell.cs:1084
bool HasRamp
Definition: Cell.cs:845
bool hasDoor
Definition: Cell.cs:266
SourceFloor.Row sourceSurface
Definition: Cell.cs:1069
float GetSurfaceHeight()
Definition: Cell.cs:1730
bool CanSuffocate()
Definition: Cell.cs:1123
Definition: Chara.cs:10
void TickConditions()
Definition: Chara.cs:3888
bool wasInWater
Definition: Chara.cs:150
bool IsLevitating
Definition: Chara.cs:603
AIAct ai
Definition: Chara.cs:206
override bool IsPC
Definition: Chara.cs:630
bool isDrunk
Definition: Chara.cs:126
Party party
Definition: Chara.cs:43
bool CanDestroyPath()
Definition: Chara.cs:2628
bool IsInCombat
Definition: Chara.cs:911
bool HasCondition(string alias)
Definition: Chara.cs:9938
AIAct SetAI(AIAct g)
Definition: Chara.cs:9393
bool IsIdle
Definition: Chara.cs:900
override bool IsDisabled
Definition: Chara.cs:591
bool hasMovedThisTurn
Definition: Chara.cs:180
override bool isSynced
Definition: Chara.cs:709
bool CanMoveTo(Point p, bool allowDestroyPath=true)
Definition: Chara.cs:2641
void DestroyPath(Point pos)
Definition: Chara.cs:3386
override bool IsPCFaction
Definition: Chara.cs:689
float actTime
Definition: Chara.cs:182
override int MaxHP
Definition: Chara.cs:726
Zone currentZone
Definition: Chara.cs:259
bool CanReplace(Chara c)
Definition: Chara.cs:3497
new Point lastPos
Definition: Chara.cs:90
void MoveByForce(Point newPoint, Card c=null, bool checkWall=false)
Definition: Chara.cs:2826
Stats stamina
Definition: Chara.cs:1205
Stats burden
Definition: Chara.cs:1203
Chara parasite
Definition: Chara.cs:30
Chara ride
Definition: Chara.cs:27
void RefreshSpeed(Element.BonusInfo info=null)
Definition: Chara.cs:2034
MoveResult TryMoveTowards(Point p)
Definition: Chara.cs:2834
void SyncRide()
Definition: Chara.cs:4158
bool isDead
Definition: Chara.cs:393
override void LookAt(Card c)
Definition: Chara.cs:3752
bool isConfused
Definition: Chara.cs:128
override bool IsPCC
Definition: Chara.cs:700
void TryPush(Point point)
Definition: Chara.cs:3430
void SetPCCState(PCCState state)
Definition: Chara.cs:7008
SourceRace.Row race
Definition: Chara.cs:468
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:667
Definition: Effect.cs:7
static Effect Get(Effect original)
Definition: Effect.cs:80
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:24
float defaultActPace
Definition: GameSetting.cs:329
RenderSetting render
Definition: GameSetting.cs:303
ConfigTactics tactics
Definition: Game.cs:91
Config config
Definition: Game.cs:219
Definition: Lang.cs:7
static string[] GetList(string id)
Definition: Lang.cs:113
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:853
void SetFoormark(Point pos, int id, int angle, int offset=0)
Definition: Map.cs:2106
void SetEffect(int x, int z, CellEffect effect=null)
Definition: Map.cs:1554
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:376
int distanceTravel
Definition: Player.cs:960
Flags flags
Definition: Player.cs:1161
Window.SaveData dataPick
Definition: Player.cs:1101
bool regionMoveWarned
Definition: Player.cs:1227
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:1057
Point Set(int _x, int _z)
Definition: Point.cs:503
bool IsBlocked
Definition: Point.cs:363
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:1177
SourceFloor.Row sourceFloor
Definition: Point.cs:65
bool HasObj
Definition: Point.cs:137
int Distance(Point p)
Definition: Point.cs:995
Cell cell
Definition: Point.cs:51
Point GetRandomNeighbor()
Definition: Point.cs:764
bool HasChara
Definition: Point.cs:238
TileType tileType
Definition: RenderRow.cs:77
Definition: Scene.cs:8
ParticleSystem psSmoke
Definition: Scene.cs:113
ParticleSystem psFoot
Definition: Scene.cs:111
EloMap elomap
Definition: Scene.cs:149
bool Surface
Definition: SourcePref.cs:330
virtual bool ShowDangerLv
Definition: Spatial.cs:503
virtual bool IsRegion
Definition: Spatial.cs:515
virtual string Name
Definition: Spatial.cs:509
SourceZone.Row source
Definition: Spatial.cs:453
List< Spatial > children
Definition: Spatial.cs:37
virtual void Mod(int a)
Definition: Stats.cs:135
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:169
virtual void OnSteppedOut(Chara c)
Definition: Trait.cs:1267
virtual bool IsChangeFloorHeight
Definition: Trait.cs:74
virtual void OnStepped(Chara c)
Definition: Trait.cs:1263
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:291
override int DangerLv
Definition: Zone.cs:112
bool IsPCFaction
Definition: Zone.cs:477
virtual bool IsUnderwater
Definition: Zone.cs:273
virtual bool KeepAllyDistance
Definition: Zone.cs:306
virtual bool HiddenInRegionMap
Definition: Zone.cs:417
Map map
Definition: Zone.cs:63

References EClass._map, EClass._zone, CardRenderer.actor, actTime, Card.AddExp(), CoreConfig.GameConfig.advancedMenu, GameDate.AdvanceMin(), Window.SaveData.advDistribution, ai, ConfigTactics.allyKeepDistance, CardRenderer.anime, GameSetting.RenderSetting.anime, CoreConfig.Test.animeFramePCC, burden, Card.c_lockLv, CanDestroyPath(), CanMoveTo(), CanReplace(), Cell.CanSuffocate(), Card.category, Window.SaveData.cats, Point.cell, Point.Charas, Spatial.children, Msg.colors, Core.config, Game.config, EInput.Consume(), EClass.core, AIAct.Current, Weather.CurrentCondition, currentZone, Card.DamageHP(), Zone.DangerLv, Player.dataPick, World.date, GameSetting.defaultActPace, DestroyPath(), GameSetting.RenderSetting.AnimeSetting.diagonalSpeed, Card.Dist(), Point.Distance(), Player.distanceTravel, Scene.elomap, PCOrbit.emitFoot, PCOrbit.emitSmoke, Card.Evalue(), Card.EvalueMax(), Window.SaveData.flag, Player.flags, PCOrbit.footPos, CoreConfig.game, EClass.game, Effect.Get(), EloMap.GetCell(), Lang.GetList(), Card.GetName(), Stats.GetPhase(), Point.GetRandomNeighbor(), Cell.GetSurfaceHeight(), CardRenderer.hasActor, Cell.HasBridge, Point.HasChara, HasCondition(), Cell.hasDoor, Cell.hasDoorBoat, Card.HasElement(), hasMovedThisTurn, Point.HasObj, Cell.HasRamp, Point.HasThing, Zone.HiddenInRegionMap, host, CellEffect.id, Card.ignoreAutoPick, TileRow.ignoreSnow, Point.IsBlocked, 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, Stats.Mod(), 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, RendererReplacer.pccData, 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(), 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(), stamina, 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(), AI_Bladder.Run(), and TryMove().

◆ _ShowDialog()

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

Definition at line 7612 of file Chara.cs.

7613 {
7614 EClass.Sound.Play("pop_drama");
7615 if (book == "_chara" && IsPC)
7616 {
7617 step = "pc";
7618 }
7619 if (id == "lomias")
7620 {
7622 }
7623 return LayerDrama.Activate(book, sheet, step, this, null, tag);
7624 }
ID_Achievement
static SoundManager Sound
Definition: EClass.cs:47
static LayerDrama Activate(string book, string idSheet, string idStep, Chara target=null, Card ref1=null, string tag="")
Definition: LayerDrama.cs:66
Definition: Steam.cs:10
static void GetAchievement(ID_Achievement id)
Definition: Steam.cs:51

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

◆ AddCondition() [1/2]

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

Definition at line 9778 of file Chara.cs.

9779 {
9780 c.owner = this;
9781 if (!(c is ConBurning))
9782 {
9783 if (c is ConBleed && ResistLv(964) >= 3)
9784 {
9785 return null;
9786 }
9787 }
9788 else if (ResistLv(950) >= 3)
9789 {
9790 return null;
9791 }
9793 {
9794 if (c.GainResistFactor >= 400)
9795 {
9796 c.power /= 2;
9797 }
9798 ResistCon(c);
9799 if (c.power <= 0)
9800 {
9801 return null;
9802 }
9803 }
9804 if (!force)
9805 {
9806 if (c.source.negate.Length != 0)
9807 {
9808 string[] negate = c.source.negate;
9809 foreach (string text in negate)
9810 {
9811 if (HasElement(text))
9812 {
9813 return null;
9814 }
9815 }
9816 }
9817 Element defenseAttribute = c.GetDefenseAttribute(this);
9818 if (defenseAttribute != null)
9819 {
9820 c.power = 100 * c.power / Mathf.Max(100 + defenseAttribute.Value, 1);
9821 }
9822 if (c.source.resistance.Length != 0)
9823 {
9824 int num = ResistLv(EClass.sources.elements.alias[c.source.resistance[0]].id);
9825 if (num > 0)
9826 {
9827 c.power /= num * num + 1;
9828 if (c.power <= 40)
9829 {
9830 return null;
9831 }
9832 }
9833 }
9834 c.power = c.EvaluatePower(c.power);
9835 if (c.power <= 0)
9836 {
9837 return null;
9838 }
9839 }
9840 int num2 = c.EvaluateTurn(c.power);
9841 if (c is ConDeathSentense && HasElement(494))
9842 {
9843 num2 = num2 * (100 + (int)Mathf.Sqrt(Evalue(494)) * 10) / 100;
9844 }
9845 if (num2 == 0)
9846 {
9847 return null;
9848 }
9849 for (int j = 0; j < conditions.Count; j++)
9850 {
9851 if (conditions[j].id != c.id)
9852 {
9853 continue;
9854 }
9855 if (c.Type == ConditionType.Stance || c.IsToggle)
9856 {
9857 conditions[j].Kill();
9858 return null;
9859 }
9860 if (conditions[j].CanStack(c))
9861 {
9862 if (conditions[j].ShouldOverride(c))
9863 {
9864 if (conditions[j].IsOverrideConditionMet(c, num2))
9865 {
9866 conditions[j].Kill(silent: true);
9867 continue;
9868 }
9869 return null;
9870 }
9871 if (CanGainConResist)
9872 {
9873 AddResistCon(c);
9874 }
9875 conditions[j].OnStacked(c.power);
9876 conditions[j].OnStartOrStack();
9877 conditions[j].PlayEffect();
9878 }
9879 if (!conditions[j].AllowMultipleInstance)
9880 {
9881 return null;
9882 }
9883 }
9884 foreach (Condition condition in conditions)
9885 {
9886 if (condition.TryNullify(c))
9887 {
9888 return null;
9889 }
9890 }
9891 c.value = num2;
9892 conditions.Add(c);
9893 if (CanGainConResist)
9894 {
9895 AddResistCon(c);
9896 }
9897 c.SetOwner(this);
9898 c.Start();
9899 SetDirtySpeed();
9900 if (c.ShouldRefresh)
9901 {
9902 Refresh();
9903 }
9904 if (c.CancelAI)
9905 {
9906 ai.Cancel();
9907 }
9908 if (IsPC && c.ConsumeTurn && !EClass.pc.isRestrained)
9909 {
9911 }
9912 if (c.SyncRide && (ride != null || parasite != null))
9913 {
9914 if (ride != null)
9915 {
9917 }
9918 if (parasite != null)
9919 {
9921 }
9922 }
9923 return c;
9924 }
ConditionType
Definition: ConditionType.cs:2
virtual Status Cancel()
Definition: AIAct.cs:305
virtual bool SyncRide
virtual bool IsToggle
virtual bool ShouldRefresh
virtual bool CancelAI
virtual int EvaluatePower(int p)
virtual int GainResistFactor
virtual bool ConsumeTurn
Element GetDefenseAttribute(Chara c=null)
virtual int EvaluateTurn(int p)
virtual void SetOwner(Chara _owner, bool onDeserialize=false)
virtual bool TryNullify(Condition c)
virtual ConditionType Type
Definition: BaseStats.cs:33
SourceStat.Row source
Definition: BaseStats.cs:16
int id
Definition: BaseStats.cs:11
bool isRestrained
Definition: Card.cs:569
int ResistLv(int res)
Definition: Card.cs:6339
void SetDirtySpeed()
Definition: Chara.cs:2025
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:9773
bool CanGainConResist
Definition: Chara.cs:1220
void AddResistCon(Condition con)
Definition: Chara.cs:10203
void ResistCon(Condition con)
Definition: Chara.cs:10223
static Condition Create(string alias, int power=100, Action< Condition > onCreate=null)
Definition: Condition.cs:47
static SourceManager sources
Definition: EClass.cs:43
int Value
Definition: ELEMENT.cs:301
void EndTurn(bool consume=true)
Definition: Player.cs:2153
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, ride, 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 9768 of file Chara.cs.

9768 : Condition
9769 {
9770 return AddCondition(typeof(T).Name, p, force);
9771 }
string Name
Definition: Card.cs:2191

◆ AddCooldown()

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

Definition at line 9174 of file Chara.cs.

9175 {
9176 if (_cooldowns == null)
9177 {
9178 _cooldowns = new List<int>();
9179 }
9180 if (turns != 0)
9181 {
9182 _cooldowns.Add(idEle * 1000 + turns);
9183 return;
9184 }
9185 SourceElement.Row row = EClass.sources.elements.map[idEle];
9186 if (row.cooldown > 0)
9187 {
9188 _cooldowns.Add(idEle * 1000 + row.cooldown);
9189 }
9190 }
List< int > _cooldowns
Definition: Chara.cs:58

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

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

◆ AddFoodHistory()

void Chara.AddFoodHistory ( Thing  food)
inline

Definition at line 10693 of file Chara.cs.

10694 {
10695 if (!IsPCFaction || !IsGlobal)
10696 {
10697 _historyFood = null;
10698 return;
10699 }
10700 if (_historyFood == null)
10701 {
10702 _historyFood = new List<List<string>>
10703 {
10704 new List<string>()
10705 };
10706 }
10707 if (_historyFood[0].Count < 5)
10708 {
10709 _historyFood[0].Add(food.id);
10710 }
10711 }
override bool IsGlobal
Definition: Chara.cs:628
List< List< string > > _historyFood
Definition: Chara.cs:64

References food.

Referenced by FoodEffect.Proc().

◆ AddHobby()

void Chara.AddHobby ( int  id)
inline

Definition at line 9593 of file Chara.cs.

9594 {
9595 foreach (int hobby in _hobbies)
9596 {
9597 if (hobby == id)
9598 {
9599 return;
9600 }
9601 }
9602 _hobbies.Add(id);
9603 }
List< int > _hobbies
Definition: Chara.cs:49

◆ AddRandomBodyPart()

void Chara.AddRandomBodyPart ( bool  msg = false)
inline

Definition at line 2372 of file Chara.cs.

2373 {
2374 int ele = new int[9] { 30, 31, 33, 35, 35, 36, 34, 37, 39 }.RandomItem();
2375 body.AddBodyPart(ele);
2376 if (msg)
2377 {
2378 Say("gain_bodyparts", this, Element.Get(ele).GetName().ToLower());
2379 PlaySound("offering");
2380 }
2381 }
void AddBodyPart(int ele, Thing thing=null)
Definition: CharaBody.cs:283
CharaBody body
Definition: Chara.cs:94
static SourceElement.Row Get(int id)
Definition: ELEMENT.cs:410

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

10204 {
10205 if (con.power > 0 && con.GainResistFactor > 0)
10206 {
10207 int key = con.id;
10208 if (resistCon == null)
10209 {
10210 resistCon = new Dictionary<int, int>();
10211 }
10212 if (resistCon.ContainsKey(key))
10213 {
10214 resistCon[key] += con.power * con.GainResistFactor / 100;
10215 }
10216 else
10217 {
10218 resistCon[key] = con.power * con.GainResistFactor / 100;
10219 }
10220 }
10221 }
Dictionary< int, int > resistCon
Definition: Chara.cs:218

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

◆ AddWork()

void Chara.AddWork ( int  id)
inline

Definition at line 9605 of file Chara.cs.

9606 {
9607 foreach (int work in _works)
9608 {
9609 if (work == id)
9610 {
9611 return;
9612 }
9613 }
9614 _works.Add(id);
9615 }
List< int > _works
Definition: Chara.cs:52

◆ ApplyDeathPenalty()

void Chara.ApplyDeathPenalty ( )
inline

Definition at line 5525 of file Chara.cs.

5526 {
5527 if (!IsPC)
5528 {
5529 return;
5530 }
5531 int currency = GetCurrency();
5532 if (currency > 0)
5533 {
5534 int num = currency / 3 + EClass.rnd(currency / 3 + 1);
5535 if (num <= 0)
5536 {
5537 num = 1;
5538 }
5539 Msg.Say("panaltyMoney", this, Lang._currency(num));
5540 ModCurrency(-num);
5542 }
5543 foreach (Element value in EClass.pc.elements.dict.Values)
5544 {
5545 if (EClass.rnd(5) == 0 && value.IsMainAttribute)
5546 {
5547 EClass.pc.elements.ModExp(value.id, -500f);
5548 }
5549 }
5550 }
@ currency
ElementContainerCard elements
Definition: Card.cs:42
int GetCurrency(string id="money")
Definition: Card.cs:4149
void ModCurrency(int a, string id="money")
Definition: Card.cs:4135
void ModExp(int ele, float a, bool chain=false)
Dictionary< int, Element > dict
int id
Definition: ELEMENT.cs:259
bool IsMainAttribute
Definition: ELEMENT.cs:392
static string _currency(object a, string IDCurrency)
Definition: Lang.cs:161
static Thing CreateCurrency(int a, string id="money")
Definition: ThingGen.cs:37
Card AddCard(Card t, Point point)
Definition: Zone.cs:2090

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

2208 {
2209 switch (tag)
2210 {
2211 case EditorTag.HostilityNeutral:
2212 {
2213 Hostility hostility2 = (base.c_originalHostility = Hostility.Neutral);
2214 this.hostility = hostility2;
2215 break;
2216 }
2217 case EditorTag.HostilityEnemy:
2218 {
2219 Hostility hostility2 = (base.c_originalHostility = Hostility.Enemy);
2220 this.hostility = hostility2;
2221 break;
2222 }
2223 case EditorTag.HostilityFriend:
2224 {
2225 Hostility hostility2 = (base.c_originalHostility = Hostility.Friend);
2226 this.hostility = hostility2;
2227 break;
2228 }
2229 case EditorTag.Male:
2230 bio.SetGender(2);
2231 base.c_idPortrait = Portrait.GetRandomPortrait(2, GetIdPortraitCat());
2232 break;
2233 case EditorTag.Female:
2234 bio.SetGender(1);
2235 base.c_idPortrait = Portrait.GetRandomPortrait(1, GetIdPortraitCat());
2236 break;
2237 case EditorTag.baby:
2238 SetFeat(1232);
2239 break;
2240 }
2241 base.ApplyEditorTags(tag);
2242 }
EditorTag
Definition: EditorTag.cs:2
void SetGender(int g)
Definition: Biography.cs:469
Biography bio
Definition: Card.cs:45
void SetFeat(int id, int value=1, bool msg=false)
Definition: Chara.cs:10428
string GetIdPortraitCat()
Definition: Chara.cs:8581
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 2334 of file Chara.cs.

2335 {
2336 elements.ApplyElementMap(base.uid, SourceValueType.Chara, job.elementMap, base.DefaultLV, remove, applyFeat: true);
2337 if (IsPCC)
2338 {
2339 EClass.game.uniforms.Apply(pccData, job.id, base.IsMale, canUseOtherGender: true);
2340 }
2341 }
SourceValueType
SourceJob.Row job
Definition: Chara.cs:470
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 2420 of file Chara.cs.

2421 {
2422 string[] array = race.figure.Split('|');
2423 foreach (string s in array)
2424 {
2425 int num = ParseBodySlot(s);
2426 if (num != -1)
2427 {
2428 if (remove)
2429 {
2430 body.RemoveBodyPart(num);
2431 }
2432 else
2433 {
2434 body.AddBodyPart(num);
2435 }
2436 }
2437 }
2439 elements.ApplyElementMap(base.uid, SourceValueType.Chara, race.elementMap, base.DefaultLV, remove, applyFeat: true);
2440 if (remove)
2441 {
2442 if (HasElement(1423))
2443 {
2444 SetFeat(1423, 0);
2445 }
2446 return;
2447 }
2448 bool flag = id == "chara" || id == "player";
2449 if (race.id == "bike" && id != "bike_cub")
2450 {
2451 SetFeat(1423, flag ? 10 : (1 + EClass.rnd(10)));
2452 }
2453 if (id == "moa")
2454 {
2455 SetFeat(1423, flag ? 7 : (1 + EClass.rnd(7)));
2456 }
2457 if (race.id == "horse" && EClass.rnd(5) == 0)
2458 {
2459 SetFeat(1423, flag ? 5 : (1 + EClass.rnd(5)));
2460 }
2461 }
void RefreshBodyParts()
Definition: CharaBody.cs:309
void RemoveBodyPart(int ele)
Definition: CharaBody.cs:338
int ParseBodySlot(string s)
Definition: Chara.cs:2355

References CharaBody.AddBodyPart(), ElementContainer.ApplyElementMap(), body, Card.elements, Card.HasElement(), 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 2532 of file Chara.cs.

2533 {
2534 owner?.Say("summon_vanish", this);
2535 pos.PlayEffect("vanish");
2536 pos.PlaySound("vanish");
2537 pos.PlayEffect("teleport");
2538 Destroy();
2539 }
void Destroy()
Definition: Card.cs:5301
SoundSource PlaySound(string id, bool synced=true, float v=1f, bool spatial=true)
Definition: Point.cs:1259
Effect PlayEffect(string id)
Definition: Point.cs:1254

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

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

◆ BanishAllMinions()

void Chara.BanishAllMinions ( )
inline

Definition at line 2569 of file Chara.cs.

2570 {
2571 List<Chara> list = new List<Chara>();
2572 foreach (Chara chara in EClass._map.charas)
2573 {
2574 if (chara.IsMinion && chara.master == this)
2575 {
2576 list.Add(chara);
2577 }
2578 }
2579 foreach (Chara item in list)
2580 {
2581 item.Banish(this);
2582 }
2583 }
override bool IsMinion
Definition: Chara.cs:645
Chara master
Definition: Chara.cs:88
List< Chara > charas
Definition: Map.cs:81

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

◆ CalcBurden()

void Chara.CalcBurden ( )
inline

Definition at line 1993 of file Chara.cs.

1994 {
1995 int num = base.ChildrenWeight * 100 / Mathf.Max(1, WeightLimit);
1996 if (num < 0)
1997 {
1998 num = 1000;
1999 }
2001 {
2002 num = 0;
2003 }
2004 burden.Set(num);
2005 SetDirtySpeed();
2006 }
override int WeightLimit
Definition: Chara.cs:728
bool ignoreWeight
Definition: CoreDebug.cs:202
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 6444 of file Chara.cs.

6445 {
6446 if (!(e is Spell))
6447 {
6448 return 100;
6449 }
6450 if (!IsPC)
6451 {
6452 int num2 = 95;
6453 if (host != null)
6454 {
6455 if (host.ride == this)
6456 {
6457 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.EvalueRiding()));
6458 }
6459 if (host.parasite == this)
6460 {
6461 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.Evalue(227)));
6462 }
6463 }
6464 return num2;
6465 }
6466 int num3 = Evalue(304);
6467 if (!IsPCFaction)
6468 {
6469 num3 = Mathf.Max(num3, base.LV + 5);
6470 }
6471 int num4 = 0;
6472 int num5 = 0;
6473 bool num6 = GetArmorSkill() == 122;
6474 AttackStyle attackStyle = body.GetAttackStyle();
6475 if (num6)
6476 {
6477 num4 = 20 - Evalue(122) / 5;
6478 num5 += 10 - Evalue(1654) * 4;
6479 }
6480 else
6481 {
6482 num4 = 10 - Evalue(120) / 5;
6483 }
6484 if (num4 < 5)
6485 {
6486 num4 = 5;
6487 }
6488 if (ride != null)
6489 {
6490 num4 += 5;
6491 }
6492 if (parasite != null)
6493 {
6494 num4 += 10;
6495 }
6496 if (attackStyle == AttackStyle.TwoWield)
6497 {
6498 num4 += 5;
6499 }
6500 if (attackStyle == AttackStyle.Shield)
6501 {
6502 num4 += 10;
6503 num5 += 20 - Evalue(1654) * 8;
6504 }
6505 if (isConfused)
6506 {
6507 num4 += 10000;
6508 }
6509 if (HasCondition<ConDim>())
6510 {
6511 num4 += ((Evalue(1654) >= 3) ? 1500 : 2500);
6512 }
6513 if (num > 1)
6514 {
6515 num4 += 5 * num;
6516 }
6517 if (num5 < 0)
6518 {
6519 num5 = 0;
6520 }
6521 return Mathf.Clamp(100 + e.Value - 10 - e.source.LV * e.source.cost[0] * num4 / Mathf.Max(10 + num3 * 10, 1), 0, 100 - num5);
6522 }
AttackStyle
Definition: AttackStyle.cs:2
AttackStyle GetAttackStyle()
Definition: CharaBody.cs:479
override int GetArmorSkill()
Definition: Chara.cs:8274
int EvalueRiding()
Definition: Chara.cs:6435
SourceElement.Row source
Definition: ELEMENT.cs:282
Definition: SPELL.cs:632

References Card.Evalue(), EvalueRiding(), CharaBody.GetAttackStyle(), parasite, ride, ride, Element.source, and Element.Value.

Referenced by Element._WriteNote().

◆ CalculateMaxStamina()

void Chara.CalculateMaxStamina ( )
inline

Definition at line 2188 of file Chara.cs.

2189 {
2190 int num = base.END;
2191 int num2 = 0;
2192 foreach (Element value in elements.dict.Values)
2193 {
2194 if (value.source.category == "skill")
2195 {
2196 num = ((!IsPC) ? (num + Mathf.Max(value.ValueWithoutLink, 0)) : (num + Mathf.Max(value.vBase, 0)));
2197 }
2198 }
2199 num2 = EClass.curve(num, 30, 10, 60);
2200 if (num2 < 10)
2201 {
2202 num2 = 10;
2203 }
2204 _maxStamina = num2 + 15;
2205 }
int _maxStamina
Definition: Chara.cs:369
static int curve(long _a, int start, int step, int rate=75)
Definition: EClass.cs:69
int ValueWithoutLink
Definition: ELEMENT.cs:303
int vBase
Definition: ELEMENT.cs:261

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

6751 {
6752 foreach (Chara chara in EClass._map.charas)
6753 {
6754 if (!chara.IsPCFaction && chara.OriginalHostility == OriginalHostility && (fanatic || Dist(chara) <= 6) && (EClass.rnd(3) != 0 || fanatic))
6755 {
6756 chara.GoHostile(tg);
6757 }
6758 }
6759 }
Hostility OriginalHostility
Definition: Chara.cs:475
void GoHostile(Card _tg)
Definition: Chara.cs:6644

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

8680 {
8681 if (things.IsFull())
8682 {
8683 return false;
8684 }
8685 if (t.c_isImportant)
8686 {
8687 return false;
8688 }
8689 if (t.id == "1084")
8690 {
8691 return true;
8692 }
8693 if (t.trait is TraitBookExp)
8694 {
8695 return true;
8696 }
8697 if (t.trait.CanOnlyCarry || !t.trait.CanBeDestroyed || t.trait.CanExtendBuild || t.rarity == Rarity.Artifact || t.IsContainer)
8698 {
8699 return false;
8700 }
8701 if (t.category.id == "currency" && !IsPCFaction)
8702 {
8703 return false;
8704 }
8705 if (base.IsPowerful && t.trait is TraitScroll { source: not null } traitScroll && traitScroll.source.abilityType.Contains("summon"))
8706 {
8707 return false;
8708 }
8709 return true;
8710 }
Rarity
Definition: Rarity.cs:2
string id
Definition: Card.cs:36
Rarity rarity
Definition: Card.cs:317
bool c_isImportant
Definition: Card.cs:1051
ThingContainer things
Definition: Card.cs:39
bool IsContainer
Definition: Card.cs:2141
bool IsFull(int y=0)
virtual SourceElement.Row source
Definition: TraitScroll.cs:5
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.category, Card.id, Card.IsContainer, Card.rarity, TraitScroll.source, and Card.trait.

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

◆ CanAcceptItem()

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

Definition at line 8658 of file Chara.cs.

8659 {
8661 {
8662 return true;
8663 }
8664 if (!IsValidGiftWeight(t, num))
8665 {
8666 return false;
8667 }
8668 if (!skipImportantCheck && t.c_isImportant)
8669 {
8670 return false;
8671 }
8672 if ((t.category.IsChildOf("furniture") || t.category.IsChildOf("junk")) && (!(t.trait is TraitFigure) || !HasElement(1427)) && !HasElement(1411))
8673 {
8674 return false;
8675 }
8676 return true;
8677 }
bool IsValidGiftWeight(Card t, int num=-1)
Definition: Chara.cs:8648

References Card.c_isImportant, Card.category, EClass.debug, CoreDebug.ignoreWeight, and Card.trait.

Referenced by InvOwner.CanShiftClick(), and InvOwner.Transaction.Process().

◆ CanAutoPick()

bool Chara.CanAutoPick ( Card  c)
inline

Definition at line 4499 of file Chara.cs.

4500 {
4501 return true;
4502 }

◆ CanBeTempAlly()

bool Chara.CanBeTempAlly ( Chara  c)
inline

Definition at line 2519 of file Chara.cs.

2520 {
2521 if (IsPCFaction || IsGlobal || IsMinion || IsMultisize || EClass._zone.CountMinions(c) > c.MaxSummon || base.rarity >= Rarity.Legendary)
2522 {
2523 return false;
2524 }
2525 if (HasElement(1222))
2526 {
2527 return false;
2528 }
2529 return true;
2530 }
int MaxSummon
Definition: Chara.cs:732
override bool IsMultisize
Definition: Chara.cs:724
int CountMinions(Chara c)
Definition: Zone.cs:3915

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

9158 {
9159 if (IsPC || base.isScaled || HasElement(1273))
9160 {
9161 return false;
9162 }
9163 if (!EClass.debug.godMode)
9164 {
9165 if (base.c_daysWithPC > 360)
9166 {
9167 return affinity.CanSleepBeside();
9168 }
9169 return false;
9170 }
9171 return true;
9172 }
bool CanSleepBeside()
Definition: Affinity.cs:84
Affinity affinity
Definition: Chara.cs:318
bool godMode
Definition: CoreDebug.cs:188

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

Referenced by WindowCharaMini.Refresh().

◆ CanDestroyPath()

bool Chara.CanDestroyPath ( )
inline

Definition at line 2628 of file Chara.cs.

2629 {
2630 if (!IsMultisize)
2631 {
2632 if (base.rarity >= Rarity.Superior && !base.IsPCFactionOrMinion && ai is GoalCombat)
2633 {
2634 return !EClass._zone.IsPCFaction;
2635 }
2636 return false;
2637 }
2638 return true;
2639 }

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

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

◆ CanDuplicate()

bool Chara.CanDuplicate ( DuplicateCondition  con = DuplicateCondition::Default)
inline

Definition at line 1886 of file Chara.cs.

1887 {
1888 if (EClass._zone.IsRegion)
1889 {
1890 return false;
1891 }
1893 {
1894 return false;
1895 }
1896 if (corruption >= 100)
1897 {
1898 return false;
1899 }
1900 if (con != DuplicateCondition.Water && (HasCondition<ConPoison>() || HasCondition<ConConfuse>() || HasCondition<ConDim>() || HasCondition<ConParalyze>() || HasCondition<ConSleep>() || HasCondition<ConBurning>() || HasCondition<ConFreeze>() || HasCondition<ConMiasma>()))
1901 {
1902 return false;
1903 }
1904 switch (con)
1905 {
1906 case DuplicateCondition.Scarab:
1908 {
1909 return false;
1910 }
1911 break;
1912 case DuplicateCondition.SpiderEgg:
1913 if (pos.cell.light > 0 || pos.IsSunLit)
1914 {
1915 return false;
1916 }
1917 break;
1918 }
1919 return true;
1920 }
DuplicateCondition
byte light
Definition: Cell.cs:66
bool HasRoof
Definition: Cell.cs:656
int corruption
Definition: Chara.cs:381
int CurrentGeneSlot
Definition: Chara.cs:1130
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, Map.IsIndoor, Date.IsNight, Spatial.IsRegion, Point.IsSunLit, isSynced, Cell.light, Card.pos, Game.principal, and EClass.world.

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

◆ CanEat()

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

Definition at line 7992 of file Chara.cs.

7993 {
7994 if (t.IsDecayed && !HasElement(480))
7995 {
7996 return false;
7997 }
7998 if (HasElement(1250) && !t.HasElement(710))
7999 {
8000 return false;
8001 }
8002 if (shouldEat && (!(t.trait is TraitFoodPrepared) || t.c_isImportant))
8003 {
8004 return false;
8005 }
8006 if (!t.IsNegativeGift && !t.HasTag(CTAG.ignoreUse) && !t.isEquipped)
8007 {
8008 return t.trait.CanEat(this);
8009 }
8010 return false;
8011 }
CTAG
Definition: CTAG.cs:2
bool IsNegativeGift
Definition: Card.cs:2466
bool HasTag(CTAG tag)
Definition: Card.cs:2728
bool isEquipped
Definition: Thing.cs:17
virtual bool CanEat(Chara c)
Definition: Trait.cs:1165

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

8165 {
8166 return !body.IsTooHeavyToEquip(t);
8167 }
bool IsTooHeavyToEquip(Thing thing)
Definition: CharaBody.cs:168

References CharaBody.IsTooHeavyToEquip().

Referenced by GoalAutoCombat.TryUseRanged().

◆ CanInsult()

bool Chara.CanInsult ( )
inline

Definition at line 8569 of file Chara.cs.

8570 {
8571 foreach (ActList.Item item in ability.list.items)
8572 {
8573 if (item.act.id == 6630)
8574 {
8575 return true;
8576 }
8577 }
8578 return false;
8579 }
List< Item > items
Definition: ActList.cs:14
ActList list
Definition: CharaAbility.cs:13
CharaAbility ability
Definition: Chara.cs:428

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

◆ CanInteractTo() [1/2]

bool Chara.CanInteractTo ( Card  c)
inline

Definition at line 2735 of file Chara.cs.

2736 {
2737 return CanInteractTo(c.pos);
2738 }
bool CanInteractTo(Card c)
Definition: Chara.cs:2735

References CanInteractTo(), and Card.pos.

Referenced by ActPlan._Update(), CanInteractTo(), ActMelee.CanPerform(), AI_Goto.IsDestinationReached(), ActPlan.Item.Perform(), and GoalCombat.TryUseAbility().

◆ CanInteractTo() [2/2]

bool Chara.CanInteractTo ( Point  p)
inline

Definition at line 2740 of file Chara.cs.

2741 {
2742 if (!p.IsValid)
2743 {
2744 return false;
2745 }
2746 if (EClass._map.cells[p.x, p.z].blocked)
2747 {
2748 return true;
2749 }
2750 if (!IsMultisize)
2751 {
2752 int num = ((p.z >= pos.z) ? ((p.x > pos.x) ? 1 : ((p.z > pos.z) ? 2 : 3)) : 0);
2753 if (EClass._map.cells[pos.x, pos.z].weights[num] == 0)
2754 {
2755 return false;
2756 }
2757 if (p.x != pos.x && p.z != pos.z)
2758 {
2759 Cell[,] cells = EClass._map.cells;
2760 int x = p.x;
2761 int z = pos.z;
2762 int num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2763 if (cells[pos.x, pos.z].weights[num2] == 0)
2764 {
2765 return false;
2766 }
2767 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2768 if (cells[p.x, p.z].weights[num2] == 0)
2769 {
2770 return false;
2771 }
2772 x = pos.x;
2773 z = p.z;
2774 num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2775 if (cells[pos.x, pos.z].weights[num2] == 0)
2776 {
2777 return false;
2778 }
2779 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2780 if (cells[p.x, p.z].weights[num2] == 0)
2781 {
2782 return false;
2783 }
2784 }
2785 }
2786 return true;
2787 }
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 4494 of file Chara.cs.

4495 {
4496 return true;
4497 }

Referenced by HotItemNoItem._TrySetAct().

◆ CanMoveTo()

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

Definition at line 2641 of file Chara.cs.

2642 {
2643 if (!p.IsValid)
2644 {
2645 return false;
2646 }
2647 int num = ((p.z >= pos.z) ? ((p.x > pos.x) ? 1 : ((p.z > pos.z) ? 2 : 3)) : 0);
2648 if (allowDestroyPath && CanDestroyPath())
2649 {
2650 if (!p.IsInBounds)
2651 {
2652 return false;
2653 }
2654 }
2655 else
2656 {
2658 {
2659 return false;
2660 }
2661 if (p.x != pos.x && p.z != pos.z)
2662 {
2663 Cell[,] cells = EClass._map.cells;
2664 int x = p.x;
2665 int z = pos.z;
2666 int num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2667 if (cells[pos.x, pos.z].weights[num2] == 0)
2668 {
2669 return false;
2670 }
2671 if (cells[x, z].blocked && (!IsAstralBody || cells[x, z].IsSky || EClass._zone.IsRegion))
2672 {
2673 return false;
2674 }
2675 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2676 if (cells[p.x, p.z].weights[num2] == 0)
2677 {
2678 return false;
2679 }
2680 x = pos.x;
2681 z = p.z;
2682 num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2683 if (cells[pos.x, pos.z].weights[num2] == 0)
2684 {
2685 return false;
2686 }
2687 if (cells[x, z].blocked && (!IsAstralBody || cells[x, z].IsSky || EClass._zone.IsRegion))
2688 {
2689 return false;
2690 }
2691 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2692 if (cells[p.x, p.z].weights[num2] == 0)
2693 {
2694 return false;
2695 }
2696 }
2697 }
2698 if (IsPC)
2699 {
2700 if (IsEnemyOnPath(p))
2701 {
2702 return false;
2703 }
2704 }
2705 else if (p.HasChara && !IsMultisize && !CanReplace(p.FirstChara))
2706 {
2707 return false;
2708 }
2709 return true;
2710 }
bool IsSky
Definition: Cell.cs:942
bool IsAstralBody
Definition: Chara.cs:506
bool IsEnemyOnPath(Point p, bool cancelAI=true)
Definition: Chara.cs:2712
bool Contains(int dx, int dz)
Definition: MapBounds.cs:38
MapBounds bounds
Definition: Map.cs:52
Chara FirstChara
Definition: Point.cs:288
bool IsInBounds
Definition: Point.cs:104

References EClass._map, EClass._zone, Algorithms.WeightCell.blocked, Map.bounds, CanDestroyPath(), CanReplace(), Map.cells, MapBounds.Contains(), Point.FirstChara, Point.HasChara, IsAstralBody, IsEnemyOnPath(), Point.IsInBounds, IsMultisize, IsPC, Spatial.IsRegion, Cell.IsSky, 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 4504 of file Chara.cs.

4505 {
4506 if (c.isDestroyed)
4507 {
4508 return false;
4509 }
4510 Card rootCard = c.GetRootCard();
4511 if (rootCard.isDestroyed || (rootCard.ExistsOnMap && rootCard.pos.Distance(pos) > 1))
4512 {
4513 return false;
4514 }
4515 if (rootCard != this && things.IsFull(c.Thing))
4516 {
4517 return false;
4518 }
4519 return true;
4520 }
bool isDestroyed
Definition: Card.cs:78
bool ExistsOnMap
Definition: Card.cs:2137
Card GetRootCard()
Definition: Card.cs:3600

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

3498 {
3500 {
3501 return false;
3502 }
3503 if (IsPC)
3504 {
3505 return true;
3506 }
3507 if (c.IsPC || c.pos.Equals(EClass.pc.pos) || c.host != null)
3508 {
3509 return false;
3510 }
3511 if (!IsHostile(c))
3512 {
3513 if (c.c_uidMaster != 0 || c.isSummon || base.IsPowerful || IsEscorted())
3514 {
3515 return true;
3516 }
3517 if (DestDist < c.DestDist)
3518 {
3519 return true;
3520 }
3521 if (IsPCParty && !c.IsPCParty)
3522 {
3523 return true;
3524 }
3525 if (IsPCFaction && !c.IsPCParty)
3526 {
3527 return true;
3528 }
3529 }
3530 return false;
3531 }
bool IsPCFactionOrMinion
Definition: Card.cs:2342
bool isSummon
Definition: Card.cs:713
int c_uidMaster
Definition: Card.cs:1489
bool noMove
Definition: Card.cs:773
new TraitChara trait
Definition: Chara.cs:509
override bool IsPCParty
Definition: Chara.cs:633
int DestDist
Definition: Chara.cs:1045
bool IsHostile()
Definition: Chara.cs:6849
bool IsEscorted()
Definition: Chara.cs:2612
bool Equals(int _x, int _z)
Definition: Point.cs:966
virtual bool CanBePushed
Definition: TraitChara.cs:116

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

5394 {
5395 return EClass.world.date.IsExpired(base.c_dateDeathLock);
5396 }
bool IsExpired(int time)
Definition: Date.cs:338

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

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

◆ CanSee()

bool Chara.CanSee ( Card  c)
inline

Definition at line 1277 of file Chara.cs.

1278 {
1279 if (c == this)
1280 {
1281 return true;
1282 }
1283 if (!c.pos.IsValid)
1284 {
1285 return false;
1286 }
1287 if (c.isChara)
1288 {
1290 {
1291 return true;
1292 }
1293 if (c.isHidden && c != this && !canSeeInvisible)
1294 {
1295 return false;
1296 }
1297 }
1298 if (IsPC)
1299 {
1300 if (fov != null)
1301 {
1302 return fov.lastPoints.ContainsKey(c.pos.index);
1303 }
1304 return false;
1305 }
1306 return true;
1307 }
virtual Chara Chara
Definition: Card.cs:2122
Fov fov
Definition: Card.cs:58
virtual bool isChara
Definition: Card.cs:2135
bool isHidden
Definition: Card.cs:533
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 1318 of file Chara.cs.

1319 {
1320 if (dist == -1)
1321 {
1322 dist = pos.Distance(p);
1323 }
1324 if (dist > GetSightRadius())
1325 {
1326 return false;
1327 }
1328 if (IsPC)
1329 {
1330 if (fov != null)
1331 {
1332 return fov.lastPoints.ContainsKey(p.index);
1333 }
1334 return false;
1335 }
1336 if ((pos.IsBlocked || p.IsBlocked) && dist <= 1)
1337 {
1338 return true;
1339 }
1340 return Los.IsVisible(pos, p);
1341 }
int GetSightRadius()
Definition: Card.cs:6860
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, Point.IsBlocked, IsPC, Los.IsVisible(), Fov.lastPoints, and Card.pos.

◆ CanSeeSimple()

bool Chara.CanSeeSimple ( Point  p)
inline

Definition at line 1260 of file Chara.cs.

1261 {
1262 if (!p.IsValid || p.IsHidden)
1263 {
1264 return false;
1265 }
1266 if (IsPC)
1267 {
1268 if (fov != null)
1269 {
1270 return fov.lastPoints.ContainsKey(p.index);
1271 }
1272 return false;
1273 }
1274 return true;
1275 }
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 1362 of file Chara.cs.

1363 {
1364 if (EClass._zone.events.GetEvent<ZoneEventQuest>() != null)
1365 {
1366 return false;
1367 }
1368 if (!EClass.debug.godMode && sleepiness.GetPhase() == 0)
1369 {
1370 return stamina.GetPhase() <= 1;
1371 }
1372 return true;
1373 }
Stats sleepiness
Definition: Chara.cs:1215
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 2343 of file Chara.cs.

2344 {
2345 ApplyJob(remove: true);
2346 base.c_idJob = idNew;
2347 _job = null;
2348 ApplyJob();
2349 if (IsPCC)
2350 {
2351 PCC.Get(pccData).Build();
2352 }
2353 }
void ApplyJob(bool remove=false)
Definition: Chara.cs:2334
SourceJob.Row _job
Definition: Chara.cs:166

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

7408 {
7409 memberType = type;
7410 }
FactionMemberType memberType
Definition: Chara.cs:46

◆ ChangeRace()

void Chara.ChangeRace ( string  idNew)
inline

Definition at line 2463 of file Chara.cs.

2464 {
2465 ApplyRace(remove: true);
2466 base.c_idRace = idNew;
2467 _race = null;
2468 ApplyRace();
2469 ChangeMaterial(source.defMat.IsEmpty(race.material));
2470 }
@ ChangeMaterial
void ApplyRace(bool remove=false)
Definition: Chara.cs:2420
SourceRace.Row _race
Definition: Chara.cs:164

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

1478 {
1479 if (r != base.rarity)
1480 {
1481 base.rarity = r;
1482 if (renderer != null && renderer.isSynced)
1483 {
1485 }
1486 base.hp = MaxHP;
1487 }
1488 }
void RefreshExtra()

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

Referenced by ZonePreEnterBout.Execute().

◆ ChooseNewGoal()

void Chara.ChooseNewGoal ( )
inline

Definition at line 9264 of file Chara.cs.

9265 {
9266 if (IsPC && EClass.AdvMode)
9267 {
9268 SetNoGoal();
9269 return;
9270 }
9271 if (IsPCParty || base.noMove)
9272 {
9273 SetAI(new GoalIdle());
9274 return;
9275 }
9276 if ((IsHomeMember() && IsInHomeZone()) || IsGuest())
9277 {
9278 Goal goalFromTimeTable = GetGoalFromTimeTable(EClass.world.date.hour);
9279 if (goalFromTimeTable != null)
9280 {
9281 SetAI(goalFromTimeTable);
9282 if (goalFromTimeTable is GoalWork)
9283 {
9284 goalFromTimeTable.Tick();
9285 }
9286 return;
9287 }
9288 }
9289 if (goalList.index == -2)
9290 {
9292 }
9293 SetAI(goalList.Next());
9294 }
Status Tick()
Definition: AIAct.cs:366
Goal GetGoalFromTimeTable(int hour)
Definition: Chara.cs:9296
GoalListType goalListType
Definition: Chara.cs:283
AIAct SetNoGoal()
Definition: Chara.cs:9388
bool IsHomeMember()
Definition: Chara.cs:6915
bool IsGuest()
Definition: Chara.cs:6940
GoalList goalList
Definition: Chara.cs:204
bool IsInHomeZone()
Definition: Chara.cs:6920
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 7699 of file Chara.cs.

7700 {
7701 if (map == null)
7702 {
7703 map = EClass._map;
7704 }
7705 foreach (Card item in map.props.installed.all)
7706 {
7707 if (item.trait is TraitBed traitBed && traitBed.IsHolder(this))
7708 {
7709 traitBed.RemoveHolder(this);
7710 }
7711 }
7712 }
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 9036 of file Chara.cs.

9037 {
9038 int num = 0;
9039 for (int num2 = things.Count - 1; num2 >= 0; num2--)
9040 {
9041 Thing thing = things[num2];
9042 if (ShouldThrowAway(thing, type))
9043 {
9044 num += thing.GetPrice(CurrencyType.Money, sell: true, PriceType.Default, this) * thing.Num;
9045 thing.Destroy();
9046 }
9047 }
9048 if (num > 0)
9049 {
9050 ModCurrency(num);
9051 if (type == ClearInventoryType.SellAtTown)
9052 {
9053 Msg.Say("party_sell", this, num.ToString() ?? "");
9054 PlaySound("pay");
9055 }
9056 }
9057 }
ClearInventoryType
CurrencyType
Definition: CurrencyType.cs:2
PriceType
Definition: PriceType.cs:2
int Num
Definition: Card.cs:161
bool ShouldThrowAway(Thing t, ClearInventoryType type)
Definition: Chara.cs:8931
override int GetPrice(CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
Definition: Thing.cs:829

References Card.Destroy(), Thing.GetPrice(), Card.Num, and Msg.Say().

Referenced by AI_Idle.Run().

◆ ClearTempElements()

void Chara.ClearTempElements ( )
inline

Definition at line 10907 of file Chara.cs.

10908 {
10909 if (tempElements != null)
10910 {
10912 tempElements = null;
10913 }
10914 }
ElementContainer tempElements
Definition: Chara.cs:36
void SetParent(Card c)

References ElementContainer.SetParent().

◆ CountDebuff()

int Chara.CountDebuff ( )
inline

Definition at line 9967 of file Chara.cs.

9968 {
9969 int num = 0;
9970 foreach (Condition condition in conditions)
9971 {
9972 if (condition.Type == ConditionType.Debuff)
9973 {
9974 num++;
9975 }
9976 }
9977 return num;
9978 }

References BaseStats.Type.

Referenced by GoalCombat.TryUseAbility().

◆ CountNumEaten()

int Chara.CountNumEaten ( Thing  food)
inline

Definition at line 10713 of file Chara.cs.

10714 {
10715 if (_historyFood == null)
10716 {
10717 return -1;
10718 }
10719 int num = 0;
10720 foreach (List<string> item in _historyFood)
10721 {
10722 foreach (string item2 in item)
10723 {
10724 if (item2 == food.id)
10725 {
10726 num++;
10727 }
10728 }
10729 }
10730 return num;
10731 }

References food, and item.

Referenced by FoodEffect.Proc().

◆ CreateReplacement()

Chara Chara.CreateReplacement ( )
inline

Definition at line 8422 of file Chara.cs.

8423 {
8424 Chara chara = CharaGen.Create(id);
8425 chara.c_originalHostility = base.c_originalHostility;
8426 if (chara.c_originalHostility != 0)
8427 {
8428 chara.hostility = chara.c_originalHostility;
8429 }
8430 if (orgPos != null)
8431 {
8432 chara.orgPos = orgPos.Copy();
8433 }
8434 chara.pos = pos.Copy();
8435 chara.isImported = true;
8436 chara.c_editorTags = base.c_editorTags;
8437 chara.c_editorTraitVal = base.c_editorTraitVal;
8438 chara.c_idTrait = base.c_idTrait;
8439 chara.homeZone = homeZone;
8440 return chara;
8441 }
Hostility c_originalHostility
Definition: Card.cs:1003
static Chara Create(string id, int lv=-1)
Definition: CharaGen.cs:17
Zone homeZone
Definition: Chara.cs:271
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 6536 of file Chara.cs.

6537 {
6538 Talk("goodBoy");
6539 Say(headpat ? "headpat" : "cuddle", this, c);
6540 c.ShowEmo(Emo.love);
6541 if (EClass.rnd(IsPC ? 100 : 5000) == 0)
6542 {
6543 c.MakeEgg();
6544 }
6545 if (headpat && this != c)
6546 {
6547 if (c.interest > 0)
6548 {
6549 c.ModAffinity(EClass.pc, 1 + EClass.rnd(3));
6550 c.interest -= 20 + EClass.rnd(10);
6551 }
6553 {
6554 foreach (Chara member in party.members)
6555 {
6556 if (!member.IsPC && CanSeeLos(member))
6557 {
6558 member.AddCondition<ConEuphoric>(100 + Evalue(6904) * 5);
6559 }
6560 }
6561 }
6562 }
6563 if (c.Evalue(1221) > 0)
6564 {
6565 int ele = ((c.MainElement == Element.Void) ? 924 : c.MainElement.id);
6566 if (c.id == "hedgehog_ether")
6567 {
6568 ele = 922;
6569 }
6570 Say("reflect_thorne", this, c);
6571 DamageHP(10L, ele, Power, AttackSource.Condition);
6572 }
6573 }
Emo
Definition: Emo.cs:2
virtual int Power
Definition: Card.cs:2365
void ShowEmo(Emo _emo=Emo.none, float duration=0f, bool skipSame=true)
Definition: Card.cs:6574
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
Definition: Card.cs:6018
Element MainElement
Definition: Chara.cs:735
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Definition: Chara.cs:8344
int interest
Definition: Chara.cs:321
Religion faith
Definition: Chara.cs:443
static Element Void
Definition: ELEMENT.cs:247
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 10042 of file Chara.cs.

10043 {
10044 bool flag = state == BlessedState.Blessed;
10045 switch (type)
10046 {
10047 case CureType.Heal:
10048 case CureType.Prayer:
10049 CureCondition<ConFear>();
10050 CureCondition<ConBlind>(2 * p / 100 + 5);
10051 CureCondition<ConPoison>(5 * p / 100 + 5);
10052 CureCondition<ConConfuse>(10 * p / 100 + 10);
10053 CureCondition<ConDim>(p / 100 + 5);
10054 CureCondition<ConBleed>(2 * p / 100 + 10);
10055 if (flag)
10056 {
10057 SAN.Mod(-15);
10058 }
10059 break;
10060 case CureType.CureBody:
10061 CureCondition<ConBlind>(5 * p / 100 + 15);
10062 CureCondition<ConPoison>(10 * p / 100 + 15);
10063 CureCondition<ConBleed>(5 * p / 100 + 20);
10064 CureTempElements(p, body: true, mind: false);
10065 break;
10066 case CureType.CureMind:
10067 CureCondition<ConFear>();
10068 CureCondition<ConDim>(3 * p / 100 + 10);
10069 CureTempElements(p, body: false, mind: true);
10070 break;
10071 case CureType.Sleep:
10072 {
10073 for (int num2 = conditions.Count - 1; num2 >= 0; num2--)
10074 {
10075 Condition condition2 = conditions[num2];
10076 if (!(condition2 is ConSleep) && !(condition2 is ConFaint))
10077 {
10078 if (condition2.isPerfume)
10079 {
10080 condition2.Mod(-1, force: true);
10081 }
10082 else if (condition2.Type == ConditionType.Bad || condition2.Type == ConditionType.Debuff)
10083 {
10084 condition2.Kill();
10085 }
10086 }
10087 }
10088 CureCondition<ConWait>();
10089 CureCondition<ConDisease>((EClass.rnd(20) + 10) * p / 100);
10090 bool flag2 = HasCondition<ConAnorexia>();
10091 base.c_vomit -= (flag2 ? 3 : 2) * p / 100;
10092 if (base.c_vomit < 0)
10093 {
10094 base.c_vomit = 0;
10095 if (flag2)
10096 {
10097 RemoveCondition<ConAnorexia>();
10098 }
10099 }
10100 break;
10101 }
10102 case CureType.HealComplete:
10103 case CureType.Death:
10104 case CureType.Jure:
10105 case CureType.Boss:
10106 case CureType.Unicorn:
10107 {
10108 CureTempElements(p * 100, body: true, mind: true);
10109 for (int num = conditions.Count - 1; num >= 0; num--)
10110 {
10111 Condition condition = conditions[num];
10112 if (condition is ConAnorexia && type != CureType.Death && type != CureType.Unicorn && type != CureType.Jure)
10113 {
10114 continue;
10115 }
10116 switch (condition.Type)
10117 {
10118 case ConditionType.Bad:
10119 case ConditionType.Debuff:
10120 case ConditionType.Disease:
10121 condition.Kill();
10122 continue;
10123 case ConditionType.Stance:
10124 if (type == CureType.Death)
10125 {
10126 condition.Kill();
10127 continue;
10128 }
10129 break;
10130 }
10131 if (type == CureType.Death && condition.isPerfume)
10132 {
10133 condition.Kill();
10134 }
10135 }
10136 CureCondition<ConWait>();
10137 CureCondition<ConSleep>();
10138 switch (type)
10139 {
10140 case CureType.Death:
10141 case CureType.Boss:
10142 case CureType.Unicorn:
10143 SAN.Mod(-20);
10144 RemoveCondition<ConBrightnessOfLife>();
10145 RemoveCondition<ConDeathSentense>();
10146 break;
10147 case CureType.Jure:
10148 SAN.Mod(-999);
10149 if (HasElement(1206))
10150 {
10151 SetFeat(1206, 0, msg: true);
10152 }
10153 RemoveCondition<ConBrightnessOfLife>();
10154 RemoveCondition<ConDeathSentense>();
10155 break;
10156 case CureType.CureBody:
10157 case CureType.CureMind:
10158 case CureType.Prayer:
10159 break;
10160 }
10161 break;
10162 }
10163 }
10164 }
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:10877
Stats SAN
Definition: Chara.cs:1217
void Kill(bool silent=false)
Definition: Condition.cs:108

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

9980 : Condition
9981 {
9982 T condition = GetCondition<T>();
9983 if (condition != null)
9984 {
9985 condition.value -= v;
9986 if (condition.value <= 0)
9987 {
9988 condition.Kill();
9989 }
9990 }
9991 }
override T GetCondition< T >()
Definition: Chara.cs:10005

◆ CureHost()

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

Definition at line 10029 of file Chara.cs.

10030 {
10031 if (parasite != null)
10032 {
10033 parasite.Cure(type, p, state);
10034 }
10035 if (ride != null)
10036 {
10037 ride.Cure(type, p, state);
10038 }
10039 Cure(type, p, state);
10040 }
void Cure(CureType type, int p=100, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:10042

References Cure(), and ride.

Referenced by FactionBranch.DailyOutcome().

◆ CureTempElements()

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

Definition at line 10877 of file Chara.cs.

10878 {
10879 if (tempElements != null)
10880 {
10881 if (body)
10882 {
10884 }
10885 if (mind)
10886 {
10888 }
10889 }
10890 void Cure(int[] eles)
10891 {
10892 foreach (int ele in eles)
10893 {
10894 if (tempElements == null)
10895 {
10896 break;
10897 }
10898 Element element = tempElements.GetElement(ele);
10899 if (element != null && element.vBase < 0)
10900 {
10901 ModTempElement(ele, Mathf.Clamp(p / 20 + EClass.rnd(p / 20), 1, -element.vBase));
10902 }
10903 }
10904 }
10905 }
void ModTempElement(int ele, int a, bool naturalDecay=false, bool onlyRenew=false)
Definition: Chara.cs:10785
Element GetElement(string alias)
static int[] List_Body
Definition: ELEMENT.cs:253
static int[] List_Mind
Definition: ELEMENT.cs:255

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

10844 {
10845 ModTempElement(ele, onlyRenew ? (-p / 20) : (-(p / 100 + EClass.rnd(p / 100 + 1) + 1)), naturalDecay: false, onlyRenew);
10846 }

References EClass.rnd().

◆ DamageTempElements()

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

Definition at line 10831 of file Chara.cs.

10832 {
10833 if (body)
10834 {
10835 DamageTempElement(Element.List_Body.RandomItem(), p, onlyRenew);
10836 }
10837 if (mind)
10838 {
10839 DamageTempElement(Element.List_Mind.RandomItem(), p, onlyRenew);
10840 }
10841 }
void DamageTempElement(int ele, int p, bool onlyRenew=false)
Definition: Chara.cs:10843

References Element.List_Body, and Element.List_Mind.

◆ DestroyPath()

void Chara.DestroyPath ( Point  pos)
inline

Definition at line 3386 of file Chara.cs.

3387 {
3388 bool broke = false;
3389 pos.ForeachMultiSize(base.W, base.H, delegate(Point _p, bool main)
3390 {
3391 if (_p.IsValid)
3392 {
3393 if (_p.HasBlock)
3394 {
3395 EClass._map.MineBlock(_p, recoverBlock: false, this);
3396 if (_p.HasObj)
3397 {
3398 EClass._map.MineObj(_p, null, this);
3399 }
3400 broke = true;
3401 }
3402 if (_p.HasObj && _p.IsBlocked)
3403 {
3404 EClass._map.MineObj(_p, null, this);
3405 broke = true;
3406 }
3407 _p.Things.ForeachReverse(delegate(Thing t)
3408 {
3409 if (t.IsInstalled && (t.trait.IsBlockPath || t.trait.IsDoor))
3410 {
3411 if (t.isNPCProperty && t.trait.CanBeDestroyed)
3412 {
3413 t.Destroy();
3414 }
3415 else if (!t.IsUnique && !t.trait.CanBeDestroyed)
3416 {
3417 t.SetPlaceState(PlaceState.roaming);
3418 }
3419 }
3420 });
3421 }
3422 });
3423 if (broke)
3424 {
3425 Msg.Say("stomp");
3426 Shaker.ShakeCam("stomp");
3427 }
3428 }
if(!match.Success)
bool IsUnique
Definition: Card.cs:2143
void ForeachMultiSize(int w, int h, Action< Point, bool > action)
Definition: Point.cs:1391
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 5588 of file Chara.cs.

5589 {
5590 combatCount = 0;
5591 if (isDead)
5592 {
5593 return;
5594 }
5595 if (host != null)
5596 {
5597 base.hp = -1;
5598 if ((uint)(attackSource - 17) > 1u)
5599 {
5600 AddCondition<ConFaint>(200, force: true);
5601 return;
5602 }
5603 ActRide.Unride(host, this);
5604 }
5605 bool isInActiveZone = IsInActiveZone;
5606 if (isInActiveZone)
5607 {
5608 if (id == "putty" && origin != null && origin.IsPCParty)
5609 {
5611 }
5612 if (IsPC)
5613 {
5615 }
5616 if (base.isSummon)
5617 {
5618 if (id == "tsunami")
5619 {
5620 pos.PlaySound("water");
5621 }
5622 else
5623 {
5624 Say("summon_vanish", this);
5625 pos.PlayEffect("vanish");
5626 pos.PlaySound("vanish");
5627 }
5628 Destroy();
5629 return;
5630 }
5631 if ((uint)(attackSource - 17) <= 1u)
5632 {
5633 if (attackSource == AttackSource.Euthanasia && trait is TraitLittleOne)
5634 {
5635 MakeEgg();
5636 if (IsPCFaction)
5637 {
5639 }
5640 }
5641 PlayEffect("revive");
5642 PlaySound("chime_angel");
5643 }
5644 else
5645 {
5646 Effect.Get("blood").Play((parent is Chara) ? (parent as Chara).pos : pos).SetParticleColor(EClass.Colors.matColors[base.material.alias].main)
5647 .Emit(50);
5648 AddBlood(AI_Slaughter.slaughtering ? 12 : (2 + EClass.rnd(2)));
5649 PlaySound(base.material.GetSoundDead(source));
5650 }
5653 ClearFOV();
5654 }
5655 if (base.hp >= 0)
5656 {
5657 base.hp = -1;
5658 }
5659 string text = "";
5660 "dead_in".langGame(EClass._zone.Name);
5661 string text2 = ((origin == null) ? "" : origin.GetName(NameStyle.Full));
5662 if (LangGame.Has("dead_" + attackSource))
5663 {
5664 text = "dead_" + attackSource;
5665 }
5666 else
5667 {
5668 if (e != Element.Void && e != null)
5669 {
5670 text = "dead_" + e.source.alias;
5671 }
5672 if (text == "" || !LangGame.Has(text))
5673 {
5674 text = "dead";
5675 }
5676 }
5677 if (IsPC)
5678 {
5679 EClass._zone.isDeathLocation = true;
5680 string s = ((origin == null) ? text : "dead_by");
5682 if (attackSource == AttackSource.Wrath)
5683 {
5685 }
5686 EClass.player.deathMsg = GameLang.Parse(s.langGame(), thirdPerson: true, EClass.pc.NameBraced, "dead_in".langGame(EClass._zone.Name), text2);
5688 if (EClass._zone.instance is ZoneInstanceRandomQuest zoneInstanceRandomQuest)
5689 {
5690 zoneInstanceRandomQuest.status = ZoneInstance.Status.Fail;
5691 }
5692 AI_PlayMusic.keepPlaying = false;
5693 }
5694 if (isInActiveZone)
5695 {
5696 if (attackSource == AttackSource.DeathSentence || attackSource == AttackSource.Euthanasia)
5697 {
5698 Msg.Say("goto_heaven", this);
5699 }
5700 else
5701 {
5702 if (originalTarget != null || origin == null || !origin.isSynced || (attackSource != AttackSource.Melee && attackSource != AttackSource.Range))
5703 {
5704 Msg.Say(text, this, "", text2);
5705 }
5706 string text3 = TalkTopic("dead");
5707 if (!text3.IsEmpty())
5708 {
5709 text3 = text3.StripBrackets();
5710 }
5711 bool flag = base.rarity >= Rarity.Legendary && !IsPCFaction;
5712 if (!IsPC && flag)
5713 {
5714 MakeGrave(text3);
5715 }
5716 Msg.SetColor();
5717 SpawnLoot(origin);
5718 }
5719 if (IsPC)
5720 {
5722 }
5723 }
5724 if (IsPCFaction)
5725 {
5726 if (homeBranch != null)
5727 {
5728 homeBranch.Log(text, this, "");
5729 }
5730 WidgetPopText.Say("popDead".lang(base.Name), FontColor.Bad);
5731 if (!IsPC)
5732 {
5733 if (EClass.player.stats.allyDeath == 0)
5734 {
5735 Tutorial.Reserve("death_pet");
5736 }
5738 }
5739 }
5740 if (id == "mandrake" || HasElement(488))
5741 {
5742 Say("a_scream", this);
5743 ActEffect.ProcAt(EffectId.Scream, base.LV * 3 + 200, BlessedState.Normal, this, this, pos, isNeg: true);
5744 }
5745 daysStarved = 0;
5746 isDead = true;
5748 enemy = null;
5749 _cooldowns = null;
5750 base.isSale = false;
5751 SetInt(70);
5752 EClass._map.props.sales.Remove(this);
5753 Cure(CureType.Death);
5754 SetAI(new NoGoal());
5756 if (isInActiveZone && EClass._zone.HasLaw && IsHuman && OriginalHostility >= Hostility.Neutral)
5757 {
5758 pos.TalkWitnesses(origin?.Chara, "witness", 3, WitnessType.crime, (Chara c) => !c.IsPCParty && !c.IsUnique);
5759 }
5760 if (IsPC)
5761 {
5762 EClass.player.returnInfo = null;
5763 EClass.player.uidLastTravelZone = 0;
5764 foreach (Chara chara3 in EClass._map.charas)
5765 {
5766 if (chara3.IsHostile())
5767 {
5768 chara3.hostility = chara3.OriginalHostility;
5769 }
5770 if (chara3.enemy == EClass.pc)
5771 {
5772 chara3.enemy = null;
5773 }
5774 }
5775 if (EClass.pc.things.Find("letter_will") != null && EClass.rnd(10) == 0)
5776 {
5777 EClass.player.preventDeathPenalty = true;
5778 }
5779 }
5780 else
5781 {
5782 bool flag2 = currentZone.IsActiveZone && IsLocalChara && !currentZone.IsPCFaction;
5783 if (currentZone is Zone_LittleGarden && id == "littleOne")
5784 {
5785 flag2 = false;
5786 }
5787 if (flag2)
5788 {
5789 EClass._map.deadCharas.Add(this);
5790 }
5791 currentZone.RemoveCard(this);
5792 }
5793 if ((origin != null && origin.IsPCParty) || IsPCFaction)
5794 {
5795 int a = -10;
5796 if (IsPCFaction && !IsPCParty && (origin == null || !origin.IsPCParty))
5797 {
5798 a = -5;
5799 }
5800 ModAffinity(EClass.pc, a, show: false);
5801 string text4 = id;
5802 if (!(text4 == "quru"))
5803 {
5804 if (text4 == "corgon")
5805 {
5806 EClass.game.cards.globalCharas.Find("quru")?.ModAffinity(EClass.pc, -20, show: false);
5807 }
5808 }
5809 else
5810 {
5811 EClass.game.cards.globalCharas.Find("corgon")?.ModAffinity(EClass.pc, -20, show: false);
5812 }
5813 }
5814 if (origin != null)
5815 {
5816 if (origin.IsPCParty || origin.IsPCPartyMinion)
5817 {
5818 int num = 0;
5820 {
5821 num = -20;
5822 }
5823 else if (OriginalHostility >= Hostility.Friend && IsHuman && !base.IsPCFactionOrMinion)
5824 {
5825 num = -5;
5826 }
5827 else if (race.id == "cat" && OriginalHostility >= Hostility.Neutral)
5828 {
5829 EClass.pc.Say("killcat");
5830 num = -1;
5831 }
5832 if (EClass.pc.party.HasElement(1563) && num < 0)
5833 {
5834 num = num * 30 / 100;
5835 }
5836 if (num != 0)
5837 {
5838 EClass.player.ModKarma(num);
5839 }
5840 }
5841 if (origin == EClass.pc)
5842 {
5843 EClass.pc.faith.Revelation("kill", 10);
5844 }
5845 else if (origin.IsPCFaction)
5846 {
5847 origin.Chara.ModAffinity(EClass.pc, 1, show: false);
5848 origin.Chara.ShowEmo(Emo.love);
5849 }
5850 }
5851 if (base.sourceBacker != null && origin != null && origin.IsPCParty)
5852 {
5853 EClass.player.doneBackers.Add(base.sourceBacker.id);
5854 }
5855 if (base.IsPCFactionOrMinion)
5856 {
5858 {
5859 Msg.Say("abort_allyDead");
5860 }
5861 }
5863 {
5864 Msg.Say("abort_enemyDead");
5865 }
5866 if (IsPCParty && !IsPC)
5867 {
5869 base.c_wasInPcParty = true;
5870 EClass.pc.Say("allyDead");
5871 }
5872 switch (id)
5873 {
5874 case "littleOne":
5875 if (attackSource != AttackSource.Euthanasia && !IsPCFaction)
5876 {
5877 EClass.player.flags.little_killed = true;
5879 }
5880 break;
5881 case "big_daddy":
5882 case "big_daddy2":
5883 if (!IsPCFaction)
5884 {
5885 Chara chara = CharaGen.Create("littleOne");
5886 EClass._zone.AddCard(chara, pos.Copy());
5887 Msg.Say("little_pop");
5889 }
5890 break;
5891 case "shark_sister":
5892 if (!IsPCFaction)
5893 {
5894 Chara t = CharaGen.Create("sister_shark");
5895 EClass._zone.AddCard(t, pos.Copy());
5896 Msg.Say("shark_pop");
5897 }
5898 break;
5899 }
5900 if (attackSource == AttackSource.Finish && origin != null && origin.Evalue(665) > 0)
5901 {
5902 Chara chara2 = CharaGen.CreateFromFilter("c_plant", base.LV);
5903 EClass._zone.AddCard(chara2, pos.Copy());
5904 if (chara2.LV < base.LV)
5905 {
5906 chara2.SetLv(base.LV);
5907 }
5908 chara2.MakeMinion((origin.IsPCParty || origin.IsPCPartyMinion) ? EClass.pc : origin.Chara, MinionType.Friend);
5909 Msg.Say("plant_pop", this, chara2);
5910 }
5913 }
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:483
static void Unride(Chara host, Chara mount, bool talk=true)
Definition: ActRide.cs:107
Chara Find(string id)
Definition: CardManager.cs:20
GlobalCharaList globalCharas
Definition: CardManager.cs:46
void RefreshSprite()
virtual void RefreshStateIcon()
void AddBlood(int a=1, int id=-1)
Definition: Card.cs:6408
virtual bool IsPCParty
Definition: Card.cs:2203
Card SetLv(int a)
Definition: Card.cs:3070
ICardParent parent
Definition: Card.cs:56
virtual bool IsPCPartyMinion
Definition: Card.cs:2207
void ClearFOV()
Definition: Card.cs:7029
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:6640
virtual bool IsPCFaction
Definition: Card.cs:2339
void SpawnLoot(Card origin)
Definition: Card.cs:5341
int LV
Definition: Card.cs:389
virtual bool isSynced
Definition: Card.cs:2139
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:926
int daysStarved
Definition: Chara.cs:333
void MakeMinion(Chara _master, MinionType type=MinionType.Default)
Definition: Chara.cs:2541
string NameBraced
Definition: Chara.cs:520
void ClearTempElements()
Definition: Chara.cs:10907
string TalkTopic(string topic="calm")
Definition: Chara.cs:7335
void TryDropBossLoot()
Definition: Chara.cs:5915
bool IsLocalChara
Definition: Chara.cs:888
Chara enemy
Definition: Chara.cs:86
bool IsInActiveZone
Definition: Chara.cs:885
void TryDropCarryOnly()
Definition: Chara.cs:4827
void MakeGrave(string lastword)
Definition: Chara.cs:5505
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:177
ConfigAutoCombat autoCombat
Definition: Game.cs:94
CardManager cards
Definition: Game.cs:156
static bool Has(string id)
Definition: LangGame.cs:99
List< Chara > deadCharas
Definition: Map.cs:46
static ThirstPersonInfo thirdPerson1
Definition: Msg.cs:6
bool HasElement(int ele, bool excludePC=false)
Definition: Party.cs:208
void RemoveMember(Chara c)
Definition: Party.cs:112
int allyDeath
Definition: Player.cs:108
void ModKarma(int a)
Definition: Player.cs:2610
Stats stats
Definition: Player.cs:1083
int little_dead
Definition: Player.cs:993
HashSet< int > doneBackers
Definition: Player.cs:1140
bool TryAbortAutoCombat(bool immediate=true)
Definition: Player.cs:2504
string deathMsg
Definition: Player.cs:1255
void TalkWitnesses(Chara criminal, string idTalk, int radius=4, WitnessType type=WitnessType.everyone, Func< Chara, bool > talkIf=null, int chance=3)
Definition: Point.cs:820
List< Card > sales
Definition: PropsManager.cs:14
virtual void Revelation(string idTalk, int chance=100)
Definition: Religion.cs:167
static Religion recentWrath
Definition: Religion.cs:29
virtual string NameShort
Definition: Religion.cs:55
Thing Find(int uid)
void Set(string n)
static void Reserve(string idStep, Action onBeforePlay=null)
Definition: Tutorial.cs:55
static void Say(string text, FontColor fontColor=FontColor.Default, Sprite sprite=null)
void OnCharaDie(Chara c)
void RefreshDeathSentense()
Definition: Zone.cs:1188
virtual bool HasLaw
Definition: Zone.cs:233
void RemoveCard(Card t)
Definition: Zone.cs:2130
void ResetHostility()
Definition: Zone.cs:2836
ZoneInstance instance
Definition: Zone.cs:55

References EClass._map, EClass._zone, ConfigAutoCombat.abortOnAllyDead, ConfigAutoCombat.abortOnEnemyDead, Zone.AddCard(), AddCondition(), Player.Stats.allyDeath, Game.Config.autoCombat, Game.cards, Map.charas, EClass.Colors, Game.config, CharaGen.Create(), CharaGen.CreateFromFilter(), Map.deadCharas, Player.deathMsg, Debug, Player.doneBackers, enemy, Zone.events, faith, ThingContainer.Find(), CardManager.GlobalCharaList.Find(), EClass.game, Effect.Get(), Steam.GetAchievement(), CardManager.globalCharas, LangGame.Has(), Party.HasElement(), Zone.HasLaw, SourceRace.Row.id, Zone.instance, IsHostile(), IsPCParty, Card.IsUnique, Player.little_dead, FactionBranch.Log(), Card.LV, MakeMinion(), ColorProfile.matColors, ModAffinity(), Player.ModKarma(), Spatial.Name, NameBraced, Religion.NameShort, ZoneEventManager.OnCharaDie(), OriginalHostility, GameLang.Parse(), party, EClass.pc, Effect.Play(), EClass.player, ActEffect.ProcAt(), Map.props, Religion.recentWrath, Zone.RefreshDeathSentense(), Party.RemoveMember(), FactionBranch.RemoveMemeber(), Tutorial.Reserve(), Zone.ResetHostility(), Religion.Revelation(), EClass.rnd(), PropsManager.sales, Msg.Say(), Card.Say(), WidgetPopText.Say(), ThirstPersonInfo.Set(), Msg.SetColor(), Card.SetLv(), AI_Slaughter.slaughtering, CellEffect.source, Player.stats, Card.things, Msg.thirdPerson1, Player.TryAbortAutoCombat(), ActRide.Unride(), and Element.Void.

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

◆ DiminishTempElements()

void Chara.DiminishTempElements ( int  a = 1)
inline

Definition at line 10862 of file Chara.cs.

10863 {
10864 if (tempElements == null)
10865 {
10866 return;
10867 }
10868 foreach (Element item in tempElements.dict.Values.ToList())
10869 {
10870 if (item.vBase > 0)
10871 {
10872 ModTempElement(item.id, -Mathf.Min(item.vBase * 5 / 100 + 1, item.vBase), naturalDecay: true);
10873 }
10874 }
10875 }

References ElementContainer.dict, and item.

◆ Divorce()

void Chara.Divorce ( Chara  c)
inline

Definition at line 8522 of file Chara.cs.

8523 {
8524 if (base.c_love != null)
8525 {
8526 base.c_love.dateMarriage = 0;
8527 base.c_love.dateWedding = 0;
8528 SetFeat(1275, 0);
8530 }
8531 }
int divorced
Definition: Player.cs:132

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

◆ DoAI()

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

Definition at line 6524 of file Chara.cs.

6525 {
6526 SetAI(new DynamicAIAct("", delegate
6527 {
6528 onPerform();
6529 return true;
6530 })
6531 {
6532 wait = wait
6533 });
6534 }

◆ DoHostileAction()

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

Definition at line 6668 of file Chara.cs.

6669 {
6670 if (_tg == null || !_tg.isChara)
6671 {
6672 return;
6673 }
6674 Chara chara = _tg.Chara;
6675 if (chara.IsPC)
6676 {
6677 EClass.pc.combatCount = 10;
6678 }
6679 if (!chara.IsAliveInCurrentZone || !IsAliveInCurrentZone || chara == this)
6680 {
6681 return;
6682 }
6683 if ((IsPCFaction || IsPCFactionMinion) && (chara.IsPCFaction || chara.IsPCFactionMinion))
6684 {
6685 chara.Say("frown", this, chara);
6686 }
6687 else
6688 {
6689 if (EClass._zone.IsRegion)
6690 {
6691 return;
6692 }
6693 if (IsPC)
6694 {
6695 if (chara.IsFriendOrAbove() && !immediate)
6696 {
6697 chara.Say("frown", this, chara);
6698 chara.ShowEmo(Emo.sad);
6699 chara.hostility = Hostility.Neutral;
6700 return;
6701 }
6702 if (!chara.IsPCFaction && chara.hostility >= Hostility.Neutral && !EClass._zone.IsPCFaction)
6703 {
6704 bool flag = chara.id == "fanatic";
6705 if (EClass.rnd(4) == 0 || flag)
6706 {
6707 chara.Say("callHelp", chara);
6708 chara.CallHelp(this, flag);
6709 }
6710 }
6711 if (chara.hostility <= Hostility.Enemy)
6712 {
6713 foreach (Chara member in EClass.pc.party.members)
6714 {
6715 if (member != EClass.pc && member.enemy == null && member.CanSee(chara))
6716 {
6717 member.SetEnemy(chara);
6718 }
6719 }
6720 }
6721 }
6722 else if (chara.IsPC && hostility <= Hostility.Enemy)
6723 {
6724 foreach (Chara member2 in EClass.pc.party.members)
6725 {
6726 if (member2 != EClass.pc && member2.enemy == null && member2.CanSee(this))
6727 {
6728 member2.SetEnemy(this);
6729 }
6730 }
6731 }
6732 if (chara.calmCheckTurn <= 0 || IsPC)
6733 {
6734 chara.calmCheckTurn = (IsPC ? (20 + EClass.rnd(30)) : (10 + EClass.rnd(10)));
6735 }
6736 if (hostility != Hostility.Enemy || chara.hostility != Hostility.Enemy)
6737 {
6738 GoHostile(chara);
6739 chara.GoHostile(this);
6740 if (base.isHidden && !chara.CanSee(this) && !chara.IsDisabled && !chara.IsPCParty && !chara.IsPCPartyMinion && EClass.rnd(10 + Dist(chara) * 10) == 0)
6741 {
6742 Thing t = ThingGen.Create("49");
6743 ActThrow.Throw(chara, pos, t);
6744 Act.TC = chara;
6745 }
6746 }
6747 }
6748 }
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:567
override bool IsPCPartyMinion
Definition: Chara.cs:657
int calmCheckTurn
Definition: Chara.cs:118
bool CanSee(Card c)
Definition: Chara.cs:1277
override bool IsPCFactionMinion
Definition: Chara.cs:673
bool IsFriendOrAbove()
Definition: Chara.cs:6945
Chara SetEnemy(Chara c=null)
Definition: Chara.cs:6619
void CallHelp(Chara tg, bool fanatic=false)
Definition: Chara.cs:6750
Hostility hostility
Definition: Chara.cs:295
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53

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

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

◆ Drink()

void Chara.Drink ( Card  t)
inline

Definition at line 5383 of file Chara.cs.

5384 {
5385 Say("drink", this, t.Duplicate(1));
5386 Say("quaff");
5387 PlaySound("drink");
5388 t.ModNum(-1);
5389 FoodEffect.ProcDrink(this, t.Thing);
5390 _ = IsPC;
5391 }
Thing Duplicate(int num)
Definition: Card.cs:3618
void ModNum(int a, bool notify=true)
Definition: Card.cs:3689
static void ProcDrink(Chara c, Thing food)
Definition: FoodEffect.cs:364

References Card.Duplicate(), Card.ModNum(), FoodEffect.ProcDrink(), and Card.Thing.

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

4840 {
4841 if (held == null)
4842 {
4843 return null;
4844 }
4845 if (IsPC)
4846 {
4847 WidgetHotbar.dirtyCurrentItem = true;
4849 }
4850 Card card = EClass._zone.AddCard(held, dropPos ?? pos);
4851 card.OnLand();
4852 if (card.trait.CanOnlyCarry)
4853 {
4854 card.SetPlaceState(PlaceState.installed);
4855 }
4856 return card;
4857 }
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 4859 of file Chara.cs.

4860 {
4861 if (t.c_isImportant)
4862 {
4863 Msg.Say("markedImportant");
4864 return;
4865 }
4866 if (!t.trait.CanBeDropped)
4867 {
4868 Msg.Say("cantDrop", t);
4869 return;
4870 }
4871 if (t.trait is TraitAbility)
4872 {
4873 SE.Trash();
4874 t.Destroy();
4875 return;
4876 }
4877 Msg.Say("dropItem", t.Name);
4878 t.ignoreAutoPick = true;
4879 PlaySound("drop");
4880 EClass._zone.AddCard(t, pos);
4881 if (t.trait.CanOnlyCarry)
4882 {
4883 t.Install();
4884 }
4885 }
Card Install()
Definition: Card.cs:3915
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(), InvOwner.OnDrag(), and CoreDebug.SpawnFigure().

◆ Duplicate()

Chara Chara.Duplicate ( )
inline

Definition at line 1940 of file Chara.cs.

1941 {
1942 Chara chara = CharaGen.Create(id);
1943 chara.mana.value = mana.value;
1944 chara.stamina.value = stamina.value;
1945 foreach (KeyValuePair<int, Element> item in elements.dict)
1946 {
1947 if (item.Key != 1275)
1948 {
1949 Element orCreateElement = chara.elements.GetOrCreateElement(item.Key);
1950 orCreateElement.vBase = item.Value.ValueWithoutLink - orCreateElement.vSource;
1951 }
1952 }
1953 chara.SetFaith(faith);
1954 chara.bio = IO.DeepCopy(bio);
1955 chara.LV = base.LV;
1956 chara.c_daysWithGod = base.c_daysWithGod;
1957 chara.RefreshFaithElement();
1958 chara.hp = (int)Mathf.Clamp((float)chara.MaxHP * ((float)base.hp / (float)MaxHP) * 0.99f, 0f, chara.MaxHP);
1959 chara.isCopy = true;
1960 chara.isScaled = base.isScaled;
1961 chara.c_altName = base.c_altName;
1962 chara._alias = _alias;
1963 if (pccData != null)
1964 {
1965 chara.pccData = IO.DeepCopy(pccData);
1966 }
1967 if (HaveFur())
1968 {
1969 chara.c_fur = -1;
1970 }
1971 return chara;
1972 }
bool HaveFur()
Definition: Card.cs:8375
Stats mana
Definition: Chara.cs:1213
void RefreshFaithElement()
Definition: Chara.cs:10742
string _alias
Definition: Chara.cs:223
void SetFaith(string id)
Definition: Chara.cs:1776
Element GetOrCreateElement(Element ele)
int vSource
Definition: ELEMENT.cs:271
Definition: IO.cs:10
virtual int value
Definition: Stats.cs:56

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

Referenced by ConTransmuteHuman.OnBeforeStart(), ActEffect.Proc(), AI_Idle.Run(), and TryDuplicate().

◆ EnhanceTempElement()

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

Definition at line 10857 of file Chara.cs.

10858 {
10859 ModTempElement(ele, onlyRenew ? (p / 20) : (p / 100 + EClass.rnd(p / 100 + 1)), naturalDecay: false, onlyRenew);
10860 }

References EClass.rnd().

◆ EnhanceTempElements()

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

Definition at line 10848 of file Chara.cs.

10849 {
10850 int[] array = (body ? Element.List_Body : Element.List_Mind);
10851 foreach (int ele in array)
10852 {
10853 EnhanceTempElement(ele, p, onlyRenew);
10854 }
10855 }
void EnhanceTempElement(int ele, int p, bool onlyRenew=false)
Definition: Chara.cs:10857

References Element.List_Mind.

◆ EQ_CAT()

void Chara.EQ_CAT ( string  s)
inline

Definition at line 5360 of file Chara.cs.

5361 {
5362 int slot = EClass.sources.categories.map[s].slot;
5363 BodySlot bodySlot = ((slot == 0) ? null : body.GetSlot(slot));
5364 if ((slot == 0 || bodySlot != null) && (slot != 37 || !HasElement(1209)))
5365 {
5366 SetEQQuality();
5367 Thing thing = ThingGen.CreateFromCategory(s, base.LV);
5368 AddThing(thing);
5369 if (bodySlot != null && !body.Equip(thing, bodySlot))
5370 {
5371 thing.Destroy();
5372 }
5373 }
5374 }
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:3273
bool Equip(Thing thing, BodySlot slot=null, bool msg=true)
Definition: CharaBody.cs:194
BodySlot GetSlot(Thing t, bool onlyEmpty=false, bool secondSlot=false)
Definition: CharaBody.cs:369
void SetEQQuality()
Definition: Chara.cs:5307
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 5340 of file Chara.cs.

5341 {
5342 SetEQQuality();
5343 if (r != Rarity.Random)
5344 {
5345 CardBlueprint.current.rarity = r;
5346 }
5347 Thing thing = ThingGen.Create(s, mat, base.LV);
5348 if (body.GetSlot(thing, onlyEmpty: true) == null)
5349 {
5350 return thing;
5351 }
5352 AddThing(thing);
5353 if (!body.Equip(thing))
5354 {
5355 thing.Destroy();
5356 }
5357 return thing;
5358 }

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

5377 {
5378 SetEQQuality();
5379 Thing t = ThingGen.Create(s, -1, base.LV).SetNum(num);
5380 AddThing(t);
5381 }
Thing SetNum(int a)
Definition: Card.cs:3669

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

◆ EvalueRiding()

int Chara.EvalueRiding ( )
inline

Definition at line 6435 of file Chara.cs.

6436 {
6437 if (ride != null && ride.HasCondition<ConTransmuteBroom>() && HasElement(1417))
6438 {
6439 return 25 + Evalue(226) * 125 / 100;
6440 }
6441 return Evalue(226);
6442 }

References ride.

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

◆ FallFromZone()

void Chara.FallFromZone ( )
inline

Definition at line 3718 of file Chara.cs.

3719 {
3720 Msg.Say("skyFall", EClass.pc, EClass._zone.Name);
3721 Zone zone = (EClass._zone.isExternalZone ? null : EClass._zone.GetTopZone().FindZone(EClass._zone.lv - 1));
3722 zone = zone ?? EClass.world.region;
3724 {
3725 state = ZoneTransition.EnterState.Fall,
3726 x = pos.x,
3727 z = pos.z
3728 });
3729 }
void MoveZone(string alias)
Definition: Chara.cs:3533
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:2046

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

8216 {
8217 TraitToolRange ranged = weapon.trait as TraitToolRange;
8218 Thing thing = (IsPC ? EClass.pc.things.Find<TraitQuiver>() : null);
8219 if (thing != null)
8220 {
8221 Thing thing2 = thing.things.Find((Thing t) => ranged.IsAmmo(t));
8222 if (thing2 != null)
8223 {
8224 return thing2;
8225 }
8226 }
8227 return things.Find((Thing t) => ranged.IsAmmo(t));
8228 }
bool IsAmmo
Definition: Card.cs:2301
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 7714 of file Chara.cs.

7715 {
7716 foreach (Card item in EClass._map.props.installed.all)
7717 {
7718 if (item.trait is TraitBed traitBed && traitBed.IsHolder(this))
7719 {
7720 return traitBed;
7721 }
7722 }
7723 return null;
7724 }

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

7947 {
7948 Thing result = null;
7949 int num = -1;
7950 if (IsPC)
7951 {
7952 return null;
7953 }
7954 foreach (Thing item in things.List((Thing t) => CanEat(t, shouldEat: true) && !t.c_isImportant, onlyAccessible: true))
7955 {
7956 int num2 = CountNumEaten(item);
7957 int num3 = 100 - num2 + (item.HasElement(757) ? 10 : 0);
7958 if (num3 > num)
7959 {
7960 result = item;
7961 num = num3;
7962 }
7963 }
7964 return result;
7965 }
bool CanEat(Thing t, bool shouldEat=false)
Definition: Chara.cs:7992
int CountNumEaten(Thing food)
Definition: Chara.cs:10713
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 2603 of file Chara.cs.

2604 {
2605 if (IsMinion)
2606 {
2607 master = EClass._map.FindChara(base.c_uidMaster);
2608 }
2609 return master;
2610 }
Chara FindChara(string id)
Definition: Map.cs:2647

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

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

◆ FindNearestNewEnemy()

bool Chara.FindNearestNewEnemy ( )
inline

Definition at line 6834 of file Chara.cs.

6835 {
6836 for (int i = 0; i < EClass._map.charas.Count; i++)
6837 {
6838 Chara chara = EClass._map.charas[i];
6839 if (chara != this && chara != enemy && (chara.mimicry == null || !chara.mimicry.IsThing) && IsHostile(chara) && Dist(chara) <= 1 && CanInteractTo(chara.pos))
6840 {
6841 DoHostileAction(chara);
6842 enemy = chara;
6843 return true;
6844 }
6845 }
6846 return false;
6847 }
void DoHostileAction(Card _tg, bool immediate=false)
Definition: Chara.cs:6668
ConBaseTransmuteMimic mimicry
Definition: Chara.cs:106

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

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

◆ FindNewEnemy()

bool Chara.FindNewEnemy ( )
inline

Definition at line 6761 of file Chara.cs.

6762 {
6763 if (EClass._zone.isPeace && base.IsPCFactionOrMinion && !IsPC)
6764 {
6765 return false;
6766 }
6767 if (enemy != null && !enemy.IsAliveInCurrentZone)
6768 {
6769 enemy = null;
6770 }
6771 if (enemy != null)
6772 {
6773 return false;
6774 }
6775 if (IsPCParty && EClass.pc.isHidden && base.isHidden)
6776 {
6777 return false;
6778 }
6779 if (mimicry != null && mimicry.IsThing)
6780 {
6781 return false;
6782 }
6783 bool flag = enemy != null || ai is GoalCombat;
6784 int num = (base.PER + Evalue(210) * 2) * ((!flag) ? 1 : 2);
6785 bool flag2 = IsPCParty && !IsPC && EClass.game.config.tactics.dontWander;
6786 bool flag3 = !IsPCParty;
6787 Chara chara = null;
6788 int num2 = 9999;
6789 for (int i = 0; i < EClass._map.charas.Count; i++)
6790 {
6791 Chara chara2 = EClass._map.charas[i];
6792 if (chara2 == this || !IsHostile(chara2) || !CanSee(chara2) || (chara2.mimicry != null && chara2.mimicry.IsThing))
6793 {
6794 continue;
6795 }
6796 int num3 = Dist(chara2);
6797 int num4 = GetSightRadius() + (flag ? 1 : 0);
6798 if (num3 > num4)
6799 {
6800 continue;
6801 }
6802 if (flag3 && EClass.rnd(chara2.Evalue(152) + 5) * (100 + num3 * num3 * 10) / 100 > EClass.rnd(num))
6803 {
6804 if (this == pos.FirstChara)
6805 {
6806 chara2.ModExp(152, Mathf.Clamp((num - chara2.Evalue(152)) / 2, 1, Mathf.Max(30 - stealthSeen * 2, 1)));
6807 }
6808 stealthSeen++;
6809 }
6810 else if (CanSeeLos(chara2) && (!flag2 || EClass.pc.isBlind || EClass.pc.CanSeeLos(chara2)) && (!base.IsPCFactionOrMinion || EClass.pc.ai.ShouldAllyAttack(chara2)))
6811 {
6812 if (!IsPCParty)
6813 {
6814 DoHostileAction(chara2);
6815 enemy = chara2;
6816 return true;
6817 }
6818 if (num3 < num2)
6819 {
6820 num2 = num3;
6821 chara = chara2;
6822 }
6823 }
6824 }
6825 if (chara != null)
6826 {
6827 DoHostileAction(chara);
6828 enemy = chara;
6829 return true;
6830 }
6831 return false;
6832 }
virtual bool ShouldAllyAttack(Chara tg)
Definition: AIAct.cs:134
int stealthSeen
Definition: Chara.cs:192
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, ConBaseTransmuteMimic.IsThing, mimicry, Card.ModExp(), EClass.pc, EClass.rnd(), AIAct.ShouldAllyAttack(), and Game.Config.tactics.

Referenced by GoalCombat.Run().

◆ FindRoom()

Room Chara.FindRoom ( )
inline

Definition at line 8339 of file Chara.cs.

8340 {
8341 return FindBed()?.owner.pos.cell.room;
8342 }
Room room
Definition: Cell.cs:110
TraitBed FindBed()
Definition: Chara.cs:7714

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

10629 {
10630 Element orCreateElement = elements.GetOrCreateElement(ele);
10631 if (orCreateElement.ValueWithoutLink == 0)
10632 {
10633 elements.ModBase(orCreateElement.id, 1);
10634 }
10635 if (orCreateElement is Spell)
10636 {
10637 int num = EClass.curve(Evalue(307), 50, 20) + (HasElement(307) ? 20 : 0);
10638 int num2 = origin?.Evalue(765) ?? 0;
10639 num = num * (100 - num2) / 100;
10640 int a = mtp * orCreateElement.source.charge * (100 + num) / 100 / 100;
10641 a = Mathf.Max(1, EClass.rndHalf(a));
10642 if (orCreateElement.source.charge == 1)
10643 {
10644 a = 1;
10645 }
10646 orCreateElement.vPotential += a;
10647 }
10648 Say("spell_gain", this, orCreateElement.Name);
10649 LayerAbility.SetDirty(orCreateElement);
10650 }
Element ModBase(int ele, int v)
virtual string Name
Definition: ELEMENT.cs:313
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(), CustomElementContent.OnGameLoad(), and TraitBaseSpellbook.OnRead().

◆ GetActionText()

string Chara.GetActionText ( )
inline

Definition at line 7651 of file Chara.cs.

7652 {
7653 string result = "?????";
7654 if (ai != null)
7655 {
7656 result = ai.GetCurrentActionText();
7657 }
7658 return result;
7659 }
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 8274 of file Chara.cs.

8275 {
8276 if (body.GetWeight(armorOnly: true) <= (HasElement(1204) ? 6000 : 30000))
8277 {
8278 return 120;
8279 }
8280 return 122;
8281 }
int GetWeight(bool armorOnly=false)
Definition: CharaBody.cs:436

References CharaBody.GetWeight().

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

◆ GetBestRangedWeapon()

Thing Chara.GetBestRangedWeapon ( )
inline

Definition at line 8230 of file Chara.cs.

8231 {
8232 Thing result = null;
8233 int num = 0;
8234 foreach (Thing thing in things)
8235 {
8236 if (thing.IsRangedWeapon && CanEquipRanged(thing) && thing.GetEquipValue() > num)
8237 {
8238 num = thing.GetEquipValue();
8239 result = thing;
8240 }
8241 }
8242 return result;
8243 }
int GetEquipValue()
Definition: Card.cs:7638
bool IsRangedWeapon
Definition: Card.cs:2297
bool CanEquipRanged(Thing t)
Definition: Chara.cs:8164

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

◆ GetBuffStats() [1/2]

Element Chara.GetBuffStats ( int  ele)
inline

Definition at line 9955 of file Chara.cs.

9956 {
9957 for (int i = 0; i < conditions.Count; i++)
9958 {
9959 if (conditions[i] is ConBuffStats conBuffStats && conBuffStats.refVal == ele)
9960 {
9961 return conBuffStats.elements.GetElement(ele);
9962 }
9963 }
9964 return null;
9965 }

References BaseCondition.refVal.

◆ GetBuffStats() [2/2]

Element Chara.GetBuffStats ( string  alias)
inline

Definition at line 9950 of file Chara.cs.

9951 {
9952 return GetBuffStats(EClass.sources.elements.alias[alias].id);
9953 }
Element GetBuffStats(string alias)
Definition: Chara.cs:9950

References SourceManager.elements, and EClass.sources.

Referenced by GoalCombat.TryUseAbility().

◆ GetBurden()

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

Definition at line 1974 of file Chara.cs.

1975 {
1976 int num2 = (base.ChildrenWeight + ((t != null) ? ((num == -1) ? t.ChildrenAndSelfWeight : (t.SelfWeight * num)) : 0)) * 100 / WeightLimit;
1977 if (num2 < 0)
1978 {
1979 num2 = 1000;
1980 }
1982 {
1983 num2 = 0;
1984 }
1985 int num3 = ((num2 >= 100) ? ((num2 - 100) / 10 + 1) : 0);
1986 if (num3 > 9)
1987 {
1988 num3 = 9;
1989 }
1990 return num3;
1991 }

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

◆ GetCondition()

BaseCondition Chara.GetCondition ( string  idCon)
inline

◆ GetCondition< T >()

override T Chara.GetCondition< T > ( )
inlinevirtual

Reimplemented from Card.

Definition at line 10005 of file Chara.cs.

10006 {
10007 for (int i = 0; i < conditions.Count; i++)
10008 {
10009 if (conditions[i] is T)
10010 {
10011 return conditions[i] as T;
10012 }
10013 }
10014 return null;
10015 }

◆ GetCooldown()

int Chara.GetCooldown ( int  idEle)
inline

Definition at line 9230 of file Chara.cs.

9231 {
9232 if (_cooldowns != null)
9233 {
9234 for (int i = 0; i < _cooldowns.Count; i++)
9235 {
9236 if (_cooldowns[i] / 1000 == idEle)
9237 {
9238 return _cooldowns[i] % 1000;
9239 }
9240 }
9241 }
9242 return 0;
9243 }

Referenced by NotificationCooldown.OnRefresh().

◆ GetCurrentDir()

int Chara.GetCurrentDir ( )
inline

Definition at line 3838 of file Chara.cs.

3839 {
3840 Debug.Log(angle);
3841 if (!renderer.hasActor)
3842 {
3843 if (angle == 0f || angle == 45f || angle == 90f)
3844 {
3845 return 2;
3846 }
3847 if (angle == -135f || angle == 180f || angle == -90f)
3848 {
3849 return 1;
3850 }
3851 if (angle == 135f)
3852 {
3853 return 0;
3854 }
3855 return 3;
3856 }
3857 return renderer.actor.currentDir;
3858 }
virtual int currentDir
Definition: CardActor.cs:41
float angle
Definition: Card.cs:74

References Debug.

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

◆ GetDestination()

Point Chara.GetDestination ( )
inline

Definition at line 7626 of file Chara.cs.

7627 {
7628 return (ai.IsRunning ? ai.GetDestination() : pos).Copy();
7629 }
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 4912 of file Chara.cs.

4913 {
4914 if (elements.Value(122) > elements.Value(120))
4915 {
4916 return elements.GetElement(122);
4917 }
4918 return elements.GetElement(120);
4919 }
int Value(int ele)

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

◆ GetFavAttackStyle()

AttackStyle Chara.GetFavAttackStyle ( )
inline

Definition at line 4887 of file Chara.cs.

4888 {
4889 int num = Evalue(131);
4890 int num2 = Evalue(130);
4891 int num3 = Evalue(123);
4892 if (num > num2 && num > num3)
4893 {
4894 return AttackStyle.TwoWield;
4895 }
4896 if (num2 > num && num2 > num3)
4897 {
4898 return AttackStyle.TwoHand;
4899 }
4900 if (num3 > num && num3 > num2)
4901 {
4902 return AttackStyle.Shield;
4903 }
4904 return AttackStyle.Default;
4905 }

Referenced by WindowChara.RefreshNote().

◆ GetFavCat()

SourceCategory.Row Chara.GetFavCat ( )
inline

Definition at line 8476 of file Chara.cs.

8477 {
8478 if (ModUtil.TryGetContent<CustomBiographyContent>("Biography/" + id, out var content))
8479 {
8480 content.RefreshCharaBio(this);
8481 if (!content.favCategory.IsEmpty() && EClass.sources.categories.map.TryGetValue(content.favCategory, out var value) && value.gift > 0)
8482 {
8483 return value;
8484 }
8485 }
8486 string str = GetStr(73);
8487 if (!str.IsEmpty() && EClass.sources.categories.map[str] != null)
8488 {
8489 return EClass.sources.categories.map[str];
8490 }
8491 SourceCategory.Row r = null;
8492 if (_listFavCat.Count == 0)
8493 {
8494 foreach (SourceCategory.Row row in EClass.sources.categories.rows)
8495 {
8496 if (row.gift > 0)
8497 {
8498 _listFavCat.Add(row);
8499 }
8500 }
8501 }
8502 Rand.UseSeed(base.uid + EClass.game.seed, delegate
8503 {
8504 r = _listFavCat.RandomItem();
8505 });
8506 return r;
8507 }
string GetStr(string id, string defaultStr=null)
Definition: Card.cs:2595
static List< SourceCategory.Row > _listFavCat
Definition: Chara.cs:198
int seed
Definition: Game.cs:201
Definition: Rand.cs:4
static void UseSeed(int seed, Action action)
Definition: Rand.cs:24

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

8444 {
8445 if (ModUtil.TryGetContent<CustomBiographyContent>("Biography/" + id, out var content))
8446 {
8447 content.RefreshCharaBio(this);
8448 if (!content.favFood.IsEmpty() && EClass.sources.things.map.TryGetValue(content.favFood, out var value))
8449 {
8450 return value;
8451 }
8452 }
8453 string str = GetStr(72);
8454 if (!str.IsEmpty() && EClass.sources.things.map[str] != null)
8455 {
8456 return EClass.sources.things.map[str];
8457 }
8458 if (_listFavFood.Count == 0)
8459 {
8460 foreach (SourceThing.Row row in EClass.sources.things.rows)
8461 {
8462 if (row._origin == "dish" && row.value != 0 && row.chance != 0)
8463 {
8464 _listFavFood.Add(row);
8465 }
8466 }
8467 }
8468 SourceThing.Row r = null;
8469 Rand.UseSeed(base.uid + EClass.game.seed, delegate
8470 {
8471 r = _listFavFood.RandomItem();
8472 });
8473 return r;
8474 }
static List< SourceThing.Row > _listFavFood
Definition: Chara.cs:196
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 4907 of file Chara.cs.

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

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

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

9297 {
9298 if (IsPC)
9299 {
9300 return null;
9301 }
9302 switch (TimeTable.GetSpan(idTimeTable, hour))
9303 {
9304 case TimeTable.Span.Sleep:
9306 {
9307 return new GoalSleep();
9308 }
9309 break;
9310 case TimeTable.Span.Eat:
9311 return new GoalIdle();
9312 case TimeTable.Span.Work:
9313 if (IsGuest())
9314 {
9315 return new GoalIdle();
9316 }
9317 return GetGoalWork();
9318 case TimeTable.Span.Free:
9319 if (IsGuest())
9320 {
9321 return new GoalIdle();
9322 }
9323 return GetGoalHobby();
9324 }
9325 return null;
9326 }
Goal GetGoalWork()
Definition: Chara.cs:9328
Goal GetGoalHobby()
Definition: Chara.cs:9341
string idTimeTable
Definition: Chara.cs:472
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 9341 of file Chara.cs.

9342 {
9343 if (IsPrisoner)
9344 {
9345 return new GoalIdle();
9346 }
9347 if (memberType == FactionMemberType.Livestock)
9348 {
9349 return new GoalGraze();
9350 }
9351 return new GoalHobby();
9352 }
FactionMemberType
bool IsPrisoner
Definition: Chara.cs:1085

Referenced by Zone.Simulate().

◆ GetGoalWork()

Goal Chara.GetGoalWork ( )
inline

Definition at line 9328 of file Chara.cs.

9329 {
9330 if (IsPrisoner)
9331 {
9332 return new GoalIdle();
9333 }
9334 if (memberType == FactionMemberType.Livestock)
9335 {
9336 return new GoalGraze();
9337 }
9338 return new GoalWork();
9339 }

Referenced by Zone.Simulate().

◆ GetHappiness()

int Chara.GetHappiness ( )
inline

Definition at line 7636 of file Chara.cs.

7637 {
7638 int num = 50;
7639 if (FindBed() != null)
7640 {
7641 num += 50;
7642 }
7643 return num;
7644 }

◆ GetHireCost()

int Chara.GetHireCost ( )
inline

Definition at line 7631 of file Chara.cs.

7632 {
7633 return base.LV / 2 + 4;
7634 }

Referenced by CalcGold.Hire().

◆ GetHoverText()

override string Chara.GetHoverText ( )
inlinevirtual

Reimplemented from Card.

Definition at line 7125 of file Chara.cs.

7126 {
7127 if (mimicry != null && mimicry.IsThing)
7128 {
7129 return mimicry.GetHoverText();
7130 }
7131 string text = ((mimicry != null && mimicry.Card != this) ? mimicry.GetName(NameStyle.Full) : base.Name);
7132 if (IsFriendOrAbove())
7133 {
7134 text = text.TagColor(EClass.Colors.colorFriend);
7135 }
7136 else if (IsHostile())
7137 {
7138 text = text.TagColor(EClass.Colors.colorHostile);
7139 }
7140 int num = 2;
7141 int lV = EClass.pc.LV;
7142 if (base.LV >= lV * 5)
7143 {
7144 num = 0;
7145 }
7146 else if (base.LV >= lV * 2)
7147 {
7148 num = 1;
7149 }
7150 else if (base.LV <= lV / 4)
7151 {
7152 num = 4;
7153 }
7154 else if (base.LV <= lV / 2)
7155 {
7156 num = 3;
7157 }
7158 string text2 = Lang.GetList("lvComparison")[num];
7159 text2 = (" (" + text2 + ") ").TagSize(14).TagColor(EClass.Colors.gradientLVComparison.Evaluate(0.25f * (float)num));
7160 string s = (IsFriendOrAbove() ? "HostilityAlly" : (IsNeutral() ? "HostilityNeutral" : "HostilityEnemy"));
7161 s = (" (" + s.lang() + ") ").TagSize(14);
7162 s = "";
7163 if (memberType == FactionMemberType.Guest)
7164 {
7165 s += (" (" + "guest".lang() + ") ").TagSize(14);
7166 }
7167 else if (memberType == FactionMemberType.Livestock)
7168 {
7169 s += (" (" + "livestock".lang() + ") ").TagSize(14);
7170 }
7171 if (!EClass.pc.IsMoving)
7172 {
7173 if (EClass.pc.HasHigherGround(this))
7174 {
7175 text2 += "lowerGround".lang();
7176 }
7177 else if (HasHigherGround(EClass.pc))
7178 {
7179 text2 += "higherGround".lang();
7180 }
7181 }
7182 if (Evalue(1232) > 0)
7183 {
7184 text2 = "milkBaby".lang().TagSize(14) + text2;
7185 }
7186 if (Guild.Fighter.ShowBounty(this) && Guild.Fighter.HasBounty(this))
7187 {
7188 text2 = "hasBounty".lang().TagSize(14) + text2;
7189 }
7190 if (EClass.pc.HasElement(481))
7191 {
7192 text2 += ("(" + faith.Name + ")").TagSize(14);
7193 }
7194 if (EClass.pc.HasElement(6607))
7195 {
7196 s += CraftUtil.GetBloodText(this).TagSize(14).TagColor(EClass.Colors.colorBlood);
7197 }
7198 return text + text2 + s;
7199 }
bool HasHigherGround(Card c)
Definition: Chara.cs:1249
override bool IsMoving
Definition: Chara.cs:626
bool IsNeutral()
Definition: Chara.cs:6896
Color colorHostile
Color colorBlood
Color colorFriend
Gradient gradientLVComparison
virtual string GetName(NameStyle style, int num=-1)
virtual string GetHoverText()
static string GetBloodText(Chara c)
Definition: CraftUtil.cs:118
bool ShowBounty(Chara c)
Definition: GuildFighter.cs:39
bool HasBounty(Chara c)
Definition: GuildFighter.cs:44
Definition: Guild.cs:2
static GuildFighter Fighter
Definition: Guild.cs:56

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

Referenced by WidgetMouseover.Refresh().

◆ GetHoverText2()

override string Chara.GetHoverText2 ( )
inlinevirtual

Reimplemented from Card.

Definition at line 7201 of file Chara.cs.

7202 {
7203 if (mimicry != null && mimicry.IsThing)
7204 {
7205 return mimicry.GetHoverText2();
7206 }
7207 string text = "";
7208 if (knowFav)
7209 {
7210 text += Environment.NewLine;
7211 text = text + "<size=14>" + "favgift".lang(GetFavCat().GetName().ToLower(), GetFavFood().GetName()) + "</size>";
7212 }
7213 string text2 = "";
7215 {
7216 text2 += Environment.NewLine;
7217 text2 = text2 + "Lv:" + base.LV + " HP:" + base.hp + "/" + MaxHP + " MP:" + mana.value + "/" + mana.max + " DV:" + DV + " PV:" + PV + " Hunger:" + hunger.value;
7218 text2 += Environment.NewLine;
7219 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");
7220 text2 += Environment.NewLine;
7221 text2 = text2 + base.uid + IsMinion + "/" + base.c_uidMaster + "/" + master;
7222 text2 = text2 + " dir:" + base.dir + " skin:" + base.idSkin + " scaled:" + base.isScaled;
7223 }
7225 {
7226 text2 += Environment.NewLine;
7227 text2 += "<size=14>";
7228 foreach (Hobby item in ListWorks())
7229 {
7230 text2 = text2 + item.Name + ", ";
7231 }
7232 foreach (Hobby item2 in ListHobbies())
7233 {
7234 text2 = text2 + item2.Name + ", ";
7235 }
7236 text2 = text2.TrimEnd(", ".ToCharArray()) + "</size>";
7237 }
7238 string text3 = "";
7239 IEnumerable<BaseStats> enumerable = conditions.Concat((!IsPCFaction) ? new BaseStats[0] : new BaseStats[2] { hunger, stamina });
7240 if (enumerable.Count() > 0)
7241 {
7242 text3 += Environment.NewLine;
7243 text3 += "<size=14>";
7244 int num = 0;
7245 foreach (BaseStats item3 in enumerable)
7246 {
7247 if (item3 is ConBaseTransmuteMimic)
7248 {
7249 continue;
7250 }
7251 string text4 = item3.GetPhaseStr();
7252 if (text4.IsEmpty() || text4 == "#")
7253 {
7254 continue;
7255 }
7256 Color c = Color.white;
7257 switch (item3.source.group)
7258 {
7259 case "Bad":
7260 case "Debuff":
7261 case "Disease":
7263 break;
7264 case "Buff":
7266 break;
7267 }
7269 {
7270 text4 = text4 + "(" + item3.GetValue() + ")";
7271 if (resistCon != null && resistCon.ContainsKey(item3.id))
7272 {
7273 text4 = text4 + "{" + resistCon[item3.id] + "}";
7274 }
7275 }
7276 num++;
7277 text3 = text3 + text4.TagColor(c) + ", ";
7278 }
7279 if (num == 0)
7280 {
7281 text3 = "";
7282 }
7283 else
7284 {
7285 text = "";
7286 text3 = text3.TrimEnd(", ".ToCharArray()) + "</size>";
7287 }
7288 }
7290 {
7291 text3 += Environment.NewLine;
7292 foreach (ActList.Item item4 in ability.list.items)
7293 {
7294 text3 = text3 + item4.act.Name + ", ";
7295 }
7296 text3 = text3.TrimEnd(", ".ToCharArray());
7297 }
7298 return text + text2 + text3;
7299 }
override string ToString()
Definition: AIAct.cs:124
virtual string GetPhaseStr()
Definition: BaseStats.cs:61
virtual int GetValue()
Definition: BaseStats.cs:66
bool isScaled
Definition: Card.cs:917
SourceCategory.Row GetFavCat()
Definition: Chara.cs:8476
bool knowFav
Definition: Chara.cs:417
Stats hunger
Definition: Chara.cs:1201
override string GetName(NameStyle style, int num=-1)
Definition: Chara.cs:1420
override int DV
Definition: Chara.cs:747
List< Hobby > ListHobbies(bool useMemberType=true)
Definition: Chara.cs:9484
override int PV
Definition: Chara.cs:776
SourceThing.Row GetFavFood()
Definition: Chara.cs:8443
List< Hobby > ListWorks(bool useMemberType=true)
Definition: Chara.cs:9457
Color colorDebuff
virtual string GetHoverText2()
bool showExtra
Definition: CoreDebug.cs:183
Definition: Hobby.cs:5
SourceTactics tactics

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

Referenced by WidgetMouseover.Refresh().

◆ GetIdPortrait()

string Chara.GetIdPortrait ( )
inline

Definition at line 8595 of file Chara.cs.

8596 {
8597 string str = GetStr("portrait_override");
8598 if (!str.IsEmpty() && Portrait.allIds.Contains(str + ".png"))
8599 {
8600 return str;
8601 }
8602 if (id == "olderyoungersister")
8603 {
8604 if (base.idSkin != 2)
8605 {
8606 return "UN_olderyoungersister";
8607 }
8608 return "UN_olderyoungersister_alt";
8609 }
8610 if (Portrait.allIds.Contains("UN_" + id + ".png"))
8611 {
8612 return "UN_" + id;
8613 }
8614 return base.c_idPortrait;
8615 }
static HashSet< string > allIds
Definition: Portrait.cs:20

References Portrait.allIds.

Referenced by ButtonRoster.SetChara(), Person.SetChara(), Portrait.SetChara(), and Portrait.SetPerson().

◆ GetIdPortraitCat()

string Chara.GetIdPortraitCat ( )
inline

Definition at line 8581 of file Chara.cs.

8582 {
8583 string text = race.id;
8584 if ((text == "mifu" || text == "nefu") && EClass.rnd(2) == 0)
8585 {
8586 return "foxfolk";
8587 }
8588 if (trait is TraitGuard)
8589 {
8590 return "guard";
8591 }
8592 return "";
8593 }

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

7403 {
7404 return GetSprite();
7405 }
override Sprite GetSprite(int dir=0)
Definition: Chara.cs:7016

◆ GetName()

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

Reimplemented from Card.

Definition at line 1420 of file Chara.cs.

1421 {
1422 if (mimicry != null && mimicry.Card != this)
1423 {
1424 return mimicry.GetName(style, num);
1425 }
1426 if (base.isBackerContent && EClass.core.config.backer.Show(base.c_idBacker))
1427 {
1428 if (id == "follower" && !IsGlobal)
1429 {
1430 return "_follower".lang(EClass.sources.backers.map[base.c_idBacker].Name, faith.Name);
1431 }
1432 return EClass.sources.backers.map[base.c_idBacker].Name;
1433 }
1434 string text = base.c_altName ?? source.GetName(this);
1435 if (HasCondition<ConTransmuteShadow>())
1436 {
1437 text = EClass.sources.charas.map["shade"].GetName(this);
1438 }
1439 text = text.Replace("#ele5", MainElement.source.GetAltname(3)).Replace("#ele4", MainElement.source.GetAltname(2)).Replace("#ele3", MainElement.source.GetAltname(1))
1440 .Replace("#ele2", MainElement.source.GetAltname(0))
1441 .Replace("#ele", MainElement.source.GetName().ToLower());
1442 if (base.c_bossType == BossType.Evolved)
1443 {
1444 text = "_evolved".lang(text.ToTitleCase(wholeText: true));
1445 }
1446 trait.SetName(ref text);
1447 if (text.Length > 0 && char.IsLower(text[0]))
1448 {
1449 if (base.rarity >= Rarity.Legendary)
1450 {
1451 text = text.ToTitleCase();
1452 }
1453 else if (num != 0)
1454 {
1455 text = text.AddArticle();
1456 }
1457 }
1458 if (style == NameStyle.Simple)
1459 {
1460 return text;
1461 }
1462 int num2 = ((base.rarity == Rarity.Mythical) ? 3 : ((base.rarity >= Rarity.Mythical) ? 2 : ((base.rarity >= Rarity.Legendary) ? 2 : ((!_alias.IsEmpty()) ? 1 : (-1)))));
1463 if (trait is TraitAdventurer)
1464 {
1465 num2 = 1;
1466 }
1467 text = (Aka.IsEmpty() ? text.Bracket(num2) : (num2 switch
1468 {
1469 -1 => "_aka",
1470 1 => "_aka3",
1471 _ => "_aka2",
1472 }).lang((num2 == -1) ? Aka : Aka.ToTitleCase(wholeText: true), text.Bracket(num2)));
1473 string text2 = (base.isSale ? "forSale".lang(Lang._currency(GetPrice(CurrencyType.Money, sell: true, PriceType.PlayerShop), "money")) : "");
1474 return text + text2;
1475 }
BossType
Definition: BossType.cs:2
virtual int GetPrice(CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
Definition: Card.cs:7741
string Aka
Definition: Chara.cs:220
BackerContentConfig backer
Definition: CoreConfig.cs:621
virtual string Name
Definition: Religion.cs:37
SourceBacker backers
SourceChara charas
virtual void SetName(ref string s)
Definition: Trait.cs:733

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

Referenced by TraitStoryBookHome.OnRead().

◆ GetNearbyCatToSniff()

Chara Chara.GetNearbyCatToSniff ( )
inline

Definition at line 8533 of file Chara.cs.

8534 {
8535 using (List<Chara>.Enumerator enumerator = pos.ListCharasInRadius(this, 3, (Chara c) => c != this && c.race.id == "cat").GetEnumerator())
8536 {
8537 if (enumerator.MoveNext())
8538 {
8539 return enumerator.Current;
8540 }
8541 }
8542 return null;
8543 }
List< Chara > ListCharasInRadius(Chara cc, int dist, Func< Chara, bool > func, bool onlyVisible=true)
Definition: Point.cs:1226

References race.

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

◆ GetPietyValue()

int Chara.GetPietyValue ( )
inline

Definition at line 10733 of file Chara.cs.

10734 {
10735 if (base._IsPC)
10736 {
10737 return 10 + (int)(Mathf.Sqrt(base.c_daysWithGod) * 2f + (float)Evalue(85)) / 2;
10738 }
10739 return 10 + (int)(Mathf.Sqrt(base.LV) * 5f + (float)Evalue(306)) / 2;
10740 }

◆ GetRandomRangedWeapon()

Thing Chara.GetRandomRangedWeapon ( )
inline

Definition at line 8245 of file Chara.cs.

8246 {
8247 return things.List((Thing t) => t.IsRangedWeapon && CanEquipRanged(t)).RandomItem();
8248 }

References Card.IsRangedWeapon.

◆ GetRevived()

void Chara.GetRevived ( )
inline

Definition at line 5398 of file Chara.cs.

5399 {
5400 Revive(EClass.pc.pos.GetNearestPoint(allowBlock: false, allowChara: false), msg: true);
5401 if (!IsPCFaction)
5402 {
5403 return;
5404 }
5406 {
5407 if (homeZone != null && EClass._zone != homeZone)
5408 {
5409 Msg.Say("returnHome", this, homeZone.Name);
5411 }
5412 }
5413 else if (!EClass._zone.IsPCFaction || homeBranch != EClass.Branch || base.c_wasInPcParty)
5414 {
5415 EClass.pc.party.AddMemeber(this, showMsg: true);
5416 }
5417 }
static FactionBranch Branch
Definition: EClass.cs:23
void AddMemeber(Chara c, bool showMsg=false)
Definition: Party.cs:67
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false, int minRadius=0)
Definition: Point.cs:624
virtual bool CanJoinParty
Definition: TraitChara.cs:48
virtual bool CanJoinPartyResident
Definition: TraitChara.cs:53

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

9436 {
9437 BaseArea result = null;
9438 foreach (Hobby item in ListWorks())
9439 {
9440 AIWork aI = item.GetAI(this);
9441 if (aI.SetDestination())
9442 {
9443 if (aI.destArea != null)
9444 {
9445 result = aI.destArea;
9446 }
9447 else if (aI.destThing != null)
9448 {
9449 result = aI.destThing.pos.cell.room;
9450 }
9451 break;
9452 }
9453 }
9454 return result;
9455 }
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 7016 of file Chara.cs.

7017 {
7018 string str = GetStr("sprite_override");
7019 if (!str.IsEmpty())
7020 {
7021 Sprite sprite = ModUtil.LoadSprite(str);
7022 if ((bool)sprite)
7023 {
7024 return sprite;
7025 }
7026 }
7027 if (IsPCC)
7028 {
7029 PCC pCC = PCC.Get(pccData);
7030 pCC.Build();
7031 return pCC.variation.idle[0, 0];
7032 }
7033 bool snow = EClass.core.IsGameStarted && EClass._zone.IsSnowCovered;
7034 int skin = 0;
7035 if (spriteReplacer?.data != null)
7036 {
7037 Sprite sprite2 = spriteReplacer.GetSprite(dir, skin, snow);
7038 if ((bool)sprite2)
7039 {
7040 return sprite2;
7041 }
7042 }
7043 if (sourceCard.tiles.Length > 1)
7044 {
7045 skin = ((base.idSkin == 0 && !source.staticSkin) ? (base.uid % sourceCard.tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)) : base.idSkin);
7046 }
7047 return sourceCard.GetSprite(dir, skin, snow);
7048 }
int dir
Definition: Card.cs:149
SpriteReplacer spriteReplacer
Definition: Chara.cs:158
override CardRow sourceCard
Definition: Chara.cs:454
int[] tiles
Definition: RenderRow.cs:10
Sprite GetSprite(int dir=0, int skin=0, bool snow=false)
Definition: RenderRow.cs:264
virtual bool IsSnowCovered
Definition: Spatial.cs:545
Sprite GetSprite(string suffix="")

References EClass._zone, RenderRow.GetSprite(), SpriteReplacer.GetSprite(), Spatial.IsSnowCovered, SourceChara.Row.staticSkin, and RenderRow.tiles.

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

7060 {
7061 if (IsPCC)
7062 {
7064 {
7066 }
7067 }
7068 else if (conSleep != null && host == null && pos.Equals(EClass.pc.pos) && IsHuman && (GetBool(123) || affinity.CanSleepBeside()))
7069 {
7070 return EClass.setting.pass.subDead;
7071 }
7072 return SubPassData.Default;
7073 }
bool GetBool(string id)
Definition: Card.cs:2557
ConSleep conSleep
Definition: Chara.cs:102
override bool IsDeadOrSleeping
Definition: Chara.cs:579
PassSetting pass
Definition: GameSetting.cs:305
bool altHeldPos
Definition: Player.cs:1223
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 7646 of file Chara.cs.

7647 {
7648 return GetHappiness().ToString() ?? "";
7649 }
int GetHappiness()
Definition: Chara.cs:7636

◆ GetTextHobby()

string Chara.GetTextHobby ( bool  simple = false)
inline

Definition at line 9573 of file Chara.cs.

9574 {
9575 string text = (simple ? "" : ("hobby".lang() + ":"));
9576 foreach (Hobby item in ListHobbies())
9577 {
9578 text = text + " " + item.Name.TagColor((item.GetEfficiency(this) > 0) ? FontColor.Good : FontColor.Warning) + ",";
9579 }
9580 return text.TrimEnd(',');
9581 }

References item.

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

◆ GetTextWork()

string Chara.GetTextWork ( bool  simple = false)
inline

Definition at line 9583 of file Chara.cs.

9584 {
9585 string text = (simple ? "" : ("work".lang() + ":"));
9586 foreach (Hobby item in ListWorks())
9587 {
9588 text = text + " " + item.Name.TagColor((item.GetEfficiency(this) > 0) ? FontColor.Good : FontColor.Warning) + ",";
9589 }
9590 return text.TrimEnd(',');
9591 }

References item.

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

◆ GetTopicText()

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

Definition at line 7301 of file Chara.cs.

7302 {
7303 ConTransmuteHuman condition = GetCondition<ConTransmuteHuman>();
7304 string key = ((condition == null) ? source : condition.chara.source).idText.IsEmpty((condition == null) ? id : condition.chara.id);
7305 if (id == "littleOne" && EClass._zone is Zone_LittleGarden)
7306 {
7307 key = "littleOne2";
7308 }
7309 SourceCharaText.Row row = EClass.sources.charaText.map.TryGetValue(key);
7310 if (row == null)
7311 {
7312 return null;
7313 }
7314 string text = row.GetText(topic, returnNull: true);
7315 if (text.IsEmpty())
7316 {
7317 return null;
7318 }
7319 if (text.StartsWith("@"))
7320 {
7321 row = EClass.sources.charaText.map.TryGetValue(text.Replace("@", ""));
7322 if (row == null)
7323 {
7324 return null;
7325 }
7326 text = row.GetText(topic, returnNull: true);
7327 if (text.IsEmpty())
7328 {
7329 return null;
7330 }
7331 }
7332 return text.Split(Environment.NewLine.ToCharArray()).RandomItem();
7333 }
SourceCharaText charaText

References EClass._zone, ConTransmuteHuman.chara, SourceManager.charaText, Card.id, source, and EClass.sources.

◆ GetTotalFeat()

int Chara.GetTotalFeat ( )
inline

Definition at line 8555 of file Chara.cs.

8556 {
8557 int num = 0;
8558 if (base.c_upgrades != null)
8559 {
8560 num += base.c_upgrades.spent;
8561 }
8562 if (base.c_genes != null)
8563 {
8564 num += base.c_genes.GetTotalCost();
8565 }
8566 return num + base.feat;
8567 }

◆ GetWork()

Hobby Chara.GetWork ( string  id)
inline

Definition at line 9504 of file Chara.cs.

9505 {
9506 foreach (Hobby item in ListWorks())
9507 {
9508 if (item.source.alias == id)
9509 {
9510 return item;
9511 }
9512 }
9513 foreach (Hobby item2 in ListHobbies())
9514 {
9515 if (item2.source.alias == id)
9516 {
9517 return item2;
9518 }
9519 }
9520 return null;
9521 }
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 9666 of file Chara.cs.

9667 {
9668 if (_workSummary == null)
9669 {
9670 _workSummary = new WorkSummary();
9671 }
9672 return _workSummary;
9673 }
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 8712 of file Chara.cs.

8713 {
8714 if (c.IsHostile() || c.IsDeadOrSleeping)
8715 {
8716 Msg.Say("affinityNone", c, this);
8717 return;
8718 }
8719 if (!t.isCopy && t.IsCursed && t.IsEquipmentOrRanged && !t.IsAmmo && c.HasElement(1414))
8720 {
8721 bool num = t.blessedState == BlessedState.Doomed;
8722 int num2 = 200 + t.LV * 3;
8723 if (t.rarity == Rarity.Legendary)
8724 {
8725 num2 *= 3;
8726 }
8727 if (t.rarity >= Rarity.Mythical)
8728 {
8729 num2 *= 5;
8730 }
8731 if (num)
8732 {
8733 num2 *= 2;
8734 }
8735 EClass.pc.PlayEffect("identify");
8736 EClass.pc.PlaySound("identify");
8737 c.PlayEffect("mutation");
8738 c.Say("draw_curse", c, t);
8739 t.Destroy();
8740 List<Element> list = new List<Element>();
8741 foreach (Element value in EClass.pc.elements.dict.Values)
8742 {
8743 if (value is Spell)
8744 {
8745 list.Add(value);
8746 }
8747 }
8748 if (list.Count == 0)
8749 {
8751 return;
8752 }
8753 Element element = list.RandomItem();
8754 EClass.pc.ModExp(element.id, num2);
8755 EClass.pc.Say("draw_curse2", EClass.pc, element.Name);
8756 c.AddExp(Mathf.Min(num2 / 3, c.ExpToNext));
8757 return;
8758 }
8759 if ((t.id == "lovepotion" || t.id == "dreambug") && !Application.isEditor)
8760 {
8761 GiveLovePotion(c, t);
8762 return;
8763 }
8764 if (t.trait is TraitErohon && c.id == t.c_idRefName)
8765 {
8766 c.OnGiveErohon(t);
8767 return;
8768 }
8769 if (t.trait is TraitTicketMassage)
8770 {
8771 t.ModNum(-1);
8772 c.Talk("ticket");
8773 switch (t.id)
8774 {
8775 case "ticket_massage":
8776 c.ModAffinity(EClass.pc, 10);
8778 {
8779 target = c
8780 });
8781 break;
8782 case "ticket_armpillow":
8783 c.ModAffinity(EClass.pc, 20);
8784 EClass.pc.AddCondition<ConSleep>(300, force: true);
8785 c.SetAI(new AI_ArmPillow
8786 {
8787 target = EClass.pc
8788 });
8789 break;
8790 case "ticket_champagne":
8791 c.ModAffinity(EClass.pc, 10);
8793 break;
8794 }
8795 return;
8796 }
8797 if (t.id == "flyer")
8798 {
8799 stamina.Mod(-1);
8800 if (c.things.Find((Thing a) => a.id == "flyer") != null)
8801 {
8802 c.Talk("flyer_miss");
8803 DoHostileAction(c);
8804 return;
8805 }
8806 if (EClass.rnd(20) != 0 && c.CHA > EClass.rnd(base.CHA + Evalue(291) * 3 + 10))
8807 {
8808 Msg.Say("affinityNone", c, this);
8809 t.Destroy();
8810 elements.ModExp(291, 10f);
8811 return;
8812 }
8813 elements.ModExp(291, 50f);
8814 }
8815 if (t.id == "statue_weird")
8816 {
8817 EClass.pc.Say("statue_sell");
8818 }
8819 t.isGifted = true;
8820 c.nextUse = c.affinity.OnGift(t);
8821 if (!t.isDestroyed)
8822 {
8823 EClass.game.quests.list.ForeachReverse(delegate(Quest q)
8824 {
8825 q.OnGiveItem(c, t);
8826 });
8827 if (c.TryEquip(t))
8828 {
8829 c.nextUse = null;
8830 }
8831 }
8832 if (c.IsPCParty)
8833 {
8835 }
8836 }
Thing OnGift(Thing t)
Definition: Affinity.cs:136
int ExpToNext
Definition: Card.cs:2060
bool isCopy
Definition: Card.cs:881
bool IsCursed
Definition: Card.cs:2309
int CHA
Definition: Card.cs:2417
bool IsEquipmentOrRanged
Definition: Card.cs:2272
void SayNothingHappans()
Definition: Card.cs:7279
string c_idRefName
Definition: Card.cs:1681
void TryClearInventory()
Definition: Chara.cs:9002
void GiveLovePotion(Chara c, Thing t)
Definition: Chara.cs:8849
bool TryEquip(Thing t, bool useFav=false)
Definition: Chara.cs:8125
void OnGiveErohon(Thing t)
Definition: Chara.cs:8838
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(), IsPCParty, 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, TryClearInventory(), and TryEquip().

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

◆ GiveLovePotion()

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

Definition at line 8849 of file Chara.cs.

8850 {
8851 c.Say("give_love", c, t);
8852 c.PlaySound(t.material.GetSoundDead());
8853 c.ShowEmo(Emo.angry);
8854 c.ModAffinity(EClass.pc, -20, show: false);
8855 c.Talk("pervert");
8856 t.Destroy();
8857 }

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

Definition at line 6644 of file Chara.cs.

6645 {
6646 if (enemy == null && !IsPC)
6647 {
6648 if (GetInt(106) == 0)
6649 {
6650 TalkTopic("aggro");
6651 }
6652 if (OriginalHostility != Hostility.Enemy)
6653 {
6654 ShowEmo(Emo.angry);
6655 }
6656 SetEnemy(_tg.Chara);
6657 }
6659 {
6660 if (hostility >= Hostility.Neutral)
6661 {
6662 Say("angry", this);
6663 }
6664 hostility = Hostility.Enemy;
6665 }
6666 }
virtual bool IsPCFactionMinion
Definition: Card.cs:2209
int GetInt(string id, int? defaultInt=null)
Definition: Card.cs:2567

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

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

◆ HasAccess() [1/2]

bool Chara.HasAccess ( Card  c)
inline

Definition at line 1343 of file Chara.cs.

1344 {
1345 return HasAccess(c.pos);
1346 }
bool HasAccess(Card c)
Definition: Chara.cs:1343

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

1349 {
1350 if (!EClass._zone.IsPCFaction || p.cell.room == null || IsPC)
1351 {
1352 return true;
1353 }
1354 return p.cell.room.data.accessType switch
1355 {
1356 BaseArea.AccessType.Resident => memberType == FactionMemberType.Default,
1357 BaseArea.AccessType.Private => false,
1358 _ => true,
1359 };
1360 }

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

◆ HasCondition()

bool Chara.HasCondition ( string  alias)
inline

◆ HasCondition< T >()

override bool Chara.HasCondition< T > ( )
inlinevirtual

Reimplemented from Card.

Definition at line 9926 of file Chara.cs.

9927 {
9928 for (int i = 0; i < conditions.Count; i++)
9929 {
9930 if (conditions[i] is T)
9931 {
9932 return true;
9933 }
9934 }
9935 return false;
9936 }

◆ HasCooldown()

bool Chara.HasCooldown ( int  idEle)
inline

Definition at line 9225 of file Chara.cs.

9226 {
9227 return GetCooldown(idEle) != 0;
9228 }
int GetCooldown(int idEle)
Definition: Chara.cs:9230

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

◆ HasHigherGround()

bool Chara.HasHigherGround ( Card  c)
inline

Definition at line 1249 of file Chara.cs.

1250 {
1251 if (c == null)
1252 {
1253 return false;
1254 }
1255 float num = renderer.position.y - pos.Position(0).y + (_isLevitating ? 0.4f : 0f);
1256 float num2 = c.renderer.position.y - c.pos.Position(0).y + ((c.isChara && c.Chara._isLevitating) ? 0.4f : 0f);
1257 return num > num2 + 0.1f;
1258 }
bool _isLevitating
Definition: Chara.cs:136
ref Vector3 Position(int height)
Definition: Point.cs:553

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

9355 {
9356 int num = EClass.sources.hobbies.alias.TryGetValue(alias)?.id ?? 0;
9357 listHobby.Clear();
9358 if (_works == null || _hobbies == null)
9359 {
9360 RerollHobby();
9361 }
9362 foreach (int work in _works)
9363 {
9364 if (work == num)
9365 {
9366 return true;
9367 }
9368 }
9369 foreach (int hobby in _hobbies)
9370 {
9371 if (hobby == num)
9372 {
9373 return true;
9374 }
9375 }
9376 return false;
9377 }
static List< Hobby > listHobby
Definition: Chara.cs:13
void RerollHobby(bool extraSlotChance=true)
Definition: Chara.cs:9617
SourceHobby hobbies

References SourceManager.hobbies, and EClass.sources.

Referenced by AI_Idle.Run().

◆ HasMinion()

bool Chara.HasMinion ( string  id)
inline

Definition at line 2585 of file Chara.cs.

2586 {
2587 foreach (Chara chara in EClass._map.charas)
2588 {
2589 if (chara.c_uidMaster == base.uid)
2590 {
2591 return true;
2592 }
2593 }
2594 return false;
2595 }

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

Referenced by ActEffect.ProcAt().

◆ HealAll()

void Chara.HealAll ( )
inline

Definition at line 1787 of file Chara.cs.

1788 {
1789 Cure(CureType.HealComplete);
1790 base.hp = MaxHP;
1791 mana.value = mana.max;
1792 stamina.value = stamina.max;
1793 Refresh();
1794 }
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 4706 of file Chara.cs.

4707 {
4708 if (held == t || t.isDestroyed || t.Num <= 0)
4709 {
4710 return;
4711 }
4712 if (IsPC && t.isNPCProperty)
4713 {
4714 t.isNPCProperty = false;
4715 if (!t.GetBool(128))
4716 {
4718 pos.TryWitnessCrime(this);
4719 }
4720 }
4721 PickHeld();
4722 if (t.isChara)
4723 {
4725 {
4726 t.ShowEmo(Emo.love);
4727 }
4728 EClass.player.altHeldPos = t.renderer.data.ForceAltHeldPosition || EClass.rnd(2) == 0;
4729 }
4730 else
4731 {
4732 if (num == -1 || num > t.Num)
4733 {
4734 num = t.Num;
4735 }
4736 if (num < t.Num)
4737 {
4738 t = t.Split(num);
4739 }
4740 }
4741 if (t.GetRootCard() != this)
4742 {
4743 t = Pick(t.Thing, msg: false, tryStack: false);
4744 if (t.GetRootCard() != this)
4745 {
4746 return;
4747 }
4748 }
4749 held = t;
4751 if (held.GetLightRadius() > 0)
4752 {
4754 }
4755 if (IsPC)
4756 {
4758 WidgetHotbar.dirtyCurrentItem = true;
4759 }
4760 }
Thing Split(int a)
Definition: Card.cs:3658
bool isNPCProperty
Definition: Card.cs:557
virtual CardRenderer _CreateRenderer()
Definition: Card.cs:6401
void RecalculateFOV()
Definition: Card.cs:6822
virtual bool IsAliveInCurrentZone
Definition: Card.cs:2179
int GetLightRadius()
Definition: Card.cs:6869
void PickHeld(bool msg=false)
Definition: Chara.cs:4762
bool TryWitnessCrime(Chara criminal, Chara target=null, int radius=4, Func< Chara, bool > funcWitness=null)
Definition: Point.cs:878

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

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

◆ InitStats()

void Chara.InitStats ( bool  onDeserialize = false)
inline

Definition at line 9750 of file Chara.cs.

9751 {
9752 if (!onDeserialize)
9753 {
9754 _cints[10] = 20;
9755 _cints[11] = 70;
9756 _cints[13] = 70;
9757 _cints[14] = 70;
9758 _cints[15] = 70;
9759 _cints[17] = 0;
9760 _cints[18] = 0;
9761 }
9762 foreach (Condition condition in conditions)
9763 {
9764 condition.SetOwner(this, onDeserialize);
9765 }
9766 }
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 7967 of file Chara.cs.

7968 {
7969 if (t == null)
7970 {
7971 t = FindBestFoodToEat();
7972 }
7973 if (t == null)
7974 {
7975 t = things.Find((Thing a) => CanEat(a, shouldEat: true) && !a.c_isImportant);
7976 }
7977 if (t == null)
7978 {
7979 t = things.Find((Thing a) => CanEat(a) && !a.c_isImportant);
7980 }
7981 if (t != null)
7982 {
7983 Say("eat_start", this, t.Duplicate(1));
7984 if (sound)
7985 {
7986 PlaySound("eat");
7987 }
7988 FoodEffect.Proc(this, t);
7989 }
7990 }
Thing FindBestFoodToEat()
Definition: Chara.cs:7946
static void Proc(Chara c, Thing food, bool consume=true)
Definition: FoodEffect.cs:16

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

6907 {
6908 if (faction == EClass.Home)
6909 {
6910 return homeZone == EClass.game.activeZone;
6911 }
6912 return false;
6913 }
Faction faction
Definition: Chara.cs:431
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 1236 of file Chara.cs.

1237 {
1238 if (host == null || includeRide)
1239 {
1240 if (Evalue(1421) <= 0)
1241 {
1242 return base.hp < MaxHP / 5;
1243 }
1244 return base.hp + mana.value < (MaxHP + mana.max) / 5;
1245 }
1246 return false;
1247 }

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

2713 {
2714 if (!currentZone.IsRegion && p.IsValid)
2715 {
2716 CellDetail detail = p.detail;
2717 if (detail != null && detail.charas.Count > 0)
2718 {
2719 foreach (Chara chara in p.detail.charas)
2720 {
2721 if (chara.mimicry == null && (chara.IsHostile(this) || chara.IsHostile() || !chara.trait.CanBePushed))
2722 {
2723 if (cancelAI && EClass.pc.ai is GoalManualMove)
2724 {
2725 EClass.pc.ai.Cancel();
2726 }
2727 return true;
2728 }
2729 }
2730 }
2731 }
2732 return false;
2733 }
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 2612 of file Chara.cs.

2613 {
2614 if (!IsPCPartyMinion)
2615 {
2616 return false;
2617 }
2618 foreach (Quest item in EClass.game.quests.list)
2619 {
2620 if (item is QuestEscort questEscort && questEscort.uidChara == base.uid)
2621 {
2622 return true;
2623 }
2624 }
2625 return false;
2626 }
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 6950 of file Chara.cs.

6951 {
6952 if (base.IsPCFactionOrMinion || IsFriendOrAbove())
6953 {
6955 {
6956 return true;
6957 }
6958 }
6959 else if (IsHostile() && c.IsHostile())
6960 {
6961 return true;
6962 }
6963 return false;
6964 }

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

◆ IsFusable()

bool Chara.IsFusable ( Chara  c)
inline

Definition at line 1856 of file Chara.cs.

1857 {
1858 if (c == this)
1859 {
1860 return false;
1861 }
1862 if (c.id != id)
1863 {
1864 return false;
1865 }
1866 if (c.IsPCFactionOrMinion || base.IsPCFactionOrMinion)
1867 {
1868 return false;
1869 }
1870 if (c.c_bossType != 0 || base.c_bossType != 0)
1871 {
1872 return false;
1873 }
1875 {
1876 return false;
1877 }
1878 return true;
1879 }
BossType c_bossType
Definition: Card.cs:1261
bool enable
Definition: CoreDebug.cs:301

References affinity, Card.c_bossType, Affinity.CanSleepBeside(), EClass.debug, CoreDebug.enable, Card.id, and Card.IsPCFactionOrMinion.

Referenced by ListFussableCharas().

◆ IsGuest()

◆ IsHomeMember()

◆ IsHostile() [1/2]

◆ IsHostile() [2/2]

bool Chara.IsHostile ( Chara  c)
inline

Definition at line 6854 of file Chara.cs.

6855 {
6856 if (c == null)
6857 {
6858 return false;
6859 }
6860 if (base.IsPCFactionOrMinion)
6861 {
6862 if ((c == EClass.pc.enemy && !c.IsPCFactionOrMinion) || c.hostility <= Hostility.Enemy)
6863 {
6864 return true;
6865 }
6866 }
6867 else
6868 {
6870 {
6871 return true;
6872 }
6873 if (OriginalHostility >= Hostility.Friend)
6874 {
6875 if (hostility <= Hostility.Enemy && c.IsPCFactionOrMinion)
6876 {
6877 return true;
6878 }
6879 if (c.hostility <= Hostility.Enemy && c.OriginalHostility == Hostility.Enemy)
6880 {
6881 return true;
6882 }
6883 }
6884 else if (OriginalHostility <= Hostility.Enemy && (c.IsPCFactionOrMinion || (c.OriginalHostility != Hostility.Enemy && c.hostility >= Hostility.Friend)))
6885 {
6886 return true;
6887 }
6888 }
6889 if (id == "unicorn" && (Evalue(418) < 0 || (c.HasElement(1216) && c.Evalue(418) < 1)))
6890 {
6891 return true;
6892 }
6893 return false;
6894 }
bool IsCriminal
Definition: Player.cs:1409

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

6921 {
6922 return EClass.game.activeZone == currentZone;
6923 }

Referenced by BaseListPeople.IsDisabled().

◆ IsInSpot< T >()

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

Definition at line 6925 of file Chara.cs.

6925 : TraitSpot
6926 {
6927 foreach (T item in EClass._map.props.installed.traits.List<T>())
6928 {
6929 foreach (Point item2 in item.ListPoints())
6930 {
6931 if (pos.Equals(item2))
6932 {
6933 return true;
6934 }
6935 }
6936 }
6937 return false;
6938 }
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 6896 of file Chara.cs.

6897 {
6898 return hostility == Hostility.Neutral;
6899 }

Referenced by ActPlan._Update().

◆ IsNeutralOrAbove()

bool Chara.IsNeutralOrAbove ( )
inline

◆ IsValidGiftWeight()

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

Definition at line 8648 of file Chara.cs.

8649 {
8650 int num2 = ((!HasElement(1411)) ? 1 : 3);
8651 if (GetBurden(t, num) >= num2)
8652 {
8653 return false;
8654 }
8655 return true;
8656 }
int GetBurden(Card t=null, int num=-1)
Definition: Chara.cs:1974

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

◆ Kiss()

void Chara.Kiss ( Chara  c)
inline

Definition at line 6575 of file Chara.cs.

6576 {
6577 EClass.player.forceTalk = true;
6578 Talk("kiss", null, null, IsPC);
6579 PlaySound("kiss");
6580 renderer.PlayAnime(AnimeID.Kiss, c);
6581 int num = 2 + EClass.rnd(4) + ((!c.IsPC && c.affinity.CurrentStage < Affinity.Stage.Fond) ? (-EClass.rnd(10)) : 0);
6582 c.ShowEmo((num > 0) ? Emo.love : Emo.sad);
6583 if (num > 0 && EClass.rnd(IsPC ? 100 : 5000) == 0)
6584 {
6585 c.MakeEgg();
6586 }
6587 if (IsPC && this != c)
6588 {
6589 if (c.interest > 0)
6590 {
6591 c.ModAffinity(EClass.pc, num);
6592 c.interest -= 20 + EClass.rnd(10);
6593 }
6594 else
6595 {
6596 c.Say("affinityNone", c, EClass.pc);
6597 }
6598 }
6599 Effect.Get("love")._Play(pos, isSynced ? renderer.position : pos.Position(), 0f, c.pos);
6600 }
Effect _Play(Point from, Vector3 fromV, float fixY=0f, Point to=null, Sprite sprite=null)
Definition: Effect.cs:117

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

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

◆ ListAvailabeFeats()

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

Definition at line 10413 of file Chara.cs.

10414 {
10415 List<Element> list = new List<Element>();
10416 foreach (SourceElement.Row item in EClass.sources.elements.rows.Where((SourceElement.Row a) => a.group == "FEAT" && a.cost[0] != -1 && !a.categorySub.IsEmpty()))
10417 {
10419 int num = ((feat.ValueWithoutLink <= 0) ? 1 : (feat.ValueWithoutLink + 1));
10420 if (num <= feat.source.max && !feat.HasTag("class") && !feat.HasTag("hidden") && !feat.HasTag("innate") && (!pet || !feat.HasTag("noPet")) && (showAll || feat.IsPurchaseFeatReqMet(elements)))
10421 {
10422 list.Add(Element.Create(feat.id, num) as Feat);
10423 }
10424 }
10425 return list;
10426 }
int feat
Definition: Card.cs:377
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1123
Definition: FEAT.cs:341

References Element.Create(), SourceManager.elements, Element.HasTag(), Element.id, Feat.IsPurchaseFeatReqMet(), item, Element.source, EClass.sources, and Element.ValueWithoutLink.

◆ ListFussableCharas()

List< Chara > Chara.ListFussableCharas ( int  radius = 2)
inline

Definition at line 1881 of file Chara.cs.

1882 {
1883 return pos.ListCharasInRadius(this, radius, (Chara c) => IsFusable(c));
1884 }
bool IsFusable(Chara c)
Definition: Chara.cs:1856

References IsFusable(), Point.ListCharasInRadius(), and Card.pos.

Referenced by TryFuse().

◆ ListHobbies()

List< Hobby > Chara.ListHobbies ( bool  useMemberType = true)
inline

Definition at line 9484 of file Chara.cs.

9485 {
9486 listHobby.Clear();
9487 if (!useMemberType || memberType != FactionMemberType.Livestock)
9488 {
9489 if (_hobbies == null)
9490 {
9491 RerollHobby();
9492 }
9493 foreach (int hobby in _hobbies)
9494 {
9495 listHobby.Add(new Hobby
9496 {
9497 id = hobby
9498 });
9499 }
9500 }
9501 return listHobby;
9502 }

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

9458 {
9459 listHobby.Clear();
9460 if (useMemberType && memberType == FactionMemberType.Livestock)
9461 {
9462 listHobby.Add(new Hobby
9463 {
9464 id = 45
9465 });
9466 }
9467 else
9468 {
9469 if (_works == null)
9470 {
9471 RerollHobby();
9472 }
9473 foreach (int work in _works)
9474 {
9475 listHobby.Add(new Hobby
9476 {
9477 id = work
9478 });
9479 }
9480 }
9481 return listHobby;
9482 }

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

3758 {
3759 angle = Util.GetAngle(p.x - pos.x, p.z - pos.z);
3760 if (EClass._zone.IsRegion)
3761 {
3762 if (angle > 100f && angle < 170f)
3763 {
3764 base.dir = 2;
3765 }
3766 else if (angle > 170f && angle < 190f)
3767 {
3768 base.dir = 0;
3769 }
3770 else if (angle > 190f || (angle < -10f && angle > -100f))
3771 {
3772 base.dir = 3;
3773 }
3774 else
3775 {
3776 base.dir = 1;
3777 }
3778 angle -= 45f;
3779 }
3780 else if (angle > 170f && angle < 235f)
3781 {
3782 base.dir = 0;
3783 }
3784 else if (angle > 80f && angle < 145f)
3785 {
3786 base.dir = 1;
3787 }
3788 else if (angle > -100f && angle < -35f)
3789 {
3790 base.dir = 3;
3791 }
3792 else if (angle > -10f && angle < 55f)
3793 {
3794 base.dir = 2;
3795 }
3797 }

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

◆ MakeAlly()

void Chara.MakeAlly ( bool  msg = true)
inline

Definition at line 2478 of file Chara.cs.

2479 {
2480 if (IsLocalChara && !base.IsUnique)
2481 {
2482 Debug.Log("Creating Replacement NPC for:" + this);
2484 }
2485 _MakeAlly();
2486 if (msg)
2487 {
2488 EClass.pc.Say("hire", this);
2489 EClass.Sound.Play("good");
2490 }
2491 EClass.pc.party.AddMemeber(this);
2492 if (EClass._zone.IsTown)
2493 {
2495 }
2496 }
Chara CreateReplacement()
Definition: Chara.cs:8422
void _MakeAlly()
Definition: Chara.cs:2498
virtual bool IsTown
Definition: Zone.cs:227
void RefreshListCitizen()
Definition: Zone.cs:3754

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

8623 {
8624 return DNA.GenerateGene(this, DNA.Type.Brain);
8625 }
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 8617 of file Chara.cs.

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

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

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

◆ MakeGrave()

void Chara.MakeGrave ( string  lastword)
inline

Definition at line 5505 of file Chara.cs.

5506 {
5507 if (!EClass._zone.IsRegion)
5508 {
5509 List<string> list = new List<string> { "930", "931", "947", "948", "949", "950", "951", "952" };
5510 if (IsPC && EClass.rnd(2) == 0 && EClass.pc.things.Find("letter_will") != null)
5511 {
5512 list = new List<string> { "944", "946", "backerGrave", "backerGrave2" };
5513 }
5514 Thing thing = ThingGen.Create(list.RandomItem());
5515 thing.MakeRefFrom(this);
5516 if (!lastword.IsEmpty())
5517 {
5518 thing.c_note = lastword;
5519 }
5520 thing.isModified = true;
5521 EClass._zone.AddCard(thing, pos).Install();
5522 }
5523 }
Card MakeRefFrom(string id)
Definition: Card.cs:6000

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

2542 {
2543 UnmakeMinion();
2544 Hostility hostility2 = (base.c_originalHostility = (_master.IsPCFaction ? Hostility.Ally : _master.hostility));
2545 this.hostility = hostility2;
2546 base.c_uidMaster = _master.uid;
2547 base.c_minionType = type;
2548 master = _master;
2549 Refresh();
2550 }
int uid
Definition: Card.cs:125

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

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

◆ MakePartyMemeber()

void Chara.MakePartyMemeber ( )
inline

Definition at line 2472 of file Chara.cs.

2473 {
2474 _MakeAlly();
2475 EClass.pc.party.AddMemeber(this);
2476 }

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

◆ Marry()

void Chara.Marry ( Chara  c)
inline

Definition at line 8509 of file Chara.cs.

8510 {
8511 if (base.c_love == null)
8512 {
8513 base.c_love = new LoveData();
8514 }
8515 base.c_love.dateMarriage = EClass.world.date.GetRaw();
8516 base.c_love.uidZoneMarriage = EClass._zone.uid;
8517 base.c_love.nameZoneMarriage = EClass._zone.Name;
8518 SetFeat(1275, 1, msg: true);
8520 }
int GetRaw(int offsetHours=0)
Definition: Date.cs:328
int married
Definition: Player.cs:129
int uid
Definition: Spatial.cs:70

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

Referenced by DramaOutcome.marry().

◆ ModAffinity()

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

Definition at line 8344 of file Chara.cs.

8345 {
8346 if (c == this)
8347 {
8348 return;
8349 }
8350 if (IsPC)
8351 {
8352 c.ModAffinity(EClass.pc, a, show);
8353 }
8354 else
8355 {
8357 {
8358 return;
8359 }
8360 int num = StatsHygiene.GetAffinityMod(EClass.pc.hygiene.GetPhase()) + (HasElement(417) ? 30 : 0) + (EClass.pc.HasCondition<ConSmoking>() ? (-30) : 0);
8361 if (IsPCFaction && homeBranch != null)
8362 {
8363 num += (int)Mathf.Sqrt(homeBranch.Evalue(2117)) * 5;
8364 }
8365 bool flag = a > 0;
8366 if (flag)
8367 {
8368 a = a * num / 100;
8369 if (affinity.GetLunchChance() > EClass.rnd(100) && GetInt(71) >= 0 && GetInt(71) < EClass.world.date.GetRaw())
8370 {
8371 SetInt(71, -1);
8372 }
8373 }
8374 if (show)
8375 {
8376 if (a == 0)
8377 {
8378 if (!showOnlyEmo)
8379 {
8380 Say("affinityNone", this, c);
8381 }
8382 }
8383 else
8384 {
8385 ShowEmo((!flag) ? Emo.angry : Emo.love);
8386 c.ShowEmo(flag ? Emo.love : Emo.sad);
8387 if (!showOnlyEmo)
8388 {
8389 Say(flag ? "affinityPlus" : "affinityMinus", this, c);
8390 }
8391 }
8392 }
8393 if (c.IsPC)
8394 {
8395 a = affinity.Mod(a);
8396 }
8397 }
8398 }
int Mod(int a)
Definition: Affinity.cs:204
int GetLunchChance()
Definition: Affinity.cs:93
Stats hygiene
Definition: Chara.cs:1211
int Evalue(int ele)
static int GetAffinityMod(int phase)
Definition: StatsHygiene.cs:19
virtual bool CanChangeAffinity
Definition: Trait.cs:581

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

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

◆ ModCorruption()

void Chara.ModCorruption ( int  a)
inline

Definition at line 10370 of file Chara.cs.

10371 {
10372 if (a > 0)
10373 {
10374 if (Evalue(962) >= 25 || (ResistLv(962) > 0 && EClass.rnd(ResistLv(962) + 1) != 0))
10375 {
10376 return;
10377 }
10378 int num = Evalue(412);
10379 if (num != 0)
10380 {
10381 float num2 = (float)a * 100f / (float)Mathf.Max(100 + num * 2, 10);
10382 a = (int)num2 + ((EClass.rndf(1f) < num2 % 1f) ? 1 : 0);
10383 }
10384 }
10385 if (a == 0)
10386 {
10387 return;
10388 }
10389 int num3 = (corruption + a) / 100 - corruption / 100;
10390 for (int i = 0; i < Mathf.Abs(num3); i++)
10391 {
10392 if (!MutateRandom((num3 > 0) ? 1 : (-1), 100, ether: true))
10393 {
10394 break;
10395 }
10396 }
10397 corruption += a;
10398 int num4 = 0;
10399 foreach (Element value in elements.dict.Values)
10400 {
10401 if (value.source.category == "ether")
10402 {
10403 num4 += value.Value;
10404 }
10405 }
10406 if (num4 > 0 && IsPC)
10407 {
10408 Tutorial.Reserve("ether");
10409 }
10410 corruption = num4 * 100 + corruption % 100;
10411 }
bool MutateRandom(int vec=0, int tries=100, bool ether=false, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:10529
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 10319 of file Chara.cs.

10320 {
10321 if (!HasElement(450))
10322 {
10323 long num = bio.height;
10324 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
10325 if (num < 1)
10326 {
10327 num = 1L;
10328 }
10329 if (num > 999999999)
10330 {
10331 num = 999999999L;
10332 }
10333 if (num != bio.height)
10334 {
10335 bio.height = (int)num;
10336 Say((a > 0) ? "height_gain" : "height_lose", this);
10337 }
10338 }
10339 }
int height
Definition: Biography.cs:53

◆ ModTempElement()

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

Definition at line 10785 of file Chara.cs.

10786 {
10787 if (a < 0 && !naturalDecay && HasElement(EClass.sources.elements.alias["sustain_" + EClass.sources.elements.map[ele].alias]?.id ?? 0))
10788 {
10789 return;
10790 }
10791 bool flag = HasElement(1215);
10792 if (tempElements == null)
10793 {
10795 tempElements.SetParent(this);
10796 }
10797 if (a > 0 && flag)
10798 {
10799 a = a * 150 / 100;
10800 }
10801 int num = elements.ValueWithoutLink(ele);
10802 int num2 = Mathf.Abs(num) + 100;
10803 int num3 = num2 / (flag ? 2 : 4);
10804 int num4 = -num - 100;
10805 int num5 = tempElements.Base(ele);
10806 int num6 = num5 + a;
10807 if (onlyRenew)
10808 {
10809 num3 = Mathf.Min(a, num3);
10810 num4 = Mathf.Max(a, -num2 / 3);
10811 }
10812 if (a > 0 && num6 > num3)
10813 {
10814 a = ((num3 > num5) ? (num3 - num5) : 0);
10815 }
10816 if (a < 0 && num6 < num4)
10817 {
10818 a = ((num4 < num5) ? (num4 - num5) : 0);
10819 }
10820 Element element = tempElements.ModBase(ele, a);
10821 if (element.vBase == 0)
10822 {
10823 tempElements.Remove(element.id);
10824 if (tempElements.dict.Count == 0)
10825 {
10826 tempElements = null;
10827 }
10828 }
10829 }
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 10341 of file Chara.cs.

10342 {
10343 if (HasElement(450) || a == 0)
10344 {
10345 return;
10346 }
10347 long num = bio.weight;
10348 long num2 = bio.height;
10349 long num3 = num2 * num2 * 18 / 25000;
10350 long num4 = num2 * num2 * 24 / 10000;
10351 if (ignoreLimit || (num > num3 && num < num4))
10352 {
10353 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
10354 if (num < 1)
10355 {
10356 num = 1L;
10357 }
10358 if (num > 999999999)
10359 {
10360 num = 999999999L;
10361 }
10362 if (num != bio.weight)
10363 {
10364 bio.weight = (int)num;
10365 Say((a > 0) ? "weight_gain" : "weight_lose", this);
10366 }
10367 }
10368 }
int weight
Definition: Biography.cs:41

◆ MoveByForce()

void Chara.MoveByForce ( Point  newPoint,
Card  c = null,
bool  checkWall = false 
)
inline

Definition at line 2826 of file Chara.cs.

2827 {
2828 if (!newPoint.sourceBlock.tileType.IsBlockPass && (!checkWall || (Dist(newPoint) <= 1 && CanMoveTo(newPoint, allowDestroyPath: false))) && _Move(newPoint, MoveType.Force) == MoveResult.Success && ai.Current.CancelWhenMoved)
2829 {
2830 ai.Current.TryCancel(c);
2831 }
2832 }
bool TryCancel(Card c)
Definition: AIAct.cs:280
virtual bool CancelWhenMoved
Definition: AIAct.cs:96
override MoveResult _Move(Point newPoint, MoveType type=MoveType.Walk)
Definition: Chara.cs:2920

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

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

◆ MoveHome() [1/2]

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

◆ MoveHome() [2/2]

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

Definition at line 3673 of file Chara.cs.

3674 {
3675 if (isDead)
3676 {
3677 Revive();
3678 }
3679 else
3680 {
3681 Cure(CureType.Death);
3682 }
3683 CureCondition<ConSuspend>();
3684 if (IsPCParty)
3685 {
3687 }
3688 FactionBranch factionBranch = homeBranch;
3689 if (x == -1)
3690 {
3691 x = 50;
3692 }
3693 if (z == -1)
3694 {
3695 z = 50;
3696 }
3697 Point point = new Point(x, z);
3698 if (zone.IsActiveZone)
3699 {
3700 point = point.GetNearestPoint(allowBlock: false, allowChara: false);
3701 }
3702 zone.AddCard(this, point);
3703 SetHomeZone(zone);
3704 global.transition = new ZoneTransition
3705 {
3706 state = ZoneTransition.EnterState.Dead,
3707 x = point.x,
3708 z = point.z
3709 };
3710 orgPos = new Point(x, z);
3711 if (factionBranch != null)
3712 {
3714 factionBranch.policies.Validate();
3715 }
3716 }
void RefreshWorkElements(ElementContainer parent=null)
Definition: Chara.cs:9523
Chara SetHomeZone(Zone zone)
Definition: Chara.cs:1498
PolicyManager policies
bool IsActiveZone
Definition: Zone.cs:499

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

2809 {
2810 List<Point> list = new List<Point>();
2811 pos.ForeachNeighbor(delegate(Point p)
2812 {
2813 list.Add(p.Copy());
2814 });
2815 list.Shuffle();
2816 foreach (Point item in list)
2817 {
2818 if (!item.Equals(pos) && !item.HasChara && TryMove(item) == MoveResult.Success)
2819 {
2820 return true;
2821 }
2822 }
2823 return false;
2824 }
override MoveResult TryMove(Point newPoint, bool allowDestroyPath=true)
Definition: Chara.cs:2896
void ForeachNeighbor(Action< Point > action, bool diagonal=true)
Definition: Point.cs:1403

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

Referenced by AI_Idle.Run().

◆ MoveRandom()

bool Chara.MoveRandom ( )
inline

Definition at line 2794 of file Chara.cs.

2795 {
2796 Point randomNeighbor = pos.GetRandomNeighbor();
2797 if (!randomNeighbor.Equals(pos) && !randomNeighbor.HasChara && HasAccess(randomNeighbor))
2798 {
2799 if ((race.tag.Contains("water") || source.tag.Contains("water")) && pos.cell.IsTopWaterAndNoSnow && !randomNeighbor.IsDeepWater)
2800 {
2801 return false;
2802 }
2803 return TryMove(randomNeighbor) == MoveResult.Success;
2804 }
2805 return false;
2806 }
bool IsTopWaterAndNoSnow
Definition: Cell.cs:720
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 3546 of file Chara.cs.

3547 {
3548 if (z == currentZone)
3549 {
3550 return;
3551 }
3552 if (HasCondition<ConInvulnerable>())
3553 {
3554 RemoveCondition<ConInvulnerable>();
3555 }
3556 if (IsPC)
3557 {
3558 EClass.player.nextZone = z;
3560 {
3563 {
3564 if (EClass.player.returnInfo != null)
3565 {
3566 EClass.player.returnInfo.turns += 5;
3567 }
3569 {
3570 EClass.game.Save(isAutoSave: true);
3571 }
3572 }
3573 EClass.player.deathZoneMove = false;
3574 }
3576 if (currentZone.instance != null)
3577 {
3579 z = EClass.game.spatials.Find(instance.uidZone) ?? EClass.pc.homeZone;
3580 transition = new ZoneTransition
3581 {
3582 state = instance.ReturnState,
3583 x = instance.x,
3584 z = instance.z
3585 };
3586 instance.OnLeaveZone();
3587 Debug.Log(z);
3588 }
3589 EInput.Consume(consumeAxis: true);
3590 EClass.player.uidLastZone = currentZone.uid;
3592 {
3594 {
3595 Msg.Say("enterZone", z.Name);
3596 }
3597 else
3598 {
3599 if (z.IsRegion)
3600 {
3601 Msg.Say("leaveZone", currentZone.Name);
3602 }
3603 else if (z.id != currentZone.id)
3604 {
3605 Msg.Say("enterZone", z.Name);
3606 }
3607 EClass.player.lastZonePos = pos.Copy();
3608 }
3609 EClass.player.lastTransition = transition;
3610 }
3611 foreach (Chara item in EClass._map.charas.Where((Chara c) => c.IsPCPartyMinion && c.master != EClass.pc).ToList())
3612 {
3614 }
3615 EClass.player.listCarryoverMap = EClass._map.charas.Where((Chara c) => c.c_uidMaster != 0 && c.FindMaster() == EClass.pc && c.c_minionType == MinionType.Default).ToList();
3616 if (!z.IsRegion && (z is Zone_Tent || currentZone is Zone_Tent))
3617 {
3618 foreach (Chara chara in EClass._map.charas)
3619 {
3620 if (chara.c_uidMaster == 0 && !chara.IsGlobal && !chara.isNPCProperty && (chara.id == "reaper" || chara.id == "messenger_death") && ((chara.enemy != null && chara.enemy.IsPCFactionOrMinion) || chara.Dist(EClass.pc) < 5))
3621 {
3622 EClass.player.listCarryoverMap.Add(chara);
3623 }
3624 }
3625 }
3626 foreach (Chara item2 in EClass.player.listCarryoverMap)
3627 {
3628 EClass._zone.RemoveCard(item2);
3629 }
3630 }
3631 if (party != null && party.leader == this)
3632 {
3633 foreach (Chara member in party.members)
3634 {
3635 if (member != this && !member.isDead && member.parent is Zone)
3636 {
3637 member.MoveZone(z);
3638 }
3639 }
3640 }
3641 if (global == null)
3642 {
3643 Debug.Log(base.Name);
3644 return;
3645 }
3646 transition.uidLastZone = currentZone?.uid ?? 0;
3647 global.transition = transition;
3648 if (z.IsActiveZone)
3649 {
3650 Point spawnPos = z.GetSpawnPos(this);
3651 global.transition = null;
3652 if (IsPC)
3653 {
3654 EClass.player.lastTransition = null;
3655 }
3656 z.AddCard(this, spawnPos);
3657 if (IsBranchMember())
3658 {
3660 }
3661 }
3662 else
3663 {
3664 z.AddCard(this);
3665 }
3666 }
MinionType c_minionType
Definition: Card.cs:1015
bool IsBranchMember()
Definition: Chara.cs:6906
GlobalData global
Definition: Chara.cs:76
Chara FindMaster()
Definition: Chara.cs:2603
bool ignoreAutoSave
Definition: CoreDebug.cs:141
bool Save(bool isAutoSave=false, bool silent=false)
Definition: Game.cs:1040
RoomManager rooms
Definition: Map.cs:31
Chara leader
Definition: Party.cs:31
bool deathZoneMove
Definition: Player.cs:1239
List< Chara > listCarryoverMap
Definition: Player.cs:1293
ReturnInfo returnInfo
Definition: Player.cs:933
bool simulatingZone
Definition: Player.cs:1249
void AssignCharas()
Definition: RoomManager.cs:39
string id
Definition: Spatial.cs:13
virtual ZoneTransition.EnterState ReturnState
Definition: ZoneInstance.cs:26
virtual void OnLeaveZone()
Definition: ZoneInstance.cs:36
virtual bool WillAutoSave
Definition: Zone.cs:267
Point GetSpawnPos(Chara c, ZoneTransition.EnterState destState=ZoneTransition.EnterState.Auto)
Definition: Zone.cs:1445

References EClass._map, EClass._zone, Zone.AddCard(), RoomManager.AssignCharas(), Card.c_minionType, Card.c_uidMaster, Map.charas, EInput.Consume(), Player.deathZoneMove, EClass.debug, Debug, Card.Dist(), enemy, SpatialManager.Find(), FindMaster(), EClass.game, Zone.GetSpawnPos(), Zone.GetTopZone(), homeZone, Card.id, Spatial.id, CoreDebug.ignoreAutoSave, Zone.instance, Zone.IsActiveZone, isDead, IsGlobal, Card.isNPCProperty, Zone.IsPCFaction, Card.IsPCFactionOrMinion, IsPCPartyMinion, Spatial.IsRegion, item, Party.leader, Player.listCarryoverMap, master, Party.members, MoveZone(), Spatial.Name, ZoneInstance.OnLeaveZone(), Card.parent, EClass.pc, EClass.player, Zone.RemoveCard(), Player.returnInfo, ZoneInstance.ReturnState, Map.rooms, Game.Save(), Msg.Say(), Player.simulatingZone, Game.spatials, ZoneInstance.uidZone, Zone.WillAutoSave, and ZoneInstance.x.

◆ MoveZone() [3/3]

void Chara.MoveZone ( Zone  z,
ZoneTransition::EnterState  state = ZoneTransition::EnterState::Auto 
)
inline

Definition at line 3538 of file Chara.cs.

3539 {
3541 {
3542 state = state
3543 });
3544 }

◆ MutateRandom()

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

Definition at line 10529 of file Chara.cs.

10530 {
10531 if (!ether && vec >= 0 && HasElement(406) && EClass.rnd(5) != 0)
10532 {
10533 Say("resistMutation", this);
10534 return false;
10535 }
10536 IEnumerable<SourceElement.Row> ie = EClass.sources.elements.rows.Where((SourceElement.Row a) => a.category == (ether ? "ether" : "mutation") && !a.tag.Contains("noRandomMutation"));
10537 for (int i = 0; i < tries; i++)
10538 {
10539 SourceElement.Row row = ie.RandomItem();
10540 if (i == 0 && vec < 0 && ether && base.c_corruptionHistory != null && base.c_corruptionHistory.Count > 0)
10541 {
10542 if (EClass.sources.elements.map.ContainsKey(base.c_corruptionHistory.LastItem()))
10543 {
10544 row = EClass.sources.elements.map[base.c_corruptionHistory.LastItem()];
10545 }
10546 base.c_corruptionHistory.RemoveAt(base.c_corruptionHistory.Count - 1);
10547 if (base.c_corruptionHistory.Count == 0)
10548 {
10549 base.c_corruptionHistory = null;
10550 }
10551 }
10552 Element element = elements.GetElement(row.id);
10553 int num = 1;
10554 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))
10555 {
10556 continue;
10557 }
10558 if (element == null && !row.aliasParent.IsEmpty() && elements.Has(row.aliasParent))
10559 {
10560 row = EClass.sources.elements.alias[row.aliasParent];
10561 element = elements.GetElement(row.id);
10562 }
10563 bool flag = row.tag.Contains("neg");
10564 if (vec > 0)
10565 {
10566 if ((state >= BlessedState.Blessed && flag) || (state <= BlessedState.Cursed && !flag))
10567 {
10568 continue;
10569 }
10570 }
10571 else if (vec < 0 && ((state >= BlessedState.Blessed && !flag) || (state <= BlessedState.Cursed && flag)))
10572 {
10573 continue;
10574 }
10575 bool flag2 = true;
10576 if (element != null)
10577 {
10578 num = element.Value + ((vec != 0) ? vec : ((EClass.rnd(2) == 0) ? 1 : (-1)));
10579 if (num > element.source.max)
10580 {
10581 num = element.source.max - 1;
10582 }
10583 flag = (flag && num > element.Value) || (!flag && num < element.Value);
10584 flag2 = num > element.Value;
10585 if (vec > 0 && !flag2)
10586 {
10587 continue;
10588 }
10589 }
10590 Say(flag2 ? "mutation_gain" : "mutation_loose", this);
10591 SetFeat(row.id, num);
10592 if (flag2 && ether)
10593 {
10594 if (base.c_corruptionHistory == null)
10595 {
10596 base.c_corruptionHistory = new List<int>();
10597 }
10598 base.c_corruptionHistory.Add(row.id);
10599 if (IsPCFaction)
10600 {
10601 Element element2 = elements.GetElement(row.id);
10602 WidgetPopText.Say("popEther".lang(element2.Name, base.Name));
10603 }
10605 {
10606 EClass.player.flags.gotEtherDisease = true;
10607 Thing thing = ThingGen.Create("parchment");
10608 thing.SetStr(53, "letter_ether");
10609 Thing thing2 = ThingGen.Create("1165");
10610 thing2.SetBlessedState(BlessedState.Normal);
10611 Thing p = ThingGen.CreateParcel(null, thing2, thing);
10613 }
10614 }
10615 if (EClass.core.IsGameStarted && pos != null)
10616 {
10617 PlaySound(ether ? "mutation_ether" : "mutation");
10618 PlayEffect("mutation");
10620 Say(row.GetText(flag ? "textDec" : "textInc", returnNull: true) ?? row.alias, this);
10621 }
10622 return true;
10623 }
10624 Say("nothingHappens");
10625 return false;
10626 }
virtual void SetBlessedState(BlessedState s)
Definition: Card.cs:4069
void SetStr(string id, string value=null)
Definition: Card.cs:2600
bool IsGameStarted
Definition: Core.cs:87
bool Has(int ele)
Color MutateBad
Definition: MsgColors.cs:21
Color MutateGood
Definition: MsgColors.cs:19
bool gotEtherDisease
Definition: Player.cs:496
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(), Card.SetStr(), Element.source, EClass.sources, SourceElement.Row.tag, Element.Value, and EClass.world.

◆ OnAdvanceDay()

void Chara.OnAdvanceDay ( )
inline

Definition at line 10678 of file Chara.cs.

10679 {
10680 if (_historyFood != null)
10681 {
10682 while (_historyFood.Count > 5)
10683 {
10684 _historyFood.RemoveAt(_historyFood.Count - 1);
10685 }
10686 if (_historyFood[0].Count > 0)
10687 {
10688 _historyFood.Insert(0, new List<string>());
10689 }
10690 }
10691 }

Referenced by GameDate.AdvanceDay().

◆ OnBanish()

void Chara.OnBanish ( )
inline

Definition at line 1512 of file Chara.cs.

1513 {
1514 if (!IsGlobal)
1515 {
1516 return;
1517 }
1518 memberType = FactionMemberType.Default;
1519 foreach (Thing item in things.List((Thing a) => a.HasTag(CTAG.godArtifact)).ToList())
1520 {
1522 }
1523 UniqueData uniqueData = base.c_uniqueData;
1524 if (uniqueData != null)
1525 {
1526 Debug.Log(uniqueData.uidZone + "/" + EClass.game.spatials.map.ContainsKey(uniqueData.uidZone) + "/" + uniqueData.x + "/" + uniqueData.y);
1527 }
1528 if (uniqueData != null && EClass.game.spatials.map.ContainsKey(uniqueData.uidZone))
1529 {
1530 MoveHome(EClass.game.spatials.map[uniqueData.uidZone] as Zone, uniqueData.x, uniqueData.y);
1531 return;
1532 }
1533 Zone z = EClass.game.spatials.Find("somewhere");
1534 if (trait is TraitAdventurer)
1535 {
1536 z = EClass.world.region.ListTowns().RandomItem();
1537 SetHomeZone(z);
1538 }
1539 MoveZone(z, ZoneTransition.EnterState.RandomVisit);
1540 }
void PickOrDrop(Point p, string idThing, int idMat=-1, int num=1, bool msg=true)
Definition: Chara.cs:4522
List< Zone > ListTowns()
Definition: Region.cs:272
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 1579 of file Chara.cs.

1580 {
1581 if (source.job == "*r")
1582 {
1583 base.c_idJob = EClass.sources.jobs.rows.Where((SourceJob.Row j) => j.playable < 4).RandomItem().id;
1584 }
1585 if (bp.idJob != null)
1586 {
1587 base.c_idJob = bp.idJob;
1588 }
1589 if (bp.idRace != null)
1590 {
1591 base.c_idRace = bp.idRace;
1592 }
1593 }
CardBlueprint bp
Definition: Card.cs:80
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 1595 of file Chara.cs.

1596 {
1597 if (source.tag.Contains("boss"))
1598 {
1599 bossText = true;
1600 }
1601 int num = ((bp.lv != -999) ? bp.lv : base.LV);
1602 if (trait.AdvType == TraitChara.Adv_Type.Adv || trait.AdvType == TraitChara.Adv_Type.Adv_Fairy)
1603 {
1604 if (ListAdvRace.Count == 0)
1605 {
1606 ListAdvRace = EClass.sources.races.rows.Where((SourceRace.Row a) => a.playable <= 1 && a.id != "fairy").ToList();
1607 ListAdvJob = EClass.sources.jobs.rows.Where((SourceJob.Row a) => a.playable <= 4).ToList();
1608 }
1609 if (trait.AdvType == TraitChara.Adv_Type.Adv)
1610 {
1611 base.c_idRace = ListAdvRace.RandomItem().id;
1612 }
1613 base.c_idJob = ListAdvJob.RandomItem().id;
1614 _race = null;
1615 _job = null;
1616 num = 10 + EClass.rnd(40);
1617 }
1618 bio = new Biography();
1619 bio.Generate(this);
1620 if (source.idActor.Length != 0 && source.idActor[0] == "pcc" && pccData == null)
1621 {
1622 pccData = PCCData.Create(IDPCCBodySet);
1623 if (source.idActor.Length > 2)
1624 {
1625 pccData.SetPart("body", IDPCCBodySet, source.idActor[2]);
1626 }
1627 else
1628 {
1629 pccData.Randomize(IDPCCBodySet);
1630 }
1631 }
1632 if (source.mainElement.Length != 0)
1633 {
1634 int _genLv = Mathf.Min(genLv, 100);
1635 List<Tuple<string, int, int>> list = new List<Tuple<string, int, int>>();
1636 string[] mainElement = source.mainElement;
1637 for (int i = 0; i < mainElement.Length; i++)
1638 {
1639 string[] array = mainElement[i].Split('/');
1640 SourceElement.Row row = EClass.sources.elements.alias["ele" + array[0]];
1641 int num2 = source.LV * row.eleP / 100;
1642 if (list.Count == 0 || num2 < _genLv || array[0] == bp.idEle)
1643 {
1644 list.Add(new Tuple<string, int, int>(array[0], (array.Length > 1) ? int.Parse(array[1]) : 0, num2));
1645 }
1646 }
1647 Tuple<string, int, int> tuple = list.RandomItemWeighted((Tuple<string, int, int> a) => 10000 / Mathf.Max(100 + (_genLv - a.Item3) * 25, 1));
1648 if (!bp.idEle.IsEmpty())
1649 {
1650 tuple = list.Where((Tuple<string, int, int> a) => a.Item1 == bp.idEle || "ele" + a.Item1 == bp.idEle).FirstOrDefault() ?? tuple;
1651 }
1652 SetMainElement(tuple.Item1, (tuple.Item2 == 0) ? 10 : tuple.Item2, elemental: true);
1653 if (list.Count >= 2)
1654 {
1655 num = tuple.Item3 + base.LV - source.LV;
1656 }
1657 }
1658 if (trait.UseRandomName)
1659 {
1660 base.c_altName = NameGen.getRandomName();
1661 }
1663 {
1664 _alias = AliasGen.GetRandomAlias();
1665 }
1666 happiness = EClass.rnd(100);
1667 contribution = EClass.rnd(100);
1668 RerollHobby();
1669 _idTimeTable = ((EClass.rnd(5) == 0) ? 1 : 0);
1670 ApplyRace();
1671 ApplyJob();
1672 ChangeMaterial(source.defMat.IsEmpty(race.material), ignoreFixedMaterial: true);
1673 if (num != source.LV)
1674 {
1675 SetLv(num);
1676 }
1677 if (base.LV > 5 && race.id == "mutant")
1678 {
1679 for (int j = 0; j < Mathf.Min(1 + base.LV / 5, 20); j++)
1680 {
1681 SetFeat(1644, j + 1);
1682 }
1683 }
1684 switch (id)
1685 {
1686 case "putty_mech_b":
1687 case "putty_mech":
1688 case "robot":
1689 SetFeat(1248, 1 + EClass.rnd(5));
1690 break;
1691 }
1692 InitStats();
1693 body.SetOwner(this);
1695 if (race.EQ.Length != 0 || !source.equip.IsEmpty())
1696 {
1697 TryRestock(onCreate: true);
1698 }
1699 switch (id)
1700 {
1701 case "dodo":
1702 base.idSkin = EClass.rnd(4);
1703 break;
1704 case "putty_snow":
1705 if (EClass.rnd(100) == 0 || EClass.debug.enable)
1706 {
1707 base.idSkin = EClass.rnd(4);
1708 }
1709 break;
1710 case "snail":
1711 base.idSkin = 5;
1712 break;
1713 case "olderyoungersister":
1714 base.idSkin = 1;
1715 break;
1716 case "sister_undead":
1717 case "dog":
1718 case "cat":
1719 base.idSkin = EClass.rnd(sourceCard.tiles.Length);
1720 if (id == "sister_undead" && EClass.rnd(10) == 0)
1721 {
1723 if (row2 != null && (!EClass.player.doneBackers.Contains(row2.id) || EClass.core.config.test.ignoreBackerDestoryFlag))
1724 {
1725 ApplyBacker(row2.id);
1726 }
1727 }
1728 break;
1729 case "baby":
1730 case "ika":
1731 SetFeat(1232, 3);
1732 break;
1733 }
1734 if (HasTag(CTAG.random_color))
1735 {
1736 DyeRandom();
1737 }
1738 SetAI(new NoGoal());
1739 if (!source.faith.IsEmpty())
1740 {
1741 SetFaith(source.faith);
1742 }
1743 else if (EClass.game.activeZone != null && EClass.game.activeZone.id == "foxtown")
1744 {
1746 }
1747 else if (EClass.game.activeZone != null && EClass.game.activeZone.id == "foxtown_nefu")
1748 {
1750 }
1751 else
1752 {
1753 SetFaith(EClass.game.religions.GetRandomReligion(onlyJoinable: true, EClass.rnd(10) == 0));
1754 }
1755 _affinity = 0;
1756 interest = 100;
1759 Refresh();
1760 stamina.value = stamina.max;
1761 mana.value = mana.max;
1762 isCreated = true;
1763 }
static int indexSister
void Generate(Chara c)
Definition: Biography.cs:323
void ClampInitialSkill()
Definition: Card.cs:3108
void DyeRandom()
Definition: Card.cs:6434
void ApplyBacker(int bid)
Definition: Card.cs:7461
int genLv
Definition: Card.cs:197
void SetOwner(Chara chara, bool deserialized=false)
Definition: CharaBody.cs:18
string IDPCCBodySet
Definition: Chara.cs:495
int _affinity
Definition: Chara.cs:307
void SetMainElement(string id, int v=0, bool elemental=false)
Definition: Chara.cs:2256
int happiness
Definition: Chara.cs:110
int contribution
Definition: Chara.cs:18
void CalculateMaxStamina()
Definition: Chara.cs:2188
bool isCreated
Definition: Chara.cs:138
int _idTimeTable
Definition: Chara.cs:345
void TryRestock(bool onCreate)
Definition: Chara.cs:4921
static List< SourceRace.Row > ListAdvRace
Definition: Chara.cs:170
void InitStats(bool onDeserialize=false)
Definition: Chara.cs:9750
bool bossText
Definition: Chara.cs:146
static List< SourceJob.Row > ListAdvJob
Definition: Chara.cs:172
bool ignoreBackerDestoryFlag
Definition: CoreConfig.cs:568
ReligionTrickery Trickery
Religion GetRandomReligion(bool onlyJoinable=true, bool includeMinor=false)
List< Row > listSister
SourceRace races
virtual Adv_Type AdvType
Definition: TraitChara.cs:102
virtual bool UseRandomName
Definition: TraitChara.cs:130
virtual bool UseRandomAlias
Definition: TraitChara.cs:132

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(), TraitChara.UseRandomAlias, and TraitChara.UseRandomName.

◆ OnDeserialized()

override void Chara.OnDeserialized ( )
inlineprotectedvirtual

Reimplemented from Card.

Definition at line 1390 of file Chara.cs.

1391 {
1392 isCreated = true;
1393 _cbits1.Bits = (uint)_cints[0];
1394 InitStats(onDeserialize: true);
1395 body.SetOwner(this, deserialized: true);
1396 elements.ApplyElementMap(base.uid, SourceValueType.Chara, job.elementMap, base.DefaultLV);
1397 elements.ApplyElementMap(base.uid, SourceValueType.Chara, race.elementMap, base.DefaultLV);
1398 if (global != null && global.goal != null)
1399 {
1400 global.goal.SetOwner(this);
1401 }
1402 if (IsPCC)
1403 {
1404 pccData.state = (base.isCensored ? PCCState.Naked : PCCState.Normal);
1405 }
1406 if (tempElements != null)
1407 {
1408 tempElements.SetParent(this);
1409 }
1410 UpdateAngle();
1412 Refresh();
1413 if (source.tag.Contains("boss"))
1414 {
1415 bossText = true;
1416 }
1417 sharedCheckTurn = EClass.rnd(200);
1418 }
int sharedCheckTurn
Definition: Chara.cs:120
void UpdateAngle()
Definition: Chara.cs:3799
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 8838 of file Chara.cs.

8839 {
8840 Say("give_erohon", this);
8841 AddCondition<ConParalyze>(50, force: true);
8842 AddCondition<ConConfuse>(50, force: true);
8843 AddCondition<ConFear>(1000, force: true);
8844 ModAffinity(EClass.pc, 100);
8845 t.Destroy();
8846 Talk("pervert");
8847 }

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

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

◆ OnInsulted()

void Chara.OnInsulted ( )
inline

Definition at line 8627 of file Chara.cs.

8628 {
8629 if (isDead)
8630 {
8631 return;
8632 }
8633 if (HasElement(1231))
8634 {
8635 Talk("insulted");
8636 AddCondition<ConEuphoric>(100 * Evalue(1231));
8637 }
8638 else if (EClass.rnd(20) == 0)
8639 {
8640 SetFeat(1231, 1, msg: true);
8641 if (IsPC)
8642 {
8644 }
8645 }
8646 }

References Steam.GetAchievement(), and EClass.rnd().

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

◆ OnSerializing()

override void Chara.OnSerializing ( )
inlineprotectedvirtual

Reimplemented from Card.

Definition at line 1375 of file Chara.cs.

1376 {
1377 if (enemy != null)
1378 {
1379 SetInt(55, enemy.uid);
1380 }
1381 _cints[0] = (int)_cbits1.Bits;
1382 List<BodySlot> slots = body.slots;
1383 rawSlots = new int[slots.Count];
1384 for (int i = 0; i < slots.Count; i++)
1385 {
1386 rawSlots[i] = slots[i].elementId;
1387 }
1388 }
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, Card.SetInt(), CharaBody.slots, and Card.uid.

◆ OnSleep() [1/2]

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

Definition at line 10281 of file Chara.cs.

10282 {
10283 if (days < 1)
10284 {
10285 days = 1;
10286 }
10287 int num = power * days;
10288 if (stamina.value < 0)
10289 {
10290 stamina.Set(1);
10291 }
10292 if (isWeakToSunlight && isSunLit)
10293 {
10294 base.hp = 0;
10295 if (mana.value > 0)
10296 {
10297 mana.Set(0);
10298 }
10299 AddCondition<ConBurning>(1000, force: true);
10300 }
10301 else
10302 {
10303 HealHP(num);
10304 stamina.Mod(10 + 25 * num / 100 * (100 + elements.GetFeatRef(1642)) / 100);
10305 mana.Mod(num);
10306 }
10307 if (IsPCFaction)
10308 {
10309 hunger.Mod(20);
10310 }
10311 sleepiness.Set(0);
10312 if (!IsMinion)
10313 {
10314 interest = 100;
10315 }
10316 Cure(CureType.Sleep, power);
10317 }
virtual void HealHP(long a, HealSource origin=HealSource.None)
Definition: Card.cs:4181
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 10261 of file Chara.cs.

10262 {
10263 bool isSunLit = pos.IsSunLit;
10264 TraitPillow traitPillow = pos.FindThing<TraitPillow>();
10265 int num = bed?.Power ?? 20;
10266 if (traitPillow != null)
10267 {
10268 num += traitPillow.owner.Power / 2;
10269 }
10270 if (bed != null)
10271 {
10272 num += bed.Evalue(750) * 5;
10273 if (bed.trait is TraitBedCoffin)
10274 {
10275 isSunLit = false;
10276 }
10277 }
10278 OnSleep(num, days, isSunLit);
10279 }
void OnSleep(Thing bed=null, int days=1)
Definition: Chara.cs:10261
Thing FindThing(Func< Thing, bool > func)
Definition: Point.cs:1146

References bed.

Referenced by LayerSleep.Advance().

◆ ParseBodySlot()

int Chara.ParseBodySlot ( string  s)
inlineprivate

Definition at line 2355 of file Chara.cs.

2356 {
2357 return s switch
2358 {
2359 "é ­" => 30,
2360 "首" => 31,
2361 "体" => 32,
2362 "背" => 33,
2363 "手" => 35,
2364 "指" => 36,
2365 "è…•" => 34,
2366 "è…°" => 37,
2367 "è¶³" => 39,
2368 _ => -1,
2369 };
2370 }

Referenced by ApplyRace(), and ResetBody().

◆ PerformWork()

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

Definition at line 9708 of file Chara.cs.

9709 {
9710 Hobby hobby = new Hobby();
9711 hobby.id = session.id;
9712 WorkSummary workSummary = _workSummary;
9713 hobby.GetAI(this).OnPerformWork(IsRealTime);
9714 if (!isHobby)
9715 {
9716 workSummary.progress += EClass.rnd(5) + 5;
9717 }
9718 int num = PerformWork(hobby, 0, isHobby);
9719 int num2 = PerformWork(hobby, 1, isHobby);
9720 int num3 = PerformWork(hobby, 2, isHobby);
9721 int num4 = PerformWork(hobby, 3, isHobby);
9722 workSummary.money += num;
9723 workSummary.food += num2;
9724 workSummary.knowledge += num3;
9725 workSummary.material += num4;
9726 int PerformWork(Hobby work, int idx, bool isHobby)
9727 {
9728 if (idx >= work.source.resources.Length)
9729 {
9730 return 0;
9731 }
9732 int num5 = work.source.resources[idx];
9733 int num6 = num5;
9734 num5 = Rand.Range(num5 * (100 - work.source.resources[idx]) / 100, num5);
9735 num5 = num5 * (isHobby ? 50 : 100) * session.efficiency / 10000;
9736 if (num6 > 0 && num5 <= 0)
9737 {
9738 num5 = 1;
9739 }
9740 return num5;
9741 }
9742 }
virtual void OnPerformWork(bool realtime)
Definition: AIWork.cs:150
void PerformWork(WorkSession session, bool isHobby=false, bool IsRealTime=false)
Definition: Chara.cs:9708
AIWork GetAI(Chara c)
Definition: Hobby.cs:12
static int Range(int min, int max)
Definition: Rand.cs:49
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 4542 of file Chara.cs.

4543 {
4544 if (t.trait is TraitCard && t.isNew && EClass.game.config.autoCollectCard && !t.c_idRefCard.IsEmpty())
4545 {
4547 return t;
4548 }
4549 if (t.parent == this)
4550 {
4551 return t;
4552 }
4553 t = TryPoisonPotion(t);
4554 ThingContainer.DestData dest = things.GetDest(t, tryStack);
4555 if (!dest.IsValid)
4556 {
4557 if (t.parent != EClass._zone)
4558 {
4559 if (IsPC)
4560 {
4561 Say("backpack_full_drop", t);
4562 SE.Drop();
4563 }
4564 return EClass._zone.AddCard(t, pos).Thing;
4565 }
4566 if (IsPC)
4567 {
4568 Say("backpack_full", t);
4569 }
4570 return t;
4571 }
4572 if (dest.stack != null)
4573 {
4574 if (msg)
4575 {
4576 PlaySound("pick_thing");
4577 Say("pick_thing", this, t);
4578 }
4579 t.TryStackTo(dest.stack);
4580 return dest.stack;
4581 }
4582 TryAbsorbRod(t);
4583 if (msg)
4584 {
4585 PlaySound("pick_thing");
4586 Say("pick_thing", this, t);
4587 }
4589 return dest.container.AddThing(t, tryStack);
4590 }
bool isNew
Definition: Card.cs:485
bool TryStackTo(Thing to)
Definition: Card.cs:3571
string c_idRefCard
Definition: Card.cs:1777
void TryReservePickupTutorial(Thing t)
Definition: Chara.cs:4636
Thing TryPoisonPotion(Thing t)
Definition: Chara.cs:4592
void TryAbsorbRod(Thing t)
Definition: Chara.cs:4606
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(), ActThrow.Throw(), Recipe.TryGetFirstTimeBonus(), ActRanged.TryReload(), Map.TryShatter(), UIDragGridIngredients.Update(), and CoreDebug.UpdateInput().

◆ PickHeld()

void Chara.PickHeld ( bool  msg = false)
inline

Definition at line 4762 of file Chara.cs.

4763 {
4764 if (held == null)
4765 {
4766 return;
4767 }
4768 Card card = held;
4769 if (IsPC && held.invY == 1)
4770 {
4771 WidgetHotbar.dirtyCurrentItem = true;
4773 held = null;
4774 return;
4775 }
4776 if (held.isChara)
4777 {
4778 DropHeld();
4779 return;
4780 }
4782 {
4783 Say("canOnlyCarry", held);
4784 DropHeld();
4785 return;
4786 }
4787 bool flag = held != things.TryStack(held.Thing);
4788 if (!flag && things.IsOverflowing())
4789 {
4790 if (IsPC)
4791 {
4792 Say("backpack_full_drop", held);
4793 SE.Drop();
4794 }
4795 DropHeld();
4796 return;
4797 }
4798 if (msg)
4799 {
4800 PlaySound("pick_thing");
4801 Say("pick_held", this, card);
4802 if (IsPC && card.id == "statue_weird")
4803 {
4804 Say("statue_pick");
4805 }
4806 }
4807 if (IsPC)
4808 {
4809 WidgetHotbar.dirtyCurrentItem = true;
4810 if (!flag)
4811 {
4813 if (held.GetRootCard() != EClass.pc)
4814 {
4815 Pick(held.Thing, msg: false);
4816 }
4817 }
4818 }
4819 held = null;
4820 }
int invY
Definition: Card.cs:2007
bool IsHotItem
Definition: Card.cs:122
Card DropHeld(Point dropPos=null)
Definition: Chara.cs:4839
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 4522 of file Chara.cs.

4523 {
4524 if (num != 0)
4525 {
4526 PickOrDrop(p, ThingGen.Create(idThing, idMat).SetNum(num), msg);
4527 }
4528 }

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

Referenced by Map.MineObj(), OnBanish(), TraitBook.OnRead(), ConSuspend.OnRemoved(), TraitMannequin.OnUse(), FoodEffect.Proc(), TraitCanvas.TrySetAct(), and Map.TrySmoothPick().

◆ PickOrDrop() [2/2]

void Chara.PickOrDrop ( Point  p,
Thing  t,
bool  msg = true 
)
inline

Definition at line 4530 of file Chara.cs.

4531 {
4532 if (things.GetDest(t).IsValid)
4533 {
4534 Pick(t, msg);
4535 }
4536 else
4537 {
4538 EClass._zone.AddCard(t, p);
4539 }
4540 }

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

◆ Refresh()

void Chara.Refresh ( bool  calledRecursive = false)
inline

Definition at line 1796 of file Chara.cs.

1797 {
1798 if (source == null)
1799 {
1800 Debug.LogError("source is null");
1801 SetSource();
1802 }
1803 if (ride != null && ride.source != null)
1804 {
1805 ride.Refresh(calledRecursive: true);
1806 }
1807 hasTelepathy = false;
1808 isWet = false;
1809 _isLevitating = HasElement(401) || (ride != null && ride._isLevitating);
1811 isWeakToSunlight = HasElement(1251) && !HasElement(431);
1812 base.isHidden = HasElement(415);
1813 isAstralBody = HasElement(1430);
1814 foreach (Condition condition in conditions)
1815 {
1816 condition.OnRefresh();
1817 }
1818 if (isWet)
1819 {
1820 base.isHidden = false;
1821 }
1823 SetDirtySpeed();
1824 if (host != null && !calledRecursive && host.source != null)
1825 {
1826 host.Refresh(calledRecursive: true);
1827 }
1828 }
virtual void OnRefresh()
bool isWet
Definition: Chara.cs:144
bool isAstralBody
Definition: Chara.cs:156
override void SetSource()
Definition: Chara.cs:2244
bool IsUndead
Definition: Chara.cs:938
bool IsHorror
Definition: Chara.cs:962
bool IsMachine
Definition: Chara.cs:950

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

Referenced by _MakeAlly(), DNA.Apply(), ElementContainerFaction.CheckDirty(), CharaBody.Equip(), HealAll(), Condition.Kill(), MakeMinion(), OnCreate(), OnDeserialized(), Game.OnLoad(), Player.OnLoad(), Player.OnStartNewGame(), Refresh(), ActRide.Ride(), CharaBody.Unequip(), UnmakeMinion(), and ActRide.Unride().

◆ RefreshFaithElement()

void Chara.RefreshFaithElement ( )
inline

Definition at line 10742 of file Chara.cs.

10743 {
10744 if (faithElements != null)
10745 {
10747 }
10749 if (idFaith == "eyth" && !HasElement(1228))
10750 {
10751 return;
10752 }
10753 SourceReligion.Row row = EClass.sources.religions.map.TryGetValue(idFaith);
10754 if (row == null)
10755 {
10756 return;
10757 }
10759 if (!HasCondition<ConExcommunication>())
10760 {
10761 SourceElement.Row row2 = EClass.sources.elements.alias.TryGetValue("featGod_" + row.id + "1");
10762 if (row2 != null)
10763 {
10764 faithElements.SetBase(row2.id, 1);
10765 }
10766 int[] array = row.elements;
10767 int num = GetPietyValue() * (120 + Evalue(1407) * 15 + Evalue(1228) * 20) / 100;
10768 for (int i = 0; i < array.Length; i += 2)
10769 {
10770 int num2 = array[i + 1] * num / 50;
10771 if (array[i] == 79)
10772 {
10773 num2 = EClass.curve(num2, array[i + 1] * 2, 10, 50);
10774 }
10775 if (num2 >= 20 && array[i] >= 950 && array[i] < 970)
10776 {
10777 num2 = 20;
10778 }
10779 faithElements.SetBase(array[i], Mathf.Max(num2, 1));
10780 }
10781 }
10783 }
string idFaith
Definition: Chara.cs:235
ElementContainer faithElements
Definition: Chara.cs:38
int GetPietyValue()
Definition: Chara.cs:10733
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(), DNA.Apply(), Religion.JoinFaith(), Religion.LeaveFaith(), ReligionEyth.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 2034 of file Chara.cs.

2035 {
2036 if (currentZone != EClass._zone)
2037 {
2038 dirtySpeed = true;
2039 return;
2040 }
2041 if (ride != null && !ride.IsDeadOrSleeping)
2042 {
2044 _Speed = ride._Speed;
2045 info?.AddText("rideSpeed".lang(_Speed.ToString() ?? ""));
2046 }
2047 else if (host != null)
2048 {
2049 if (host.ride == this)
2050 {
2051 _Speed = Evalue(79);
2052 int a = Evalue(1423);
2053 int num = ((!HasElement(495)) ? 1 : 3);
2054 int value = 100 + (int)_Speed * ((Ridability != Ridability.BadRide) ? 1 : 5) * Mathf.Max(a, 1) / num - base.STR - host.EvalueRiding() * 2 - ((Ridability == Ridability.GoodRide) ? 50 : 0);
2055 _Speed = _Speed * 100 / Mathf.Clamp(value, 100, 1000);
2056 }
2057 else
2058 {
2059 _Speed = (Evalue(79) + host.Evalue(79)) / 2;
2060 }
2061 }
2062 else
2063 {
2064 _Speed = Evalue(79) + Evalue(407) / 2;
2065 }
2066 if (body.GetSlot(37, onlyEmpty: false)?.thing != null && HasElement(1209) && !HasElement(419))
2067 {
2068 _Speed -= 25L;
2069 info?.AddText(-25L, EClass.sources.elements.map[1209].GetName());
2070 }
2071 if (parasite != null)
2072 {
2073 long speed = _Speed;
2074 int num2 = ((!HasElement(495)) ? 1 : 3);
2075 _Speed = _Speed * 100 / Mathf.Clamp(120 + parasite.LV * 2 / num2 - base.STR - Evalue(227) * 2, 100, 1000);
2076 info?.AddText(_Speed - speed, "parasiteSpeed".lang());
2077 }
2078 if (_Speed < elements.ValueWithoutLink(79) / 3)
2079 {
2081 info?.AddText("minSpeed".lang((elements.ValueWithoutLink(79) / 3).ToString() ?? ""));
2082 }
2083 int num3 = 100;
2084 if (EClass._zone.map != null && (EClass._zone.IsUnderwater || (base.Cell.IsTopWaterAndNoSnow && !base.Cell.isFloating)))
2085 {
2086 int num4 = Evalue(200);
2087 int num5 = Evalue(1252);
2088 num3 = 50 + Mathf.Clamp((int)Mathf.Sqrt(num4) * 5 - EClass._zone.DangerLv / 50, (num5 > 0) ? 50 : ((base.IsPowerful || IsMultisize) ? 40 : 0), 50) + Mathf.Clamp((int)Mathf.Sqrt(num4), 0, 25);
2089 if (info != null && num3 != 100)
2090 {
2091 info.AddFix(num3 - 100, EClass.sources.elements.map[200].GetName().ToTitleCase());
2092 }
2093 if (num5 > 0)
2094 {
2095 num3 += num5 * 20;
2096 info?.AddFix(num5 * 20, EClass.sources.elements.map[1252].GetName().ToTitleCase());
2097 }
2098 }
2099 if (IsPCFaction)
2100 {
2101 switch (burden.GetPhase())
2102 {
2103 case 1:
2104 num3 -= 10;
2105 info?.AddFix(-10, burden.GetPhaseStr());
2106 break;
2107 case 2:
2108 num3 -= 20;
2109 info?.AddFix(-20, burden.GetPhaseStr());
2110 break;
2111 case 3:
2112 num3 -= 30;
2113 info?.AddFix(-30, burden.GetPhaseStr());
2114 break;
2115 case 4:
2116 num3 -= (IsPC ? 50 : 100);
2117 info?.AddFix(IsPC ? (-50) : (-100), burden.GetPhaseStr());
2118 break;
2119 }
2120 if (IsPC)
2121 {
2122 switch (stamina.GetPhase())
2123 {
2124 case 1:
2125 num3 -= 10;
2126 info?.AddFix(-10, stamina.GetPhaseStr());
2127 break;
2128 case 0:
2129 num3 -= 20;
2130 info?.AddFix(-20, stamina.GetPhaseStr());
2131 break;
2132 }
2133 switch (sleepiness.GetPhase())
2134 {
2135 case 2:
2136 num3 -= 10;
2137 info?.AddFix(-10, sleepiness.GetPhaseStr());
2138 break;
2139 case 3:
2140 num3 -= 20;
2141 info?.AddFix(-20, sleepiness.GetPhaseStr());
2142 break;
2143 }
2144 switch (hunger.GetPhase())
2145 {
2146 case 3:
2147 case 4:
2148 num3 -= 10;
2149 info?.AddFix(-10, hunger.GetPhaseStr());
2150 break;
2151 case 5:
2152 num3 -= 30;
2153 info?.AddFix(-30, hunger.GetPhaseStr());
2154 break;
2155 }
2156 num3 += EClass.player.lastEmptyAlly * Evalue(1646);
2157 info?.AddFix(EClass.player.lastEmptyAlly * Evalue(1646), EClass.sources.elements.map[1646].GetName());
2158 }
2160 {
2161 num3 += EClass.player.lastEmptyAlly * 10 - 10;
2162 info?.AddFix(EClass.player.lastEmptyAlly * 10 - 10, "exceedParty".lang());
2163 }
2164 }
2165 else if (base.LV >= 1000 && !EClass.game.principal.disableVoidBlessing && !base.IsPCFactionOrMinion)
2166 {
2167 num3 += EClass.curve((base.LV - 900) / 100 * 10, 500, 100);
2168 info?.AddFix(EClass.curve((base.LV - 900) / 100 * 10, 500, 100), "enemySpeedBuff".lang());
2169 }
2170 if (HasCondition<ConGravity>())
2171 {
2172 num3 -= 30;
2173 info?.AddFix(-30, GetCondition<ConGravity>().Name);
2174 }
2175 if (_Speed < 10)
2176 {
2177 _Speed = 10L;
2178 }
2179 _Speed = _Speed * num3 / 100;
2180 if (_Speed < 10)
2181 {
2182 _Speed = 10L;
2183 info?.AddText("minSpeed".lang(10.ToString() ?? ""));
2184 }
2185 dirtySpeed = false;
2186 }
Ridability
Definition: Ridability.cs:2
Thing thing
Definition: BodySlot.cs:8
override string ToString()
Definition: Chara.cs:1231
bool dirtySpeed
Definition: Chara.cs:174
long _Speed
Definition: Chara.cs:176
void AddText(string text, FontColor col=FontColor.Warning)
Definition: ELEMENT.cs:115
void AddFix(int v, string text)
Definition: ELEMENT.cs:136
bool disableVoidBlessing
int lastEmptyAlly
Definition: Player.cs:1263

References _Speed, EClass._zone, body, burden, currentZone, 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, 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 9523 of file Chara.cs.

9524 {
9525 if (workElements != null)
9526 {
9528 }
9529 workElements = null;
9530 if (IsPCParty || homeBranch == null || homeBranch.owner == null)
9531 {
9532 return;
9533 }
9534 foreach (Hobby item in ListHobbies())
9535 {
9536 TryAdd(item);
9537 }
9538 foreach (Hobby item2 in ListWorks())
9539 {
9540 TryAdd(item2);
9541 }
9542 if (workElements != null)
9543 {
9545 }
9546 void TryAdd(Hobby h)
9547 {
9548 if (!h.source.elements.IsEmpty())
9549 {
9550 if (workElements == null)
9551 {
9553 }
9554 for (int i = 0; i < h.source.elements.Length; i += 2)
9555 {
9556 int num = h.source.elements[i];
9557 int num2 = h.source.elements[i + 1];
9558 int num3 = 100;
9559 if (num != 2115 && num != 2207)
9560 {
9561 num3 = h.GetEfficiency(this) * homeBranch.efficiency / 100;
9562 if (num3 <= 0)
9563 {
9564 continue;
9565 }
9566 }
9567 workElements.ModBase(num, (num2 < 0) ? (num2 / 10) : Mathf.Max(1, h.source.elements[i + 1] * num3 / 1000));
9568 }
9569 }
9570 }
9571 }
ElementContainer workElements
Definition: Chara.cs:40
int GetEfficiency(Chara c)
Definition: Hobby.cs:31

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

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

◆ RemoveAllStances()

void Chara.RemoveAllStances ( )
inline

Definition at line 10166 of file Chara.cs.

10167 {
10168 for (int num = conditions.Count - 1; num >= 0; num--)
10169 {
10170 Condition condition = conditions[num];
10171 if (condition.Type == ConditionType.Stance)
10172 {
10173 condition.Kill();
10174 }
10175 }
10176 }

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

Referenced by DNA.Apply(), and Religion.LeaveFaith().

◆ RemoveCondition< T >()

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

Definition at line 10017 of file Chara.cs.

10017 : Condition
10018 {
10019 for (int num = conditions.Count - 1; num >= 0; num--)
10020 {
10021 if (conditions[num] is T)
10022 {
10023 conditions[num].Kill();
10024 break;
10025 }
10026 }
10027 }

References Condition.Kill().

◆ RemoveGlobal()

void Chara.RemoveGlobal ( )
inline

◆ RemoveLastBodyPart()

void Chara.RemoveLastBodyPart ( bool  msg = false)
inline

Definition at line 2383 of file Chara.cs.

2384 {
2385 if (body.slots.Count != 0)
2386 {
2387 BodySlot bodySlot = body.slots.LastItem();
2388 body.RemoveBodyPartAt(body.slots.Count - 1);
2389 if (msg)
2390 {
2391 Say("lose_bodyparts", this, Element.Get(bodySlot.elementId).GetName().ToLower());
2392 PlaySound("offering");
2393 }
2394 }
2395 }
int elementId
Definition: BodySlot.cs:6
void RemoveBodyPartAt(int idx)
Definition: CharaBody.cs:344

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

Referenced by TraitFoodEggFertilized.Incubate().

◆ RequestProtection()

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

Definition at line 8859 of file Chara.cs.

8860 {
8861 if (HasCondition<StanceTaunt>() || base.isRestrained || attacker == this)
8862 {
8863 return false;
8864 }
8865 if (host != null && host.isRestrained)
8866 {
8867 return false;
8868 }
8869 if (base.IsPCFactionOrMinion && attacker.IsPCFactionOrMinion)
8870 {
8871 return false;
8872 }
8873 bool flag = false;
8874 foreach (Chara chara in EClass._map.charas)
8875 {
8876 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) || chara.HasElement(1277))
8877 {
8878 continue;
8879 }
8880 bool flag2 = chara.HasElement(1225) && !chara.GetBool(126);
8881 if ((!flag2 && (flag || EClass.rnd(2) == 0 || !chara.HasCondition<StanceTaunt>())) || chara.HasCooldown(1225))
8882 {
8883 continue;
8884 }
8885 int num = Mathf.Max(chara.Evalue(1649), (!flag2) ? 1 : 3);
8886 int num2 = Dist(chara);
8887 if (num2 > 25)
8888 {
8889 continue;
8890 }
8891 if (num2 > num || !chara.CanSeeLos(pos, num2))
8892 {
8893 if (!flag2)
8894 {
8895 continue;
8896 }
8897 Point nearestPoint = pos.GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: true, ignoreCenter: true);
8898 if (!nearestPoint.IsValid)
8899 {
8900 continue;
8901 }
8902 chara.Teleport(nearestPoint);
8903 chara.AddCooldown(1225, 10);
8904 num2 = Dist(chara);
8905 Say("intercept_loyal", chara, this);
8906 chara.SetEnemy(attacker);
8907 attacker.SetEnemy(chara);
8908 if (num2 > num || !chara.CanSeeLos(pos, num2))
8909 {
8910 continue;
8911 }
8912 }
8913 if (!flag && !HasElement(1225))
8914 {
8915 Say("intercept", chara, this);
8916 if (EClass.rnd(10) == 0)
8917 {
8918 chara.Talk("intercept", base.NameSimple);
8919 }
8920 if (attacker.enemy == this)
8921 {
8922 attacker.SetEnemy(chara);
8923 }
8924 action(chara);
8925 flag = true;
8926 }
8927 }
8928 return flag;
8929 }
void Teleport(Point point, bool silent=false, bool force=false)
Definition: Card.cs:6162
ConSuspend conSuspend
Definition: Chara.cs:104
void AddCooldown(int idEle, int turns=0)
Definition: Chara.cs:9174
bool HasCooldown(int idEle)
Definition: Chara.cs:9225

References EClass._map, AddCooldown(), CanSeeLos(), Map.charas, conSuspend, enemy, Card.Evalue(), Card.GetBool(), Point.GetNearestPoint(), HasCondition(), HasCooldown(), Card.HasElement(), host, IsDisabled, IsFriendOrAbove(), 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 9617 of file Chara.cs.

9618 {
9619 if (_hobbies != null && _works != null)
9620 {
9621 _hobbies.Clear();
9622 _works.Clear();
9623 }
9624 else
9625 {
9626 _hobbies = new List<int>();
9627 _works = new List<int>();
9628 }
9629 if (source.hobbies.IsEmpty())
9630 {
9631 AddHobby(EClass.sources.hobbies.listHobbies.RandomItem().id);
9632 }
9633 else
9634 {
9635 string[] hobbies = source.hobbies;
9636 foreach (string text in hobbies)
9637 {
9638 if (EClass.sources.hobbies.alias.TryGetValue(text.Trim(), out var value))
9639 {
9640 AddHobby(value.id);
9641 continue;
9642 }
9643 ModUtil.LogModError("source chara row '" + source.id + "' has invalid hobby '" + text + "'", source);
9644 }
9645 }
9646 if (source.works.IsEmpty())
9647 {
9648 AddWork(EClass.sources.hobbies.listWorks.RandomItem().id);
9649 }
9650 else
9651 {
9652 string[] hobbies = source.works;
9653 foreach (string text2 in hobbies)
9654 {
9655 if (EClass.sources.hobbies.alias.TryGetValue(text2.Trim(), out var value2))
9656 {
9657 AddWork(value2.id);
9658 continue;
9659 }
9660 ModUtil.LogModError("source chara row '" + source.id + "' has invalid work '" + text2 + "'", source);
9661 }
9662 }
9664 }
WorkSummary GetWorkSummary()
Definition: Chara.cs:9666
void AddWork(int id)
Definition: Chara.cs:9605
void AddHobby(int id)
Definition: Chara.cs:9593
List< Row > listWorks
Definition: SourceHobby.cs:112
List< Row > listHobbies
Definition: SourceHobby.cs:109
void Reset()
Definition: WorkSummary.cs:78

References SourceChara.Row.hobbies, SourceManager.hobbies, CardRow.id, SourceHobby.listHobbies, SourceHobby.listWorks, EClass.sources, and SourceChara.Row.works.

Referenced by OnCreate().

◆ ResetBody()

void Chara.ResetBody ( )
inline

Definition at line 2397 of file Chara.cs.

2398 {
2399 for (int num = body.slots.Count - 1; num >= 0; num--)
2400 {
2401 BodySlot bodySlot = body.slots[num];
2402 if (bodySlot.elementId == 45 || bodySlot.elementId == 40)
2403 {
2404 return;
2405 }
2406 body.RemoveBodyPart(num);
2407 }
2408 string[] array = race.figure.Split('|');
2409 foreach (string s in array)
2410 {
2411 int num2 = ParseBodySlot(s);
2412 if (num2 != -1)
2413 {
2414 body.AddBodyPart(num2);
2415 }
2416 }
2418 }

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

◆ ResetUpgrade()

void Chara.ResetUpgrade ( )
inline

Definition at line 9059 of file Chara.cs.

9060 {
9061 _ = base.c_upgrades;
9062 }

Referenced by CoreDebug.ResetPetUpgrades().

◆ ResistCon()

void Chara.ResistCon ( Condition  con)
inline

Definition at line 10223 of file Chara.cs.

10224 {
10225 if (con.power > 0 && resistCon != null)
10226 {
10227 int a = ClassExtension.TryGetValue<int, int>((IDictionary<int, int>)resistCon, con.id, 0);
10228 if (1000 < EClass.rnd(a))
10229 {
10230 con.power = 0;
10231 }
10232 else if (500 < EClass.rnd(a))
10233 {
10234 con.power /= 5;
10235 }
10236 else if (200 < EClass.rnd(a))
10237 {
10238 con.power /= 3;
10239 }
10240 else if (100 < EClass.rnd(a))
10241 {
10242 con.power /= 2;
10243 }
10244 }
10245 }

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

◆ RestockEquip()

void Chara.RestockEquip ( bool  onCreate)
inline

Definition at line 4931 of file Chara.cs.

4932 {
4933 string equip = source.equip;
4934 if (equip.IsEmpty())
4935 {
4936 equip = job.equip;
4937 }
4938 if (equip == "none")
4939 {
4940 return;
4941 }
4942 bool flag = true;
4943 switch (id)
4944 {
4945 case "kettle":
4946 case "quru":
4947 case "loytel":
4948 case "shojo":
4949 EQ_ID("staff_long", 1);
4950 EQ_CAT("head");
4951 EQ_CAT("torso");
4952 EQ_CAT("arm");
4953 return;
4954 case "adv_yukiimo":
4955 if (onCreate)
4956 {
4957 EQ_ID("tail_snowleopard");
4958 }
4959 break;
4960 case "adv_kiria":
4961 if (onCreate)
4962 {
4963 EQ_ID("sword_zephir");
4964 }
4965 break;
4966 case "adv_mesherada":
4967 if (onCreate)
4968 {
4969 EQ_ID("dagger_hathaway");
4970 }
4971 break;
4972 case "adv_verna":
4973 if (onCreate)
4974 {
4975 EQ_ID("staff_long", -1, Rarity.Legendary);
4976 }
4977 if (onCreate)
4978 {
4979 EQ_ID("cloak_wing", -1, Rarity.Mythical);
4980 }
4981 break;
4982 case "big_sister":
4983 if (onCreate)
4984 {
4985 EQ_ID("sword_muramasa");
4986 }
4987 break;
4988 case "adv_gaki":
4989 if (onCreate)
4990 {
4991 EQ_ID("dagger_gaki");
4992 }
4993 if (onCreate)
4994 {
4995 EQ_ID("dagger_ninto");
4996 }
4997 break;
4998 case "adv_ivory":
4999 EQ_ID("dagger", -1, Rarity.Legendary);
5000 AddThing("60");
5001 break;
5002 case "adv_wini":
5003 if (onCreate)
5004 {
5005 EQ_ID("staff_Cat", -1, Rarity.Mythical);
5006 }
5008 if (onCreate)
5009 {
5010 AddThing("1071");
5011 }
5012 break;
5013 case "mamani":
5014 EQ_ID("lightsaber_double", -1, Rarity.Mythical);
5015 if (onCreate)
5016 {
5017 EQ_ID("cloak_mani2");
5018 EQ_ID("boots_dal");
5019 AddThing("gun_gravity2");
5020 AddThing("gun_mani");
5021 }
5022 break;
5023 case "namamani":
5024 if (onCreate)
5025 {
5026 AddThing("gun_gravity2");
5027 }
5028 break;
5029 case "lomias":
5030 if (onCreate)
5031 {
5032 AddThing("bow_vindale");
5033 }
5034 break;
5035 case "unseenhand":
5036 if (onCreate)
5037 {
5038 EQ_ID("martial_ring");
5039 }
5040 break;
5041 case "larnneire":
5042 if (onCreate)
5043 {
5044 EQ_ID("EtherDagger2");
5045 }
5046 break;
5047 case "keeper_garden":
5048 if (!body.HasWeapon())
5049 {
5050 EQ_ID("sword_ragnarok");
5051 }
5052 break;
5053 case "ungaga_pap":
5054 if (onCreate)
5055 {
5056 EQ_ID("axe_destruction");
5057 }
5058 break;
5059 case "lurie_boss":
5060 if (onCreate)
5061 {
5062 EQ_ID("ribbon_duponne");
5063 }
5064 break;
5065 case "seeker":
5066 if (onCreate)
5067 {
5068 EQ_ID("helm_seeker");
5069 }
5070 EQ_ID("robe_pope");
5071 EQ_ID("sword_katana");
5072 EQ_ID("staff");
5073 EQ_ID("sword_katana");
5074 if (onCreate)
5075 {
5076 EQ_ID("boots_seven");
5077 }
5078 if (onCreate)
5079 {
5080 for (int i = 0; i < 20; i++)
5081 {
5083 }
5084 EQ_Item("panty");
5085 AddThing("plat").SetNum(6);
5086 }
5087 break;
5088 case "ephrond":
5089 if (onCreate)
5090 {
5091 AddThing("guitar_efrond");
5092 }
5093 break;
5094 case "ashland":
5095 if (onCreate)
5096 {
5097 AddThing("guitar_ash");
5098 }
5099 break;
5100 case "swordkeeper":
5101 if (onCreate)
5102 {
5103 EQ_ID("EtherDagger");
5104 }
5105 break;
5106 case "mech_angel":
5107 if (onCreate)
5108 {
5109 Thing thing = ThingGen.Create("pole_holy");
5110 thing.SetReplica(on: true);
5111 thing.rarity = Rarity.Normal;
5112 thing.elements.SetTo(60, -15);
5113 thing.elements.SetTo(418, -100);
5114 thing.elements.SetTo(93, 50);
5115 AddThing(thing);
5116 body.Equip(thing);
5117 flag = false;
5118 }
5119 break;
5120 case "azzrasizzle":
5121 if (onCreate)
5122 {
5123 EQ_ID("staff_magius");
5124 }
5125 break;
5126 case "sorin":
5127 if (onCreate)
5128 {
5129 EQ_ID("staff_insanity");
5130 }
5131 break;
5132 case "robot":
5133 if (onCreate)
5134 {
5135 EQ_ID("sword_katana");
5136 }
5137 break;
5138 case "mimu":
5139 if (onCreate)
5140 {
5141 EQ_ID("staff_leek");
5142 }
5143 break;
5144 case "kumatan":
5145 if (onCreate)
5146 {
5147 EQ_ID("dagger_hocho");
5148 }
5149 break;
5150 case "mad_rich":
5151 if (onCreate)
5152 {
5153 int a = (EClass._zone.IsUserZone ? 200 : EClass.rndHalf(100 + (EClass.debug.enable ? 10 : EClass._zone.influence) * 50 + (int)Mathf.Sqrt(EClass._zone.DangerLv) * 100 + (int)Mathf.Sqrt(EClass.pc.FameLv) * 100 + EClass._zone.development * 10));
5154 ModCurrency(a);
5155 }
5156 break;
5157 }
5158 if (!TryEquipRanged())
5159 {
5160 switch (id)
5161 {
5162 case "tyche":
5163 case "trooper":
5164 case "mech_scarab":
5165 AddThing("gun_laser");
5166 break;
5167 case "rocketman":
5168 {
5169 Thing thing2 = AddThing("panzerfaust");
5170 thing2.ChangeMaterial("iron");
5171 thing2.c_ammo = 0;
5172 break;
5173 }
5174 default:
5175 switch (equip)
5176 {
5177 case "archer":
5178 EQ_CAT((EClass.rnd(4) == 0) ? "crossbow" : "bow");
5179 break;
5180 case "inquisitor":
5181 case "gunner":
5182 EQ_CAT("gun");
5183 break;
5184 }
5185 break;
5186 }
5187 }
5188 int num = ((base.rarity >= Rarity.Mythical) ? (base.LV * 3) : ((base.rarity >= Rarity.Legendary) ? (base.LV * 2) : base.LV));
5189 if (trait is TraitAdventurer)
5190 {
5191 num *= 3;
5192 }
5193 if (race.id == "asura")
5194 {
5195 for (int j = 0; j < 4; j++)
5196 {
5197 EQ_CAT(job.weapon.RandomItem());
5198 }
5199 }
5200 for (int k = 0; k < ((!(race.id == "mutant")) ? 1 : (2 + base.LV / 30)); k++)
5201 {
5202 if (flag)
5203 {
5204 if (source.ContainsTag("boxer"))
5205 {
5206 EQ_CAT("martial");
5207 }
5208 else if (!job.weapon.IsEmpty())
5209 {
5210 if (race.id == "mutant" || (body.slotMainHand != null && body.slotMainHand.thing == null))
5211 {
5212 EQ_CAT(job.weapon.RandomItem());
5213 }
5214 if (race.id == "mutant" || (Evalue(131) > 0 && EClass.rnd(2) == 0))
5215 {
5216 EQ_CAT(job.weapon.RandomItem());
5217 }
5218 }
5219 }
5220 EQ_CAT("torso");
5221 if (EClass.rnd(num) > 5)
5222 {
5223 EQ_CAT("arm");
5224 }
5225 if (EClass.rnd(num) > 10)
5226 {
5227 EQ_CAT("head");
5228 }
5229 if (EClass.rnd(num) > 15)
5230 {
5231 EQ_CAT("back");
5232 }
5233 if (EClass.rnd(num) > 20)
5234 {
5235 EQ_CAT("ring");
5236 }
5237 if (EClass.rnd(num) > 25)
5238 {
5239 EQ_CAT("amulet");
5240 }
5241 if (EClass.rnd(num) > 30)
5242 {
5243 EQ_CAT("foot");
5244 }
5245 if (EClass.rnd(num) > 35)
5246 {
5247 EQ_CAT("waist");
5248 }
5249 if (EClass.rnd(num) > 40)
5250 {
5251 EQ_CAT("ring");
5252 }
5253 }
5254 if (trait is TraitBard)
5255 {
5256 AddThing(ThingGen.Create("lute"));
5257 if (EClass.debug.enable || EClass.rnd(100) == 0)
5258 {
5259 EQ_ID("shield_lute");
5260 }
5261 }
5262 if (HasTag(CTAG.shield))
5263 {
5264 EQ_CAT("shield");
5265 }
5266 }
int FameLv
Definition: Card.cs:2368
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
Definition: Card.cs:3210
Card AddCard(Card c)
Definition: Card.cs:3259
void SetReplica(bool on)
Definition: Card.cs:3244
bool HasWeapon()
Definition: CharaBody.cs:400
BodySlot slotMainHand
Definition: CharaBody.cs:10
void EQ_Item(string s, int num=1)
Definition: Chara.cs:5376
Thing EQ_ID(string s, int mat=-1, Rarity r=Rarity.Random)
Definition: Chara.cs:5340
bool TryEquipRanged()
Definition: Chara.cs:8250
void EQ_CAT(string s)
Definition: Chara.cs:5360
void SetTo(int id, int v)
int development
Definition: Spatial.cs:238
int influence
Definition: Spatial.cs:214
static Thing CreateSpellbook(string alias, int num=1)
Definition: ThingGen.cs:159

References EClass._zone, Card.ChangeMaterial(), RenderRow.ContainsTag(), ThingGen.Create(), ThingGen.CreateFromCategory(), ThingGen.CreateSpellbook(), Zone.DangerLv, EClass.debug, Spatial.development, Card.elements, CoreDebug.enable, CharaBody.Equip(), SourceChara.Row.equip, SourceJob.Row.equip, Card.FameLv, CharaBody.HasWeapon(), SourceRace.Row.id, Spatial.influence, EClass.pc, EClass.rnd(), EClass.rndHalf(), 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 5268 of file Chara.cs.

5269 {
5270 switch (id)
5271 {
5272 case "lomias":
5273 if (ShouldRestock("_meat"))
5274 {
5275 AddCard(ThingGen.Create("_meat").MakeRefFrom("begger"));
5276 }
5277 break;
5278 case "fiama":
5279 Restock("book_story", 1);
5280 break;
5281 case "rock_thrower":
5282 Restock("stone", 10 + EClass.rnd(10));
5283 break;
5284 case "giant":
5285 Restock("rock", 2 + EClass.rnd(10));
5286 break;
5287 case "farris":
5288 Restock("lute", 1);
5289 Restock("book_story_home", 1);
5290 break;
5291 case "begger":
5292 break;
5293 }
5294 void Restock(string id, int num)
5295 {
5296 if (ShouldRestock(id))
5297 {
5298 AddCard(ThingGen.Create(id).SetNum(num));
5299 }
5300 }
5301 bool ShouldRestock(string id)
5302 {
5303 return things.Find(id) == null;
5304 }
5305 }

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

◆ Revive()

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

Definition at line 5419 of file Chara.cs.

5420 {
5421 if (!isDead)
5422 {
5423 return;
5424 }
5425 isDead = false;
5426 base.hp = MaxHP / 3;
5427 mana.value = 0;
5428 stamina.value = 0;
5429 if (hunger.value > 30)
5430 {
5431 hunger.value = 30;
5432 }
5433 sleepiness.value = 0;
5435 RemoveCondition<StanceTaunt>();
5436 if (id == "keeper_garden")
5437 {
5438 SaiyanRevive();
5439 }
5440 if (IsPC)
5441 {
5443 {
5444 Msg.Say("noDeathPenalty2", this);
5445 }
5447 {
5448 Msg.Say("noDeathPenalty", this);
5449 }
5450 else
5451 {
5453 }
5454 List<Thing> dropList = new List<Thing>();
5455 EClass.pc.things.Foreach(delegate(Thing t)
5456 {
5458 {
5459 t.ignoreAutoPick = true;
5460 dropList.Add(t);
5461 }
5462 }, onlyAccessible: false);
5463 foreach (Thing item in dropList)
5464 {
5466 Msg.Say("backpack_full_drop", item);
5467 }
5468 EClass.player.preventDeathPenalty = false;
5469 }
5470 if (IsPCFaction && homeBranch != null)
5471 {
5472 homeBranch.Log("bRevive", this);
5473 }
5474 if (p != null)
5475 {
5476 if (!p.IsInBounds)
5477 {
5479 }
5480 EClass._zone.AddCard(this, p);
5481 if (msg)
5482 {
5483 SE.Play("revive");
5484 Msg.Say("revive", this);
5485 PlayEffect("revive");
5486 }
5487 SetCensored(enable: false);
5488 }
5489 }
void SetCensored(bool enable)
Definition: Card.cs:8214
Card parentCard
Definition: Card.cs:106
void SaiyanRevive()
Definition: Chara.cs:5491
void ApplyDeathPenalty()
Definition: Chara.cs:5525
bool disableDeathPenaltyProtection
Point GetCenterPos()
Definition: MapBounds.cs:52
int days
Definition: Player.cs:75
bool preventDeathPenalty
Definition: Player.cs:1237
void Foreach(Action< Thing > action, bool onlyAccessible=true)
override int SelfWeight
Definition: Thing.cs:64

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

3739 {
3740 if (renderer.hasActor)
3741 {
3742 base.dir = (base.dir + ((!reverse) ? 1 : (-1))).Clamp(0, 3, loop: true);
3743 }
3744 else
3745 {
3746 base.dir = ((base.dir == 0) ? 1 : 0);
3747 }
3748 UpdateAngle();
3750 }

Referenced by AI_Dance.Run().

◆ SaiyanRevive()

void Chara.SaiyanRevive ( )
inline

Definition at line 5491 of file Chara.cs.

5492 {
5493 ModCorruption(-100000);
5494 if (base.LV < 10000000)
5495 {
5496 SetLv(base.LV * 10 + 9);
5497 }
5498 Refresh();
5499 base.hp = MaxHP;
5500 mana.value = mana.max;
5501 stamina.value = stamina.max;
5502 bossText = true;
5503 }
void ModCorruption(int a)
Definition: Chara.cs:10370

References Stats.max.

◆ ScaleByPrincipal()

Chara Chara.ScaleByPrincipal ( )
inline

◆ SetAI()

AIAct Chara.SetAI ( AIAct  g)
inline

Definition at line 9393 of file Chara.cs.

9394 {
9395 if (IsPC)
9396 {
9398 }
9399 if (ai.IsRunning)
9400 {
9401 if (ai == g && ai.IsNoGoal)
9402 {
9403 return g;
9404 }
9405 ai.Cancel();
9406 if (ai == g)
9407 {
9408 Debug.Log("goal is g:" + ai?.ToString() + "/" + this);
9409 return g;
9410 }
9411 }
9412 if (HasCondition<ConWait>())
9413 {
9414 RemoveCondition<ConWait>();
9415 }
9416 ai = g;
9417 ai.SetOwner(this);
9418 if (IsPC)
9419 {
9421 }
9422 return g;
9423 }
virtual bool IsNoGoal
Definition: AIAct.cs:74
void SetOwner(Chara c)
Definition: AIAct.cs:189
QueueManager queues
Definition: Player.cs:1281
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.Activate(), Zone.AddCard(), Thing.DoAct(), UIInventory.DoAct(), Player.EndTurn(), GiveGift(), TraitTrolley.OnActivateTrap(), BaseListPeople.OnClick(), LayerCraft.OnClickCraft(), OnCreate(), ZoneInstanceBout.OnLeaveZone(), AM_Paint.OnUpdateInput(), ActBloodsuck.Perform(), ActNTR.Perform(), ActRanged.Perform(), ActRestrain.Perform(), ActSlime.Perform(), ActPlan.Item.Perform(), LayerCraftFloat.RefreshCraft(), AI_Idle.Run(), GoalSpot.Run(), ZoneEventSiege.ShouldEnd(), Zone.Simulate(), ConSleep.SuccubusVisit(), ActThrow.Throw(), TaskManager.Designations.TryRemoveDesignation(), InvOwnerCraft.TryStartCraft(), and GoalWork.TryWork().

◆ SetAIAggro()

void Chara.SetAIAggro ( )
inline

Definition at line 9383 of file Chara.cs.

9384 {
9385 SetAI(new GoalCombat());
9386 }

Referenced by ZoneEventQuest.AggroEnemy().

◆ SetAIIdle()

void Chara.SetAIIdle ( )
inline

Definition at line 9379 of file Chara.cs.

9380 {
9381 }

◆ SetAIImmediate()

void Chara.SetAIImmediate ( AIAct  g)
inline

◆ SetCooldown()

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

Definition at line 9192 of file Chara.cs.

9193 {
9194 if (_cooldowns == null)
9195 {
9196 _cooldowns = new List<int>();
9197 }
9198 bool flag = false;
9199 for (int i = 0; i < _cooldowns.Count; i++)
9200 {
9201 if (_cooldowns[i] / 1000 == idEle)
9202 {
9203 if (turns == 0)
9204 {
9205 _cooldowns.RemoveAt(i);
9206 }
9207 else
9208 {
9209 _cooldowns[i] = idEle * 1000 + turns;
9210 }
9211 flag = true;
9212 break;
9213 }
9214 }
9215 if (!flag && turns > 0)
9216 {
9217 AddCooldown(idEle, turns);
9218 }
9219 if (_cooldowns.Count == 0)
9220 {
9221 _cooldowns = null;
9222 }
9223 }

Referenced by ConTransmuteBat.OnRemoved().

◆ SetDir()

override void Chara.SetDir ( int  d)
inlinevirtual

Reimplemented from Card.

Definition at line 3731 of file Chara.cs.

3732 {
3733 base.dir = d;
3734 UpdateAngle();
3736 }

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

◆ SetDirtySpeed()

void Chara.SetDirtySpeed ( )
inline

Definition at line 2025 of file Chara.cs.

2026 {
2027 dirtySpeed = true;
2028 if (host != null)
2029 {
2031 }
2032 }

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

6620 {
6621 enemy = c;
6622 if (c == null)
6623 {
6624 if (ai is GoalCombat)
6625 {
6626 ai.Cancel();
6627 }
6628 }
6629 else
6630 {
6631 calmCheckTurn = 10 + EClass.rnd(30);
6632 }
6633 return c;
6634 }

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

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

◆ SetEQQuality()

void Chara.SetEQQuality ( )
inlineprivate

Definition at line 5307 of file Chara.cs.

5308 {
5310 Rarity rarity = Rarity.Normal;
5311 int num = ((base.LV >= 1000) ? 7 : ((base.LV >= 500) ? 5 : ((base.LV >= 250) ? 3 : ((base.LV >= 100) ? 2 : ((base.LV >= 50) ? 1 : 0)))));
5312 Rarity rarity2 = base.rarity;
5313 if (id == "big_sister")
5314 {
5315 num = (isOnCreate ? 8 : 4);
5316 }
5317 if (!isOnCreate && EClass.rnd(10) != 0)
5318 {
5319 num /= 2;
5320 }
5321 if (rarity2 == Rarity.Superior && EClass.rnd(10) <= num)
5322 {
5323 rarity = Rarity.Superior;
5324 }
5325 else if (rarity2 == Rarity.Legendary)
5326 {
5327 rarity = ((EClass.rnd(10) <= num) ? Rarity.Legendary : ((EClass.rnd(5) <= num) ? Rarity.Superior : Rarity.Normal));
5328 }
5329 else if (rarity2 >= Rarity.Mythical)
5330 {
5331 rarity = ((EClass.rnd(30) <= num) ? Rarity.Mythical : ((EClass.rnd(10) > num) ? Rarity.Superior : Rarity.Legendary));
5332 }
5333 if (rarity == Rarity.Normal && EClass.rnd(1000) == 0)
5334 {
5335 rarity = Rarity.Legendary;
5336 }
5337 CardBlueprint.current.rarity = rarity;
5338 }
static void Set(CardBlueprint _bp=null)
static CardBlueprint CharaGenEQ
static bool isOnCreate
Definition: Chara.cs:188

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

◆ SetFaction()

Chara Chara.SetFaction ( Faction  f)
inline

Definition at line 1490 of file Chara.cs.

1491 {
1492 _faction = null;
1493 faction = f;
1495 return this;
1496 }
Faction _faction
Definition: Chara.cs:160
Hostility GetHostility()
Definition: FACTION.cs:255

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

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

◆ SetFaith() [1/2]

void Chara.SetFaith ( Religion  r)
inline

Definition at line 1781 of file Chara.cs.

1782 {
1783 faith = r;
1785 }

References faith, and RefreshFaithElement().

◆ SetFaith() [2/2]

void Chara.SetFaith ( string  id)
inline

Definition at line 1776 of file Chara.cs.

1777 {
1779 }
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 10428 of file Chara.cs.

10429 {
10430 Feat feat = elements.GetElement(id) as Feat;
10431 int num = 0;
10432 if (feat != null && feat.Value > 0)
10433 {
10434 if (value == feat.Value)
10435 {
10436 return;
10437 }
10438 num = feat.Value;
10439 feat.Apply(-feat.Value, elements);
10440 }
10441 feat = elements.SetBase(id, value - (feat?.vSource ?? 0)) as Feat;
10442 if (feat.Value != 0)
10443 {
10444 feat.Apply(feat.Value, elements);
10445 }
10447 {
10448 Refresh();
10450 }
10451 if (!msg)
10452 {
10453 return;
10454 }
10455 if (feat.source.textInc.IsEmpty())
10456 {
10457 PlaySound("ding_skill");
10459 Say("gainFeat", this, feat.FullName);
10460 }
10461 else
10462 {
10463 bool flag = value < num;
10464 if (feat.source.tag.Contains("neg"))
10465 {
10466 flag = !flag;
10467 }
10468 switch (id)
10469 {
10470 case 1270:
10471 if (!flag)
10472 {
10473 PlaySound("chime_angel");
10474 }
10475 break;
10476 case 1271:
10477 if (!flag)
10478 {
10479 PlaySound("chime_devil");
10480 }
10481 break;
10482 default:
10483 PlaySound("mutation");
10484 break;
10485 }
10487 Say((value > num) ? feat.source.GetText("textInc") : feat.source.GetText("textDec"), this, feat.FullName);
10488 }
10490 }
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, Msg.SetColor(), Element.source, and Element.Value.

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

◆ SetGlobal() [1/2]

Chara Chara.SetGlobal ( )
inline

Definition at line 1557 of file Chara.cs.

1558 {
1559 if (!IsGlobal)
1560 {
1562 global = new GlobalData();
1563 base.isSubsetCard = false;
1564 enemy = null;
1565 base.c_uidMaster = 0;
1566 }
1567 return this;
1568 }

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

1543 {
1544 SetGlobal();
1545 homeZone = _home;
1546 _home.AddCard(this, x, z);
1547 global.transition = new ZoneTransition
1548 {
1549 state = ZoneTransition.EnterState.Exact,
1550 x = x,
1551 z = z
1552 };
1553 orgPos = new Point(x, z);
1554 return this;
1555 }

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

◆ SetHostility()

Chara Chara.SetHostility ( Hostility  h)
inline

Definition at line 1505 of file Chara.cs.

1506 {
1507 Hostility hostility2 = (base.c_originalHostility = h);
1508 this.hostility = hostility2;
1509 return this;
1510 }

Referenced by Card.HatchEgg(), 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 2265 of file Chara.cs.

2266 {
2267 if (base.c_idMainElement != 0)
2268 {
2269 SetElements(base.c_idMainElement, remove: true);
2270 base.c_idMainElement = 0;
2271 }
2272 if (id != 0)
2273 {
2274 _ = EClass.sources.elements.map[id];
2275 SetElements(id, remove: false);
2276 base.c_idMainElement = id;
2277 if (elemental)
2278 {
2279 base.isElemental = true;
2280 _colorInt = 0;
2281 Color colorSprite = EClass.setting.elements[MainElement.source.alias].colorSprite;
2282 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);
2283 }
2284 _ability = null;
2285 }
2286 void SetElements(int idEle, bool remove)
2287 {
2288 elements.SetBase(idEle, (!remove) ? ((v == 0) ? 10 : v) : 0);
2289 elements.ModBase(EClass.sources.elements.alias[EClass.sources.elements.map[idEle].aliasRef].id, remove ? (-20) : 20);
2290 switch (idEle)
2291 {
2292 case 910:
2293 elements.ModBase(951, remove ? 10 : (-10));
2294 break;
2295 case 911:
2296 elements.ModBase(950, remove ? 10 : (-10));
2297 break;
2298 case 912:
2299 elements.ModBase(953, remove ? 10 : (-10));
2300 break;
2301 case 913:
2302 elements.ModBase(952, remove ? 10 : (-10));
2303 break;
2304 case 916:
2305 elements.ModBase(960, remove ? 10 : (-10));
2306 break;
2307 case 919:
2308 elements.ModBase(956, remove ? 10 : (-10));
2309 break;
2310 case 925:
2311 elements.ModBase(962, remove ? 10 : (-10));
2312 break;
2313 case 922:
2314 elements.ModBase(965, remove ? 10 : (-10));
2315 break;
2316 case 921:
2317 elements.ModBase(971, remove ? 10 : (-10));
2318 break;
2319 case 926:
2320 elements.ModBase(961, remove ? 10 : (-10));
2321 break;
2322 case 914:
2323 case 915:
2324 case 917:
2325 case 918:
2326 case 920:
2327 case 923:
2328 case 924:
2329 break;
2330 }
2331 }
2332 }
int _colorInt
Definition: Card.cs:70
CharaAbility _ability
Definition: Chara.cs:96
UD_String_ElementRef elements
Definition: GameSetting.cs:317

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

2257 {
2258 if (!id.StartsWith("ele"))
2259 {
2260 id = "ele" + id;
2261 }
2262 SetMainElement(EClass.sources.elements.alias[id].id, v, elemental);
2263 }

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

10493 {
10494 SourceElement.Row row = EClass.sources.elements.map[idEle];
10496 Element element = elements.GetElement(idEle);
10497 Element element2 = elements.GetElement(row2.id);
10498 int num = element?.Value ?? 0;
10499 if (a < 0)
10500 {
10501 a = 0;
10502 }
10503 if (a > row.max)
10504 {
10505 a = row.max;
10506 }
10507 bool flag = (row.tag.Contains("neg") ? (a > num) : (a < num));
10508 if (a == 0 && (element == null || element.Value == 0))
10509 {
10511 return;
10512 }
10513 if (element != null && element.Value == a)
10514 {
10516 return;
10517 }
10518 if (element2 != null && element2.Value > 0)
10519 {
10520 SetFeat(element2.id, 0);
10521 }
10522 SetFeat(idEle, a);
10523 PlaySound("mutation");
10524 PlayEffect("mutation");
10526 Say(row.GetText(flag ? "textDec" : "textInc", returnNull: true) ?? row.alias, this);
10527 }

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

9389 {
9390 return SetAI(_NoGoalPC);
9391 }
static NoGoal _NoGoalPC
Definition: Chara.cs:200

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

◆ SetPCCState()

void Chara.SetPCCState ( PCCState  state)
inline

Definition at line 7008 of file Chara.cs.

7009 {
7010 if (IsPCC)
7011 {
7012 PCC.Get(pccData).Build(state);
7013 }
7014 }

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

7076 {
7077 p.mat = base.material;
7078 p.matColor = base.colorInt;
7079 if (!renderer.usePass)
7080 {
7081 return;
7082 }
7083 if (renderer.replacer != null)
7084 {
7085 p.tile = renderer.replacer.tile * ((!flipX) ? 1 : (-1));
7086 if (renderer.replacer.mat != -1)
7087 {
7088 p.mat = EClass.sources.materials.rows.TryGet(renderer.replacer.mat, 0);
7089 p.matColor = BaseTileMap.GetColorInt(ref p.mat.matColor, 100);
7090 p.color -= 1048576f;
7091 }
7092 }
7093 else if (source._tiles_snow.Length != 0 && EClass._zone.IsSnowCovered)
7094 {
7095 if (source._tiles_snow.Length > 1)
7096 {
7097 int num = ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % source._tiles_snow.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
7098 if (num < 0)
7099 {
7100 num = 0;
7101 }
7102 p.tile = source._tiles_snow[(num < source._tiles_snow.Length) ? num : 0] * ((!flipX) ? 1 : (-1));
7103 }
7104 else
7105 {
7106 p.tile = source._tiles_snow[0] * ((!flipX) ? 1 : (-1));
7107 }
7108 }
7109 else if (sourceCard._tiles.Length > 1)
7110 {
7111 int num2 = ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % sourceCard._tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
7112 if (num2 < 0)
7113 {
7114 num2 = 0;
7115 }
7116 p.tile = sourceCard._tiles[(num2 >= 0 && num2 < sourceCard._tiles.Length) ? num2 : 0] * ((!flipX) ? 1 : (-1));
7117 }
7118 else
7119 {
7120 p.tile = sourceCard._tiles[0] * ((!flipX) ? 1 : (-1));
7121 }
7122 p.dir = base.dir;
7123 }
static int GetColorInt(ref Color matColor, int p)
override bool flipX
Definition: Chara.cs:553
SourceMaterial.Row mat
Definition: RenderParam.cs:17
int[] _tiles
Definition: RenderRow.cs:12
SourceMaterial materials

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

7672 {
7673 switch (m)
7674 {
7675 case UIList.SortMode.ByJob:
7676 sortVal = job._index * 10000 + sourceCard._index;
7677 break;
7678 case UIList.SortMode.ByRace:
7679 sortVal = race._index * 10000 * ((!IsHuman) ? 1 : (-1)) + sourceCard._index;
7680 break;
7681 case UIList.SortMode.ByFeat:
7682 sortVal = -GetTotalFeat();
7683 break;
7684 case UIList.SortMode.ByPartyOrder:
7685 sortVal = EClass.pc.party.members.IndexOf(this);
7686 return;
7687 default:
7688 sortVal = sourceCard._index * ((!IsHuman) ? 1 : (-1));
7689 break;
7690 case UIList.SortMode.ByWorkk:
7691 break;
7692 }
7693 if (base.isFav)
7694 {
7695 sortVal -= 100000000;
7696 }
7697 }
int sortVal
Definition: Card.cs:104
int GetTotalFeat()
Definition: Chara.cs:8555
Definition: UIList.cs:9
SortMode
Definition: UIList.cs:27

References SourceData< T, T2 >.BaseRow._index, Party.members, party, and EClass.pc.

Referenced by BaseListPeople.List(), and LayerDragGrid.SetInv().

◆ SetSource()

override void Chara.SetSource ( )
inlinevirtual

Reimplemented from Card.

Definition at line 2244 of file Chara.cs.

2245 {
2246 source = EClass.sources.charas.map.TryGetValue(id);
2247 if (source == null)
2248 {
2249 Debug.LogWarning("Chara " + id + " not found");
2250 id = "chicken";
2251 source = EClass.sources.charas.map[id];
2252 }
2253 path.walker = this;
2254 }

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

Referenced by Refresh().

◆ SetSummon()

void Chara.SetSummon ( int  duration)
inline

Definition at line 2597 of file Chara.cs.

2598 {
2599 base.c_summonDuration = duration;
2600 base.isSummon = true;
2601 }

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

8014 {
8015 if (t.IsRangedWeapon && t.category.slot == 0)
8016 {
8017 if (!CanEquipRanged(t))
8018 {
8019 return false;
8020 }
8021 int num = 0;
8022 foreach (Thing thing in things)
8023 {
8024 if (thing.IsRangedWeapon)
8025 {
8026 if (thing.category.slot != 0 && thing.isEquipped)
8027 {
8028 return false;
8029 }
8030 if (CanEquipRanged(thing) && thing.GetEquipValue() > num)
8031 {
8032 num = thing.GetEquipValue();
8033 }
8034 }
8035 }
8036 if (t.GetEquipValue() > num)
8037 {
8038 return true;
8039 }
8040 return false;
8041 }
8042 BodySlot bodySlot = body.GetSlot(t);
8043 if (bodySlot == null)
8044 {
8045 return false;
8046 }
8047 if (useFav)
8048 {
8049 switch (GetFavAttackStyle())
8050 {
8051 case AttackStyle.Default:
8052 case AttackStyle.TwoHand:
8053 if (t.IsMeleeWeapon)
8054 {
8055 bodySlot = body.slotMainHand;
8056 }
8057 else if (bodySlot.elementId == 35)
8058 {
8059 return false;
8060 }
8061 break;
8062 case AttackStyle.Shield:
8063 if (t.IsMeleeWeapon)
8064 {
8065 bodySlot = body.slotMainHand;
8066 }
8067 else if (bodySlot.elementId == 35 && t.IsMeleeWeapon)
8068 {
8069 return false;
8070 }
8071 break;
8072 case AttackStyle.TwoWield:
8073 if (bodySlot.elementId == 35 && !t.IsMeleeWeapon)
8074 {
8075 return false;
8076 }
8077 break;
8078 }
8079 }
8080 if (!body.IsEquippable(t, bodySlot, text: false))
8081 {
8082 return false;
8083 }
8084 if (bodySlot.thing != null && (bodySlot.thing.blessedState <= BlessedState.Cursed || bodySlot.thing.GetEquipValue() >= t.GetEquipValue()))
8085 {
8086 return false;
8087 }
8088 if (!base.IsPCFactionOrMinion)
8089 {
8090 int num2 = 0;
8091 foreach (Element value in t.elements.dict.Values)
8092 {
8093 if (value.Value <= 0)
8094 {
8095 int num3 = 100;
8096 switch (value.id)
8097 {
8098 case 418:
8099 num3 = 10;
8100 break;
8101 case 60:
8102 case 61:
8103 case 62:
8104 num3 = 200;
8105 break;
8106 case 962:
8107 num3 = 10000;
8108 break;
8109 }
8110 num2 += value.Value * num3 / 100;
8111 }
8112 }
8113 if (num2 < -40)
8114 {
8115 return false;
8116 }
8117 }
8118 if (t.HasTag(CTAG.gift) && t.c_uidAttune != base.uid)
8119 {
8120 return false;
8121 }
8122 return true;
8123 }
bool IsMeleeWeapon
Definition: Card.cs:2295
BlessedState blessedState
Definition: Card.cs:281
int c_uidAttune
Definition: Card.cs:1212
bool IsEquippable(Thing thing, BodySlot slot, bool text=true)
Definition: CharaBody.cs:110
AttackStyle GetFavAttackStyle()
Definition: Chara.cs:4887

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

◆ ShouldThrowAway()

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

Definition at line 8931 of file Chara.cs.

8932 {
8933 if (IsPCFaction)
8934 {
8935 if (t.IsFood && t.category.id != "fish" && !t.IsDecayed)
8936 {
8937 return false;
8938 }
8939 if (t.trait.GetHealAction(this) != null)
8940 {
8941 return false;
8942 }
8943 if (t.IsThrownWeapon || t.IsRangedWeapon || t.IsAmmo)
8944 {
8945 return false;
8946 }
8947 if (t.trait is TraitBlanket || t.trait is TraitItemProc || t.trait is TraitBookSkill)
8948 {
8949 return false;
8950 }
8951 }
8952 if (t.isEquipped || t.rarity >= Rarity.Legendary || !t.trait.CanBeDestroyed || t.c_isImportant)
8953 {
8954 return false;
8955 }
8956 if (t.trait is TraitCurrency || t.trait is TraitTool)
8957 {
8958 return false;
8959 }
8960 switch (type)
8961 {
8962 case ClearInventoryType.SellAtTown:
8963 if (!t.isGifted && !t.isNPCProperty)
8964 {
8965 return false;
8966 }
8967 break;
8968 case ClearInventoryType.Purge:
8969 switch (t.category.id)
8970 {
8971 case "fish":
8972 if (EClass.rnd(3) == 0)
8973 {
8974 return true;
8975 }
8976 break;
8977 case "junk":
8978 case "garbage":
8979 if (EClass.rnd(3) != 0)
8980 {
8981 return true;
8982 }
8983 break;
8984 }
8985 if (t.id == "flyer")
8986 {
8987 return true;
8988 }
8989 if (!t.IsDecayed && EClass.rnd(3) == 0)
8990 {
8991 return false;
8992 }
8993 if (!things.IsFull() && t.IsRangedWeapon)
8994 {
8995 return false;
8996 }
8997 break;
8998 }
8999 return true;
9000 }
bool IsThrownWeapon
Definition: Card.cs:2299
bool IsFood
Definition: Card.cs:2229
bool isGifted
Definition: Card.cs:785
virtual Action GetHealAction(Chara c)
Definition: Trait.cs:635

References Card.c_isImportant, Trait.CanBeDestroyed, Card.category, Trait.GetHealAction(), Card.id, Card.IsAmmo, Card.IsDecayed, Thing.isEquipped, Card.IsFood, Card.isGifted, Card.isNPCProperty, Card.IsRangedWeapon, Card.IsThrownWeapon, Card.rarity, EClass.rnd(), and Card.trait.

◆ ShowDialog() [1/2]

void Chara.ShowDialog ( )
inline

Definition at line 7412 of file Chara.cs.

7413 {
7414 Zone_Nymelle zone_Nymelle = EClass._zone as Zone_Nymelle;
7415 if (conSuspend != null && IsPCParty)
7416 {
7417 RemoveCondition<ConSuspend>();
7418 }
7419 if (LayerDrama.forceJump == null)
7420 {
7421 if (IsDeadOrSleeping)
7422 {
7423 ShowDialog("_chara", "sleep");
7424 return;
7425 }
7426 if (EClass.pc.isHidden && !CanSee(EClass.pc))
7427 {
7428 ShowDialog("_chara", "invisible");
7429 return;
7430 }
7431 if (!IsPC && !EClass.player.codex.DroppedCard(id) && affinity.CanGiveCard() && source.LV < 10000)
7432 {
7434 ShowDialog("_chara", "give_card");
7435 Thing thing = ThingGen.Create("figure");
7436 thing.MakeFigureFrom(id);
7437 EClass.player.DropReward(thing);
7438 thing = ThingGen.Create("figure3");
7439 thing.MakeFigureFrom(id);
7440 EClass.player.DropReward(thing);
7441 return;
7442 }
7443 if (GetInt(71) == -2)
7444 {
7445 ShowDialog("_chara", "give_lunch");
7446 Thing t = CraftUtil.MakeLoveLunch(this);
7448 SetInt(71, EClass.world.date.GetRaw() + 43200);
7449 return;
7450 }
7451 if (base.isRestrained)
7452 {
7453 ShowDialog("_chara", "strain");
7454 return;
7455 }
7456 if (IsEscorted())
7457 {
7458 ShowDialog("_chara", "escort");
7459 return;
7460 }
7462 {
7463 string step = ((!(EClass._zone is Zone_Wedding)) ? "party" : (IsPCParty ? "wedding_love" : ((IsMarried || affinity.IsWeddingHater) ? "wedding_hater" : "wedding")));
7464 if (EClass._zone is Zone_Wedding && IsPCParty && base.c_love != null && !base.c_love.gaveCutter)
7465 {
7466 step = "wedding_cutter";
7467 EClass.player.DropReward(ThingGen.Create("dagger_cakecutter"));
7468 base.c_love.gaveCutter = true;
7469 }
7470 ShowDialog("_chara", step);
7471 return;
7472 }
7473 if (EClass.game.quests.OnShowDialog(this))
7474 {
7475 return;
7476 }
7477 if (id == "nino")
7478 {
7480 }
7481 switch (id)
7482 {
7483 case "loytel":
7484 {
7486 {
7487 EClass.game.quests.Get("pre_debt_runaway").Complete();
7488 EClass.player.flags.loytelEscaped = false;
7489 EClass.game.quests.Add("debt", "loytel");
7490 ShowDialog("loytel", "loytelEscaped");
7491 return;
7492 }
7493 QuestDebt questDebt = EClass.game.quests.Get<QuestDebt>();
7494 if (questDebt != null && questDebt.paid)
7495 {
7496 questDebt.stage++;
7497 if (questDebt.stage > 7)
7498 {
7499 questDebt.stage = 7;
7500 }
7501 ShowDialog("loytel", "debt" + questDebt.stage);
7502 return;
7503 }
7504 break;
7505 }
7506 case "farris":
7507 if (EClass._zone.id == "startVillage" || EClass._zone.id == "startVillage3" || EClass.game.IsSurvival)
7508 {
7509 ShowDialog("farris");
7510 return;
7511 }
7513 {
7514 case -1:
7515 ShowDialog("farris", "nymelle_noQuest");
7516 break;
7517 case 0:
7518 ShowDialog("farris", "nymelle_first");
7519 break;
7520 case 1:
7521 ShowDialog("farris", "home_first");
7522 break;
7523 default:
7524 ShowDialog("farris");
7525 break;
7526 }
7527 return;
7528 case "ashland":
7529 ShowDialog("ashland");
7530 return;
7531 case "fiama":
7532 if (zone_Nymelle != null && zone_Nymelle.IsCrystalLv && EClass.game.quests.GetPhase<QuestExploration>() == 3)
7533 {
7534 SoundManager.ForceBGM();
7535 LayerDrama.ActivateMain("mono", "nymelle_crystal");
7536 }
7538 {
7540 {
7541 EClass.player.flags.fiamaFirstDream = true;
7542 ShowDialog("fiama", "firstDream");
7543 }
7545 {
7546 ShowDialog("fiama", "giveStoryBook").SetOnKill(delegate
7547 {
7548 EClass.player.flags.fiamaStoryBookGiven = true;
7549 EClass.player.DropReward(ThingGen.Create("book_story"));
7550 });
7551 }
7552 else
7553 {
7554 ShowDialog("fiama");
7555 }
7556 }
7557 else
7558 {
7559 ShowDialog("fiama");
7560 }
7561 return;
7562 case "big_sister":
7564 {
7565 ShowDialog("big_sister", "little_saved");
7566 EClass.player.flags.little_saved = false;
7567 return;
7568 }
7570 {
7571 ShowDialog("big_sister", "little_dead");
7572 EClass.player.flags.little_killed = false;
7573 return;
7574 }
7575 break;
7576 }
7577 if (trait is TraitGuildDoorman)
7578 {
7579 string tag = ((trait is TraitDoorman_Fighter) ? "fighter" : ((trait is TraitDoorman_Mage) ? "mage" : "thief"));
7580 ShowDialog("guild_doorman", "main", tag);
7581 return;
7582 }
7583 if (trait is TraitGuildClerk)
7584 {
7585 string tag2 = ((trait is TraitClerk_Fighter) ? "fighter" : ((trait is TraitClerk_Mage) ? "mage" : "thief"));
7586 ShowDialog("guild_clerk", "main", tag2);
7587 return;
7588 }
7589 }
7590 bool flag = true;
7591 if (id == "parttimer_jure" && (!EClass._zone.IsFestival || !(EClass._zone is Zone_Noyel) || EClass.pc.faith == EClass.game.religions.Healing))
7592 {
7593 flag = false;
7594 }
7595 string book = "_chara";
7596 if (flag)
7597 {
7598 string text = GetStr("drama_override").IsEmpty(id);
7599 if (File.Exists(PackageIterator.GetFiles("Dialog/Drama/" + text + ".xlsx").LastOrDefault()?.FullName ?? (CorePath.DramaData + id + ".xlsx")))
7600 {
7601 book = text;
7602 }
7603 }
7605 }
bool CanGiveCard()
Definition: Affinity.cs:70
bool IsWeddingHater
Definition: Affinity.cs:36
void MakeFigureFrom(string id)
Definition: Card.cs:5995
void ShowDialog()
Definition: Chara.cs:7412
bool IsMarried
Definition: Chara.cs:615
bool DroppedCard(string id)
Definition: CodexManager.cs:46
void MarkCardDrop(string id)
Definition: CodexManager.cs:41
static string DramaData
Definition: CorePath.cs:174
static Thing MakeLoveLunch(Chara c)
Definition: CraftUtil.cs:221
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:508
int storyFiama
Definition: Player.cs:652
bool little_saved
Definition: Player.cs:472
bool fiamaStoryBookGiven
Definition: Player.cs:328
bool fiamaFirstDream
Definition: Player.cs:340
bool little_killed
Definition: Player.cs:484
CodexManager codex
Definition: Player.cs:1182
bool EnableDreamStory
Definition: Player.cs:1340
Thing DropReward(Thing t, bool silent=false)
Definition: Player.cs:2642
bool paid
Definition: QuestDebt.cs:10
int stage
Definition: QuestDebt.cs:13
bool OnShowDialog(Chara c)
Quest Add(string id, string idGlobalChara=null)
Definition: QuestManager.cs:29
int GetPhase(string id)
Quest Get(string id)
void Complete()
Definition: Quest.cs:473
ReligionHealing Healing
bool IsCrystalLv
Definition: Zone_Nymelle.cs:25
virtual bool IsFestival
Definition: Zone.cs:213

References EClass._zone, LayerDrama.ActivateMain(), QuestManager.Add(), book, Affinity.CanGiveCard(), Player.codex, Quest.Complete(), ThingGen.Create(), World.date, CorePath.DramaData, CodexManager.DroppedCard(), Player.DropReward(), Player.EnableDreamStory, faith, Player.Flags.fiamaFirstDream, Player.Flags.fiamaStoryBookGiven, Player.flags, LayerDrama.forceJump, EClass.game, QuestManager.Get(), Steam.GetAchievement(), QuestManager.GetPhase(), Date.GetRaw(), ReligionManager.Healing, Spatial.id, Zone_Nymelle.IsCrystalLv, Zone.IsFestival, Card.isHidden, Game.IsSurvival, Affinity.IsWeddingHater, Player.Flags.little_killed, Player.Flags.little_saved, Player.Flags.loytelEscaped, RenderRow.LV, 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 7607 of file Chara.cs.

7608 {
7609 return _ShowDialog(book, null, step, tag);
7610 }
LayerDrama _ShowDialog(string book, string sheet, string step="main", string tag="")
Definition: Chara.cs:7612

References book.

◆ Slap()

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

Definition at line 6602 of file Chara.cs.

6603 {
6604 if (id == "olderyoungersister")
6605 {
6607 }
6608 PlaySound("whip");
6609 Say("slap", this, c);
6610 c.PlayAnime(AnimeID.Shiver);
6611 c.DamageHP(slapToDeath ? (c.MaxHP * 2) : (5 + EClass.rndHalf(EClass.pc.MaxHP / 3)), 919, 100, AttackSource.Condition);
6612 c.OnInsulted();
6613 if (slapToDeath && c.IsAliveInCurrentZone)
6614 {
6615 c.Die();
6616 }
6617 }
void PlayAnime(AnimeID id, bool force=false)
Definition: Card.cs:6625
void OnInsulted()
Definition: Chara.cs:8627
override void Die(Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None, Chara originalTarget=null)
Definition: Chara.cs:5588

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

Referenced by DramaOutcome.wedding_fail().

◆ Sleep()

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

Definition at line 10247 of file Chara.cs.

10248 {
10249 RemoveCondition<ConAwakening>();
10250 AddCondition(Condition.Create(100, delegate(ConSleep con)
10251 {
10252 con.pcSleep = 15;
10253 con.pcBed = bed;
10254 con.pcPillow = pillow;
10255 con.pickup = pickup;
10256 con.posBed = posBed;
10257 con.posPillow = posPillow;
10258 }), force: true);
10259 }

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

8546 {
8547 Say("abCatSniff", this, c);
8548 AddCondition<ConHOT>(EClass.curve(50 + c.CHA * 5, 400, 100));
8549 c.ShowEmo(Emo.angry);
8550 ShowEmo(Emo.love);
8551 Talk("sniff");
8552 c.Talk(new string[4] { "labor", "disgust", "scold", "callGuards" }.RandomItem());
8553 }

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

4823 {
4824 return held.Split(a);
4825 }

References Card.Split().

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

◆ Stumble()

void Chara.Stumble ( int  mtp = 100)
inline

Definition at line 2008 of file Chara.cs.

2009 {
2010 bool flag = EClass._map.FindThing((Thing t) => t.IsInstalled && t.pos.Equals(EClass.pc.pos) && t.trait is TraitStairsUp) != null;
2011 Say(flag ? "dmgBurdenStairs" : "dmgBurdenFallDown", this);
2012 long num = MaxHP;
2013 if (Evalue(1421) > 0)
2014 {
2015 num = mana.max;
2016 }
2017 long num2 = (num * (base.ChildrenWeight * 100 / WeightLimit) / (flag ? 100 : 200) + 1) * mtp / 100;
2018 if (base.hp <= 0)
2019 {
2020 num2 *= 2;
2021 }
2022 DamageHP(num2, flag ? AttackSource.BurdenStairs : AttackSource.BurdenFallDown);
2023 }
Thing FindThing(Func< Thing, bool > func)
Definition: Map.cs:2671

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

4159 {
4160 if (host != null)
4161 {
4162 host.SyncRide();
4163 }
4164 if (ride != null)
4165 {
4166 SyncRide(ride);
4167 }
4168 if (parasite != null)
4169 {
4171 }
4172 }

References ride, and SyncRide().

Referenced by _Move(), Card._Move(), Zone.Activate(), Card.MoveImmediate(), ActRide.Ride(), and SyncRide().

◆ SyncRide() [2/2]

void Chara.SyncRide ( Chara  c)
inline

Definition at line 4174 of file Chara.cs.

4175 {
4176 if (!c.pos.Equals(pos))
4177 {
4178 if (!pos.IsValid)
4179 {
4180 Debug.LogError("exception: pos is not valid:" + pos?.ToString() + "/" + this);
4181 pos = new Point();
4182 }
4183 EClass._map.MoveCard(pos, c);
4184 }
4185 }

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

◆ TalkTopic()

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

Definition at line 7335 of file Chara.cs.

7336 {
7337 if (host == null && !IsInActiveZone)
7338 {
7339 return null;
7340 }
7341 if (!isSynced && (host == null || !host.isSynced) && topic != "dead")
7342 {
7343 return null;
7344 }
7345 if (IsPCParty)
7346 {
7347 int num = EClass.pc.party.members.Count - 1;
7348 switch (topic)
7349 {
7350 case "calm":
7351 if (EClass.rnd(num * 5) != 0)
7352 {
7353 return null;
7354 }
7355 break;
7356 case "aggro":
7357 if (EClass.rnd(num * 10) != 0)
7358 {
7359 return null;
7360 }
7361 break;
7362 case "kill":
7363 if (EClass.rnd(num * 3) != 0)
7364 {
7365 return null;
7366 }
7367 break;
7368 case "fov":
7369 return null;
7370 }
7371 }
7372 string topicText = GetTopicText(topic);
7373 if (topicText.IsEmpty())
7374 {
7375 return null;
7376 }
7377 HashSet<string> obj = new HashSet<string>
7378 {
7379 "_bracketTalk".lang(),
7380 "\"",
7381 "“",
7382 "「"
7383 };
7384 bool flag = topicText.StartsWith("*");
7385 bool flag2 = topicText.StartsWith("(");
7386 bool flag3 = obj.Any(topicText.StartsWith);
7387 topicText = ApplyTone(topicText);
7388 topicText = topicText.Replace('~', '*');
7389 Msg.SetColor(flag2 ? Msg.colors.Thinking : (flag3 ? Msg.colors.Talk : Msg.colors.Ono));
7390 Msg.Say(StripTalkSpecialCharacters(topicText.Replace("&", "")));
7391 if (topic == "dead")
7392 {
7393 EClass.ui.popGame.PopText(ApplyNewLine(topicText.StripBrackets()), null, "PopTextDead", default(Color), pos.Position() + EClass.setting.render.tc.textPosDead);
7394 }
7395 else if (flag || flag3 || flag2)
7396 {
7397 (host ?? this).renderer.Say(ApplyNewLine(topicText.StripBrackets()), default(Color), IsPCParty ? 0.6f : 0f);
7398 }
7399 return topicText;
7400 }
void Say(string text, Color c=default(Color), float duration=0f)
string ApplyNewLine(string text)
Definition: Card.cs:7251
string StripTalkSpecialCharacters(string text)
Definition: Card.cs:7232
string ApplyTone(string text, bool stripPun=false)
Definition: Card.cs:7331
string GetTopicText(string topic="calm")
Definition: Chara.cs:7301
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 4187 of file Chara.cs.

4188 {
4189 SyncRide();
4190 combatCount--;
4191 ignoreSPAbsorb = false;
4192 if (IsPC)
4193 {
4194 if (hasMovedThisTurn)
4195 {
4196 pos.Things.ForeachReverse(delegate(Thing t)
4197 {
4199 {
4200 AI_Goto aI_Goto = ai.Current as AI_Goto;
4201 if ((aI_Goto == null && !(ai is GoalManualMove)) || (aI_Goto != null && !aI_Goto.dest.Equals(pos)))
4202 {
4203 return;
4204 }
4205 }
4206 t.trait.OnStepped(this);
4207 });
4208 if (isDead)
4209 {
4210 return;
4211 }
4212 hasMovedThisTurn = false;
4214 {
4215 EClass.player.haltMove = false;
4216 ActionMode.Adv.TryCancelInteraction(sound: false);
4217 EInput.Consume(1);
4218 return;
4219 }
4220 if (EClass._zone.IsRegion)
4221 {
4223 {
4224 foreach (Chara member in EClass.pc.party.members)
4225 {
4226 if (member.hunger.value > 65)
4227 {
4228 member.InstantEat(null, sound: false);
4229 }
4230 }
4231 }
4232 Chara chara = null;
4234 if (cell2 != null && (cell2.zone == null || (cell2.zone is Zone_Field && !cell2.zone.IsPCFaction)))
4235 {
4236 foreach (Chara chara2 in EClass._map.charas)
4237 {
4238 if (!chara2.IsPCFactionOrMinion && !chara2.IsGlobal && chara2.pos.Equals(EClass.pc.pos))
4239 {
4240 chara = chara2;
4241 break;
4242 }
4243 }
4244 }
4245 if (chara != null)
4246 {
4248 {
4249 EClass.player.safeTravel = 5 + EClass.rnd(5);
4250 }
4251 EClass._zone.RemoveCard(chara);
4252 Msg.Say("encounter");
4253 EClass.player.EnterLocalZone(encounter: true, chara);
4254 }
4255 else if (EClass.player.safeTravel <= 0)
4256 {
4257 if (cell2 != null && cell2.zone == null && !EClass.debug.ignoreEncounter)
4258 {
4260 if (!tileInfo.shore)
4261 {
4262 bool num = EClass.pc.HasCondition<ConWardMonster>();
4263 bool flag = EClass.pc.HasCondition<ConDrawMonster>();
4264 bool flag2 = EClass.game.quests.Get<QuestEscort>() != null;
4265 int num2 = (tileInfo.isRoad ? 22 : 12);
4266 if (flag2)
4267 {
4268 num2 = (tileInfo.isRoad ? 16 : 10);
4269 }
4270 if (num)
4271 {
4272 num2 *= (flag2 ? 2 : 20);
4273 }
4274 if (flag)
4275 {
4276 num2 /= 2;
4277 }
4278 if (EClass.rnd(num2) == 0)
4279 {
4280 Msg.Say("encounter");
4281 if (!flag)
4282 {
4283 EClass.player.safeTravel = 5 + EClass.rnd(5);
4284 }
4285 EClass.player.EnterLocalZone(encounter: true);
4286 }
4287 }
4288 }
4289 }
4290 else
4291 {
4293 }
4294 }
4295 }
4296 EClass.player.pickupDelay = 0f;
4297 if (EClass.player.returnInfo != null)
4298 {
4300 if (EClass.player.returnInfo.turns <= 0)
4301 {
4303 {
4304 EClass.player.returnInfo = null;
4306 }
4307 else
4308 {
4310 {
4311 int uidDest = EClass.player.returnInfo.uidDest;
4312 Zone zone = null;
4313 if (uidDest != 0)
4314 {
4315 zone = EClass.game.spatials.map.TryGetValue(uidDest) as Zone;
4316 }
4317 if (zone == null || zone.destryoed)
4318 {
4319 zone = EClass.world.region;
4320 }
4322 {
4323 Msg.Say("returnFail");
4324 }
4325 else
4326 {
4327 Msg.Say("returnComplete");
4328 EClass.player.uidLastTravelZone = 0;
4330 EClass.player.lastZonePos = null;
4331 }
4332 EClass.player.returnInfo = null;
4333 return;
4334 }
4335 EClass.player.returnInfo = null;
4336 Msg.Say("returnOverweight");
4337 }
4338 }
4339 }
4340 if ((HasNoGoal || !ai.IsRunning) && !WillConsumeTurn())
4341 {
4343 return;
4344 }
4347 {
4348 RecipeUpdater.dirty = true;
4349 }
4351 }
4352 else
4353 {
4354 actTime = EClass.player.baseActTime * Mathf.Max(0.1f, (float)EClass.pc.Speed / (float)Speed);
4355 hasMovedThisTurn = false;
4356 }
4359 {
4360 return;
4361 }
4363 if (host != null && !consumeTurn)
4364 {
4365 if (host.ride == this && ((host.hasMovedThisTurn && IsInCombat) || (enemy != null && turn % 3 != 0)))
4366 {
4367 consumeTurn = true;
4368 }
4369 if (host.parasite == this && enemy != null && EClass.rnd(10) > EClass.rnd(host.Evalue(227) + 10))
4370 {
4371 if (Dist(enemy) < 3 && EClass.rnd(2) == 0)
4372 {
4373 Say("parasite_fail", this, host);
4374 if (EClass.rnd(2) == 0 && GetInt(106) == 0)
4375 {
4376 Talk("parasite_fail");
4377 }
4378 }
4379 consumeTurn = true;
4380 }
4381 }
4382 if (consumeTurn)
4383 {
4384 if (IsPC)
4385 {
4387 }
4388 }
4389 else
4390 {
4391 if (base.isRestrained)
4392 {
4393 TryUnrestrain();
4394 }
4395 if (enemy != null)
4396 {
4398 {
4399 enemy = null;
4400 }
4401 else if (!IsPC && (ai.CancelOnAggro || !ai.IsRunning))
4402 {
4403 SetAIAggro();
4404 }
4405 }
4406 if (HasNoGoal || !ai.IsRunning)
4407 {
4408 ChooseNewGoal();
4409 }
4410 ai.Tick();
4411 }
4412 Cell cell = base.Cell;
4414 {
4415 AddCondition<ConWet>(50);
4416 if (pos.IsHotSpring)
4417 {
4418 hygiene.Mod(2);
4419 }
4420 }
4421 if (cell.sourceSurface.id == 20)
4422 {
4423 AddCondition<ConBurning>();
4424 }
4425 if (IsPC && !EClass._zone.IsRegion && cell.CanSuffocate() && !EClass.debug.godMode && !HasElement(1252))
4426 {
4427 AddCondition<ConSuffocation>(800 / (100 + EvalueMax(200, -5) * 10), force: true);
4428 }
4429 CellEffect e;
4430 if (cell.effect != null)
4431 {
4432 e = cell.effect;
4433 switch (e.id)
4434 {
4435 case 1:
4436 case 2:
4437 case 4:
4438 if (IsLevitating)
4439 {
4440 Say("levitating");
4441 break;
4442 }
4443 AddCondition<ConWet>(50);
4444 ProcEffect();
4445 break;
4446 case 3:
4447 PlaySound("fire_step");
4448 AddCondition<ConBurning>(30);
4449 break;
4450 case 5:
4451 if (!isWet)
4452 {
4453 PlaySound("bubble");
4454 AddCondition<ConWet>(30);
4455 ProcEffect();
4456 }
4457 break;
4458 case 6:
4459 if (hasMovedThisTurn)
4460 {
4461 Say("abMistOfDarkness_step", this);
4462 }
4463 AddCondition<ConDark>(e.power);
4464 break;
4465 }
4466 }
4467 if (IsPC)
4468 {
4469 if (EClass.player.currentHotItem.Thing != null)
4470 {
4472 }
4474 }
4475 void ClearEffect()
4476 {
4477 EClass._map.SetLiquid(cell.x, cell.z, 0, 0);
4478 }
4479 void ProcEffect()
4480 {
4481 if (e.idEffect != 0)
4482 {
4483 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
4484 {
4485 aliasEle = EClass.sources.elements.map[e.idEle].alias,
4486 n1 = e.n1,
4487 refVal = e.refVal
4488 });
4489 ClearEffect();
4490 }
4491 }
4492 }
virtual bool CancelOnAggro
Definition: AIAct.cs:80
bool TryCancelInteraction(bool sound=true)
Definition: AM_Adv.cs:1115
void SetTurbo(int mtp=-1)
Definition: AM_Adv.cs:1086
static AM_Adv Adv
Definition: ActionMode.cs:15
virtual void OnEndPlayerTurn()
int turn
Definition: Card.cs:68
void TryUnrestrain(bool force=false, Chara c=null)
Definition: Card.cs:7565
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:102
byte z
Definition: Cell.cs:64
byte x
Definition: Cell.cs:62
void InstantEat(Thing t=null, bool sound=true)
Definition: Chara.cs:7967
int Speed
Definition: Chara.cs:1142
static bool consumeTurn
Definition: Chara.cs:184
void SetAIAggro()
Definition: Chara.cs:9383
bool ignoreSPAbsorb
Definition: Chara.cs:148
void ChooseNewGoal()
Definition: Chara.cs:9264
bool WillConsumeTurn()
Definition: Chara.cs:3876
bool ignoreEncounter
Definition: CoreDebug.cs:216
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:1523
static string SayNothingHappen()
Definition: Msg.cs:96
int turns
Definition: Player.cs:84
bool haltMove
Definition: Player.cs:1241
float baseActTime
Definition: Player.cs:1269
void EnterLocalZone(bool encounter=false, Chara mob=null)
Definition: Player.cs:2018
HotItem currentHotItem
Definition: Player.cs:1167
int safeTravel
Definition: Player.cs:987
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:1237
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 3888 of file Chara.cs.

3889 {
3890 if (_cooldowns != null)
3891 {
3892 TickCooldown();
3893 }
3894 turn++;
3895 consumeTurn = false;
3896 preventRegen = false;
3897 emoIcon = Emo2.none;
3898 if (base.isSummon)
3899 {
3900 base.c_summonDuration--;
3901 if (base.c_summonDuration <= 0)
3902 {
3903 Die();
3904 return;
3905 }
3906 }
3908 {
3909 AddCondition<ConWet>(20);
3910 }
3911 switch (turn % 50)
3912 {
3913 case 0:
3914 happiness = (hunger.value + stamina.value + depression.value + bladder.value + hygiene.value) / 5;
3915 break;
3916 case 1:
3917 if (!IsPC || !EClass.debug.godMode)
3918 {
3919 if (EClass.rnd(2) == 0 && !HasCondition<ConAwakening>())
3920 {
3921 sleepiness.Mod(1);
3922 }
3923 if (EClass.rnd(3) == 0)
3924 {
3925 hunger.Mod(1);
3926 }
3927 if (IsPC && (sleepiness.GetPhase() != 0 || stamina.GetPhase() <= 1))
3928 {
3929 Tutorial.Play("sleep");
3930 }
3931 }
3932 break;
3933 case 2:
3934 if (parasite != null)
3935 {
3936 ModExp(227, (int)((EClass._zone.IsRegion ? 5 : 40) + parasite.affinity.CurrentStage));
3937 }
3938 if (ride != null)
3939 {
3940 ModExp(226, (int)((EClass._zone.IsRegion ? 5 : 40) + ride.affinity.CurrentStage));
3941 }
3942 break;
3943 case 3:
3944 {
3945 int phase = hygiene.GetPhase();
3946 int num = 0;
3947 num = ((!IsPC) ? ((phase > 3) ? 50 : 0) : ((phase > 3) ? 50 : 0));
3948 if (num > EClass.rnd(100))
3949 {
3950 hygiene.Mod(-1);
3951 }
3952 break;
3953 }
3954 case 4:
3955 if (IsPC)
3956 {
3958 }
3959 break;
3960 case 5:
3961 case 30:
3963 {
3964 AddCondition<ConBurning>(1000, force: true);
3965 }
3966 break;
3967 case 10:
3968 if (HasElement(1250))
3969 {
3970 if (!HasCondition<ConVampire>())
3971 {
3972 AddCondition<ConVampire>();
3973 }
3974 if (!IsPC && !HasCooldown(8793))
3975 {
3976 bool flag = false;
3977 flag = ((!HasCondition<ConTransmuteBat>()) ? (!HasElement(431) && pos.IsSunLit) : (body.HasElement(431) || (EClass.world.date.IsNight && !pos.IsSunLit)));
3978 if (flag && base.IsPCFactionOrMinion && !EClass._zone.IsPCFactionOrTent && EClass._zone.HasLaw && pos.ListWitnesses(this).Count > 0 && !HasCondition<ConBurning>())
3979 {
3980 flag = false;
3981 }
3982 if (flag)
3983 {
3984 UseAbility("SpTransmuteBat", this);
3985 }
3986 }
3987 }
3988 if (HasElement(1423) && !HasCondition<ConPeaky>())
3989 {
3990 AddCondition<ConPeaky>();
3991 }
3992 break;
3993 }
3994 if (turn % 200 == 0)
3995 {
3997 }
3998 if (IsPCParty)
3999 {
4000 if (dirtyWeight)
4001 {
4002 CalcBurden();
4003 }
4004 int phase2 = burden.GetPhase();
4005 int phase3 = hunger.GetPhase();
4006 if (phase3 >= 4)
4007 {
4008 preventRegen = true;
4009 }
4010 if (EClass.rnd(EClass._zone.IsRegion ? 100 : 30) == 0 && phase2 >= 3)
4011 {
4012 Say("dmgBurden", this);
4013 DamageHP(MaxHP * (base.ChildrenWeight * 100 / WeightLimit) / 1000 + 1, AttackSource.Burden);
4014 if (isDead)
4015 {
4016 return;
4017 }
4018 }
4019 if (EClass.rnd(12) == 0)
4020 {
4021 if (IsPC)
4022 {
4023 if (phase2 > 0)
4024 {
4025 ModExp(207, 1 + phase2 * phase2);
4026 }
4027 }
4028 else
4029 {
4030 ModExp(207, 4);
4031 }
4032 }
4033 if (IsPC)
4034 {
4035 if (phase3 >= 5)
4036 {
4037 if (!(ai is AI_Eat) && EClass.rnd(5) == 0)
4038 {
4039 DamageHP(1 + EClass.rnd(2) + MaxHP / 50, AttackSource.Hunger);
4040 }
4041 if (!isDead && EClass.rnd(3) == 0)
4042 {
4043 stamina.Mod(-1);
4044 }
4045 }
4046 if (isDead)
4047 {
4048 return;
4049 }
4050 phase3 = stamina.GetPhase();
4051 if (phase3 <= 0)
4052 {
4053 preventRegen = true;
4054 }
4056 {
4057 if (EClass.rnd(100) == 0 && !isConfused)
4058 {
4059 Msg.Say("rain_confuse");
4060 AddCondition<ConConfuse>(500);
4061 }
4062 if (EClass.rnd(300) == 0 && !isBlind)
4063 {
4064 Msg.Say("rain_confuse");
4065 AddCondition<ConBlind>(200);
4066 }
4067 }
4068 if (turn % (200000 / Mathf.Max(100 + Evalue(409) * 10, 50)) == 0)
4069 {
4070 ModCorruption(1);
4071 }
4072 }
4073 }
4074 if (!IsPC)
4075 {
4076 int num2 = Evalue(409);
4077 if (num2 > 0 && turn % (200000 / Mathf.Max(100 + num2 * 10, 50)) == 0)
4078 {
4079 ModCorruption(1);
4080 }
4081 }
4082 for (int num3 = conditions.Count - 1; num3 >= 0; num3--)
4083 {
4084 if (num3 < conditions.Count)
4085 {
4086 Condition condition = conditions[num3];
4087 if (!condition.TimeBased)
4088 {
4089 condition.Tick();
4090 }
4091 if (!condition.IsKilled)
4092 {
4093 if (condition.ConsumeTurn)
4094 {
4095 consumeTurn = true;
4096 }
4097 if (condition.PreventRegen)
4098 {
4099 preventRegen = true;
4100 }
4101 if (condition.EmoIcon != 0 && condition.EmoIcon > emoIcon)
4102 {
4103 emoIcon = condition.EmoIcon;
4104 }
4105 }
4106 if (isDead)
4107 {
4108 return;
4109 }
4110 }
4111 }
4112 switch (id)
4113 {
4114 case "cocoon_alien":
4115 case "cocoon":
4116 if (!EClass._zone.IsRegion && !IsDisabled && 1.0005f - (float)base.hp / (float)MaxHP > EClass.rndf(1f) && !pos.IsSunLit)
4117 {
4118 HatchEgg();
4119 return;
4120 }
4121 consumeTurn = true;
4122 break;
4123 case "tsunami":
4124 if (elements.Base(79) >= 30)
4125 {
4126 if (IsInCombat)
4127 {
4128 elements.SetTo(79, elements.Base(79) * 3 / 4);
4129 }
4130 break;
4131 }
4132 Die();
4133 return;
4134 }
4135 if (pos.IsBlocked && pos.HasBlock)
4136 {
4137 preventRegen = true;
4138 }
4139 if (!preventRegen)
4140 {
4141 if (EClass.rnd(25) == 0 && base.hp < MaxHP)
4142 {
4143 HealHP(EClass.rnd(Evalue(300) / 3 + 1) + 1);
4144 elements.ModExp(300, 8f);
4145 }
4146 if (EClass.rnd(8) == 0 && mana.value < mana.max)
4147 {
4148 mana.Mod(EClass.rnd(Evalue(301) / 2 + 1) + 1);
4149 elements.ModExp(301, 8f);
4150 }
4151 if (EClass.rnd(20) == 0 && !IsPC && stamina.value < stamina.max)
4152 {
4153 stamina.Mod(EClass.rnd(5) + 1);
4154 }
4155 }
4156 }
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:31
void HatchEgg()
Definition: Card.cs:6091
bool dirtyWeight
Definition: Card.cs:88
bool HasElement(int idEle)
Definition: CharaBody.cs:412
void TickCooldown()
Definition: Chara.cs:9245
void DiminishTempElements(int a=1)
Definition: Chara.cs:10862
Emo2 emoIcon
Definition: Chara.cs:108
bool UseAbility(int idAct, Card tc=null, Point pos=null, bool pt=false)
Definition: Chara.cs:6081
bool isBlind
Definition: Chara.cs:132
static bool preventRegen
Definition: Chara.cs:186
void CalcBurden()
Definition: Chara.cs:1993
virtual bool IsKilled
Definition: Condition.cs:8
override void Tick()
Definition: Condition.cs:87
void UpdateNyan()
Definition: Player.cs:2482
List< Chara > ListWitnesses(Chara criminal, int radius=4, WitnessType type=WitnessType.crime, Chara target=null)
Definition: Point.cs:835
bool HasBlock
Definition: Point.cs:141
static void Play(string idStep)
Definition: Tutorial.cs:7
bool IsRaining
Definition: Weather.cs:117
bool IsPCFactionOrTent
Definition: Zone.cs:480

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

Referenced by _Move().

◆ TickCooldown()

void Chara.TickCooldown ( )
inline

Definition at line 9245 of file Chara.cs.

9246 {
9247 for (int num = _cooldowns.Count - 1; num >= 0; num--)
9248 {
9249 if (_cooldowns[num] % 1000 == 1)
9250 {
9251 _cooldowns.RemoveAt(num);
9252 }
9253 else
9254 {
9255 _cooldowns[num]--;
9256 }
9257 }
9258 if (_cooldowns.Count == 0)
9259 {
9260 _cooldowns = null;
9261 }
9262 }

◆ TickWork()

void Chara.TickWork ( VirtualDate  date)
inline

Definition at line 9675 of file Chara.cs.

9676 {
9678 if (span != TimeTable.Span.Work && span != 0)
9679 {
9680 return;
9681 }
9682 WorkSummary workSummary = GetWorkSummary();
9683 if (span == TimeTable.Span.Work)
9684 {
9685 if (workSummary.work != null)
9686 {
9687 PerformWork(workSummary.work, isHobby: false, date.IsRealTime);
9688 }
9689 }
9690 else if (workSummary.hobbies.Count > 0)
9691 {
9692 PerformWork(workSummary.hobbies.RandomItem(), isHobby: true, date.IsRealTime);
9693 }
9694 }
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 1231 of file Chara.cs.

1232 {
1233 return base.Name + "(" + ai?.ToString() + ")" + pos?.ToString() + "/" + base.ExistsOnMap + "/" + isDead;
1234 }
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 4606 of file Chara.cs.

4607 {
4608 if (!IsPC || !(t.trait is TraitRod) || t.c_charges <= 0 || !HasElement(1564))
4609 {
4610 return;
4611 }
4612 Say("absorbRod", this, t);
4613 TraitRod rod = t.trait as TraitRod;
4614 bool flag = false;
4615 if (rod.source != null)
4616 {
4617 using IEnumerator<SourceElement.Row> enumerator = EClass.sources.elements.rows.Where((SourceElement.Row a) => a.id == rod.source.id).GetEnumerator();
4618 if (enumerator.MoveNext())
4619 {
4620 SourceElement.Row current = enumerator.Current;
4621 if (IsPC)
4622 {
4623 GainAbility(current.id, t.c_charges * 100, t);
4624 flag = true;
4625 }
4626 }
4627 }
4628 if (!flag)
4629 {
4630 mana.Mod(-50 * t.c_charges);
4631 }
4632 t.c_charges = 0;
4634 }
int c_charges
Definition: Card.cs:1309
void GainAbility(int ele, int mtp=100, Thing origin=null)
Definition: Chara.cs:10628

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

7727 {
7728 if (!IsPCFaction && !IsGuest())
7729 {
7730 return null;
7731 }
7732 foreach (Card item in EClass._map.props.installed.all)
7733 {
7734 if (item.trait is TraitBed traitBed && traitBed.CanAssign(this))
7735 {
7736 traitBed.AddHolder(this);
7737 Msg.Say("claimBed", this);
7738 return traitBed;
7739 }
7740 }
7741 return null;
7742 }
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().

◆ TryClearInventory()

void Chara.TryClearInventory ( )
inline

Definition at line 9002 of file Chara.cs.

9003 {
9004 if (IsPC)
9005 {
9006 return;
9007 }
9008 if (IsPCParty)
9009 {
9010 if (!things.IsAlmostFull())
9011 {
9012 return;
9013 }
9014 bool flag = EClass._zone.IsTown;
9015 if (!flag && EClass._zone.IsPCFactionOrTent)
9016 {
9017 foreach (Chara chara in EClass._map.charas)
9018 {
9019 if (chara.IsPCFaction && chara.trait.ShopType != 0)
9020 {
9021 flag = true;
9022 }
9023 }
9024 }
9025 if (flag)
9026 {
9028 }
9029 }
9030 else
9031 {
9033 }
9034 }
void ClearInventory(ClearInventoryType type)
Definition: Chara.cs:9036
bool IsAlmostFull(int threshold=2)
virtual ShopType ShopType
Definition: Trait.cs:532

References EClass._map, EClass._zone, Map.charas, IsPCFaction, Zone.IsPCFactionOrTent, Zone.IsTown, Trait.ShopType, and trait.

Referenced by GiveGift(), AI_Fish.Run(), and AI_Idle.Run().

◆ TryDropBossLoot()

void Chara.TryDropBossLoot ( )
inline

Definition at line 5915 of file Chara.cs.

5916 {
5918 {
5919 return;
5920 }
5921 int num = 0;
5922 bool flag = false;
5923 bool flag2 = false;
5924 Point point = pos.GetNearestPoint(allowBlock: true, allowChara: false, allowInstalled: false, ignoreCenter: true) ?? pos;
5925 TreasureType type = TreasureType.BossQuest;
5926 if (EClass._zone.Boss == this)
5927 {
5928 type = TreasureType.BossNefia;
5929 num = 2 + EClass.rnd(2);
5930 flag = (flag2 = true);
5931 EClass._zone.Boss = null;
5932 Msg.Say("boss_win", EClass._zone.Name);
5934 {
5935 Msg.Say("boss_win_void", EClass._zone.Name);
5936 EClass.player.flags.KilledBossInVoid = true;
5937 }
5938 if (EClass._zone.IsNefia)
5939 {
5942 SE.Play("Jingle/fanfare2");
5943 EClass._zone.SetBGM(114, refresh: true, 3f);
5944 }
5947 }
5948 switch (id)
5949 {
5950 case "azzrasizzle":
5951 num = 5;
5952 flag = (flag2 = true);
5953 EClass.Sound.StopBGM(3f);
5954 EClass._zone.SetBGM(1, refresh: false);
5956 {
5957 EClass.game.quests.Get<QuestIntoDarkness>().UpdateOnTalk();
5958 }
5959 break;
5960 case "vernis_boss":
5961 num = 5;
5962 flag = (flag2 = true);
5963 EClass.Sound.StopBGM(3f);
5964 EClass._zone.SetBGM(1, refresh: false);
5966 {
5967 EClass.game.quests.Get<QuestVernis>().UpdateOnTalk();
5968 }
5969 break;
5970 case "lurie_boss":
5971 if (!(EClass._zone is Zone_Exile))
5972 {
5973 num = 5;
5974 flag = (flag2 = true);
5975 EClass._zone.SetBGM(120, refresh: true, 3f);
5977 {
5978 EClass.game.quests.Get<QuestNegotiationDarkness>().ChangePhase(4);
5979 EClass.player.flags.killedDuponne = true;
5980 }
5981 }
5982 break;
5983 case "ungaga_pap":
5984 num = 5;
5985 flag = (flag2 = true);
5987 {
5988 EClass._zone.SetBGM(46, refresh: true, 3f);
5989 }
5990 break;
5991 case "melilith_boss":
5992 num = 5;
5993 flag = (flag2 = true);
5994 EClass.Sound.StopBGM(3f);
5995 EClass._zone.SetBGM(1, refresh: false);
5996 break;
5997 case "doga":
5998 {
5999 QuestCurry questCurry = EClass.game.quests.Get<QuestCurry>();
6000 if (questCurry != null)
6001 {
6002 num = 5;
6003 flag = (flag2 = true);
6004 EClass.Sound.StopBGM(3f);
6005 EClass._zone.SetBGM(1, refresh: false);
6006 questCurry.NextPhase();
6007 }
6008 break;
6009 }
6010 case "fairy_raina":
6011 case "fairy_poina":
6012 {
6013 bool num2 = EClass._map.FindChara((id == "fairy_raina") ? "fairy_poina" : "fairy_raina") == null;
6014 QuestNasu questNasu = EClass.game.quests.Get<QuestNasu>();
6015 if (num2 && questNasu != null && questNasu.phase <= 1)
6016 {
6017 if (questNasu.phase == 0)
6018 {
6019 questNasu.NextPhase();
6020 }
6021 num = 5;
6022 flag = (flag2 = true);
6023 EClass.Sound.StopBGM(3f);
6024 EClass._zone.SetBGM(1, refresh: false);
6025 EClass.player.DropReward(ThingGen.Create("backpack_holding"));
6026 questNasu.NextPhase();
6027 }
6028 break;
6029 }
6030 case "isygarad":
6031 {
6032 num = 5;
6033 flag = (flag2 = true);
6034 QuestExploration questExploration = EClass.game.quests.Get<QuestExploration>();
6035 if (questExploration != null)
6036 {
6037 SE.Play("kill_boss");
6038 questExploration.ChangePhase(3);
6039 EClass.Sound.StopBGM(3f);
6040 EClass._zone.SetBGM(1, refresh: false);
6041 }
6042 break;
6043 }
6044 case "swordkeeper":
6045 num = 10;
6046 flag = true;
6047 SE.Play("kill_boss");
6048 SoundManager.ForceBGM();
6049 LayerDrama.Activate("_event", "event", "swordkeeper_defeat");
6050 break;
6051 }
6052 if (flag)
6053 {
6054 SE.Play("kill_boss");
6055 }
6056 if (num != 0)
6057 {
6059 {
6060 EClass.player.stats.deepest = EClass._zone.DangerLv;
6061 Msg.Say("update_deepest", EClass.player.stats.deepest.ToString() ?? "");
6062 }
6064 {
6065 EClass.player.stats.deepestVoid = -EClass._zone.lv;
6066 Msg.Say("update_deepest_void", EClass.player.stats.deepestVoid.ToString() ?? "");
6067 }
6068 EClass.player.willAutoSave = true;
6069 Thing thing = ThingGen.CreateTreasure("chest_boss", base.LV, type);
6070 point.SetBlock();
6071 point.SetObj();
6072 EClass._zone.AddCard(thing, point).Install();
6073 ThingGen.TryLickChest(thing);
6074 }
6075 if (flag2)
6076 {
6078 }
6079 }
TreasureType
Definition: TreasureType.cs:2
bool KilledBossInVoid
Definition: Player.cs:448
int deepest
Definition: Player.cs:111
long nefiaBeaten
Definition: Player.cs:153
int deepestVoid
Definition: Player.cs:114
void ModFame(int a)
Definition: Player.cs:2166
void SetObj(int id=0, int value=1, int dir=0)
Definition: Point.cs:934
void SetBlock(int idMat=0, int idBlock=0)
Definition: Point.cs:924
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:431
static Thing CreateTreasure(string id, int lv, TreasureType type=TreasureType.Map)
Definition: ThingGen.cs:264
static Thing CreateScroll(int ele, int num=1)
Definition: ThingGen.cs:190
virtual bool IsNefia
Definition: Zone.cs:289
void SetBGM(List< int > ids, bool refresh=true, float fadeDuration=0f)
Definition: Zone.cs:3154
Chara Boss
Definition: Zone.cs:88

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

Referenced by ActEffect.Proc().

◆ TryDropCarryOnly()

void Chara.TryDropCarryOnly ( )
inline

Definition at line 4827 of file Chara.cs.

4828 {
4829 if (held != null && held.trait.CanOnlyCarry)
4830 {
4831 DropHeld();
4832 }
4833 foreach (Thing item in things.List((Thing t) => t.trait.CanOnlyCarry))
4834 {
4835 DropThing(item);
4836 }
4837 }
void DropThing(Thing t, int num=-1)
Definition: Chara.cs:4859

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

◆ TryDuplicate()

Chara Chara.TryDuplicate ( DuplicateCondition  con = DuplicateCondition::Default,
Point  dest = null 
)
inline

Definition at line 1922 of file Chara.cs.

1923 {
1924 if (dest == null)
1925 {
1926 dest = pos;
1927 }
1928 dest = dest.GetRandomPoint(2, requireLos: false, allowChara: false, allowBlocked: false, 200);
1929 if (dest == null || dest.Equals(pos) || !dest.IsValid || !CanDuplicate(con))
1930 {
1931 Say("split_fail", this);
1932 return null;
1933 }
1934 Chara chara = Duplicate();
1935 EClass._zone.AddCard(chara, dest);
1936 Say("split", this);
1937 return chara;
1938 }
bool CanDuplicate(DuplicateCondition con=DuplicateCondition.Default)
Definition: Chara.cs:1886
Chara Duplicate()
Definition: Chara.cs:1940
Point GetRandomPoint(int radius, bool requireLos=true, bool allowChara=true, bool allowBlocked=false, int tries=100)
Definition: Point.cs:774

References EClass._zone, Zone.AddCard(), CanDuplicate(), Duplicate(), Point.GetRandomPoint(), Card.pos, and Card.Say().

Referenced by ConWet.OnStart(), and ActEffect.Proc().

◆ TryEquip()

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

Definition at line 8125 of file Chara.cs.

8126 {
8127 if (!ShouldEquip(t, useFav))
8128 {
8129 return false;
8130 }
8131 if (t.category.slot == 0)
8132 {
8133 return false;
8134 }
8135 if (useFav)
8136 {
8137 BodySlot slot = body.GetSlot(t);
8138 switch (GetFavAttackStyle())
8139 {
8140 case AttackStyle.Default:
8141 case AttackStyle.TwoHand:
8142 if (t.IsMeleeWeapon)
8143 {
8144 slot = body.slotMainHand;
8145 }
8146 break;
8147 case AttackStyle.Shield:
8148 if (t.IsMeleeWeapon)
8149 {
8150 slot = body.slotMainHand;
8151 }
8152 break;
8153 }
8154 body.Equip(t, slot);
8155 }
8156 else
8157 {
8158 body.Equip(t);
8159 }
8160 Say("equip", this, t);
8161 return true;
8162 }
bool ShouldEquip(Thing t, bool useFav=false)
Definition: Chara.cs:8013

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

8251 {
8252 if (id == "mamani")
8253 {
8255 }
8256 if (IsPC)
8257 {
8259 if (thing?.trait is TraitToolRange && CanEquipRanged(thing))
8260 {
8261 ranged = thing;
8262 return true;
8263 }
8264 return false;
8265 }
8266 if (ranged != null && ranged.parent == this)
8267 {
8268 return true;
8269 }
8271 return ranged != null;
8272 }
Thing GetBestRangedWeapon()
Definition: Chara.cs:8230
Thing GetRandomRangedWeapon()
Definition: Chara.cs:8245

References Player.currentHotItem, Card.parent, EClass.player, and HotItem.Thing.

Referenced by TraitTrainingDummy.IdleUse(), ActRanged.Perform(), GoalCombat.TryMove(), and GoalCombat.TryUseRanged().

◆ TryFuse()

bool Chara.TryFuse ( float  chance = 1f)
inline

Definition at line 1830 of file Chara.cs.

1831 {
1832 if (chance < EClass.rndf(1f))
1833 {
1834 return false;
1835 }
1836 List<Chara> list = ListFussableCharas(3);
1837 if (list.Count < 8)
1838 {
1839 return false;
1840 }
1841 Say("fuse", this);
1842 Chara chara = EClass._zone.SpawnMob("marshmallow_king", pos);
1843 foreach (Chara item in list)
1844 {
1845 item.Talk("fusion");
1846 Effect.Get<EffectIRenderer>("throw_fuse").Play(item, item, item.pos, pos);
1847 item.Destroy();
1848 }
1849 Destroy();
1850 chara.PlayAnime(AnimeID.FallSky);
1851 chara.pos.PlaySound("fuse");
1852 chara.pos.PlayEffect("vanish");
1853 return true;
1854 }
List< Chara > ListFussableCharas(int radius=2)
Definition: Chara.cs:1881
Chara SpawnMob(string id, Point pos=null)
Definition: Zone.cs:2889

References EClass._zone, Card.Destroy(), Effect.Get(), item, ListFussableCharas(), Card.pos, EClass.rndf(), Card.Say(), and Zone.SpawnMob().

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

◆ TryGetThrowable()

Thing Chara.TryGetThrowable ( )
inline

Definition at line 8169 of file Chara.cs.

8170 {
8171 Thing dest = null;
8172 if (IsPC)
8173 {
8175 {
8176 return FindThrowable(hotbar: true);
8177 }
8178 return null;
8179 }
8180 things.Foreach(delegate(Thing t)
8181 {
8182 if (t.HasTag(CTAG.throwWeapon) || (!base.IsPCFactionOrMinion && t.HasTag(CTAG.throwWeaponEnemy)))
8183 {
8184 dest = t;
8185 }
8186 });
8187 return dest;
8188 Thing FindThrowable(bool hotbar)
8189 {
8190 things.Foreach(delegate(Thing t)
8191 {
8192 if (dest == null)
8193 {
8194 if (t.IsHotItem)
8195 {
8196 if (!hotbar)
8197 {
8198 return;
8199 }
8200 }
8201 else if (hotbar)
8202 {
8203 return;
8204 }
8205 if (t.HasTag(CTAG.throwWeapon))
8206 {
8207 dest = t;
8208 }
8209 }
8210 });
8211 return dest;
8212 }
8213 }

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

4685 {
4686 if (held == t)
4687 {
4688 return true;
4689 }
4690 if (t.isDestroyed || t.Num <= 0)
4691 {
4692 return false;
4693 }
4694 if (!CanPick(t))
4695 {
4696 if (t.parent == null)
4697 {
4698 EClass._zone.AddCard(t, pos);
4699 }
4700 return false;
4701 }
4702 HoldCard(t, num);
4703 return true;
4704 }
bool CanPick(Card c)
Definition: Chara.cs:4504
void HoldCard(Card t, int num=-1)
Definition: Chara.cs:4706

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

8401 {
8402 int num = Evalue(289);
8403 if (num == 0)
8404 {
8405 return false;
8406 }
8407 int lV = t.LV;
8408 if (EClass.rnd(num * num + 5) > EClass.rnd(lV * lV) * 20)
8409 {
8410 t.Identify(show, (num >= 20) ? IDTSource.SkillHigh : IDTSource.Skill);
8411 int num2 = 50;
8412 if (lV > num)
8413 {
8414 num2 += (lV - num) * 10;
8415 }
8416 elements.ModExp(289, Mathf.Min(num2, 1000));
8417 return true;
8418 }
8419 return false;
8420 }
IDTSource
Definition: IDTSource.cs:2
Thing Identify(bool show=true, IDTSource idtSource=IDTSource.Identify)
Definition: Thing.cs:2132

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

Referenced by Player.OnAdvanceHour().

◆ TryMove()

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

Reimplemented from Card.

Definition at line 2896 of file Chara.cs.

2897 {
2898 foreach (Condition condition in conditions)
2899 {
2900 if (!condition.TryMove(newPoint))
2901 {
2902 return MoveResult.Fail;
2903 }
2904 }
2905 if (base.isRestrained)
2906 {
2907 if (!IsPC)
2908 {
2909 return MoveResult.Fail;
2910 }
2911 base.isRestrained = false;
2912 }
2913 if (!CanMoveTo(newPoint, allowDestroyPath))
2914 {
2915 return MoveResult.Fail;
2916 }
2917 return _Move(newPoint);
2918 }
virtual bool TryMove(Point p)

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

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

◆ TryMoveTowards()

MoveResult Chara.TryMoveTowards ( Point  p)
inline

Definition at line 2834 of file Chara.cs.

2835 {
2836 if (p.Equals(pos))
2837 {
2838 return MoveResult.Success;
2839 }
2841 {
2842 return MoveResult.Fail;
2843 }
2844 bool flag = true;
2845 Point point = null;
2846 _sharedPos.Set(p);
2847 if (CanDestroyPath())
2848 {
2850 {
2851 return MoveResult.Success;
2852 }
2853 Debug.Log(CanMoveTo(pos));
2855 }
2856 int num = pos.Distance(p);
2857 PathProgress pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Default, num + 4, 1);
2858 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 4)
2859 {
2860 PathFinderNode pathFinderNode = pathProgress.nodes[pathProgress.nodes.Count - 1];
2861 if (TryMove(new Point(pathFinderNode.X, pathFinderNode.Z)) == MoveResult.Success)
2862 {
2863 return MoveResult.Success;
2864 }
2865 }
2866 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Combat, num + 4, 1);
2867 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 4)
2868 {
2869 PathFinderNode pathFinderNode2 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2870 if (TryMove(new Point(pathFinderNode2.X, pathFinderNode2.Z)) == MoveResult.Success)
2871 {
2872 return MoveResult.Success;
2873 }
2874 }
2875 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Default, num + 25, 2);
2876 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 25)
2877 {
2878 PathFinderNode pathFinderNode3 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2879 if (TryMove(new Point(pathFinderNode3.X, pathFinderNode3.Z)) == MoveResult.Success)
2880 {
2881 return MoveResult.Success;
2882 }
2883 }
2884 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Combat, num + 25, 2);
2885 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 25)
2886 {
2887 PathFinderNode pathFinderNode4 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2888 if (TryMove(new Point(pathFinderNode4.X, pathFinderNode4.Z)) == MoveResult.Success)
2889 {
2890 return MoveResult.Success;
2891 }
2892 }
2893 return MoveResult.Fail;
2894 }
static Point _sharedPos
Definition: Chara.cs:178
void RequestPathImmediate(PathProgress progress)
Definition: PathManager.cs:41
List< PathFinderNode > nodes
Definition: PathProgress.cs:16
bool TooHeavyToMove()
Definition: Player.cs:2653
Point GetPointTowards(Point dest)
Definition: Point.cs:806

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

10179 {
10180 if (TC == null || TC.HasCondition<ConInvulnerable>() || TC.Evalue(1421) > 0 || !TC.ExistsOnMap)
10181 {
10182 return false;
10183 }
10184 if (TC.hp > (long)TC.MaxHP * (long)(Mathf.Min(5 + (int)Mathf.Sqrt(power), harvest ? 35 : 25) + Evalue(1426) * 5) / (TC.IsPowerful ? 200 : 100))
10185 {
10186 return false;
10187 }
10188 if (TC.HasElement(427))
10189 {
10190 return false;
10191 }
10192 if (TC.IsPC && EClass.player.invlunerable)
10193 {
10194 return false;
10195 }
10196 PlaySound("hit_finish");
10197 Say("finish");
10198 Say("finish2", this, TC);
10199 TC.DamageHP(TC.MaxHP, AttackSource.Finish, this);
10200 return false;
10201 }
@ harvest
bool invlunerable
Definition: Player.cs:1243
Definition: TC.cs:4

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

Referenced by ActEffect.Proc().

◆ TryNullifyCurse()

bool Chara.TryNullifyCurse ( )
inline

Definition at line 10652 of file Chara.cs.

10653 {
10654 if (IsPCParty)
10655 {
10656 foreach (Chara member in EClass.pc.party.members)
10657 {
10658 if (member.HasElement(1641) && EClass.rnd(3) != 0)
10659 {
10660 Msg.Say("curse_nullify", member);
10661 return true;
10662 }
10663 }
10664 }
10665 else if (HasElement(1641) && EClass.rnd(3) != 0)
10666 {
10667 Say("curse_nullify", this);
10668 return true;
10669 }
10670 if (GetCondition<ConHolyVeil>() != null && EClass.rnd(5) != 0)
10671 {
10672 Say("curse_nullify", this);
10673 return true;
10674 }
10675 return false;
10676 }

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

◆ TryPickGroundItem()

void Chara.TryPickGroundItem ( Func< Card, bool >  func = null)
inline

Definition at line 4660 of file Chara.cs.

4661 {
4662 foreach (Card item in pos.ListCards())
4663 {
4664 if ((IsPC || !(EClass.pc.ai is AI_UseCrafter aI_UseCrafter) || !aI_UseCrafter.ings.Contains(item)) && item.isThing && item.placeState == PlaceState.roaming && CanPick(item) && (func == null || func(item)))
4665 {
4666 Thing thing = Pick(item.Thing);
4667 if (thing != null && !IsPC)
4668 {
4669 thing.isNPCProperty = true;
4670 }
4671 break;
4672 }
4673 }
4674 }

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

Referenced by AI_Fish.Run().

◆ TryPoisonPotion()

Thing Chara.TryPoisonPotion ( Thing  t)
inline

Definition at line 4592 of file Chara.cs.

4593 {
4594 if (t.trait is TraitPotion && t.id != "1165" && !t.source.tag.Contains("neg") && EClass.rnd(2) == 0 && HasElement(1565))
4595 {
4596 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)
4597 .id;
4598 Say("poisonDrip", this);
4599 int num = t.Num;
4600 t.Destroy();
4601 t = ThingGen.Create(text).SetNum(num);
4602 }
4603 return t;
4604 }
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 3430 of file Chara.cs.

3431 {
3432 List<Chara> list = point.ListCharas();
3433 if (list.Count == 0)
3434 {
3435 return;
3436 }
3437 list.Copy().ForeachReverse(delegate(Chara c)
3438 {
3439 if ((trait is TraitSnitch && c.IsPCFactionOrMinion) || (!c.ai.IsMoveAI && !c.IsPC && c.trait.CanBePushed && c != this && !c.noMove && (!EClass._zone.IsRegion || c.IsPCFactionOrMinion)))
3440 {
3441 List<Point> list2 = new List<Point>();
3442 for (int i = point.x - 1; i <= point.x + 1; i++)
3443 {
3444 for (int j = point.z - 1; j <= point.z + 1; j++)
3445 {
3446 if (i != point.x || j != point.z)
3447 {
3448 Point point2 = new Point(i, j);
3449 if (point2.IsValid && !point2.HasChara && !point2.IsBlocked && !point2.cell.hasDoor && !point2.IsBlockByHeight(point))
3450 {
3451 list2.Add(point2);
3452 }
3453 }
3454 }
3455 }
3456 if (list2.Count > 0)
3457 {
3458 if (list2.Count > 1)
3459 {
3460 list2.ForeachReverse(delegate(Point p)
3461 {
3462 if (p.Equals(new Point(point.x + point.x - pos.x, point.z + point.z - pos.z)))
3463 {
3464 list2.Remove(p);
3465 }
3466 });
3467 }
3468 Point newPoint = list2.RandomItem();
3469 if (IsPC)
3470 {
3471 Say("displace", this, c);
3472 PlaySound("push");
3473 }
3474 else if (c.isSynced)
3475 {
3476 c.PlayEffect("push");
3477 }
3478 c.MoveByForce(newPoint, this, checkWall: true);
3479 if (!c.IsPC && c.trait is TraitRogue && EClass.rnd(3) == 0 && GetCurrency() > 20 && !HasElement(426))
3480 {
3481 int num = EClass.rndHalf(10 + Mathf.Min(GetCurrency() / 100, 1000));
3482 c.Talk("pushed");
3483 Say("pushed_money", this, c);
3484 ModCurrency(-num);
3485 c.ModCurrency(num);
3486 c.PlaySound("steal_money");
3487 }
3488 else if (IsPC && !c.IsPCParty && !c.IsUnique && c.IsHumanSpeak && EClass.rnd(5) == 0)
3489 {
3490 c.Talk("pushed");
3491 }
3492 }
3493 }
3494 });
3495 }
bool IsMoveAI
Definition: AIAct.cs:55
bool IsHumanSpeak
Definition: Chara.cs:1062

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

4677 {
4678 if (!EClass._zone.TryAddThingInSharedContainer(t, containers) && dropIfFail)
4679 {
4680 EClass._zone.AddCard(t, pos);
4681 }
4682 }
bool TryAddThingInSharedContainer(Thing t, List< Thing > containers=null, bool add=true, bool msg=false, Chara chara=null, bool sharedOnly=true)
Definition: Zone.cs:2233

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

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

7745 {
7746 if (GetInt(113) != 0)
7747 {
7748 return;
7749 }
7750 _ListItems.Clear();
7751 Thing bestRangedWeapon = GetBestRangedWeapon();
7752 foreach (Thing thing in things)
7753 {
7754 if (!thing.IsAmmo && !thing.c_isImportant)
7755 {
7756 if (thing.category.slot != 0 && !thing.isEquipped && !thing.HasTag(CTAG.gift))
7757 {
7758 _ListItems.Add(thing);
7759 }
7760 else if (thing.IsRangedWeapon && thing.category.slot == 0 && bestRangedWeapon != thing)
7761 {
7762 _ListItems.Add(thing);
7763 }
7764 }
7765 }
7766 if (_ListItems.Count == 0)
7767 {
7768 return;
7769 }
7770 List<Thing> containers2 = containers.ToList();
7771 foreach (Thing listItem in _ListItems)
7772 {
7773 EClass._zone.TryAddThingInSharedContainer(listItem, containers2, add: true, msg: true, this);
7774 }
7775 }
void Add(Act a, string s="")
Definition: ActPlan.cs:11
static List< Thing > _ListItems
Definition: Chara.cs:194

References EClass._zone, Card.c_isImportant, Card.category, Card.HasTag(), Card.IsAmmo, Thing.isEquipped, Card.IsRangedWeapon, and Zone.TryAddThingInSharedContainer().

Referenced by AI_Idle.Run().

◆ TryReservePickupTutorial()

void Chara.TryReservePickupTutorial ( Thing  t)
inline

Definition at line 4636 of file Chara.cs.

4637 {
4638 if (t.id == "axe")
4639 {
4640 Tutorial.Reserve("tool");
4641 }
4642 if (t.category.id == "mushroom")
4643 {
4644 Tutorial.Reserve("food");
4645 }
4646 if (t.category.id == "herb")
4647 {
4648 Tutorial.Reserve("herb");
4649 }
4650 if (t.id == "pasture")
4651 {
4652 Tutorial.Reserve("pasture");
4653 }
4654 if (t.id == "log")
4655 {
4656 Tutorial.Reserve("process");
4657 }
4658 }

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

◆ TryRestock()

void Chara.TryRestock ( bool  onCreate)
inline

Definition at line 4921 of file Chara.cs.

4922 {
4923 isOnCreate = onCreate;
4924 if (onCreate || (!IsPCFaction && (base.IsUnique || trait is TraitAdventurer || trait is TraitGuard)))
4925 {
4926 RestockEquip((!EClass.core.IsGameStarted || !(EClass._zone is Zone_Music)) && onCreate);
4927 }
4928 RestockInventory(onCreate);
4929 }
void RestockInventory(bool onCreate)
Definition: Chara.cs:5268
void RestockEquip(bool onCreate)
Definition: Chara.cs:4931

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

6637 {
6638 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))
6639 {
6640 SetEnemy(c);
6641 }
6642 }

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

7783 {
7785 }
void TryTakeSharedItems(bool msg=true)
Definition: Chara.cs:7782

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

7788 {
7789 if (base.isSummon || (memberType == FactionMemberType.Livestock && homeBranch != null && !homeBranch.policies.IsActive(2715)))
7790 {
7791 return;
7792 }
7793 int num = 2;
7794 int num2 = 1;
7795 int num3 = 2;
7796 bool flag = GetInt(113) == 0;
7797 int num4 = 2;
7798 int num5 = 2;
7799 int num6 = 2;
7801 {
7802 num5 = 0;
7803 num6 = 0;
7804 }
7805 foreach (Thing thing3 in things)
7806 {
7807 if (CanEat(thing3, shouldEat))
7808 {
7809 if (thing3.HasElement(757))
7810 {
7811 num2 -= thing3.Num;
7812 num -= thing3.Num;
7813 }
7814 else
7815 {
7816 num -= thing3.Num;
7817 }
7818 }
7819 if (thing3.trait.GetHealAction(this) != null)
7820 {
7821 num3 -= thing3.Num;
7822 }
7823 if (thing3.id == "polish_powder")
7824 {
7825 num4 -= thing3.Num;
7826 }
7827 if (thing3.trait is TraitBlanketColdproof)
7828 {
7829 num5 -= thing3.Num;
7830 }
7831 if (thing3.trait is TraitBlanketFireproof)
7832 {
7833 num6 -= thing3.Num;
7834 }
7835 }
7836 _ListItems.Clear();
7837 foreach (Thing container in containers)
7838 {
7839 if (!container.IsSharedContainer)
7840 {
7841 continue;
7842 }
7843 foreach (Thing thing4 in container.things)
7844 {
7845 if (!thing4.c_isImportant && thing4.IsIdentified && thing4 != EClass.pc.held)
7846 {
7847 if (num4 > 0 && thing4.id == "polish_powder")
7848 {
7849 _ListItems.Add(thing4);
7850 num4 -= thing4.Num;
7851 }
7852 else if (num5 > 0 && !HasElement(1236) && thing4.trait is TraitBlanketColdproof)
7853 {
7854 _ListItems.Add(thing4);
7855 num5 -= thing4.Num;
7856 }
7857 else if (num6 > 0 && thing4.trait is TraitBlanketFireproof)
7858 {
7859 _ListItems.Add(thing4);
7860 num6 -= thing4.Num;
7861 }
7862 else if (num2 > 0 && CanEat(thing4, shouldEat) && !thing4.c_isImportant && thing4.HasElement(757))
7863 {
7864 _ListItems.Add(thing4);
7865 num2 -= thing4.Num;
7866 }
7867 else if (num > 0 && CanEat(thing4, shouldEat) && !thing4.c_isImportant)
7868 {
7869 _ListItems.Add(thing4);
7870 num -= thing4.Num;
7871 }
7872 else if (num3 > 0 && thing4.trait.GetHealAction(this) != null)
7873 {
7874 _ListItems.Add(thing4);
7875 num3 -= thing4.Num;
7876 }
7877 else if (flag && thing4.IsEquipmentOrRanged && !thing4.HasTag(CTAG.gift) && ShouldEquip(thing4, useFav: true))
7878 {
7879 _ListItems.Add(thing4);
7880 }
7881 }
7882 }
7883 }
7884 if (_ListItems.Count == 0)
7885 {
7886 return;
7887 }
7888 _ListItems.ForeachReverse(delegate(Thing t)
7889 {
7890 if (t.IsEquipmentOrRanged)
7891 {
7892 bool flag3 = false;
7893 int slot = t.category.slot;
7894 int equipValue = t.GetEquipValue();
7895 foreach (Thing listItem in _ListItems)
7896 {
7897 if (listItem.category.slot == slot && listItem.GetEquipValue() > equipValue)
7898 {
7899 flag3 = true;
7900 break;
7901 }
7902 }
7903 if (flag3)
7904 {
7905 _ListItems.Remove(t);
7906 }
7907 }
7908 });
7909 bool flag2 = false;
7910 foreach (Thing listItem2 in _ListItems)
7911 {
7912 Thing thing = listItem2;
7913 if (things.IsFull(thing))
7914 {
7915 break;
7916 }
7917 Thing thing2 = listItem2.parent as Thing;
7918 if (thing.HasElement(757))
7919 {
7920 if (thing.Num > 1)
7921 {
7922 thing = thing.Split(1);
7923 }
7924 }
7925 else if (thing.Num > 2)
7926 {
7927 thing = thing.Split(2);
7928 }
7929 if (msg)
7930 {
7931 Say("takeSharedItem", this, thing, thing2.GetName(NameStyle.Full));
7932 }
7933 AddCard(thing);
7934 if (ShouldEquip(thing, useFav: true) && thing.category.slot != 0)
7935 {
7936 TryEquip(thing, useFav: true);
7937 flag2 = true;
7938 }
7939 }
7940 if (flag2 && flag)
7941 {
7942 TryPutSharedItems(containers);
7943 }
7944 }
bool IsIdentified
Definition: Card.cs:2447
bool HasItemProtection
bool IsActive(int id, int days=-1)
override string GetName(NameStyle style, int _num=-1)
Definition: Thing.cs:532
bool IsSharedContainer
Definition: Thing.cs:110

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

9065 {
9066 if (!EClass.debug.enable || IsPC || !IsGlobal || !IsPCFaction)
9067 {
9068 return;
9069 }
9070 for (int i = 0; i < 100; i++)
9071 {
9072 if (base.feat == 0)
9073 {
9074 break;
9075 }
9076 if (base.c_upgrades == null)
9077 {
9078 base.c_upgrades = new CharaUpgrade();
9079 }
9080 if (base.c_upgrades.halt)
9081 {
9082 break;
9083 }
9084 Rand.SetSeed(base.uid + base.c_upgrades.count);
9085 int num = EClass.rnd(100);
9086 int num2 = 0;
9087 int num3 = 1;
9088 int num4 = 0;
9089 bool flag = false;
9090 IEnumerable<SourceElement.Row> ie = EClass.sources.elements.rows.Where((SourceElement.Row a) => !elements.Has(a) && a.category == "skill" && !a.tag.Contains("noPet"));
9091 List<Element> list = ListAvailabeFeats(pet: true);
9092 if (num >= 90 && list.Count > 0)
9093 {
9094 Element element = list.RandomItem();
9095 num2 = element.id;
9096 num4 = element.CostLearn;
9097 }
9098 else if (num >= 60 && ie.Any())
9099 {
9100 num2 = ie.RandomItem().id;
9101 num4 = 3;
9102 }
9103 else
9104 {
9105 num2 = Element.List_MainAttributesMajor.RandomItem();
9106 num4 = 1;
9107 num3 = 2;
9108 flag = true;
9109 }
9110 Rand.SetSeed();
9111 if (num4 > base.feat)
9112 {
9113 break;
9114 }
9115 base.feat -= num4;
9116 base.c_upgrades.count++;
9117 base.c_upgrades.spent += num4;
9118 bool flag2 = false;
9119 if (flag)
9120 {
9121 foreach (CharaUpgrade.Item item in base.c_upgrades.items)
9122 {
9123 if (item.idEle == num2)
9124 {
9125 item.value += num3;
9126 item.cost += num4;
9127 flag2 = true;
9128 break;
9129 }
9130 }
9131 }
9132 if (!flag2)
9133 {
9134 base.c_upgrades.items.Add(new CharaUpgrade.Item
9135 {
9136 idEle = num2,
9137 value = num3,
9138 cost = num4
9139 });
9140 }
9141 SourceElement.Row row = EClass.sources.elements.map[num2];
9142 if (row.category == "feat")
9143 {
9144 SetFeat(num2, elements.ValueWithoutLink(num2) + 1, msg: true);
9145 }
9146 else if (elements.ValueWithoutLink(row.id) == 0)
9147 {
9148 elements.Learn(row.id);
9149 }
9150 else
9151 {
9152 elements.ModBase(num2, num3);
9153 }
9154 }
9155 }
List< Element > ListAvailabeFeats(bool pet=false, bool showAll=false)
Definition: Chara.cs:10413
void Learn(int ele, int v=1)
virtual int CostLearn
Definition: ELEMENT.cs:323
static int[] List_MainAttributesMajor
Definition: ELEMENT.cs:251
static void SetSeed(int a=-1)
Definition: Rand.cs:44

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

8284 {
8285 if (t.id == "338" && t.blessedState >= BlessedState.Normal)
8286 {
8287 Thing thing = things.Find((Thing a) => a.IsEquipmentOrRanged && !a.isAcidproof);
8288 if (thing != null)
8289 {
8290 Say("dip", this, thing, t.GetName(NameStyle.Full, 1));
8291 SE.Change();
8292 t.trait.OnBlend(thing, this);
8293 return true;
8294 }
8295 return false;
8296 }
8297 if (t.IsNegativeGift || t.source.HasTag(CTAG.ignoreUse))
8298 {
8299 return false;
8300 }
8301 if (t.id == "cigar")
8302 {
8303 (t.trait as TraitItemProc).OnUse(this);
8304 return true;
8305 }
8306 if (t.trait.CanDrink(this))
8307 {
8308 Drink(t);
8309 return true;
8310 }
8311 if (t.trait.CanEat(this) && hunger.GetPhase() > ((IsPCFaction || IsPCFactionMinion) ? 2 : 0))
8312 {
8314 {
8315 target = t
8316 });
8317 return true;
8318 }
8319 if (t.trait.CanRead(this))
8320 {
8322 {
8323 target = t
8324 });
8325 return true;
8326 }
8327 if (base.hp < MaxHP * 90 / 100)
8328 {
8329 Action healAction = t.trait.GetHealAction(this);
8330 if (healAction != null)
8331 {
8332 healAction();
8333 return true;
8334 }
8335 }
8336 return false;
8337 }
bool isAcidproof
Definition: Card.cs:689
void SetAIImmediate(AIAct g)
Definition: Chara.cs:9425
virtual bool CanRead(Chara c)
Definition: Trait.cs:1156
virtual bool CanDrink(Chara c)
Definition: Trait.cs:1174
virtual void OnBlend(Thing t, Chara c)
Definition: Trait.cs:645

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

9697 {
9698 if (EClass.world.date.IsExpired(GetInt(51)))
9699 {
9700 Expedition expedition = Expedition.Create(this, sourceWork.expedition.ToEnum<ExpeditionType>());
9701 SetInt(51, EClass.world.date.GetRaw() + 60 * (expedition.hours + 24));
9702 homeBranch.expeditions.Add(expedition);
9703 return true;
9704 }
9705 return false;
9706 }
ExpeditionType
void Add(Expedition ex)
static Expedition Create(Chara c, ExpeditionType type)
Definition: Expedition.cs:112
int hours
Definition: Expedition.cs:6
ExpeditionManager expeditions
string expedition
Definition: SourceHobby.cs:29

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

◆ UnmakeMinion()

void Chara.UnmakeMinion ( )
inline

Definition at line 2552 of file Chara.cs.

2553 {
2554 base.c_uidMaster = 0;
2555 master = null;
2556 enemy = null;
2557 foreach (Chara chara in EClass._map.charas)
2558 {
2559 if (chara.enemy == this)
2560 {
2561 chara.SetEnemy();
2562 chara.ai.Cancel();
2563 }
2564 }
2565 ai.Cancel();
2566 Refresh();
2567 }

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

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

◆ UpdateAngle()

void Chara.UpdateAngle ( )
inline

Definition at line 3799 of file Chara.cs.

3800 {
3801 if (IsPCC)
3802 {
3803 if (base.dir == 0)
3804 {
3805 angle = 225f;
3806 }
3807 else if (base.dir == 1)
3808 {
3809 angle = 135f;
3810 }
3811 else if (base.dir == 2)
3812 {
3813 angle = 45f;
3814 }
3815 else if (base.dir == 3)
3816 {
3817 angle = -45f;
3818 }
3819 }
3820 else if (base.dir == 0)
3821 {
3822 angle = 165f;
3823 }
3824 else if (base.dir == 1)
3825 {
3826 angle = 300f;
3827 }
3828 else if (base.dir == 2)
3829 {
3830 angle = 0f;
3831 }
3832 else if (base.dir == 3)
3833 {
3834 angle = 120f;
3835 }
3836 }

Referenced by OnDeserialized().

◆ UpdateSight()

void Chara.UpdateSight ( )
inline

Definition at line 3860 of file Chara.cs.

3861 {
3862 int num = 4;
3863 for (int i = -num; i < num + 1; i++)
3864 {
3865 for (int j = -num; j < num + 1; j++)
3866 {
3867 shared.Set(pos.x + i, pos.z + j);
3868 if (shared.IsValid && !shared.cell.isSeen && i >= -1 && i <= 1 && j >= -1)
3869 {
3870 _ = 1;
3871 }
3872 }
3873 }
3874 }
bool isSeen
Definition: Cell.cs:290
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 6091 of file Chara.cs.

6092 {
6093 if (HasCooldown(a.id))
6094 {
6095 return false;
6096 }
6097 if (!a.ValidatePerform(this, tc, pos))
6098 {
6099 return false;
6100 }
6101 if (a.source.proc.TryGet(0) == "Heal" && HasElement(1422) && !IsPC)
6102 {
6103 List<int> list = new List<int> { 8400, 8401, 8402, 8403, 8404, 8405 };
6104 int num = list.IndexOf(a.id);
6105 if (num != -1)
6106 {
6107 int num2 = list.TryGet(num + Evalue(1422));
6108 a = elements.GetElement(num2)?.act ?? ACT.Create(num2);
6109 }
6110 }
6111 int num3 = 1;
6112 Act.Cost cost = a.GetCost(this);
6113 a.GetPower(this);
6114 int i = 1;
6115 int num4 = 0;
6116 bool flag = a.IsTargetHostileParty();
6117 bool flag2 = ability.Has(a.id);
6118 if (IsPC && HasCondition<StanceManaCost>())
6119 {
6120 num4 = Evalue(1657);
6121 }
6122 _pts.Clear();
6123 if (a.TargetType.ForceParty)
6124 {
6125 pt = true;
6126 }
6127 if (pt)
6128 {
6129 i = 0;
6130 if (flag)
6131 {
6132 ForeachEnemy(delegate
6133 {
6134 i++;
6135 });
6136 }
6137 else
6138 {
6139 ForeachParty(delegate
6140 {
6141 i++;
6142 });
6143 }
6144 }
6145 if (a is Spell && IsPC && a.vPotential < i && !flag2)
6146 {
6147 i = 1;
6148 _pts.Clear();
6149 _pts.Add(this);
6150 pt = false;
6151 }
6152 int num5 = 100;
6153 if (!a.TargetType.ForceParty && i > 1)
6154 {
6155 num5 = (IsPC ? (i * 100) : (50 + i * 50));
6156 }
6157 int num6 = cost.cost * num5 / 100;
6158 if (cost.type == Act.CostType.MP && Evalue(483) > 0)
6159 {
6160 num6 = num6 * 100 / (100 + (int)Mathf.Sqrt(Evalue(483) * 10) * 3);
6161 }
6162 if (i == 0)
6163 {
6164 if (IsPC)
6165 {
6167 }
6168 return false;
6169 }
6170 if (!IsPC && cost.type == Act.CostType.MP && mana.value < 0 && (EClass.rnd(4) != 0 || IsPCFaction || (base.IsPowerful && mana.value < -20)))
6171 {
6172 return false;
6173 }
6174 if (IsPC)
6175 {
6176 if (!Dialog.warned && cost.type == Act.CostType.MP && cost.cost > 0 && mana.value < num6 && !EClass.debug.godMode)
6177 {
6178 Card cardBk = EClass.scene.mouseTarget.card;
6179 ActPlan.warning = true;
6180 Dialog.TryWarnMana(delegate
6181 {
6182 EClass.scene.mouseTarget.card = cardBk;
6183 if (UseAbility(a, tc, pos, pt))
6184 {
6186 }
6187 });
6188 return false;
6189 }
6190 EClass.ui.CloseLayers();
6191 }
6192 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))
6193 {
6194 Say("shakeHead", this);
6195 return true;
6196 }
6197 if (tc != null && tc != this)
6198 {
6199 LookAt(tc.pos);
6200 }
6201 if (pos != null && !base.pos.Equals(pos))
6202 {
6203 LookAt(pos);
6204 }
6205 if (a.CanRapidFire && HasElement(1648))
6206 {
6207 num3 = 1 + Evalue(1648);
6208 }
6209 if (IsPC && cost.cost > 0 && a.Value == 0 && !flag2)
6210 {
6212 return false;
6213 }
6214 if (a is Spell)
6215 {
6216 string s = (isConfused ? "_cast_confuse" : (HasCondition<ConDim>() ? "_cast_dim" : ""));
6217 if (!a.source.tag.Contains("useHand"))
6218 {
6219 Say(race.castStyle.IsEmpty("cast"), this, a.source.GetName().ToLower(), s.lang());
6220 }
6221 if (IsPC)
6222 {
6223 _ = (i + 1) / 2;
6224 if (a.vPotential < i && !flag2)
6225 {
6226 Msg.Say("noSpellStock");
6227 EInput.Consume();
6228 return false;
6229 }
6230 if (num4 > 0 && (a.vPotential >= i * 2 || flag2))
6231 {
6232 if (!flag2)
6233 {
6234 a.vPotential -= i * 2;
6235 }
6236 num6 = num6 * (100 - num4 * 20) / 100;
6237 }
6238 else if (!flag2)
6239 {
6240 a.vPotential -= i;
6241 }
6243 }
6244 }
6245 else
6246 {
6247 if (IsPC && HasElement(1274) && a.vPotential < 0 && !flag2 && !a.HasTag("dontForget"))
6248 {
6249 Msg.Say("noSpellStock");
6250 EInput.Consume();
6251 return false;
6252 }
6253 if (a.source.langAct.Length != 0 && tc != null)
6254 {
6255 string text = a.source.langAct[0];
6256 string text2 = ((a.source.langAct.Length >= 2) ? a.source.langAct[1] : "");
6257 if (text == "spell_hand")
6258 {
6259 string[] list2 = Lang.GetList("attack" + race.meleeStyle.IsEmpty("Touch"));
6260 string @ref = text2.lang(list2[4]);
6261 Say(tc.IsPCParty ? "cast_hand_ally" : "cast_hand", this, tc, @ref, tc.IsPCParty ? list2[1] : list2[2]);
6262 }
6263 else
6264 {
6265 Say(text, this, tc, text2.IsEmpty() ? "" : text2.lang());
6266 }
6267 if (a.source.id == 6630)
6268 {
6269 Talk("insult_" + (base.IsMale ? "m" : "f"));
6270 }
6271 }
6272 }
6273 switch (cost.type)
6274 {
6275 case Act.CostType.MP:
6276 if (Evalue(1421) >= 2 && base.hp <= MaxHP / Mathf.Max(1, 9 - Evalue(1421) * 2))
6277 {
6278 num6 /= 2;
6279 }
6280 if (isSynced)
6281 {
6282 PlayEffect("cast");
6283 }
6284 mana.Mod(-num6);
6285 if (isDead)
6286 {
6287 return true;
6288 }
6289 elements.ModExp(304, Mathf.Clamp(num6 * 2, 1, 200));
6290 break;
6291 case Act.CostType.SP:
6292 stamina.Mod(-num6);
6293 ignoreSPAbsorb = true;
6294 break;
6295 }
6296 if (a is Spell && GetCondition<ConSilence>() != null)
6297 {
6298 Say("cast_silence", this);
6299 return true;
6300 }
6301 if (isDead)
6302 {
6303 return true;
6304 }
6305 int spellExp = elements.GetSpellExp(this, a, num5);
6306 if (EClass.rnd(100) >= CalcCastingChance(a, i) && !EClass.debug.godMode)
6307 {
6308 Say("fizzle", this);
6309 PlayEffect("fizzle");
6310 PlaySound("fizzle");
6311 if (cost.cost > 0 && a.source.lvFactor > 0)
6312 {
6313 ModExp(a.id, spellExp / 5);
6314 }
6315 RemoveCondition<ConInvisibility>();
6316 return true;
6317 }
6318 bool flag3 = true;
6319 if (a.source.cooldown > 0 && (!IsPC || !a.source.tag.Contains("CD_npc")))
6320 {
6321 AddCooldown(a.id, a.source.cooldown);
6322 }
6323 if (HasTalk("phrase_" + a.source.alias))
6324 {
6325 EClass.player.forceTalk = true;
6326 Talk("phrase_" + a.source.alias);
6327 }
6328 if (pt)
6329 {
6330 Act.forcePt = true;
6331 if (flag)
6332 {
6333 ForeachEnemy(delegate(Chara c)
6334 {
6335 a.Perform(this, c, c.pos);
6336 });
6337 }
6338 else
6339 {
6340 ForeachParty(delegate(Chara c)
6341 {
6342 a.Perform(this, c, c.pos);
6343 });
6344 }
6345 Act.forcePt = false;
6346 }
6347 else
6348 {
6349 for (int j = 0; j < num3; j++)
6350 {
6351 if (a.TargetType != TargetType.SelfParty && tc != null && !tc.IsAliveInCurrentZone)
6352 {
6353 break;
6354 }
6355 ActEffect.RapidCount = j;
6356 ActEffect.RapidDelay = a.RapidDelay;
6357 flag3 = a.Perform(this, tc, pos);
6358 }
6359 }
6360 if (flag3 && !isDead)
6361 {
6362 if (IsPC && flag2 && elements.Base(a.id) == 0 && a.PotentialAsStock)
6363 {
6364 elements.ModBase(a.id, 1);
6365 }
6366 if (cost.cost > 0 && a.source.lvFactor > 0)
6367 {
6368 ModExp(a.id, spellExp);
6369 }
6370 }
6371 ActEffect.RapidCount = 0;
6372 if (flag3 && !a.source.tag.Contains("keepInvisi") && EClass.rnd(2) == 0)
6373 {
6374 RemoveCondition<ConInvisibility>();
6375 RemoveCondition<ConDark>();
6376 }
6377 if (!base.IsPCFactionOrMinion && a.HasTag("specialAbility") && renderer.isSynced)
6378 {
6379 string name = a.Name;
6380 renderer.Say("| " + name + " ");
6381 }
6382 return flag3;
6383 void ForeachEnemy(Action<Chara> action)
6384 {
6385 if (_pts.Count == 0)
6386 {
6387 for (int num10 = EClass._map.charas.Count - 1; num10 >= 0; num10--)
6388 {
6389 Chara chara3 = EClass._map.charas[num10];
6390 if (chara3 != this && CanSeeLos(chara3) && chara3.IsHostile(this))
6391 {
6392 _pts.Add(chara3);
6393 }
6394 }
6395 }
6396 for (int num11 = _pts.Count - 1; num11 >= 0; num11--)
6397 {
6398 action(_pts[num11]);
6399 }
6400 }
6401 void ForeachParty(Action<Chara> action)
6402 {
6403 if (_pts.Count == 0)
6404 {
6405 if (IsPCParty)
6406 {
6407 for (int num7 = EClass.pc.party.members.Count - 1; num7 >= 0; num7--)
6408 {
6409 Chara chara = EClass.pc.party.members[num7];
6410 if (chara == this || chara.host != null || CanSeeLos(chara))
6411 {
6412 _pts.Add(chara);
6413 }
6414 }
6415 }
6416 else
6417 {
6418 for (int num8 = EClass._map.charas.Count - 1; num8 >= 0; num8--)
6419 {
6420 Chara chara2 = EClass._map.charas[num8];
6421 if ((chara2 == this || (chara2.IsFriendOrAbove(this) && CanSeeLos(chara2))) && (chara2 == tc || _pts.Count < 3 || EClass.rnd(_pts.Count * _pts.Count) > 6))
6422 {
6423 _pts.Add(chara2);
6424 }
6425 }
6426 }
6427 }
6428 for (int num9 = _pts.Count - 1; num9 >= 0; num9--)
6429 {
6430 action(_pts[num9]);
6431 }
6432 }
6433 }
Definition: ACT.cs:6
static Act Create(int id)
Definition: ACT.cs:36
Definition: ACT.cs:62
CostType
Definition: ACT.cs:64
virtual bool Perform()
Definition: ACT.cs:266
virtual TargetType TargetType
Definition: ACT.cs:144
virtual float RapidDelay
Definition: ACT.cs:177
virtual bool ValidatePerform(Chara _cc, Card _tc, Point _tp)
Definition: ACT.cs:321
bool IsTargetHostileParty()
Definition: ACT.cs:241
virtual bool CanRapidFire
Definition: ACT.cs:175
bool HasTalk(string idTopic)
Definition: Card.cs:7161
bool Has(int id)
static List< Chara > _pts
Definition: Chara.cs:190
int CalcCastingChance(Element e, int num=1)
Definition: Chara.cs:6444
Definition: Dialog.cs:7
static bool warned
Definition: Dialog.cs:50
static void TryWarnMana(Action action)
Definition: Dialog.cs:399
int GetSpellExp(Chara c, Element e, int costMod=100)
int vPotential
Definition: ELEMENT.cs:265
virtual int GetPower(Card c)
Definition: ELEMENT.cs:1094
virtual Act.Cost GetCost(Chara c)
Definition: ELEMENT.cs:1053
virtual bool PotentialAsStock
Definition: ELEMENT.cs:345
Act act
Definition: ELEMENT.cs:403
PointTarget mouseTarget
Definition: Scene.cs:135
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, PointTarget.card, SourceRace.Row.castStyle, Map.charas, EInput.Consume(), Act.Cost.cost, ACT.Create(), EClass.debug, Player.EndTurn(), TargetType.ForceParty, Element.GetCost(), Lang.GetList(), Element.GetPower(), CoreDebug.godMode, CharaAbility.Has(), Element.HasTag(), host, Element.id, IsFriendOrAbove(), IsHostile(), Act.IsTargetHostileParty(), SourceRace.Row.meleeStyle, Party.members, Stats.Mod(), Scene.mouseTarget, Element.Name, party, EClass.pc, Act.Perform(), EClass.player, Card.pos, Element.PotentialAsStock, Act.RapidDelay, EClass.rnd(), Msg.Say(), Msg.SayNothingHappen(), EClass.scene, TargetType.SelfParty, LayerAbility.SetDirty(), Element.source, Act.TargetType, Dialog.TryWarnMana(), Act.Cost.type, EClass.ui, Act.ValidatePerform(), Element.Value, Stats.value, Element.vPotential, and Dialog.warned.

◆ UseAbility() [2/3]

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

◆ UseAbility() [3/3]

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

Definition at line 6086 of file Chara.cs.

6087 {
6088 return UseAbility(elements.GetElement(idAct)?.act ?? ACT.Create(idAct), tc, pos, pt);
6089 }

References ACT.Create().

◆ ValidateWorks()

void Chara.ValidateWorks ( )
inline

Definition at line 9744 of file Chara.cs.

9745 {
9746 _goalWork.FindWork(this, setAI: false);
9748 }
static GoalHobby _goalHobby
Definition: Chara.cs:212
static GoalWork _goalWork
Definition: Chara.cs:210
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 5552 of file Chara.cs.

5553 {
5554 base.c_vomit++;
5555 Say("vomit", this);
5556 PlaySound("vomit");
5557 if (!EClass._zone.IsRegion)
5558 {
5559 Thing thing = ThingGen.Create("731");
5561 {
5562 thing.MakeRefFrom(this);
5563 }
5564 EClass._zone.AddCard(thing, pos);
5565 }
5566 if (HasCondition<ConAnorexia>())
5567 {
5568 ModExp(70, -50);
5569 ModExp(71, -75);
5570 ModExp(77, -100);
5571 }
5572 else if (base.c_vomit > 10)
5573 {
5574 AddCondition<ConAnorexia>();
5575 }
5576 AddCondition<ConDim>();
5577 if (HasCondition<ConAnorexia>())
5578 {
5579 ModWeight(-1 * (1 + EClass.rnd(5)));
5580 }
5581 if (hunger.GetPhase() >= 4)
5582 {
5583 DamageHP(9999L, AttackSource.Hunger);
5584 }
5585 hunger.Mod(30);
5586 }
void ModWeight(int a, bool ignoreLimit=false)
Definition: Chara.cs:10341

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

3877 {
3878 for (int num = conditions.Count - 1; num >= 0; num--)
3879 {
3880 if (conditions[num].ConsumeTurn)
3881 {
3882 return true;
3883 }
3884 }
3885 return false;
3886 }

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

7662 {
7663 n.Clear();
7664 UIItem uIItem = n.AddHeaderCard(base.Name.ToTitleCase());
7665 SetImage(uIItem.image2);
7666 uIItem.text2.SetText(race.GetText().ToTitleCase(wholeText: true) + " " + job.GetText().ToTitleCase(wholeText: true));
7667 n.AddText("");
7668 n.Build();
7669 }
void SetImage(Image image, int dir, int idSkin=0)
Definition: Card.cs:6547
Definition: UIItem.cs:5
Image image2
Definition: UIItem.cs:16
UIText text2
Definition: UIItem.cs:8
UIItem AddHeaderCard(string text, Sprite sprite=null)
Definition: UINote.cs:84
void Clear()
Definition: UINote.cs:35
UIItem AddText(string text, FontColor color=FontColor.DontChange)
Definition: UINote.cs:113
void Build()
Definition: UINote.cs:49
void SetText(string s)
Definition: UIText.cs:163

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

Member Data Documentation

◆ _ability

CharaAbility Chara._ability

Definition at line 96 of file Chara.cs.

Referenced by SetMainElement().

◆ _baseWorkElements

ElementContainer Chara._baseWorkElements

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

Referenced by SetFaction().

◆ _goalHobby

GoalHobby Chara._goalHobby = new GoalHobby()
staticprivate

Definition at line 212 of file Chara.cs.

◆ _goalWork

GoalWork Chara._goalWork = new GoalWork()
staticprivate

Definition at line 210 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 166 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 198 of file Chara.cs.

◆ _listFavFood

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

Definition at line 196 of file Chara.cs.

◆ _ListItems

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

Definition at line 194 of file Chara.cs.

◆ _NoGoalPC

NoGoal Chara._NoGoalPC = new NoGoal()
static

Definition at line 200 of file Chara.cs.

◆ _NoGoalRepeat

NoGoal Chara._NoGoalRepeat = new NoGoal()
static

Definition at line 202 of file Chara.cs.

Referenced by ActPlan.Item.Perform().

◆ _pts

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

Definition at line 190 of file Chara.cs.

◆ _race

SourceRace.Row Chara._race

Definition at line 164 of file Chara.cs.

Referenced by ChangeRace(), and OnCreate().

◆ _sharedPos

Point Chara._sharedPos = new Point()
staticprivate

Definition at line 178 of file Chara.cs.

Referenced by TryMoveTowards().

◆ _Speed

long Chara._Speed
private

Definition at line 176 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 168 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 182 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 184 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 174 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 204 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 180 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.

◆ isAstralBody

bool Chara.isAstralBody

Definition at line 156 of file Chara.cs.

Referenced by Refresh().

◆ 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 188 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

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

Referenced by OnCreate().

◆ ListAdvRace

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

Definition at line 170 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

◆ memberType

◆ mimicry

◆ nextUse

Thing Chara.nextUse

Definition at line 100 of file Chara.cs.

Referenced by AI_Idle.Run().

◆ orgPos

◆ parasite

◆ party

Party Chara.party

Definition at line 43 of file Chara.cs.

Referenced by _Move(), AM_Adv._OnUpdateInput(), TraitGodStatue._OnUse(), TraitShrine._OnUse(), Party.AddMemeber(), Faction.AddReserve(), LayerSleep.Advance(), ZoneEventQuest.AggroEnemy(), WidgetRoster.Build(), WidgetStatsBar.Build(), LayerInventory.CreateContainer(), FactionBranch.DailyOutcome(), Card.DamageHP(), Card.Destroy(), Die(), DoHostileAction(), TileMapElona.DrawTile(), ZonePreEnterEncounter.Execute(), GoalAutoCombat.GetActPlanColor(), GetRevived(), GoalAutoCombat.GoalAutoCombat(), TraitFoodEggFertilized.Incubate(), ListPeopleParty.JoinParty(), MakeAlly(), MakePartyMemeber(), Card.ModExpParty(), MoveHome(), Player.MoveZone(), TraitHitchingPost.OnActivateTrap(), Player.OnAdvanceHour(), FactionBranch.OnAfterSimulate(), ListPeopleParty.OnClick(), Zone_DungeonFairy.OnGenerateMap(), Zone_RandomDungeon.OnGenerateMap(), Zone_Void.OnGenerateMap(), ZoneEventHarvest.OnLeaveZone(), ElementContainerCard.OnLevelUp(), BaseListPeople.OnList(), ListPeopleParty.OnList(), Game.OnLoad(), ListPeopleParty.OnRefreshMenu(), ConSleep.OnRemoved(), QuestDebt.OnStart(), Scene.OnUpdate(), TraitGeneMachine.OnUse(), TraitStairsLocked.OnUse(), ZoneEventMusic.OnVisit(), ActPray.Pray(), CoreDebug.QuickStart(), Player.RefreshEmptyAlly(), ActRide.Ride(), AI_Idle.Run(), AI_PassTime.Run(), AI_Slaughter.Run(), Weather.SetCondition(), LayerDragGrid.SetInv(), SetSortVal(), Tick(), ConSleep.Tick(), ConStrife.TryApplyParty(), TryNullifyCurse(), ActPray.TryPray(), GoalCombat.TryUseAbility(), CoreDebug.UpdateInput(), DramaOutcome.upgrade_miscreation(), UseAbility(), ElementContainerCard.ValueBonus(), and TraitBookSkill.WriteNote().

◆ 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 186 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 218 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 158 of file Chara.cs.

Referenced by LayerEditSkin.RefreshImage().

◆ stealthSeen

int Chara.stealthSeen

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

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

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

◆ _alias

string Chara._alias
getset

Definition at line 222 of file Chara.cs.

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

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

◆ _idTimeTable

int Chara._idTimeTable
getset

Definition at line 344 of file Chara.cs.

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

Referenced by OnCreate().

◆ _maxStamina

int Chara._maxStamina
getset

Definition at line 368 of file Chara.cs.

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

Referenced by CalculateMaxStamina().

◆ ability

◆ actorPrefab

override string Chara.actorPrefab
get

Definition at line 524 of file Chara.cs.

525 {
526 get
527 {
528 if (IsPCC)
529 {
530 return "CharaActorPCC";
531 }
532 return "CharaActor";
533 }
534 }

◆ affinity

◆ Aka

◆ AliasMaterialOnCreate

override string Chara.AliasMaterialOnCreate
get

Definition at line 564 of file Chara.cs.

◆ baseWorkElements

ElementContainer Chara.baseWorkElements
get

Definition at line 1169 of file Chara.cs.

1170 {
1171 get
1172 {
1173 if (_baseWorkElements == null)
1174 {
1176 foreach (Hobby item in ListHobbies())
1177 {
1178 Build(item);
1179 }
1180 foreach (Hobby item2 in ListWorks())
1181 {
1182 Build(item2);
1183 }
1184 }
1185 return _baseWorkElements;
1186 void Build(Hobby h)
1187 {
1188 if (!h.source.elements.IsEmpty())
1189 {
1190 for (int i = 0; i < h.source.elements.Length; i += 2)
1191 {
1192 int ele = h.source.elements[i];
1193 int v = h.source.elements[i + 1];
1194 _baseWorkElements.ModBase(ele, v);
1195 }
1196 }
1197 }
1198 }
1199 }
ElementContainer _baseWorkElements
Definition: Chara.cs:208

◆ bladder

Stats Chara.bladder
get

Definition at line 1209 of file Chara.cs.

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

◆ burden

◆ CanGainConResist

bool Chara.CanGainConResist
get

Definition at line 1219 of file Chara.cs.

1220 {
1221 get
1222 {
1223 if (base.rarity >= Rarity.Legendary)
1224 {
1225 return !IsPCFaction;
1226 }
1227 return false;
1228 }
1229 }

◆ CanOpenDoor

bool Chara.CanOpenDoor
get

Definition at line 841 of file Chara.cs.

842 {
843 get
844 {
845 if (base.INT < 5)
846 {
847 if (IsPCFaction)
848 {
849 return memberType == FactionMemberType.Default;
850 }
851 return false;
852 }
853 return true;
854 }
855 }

◆ CanWitness

bool Chara.CanWitness
get

Definition at line 1049 of file Chara.cs.

1050 {
1051 get
1052 {
1053 if (!IsHuman && !IsFairy && !IsGod)
1054 {
1055 return race.id == "mutant";
1056 }
1057 return true;
1058 }
1059 }
bool IsFairy
Definition: Chara.cs:986
bool IsGod
Definition: Chara.cs:998

Referenced by Point.ListWitnesses().

◆ corruption

int Chara.corruption
getset

Definition at line 380 of file Chara.cs.

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

Referenced by CanDuplicate().

◆ CurrentGeneSlot

int Chara.CurrentGeneSlot
get

Definition at line 1129 of file Chara.cs.

1130 {
1131 get
1132 {
1133 if (base.c_genes != null)
1134 {
1135 return base.c_genes.GetGeneSlot(this);
1136 }
1137 return 0;
1138 }
1139 }

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

◆ CurrentSpan

TimeTable.Span Chara.CurrentSpan
get

Definition at line 859 of file Chara.cs.

Referenced by ConSleep.Tick().

◆ currentZone

Zone Chara.currentZone
getset

Definition at line 258 of file Chara.cs.

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

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

◆ daysStarved

int Chara.daysStarved
getset

Definition at line 332 of file Chara.cs.

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

◆ depression

Stats Chara.depression
get

Definition at line 1207 of file Chara.cs.

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

◆ DestDist

int Chara.DestDist
get

Definition at line 1045 of file Chara.cs.

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

◆ DV

override int Chara.DV
get

Definition at line 746 of file Chara.cs.

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

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

◆ faction

Faction Chara.faction
getset

Definition at line 430 of file Chara.cs.

431 {
432 get
433 {
434 return _faction ?? (_faction = EClass.game.factions.dictAll.TryGetValue(idFaction));
435 }
436 set
437 {
438 idFaction = value?.uid;
439 }
440 }
string idFaction
Definition: Chara.cs:247
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(), UISearchPeople.Init(), Element.IsFactionElement(), Religion.JoinFaith(), Religion.LeaveFaith(), ReligionEyth.LeaveFaith(), Map.ListChara(), ElementContainer.ListElements(), FactionBranch.OnClaimZone(), ListPeopleRevive.OnList(), Game.OnLoad(), TraitBookSkill.OnRead(), TraitDeed.OnRead(), TraitDeedRelocate.OnRead(), ContentHomeReport.OnSwitchContent(), FactionBranch.OnUnclaimZone(), Zone_Aquli.OnVisitNewMapOrRegenerate(), 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 552 of file Chara.cs.

553 {
554 get
555 {
556 if (base.dir != 1)
557 {
558 return base.dir == 2;
559 }
560 return true;
561 }
562 }

Referenced by CharaActor.RefreshSprite().

◆ GeneCostMTP

int Chara.GeneCostMTP
get

Definition at line 1117 of file Chara.cs.

1118 {
1119 get
1120 {
1121 if (!IsPC)
1122 {
1123 return 100;
1124 }
1125 return 5;
1126 }
1127 }

Referenced by TraitGene.TrySetHeldAct(), and TraitGene.WriteNote().

◆ goalListType

GoalListType Chara.goalListType
getset

Definition at line 282 of file Chara.cs.

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

◆ HasHost

override bool Chara.HasHost
get

Definition at line 706 of file Chara.cs.

Referenced by ActEffect.Proc().

◆ HasNoGoal

◆ homeBranch

◆ homeZone

◆ hostility

◆ hunger

◆ hygiene

Stats Chara.hygiene
get

◆ idFaction

string Chara.idFaction
getset

Definition at line 246 of file Chara.cs.

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

◆ idFaith

string Chara.idFaith
getset

Definition at line 234 of file Chara.cs.

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

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

◆ IDPCCBodySet

string Chara.IDPCCBodySet
get

Definition at line 494 of file Chara.cs.

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

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

◆ idTimeTable

string Chara.idTimeTable
get

Definition at line 472 of file Chara.cs.

Referenced by LayerQuestBoard.RefreshHire().

◆ interest

int Chara.interest
getset

Definition at line 320 of file Chara.cs.

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

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

◆ IsAdventurer

bool Chara.IsAdventurer
get

Definition at line 1087 of file Chara.cs.

1088 {
1089 get
1090 {
1091 if (global != null && faction != EClass.pc.faction)
1092 {
1093 return IsPCC;
1094 }
1095 return false;
1096 }
1097 }

◆ isAlawysVisible

bool Chara.isAlawysVisible
getset

Definition at line 404 of file Chara.cs.

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

◆ IsAliveInCurrentZone

◆ IsAnimal

bool Chara.IsAnimal
get

Definition at line 913 of file Chara.cs.

914 {
915 get
916 {
917 if (!race.IsAnimal)
918 {
919 return HasTag(CTAG.animal);
920 }
921 return true;
922 }
923 }

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

◆ IsAstralBody

bool Chara.IsAstralBody
get

Implements IPathfindWalker.

Definition at line 506 of file Chara.cs.

Referenced by CanMoveTo(), BaseTileMap.DrawTile(), and AM_Adv.SetPressedAction().

◆ IsCat

bool Chara.IsCat
get

Definition at line 1033 of file Chara.cs.

1034 {
1035 get
1036 {
1037 if (!(race.id == "cat") && !(race.id == "catsister"))
1038 {
1039 return race.id == "catgod";
1040 }
1041 return true;
1042 }
1043 }

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

◆ isChara

override bool Chara.isChara
get

Definition at line 704 of file Chara.cs.

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

◆ isDead

bool Chara.isDead
getset

Definition at line 392 of file Chara.cs.

393 {
394 get
395 {
396 return _cbits1[0];
397 }
398 set
399 {
400 _cbits1[0] = value;
401 }
402 }

Referenced by _Move(), ActPlan._Update(), SerializedCards.Add(), Zone.AddGlobalCharasOnActivate(), ListPeopleParty.CanJoinParty(), Player.CanSee(), FactionBranch.CountMembers(), FactionBranch.DailyOutcome(), TileMapElona.DrawTile(), Player.EndTurn(), AI_Fuck.Finish(), FactionBranch.GetProductBonus(), CharaActorPCC.IdleFrame(), FactionBranch.IsAllDead(), BaseListPeople.IsDisabled(), TraitToolBrush.IsTamePossible(), AI_OpenGambleChest.IsValid(), Condition.Kill(), ElementContainer.ModExp(), MoveZone(), FactionBranch.OnAdvanceDay(), GlobalGoalAdv.OnAdvanceHour(), TaskDrawWater.OnCreateProgress(), TaskPlow.OnCreateProgress(), TaskPourWater.OnCreateProgress(), TraitRollingFortune.OnEndAI(), QuestEscort.OnEnterZone(), ZoneInstanceBout.OnLeaveZone(), Game.OnLoad(), MiniGame.OnPlay(), TaskDig.OnProgressComplete(), ListPeopleParty.OnRefreshMenu(), ConSleep.OnRemoved(), Scene.OnUpdate(), LayerMiniGame.OnUpdateInput(), ZoneEventWedding.OnVisit(), ActRanged.Perform(), ActEffect.Poison(), FoodEffect.Proc(), FoodEffect.ProcDrink(), FactionBranch.Recruit(), TCOrbitChara.RefreshAll(), UIHomeInfo.RefreshReport(), Zone.Revive(), DramaOutcome.revive_pet(), AI_Fuck.Run(), AI_Shear.Run(), AI_Slaughter.Run(), AI_UseCrafter.Run(), GoalCombat.Run(), TaskClean.Run(), ItemGeneral.SetChara(), ListPeopleExpedition.SetSubText(), Thing.ShowSplitMenu(), Thing.ShowSplitMenu2(), ConSleep.Tick(), and ToString().

◆ IsDeadOrSleeping

override bool Chara.IsDeadOrSleeping
get

◆ IsDisabled

override bool Chara.IsDisabled
get

◆ IsDragon

bool Chara.IsDragon
get

Definition at line 1009 of file Chara.cs.

1010 {
1011 get
1012 {
1013 if (!race.IsDragon)
1014 {
1015 return HasTag(CTAG.dragon);
1016 }
1017 return true;
1018 }
1019 }

◆ IsEyth

bool Chara.IsEyth
get

Definition at line 1099 of file Chara.cs.

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

◆ IsFairy

bool Chara.IsFairy
get

Definition at line 985 of file Chara.cs.

986 {
987 get
988 {
989 if (!race.IsFairy)
990 {
991 return HasTag(CTAG.fairy);
992 }
993 return true;
994 }
995 }

Referenced by Faction.IsWearingPanty().

◆ IsFish

bool Chara.IsFish
get

Definition at line 973 of file Chara.cs.

974 {
975 get
976 {
977 if (!race.IsFish)
978 {
979 return HasTag(CTAG.fish);
980 }
981 return true;
982 }
983 }

◆ IsGlobal

◆ IsGod

bool Chara.IsGod
get

Definition at line 997 of file Chara.cs.

998 {
999 get
1000 {
1001 if (!race.IsGod)
1002 {
1003 return HasTag(CTAG.god);
1004 }
1005 return true;
1006 }
1007 }

◆ IsHorror

bool Chara.IsHorror
get

Definition at line 961 of file Chara.cs.

962 {
963 get
964 {
965 if (!race.IsHorror)
966 {
967 return HasTag(CTAG.horror);
968 }
969 return true;
970 }
971 }

Referenced by Refresh().

◆ IsHuman

bool Chara.IsHuman
get

Definition at line 925 of file Chara.cs.

926 {
927 get
928 {
929 if (!race.IsHuman)
930 {
931 return HasTag(CTAG.human);
932 }
933 return true;
934 }
935 }

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

1062 {
1063 get
1064 {
1065 if (!IsHuman && !race.tag.Contains("humanSpeak"))
1066 {
1067 return HasTag(CTAG.humanSpeak);
1068 }
1069 return true;
1070 }
1071 }

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

◆ IsIdle

bool Chara.IsIdle
get

Definition at line 899 of file Chara.cs.

900 {
901 get
902 {
903 if (!IsDeadOrSleeping)
904 {
905 return ai.Current.IsIdle;
906 }
907 return false;
908 }
909 }
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 602 of file Chara.cs.

603 {
604 get
605 {
606 if (ride != null)
607 {
608 return ride._isLevitating;
609 }
610 return _isLevitating;
611 }
612 }

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

◆ IsLocalChara

bool Chara.IsLocalChara
get

Definition at line 887 of file Chara.cs.

888 {
889 get
890 {
891 if (!IsGlobal && !base.isSubsetCard)
892 {
893 return homeZone == EClass._zone;
894 }
895 return false;
896 }
897 }

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

◆ IsMachine

bool Chara.IsMachine
get

Definition at line 949 of file Chara.cs.

950 {
951 get
952 {
953 if (!race.IsMachine)
954 {
955 return HasTag(CTAG.machine);
956 }
957 return true;
958 }
959 }

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

◆ IsMaid

bool Chara.IsMaid
get

Definition at line 1073 of file Chara.cs.

1074 {
1075 get
1076 {
1077 if (EClass.Branch != null)
1078 {
1079 return EClass.Branch.uidMaid == base.uid;
1080 }
1081 return false;
1082 }
1083 }

Referenced by FactionBranch.GetMaid().

◆ IsMarried

bool Chara.IsMarried
get

Definition at line 614 of file Chara.cs.

615 {
616 get
617 {
618 if (base.c_love != null)
619 {
620 return base.c_love.dateMarriage != 0;
621 }
622 return false;
623 }
624 }

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

◆ IsMinion

override bool Chara.IsMinion
get

Definition at line 644 of file Chara.cs.

645 {
646 get
647 {
648 if (master == null)
649 {
650 return base.c_uidMaster != 0;
651 }
652 return true;
653 }
654 }

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

◆ IsMofuable

bool Chara.IsMofuable
get

Definition at line 1157 of file Chara.cs.

1158 {
1159 get
1160 {
1161 if (!race.tag.Contains("mofu"))
1162 {
1163 return HasElement(419);
1164 }
1165 return true;
1166 }
1167 }

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

◆ IsMoving

override bool Chara.IsMoving
get

Definition at line 626 of file Chara.cs.

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

◆ IsMultisize

◆ IsPC

override bool Chara.IsPC
get

Definition at line 630 of file Chara.cs.

Referenced by _Move(), TraitShrine._OnUse(), ActPlan._Update(), Element._WriteNote(), TraitSwitch.ActivateTrap(), CharaAbility.Add(), Zone.AddGlobalCharasOnActivate(), ConStrife.AddKill(), DNA.Apply(), Feat.Apply(), ActMelee.Attack(), GoalCombat.BuildAbilityList(), CalcBurden(), CalculateMaxStamina(), TraitTrolley.CanActivate(), Thing.CanAutoFire(), AIAct.Cancel(), TraitFoodPreparedPackage.CanEat(), ListPeopleParty.CanJoinParty(), CanMoveTo(), ActTelekinesis.CanPerform(), Act.CanPerform(), TraitScroll.CanRead(), DNA.CanRemove(), CanReplace(), CanSee(), Player.CanSee(), CanSeeLos(), CanSeeSimple(), ActThrow.CanThrow(), AI_Torture.CreateProgress(), Cuddle(), FactionBranch.DailyOutcome(), ActionMode.DoFunc(), DoHostileAction(), CharaRenderer.Draw(), BaseTileMap.DrawTile(), CharaBody.Equip(), AI_Fish.ProgressFish.Fail(), AI_Fuck.Finish(), Biography.GetAge(), GetBurden(), Element.GetCost(), GetFirstStep(), TraitToolBrush.GetHeldEmo(), DNA.GetInvalidFeat(), FactionBranch.GetResidentTax(), Zone.GetSpawnPos(), HasAccess(), Party.HasElement(), TraitGamble.IdleUse(), Zone.IsCrime(), Party.IsCriticallyWounded(), CharaBody.IsEquippable(), AI_Eat.IsValidTarget(), Religion.JoinFaith(), Card.Kick(), Religion.LeaveFaith(), ReligionEyth.LeaveFaith(), Point.ListWitnesses(), AI_Fish.Makefish(), StatsMana.Mod(), StatsStamina.Mod(), ModAffinity(), TraitBasketGame.OnActivateTrap(), TraitHitchingPost.OnActivateTrap(), FactionBranch.OnAdvanceDay(), BaseListPeople.OnClick(), ListPeopleParty.OnClick(), WindowChara.OnClickPortrait(), TaskHarvest.OnCreateProgress(), TaskPlow.OnCreateProgress(), TraitFortuneCookie.OnEat(), Trait.OnLockOpen(), 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(), ListPeopleParty.OnRefreshMenu(), ConBlind.OnRemoved(), ConFaint.OnRemoved(), ConReload.OnRemoved(), AI_Read.OnSetOwner(), ConBlind.OnStart(), ConSmoking.OnStart(), ConSuffocation.OnStart(), TraitCurrencyMedal.OnStepped(), TraitMiniPool.OnStepped(), TraitNewZone.OnStepped(), WindowChara.OnSwitchContent(), ActKiss.Perform(), ActRanged.Perform(), ActWait.Perform(), ActZap.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(), CharaAbility.Remove(), AI_Eat.Run(), AI_Fish.Run(), AI_Fuck.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(), BaseSong.Tick(), ConFear.Tick(), ConSleep.Tick(), ConStrife.Tick(), ConSuffocation.Tick(), ConStrife.TryApplyParty(), AIAct.TryCancel(), TaskHarvest.TryGetAct(), AI_Goto.TryGoTo(), GoalCombat.TryMove(), TryMove(), TryMoveTowards(), Trait.TryOpenLock(), LayerDragGrid.TryProc(), TraitBaseSpellbook.TryProgress(), Trait.TryPryOpenLock(), 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 688 of file Chara.cs.

689 {
690 get
691 {
692 if (EClass.pc != null)
693 {
694 return faction == EClass.pc.faction;
695 }
696 return false;
697 }
698 }

Referenced by _Move(), ActPlan._Update(), Element._WriteNote(), GameDate.AdvanceDay(), GameDate.AdvanceHour(), LayerShippingResult.Awake(), 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(), Zone.OnActivate(), Zone_LittleGarden.OnActivate(), 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(), ListPeopleParty.OnList(), Game.OnLoad(), ListPeopleParty.OnRefreshMenu(), ElementContainerFaction.OnUnequip(), Zone.OnVisit(), ZoneEventWedding.OnVisit(), FoodEffect.Proc(), ActEffect.Proc(), TraitBaseSpellbook.ReadFailEffect(), TraitGeneratorWheel.Refresh(), WindowChara.RefreshProfile(), LayerQuestBoard.RefreshRanking(), RefreshSpeed(), RequestProtection(), Zone.ResetHostility(), CoreDebug.ResetPetUpgrades(), ActRide.Ride(), AI_Fuck.Run(), AI_Idle.Run(), AI_PlayMusic.Run(), AI_Steal.Run(), GoalCombat.Run(), TraitGeneratorWheel.ShouldWork(), Zone.Simulate(), ConMiasma.Tick(), ConSleep.Tick(), TryClearInventory(), 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 672 of file Chara.cs.

673 {
674 get
675 {
676 if (master != null)
677 {
678 if (!master.IsPCFaction)
679 {
681 }
682 return true;
683 }
684 return false;
685 }
686 }

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

◆ IsPCParty

override bool Chara.IsPCParty
get

Definition at line 632 of file Chara.cs.

633 {
634 get
635 {
636 if (party != null)
637 {
638 return party.leader == EClass.pc;
639 }
640 return false;
641 }
642 }

Referenced by ActPlan._Update(), Zone.AbandonZone(), Zone.AddGlobalCharasOnActivate(), Faction.AddReserve(), GameDate.AdvanceHour(), FactionBranch.AutoClean(), CanReplace(), Player.CanSee(), TraitSalesTag.CanTagSale(), ConTransmute.Change(), Cuddle(), FactionBranch.DailyOutcome(), Die(), DoHostileAction(), AI_Fuck.Finish(), FactionBranch.GenerateGarbage(), DramaCustomSequence.GetListGuide(), FactionBranch.GetProductBonus(), GiveGift(), IsHostile(), AI_Fish.Makefish(), TraitHitchingPost.OnActivateTrap(), FactionBranch.OnAdvanceDay(), FactionBranch.OnAfterSimulate(), ZoneEventDefenseGame.OnCharaDie(), BaseListPeople.OnClick(), Zone_CursedManor.OnGenerateMap(), ListPeopleExpedition.OnList(), ListPeopleParty.OnList(), AI_Fish.ProgressFish.OnProgressComplete(), TraitBaseSpellbook.OnRead(), ConTransmute.OnRemoved(), AI_Read.OnSetOwner(), FactionBranch.OnSimulateDay(), FactionBranch.OnSimulateHour(), TraitGeneMachine.OnUse(), Zone.OnVisit(), ActWait.Perform(), ActWater.Perform(), ActZap.Perform(), AttackProcess.Prepare(), FoodEffect.Proc(), ActEffect.Proc(), ActEffect.ProcAt(), TCOrbitChara.RefreshAll(), Zone.RefreshCriminal(), FactionBranch.RefreshEfficiency(), UIHomeInfo.RefreshReport(), RefreshSpeed(), RequestProtection(), AI_Eat.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 656 of file Chara.cs.

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

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

◆ IsPlant

bool Chara.IsPlant
get

Definition at line 1021 of file Chara.cs.

1022 {
1023 get
1024 {
1025 if (!race.IsPlant)
1026 {
1027 return HasTag(CTAG.plant);
1028 }
1029 return true;
1030 }
1031 }

Referenced by GoalCombat.Run().

◆ IsPrisoner

bool Chara.IsPrisoner
get

Definition at line 1085 of file Chara.cs.

◆ isSynced

override bool Chara.isSynced
get

Definition at line 708 of file Chara.cs.

709 {
710 get
711 {
712 if (renderer == null || !renderer.isSynced)
713 {
714 if (host != null)
715 {
716 return host.isSynced;
717 }
718 return false;
719 }
720 return true;
721 }
722 }

Referenced by _Move(), ActPlan._Update(), CanDuplicate(), BaseGameScreen.Draw(), Player.HasValidRangedTarget(), Point.ListInspectorTargets(), BaseListPeople.OnClick(), ConTransmute.OnRemoved(), AM_Adv.OnRenderTile(), Scene.OnUpdate(), AI_Idle.Run(), TalkTopic(), Player.TargetRanged(), ConSleep.Tick(), and TryPush().

◆ isThing

override bool Chara.isThing
get

Definition at line 702 of file Chara.cs.

◆ IsUndead

bool Chara.IsUndead
get

Definition at line 937 of file Chara.cs.

938 {
939 get
940 {
941 if (!race.IsUndead)
942 {
943 return HasTag(CTAG.undead);
944 }
945 return true;
946 }
947 }

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

◆ IsWealthy

bool Chara.IsWealthy
get

Definition at line 1101 of file Chara.cs.

1102 {
1103 get
1104 {
1105 if (!source.works.Contains("Rich"))
1106 {
1107 return source.hobbies.Contains("Rich");
1108 }
1109 return true;
1110 }
1111 }

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

◆ job

◆ knowFav

bool Chara.knowFav
getset

Definition at line 416 of file Chara.cs.

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

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

◆ MainElement

Element Chara.MainElement
get

Definition at line 734 of file Chara.cs.

735 {
736 get
737 {
738 if (base.c_idMainElement == 0)
739 {
740 return Element.Void;
741 }
742 return elements.GetElement(base.c_idMainElement);
743 }
744 }

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

◆ mana

◆ MaxGeneSlot

int Chara.MaxGeneSlot
get

◆ MaxHP

◆ MaxSummon

int Chara.MaxSummon
get

◆ NameBraced

◆ NameTitled

string Chara.NameTitled
get

Definition at line 522 of file Chara.cs.

Referenced by Scene.OnUpdate(), and ActEffect.Proc().

◆ OriginalHostility

Hostility Chara.OriginalHostility
get

Definition at line 474 of file Chara.cs.

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

Referenced by FactionBranch.AddMemeber(), CallHelp(), GuildFighter.CanGiveContribution(), Die(), Card.HatchEgg(), 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 804 of file Chara.cs.

805 {
806 get
807 {
808 if (spriteReplacer != null)
809 {
811 {
812 spriteReplacer.data.tryFixPrefNotLoadedAtStart = true;
814 }
816 }
817 if (base.idSkin > 0)
818 {
819 switch (sourceCard.tiles.TryGet(base.idSkin))
820 {
821 case 2319:
822 case 2619:
823 case 2621:
824 case 2623:
825 case 2625:
827 case 2320:
828 case 2611:
829 case 2620:
830 case 2622:
831 case 2624:
832 case 2626:
833 case 2828:
835 }
836 }
838 }
839 }
SourcePref snowputit2
Definition: CoreRef.cs:327
SourcePref sonwputit1
Definition: CoreRef.cs:325
SourcePref replacer1
Definition: CoreRef.cs:331
PrefData prefs
Definition: CoreRef.cs:418
CoreRef refs
Definition: Core.cs:51
SpriteReplacer replacer
Definition: RenderRow.cs:89
SourcePref pref
Definition: RenderRow.cs:68
bool tryFixPrefNotLoadedAtStart
Definition: SpriteData.cs:32
void LoadPref()
Definition: SpriteData.cs:49
SourcePref pref
Definition: SpriteData.cs:30
SpriteData data

Referenced by BaseTileMap.DrawTile(), LayerEditSkin.OnClickEdit(), TCOrbitChara.OnSetOwner(), and Portrait.SetChara().

◆ PrefIndex

override int Chara.PrefIndex
get

Definition at line 536 of file Chara.cs.

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

◆ PV

override int Chara.PV
get

Definition at line 775 of file Chara.cs.

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

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

◆ race

◆ Ridability

Ridability Chara.Ridability
get

Definition at line 861 of file Chara.cs.

862 {
863 get
864 {
865 if (!HasTag(CTAG.ride))
866 {
867 if (!HasTag(CTAG.noRide))
868 {
869 if (!race.tag.Contains("ride"))
870 {
871 if (!race.tag.Contains("noRide"))
872 {
873 return Ridability.Default;
874 }
875 return Ridability.BadRide;
876 }
877 return Ridability.GoodRide;
878 }
879 return Ridability.BadRide;
880 }
881 return Ridability.GoodRide;
882 }
883 }

Referenced by ActRide.Ride().

◆ SAN

◆ SelfWeight

override int Chara.SelfWeight
get

Definition at line 730 of file Chara.cs.

◆ sleepiness

Stats Chara.sleepiness
get

◆ sourceCard

override CardRow Chara.sourceCard
get

◆ sourceRenderCard

override CardRow Chara.sourceRenderCard
get

Definition at line 456 of file Chara.cs.

457 {
458 get
459 {
460 if (pccData != null && !(source.renderData is RenderDataPcc))
461 {
463 }
464 return source;
465 }
466 }
static Row rowDefaultPCC
Definition: SourceChara.cs:158

◆ Speed

int Chara.Speed
get

Definition at line 1141 of file Chara.cs.

1142 {
1143 get
1144 {
1145 if (dirtySpeed)
1146 {
1147 RefreshSpeed();
1148 }
1149 if (_Speed > 100000000)
1150 {
1151 return 100000000;
1152 }
1153 return (int)_Speed;
1154 }
1155 }

Referenced by GameUpdater.ConditionUpdater.FixedUpdate().

◆ stamina

◆ tactics

Tactics Chara.tactics
get

Definition at line 857 of file Chara.cs.

Referenced by GoalCombat.Run().

◆ trait

◆ uidEditor

int Chara.uidEditor
getset

Definition at line 356 of file Chara.cs.

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

Referenced by SerializedCards.Add().

◆ WeightLimit

override int Chara.WeightLimit
get

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