Elin Decompiled Documentation EA 23.343.5 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, bool inheritHostility=false)
 
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< T > (int p, int p2, bool force=false)
 
Condition AddCondition (string id, int p=100, bool force=false)
 
Condition AddCondition (string id, int p, int p2, 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, bool purchaseFeat=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 7026 of file Chara.cs.

7027 {
7028 CardRenderer cardRenderer = renderer;
7029 CharaRenderer charaRenderer = new CharaRenderer();
7030 if (source.skinAntiSpider != 0 && EClass.core.config.game.antiSpider)
7031 {
7032 base.idSkin = source.skinAntiSpider;
7033 }
7034 if (host != null)
7035 {
7036 charaRenderer.pccData = PCCData.Create("ride");
7037 string idPart = base.c_idRidePCC.IsEmpty(EClass.core.pccs.sets["ride"].map["body"].map.Keys.First());
7038 charaRenderer.pccData.SetPart("body", "ride", idPart);
7039 charaRenderer.pccData.ride = EClass.core.pccs.GetRideData(idPart);
7040 }
7041 else
7042 {
7043 foreach (Condition condition in conditions)
7044 {
7045 RendererReplacer rendererReplacer = condition.GetRendererReplacer();
7046 if (rendererReplacer != null)
7047 {
7048 charaRenderer.replacer = rendererReplacer;
7049 charaRenderer.data = rendererReplacer.data;
7050 charaRenderer.pccData = rendererReplacer.pccData;
7051 break;
7052 }
7053 }
7054 if (charaRenderer.replacer == null)
7055 {
7056 charaRenderer.pccData = pccData;
7057 }
7058 }
7059 renderer = charaRenderer;
7060 renderer.SetOwner(this);
7061 if (cardRenderer != null)
7062 {
7063 renderer.SetFirst(first: false, cardRenderer.position);
7064 }
7065 return charaRenderer;
7066 }
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:627
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 2513 of file Chara.cs.

2514 {
2515 if (EClass.pc.homeBranch != null)
2516 {
2518 }
2519 else
2520 {
2521 SetGlobal();
2523 }
2524 Hostility hostility = (base.c_originalHostility = Hostility.Ally);
2525 this.hostility = hostility;
2526 orgPos = null;
2527 base.c_summonDuration = 0;
2528 base.isSummon = false;
2529 UnmakeMinion();
2530 SetInt(32);
2531 Refresh();
2532 }
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:2567
Chara SetFaction(Faction f)
Definition: Chara.cs:1490
Point orgPos
Definition: Chara.cs:21
FactionBranch homeBranch
Definition: Chara.cs:1113
Hostility hostility
Definition: Chara.cs:295
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, hostility, 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 2935 of file Chara.cs.

2936 {
2937 if (isDead)
2938 {
2939 return MoveResult.Fail;
2940 }
2941 if (IsPC)
2942 {
2943 float num = EClass.setting.defaultActPace;
2944 switch (burden.GetPhase())
2945 {
2946 case 3:
2947 num *= 1.5f;
2948 break;
2949 case 4:
2950 num *= 2f;
2951 break;
2952 }
2954 {
2955 int num2 = 30;
2956 if (!EClass.pc.HasElement(408))
2957 {
2959 {
2960 case Weather.Condition.Rain:
2961 num2 += 5;
2962 break;
2963 case Weather.Condition.RainHeavy:
2964 num2 += 10;
2965 num *= 1.5f;
2966 break;
2967 case Weather.Condition.Snow:
2968 num2 += 10;
2969 break;
2970 case Weather.Condition.SnowHeavy:
2971 num2 += 15;
2972 num *= 1.5f;
2973 break;
2974 }
2975 }
2976 if (newPoint.matFloor.id == 48)
2977 {
2978 num2 += 20;
2979 num *= 1.8f;
2980 }
2981 num2 = num2 * 100 / (100 + EClass.sqrt(EvalueMax(240, -20) * 10) + EvalueMax(407, -5) * 5);
2982 EClass.world.date.AdvanceMin(num2 * 6);
2983 EClass.player.lastZonePos = null;
2985 int num3 = base.hp;
2986 for (int i = 0; i < num2 * 4; i++)
2987 {
2988 EClass.pc.party.members.ForeachReverse(delegate(Chara m)
2989 {
2990 if (!m.isDead)
2991 {
2992 m.TickConditions();
2993 }
2994 });
2995 if (base.hp < MaxHP / 5 && base.hp < num3 && !EClass.player.regionMoveWarned)
2996 {
2997 EClass.player.regionMoveWarned = true;
2998 Msg.Say("regionAbortMove");
2999 EInput.Consume(consumeAxis: true);
3000 SetAI(new NoGoal());
3001 return MoveResult.Fail;
3002 }
3003 }
3004 if (newPoint.cell.CanSuffocate())
3005 {
3006 bool flag = HasElement(1252);
3007 if (!flag)
3008 {
3009 AddCondition<ConSuffocation>((Evalue(200) != 0) ? (2000 / (100 + EvalueMax(200, -5) * 10)) : 30, force: true);
3010 }
3011 int num4 = GetCondition<ConSuffocation>()?.GetPhase() ?? 0;
3012 if (num4 >= 2)
3013 {
3014 DamageHP(EClass.rndHalf(10 + MaxHP / 5), AttackSource.Condition);
3015 }
3016 if (!isDead && !HasElement(429))
3017 {
3018 ModExp(200, ((!flag) ? 1 : 10) + num4 * 12);
3019 }
3020 }
3021 EClass.player.regionMoveWarned = false;
3022 if (isDead)
3023 {
3024 return MoveResult.Fail;
3025 }
3026 }
3027 if (num > EClass.setting.defaultActPace * 3f)
3028 {
3029 num = EClass.setting.defaultActPace * 3f;
3030 }
3031 actTime = num;
3032 }
3033 if (IsPCFaction && EClass.rnd(5) == 0 && newPoint.cell.CanSuffocate())
3034 {
3035 int num5 = Mathf.Min(5 + EClass._zone.DangerLv / 10, 200);
3036 ModExp(200, EClass._zone.IsRegion ? 50 : num5);
3037 if (ride != null)
3038 {
3039 ride.ModExp(200, EClass._zone.IsRegion ? 50 : num5);
3040 }
3041 if (parasite != null)
3042 {
3043 parasite.ModExp(200, EClass._zone.IsRegion ? 50 : num5);
3044 }
3045 }
3046 Chara chara = ((ride == null) ? this : ride);
3047 if (!EClass._zone.IsRegion || chara.IsPC)
3048 {
3049 bool flag2 = (chara.isConfused && EClass.rnd(2) == 0) || (chara.isDrunk && EClass.rnd(IsIdle ? 2 : 8) == 0 && !chara.HasElement(1215));
3050 if (host != null && host.ride == this && ((host.isConfused && EClass.rnd(2) == 0) || (host.isDrunk && EClass.rnd(IsIdle ? 2 : 8) == 0 && !host.HasElement(1215))))
3051 {
3052 flag2 = true;
3053 }
3054 if (flag2 && !HasElement(493) && newPoint.Distance(pos) <= 1)
3055 {
3056 Point randomNeighbor = pos.GetRandomNeighbor();
3057 if (CanMoveTo(randomNeighbor, allowDestroyPath: false))
3058 {
3059 newPoint = randomNeighbor;
3060 if (isDrunk)
3061 {
3062 Talk("drunk");
3063 }
3064 }
3065 }
3066 }
3067 if (newPoint.x != pos.x || newPoint.z != pos.z)
3068 {
3069 LookAt(newPoint);
3070 }
3071 CellEffect effect = base.Cell.effect;
3072 if (effect != null && effect.id == 7)
3073 {
3074 CellEffect effect2 = base.Cell.effect;
3075 if (race.height < 500 && !race.tag.Contains("webfree") && !HasElement(493) && EClass.rnd(effect2.power + 25) > EClass.rnd(base.STR + base.DEX + 1))
3076 {
3077 Say("abWeb_caught", this);
3078 PlaySound("web");
3079 effect2.power = effect2.power * 3 / 4;
3080 renderer.PlayAnime(AnimeID.Shiver);
3081 return MoveResult.Fail;
3082 }
3083 Say("abWeb_pass", this);
3084 EClass._map.SetEffect(base.Cell.x, base.Cell.z);
3085 }
3086 if (IsPC)
3087 {
3088 EClass.player.renderExtraTime = 0f;
3089 if (EClass._zone.IsRegion)
3090 {
3092 }
3093 else if ((newPoint.x > pos.x && newPoint.z > pos.z) || (newPoint.x < pos.x && newPoint.z < pos.z))
3094 {
3095 EClass.player.renderExtraTime = actTime * EClass.setting.render.anime.diagonalSpeed;
3096 }
3097 }
3098 if (newPoint.HasChara)
3099 {
3100 foreach (Chara item in newPoint.ListCharas())
3101 {
3102 if (item.mimicry != null && item.IsHostile(this))
3103 {
3104 if (item.mimicry.ShouldRevealOnPush)
3105 {
3106 item.mimicry.Reveal(this, surprise: true);
3107 }
3108 return MoveResult.Event;
3109 }
3110 }
3111 }
3112 if (newPoint.cell.hasDoor)
3113 {
3114 foreach (Thing thing in pos.Things)
3115 {
3116 if (thing.trait is TraitDoor traitDoor && traitDoor.owner.c_lockLv > 0)
3117 {
3118 if (base.INT < 10)
3119 {
3120 return MoveResult.Fail;
3121 }
3122 traitDoor.TryOpenLock(this);
3123 return MoveResult.Door;
3124 }
3125 }
3126 }
3127 Cell cell = newPoint.cell;
3128 Cell cell2 = pos.cell;
3129 bool flag3 = cell.HasLiquid && !IsLevitating;
3130 bool hasBridge = cell.HasBridge;
3131 bool hasRamp = cell.HasRamp;
3132 bool flag4 = EClass._zone.IsSnowCovered && !cell.HasRoof && !cell.isClearSnow;
3133 TileRow tileRow = (hasRamp ? ((TileRow)cell.sourceBlock) : ((TileRow)(hasBridge ? cell.sourceBridge : cell.sourceFloor)));
3134 SourceMaterial.Row row = (hasRamp ? cell.matBlock : (hasBridge ? cell.matBridge : cell.matFloor));
3135 bool flag5 = cell.IsTopWater && !cell.isFloating;
3136 if (!EClass._zone.IsRegion)
3137 {
3138 if (cell.hasDoorBoat)
3139 {
3140 tileRow = FLOOR.sourceWood;
3141 row = MATERIAL.sourceOak;
3142 flag5 = false;
3143 }
3144 else if (flag4 && !tileRow.ignoreSnow)
3145 {
3146 if (tileRow.tileType.IsWater)
3147 {
3148 tileRow = FLOOR.sourceIce;
3149 row = MATERIAL.sourceIce;
3150 }
3151 else
3152 {
3153 tileRow = FLOOR.sourceSnow;
3154 row = MATERIAL.sourceSnow;
3155 }
3156 flag5 = false;
3157 }
3158 }
3159 if ((pos.sourceFloor.isBeach || cell2.IsSnowTile) && !pos.HasObj)
3160 {
3161 EClass._map.SetFoormark(pos, 1, (int)Util.GetAngle(pos.x - newPoint.x, pos.z - newPoint.z), cell2.IsSnowTile ? 312 : 304);
3162 }
3163 if (isSynced)
3164 {
3165 string text = ((flag3 || flag5) ? "water" : tileRow.soundFoot.IsEmpty(row.soundFoot.IsEmpty("default")));
3166 if (cell.obj != 0 && cell.sourceObj.tileType.IsPlayFootSound && !cell.matObj.soundFoot.IsEmpty())
3167 {
3168 text = cell.matObj.soundFoot;
3169 }
3170 if (IsPC)
3171 {
3172 foreach (Thing thing2 in newPoint.Things)
3173 {
3174 if (thing2.IsInstalled && (thing2.trait.IsChangeFloorHeight || thing2.Pref.Surface))
3175 {
3176 text = thing2.material.soundFoot;
3177 }
3178 }
3179 }
3180 if (!text.IsEmpty())
3181 {
3182 SoundManager.altLastData = IsPC;
3183 PlaySound("Footstep/" + text, IsPC ? 1f : 0.9f);
3184 }
3185 if (!flag5)
3186 {
3188 PCOrbit pcOrbit = EClass.screen.pcOrbit;
3189 bool flag6 = scene.actionMode.gameSpeed > 1f;
3190 scene.psFoot.transform.position = renderer.position + pcOrbit.footPos;
3191 scene.psFoot.startColor = row.matColor;
3192 scene.psFoot.Emit(pcOrbit.emitFoot * ((!flag6) ? 1 : 2));
3193 if (flag6 && IsPC)
3194 {
3195 scene.psSmoke.transform.position = renderer.position + pcOrbit.smokePos;
3196 scene.psSmoke.Emit(pcOrbit.emitSmoke);
3197 }
3198 }
3199 if (flag3 || flag5)
3200 {
3201 Effect.Get("ripple").Play(newPoint);
3202 }
3203 }
3204 lastPos.Set(pos);
3205 if (type != MoveType.Force)
3206 {
3207 if (newPoint.HasChara && ai.Current.PushChara)
3208 {
3209 TryPush(newPoint);
3210 }
3211 if (newPoint.HasChara && newPoint.Charas.Count == 1)
3212 {
3213 Chara chara2 = newPoint.Charas[0];
3214 if (CanReplace(chara2))
3215 {
3216 chara2.MoveByForce(lastPos, this);
3217 if (chara.IsPC)
3218 {
3219 Say("replace_pc", chara, chara2);
3220 }
3221 }
3222 }
3223 }
3224 if (cell.hasDoor)
3225 {
3226 foreach (Thing thing3 in newPoint.Things)
3227 {
3228 if (thing3.trait is TraitDoor traitDoor2)
3229 {
3230 traitDoor2.TryOpen(this);
3231 }
3232 }
3233 }
3234 EClass._zone.map.MoveCard(newPoint, this);
3235 SyncRide();
3237 {
3238 foreach (Chara member in EClass.pc.party.members)
3239 {
3240 if (member.isLeashed && !member.IsPC && member.host == null && !member.IsDisabled && !member.HasCondition<ConEntangle>() && !member.IsInCombat && member.Dist(EClass.pc) > 1)
3241 {
3242 member.TryMoveTowards(EClass.pc.pos);
3243 }
3244 }
3245 }
3247 {
3249 }
3250 if (IsPC)
3251 {
3252 PlaySound("Footstep/Extra/pcfootstep");
3253 if (pos.HasThing)
3254 {
3255 foreach (Card item2 in pos.ListCards())
3256 {
3257 if (!item2.isThing || item2.placeState != PlaceState.roaming || item2.ignoreAutoPick)
3258 {
3259 continue;
3260 }
3262 {
3264 ContainerFlag containerFlag = item2.category.GetRoot().id.ToEnum<ContainerFlag>();
3265 if (containerFlag == ContainerFlag.none)
3266 {
3267 containerFlag = ContainerFlag.other;
3268 }
3269 if ((dataPick.noRotten && item2.IsDecayed) || (dataPick.onlyRottable && item2.trait.Decay == 0))
3270 {
3271 continue;
3272 }
3273 if (dataPick.userFilter)
3274 {
3275 switch (dataPick.IsFilterPass(item2.GetName(NameStyle.Full, 1)))
3276 {
3277 case Window.SaveData.FilterResult.PassWithoutFurtherTest:
3278 Pick(item2.Thing);
3279 continue;
3280 case Window.SaveData.FilterResult.Block:
3281 continue;
3282 }
3283 }
3284 if (dataPick.advDistribution)
3285 {
3286 foreach (int cat in dataPick.cats)
3287 {
3288 if (item2.category.uid == cat)
3289 {
3290 Pick(item2.Thing);
3291 }
3292 }
3293 }
3294 else if (!dataPick.flag.HasFlag(containerFlag))
3295 {
3296 Pick(item2.Thing);
3297 }
3298 }
3299 else
3300 {
3301 Pick(item2.Thing);
3302 }
3303 }
3304 }
3305 if (EClass._zone.IsRegion)
3306 {
3308 if (cell3?.zone != null && !cell3.zone.HiddenInRegionMap && (!(cell3.zone is Zone_Field) || cell3.zone.children.Count > 0 || cell3.zone.IsPCFaction))
3309 {
3310 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() ?? "");
3311 }
3312 if (pos.matFloor.alias == "snow" && EClass.rnd(3) == 0)
3313 {
3315 Msg.Say(Lang.GetList("walk_snow").RandomItem());
3316 }
3317 else if (EClass.world.weather.CurrentCondition == Weather.Condition.RainHeavy && EClass.rnd(3) == 0)
3318 {
3320 Msg.Say(Lang.GetList("walk_storm").RandomItem());
3321 }
3322 }
3323 ActWait.Search(this);
3324 }
3325 if (IsPCC)
3326 {
3327 int num6 = Mathf.Abs(cell2.topHeight - cell.topHeight);
3328 if ((num6 >= 3 && lastPos.sourceBlock.tileType.slopeHeight == 0 && newPoint.sourceBlock.tileType.slopeHeight == 0) || cell2.hasDoorBoat || cell.hasDoorBoat)
3329 {
3330 renderer.PlayAnime((cell2.topHeight >= cell.topHeight) ? AnimeID.JumpDown : ((num6 >= 6) ? AnimeID.Jump : AnimeID.JumpSmall));
3331 }
3332 else
3333 {
3334 float surfaceHeight = cell2.GetSurfaceHeight();
3335 float surfaceHeight2 = cell.GetSurfaceHeight();
3336 num6 = (int)Mathf.Abs((surfaceHeight - surfaceHeight2) * 100f);
3337 if (num6 >= 15)
3338 {
3339 renderer.PlayAnime((surfaceHeight >= surfaceHeight2) ? AnimeID.JumpDown : ((num6 >= 40) ? AnimeID.Jump : AnimeID.JumpSmall));
3340 }
3341 }
3342 }
3343 if (IsPC)
3344 {
3345 if (renderer.anime == null && renderer.replacer != null && renderer.replacer.pccData == null)
3346 {
3348 }
3350 {
3351 if (!FLOOR.IsTatami(pos.cell.sourceSurface.id) && pos.cell.room == null)
3352 {
3353 EClass.player.flags.isShoesOff = false;
3354 EClass.pc.Say("shoes_on", EClass.pc);
3355 EClass.pc.SetPCCState(PCCState.Normal);
3356 }
3357 }
3358 else if (FLOOR.IsTatami(pos.cell.sourceSurface.id) && pos.cell.room != null)
3359 {
3360 EClass.player.flags.isShoesOff = true;
3361 EClass.pc.Say("shoes_off", EClass.pc);
3362 EClass.pc.SetPCCState(PCCState.ShoesOff);
3363 }
3364 }
3365 bool flag7 = flag5 || EClass._zone.IsUnderwater;
3366 if (wasInWater != flag7)
3367 {
3368 wasInWater = flag7;
3369 RefreshSpeed();
3370 }
3371 lastPos.Things.ForeachReverse(delegate(Thing t)
3372 {
3373 t.trait.OnSteppedOut(this);
3374 });
3375 if (!IsPC)
3376 {
3377 pos.Things.ForeachReverse(delegate(Thing t)
3378 {
3379 t.trait.OnStepped(this);
3380 });
3381 }
3382 if (CanDestroyPath())
3383 {
3385 }
3386 if (!isDead)
3387 {
3388 if (Evalue(492) > 0 && EClass.rnd(10000 / (80 + Evalue(492) * 2)) == 0)
3389 {
3390 AddExp(Mathf.Clamp((int)Mathf.Sqrt(base.ExpToNext / 100), 1, 1000));
3391 }
3392 if (pos.IsBlocked && EClass.rnd(IsPC ? 2 : 20) == 0)
3393 {
3394 stamina.Mod(-1);
3395 }
3396 }
3397 hasMovedThisTurn = true;
3398 return MoveResult.Success;
3399 }
AnimeID
Definition: AnimeID.cs:2
AttackSource
Definition: AttackSource.cs:2
ContainerFlag
Definition: ContainerFlag.cs:5
NameStyle
Definition: NameStyle.cs:2
PlaceState
Definition: PlaceState.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:6641
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:7201
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:4276
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:8200
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:3123
bool HasElement(int ele, bool includeNagative=false)
Definition: Card.cs:6379
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:7319
Definition: Cell.cs:7
SourceBlock.Row sourceBlock
Definition: Cell.cs:1074
bool IsSnowTile
Definition: Cell.cs:802
bool hasDoorBoat
Definition: Cell.cs:518
bool HasBridge
Definition: Cell.cs:691
bool isClearSnow
Definition: Cell.cs:470
bool isFloating
Definition: Cell.cs:494
SourceMaterial.Row matObj
Definition: Cell.cs:1058
byte topHeight
Definition: Cell.cs:98
SourceMaterial.Row matFloor
Definition: Cell.cs:1052
byte obj
Definition: Cell.cs:52
SourceObj.Row sourceObj
Definition: Cell.cs:1096
bool HasRamp
Definition: Cell.cs:857
bool hasDoor
Definition: Cell.cs:278
SourceFloor.Row sourceSurface
Definition: Cell.cs:1081
float GetSurfaceHeight()
Definition: Cell.cs:1742
bool CanSuffocate()
Definition: Cell.cs:1135
Definition: Chara.cs:10
void TickConditions()
Definition: Chara.cs:3911
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:2643
bool IsInCombat
Definition: Chara.cs:911
bool HasCondition(string alias)
Definition: Chara.cs:10010
AIAct SetAI(AIAct g)
Definition: Chara.cs:9453
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:2656
void DestroyPath(Point pos)
Definition: Chara.cs:3401
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:3512
new Point lastPos
Definition: Chara.cs:90
void MoveByForce(Point newPoint, Card c=null, bool checkWall=false)
Definition: Chara.cs:2841
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:2049
MoveResult TryMoveTowards(Point p)
Definition: Chara.cs:2849
void SyncRide()
Definition: Chara.cs:4193
bool isDead
Definition: Chara.cs:393
override void LookAt(Card c)
Definition: Chara.cs:3775
bool isConfused
Definition: Chara.cs:128
override bool IsPCC
Definition: Chara.cs:700
void TryPush(Point point)
Definition: Chara.cs:3445
void SetPCCState(PCCState state)
Definition: Chara.cs:7068
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:372
RenderSetting render
Definition: GameSetting.cs:346
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:851
void SetFoormark(Point pos, int id, int angle, int offset=0)
Definition: Map.cs:2104
void SetEffect(int x, int z, CellEffect effect=null)
Definition: Map.cs:1552
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:1164
Window.SaveData dataPick
Definition: Player.cs:1104
bool regionMoveWarned
Definition: Player.cs:1230
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:369
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:1275
virtual bool IsChangeFloorHeight
Definition: Trait.cs:74
virtual void OnStepped(Chara c)
Definition: Trait.cs:1271
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:294
override int DangerLv
Definition: Zone.cs:115
bool IsPCFaction
Definition: Zone.cs:480
virtual bool IsUnderwater
Definition: Zone.cs:276
virtual bool KeepAllyDistance
Definition: Zone.cs:309
virtual bool HiddenInRegionMap
Definition: Zone.cs:420
Map map
Definition: Zone.cs:66

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

7673 {
7674 EClass.Sound.Play("pop_drama");
7675 if (book == "_chara" && IsPC)
7676 {
7677 step = "pc";
7678 }
7679 if (id == "lomias")
7680 {
7682 }
7683 return LayerDrama.Activate(book, sheet, step, this, null, tag);
7684 }
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:12
static void GetAchievement(ID_Achievement id)
Definition: Steam.cs:53

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

◆ AddCondition() [1/3]

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

Definition at line 9850 of file Chara.cs.

9851 {
9852 c.owner = this;
9853 if (!(c is ConBurning))
9854 {
9855 if (c is ConBleed && ResistLv(964) >= 3)
9856 {
9857 return null;
9858 }
9859 }
9860 else if (ResistLv(950) >= 3)
9861 {
9862 return null;
9863 }
9865 {
9866 if (c.GainResistFactor >= 400)
9867 {
9868 c.power /= 2;
9869 }
9870 ResistCon(c);
9871 if (c.power <= 0)
9872 {
9873 return null;
9874 }
9875 }
9876 if (!force)
9877 {
9878 if (c.source.negate.Length != 0)
9879 {
9880 string[] negate = c.source.negate;
9881 foreach (string text in negate)
9882 {
9883 if (HasElement(text))
9884 {
9885 return null;
9886 }
9887 }
9888 }
9889 Element defenseAttribute = c.GetDefenseAttribute(this);
9890 if (defenseAttribute != null)
9891 {
9892 c.power = MathEx.ClampToInt(100L * (long)c.power / Mathf.Max(100 + defenseAttribute.Value, 1));
9893 }
9894 if (c.source.resistance.Length != 0)
9895 {
9896 int num = ResistLv(EClass.sources.elements.alias[c.source.resistance[0]].id);
9897 if (num > 0)
9898 {
9899 c.power /= num * num + 1;
9900 if (c.power <= 40)
9901 {
9902 return null;
9903 }
9904 }
9905 }
9906 c.power = c.EvaluatePower(c.power);
9907 if (c.power <= 0)
9908 {
9909 return null;
9910 }
9911 }
9912 int num2 = c.EvaluateTurn(c.power);
9913 if (c is ConDeathSentense && HasElement(494))
9914 {
9915 num2 = num2 * (100 + (int)Mathf.Sqrt(Evalue(494)) * 10) / 100;
9916 }
9917 if (num2 == 0)
9918 {
9919 return null;
9920 }
9921 for (int j = 0; j < conditions.Count; j++)
9922 {
9923 if (conditions[j].id != c.id)
9924 {
9925 continue;
9926 }
9927 if (c.Type == ConditionType.Stance || c.IsToggle)
9928 {
9929 conditions[j].Kill();
9930 return null;
9931 }
9932 if (conditions[j].CanStack(c))
9933 {
9934 if (conditions[j].ShouldOverride(c))
9935 {
9936 if (conditions[j].IsOverrideConditionMet(c, num2))
9937 {
9938 conditions[j].Kill(silent: true);
9939 continue;
9940 }
9941 return null;
9942 }
9943 if (CanGainConResist)
9944 {
9945 AddResistCon(c);
9946 }
9947 conditions[j].OnStacked(c.power);
9948 conditions[j].OnStartOrStack();
9949 conditions[j].PlayEffect();
9950 }
9951 if (!conditions[j].AllowMultipleInstance)
9952 {
9953 return null;
9954 }
9955 }
9956 foreach (Condition condition in conditions)
9957 {
9958 if (condition.TryNullify(c))
9959 {
9960 return null;
9961 }
9962 }
9963 c.value = num2;
9964 conditions.Add(c);
9965 if (CanGainConResist)
9966 {
9967 AddResistCon(c);
9968 }
9969 c.SetOwner(this);
9970 c.Start();
9971 SetDirtySpeed();
9972 if (c.ShouldRefresh)
9973 {
9974 Refresh();
9975 }
9976 if (c.CancelAI)
9977 {
9978 ai.Cancel();
9979 }
9980 if (IsPC && c.ConsumeTurn && !EClass.pc.isRestrained)
9981 {
9983 }
9984 if (c.SyncRide && (ride != null || parasite != null))
9985 {
9986 if (ride != null)
9987 {
9989 }
9990 if (parasite != null)
9991 {
9993 }
9994 }
9995 return c;
9996 }
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:6374
void SetDirtySpeed()
Definition: Chara.cs:2040
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:9838
bool CanGainConResist
Definition: Chara.cs:1220
void AddResistCon(Condition con)
Definition: Chara.cs:10276
void ResistCon(Condition con)
Definition: Chara.cs:10296
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
Definition: MathEx.cs:2
static int ClampToInt(long a)
Definition: MathEx.cs:25
void EndTurn(bool consume=true)
Definition: Player.cs:2179
SourceElement elements

References AddCondition(), AIAct.Cancel(), MathEx.ClampToInt(), 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/3]

Condition Chara.AddCondition ( string  id,
int  p,
int  p2,
bool  force = false 
)
inline

Definition at line 9843 of file Chara.cs.

9844 {
9845 Condition condition = Condition.Create(id, p);
9846 condition.P2 = p2;
9847 return AddCondition(condition, force);
9848 }

References Condition.Create().

◆ AddCondition() [3/3]

◆ AddCondition< T >() [1/2]

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

Definition at line 9833 of file Chara.cs.

9833 : Condition
9834 {
9835 return AddCondition(typeof(T).Name, p, p2, force);
9836 }
string Name
Definition: Card.cs:2191

◆ AddCondition< T >() [2/2]

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

Definition at line 9828 of file Chara.cs.

9828 : Condition
9829 {
9830 return AddCondition(typeof(T).Name, p, force);
9831 }

◆ AddCooldown()

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

Definition at line 9234 of file Chara.cs.

9235 {
9236 if (_cooldowns == null)
9237 {
9238 _cooldowns = new List<int>();
9239 }
9240 if (turns != 0)
9241 {
9242 _cooldowns.Add(idEle * 1000 + turns);
9243 return;
9244 }
9245 SourceElement.Row row = EClass.sources.elements.map[idEle];
9246 if (row.cooldown > 0)
9247 {
9248 _cooldowns.Add(idEle * 1000 + row.cooldown);
9249 }
9250 }
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 10801 of file Chara.cs.

10802 {
10803 if (!IsPCFaction || !IsGlobal)
10804 {
10805 _historyFood = null;
10806 return;
10807 }
10808 if (_historyFood == null)
10809 {
10810 _historyFood = new List<List<string>>
10811 {
10812 new List<string>()
10813 };
10814 }
10815 if (_historyFood[0].Count < 5)
10816 {
10817 _historyFood[0].Add(food.id);
10818 }
10819 }
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 9653 of file Chara.cs.

9654 {
9655 foreach (int hobby in _hobbies)
9656 {
9657 if (hobby == id)
9658 {
9659 return;
9660 }
9661 }
9662 _hobbies.Add(id);
9663 }
List< int > _hobbies
Definition: Chara.cs:49

◆ AddRandomBodyPart()

void Chara.AddRandomBodyPart ( bool  msg = false)
inline

Definition at line 2387 of file Chara.cs.

2388 {
2389 int ele = new int[9] { 30, 31, 33, 35, 35, 36, 34, 37, 39 }.RandomItem();
2390 body.AddBodyPart(ele);
2391 if (msg)
2392 {
2393 Say("gain_bodyparts", this, Element.Get(ele).GetName().ToLower());
2394 PlaySound("offering");
2395 }
2396 }
void AddBodyPart(int ele, Thing thing=null)
Definition: CharaBody.cs:312
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 10276 of file Chara.cs.

10277 {
10278 if (con.power > 0 && con.GainResistFactor > 0)
10279 {
10280 int key = con.id;
10281 if (resistCon == null)
10282 {
10283 resistCon = new Dictionary<int, int>();
10284 }
10285 if (resistCon.ContainsKey(key))
10286 {
10287 resistCon[key] += con.power * con.GainResistFactor / 100;
10288 }
10289 else
10290 {
10291 resistCon[key] = con.power * con.GainResistFactor / 100;
10292 }
10293 }
10294 }
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 9665 of file Chara.cs.

9666 {
9667 foreach (int work in _works)
9668 {
9669 if (work == id)
9670 {
9671 return;
9672 }
9673 }
9674 _works.Add(id);
9675 }
List< int > _works
Definition: Chara.cs:52

◆ ApplyDeathPenalty()

void Chara.ApplyDeathPenalty ( )
inline

Definition at line 5571 of file Chara.cs.

5572 {
5573 if (!IsPC)
5574 {
5575 return;
5576 }
5577 int currency = GetCurrency();
5578 if (currency > 0)
5579 {
5580 int num = currency / 3 + EClass.rnd(currency / 3 + 1);
5581 if (num <= 0)
5582 {
5583 num = 1;
5584 }
5585 Msg.Say("panaltyMoney", this, Lang._currency(num));
5586 ModCurrency(-num);
5588 }
5589 foreach (Element value in EClass.pc.elements.dict.Values)
5590 {
5591 if (EClass.rnd(5) == 0 && value.IsMainAttribute)
5592 {
5593 EClass.pc.elements.ModExp(value.id, -500f);
5594 }
5595 }
5596 }
@ currency
ElementContainerCard elements
Definition: Card.cs:42
int GetCurrency(string id="money")
Definition: Card.cs:4156
void ModCurrency(int a, string id="money")
Definition: Card.cs:4142
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:2142

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

2223 {
2224 switch (tag)
2225 {
2226 case EditorTag.HostilityNeutral:
2227 {
2228 Hostility hostility = (base.c_originalHostility = Hostility.Neutral);
2229 this.hostility = hostility;
2230 break;
2231 }
2232 case EditorTag.HostilityEnemy:
2233 {
2234 Hostility hostility = (base.c_originalHostility = Hostility.Enemy);
2235 this.hostility = hostility;
2236 break;
2237 }
2238 case EditorTag.HostilityFriend:
2239 {
2240 Hostility hostility = (base.c_originalHostility = Hostility.Friend);
2241 this.hostility = hostility;
2242 break;
2243 }
2244 case EditorTag.Male:
2245 bio.SetGender(2);
2246 base.c_idPortrait = Portrait.GetRandomPortrait(2, GetIdPortraitCat());
2247 break;
2248 case EditorTag.Female:
2249 bio.SetGender(1);
2250 base.c_idPortrait = Portrait.GetRandomPortrait(1, GetIdPortraitCat());
2251 break;
2252 case EditorTag.baby:
2253 SetFeat(1232);
2254 break;
2255 }
2256 base.ApplyEditorTags(tag);
2257 }
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:10517
string GetIdPortraitCat()
Definition: Chara.cs:8645
static string GetRandomPortrait(string idDict)
Definition: Portrait.cs:105

References Card.bio, GetIdPortraitCat(), Portrait.GetRandomPortrait(), hostility, SetFeat(), and Biography.SetGender().

◆ ApplyJob()

void Chara.ApplyJob ( bool  remove = false)
inline

Definition at line 2349 of file Chara.cs.

2350 {
2351 elements.ApplyElementMap(base.uid, SourceValueType.Chara, job.elementMap, base.DefaultLV, remove, applyFeat: true);
2352 if (IsPCC)
2353 {
2354 EClass.game.uniforms.Apply(pccData, job.id, base.IsMale, canUseOtherGender: true);
2355 }
2356 }
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 2435 of file Chara.cs.

2436 {
2437 string[] array = race.figure.Split('|');
2438 foreach (string s in array)
2439 {
2440 int num = ParseBodySlot(s);
2441 if (num != -1)
2442 {
2443 if (remove)
2444 {
2445 body.RemoveBodyPart(num);
2446 }
2447 else
2448 {
2449 body.AddBodyPart(num);
2450 }
2451 }
2452 }
2454 elements.ApplyElementMap(base.uid, SourceValueType.Chara, race.elementMap, base.DefaultLV, remove, applyFeat: true);
2455 if (remove)
2456 {
2457 if (HasElement(1423))
2458 {
2459 SetFeat(1423, 0);
2460 }
2461 return;
2462 }
2463 bool flag = id == "chara" || id == "player";
2464 if (race.id == "bike" && id != "bike_cub")
2465 {
2466 SetFeat(1423, flag ? 10 : (1 + EClass.rnd(10)));
2467 }
2468 if (id == "moa")
2469 {
2470 SetFeat(1423, flag ? 7 : (1 + EClass.rnd(7)));
2471 }
2472 if (race.id == "horse" && EClass.rnd(5) == 0)
2473 {
2474 SetFeat(1423, flag ? 5 : (1 + EClass.rnd(5)));
2475 }
2476 }
void RefreshBodyParts()
Definition: CharaBody.cs:338
void RemoveBodyPart(int ele)
Definition: CharaBody.cs:367
int ParseBodySlot(string s)
Definition: Chara.cs:2370

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

2548 {
2549 owner?.Say("summon_vanish", this);
2550 pos.PlayEffect("vanish");
2551 pos.PlaySound("vanish");
2552 pos.PlayEffect("teleport");
2553 Destroy();
2554 }
void Destroy()
Definition: Card.cs:5313
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 2584 of file Chara.cs.

2585 {
2586 List<Chara> list = new List<Chara>();
2587 foreach (Chara chara in EClass._map.charas)
2588 {
2589 if (chara.IsMinion && chara.master == this)
2590 {
2591 list.Add(chara);
2592 }
2593 }
2594 foreach (Chara item in list)
2595 {
2596 item.Banish(this);
2597 }
2598 }
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 2008 of file Chara.cs.

2009 {
2010 int num = base.ChildrenWeight * 100 / Mathf.Max(1, WeightLimit);
2011 if (num < 0)
2012 {
2013 num = 1000;
2014 }
2016 {
2017 num = 0;
2018 }
2019 burden.Set(num);
2020 SetDirtySpeed();
2021 }
override int WeightLimit
Definition: Chara.cs:728
bool ignoreWeight
Definition: CoreDebug.cs:203
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 6504 of file Chara.cs.

6505 {
6506 if (!(e is Spell))
6507 {
6508 return 100;
6509 }
6510 if (!IsPC)
6511 {
6512 int num2 = 95;
6513 if (host != null)
6514 {
6515 if (host.ride == this)
6516 {
6517 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.EvalueRiding()));
6518 }
6519 if (host.parasite == this)
6520 {
6521 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.Evalue(227)));
6522 }
6523 }
6524 return num2;
6525 }
6526 int num3 = Evalue(304);
6527 if (!IsPCFaction)
6528 {
6529 num3 = Mathf.Max(num3, base.LV + 5);
6530 }
6531 int num4 = 0;
6532 int num5 = 0;
6533 bool num6 = GetArmorSkill() == 122;
6534 AttackStyle attackStyle = body.GetAttackStyle();
6535 if (num6)
6536 {
6537 num4 = 20 - Evalue(122) / 5;
6538 num5 += 10 - Evalue(1654) * 4;
6539 }
6540 else
6541 {
6542 num4 = 10 - Evalue(120) / 5;
6543 }
6544 if (num4 < 5)
6545 {
6546 num4 = 5;
6547 }
6548 if (ride != null)
6549 {
6550 num4 += 5;
6551 }
6552 if (parasite != null)
6553 {
6554 num4 += 10;
6555 }
6556 if (attackStyle == AttackStyle.TwoWield)
6557 {
6558 num4 += 5;
6559 }
6560 if (attackStyle == AttackStyle.Shield)
6561 {
6562 num4 += 10;
6563 num5 += 20 - Evalue(1654) * 8;
6564 }
6565 if (isConfused)
6566 {
6567 num4 += 10000;
6568 }
6569 if (HasCondition<ConDim>())
6570 {
6571 num4 += ((Evalue(1654) >= 3) ? 1500 : 2500);
6572 }
6573 if (num > 1)
6574 {
6575 num4 += 5 * num;
6576 }
6577 if (num5 < 0)
6578 {
6579 num5 = 0;
6580 }
6581 return Mathf.Clamp(100 + e.Value - 10 - e.source.LV * e.source.cost[0] * num4 / Mathf.Max(10 + num3 * 10, 1), 0, 100 - num5);
6582 }
AttackStyle
Definition: AttackStyle.cs:2
AttackStyle GetAttackStyle()
Definition: CharaBody.cs:508
override int GetArmorSkill()
Definition: Chara.cs:8338
int EvalueRiding()
Definition: Chara.cs:6495
SourceElement.Row source
Definition: ELEMENT.cs:282
Definition: SPELL.cs:708

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

2204 {
2205 int num = base.END;
2206 int num2 = 0;
2207 foreach (Element value in elements.dict.Values)
2208 {
2209 if (value.source.category == "skill")
2210 {
2211 num = ((!IsPC) ? (num + Mathf.Max(value.ValueWithoutLink, 0)) : (num + Mathf.Max(value.vBase, 0)));
2212 }
2213 }
2214 num2 = EClass.curve(num, 30, 10, 60);
2215 if (num2 < 10)
2216 {
2217 num2 = 10;
2218 }
2219 _maxStamina = num2 + 15;
2220 }
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 6810 of file Chara.cs.

6811 {
6812 foreach (Chara chara in EClass._map.charas)
6813 {
6814 if (!chara.IsPCFaction && chara.OriginalHostility == OriginalHostility && (fanatic || Dist(chara) <= 6) && (EClass.rnd(3) != 0 || fanatic))
6815 {
6816 chara.GoHostile(tg);
6817 }
6818 }
6819 }
Hostility OriginalHostility
Definition: Chara.cs:475
void GoHostile(Card _tg)
Definition: Chara.cs:6704

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

8744 {
8745 if (things.IsFull())
8746 {
8747 return false;
8748 }
8749 if (t.c_isImportant)
8750 {
8751 return false;
8752 }
8753 if (t.id == "1084")
8754 {
8755 return true;
8756 }
8757 if (t.trait is TraitBookExp)
8758 {
8759 return true;
8760 }
8761 if (t.trait.CanOnlyCarry || !t.trait.CanBeDestroyed || t.trait.CanExtendBuild || t.rarity == Rarity.Artifact || t.IsContainer)
8762 {
8763 return false;
8764 }
8765 if (base.IsPowerful && t.trait is TraitScroll { source: not null } traitScroll && traitScroll.source.abilityType.Contains("summon"))
8766 {
8767 return false;
8768 }
8769 return true;
8770 }
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.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 8722 of file Chara.cs.

8723 {
8725 {
8726 return true;
8727 }
8728 if (!IsValidGiftWeight(t, num))
8729 {
8730 return false;
8731 }
8732 if (!skipImportantCheck && t.c_isImportant)
8733 {
8734 return false;
8735 }
8736 if ((t.category.IsChildOf("furniture") || t.category.IsChildOf("junk")) && (!(t.trait is TraitFigure) || !HasElement(1427)) && !HasElement(1411))
8737 {
8738 return false;
8739 }
8740 return true;
8741 }
bool IsValidGiftWeight(Card t, int num=-1)
Definition: Chara.cs:8712

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

4535 {
4536 return true;
4537 }

◆ CanBeTempAlly()

bool Chara.CanBeTempAlly ( Chara  c)
inline

Definition at line 2534 of file Chara.cs.

2535 {
2536 if (IsPCFaction || IsGlobal || IsMinion || IsMultisize || EClass._zone.CountMinions(c) > c.MaxSummon || base.rarity >= Rarity.Legendary)
2537 {
2538 return false;
2539 }
2540 if (HasElement(1222))
2541 {
2542 return false;
2543 }
2544 return true;
2545 }
int MaxSummon
Definition: Chara.cs:732
override bool IsMultisize
Definition: Chara.cs:724
int CountMinions(Chara c)
Definition: Zone.cs:4019

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

9218 {
9219 if (IsPC || base.isScaled || HasElement(1273))
9220 {
9221 return false;
9222 }
9223 if (!EClass.debug.godMode)
9224 {
9225 if (base.c_daysWithPC > 360)
9226 {
9227 return affinity.CanSleepBeside();
9228 }
9229 return false;
9230 }
9231 return true;
9232 }
bool CanSleepBeside()
Definition: Affinity.cs:88
Affinity affinity
Definition: Chara.cs:318
bool godMode
Definition: CoreDebug.cs:189

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

Referenced by WindowCharaMini.Refresh().

◆ CanDestroyPath()

bool Chara.CanDestroyPath ( )
inline

Definition at line 2643 of file Chara.cs.

2644 {
2645 if (!IsMultisize)
2646 {
2647 if (base.rarity >= Rarity.Superior && !base.IsPCFactionOrMinion && ai is GoalCombat)
2648 {
2649 return !EClass._zone.IsPCFaction;
2650 }
2651 return false;
2652 }
2653 return true;
2654 }

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

1898 {
1899 if (EClass._zone.IsRegion)
1900 {
1901 return false;
1902 }
1904 {
1905 return false;
1906 }
1907 if (corruption >= 100)
1908 {
1909 return false;
1910 }
1911 if (con != DuplicateCondition.Water && con != DuplicateCondition.Quantum && (HasCondition<ConPoison>() || HasCondition<ConConfuse>() || HasCondition<ConDim>() || HasCondition<ConParalyze>() || HasCondition<ConSleep>() || HasCondition<ConBurning>() || HasCondition<ConFreeze>() || HasCondition<ConMiasma>()))
1912 {
1913 return false;
1914 }
1915 switch (con)
1916 {
1917 case DuplicateCondition.Scarab:
1919 {
1920 return false;
1921 }
1922 break;
1923 case DuplicateCondition.SpiderEgg:
1924 if (pos.cell.light > 0 || pos.IsSunLit)
1925 {
1926 return false;
1927 }
1928 break;
1929 }
1930 return true;
1931 }
DuplicateCondition
byte light
Definition: Cell.cs:78
bool HasRoof
Definition: Cell.cs:668
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 8052 of file Chara.cs.

8053 {
8054 if (t.IsDecayed && !HasElement(480))
8055 {
8056 return false;
8057 }
8058 if (HasElement(1250) && !t.HasElement(710))
8059 {
8060 return false;
8061 }
8062 if (shouldEat && (!(t.trait is TraitFoodPrepared) || t.c_isImportant))
8063 {
8064 return false;
8065 }
8066 if ((IsPC || (homeBranch != null && homeBranch.GetCivility() >= 50)) && (t.HasTag(CTAG.dish_fail) || t.id == "731"))
8067 {
8068 return false;
8069 }
8070 if (!t.IsNegativeGift && !t.HasTag(CTAG.ignoreUse) && !t.isEquipped)
8071 {
8072 return t.trait.CanEat(this);
8073 }
8074 return false;
8075 }
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:1173

References Card.c_isImportant, Trait.CanEat(), FactionBranch.GetCivility(), Card.HasElement(), Card.HasTag(), Card.id, 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 8228 of file Chara.cs.

8229 {
8230 return !body.IsTooHeavyToEquip(t);
8231 }
bool IsTooHeavyToEquip(Thing thing)
Definition: CharaBody.cs:187

References CharaBody.IsTooHeavyToEquip().

Referenced by GoalAutoCombat.TryUseRanged().

◆ CanInsult()

bool Chara.CanInsult ( )
inline

Definition at line 8633 of file Chara.cs.

8634 {
8635 foreach (ActList.Item item in ability.list.items)
8636 {
8637 if (item.act.id == 6630)
8638 {
8639 return true;
8640 }
8641 }
8642 return false;
8643 }
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 2750 of file Chara.cs.

2751 {
2752 return CanInteractTo(c.pos);
2753 }
bool CanInteractTo(Card c)
Definition: Chara.cs:2750

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

2756 {
2757 if (!p.IsValid)
2758 {
2759 return false;
2760 }
2761 if (EClass._map.cells[p.x, p.z].blocked)
2762 {
2763 return true;
2764 }
2765 if (!IsMultisize)
2766 {
2767 int num = ((p.z >= pos.z) ? ((p.x > pos.x) ? 1 : ((p.z > pos.z) ? 2 : 3)) : 0);
2768 if (EClass._map.cells[pos.x, pos.z].weights[num] == 0)
2769 {
2770 return false;
2771 }
2772 if (p.x != pos.x && p.z != pos.z)
2773 {
2774 Cell[,] cells = EClass._map.cells;
2775 int x = p.x;
2776 int z = pos.z;
2777 int num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2778 if (cells[pos.x, pos.z].weights[num2] == 0)
2779 {
2780 return false;
2781 }
2782 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2783 if (cells[p.x, p.z].weights[num2] == 0)
2784 {
2785 return false;
2786 }
2787 x = pos.x;
2788 z = p.z;
2789 num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2790 if (cells[pos.x, pos.z].weights[num2] == 0)
2791 {
2792 return false;
2793 }
2794 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2795 if (cells[p.x, p.z].weights[num2] == 0)
2796 {
2797 return false;
2798 }
2799 }
2800 }
2801 return true;
2802 }
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 4529 of file Chara.cs.

4530 {
4531 return true;
4532 }

Referenced by HotItemNoItem._TrySetAct().

◆ CanMoveTo()

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

Definition at line 2656 of file Chara.cs.

2657 {
2658 if (!p.IsValid)
2659 {
2660 return false;
2661 }
2662 int num = ((p.z >= pos.z) ? ((p.x > pos.x) ? 1 : ((p.z > pos.z) ? 2 : 3)) : 0);
2663 if (allowDestroyPath && CanDestroyPath())
2664 {
2665 if (!p.IsInBounds)
2666 {
2667 return false;
2668 }
2669 }
2670 else
2671 {
2673 {
2674 return false;
2675 }
2676 if (p.x != pos.x && p.z != pos.z)
2677 {
2678 Cell[,] cells = EClass._map.cells;
2679 int x = p.x;
2680 int z = pos.z;
2681 int num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2682 if (cells[pos.x, pos.z].weights[num2] == 0)
2683 {
2684 return false;
2685 }
2686 if (cells[x, z].blocked && (!IsAstralBody || cells[x, z].IsSky || EClass._zone.IsRegion))
2687 {
2688 return false;
2689 }
2690 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2691 if (cells[p.x, p.z].weights[num2] == 0)
2692 {
2693 return false;
2694 }
2695 x = pos.x;
2696 z = p.z;
2697 num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2698 if (cells[pos.x, pos.z].weights[num2] == 0)
2699 {
2700 return false;
2701 }
2702 if (cells[x, z].blocked && (!IsAstralBody || cells[x, z].IsSky || EClass._zone.IsRegion))
2703 {
2704 return false;
2705 }
2706 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2707 if (cells[p.x, p.z].weights[num2] == 0)
2708 {
2709 return false;
2710 }
2711 }
2712 }
2713 if (IsPC)
2714 {
2715 if (IsEnemyOnPath(p))
2716 {
2717 return false;
2718 }
2719 }
2720 else if (p.HasChara && !IsMultisize && !CanReplace(p.FirstChara))
2721 {
2722 return false;
2723 }
2724 return true;
2725 }
bool IsSky
Definition: Cell.cs:954
bool IsAstralBody
Definition: Chara.cs:506
bool IsEnemyOnPath(Point p, bool cancelAI=true)
Definition: Chara.cs:2727
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 4539 of file Chara.cs.

4540 {
4541 if (c.isDestroyed)
4542 {
4543 return false;
4544 }
4545 Card rootCard = c.GetRootCard();
4546 if (rootCard.isDestroyed || (rootCard.ExistsOnMap && rootCard.pos.Distance(pos) > 1))
4547 {
4548 return false;
4549 }
4550 if (rootCard != this && things.IsFull(c.Thing))
4551 {
4552 return false;
4553 }
4554 return true;
4555 }
bool isDestroyed
Definition: Card.cs:78
bool ExistsOnMap
Definition: Card.cs:2137
Card GetRootCard()
Definition: Card.cs:3607

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

3513 {
3515 {
3516 return false;
3517 }
3518 if (IsPC)
3519 {
3520 return true;
3521 }
3522 if (c.IsPC || c.pos.Equals(EClass.pc.pos) || c.host != null)
3523 {
3524 return false;
3525 }
3526 if (!IsHostile(c))
3527 {
3528 if (c.c_uidMaster != 0 || c.isSummon || base.IsPowerful || IsEscorted())
3529 {
3530 return true;
3531 }
3532 if (DestDist < c.DestDist)
3533 {
3534 return true;
3535 }
3536 if (IsPCParty && !c.IsPCParty)
3537 {
3538 return true;
3539 }
3540 if (IsPCFaction && !c.IsPCParty)
3541 {
3542 return true;
3543 }
3544 }
3545 return false;
3546 }
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:6909
bool IsEscorted()
Definition: Chara.cs:2627
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 5439 of file Chara.cs.

5440 {
5441 return EClass.world.date.IsExpired(base.c_dateDeathLock);
5442 }
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:6895
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:43

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

2359 {
2360 ApplyJob(remove: true);
2361 base.c_idJob = idNew;
2362 _job = null;
2363 ApplyJob();
2364 if (IsPCC)
2365 {
2366 PCC.Get(pccData).Build();
2367 }
2368 }
void ApplyJob(bool remove=false)
Definition: Chara.cs:2349
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 7467 of file Chara.cs.

7468 {
7469 memberType = type;
7470 }
FactionMemberType memberType
Definition: Chara.cs:46

◆ ChangeRace()

void Chara.ChangeRace ( string  idNew)
inline

Definition at line 2478 of file Chara.cs.

2479 {
2480 ApplyRace(remove: true);
2481 base.c_idRace = idNew;
2482 _race = null;
2483 ApplyRace();
2484 ChangeMaterial(source.defMat.IsEmpty(race.material));
2485 }
@ ChangeMaterial
void ApplyRace(bool remove=false)
Definition: Chara.cs:2435
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 9324 of file Chara.cs.

9325 {
9326 if (IsPC && EClass.AdvMode)
9327 {
9328 SetNoGoal();
9329 return;
9330 }
9331 if (IsPCParty || base.noMove)
9332 {
9333 SetAI(new GoalIdle());
9334 return;
9335 }
9336 if ((IsHomeMember() && IsInHomeZone()) || IsGuest())
9337 {
9338 Goal goalFromTimeTable = GetGoalFromTimeTable(EClass.world.date.hour);
9339 if (goalFromTimeTable != null)
9340 {
9341 SetAI(goalFromTimeTable);
9342 if (goalFromTimeTable is GoalWork)
9343 {
9344 goalFromTimeTable.Tick();
9345 }
9346 return;
9347 }
9348 }
9349 if (goalList.index == -2)
9350 {
9352 }
9353 SetAI(goalList.Next());
9354 }
Status Tick()
Definition: AIAct.cs:366
Goal GetGoalFromTimeTable(int hour)
Definition: Chara.cs:9356
GoalListType goalListType
Definition: Chara.cs:283
AIAct SetNoGoal()
Definition: Chara.cs:9448
bool IsHomeMember()
Definition: Chara.cs:6975
bool IsGuest()
Definition: Chara.cs:7000
GoalList goalList
Definition: Chara.cs:204
bool IsInHomeZone()
Definition: Chara.cs:6980
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 7759 of file Chara.cs.

7760 {
7761 if (map == null)
7762 {
7763 map = EClass._map;
7764 }
7765 foreach (Card item in map.props.installed.all)
7766 {
7767 if (item.trait is TraitBed traitBed && traitBed.IsHolder(this))
7768 {
7769 traitBed.RemoveHolder(this);
7770 }
7771 }
7772 }
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 9096 of file Chara.cs.

9097 {
9098 int num = 0;
9099 for (int num2 = things.Count - 1; num2 >= 0; num2--)
9100 {
9101 Thing thing = things[num2];
9102 if (ShouldThrowAway(thing, type))
9103 {
9104 num += thing.GetPrice(CurrencyType.Money, sell: true, PriceType.Default, this) * thing.Num;
9105 thing.Destroy();
9106 }
9107 }
9108 if (num > 0)
9109 {
9110 ModCurrency(num);
9111 if (type == ClearInventoryType.SellAtTown)
9112 {
9113 Msg.Say("party_sell", this, num.ToString() ?? "");
9114 PlaySound("pay");
9115 }
9116 }
9117 }
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:8991
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 11015 of file Chara.cs.

11016 {
11017 if (tempElements != null)
11018 {
11020 tempElements = null;
11021 }
11022 }
ElementContainer tempElements
Definition: Chara.cs:36
void SetParent(Card c)

References ElementContainer.SetParent().

◆ CountDebuff()

int Chara.CountDebuff ( )
inline

Definition at line 10039 of file Chara.cs.

10040 {
10041 int num = 0;
10042 foreach (Condition condition in conditions)
10043 {
10044 if (condition.Type == ConditionType.Debuff)
10045 {
10046 num++;
10047 }
10048 }
10049 return num;
10050 }

References BaseStats.Type.

Referenced by GoalCombat.TryUseAbility().

◆ CountNumEaten()

int Chara.CountNumEaten ( Thing  food)
inline

Definition at line 10821 of file Chara.cs.

10822 {
10823 if (_historyFood == null)
10824 {
10825 return -1;
10826 }
10827 int num = 0;
10828 foreach (List<string> item in _historyFood)
10829 {
10830 foreach (string item2 in item)
10831 {
10832 if (item2 == food.id)
10833 {
10834 num++;
10835 }
10836 }
10837 }
10838 return num;
10839 }

References food, and item.

Referenced by FoodEffect.Proc().

◆ CreateReplacement()

Chara Chara.CreateReplacement ( )
inline

Definition at line 8486 of file Chara.cs.

8487 {
8488 Chara chara = CharaGen.Create(id);
8489 chara.c_originalHostility = base.c_originalHostility;
8490 if (chara.c_originalHostility != 0)
8491 {
8492 chara.hostility = chara.c_originalHostility;
8493 }
8494 if (orgPos != null)
8495 {
8496 chara.orgPos = orgPos.Copy();
8497 }
8498 chara.pos = pos.Copy();
8499 chara.isImported = true;
8500 chara.c_editorTags = base.c_editorTags;
8501 chara.c_editorTraitVal = base.c_editorTraitVal;
8502 chara.c_idTrait = base.c_idTrait;
8503 chara.homeZone = homeZone;
8504 return chara;
8505 }
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 6596 of file Chara.cs.

6597 {
6598 Talk("goodBoy");
6599 Say(headpat ? "headpat" : "cuddle", this, c);
6600 c.ShowEmo(Emo.love);
6601 if (EClass.rnd(IsPC ? 100 : 5000) == 0)
6602 {
6603 c.MakeEgg();
6604 }
6605 if (headpat && this != c)
6606 {
6607 if (c.interest > 0)
6608 {
6609 c.ModAffinity(EClass.pc, 1 + EClass.rnd(3));
6610 c.interest -= 20 + EClass.rnd(10);
6611 }
6613 {
6614 foreach (Chara member in c.party.members)
6615 {
6616 if (!member.IsPC && CanSeeLos(member))
6617 {
6618 member.AddCondition<ConEuphoric>(100 + Evalue(6904) * 5);
6619 }
6620 }
6621 }
6622 }
6623 if (c.Evalue(1221) > 0)
6624 {
6625 int ele = ((c.MainElement == Element.Void) ? 924 : c.MainElement.id);
6626 if (c.id == "hedgehog_ether")
6627 {
6628 ele = 922;
6629 }
6630 Say("reflect_thorne", this, c);
6631 DamageHP(10L, ele, Power, AttackSource.Condition);
6632 }
6633 }
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:6609
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
Definition: Card.cs:6041
Element MainElement
Definition: Chara.cs:735
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Definition: Chara.cs:8408
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, party, 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 10115 of file Chara.cs.

10116 {
10117 bool flag = state == BlessedState.Blessed;
10118 switch (type)
10119 {
10120 case CureType.Heal:
10121 case CureType.Prayer:
10122 CureCondition<ConFear>();
10123 CureCondition<ConBlind>(2 * p / 100 + 5);
10124 CureCondition<ConPoison>(5 * p / 100 + 5);
10125 CureCondition<ConConfuse>(10 * p / 100 + 10);
10126 CureCondition<ConDim>(p / 100 + 5);
10127 CureCondition<ConBleed>(2 * p / 100 + 10);
10128 if (flag)
10129 {
10130 SAN.Mod(-15);
10131 }
10132 break;
10133 case CureType.CureBody:
10134 CureCondition<ConBlind>(5 * p / 100 + 15);
10135 CureCondition<ConPoison>(10 * p / 100 + 15);
10136 CureCondition<ConBleed>(5 * p / 100 + 20);
10137 CureTempElements(p, body: true, mind: false);
10138 break;
10139 case CureType.CureMind:
10140 CureCondition<ConFear>();
10141 CureCondition<ConDim>(3 * p / 100 + 10);
10142 CureTempElements(p, body: false, mind: true);
10143 break;
10144 case CureType.Sleep:
10145 {
10146 for (int num2 = conditions.Count - 1; num2 >= 0; num2--)
10147 {
10148 Condition condition2 = conditions[num2];
10149 if (!(condition2 is ConSleep) && !(condition2 is ConFaint))
10150 {
10151 if (condition2.isPerfume)
10152 {
10153 condition2.Mod(-1, force: true);
10154 }
10155 else if (condition2.Type == ConditionType.Bad || condition2.Type == ConditionType.Debuff)
10156 {
10157 condition2.Kill();
10158 }
10159 }
10160 }
10161 CureCondition<ConWait>();
10162 CureCondition<ConDisease>((EClass.rnd(20) + 10) * p / 100);
10163 bool flag2 = HasCondition<ConAnorexia>();
10164 base.c_vomit -= (flag2 ? 3 : 2) * p / 100;
10165 if (base.c_vomit < 0)
10166 {
10167 base.c_vomit = 0;
10168 if (flag2)
10169 {
10170 RemoveCondition<ConAnorexia>();
10171 }
10172 }
10173 break;
10174 }
10175 case CureType.HealComplete:
10176 case CureType.Death:
10177 case CureType.Jure:
10178 case CureType.Boss:
10179 case CureType.Unicorn:
10180 {
10181 CureTempElements(p * 100, body: true, mind: true);
10182 for (int num = conditions.Count - 1; num >= 0; num--)
10183 {
10184 Condition condition = conditions[num];
10185 if (condition is ConAnorexia && type != CureType.Death && type != CureType.Unicorn && type != CureType.Jure)
10186 {
10187 continue;
10188 }
10189 switch (condition.Type)
10190 {
10191 case ConditionType.Bad:
10192 case ConditionType.Debuff:
10193 case ConditionType.Disease:
10194 condition.Kill();
10195 continue;
10196 case ConditionType.Stance:
10197 if (type == CureType.Death)
10198 {
10199 condition.Kill();
10200 continue;
10201 }
10202 break;
10203 }
10204 if (type == CureType.Death && condition.isPerfume)
10205 {
10206 condition.Kill();
10207 }
10208 }
10209 CureCondition<ConWait>();
10210 CureCondition<ConSleep>();
10211 switch (type)
10212 {
10213 case CureType.Death:
10214 case CureType.Boss:
10215 case CureType.Unicorn:
10216 SAN.Mod(-20);
10217 RemoveCondition<ConBrightnessOfLife>();
10218 RemoveCondition<ConDeathSentense>();
10219 break;
10220 case CureType.Jure:
10221 SAN.Mod(-999);
10222 if (HasElement(1206))
10223 {
10224 SetFeat(1206, 0, msg: true);
10225 }
10226 RemoveCondition<ConBrightnessOfLife>();
10227 RemoveCondition<ConDeathSentense>();
10228 break;
10229 case CureType.CureBody:
10230 case CureType.CureMind:
10231 case CureType.Prayer:
10232 break;
10233 }
10234 break;
10235 }
10236 }
10237 }
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:10985
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 10052 of file Chara.cs.

10052 : Condition
10053 {
10054 T condition = GetCondition<T>();
10055 if (condition != null)
10056 {
10057 int value = condition.value - v;
10058 condition.value = value;
10059 if (condition.value <= 0)
10060 {
10061 condition.Kill();
10062 }
10063 }
10064 }
override T GetCondition< T >()
Definition: Chara.cs:10078

◆ CureHost()

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

Definition at line 10102 of file Chara.cs.

10103 {
10104 if (parasite != null)
10105 {
10106 parasite.Cure(type, p, state);
10107 }
10108 if (ride != null)
10109 {
10110 ride.Cure(type, p, state);
10111 }
10112 Cure(type, p, state);
10113 }
void Cure(CureType type, int p=100, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:10115

References Cure(), and ride.

Referenced by FactionBranch.DailyOutcome().

◆ CureTempElements()

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

Definition at line 10985 of file Chara.cs.

10986 {
10987 if (tempElements != null)
10988 {
10989 if (body)
10990 {
10992 }
10993 if (mind)
10994 {
10996 }
10997 }
10998 void Cure(int[] eles)
10999 {
11000 foreach (int ele in eles)
11001 {
11002 if (tempElements == null)
11003 {
11004 break;
11005 }
11006 Element element = tempElements.GetElement(ele);
11007 if (element != null && element.vBase < 0)
11008 {
11009 ModTempElement(ele, Mathf.Clamp(p / 20 + EClass.rnd(p / 20), 1, -element.vBase));
11010 }
11011 }
11012 }
11013 }
void ModTempElement(int ele, int a, bool naturalDecay=false, bool onlyRenew=false)
Definition: Chara.cs:10893
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 10951 of file Chara.cs.

10952 {
10953 ModTempElement(ele, onlyRenew ? (-p / 20) : (-(p / 100 + EClass.rnd(p / 100 + 1) + 1)), naturalDecay: false, onlyRenew);
10954 }

References EClass.rnd().

◆ DamageTempElements()

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

Definition at line 10939 of file Chara.cs.

10940 {
10941 if (body)
10942 {
10943 DamageTempElement(Element.List_Body.RandomItem(), p, onlyRenew);
10944 }
10945 if (mind)
10946 {
10947 DamageTempElement(Element.List_Mind.RandomItem(), p, onlyRenew);
10948 }
10949 }
void DamageTempElement(int ele, int p, bool onlyRenew=false)
Definition: Chara.cs:10951

References Element.List_Body, and Element.List_Mind.

◆ DestroyPath()

void Chara.DestroyPath ( Point  pos)
inline

Definition at line 3401 of file Chara.cs.

3402 {
3403 bool broke = false;
3404 pos.ForeachMultiSize(base.W, base.H, delegate(Point _p, bool main)
3405 {
3406 if (_p.IsValid)
3407 {
3408 if (_p.HasBlock)
3409 {
3410 EClass._map.MineBlock(_p, recoverBlock: false, this);
3411 if (_p.HasObj)
3412 {
3413 EClass._map.MineObj(_p, null, this);
3414 }
3415 broke = true;
3416 }
3417 if (_p.HasObj && _p.IsBlocked)
3418 {
3419 EClass._map.MineObj(_p, null, this);
3420 broke = true;
3421 }
3422 _p.Things.ForeachReverse(delegate(Thing t)
3423 {
3424 if (t.IsInstalled && (t.trait.IsBlockPath || t.trait.IsDoor))
3425 {
3426 if (t.isNPCProperty && t.trait.CanBeDestroyed)
3427 {
3428 t.Destroy();
3429 }
3430 else if (!t.IsUnique && !t.trait.CanBeDestroyed)
3431 {
3432 t.SetPlaceState(PlaceState.roaming);
3433 }
3434 }
3435 });
3436 }
3437 });
3438 if (broke)
3439 {
3440 Msg.Say("stomp");
3441 Shaker.ShakeCam("stomp");
3442 }
3443 }
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 5634 of file Chara.cs.

5635 {
5636 combatCount = 0;
5637 if (isDead)
5638 {
5639 return;
5640 }
5641 if (host != null)
5642 {
5643 base.hp = -1;
5644 if ((uint)(attackSource - 17) > 1u)
5645 {
5646 AddCondition<ConFaint>(200, force: true);
5647 return;
5648 }
5649 ActRide.Unride(host, this);
5650 }
5651 bool isInActiveZone = IsInActiveZone;
5652 if (isInActiveZone)
5653 {
5654 if (id == "putty" && origin != null && origin.IsPCParty)
5655 {
5657 }
5658 if (IsPC)
5659 {
5661 }
5662 if (base.isSummon)
5663 {
5664 if (id == "tsunami")
5665 {
5666 pos.PlaySound("water");
5667 }
5668 else
5669 {
5670 Say("summon_vanish", this);
5671 pos.PlayEffect("vanish");
5672 pos.PlaySound("vanish");
5673 }
5674 Destroy();
5675 return;
5676 }
5677 if ((uint)(attackSource - 17) <= 1u)
5678 {
5679 if (attackSource == AttackSource.Euthanasia && trait is TraitLittleOne)
5680 {
5681 MakeEgg();
5682 if (IsPCFaction)
5683 {
5685 }
5686 }
5687 PlayEffect("revive");
5688 PlaySound("chime_angel");
5689 }
5690 else
5691 {
5692 Effect.Get("blood").Play((parent is Chara) ? (parent as Chara).pos : pos).SetParticleColor(EClass.Colors.matColors[base.material.alias].main)
5693 .Emit(50);
5694 AddBlood(AI_Slaughter.slaughtering ? 12 : (2 + EClass.rnd(2)));
5695 PlaySound(base.material.GetSoundDead(source));
5696 }
5699 ClearFOV();
5700 }
5701 if (base.hp >= 0)
5702 {
5703 base.hp = -1;
5704 }
5705 string text = "";
5706 "dead_in".langGame(EClass._zone.Name);
5707 string text2 = ((origin == null) ? "" : origin.GetName(NameStyle.Full));
5708 if (LangGame.Has("dead_" + attackSource))
5709 {
5710 text = "dead_" + attackSource;
5711 }
5712 else
5713 {
5714 if (e != Element.Void && e != null)
5715 {
5716 text = "dead_" + e.source.alias;
5717 }
5718 if (text == "" || !LangGame.Has(text))
5719 {
5720 text = "dead";
5721 }
5722 }
5723 if (IsPC)
5724 {
5725 EClass.player.staminaRecovery = 0;
5726 EClass._zone.isDeathLocation = true;
5727 string s = ((origin == null) ? text : "dead_by");
5729 if (attackSource == AttackSource.Wrath)
5730 {
5732 }
5733 EClass.player.deathMsg = GameLang.Parse(s.langGame(), thirdPerson: true, EClass.pc.NameBraced, "dead_in".langGame(EClass._zone.Name), text2);
5735 if (EClass._zone.instance is ZoneInstanceRandomQuest zoneInstanceRandomQuest)
5736 {
5737 zoneInstanceRandomQuest.status = ZoneInstance.Status.Fail;
5738 }
5739 AI_PlayMusic.keepPlaying = false;
5740 }
5741 if (isInActiveZone)
5742 {
5743 if (attackSource == AttackSource.DeathSentence || attackSource == AttackSource.Euthanasia)
5744 {
5745 Msg.Say("goto_heaven", this);
5746 }
5747 else
5748 {
5749 if (originalTarget != null || origin == null || !origin.isSynced || (attackSource != AttackSource.Melee && attackSource != AttackSource.Range))
5750 {
5751 Msg.Say(text, this, "", text2);
5752 }
5753 string text3 = TalkTopic("dead");
5754 if (!text3.IsEmpty())
5755 {
5756 text3 = text3.StripBrackets();
5757 }
5758 bool flag = base.rarity >= Rarity.Legendary && !IsPCFaction;
5759 if (!IsPC && flag)
5760 {
5761 MakeGrave(text3);
5762 }
5763 Msg.SetColor();
5764 SpawnLoot(origin);
5765 }
5766 if (IsPC)
5767 {
5769 }
5770 }
5771 if (IsPCFaction)
5772 {
5773 if (homeBranch != null)
5774 {
5775 homeBranch.Log(text, this, "");
5776 }
5777 WidgetPopText.Say("popDead".lang(base.Name), FontColor.Bad);
5778 if (!IsPC)
5779 {
5780 if (EClass.player.stats.allyDeath == 0)
5781 {
5782 Tutorial.Reserve("death_pet");
5783 }
5785 }
5786 }
5787 if (id == "mandrake" || HasElement(488))
5788 {
5789 Say("a_scream", this);
5790 ActEffect.ProcAt(EffectId.Scream, base.LV * 3 + 200, BlessedState.Normal, this, this, pos, isNeg: true);
5791 }
5792 daysStarved = 0;
5793 isDead = true;
5795 enemy = null;
5796 _cooldowns = null;
5797 base.isSale = false;
5798 SetInt(70);
5799 EClass._map.props.sales.Remove(this);
5800 Cure(CureType.Death);
5801 SetAI(new NoGoal());
5803 if (isInActiveZone && EClass._zone.HasLaw && IsHuman && OriginalHostility >= Hostility.Neutral)
5804 {
5805 pos.TalkWitnesses(origin?.Chara, "witness", 3, WitnessType.crime, (Chara c) => !c.IsPCParty && !c.IsUnique);
5806 }
5807 if (IsPC)
5808 {
5809 EClass.player.returnInfo = null;
5810 EClass.player.uidLastTravelZone = 0;
5811 foreach (Chara chara3 in EClass._map.charas)
5812 {
5813 if (chara3.IsHostile())
5814 {
5815 chara3.hostility = chara3.OriginalHostility;
5816 }
5817 if (chara3.enemy == EClass.pc)
5818 {
5819 chara3.enemy = null;
5820 }
5821 }
5822 if (EClass.pc.things.Find("letter_will") != null && EClass.rnd(10) == 0)
5823 {
5824 EClass.player.preventDeathPenalty = true;
5825 }
5826 }
5827 else
5828 {
5829 bool flag2 = currentZone.IsActiveZone && IsLocalChara && !currentZone.IsPCFaction;
5830 if (currentZone is Zone_LittleGarden && id == "littleOne")
5831 {
5832 flag2 = false;
5833 }
5834 if (flag2)
5835 {
5836 EClass._map.deadCharas.Add(this);
5837 }
5838 currentZone.RemoveCard(this);
5839 }
5840 if ((origin != null && origin.IsPCParty) || IsPCFaction)
5841 {
5842 int a = -10;
5843 if (IsPCFaction && !IsPCParty && (origin == null || !origin.IsPCParty))
5844 {
5845 a = -5;
5846 }
5847 ModAffinity(EClass.pc, a, show: false);
5848 string text4 = id;
5849 if (!(text4 == "quru"))
5850 {
5851 if (text4 == "corgon")
5852 {
5853 EClass.game.cards.globalCharas.Find("quru")?.ModAffinity(EClass.pc, -20, show: false);
5854 }
5855 }
5856 else
5857 {
5858 EClass.game.cards.globalCharas.Find("corgon")?.ModAffinity(EClass.pc, -20, show: false);
5859 }
5860 }
5861 if (origin != null)
5862 {
5863 if (origin.IsPCParty || origin.IsPCPartyMinion)
5864 {
5865 int num = 0;
5867 {
5868 num = -20;
5869 }
5870 else if (OriginalHostility >= Hostility.Friend && IsHuman && !base.IsPCFactionOrMinion)
5871 {
5872 num = -5;
5873 }
5874 else if (race.id == "cat" && OriginalHostility >= Hostility.Neutral)
5875 {
5876 EClass.pc.Say("killcat");
5877 num = -1;
5878 }
5879 if (EClass.pc.party.HasElement(1563) && num < 0)
5880 {
5881 num = num * 30 / 100;
5882 }
5883 if (num != 0)
5884 {
5885 EClass.player.ModKarma(num);
5886 }
5887 }
5888 if (origin == EClass.pc)
5889 {
5890 EClass.pc.faith.Revelation("kill", EClass.pc, 10);
5891 }
5892 else if (origin.IsPCFaction)
5893 {
5894 origin.Chara.ModAffinity(EClass.pc, 1, show: false);
5895 origin.Chara.ShowEmo(Emo.love);
5896 }
5897 }
5898 if (base.sourceBacker != null && origin != null && origin.IsPCParty)
5899 {
5900 EClass.player.doneBackers.Add(base.sourceBacker.id);
5901 }
5902 if (base.IsPCFactionOrMinion)
5903 {
5905 {
5906 Msg.Say("abort_allyDead");
5907 }
5908 }
5910 {
5911 Msg.Say("abort_enemyDead");
5912 }
5913 if (IsPCParty && !IsPC)
5914 {
5916 base.c_wasInPcParty = true;
5917 EClass.pc.Say("allyDead");
5918 }
5919 switch (id)
5920 {
5921 case "littleOne":
5922 if (attackSource != AttackSource.Euthanasia && !IsPCFaction)
5923 {
5924 EClass.player.flags.little_killed = true;
5926 }
5927 break;
5928 case "big_daddy":
5929 case "big_daddy2":
5930 if (!IsPCFaction)
5931 {
5932 Chara chara = CharaGen.Create("littleOne");
5933 EClass._zone.AddCard(chara, pos.Copy());
5934 Msg.Say("little_pop");
5936 }
5937 break;
5938 case "shark_sister":
5939 if (!IsPCFaction)
5940 {
5941 Chara t = CharaGen.Create("sister_shark");
5942 EClass._zone.AddCard(t, pos.Copy());
5943 Msg.Say("shark_pop");
5944 }
5945 break;
5946 }
5947 if (attackSource == AttackSource.Finish && origin != null && origin.Evalue(665) > 0)
5948 {
5949 Chara chara2 = CharaGen.CreateFromFilter("c_plant", base.LV);
5950 EClass._zone.AddCard(chara2, pos.Copy());
5951 if (chara2.LV < base.LV)
5952 {
5953 chara2.SetLv(base.LV);
5954 }
5955 chara2.MakeMinion((origin.IsPCParty || origin.IsPCPartyMinion) ? EClass.pc : origin.Chara, MinionType.Friend);
5956 Msg.Say("plant_pop", this, chara2);
5957 }
5960 }
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:519
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:6443
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:7064
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:6675
virtual bool IsPCFaction
Definition: Card.cs:2339
void SpawnLoot(Card origin)
Definition: Card.cs:5353
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:2556
string NameBraced
Definition: Chara.cs:520
void ClearTempElements()
Definition: Chara.cs:11015
string TalkTopic(string topic="calm")
Definition: Chara.cs:7395
void TryDropBossLoot()
Definition: Chara.cs:5962
bool IsLocalChara
Definition: Chara.cs:888
Chara enemy
Definition: Chara.cs:86
bool IsInActiveZone
Definition: Chara.cs:885
void TryDropCarryOnly()
Definition: Chara.cs:4862
void MakeGrave(string lastword)
Definition: Chara.cs:5551
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:212
void RemoveMember(Chara c)
Definition: Party.cs:116
int allyDeath
Definition: Player.cs:108
void ModKarma(int a)
Definition: Player.cs:2636
Stats stats
Definition: Player.cs:1086
int little_dead
Definition: Player.cs:993
HashSet< int > doneBackers
Definition: Player.cs:1143
bool TryAbortAutoCombat(bool immediate=true)
Definition: Player.cs:2530
string deathMsg
Definition: Player.cs:1258
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
static Religion recentWrath
Definition: Religion.cs:29
virtual void Revelation(string idTalk, Card c, int chance=100)
Definition: Religion.cs:167
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:1198
virtual bool HasLaw
Definition: Zone.cs:236
void RemoveCard(Card t)
Definition: Zone.cs:2182
void ResetHostility()
Definition: Zone.cs:2905
ZoneInstance instance
Definition: Zone.cs:58

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

10971 {
10972 if (tempElements == null)
10973 {
10974 return;
10975 }
10976 foreach (Element item in tempElements.dict.Values.ToList())
10977 {
10978 if (item.vBase > 0)
10979 {
10980 ModTempElement(item.id, -Mathf.Min(item.vBase * 5 / 100 + 1, item.vBase), naturalDecay: true);
10981 }
10982 }
10983 }

References ElementContainer.dict, and item.

◆ Divorce()

void Chara.Divorce ( Chara  c)
inline

Definition at line 8586 of file Chara.cs.

8587 {
8588 if (base.c_love != null)
8589 {
8590 base.c_love.dateMarriage = 0;
8591 base.c_love.dateWedding = 0;
8592 SetFeat(1275, 0);
8594 }
8595 }
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 6584 of file Chara.cs.

6585 {
6586 SetAI(new DynamicAIAct("", delegate
6587 {
6588 onPerform();
6589 return true;
6590 })
6591 {
6592 wait = wait
6593 });
6594 }

◆ DoHostileAction()

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

Definition at line 6728 of file Chara.cs.

6729 {
6730 if (_tg == null || !_tg.isChara)
6731 {
6732 return;
6733 }
6734 Chara chara = _tg.Chara;
6735 if (chara.IsPC)
6736 {
6737 EClass.pc.combatCount = 10;
6738 }
6739 if (!chara.IsAliveInCurrentZone || !IsAliveInCurrentZone || chara == this)
6740 {
6741 return;
6742 }
6743 if ((IsPCFaction || IsPCFactionMinion) && (chara.IsPCFaction || chara.IsPCFactionMinion))
6744 {
6745 chara.Say("frown", this, chara);
6746 }
6747 else
6748 {
6749 if (EClass._zone.IsRegion)
6750 {
6751 return;
6752 }
6753 if (IsPC)
6754 {
6755 if (chara.IsFriendOrAbove() && !immediate)
6756 {
6757 chara.Say("frown", this, chara);
6758 chara.ShowEmo(Emo.sad);
6759 chara.hostility = Hostility.Neutral;
6760 return;
6761 }
6762 if (!chara.IsPCFaction && chara.hostility >= Hostility.Neutral && !EClass._zone.IsPCFaction)
6763 {
6764 bool flag = chara.id == "fanatic";
6765 if (EClass.rnd(4) == 0 || flag)
6766 {
6767 chara.Say("callHelp", chara);
6768 chara.CallHelp(this, flag);
6769 }
6770 }
6771 if (chara.hostility <= Hostility.Enemy)
6772 {
6773 foreach (Chara member in EClass.pc.party.members)
6774 {
6775 if (member != EClass.pc && member.enemy == null && member.CanSee(chara))
6776 {
6777 member.SetEnemy(chara);
6778 }
6779 }
6780 }
6781 }
6782 else if (chara.IsPC && hostility <= Hostility.Enemy)
6783 {
6784 foreach (Chara member2 in EClass.pc.party.members)
6785 {
6786 if (member2 != EClass.pc && member2.enemy == null && member2.CanSee(this))
6787 {
6788 member2.SetEnemy(this);
6789 }
6790 }
6791 }
6792 if (chara.calmCheckTurn <= 0 || IsPC)
6793 {
6794 chara.calmCheckTurn = (IsPC ? (20 + EClass.rnd(30)) : (10 + EClass.rnd(10)));
6795 }
6796 if (hostility != Hostility.Enemy || chara.hostility != Hostility.Enemy)
6797 {
6798 GoHostile(chara);
6799 chara.GoHostile(this);
6800 if (base.isHidden && !chara.CanSee(this) && !chara.IsDisabled && !chara.IsPCParty && !chara.IsPCPartyMinion && EClass.rnd(10 + Dist(chara) * 10) == 0)
6801 {
6802 Thing t = ThingGen.Create("49");
6803 ActThrow.Throw(chara, pos, t);
6804 Act.TC = chara;
6805 }
6806 }
6807 }
6808 }
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:7005
Chara SetEnemy(Chara c=null)
Definition: Chara.cs:6679
void CallHelp(Chara tg, bool fanatic=false)
Definition: Chara.cs:6810
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 5429 of file Chara.cs.

5430 {
5431 Say("drink", this, t.Duplicate(1));
5432 Say("quaff");
5433 PlaySound("drink");
5434 t.ModNum(-1);
5435 FoodEffect.ProcDrink(this, t.Thing);
5436 _ = IsPC;
5437 }
Thing Duplicate(int num)
Definition: Card.cs:3625
void ModNum(int a, bool notify=true)
Definition: Card.cs:3696
static void ProcDrink(Chara c, Thing food)
Definition: FoodEffect.cs:368

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

4875 {
4876 if (held == null)
4877 {
4878 return null;
4879 }
4880 if (IsPC)
4881 {
4882 WidgetHotbar.dirtyCurrentItem = true;
4884 }
4885 Card card = EClass._zone.AddCard(held, dropPos ?? pos);
4886 card.OnLand();
4887 if (card.trait.CanOnlyCarry)
4888 {
4889 card.SetPlaceState(PlaceState.installed);
4890 }
4891 return card;
4892 }
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 4894 of file Chara.cs.

4895 {
4896 if (t.c_isImportant)
4897 {
4898 Msg.Say("markedImportant");
4899 return;
4900 }
4901 if (!t.trait.CanBeDropped)
4902 {
4903 Msg.Say("cantDrop", t);
4904 return;
4905 }
4906 if (t.trait is TraitAbility)
4907 {
4908 SE.Trash();
4909 t.Destroy();
4910 return;
4911 }
4912 Msg.Say("dropItem", t.Name);
4913 t.ignoreAutoPick = true;
4914 PlaySound("drop");
4915 EClass._zone.AddCard(t, pos);
4916 if (t.trait.CanOnlyCarry)
4917 {
4918 t.Install();
4919 }
4920 }
Card Install()
Definition: Card.cs:3922
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 1955 of file Chara.cs.

1956 {
1957 Chara chara = CharaGen.Create(id);
1958 chara.mana.value = mana.value;
1959 chara.stamina.value = stamina.value;
1960 foreach (KeyValuePair<int, Element> item in elements.dict)
1961 {
1962 if (item.Key != 1275)
1963 {
1964 Element orCreateElement = chara.elements.GetOrCreateElement(item.Key);
1965 orCreateElement.vBase = item.Value.ValueWithoutLink - orCreateElement.vSource;
1966 }
1967 }
1968 chara.SetFaith(faith);
1969 chara.bio = IO.DeepCopy(bio);
1970 chara.LV = base.LV;
1971 chara.c_daysWithGod = base.c_daysWithGod;
1972 chara.RefreshFaithElement();
1973 chara.hp = (int)Mathf.Clamp((float)chara.MaxHP * ((float)base.hp / (float)MaxHP) * 0.99f, 0f, chara.MaxHP);
1974 chara.isCopy = true;
1975 chara.isScaled = base.isScaled;
1976 chara.c_altName = base.c_altName;
1977 chara._alias = _alias;
1978 if (pccData != null)
1979 {
1980 chara.pccData = IO.DeepCopy(pccData);
1981 }
1982 if (HaveFur())
1983 {
1984 chara.c_fur = -1;
1985 }
1986 return chara;
1987 }
bool HaveFur()
Definition: Card.cs:8410
Stats mana
Definition: Chara.cs:1213
void RefreshFaithElement()
Definition: Chara.cs:10850
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 10965 of file Chara.cs.

10966 {
10967 ModTempElement(ele, onlyRenew ? (p / 20) : (p / 100 + EClass.rnd(p / 100 + 1)), naturalDecay: false, onlyRenew);
10968 }

References EClass.rnd().

◆ EnhanceTempElements()

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

Definition at line 10956 of file Chara.cs.

10957 {
10958 int[] array = (body ? Element.List_Body : Element.List_Mind);
10959 foreach (int ele in array)
10960 {
10961 EnhanceTempElement(ele, p, onlyRenew);
10962 }
10963 }
void EnhanceTempElement(int ele, int p, bool onlyRenew=false)
Definition: Chara.cs:10965

References Element.List_Mind.

◆ EQ_CAT()

void Chara.EQ_CAT ( string  s)
inline

Definition at line 5406 of file Chara.cs.

5407 {
5408 int slot = EClass.sources.categories.map[s].slot;
5409 BodySlot bodySlot = ((slot == 0) ? null : body.GetSlot(slot));
5410 if ((slot == 0 || bodySlot != null) && (slot != 37 || !HasElement(1209)))
5411 {
5412 SetEQQuality();
5413 Thing thing = ThingGen.CreateFromCategory(s, base.LV);
5414 AddThing(thing);
5415 if (bodySlot != null && !body.Equip(thing, bodySlot))
5416 {
5417 thing.Destroy();
5418 }
5419 }
5420 }
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:3280
bool Equip(Thing thing, BodySlot slot=null, bool msg=true)
Definition: CharaBody.cs:213
BodySlot GetSlot(Thing t, bool onlyEmpty=false, bool secondSlot=false)
Definition: CharaBody.cs:398
void SetEQQuality()
Definition: Chara.cs:5353
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 5386 of file Chara.cs.

5387 {
5388 SetEQQuality();
5389 if (r != Rarity.Random)
5390 {
5391 CardBlueprint.current.rarity = r;
5392 }
5393 Thing thing = ThingGen.Create(s, mat, base.LV);
5394 if (body.GetSlot(thing, onlyEmpty: true) == null)
5395 {
5396 return thing;
5397 }
5398 AddThing(thing);
5399 if (!body.Equip(thing))
5400 {
5401 thing.Destroy();
5402 }
5403 return thing;
5404 }

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

5423 {
5424 SetEQQuality();
5425 Thing t = ThingGen.Create(s, -1, base.LV).SetNum(num);
5426 AddThing(t);
5427 }
Thing SetNum(int a)
Definition: Card.cs:3676

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

◆ EvalueRiding()

int Chara.EvalueRiding ( )
inline

Definition at line 6495 of file Chara.cs.

6496 {
6497 if (ride != null && ride.HasCondition<ConTransmuteBroom>() && HasElement(1417))
6498 {
6499 return 25 + Evalue(226) * 125 / 100;
6500 }
6501 return Evalue(226);
6502 }

References ride.

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

◆ FallFromZone()

void Chara.FallFromZone ( )
inline

Definition at line 3741 of file Chara.cs.

3742 {
3743 Msg.Say("skyFall", EClass.pc, EClass._zone.Name);
3744 Zone zone = (EClass._zone.isExternalZone ? null : EClass._zone.GetTopZone().FindZone(EClass._zone.lv - 1));
3745 zone = zone ?? EClass.world.region;
3747 {
3748 state = ZoneTransition.EnterState.Fall,
3749 x = pos.x,
3750 z = pos.z
3751 });
3752 }
void MoveZone(string alias)
Definition: Chara.cs:3548
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:2098

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

8280 {
8281 TraitToolRange ranged = weapon.trait as TraitToolRange;
8282 Thing thing = (IsPC ? EClass.pc.things.Find<TraitQuiver>() : null);
8283 if (thing != null)
8284 {
8285 Thing thing2 = thing.things.Find((Thing t) => ranged.IsAmmo(t));
8286 if (thing2 != null)
8287 {
8288 return thing2;
8289 }
8290 }
8291 return things.Find((Thing t) => ranged.IsAmmo(t));
8292 }
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 7774 of file Chara.cs.

7775 {
7776 foreach (Card item in EClass._map.props.installed.all)
7777 {
7778 if (item.trait is TraitBed traitBed && traitBed.IsHolder(this))
7779 {
7780 return traitBed;
7781 }
7782 }
7783 return null;
7784 }

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

8007 {
8008 Thing result = null;
8009 int num = -1;
8010 if (IsPC)
8011 {
8012 return null;
8013 }
8014 foreach (Thing item in things.List((Thing t) => CanEat(t, shouldEat: true) && !t.c_isImportant, onlyAccessible: true))
8015 {
8016 int num2 = CountNumEaten(item);
8017 int num3 = 100 - num2 + (item.HasElement(757) ? 10 : 0);
8018 if (num3 > num)
8019 {
8020 result = item;
8021 num = num3;
8022 }
8023 }
8024 return result;
8025 }
bool CanEat(Thing t, bool shouldEat=false)
Definition: Chara.cs:8052
int CountNumEaten(Thing food)
Definition: Chara.cs:10821
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 2618 of file Chara.cs.

2619 {
2620 if (IsMinion)
2621 {
2622 master = EClass._map.FindChara(base.c_uidMaster);
2623 }
2624 return master;
2625 }
Chara FindChara(string id)
Definition: Map.cs:2645

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

6895 {
6896 for (int i = 0; i < EClass._map.charas.Count; i++)
6897 {
6898 Chara chara = EClass._map.charas[i];
6899 if (chara != this && chara != enemy && (chara.mimicry == null || !chara.mimicry.IsThing) && IsHostile(chara) && Dist(chara) <= 1 && CanInteractTo(chara.pos))
6900 {
6901 DoHostileAction(chara);
6902 enemy = chara;
6903 return true;
6904 }
6905 }
6906 return false;
6907 }
void DoHostileAction(Card _tg, bool immediate=false)
Definition: Chara.cs:6728
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 6821 of file Chara.cs.

6822 {
6823 if (EClass._zone.isPeace && base.IsPCFactionOrMinion && !IsPC)
6824 {
6825 return false;
6826 }
6827 if (enemy != null && !enemy.IsAliveInCurrentZone)
6828 {
6829 enemy = null;
6830 }
6831 if (enemy != null)
6832 {
6833 return false;
6834 }
6835 if (IsPCParty && EClass.pc.isHidden && base.isHidden)
6836 {
6837 return false;
6838 }
6839 if (mimicry != null && mimicry.IsThing)
6840 {
6841 return false;
6842 }
6843 bool flag = enemy != null || ai is GoalCombat;
6844 int num = (base.PER + Evalue(210) * 2) * ((!flag) ? 1 : 2);
6845 bool flag2 = IsPCParty && !IsPC && EClass.game.config.tactics.dontWander;
6846 bool flag3 = !IsPCParty;
6847 Chara chara = null;
6848 int num2 = 9999;
6849 for (int i = 0; i < EClass._map.charas.Count; i++)
6850 {
6851 Chara chara2 = EClass._map.charas[i];
6852 if (chara2 == this || !IsHostile(chara2) || !CanSee(chara2) || (chara2.mimicry != null && chara2.mimicry.IsThing))
6853 {
6854 continue;
6855 }
6856 int num3 = Dist(chara2);
6857 int num4 = GetSightRadius() + (flag ? 1 : 0);
6858 if (num3 > num4)
6859 {
6860 continue;
6861 }
6862 if (flag3 && EClass.rnd(chara2.Evalue(152) + 5) * (100 + num3 * num3 * 10) / 100 > EClass.rnd(num))
6863 {
6864 if (this == pos.FirstChara)
6865 {
6866 chara2.ModExp(152, Mathf.Clamp((num - chara2.Evalue(152)) / 2, 1, Mathf.Max(30 - stealthSeen * 2, 1)));
6867 }
6868 stealthSeen++;
6869 }
6870 else if (CanSeeLos(chara2) && (!flag2 || EClass.pc.isBlind || EClass.pc.CanSeeLos(chara2)) && (!base.IsPCFactionOrMinion || EClass.pc.ai.ShouldAllyAttack(chara2)))
6871 {
6872 if (!IsPCParty)
6873 {
6874 DoHostileAction(chara2);
6875 enemy = chara2;
6876 return true;
6877 }
6878 if (num3 < num2)
6879 {
6880 num2 = num3;
6881 chara = chara2;
6882 }
6883 }
6884 }
6885 if (chara != null)
6886 {
6887 DoHostileAction(chara);
6888 enemy = chara;
6889 return true;
6890 }
6891 return false;
6892 }
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 8403 of file Chara.cs.

8404 {
8405 return FindBed()?.owner.pos.cell.room;
8406 }
Room room
Definition: Cell.cs:122
TraitBed FindBed()
Definition: Chara.cs:7774

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

10737 {
10738 Element orCreateElement = elements.GetOrCreateElement(ele);
10739 if (orCreateElement.ValueWithoutLink == 0)
10740 {
10741 elements.ModBase(orCreateElement.id, 1);
10742 }
10743 if (orCreateElement is Spell)
10744 {
10745 int num = EClass.curve(Evalue(307), 50, 20) + (HasElement(307) ? 20 : 0);
10746 int num2 = origin?.Evalue(765) ?? 0;
10747 num = num * (100 - num2) / 100;
10748 int a = mtp * orCreateElement.source.charge * (100 + num) / 100 / 100;
10749 a = Mathf.Max(1, EClass.rndHalf(a));
10750 if (orCreateElement.source.charge == 1)
10751 {
10752 a = 1;
10753 }
10754 orCreateElement.vPotential += a;
10755 }
10756 Say("spell_gain", this, orCreateElement.Name);
10757 LayerAbility.SetDirty(orCreateElement);
10758 }
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 7711 of file Chara.cs.

7712 {
7713 string result = "?????";
7714 if (ai != null)
7715 {
7716 result = ai.GetCurrentActionText();
7717 }
7718 return result;
7719 }
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 8338 of file Chara.cs.

8339 {
8340 if (body.GetWeight(armorOnly: true) <= (HasElement(1204) ? 6000 : 30000))
8341 {
8342 return 120;
8343 }
8344 return 122;
8345 }
int GetWeight(bool armorOnly=false)
Definition: CharaBody.cs:465

References CharaBody.GetWeight().

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

◆ GetBestRangedWeapon()

Thing Chara.GetBestRangedWeapon ( )
inline

Definition at line 8294 of file Chara.cs.

8295 {
8296 Thing result = null;
8297 int num = 0;
8298 foreach (Thing thing in things)
8299 {
8300 if (thing.IsRangedWeapon && CanEquipRanged(thing) && thing.GetEquipValue() > num)
8301 {
8302 num = thing.GetEquipValue();
8303 result = thing;
8304 }
8305 }
8306 return result;
8307 }
int GetEquipValue()
Definition: Card.cs:7673
bool IsRangedWeapon
Definition: Card.cs:2297
bool CanEquipRanged(Thing t)
Definition: Chara.cs:8228

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

◆ GetBuffStats() [1/2]

Element Chara.GetBuffStats ( int  ele)
inline

Definition at line 10027 of file Chara.cs.

10028 {
10029 for (int i = 0; i < conditions.Count; i++)
10030 {
10031 if (conditions[i] is ConBuffStats conBuffStats && conBuffStats.refVal == ele)
10032 {
10033 return conBuffStats.elements.GetElement(ele);
10034 }
10035 }
10036 return null;
10037 }

References BaseCondition.refVal.

◆ GetBuffStats() [2/2]

Element Chara.GetBuffStats ( string  alias)
inline

Definition at line 10022 of file Chara.cs.

10023 {
10024 return GetBuffStats(EClass.sources.elements.alias[alias].id);
10025 }
Element GetBuffStats(string alias)
Definition: Chara.cs:10022

References SourceManager.elements, and EClass.sources.

Referenced by GoalCombat.TryUseAbility().

◆ GetBurden()

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

Definition at line 1989 of file Chara.cs.

1990 {
1991 int num2 = (base.ChildrenWeight + ((t != null) ? ((num == -1) ? t.ChildrenAndSelfWeight : (t.SelfWeight * num)) : 0)) * 100 / WeightLimit;
1992 if (num2 < 0)
1993 {
1994 num2 = 1000;
1995 }
1997 {
1998 num2 = 0;
1999 }
2000 int num3 = ((num2 >= 100) ? ((num2 - 100) / 10 + 1) : 0);
2001 if (num3 > 9)
2002 {
2003 num3 = 9;
2004 }
2005 return num3;
2006 }

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

◆ GetCondition()

◆ GetCondition< T >()

override T Chara.GetCondition< T > ( )
inlinevirtual

Reimplemented from Card.

Definition at line 10078 of file Chara.cs.

10079 {
10080 for (int i = 0; i < conditions.Count; i++)
10081 {
10082 if (conditions[i] is T)
10083 {
10084 return conditions[i] as T;
10085 }
10086 }
10087 return null;
10088 }

◆ GetCooldown()

int Chara.GetCooldown ( int  idEle)
inline

Definition at line 9290 of file Chara.cs.

9291 {
9292 if (_cooldowns != null)
9293 {
9294 for (int i = 0; i < _cooldowns.Count; i++)
9295 {
9296 if (_cooldowns[i] / 1000 == idEle)
9297 {
9298 return _cooldowns[i] % 1000;
9299 }
9300 }
9301 }
9302 return 0;
9303 }

Referenced by NotificationCooldown.OnRefresh().

◆ GetCurrentDir()

int Chara.GetCurrentDir ( )
inline

Definition at line 3861 of file Chara.cs.

3862 {
3863 Debug.Log(angle);
3864 if (!renderer.hasActor)
3865 {
3866 if (angle == 0f || angle == 45f || angle == 90f)
3867 {
3868 return 2;
3869 }
3870 if (angle == -135f || angle == 180f || angle == -90f)
3871 {
3872 return 1;
3873 }
3874 if (angle == 135f)
3875 {
3876 return 0;
3877 }
3878 return 3;
3879 }
3880 return renderer.actor.currentDir;
3881 }
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 7686 of file Chara.cs.

7687 {
7688 return (ai.IsRunning ? ai.GetDestination() : pos).Copy();
7689 }
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 4947 of file Chara.cs.

4948 {
4949 if (elements.Value(122) > elements.Value(120))
4950 {
4951 return elements.GetElement(122);
4952 }
4953 return elements.GetElement(120);
4954 }
int Value(int ele)

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

◆ GetFavAttackStyle()

AttackStyle Chara.GetFavAttackStyle ( )
inline

Definition at line 4922 of file Chara.cs.

4923 {
4924 int num = Evalue(131);
4925 int num2 = Evalue(130);
4926 int num3 = Evalue(123);
4927 if (num > num2 && num > num3)
4928 {
4929 return AttackStyle.TwoWield;
4930 }
4931 if (num2 > num && num2 > num3)
4932 {
4933 return AttackStyle.TwoHand;
4934 }
4935 if (num3 > num && num3 > num2)
4936 {
4937 return AttackStyle.Shield;
4938 }
4939 return AttackStyle.Default;
4940 }

Referenced by WindowChara.RefreshNote().

◆ GetFavCat()

SourceCategory.Row Chara.GetFavCat ( )
inline

Definition at line 8540 of file Chara.cs.

8541 {
8542 if (ModUtil.TryGetContent<CustomBiographyContent>("Biography/" + id, out var content))
8543 {
8544 content.RefreshCharaBio(this);
8545 if (!content.favCategory.IsEmpty() && EClass.sources.categories.map.TryGetValue(content.favCategory, out var value) && value.gift > 0)
8546 {
8547 return value;
8548 }
8549 }
8550 string str = GetStr(73);
8551 if (!str.IsEmpty() && EClass.sources.categories.map[str] != null)
8552 {
8553 return EClass.sources.categories.map[str];
8554 }
8555 SourceCategory.Row r = null;
8556 if (_listFavCat.Count == 0)
8557 {
8558 foreach (SourceCategory.Row row in EClass.sources.categories.rows)
8559 {
8560 if (row.gift > 0)
8561 {
8562 _listFavCat.Add(row);
8563 }
8564 }
8565 }
8566 Rand.UseSeed(base.uid + EClass.game.seed, delegate
8567 {
8568 r = _listFavCat.RandomItem();
8569 });
8570 return r;
8571 }
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 8507 of file Chara.cs.

8508 {
8509 if (ModUtil.TryGetContent<CustomBiographyContent>("Biography/" + id, out var content))
8510 {
8511 content.RefreshCharaBio(this);
8512 if (!content.favFood.IsEmpty() && EClass.sources.things.map.TryGetValue(content.favFood, out var value))
8513 {
8514 return value;
8515 }
8516 }
8517 string str = GetStr(72);
8518 if (!str.IsEmpty() && EClass.sources.things.map.TryGetValue(str, out var value2))
8519 {
8520 return value2;
8521 }
8522 if (_listFavFood.Count == 0)
8523 {
8524 foreach (SourceThing.Row row in EClass.sources.things.rows)
8525 {
8526 if (row._origin == "dish" && row.value != 0 && row.chance != 0)
8527 {
8528 _listFavFood.Add(row);
8529 }
8530 }
8531 }
8532 SourceThing.Row r = null;
8533 Rand.UseSeed(base.uid + EClass.game.seed, delegate
8534 {
8535 r = _listFavFood.RandomItem();
8536 });
8537 return r;
8538 }
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 4942 of file Chara.cs.

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

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

9357 {
9358 if (IsPC)
9359 {
9360 return null;
9361 }
9362 switch (TimeTable.GetSpan(idTimeTable, hour))
9363 {
9364 case TimeTable.Span.Sleep:
9366 {
9367 return new GoalSleep();
9368 }
9369 break;
9370 case TimeTable.Span.Eat:
9371 return new GoalIdle();
9372 case TimeTable.Span.Work:
9373 if (IsGuest())
9374 {
9375 return new GoalIdle();
9376 }
9377 return GetGoalWork();
9378 case TimeTable.Span.Free:
9379 if (IsGuest())
9380 {
9381 return new GoalIdle();
9382 }
9383 return GetGoalHobby();
9384 }
9385 return null;
9386 }
Goal GetGoalWork()
Definition: Chara.cs:9388
Goal GetGoalHobby()
Definition: Chara.cs:9401
string idTimeTable
Definition: Chara.cs:472
static Span GetSpan(string id, int hour)
Definition: TimeTable.cs:45
bool isSimulating
Definition: Zone.cs:78

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

◆ GetGoalHobby()

Goal Chara.GetGoalHobby ( )
inline

Definition at line 9401 of file Chara.cs.

9402 {
9403 if (IsPrisoner)
9404 {
9405 return new GoalIdle();
9406 }
9407 if (memberType == FactionMemberType.Livestock)
9408 {
9409 return new GoalGraze();
9410 }
9411 return new GoalHobby();
9412 }
FactionMemberType
bool IsPrisoner
Definition: Chara.cs:1085

Referenced by Zone.Simulate().

◆ GetGoalWork()

Goal Chara.GetGoalWork ( )
inline

Definition at line 9388 of file Chara.cs.

9389 {
9390 if (IsPrisoner)
9391 {
9392 return new GoalIdle();
9393 }
9394 if (memberType == FactionMemberType.Livestock)
9395 {
9396 return new GoalGraze();
9397 }
9398 return new GoalWork();
9399 }

Referenced by Zone.Simulate().

◆ GetHappiness()

int Chara.GetHappiness ( )
inline

Definition at line 7696 of file Chara.cs.

7697 {
7698 int num = 50;
7699 if (FindBed() != null)
7700 {
7701 num += 50;
7702 }
7703 return num;
7704 }

◆ GetHireCost()

int Chara.GetHireCost ( )
inline

Definition at line 7691 of file Chara.cs.

7692 {
7693 return base.LV / 2 + 4;
7694 }

Referenced by CalcGold.Hire().

◆ GetHoverText()

override string Chara.GetHoverText ( )
inlinevirtual

Reimplemented from Card.

Definition at line 7185 of file Chara.cs.

7186 {
7187 if (mimicry != null && mimicry.IsThing)
7188 {
7189 return mimicry.GetHoverText();
7190 }
7191 string text = ((mimicry != null && mimicry.Card != this) ? mimicry.GetName(NameStyle.Full) : base.Name);
7192 if (IsFriendOrAbove())
7193 {
7194 text = text.TagColor(EClass.Colors.colorFriend);
7195 }
7196 else if (IsHostile())
7197 {
7198 text = text.TagColor(EClass.Colors.colorHostile);
7199 }
7200 int num = 2;
7201 int lV = EClass.pc.LV;
7202 if (base.LV >= lV * 5)
7203 {
7204 num = 0;
7205 }
7206 else if (base.LV >= lV * 2)
7207 {
7208 num = 1;
7209 }
7210 else if (base.LV <= lV / 4)
7211 {
7212 num = 4;
7213 }
7214 else if (base.LV <= lV / 2)
7215 {
7216 num = 3;
7217 }
7218 string text2 = Lang.GetList("lvComparison")[num];
7219 text2 = (" (" + text2 + ") ").TagSize(14).TagColor(EClass.Colors.gradientLVComparison.Evaluate(0.25f * (float)num));
7220 string s = (IsFriendOrAbove() ? "HostilityAlly" : (IsNeutral() ? "HostilityNeutral" : "HostilityEnemy"));
7221 s = (" (" + s.lang() + ") ").TagSize(14);
7222 s = "";
7223 if (memberType == FactionMemberType.Guest)
7224 {
7225 s += (" (" + "guest".lang() + ") ").TagSize(14);
7226 }
7227 else if (memberType == FactionMemberType.Livestock)
7228 {
7229 s += (" (" + "livestock".lang() + ") ").TagSize(14);
7230 }
7231 if (!EClass.pc.IsMoving)
7232 {
7233 if (EClass.pc.HasHigherGround(this))
7234 {
7235 text2 += "lowerGround".lang();
7236 }
7237 else if (HasHigherGround(EClass.pc))
7238 {
7239 text2 += "higherGround".lang();
7240 }
7241 }
7242 if (Evalue(1232) > 0)
7243 {
7244 text2 = "milkBaby".lang().TagSize(14) + text2;
7245 }
7246 if (Guild.Fighter.ShowBounty(this) && Guild.Fighter.HasBounty(this))
7247 {
7248 text2 = "hasBounty".lang().TagSize(14) + text2;
7249 }
7250 if (EClass.pc.HasElement(481))
7251 {
7252 text2 += ("(" + faith.Name + ")").TagSize(14);
7253 }
7254 if (EClass.pc.HasElement(6607))
7255 {
7256 s += CraftUtil.GetBloodText(this).TagSize(14).TagColor(EClass.Colors.colorBlood);
7257 }
7258 return text + text2 + s;
7259 }
bool HasHigherGround(Card c)
Definition: Chara.cs:1249
override bool IsMoving
Definition: Chara.cs:626
bool IsNeutral()
Definition: Chara.cs:6956
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 7261 of file Chara.cs.

7262 {
7263 if (mimicry != null && mimicry.IsThing)
7264 {
7265 return mimicry.GetHoverText2();
7266 }
7267 string text = "";
7268 if (knowFav)
7269 {
7270 text += Environment.NewLine;
7271 text = text + "<size=14>" + "favgift".lang(GetFavCat().GetName().ToLower(), GetFavFood().GetName()) + "</size>";
7272 }
7273 string text2 = "";
7275 {
7276 text2 += Environment.NewLine;
7277 text2 = text2 + "Lv:" + base.LV + " HP:" + base.hp + "/" + MaxHP + " MP:" + mana.value + "/" + mana.max + " DV:" + DV + " PV:" + PV + " Hunger:" + hunger.value;
7278 text2 += Environment.NewLine;
7279 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");
7280 text2 += Environment.NewLine;
7281 text2 = text2 + base.uid + IsMinion + "/" + base.c_uidMaster + "/" + master;
7282 text2 = text2 + " dir:" + base.dir + " skin:" + base.idSkin + " scaled:" + base.isScaled;
7283 }
7285 {
7286 text2 += Environment.NewLine;
7287 text2 += "<size=14>";
7288 foreach (Hobby item in ListWorks())
7289 {
7290 text2 = text2 + item.Name + ", ";
7291 }
7292 foreach (Hobby item2 in ListHobbies())
7293 {
7294 text2 = text2 + item2.Name + ", ";
7295 }
7296 text2 = text2.TrimEnd(", ".ToCharArray()) + "</size>";
7297 }
7298 string text3 = "";
7299 IEnumerable<BaseStats> enumerable = conditions.Concat((!IsPCFaction) ? new BaseStats[0] : new BaseStats[2] { hunger, stamina });
7300 if (enumerable.Count() > 0)
7301 {
7302 text3 += Environment.NewLine;
7303 text3 += "<size=14>";
7304 int num = 0;
7305 foreach (BaseStats item3 in enumerable)
7306 {
7307 if (item3 is ConBaseTransmuteMimic)
7308 {
7309 continue;
7310 }
7311 string text4 = item3.GetPhaseStr();
7312 if (text4.IsEmpty() || text4 == "#")
7313 {
7314 continue;
7315 }
7316 Color c = Color.white;
7317 switch (item3.source.group)
7318 {
7319 case "Bad":
7320 case "Debuff":
7321 case "Disease":
7323 break;
7324 case "Buff":
7326 break;
7327 }
7329 {
7330 text4 = text4 + "(" + item3.GetValue() + ")";
7331 if (resistCon != null && resistCon.ContainsKey(item3.id))
7332 {
7333 text4 = text4 + "{" + resistCon[item3.id] + "}";
7334 }
7335 }
7336 num++;
7337 text3 = text3 + text4.TagColor(c) + ", ";
7338 }
7339 if (num == 0)
7340 {
7341 text3 = "";
7342 }
7343 else
7344 {
7345 text = "";
7346 text3 = text3.TrimEnd(", ".ToCharArray()) + "</size>";
7347 }
7348 }
7350 {
7351 text3 += Environment.NewLine;
7352 foreach (ActList.Item item4 in ability.list.items)
7353 {
7354 text3 = text3 + item4.act.Name + ", ";
7355 }
7356 text3 = text3.TrimEnd(", ".ToCharArray());
7357 }
7358 return text + text2 + text3;
7359 }
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:8540
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:9544
override int PV
Definition: Chara.cs:776
SourceThing.Row GetFavFood()
Definition: Chara.cs:8507
List< Hobby > ListWorks(bool useMemberType=true)
Definition: Chara.cs:9517
Color colorDebuff
virtual string GetHoverText2()
bool showExtra
Definition: CoreDebug.cs:184
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 8659 of file Chara.cs.

8660 {
8661 string str = GetStr("portrait_override");
8662 if (!str.IsEmpty() && Portrait.allIds.Contains(str + ".png"))
8663 {
8664 return str;
8665 }
8666 if (id == "olderyoungersister")
8667 {
8668 if (base.idSkin != 2)
8669 {
8670 return "UN_olderyoungersister";
8671 }
8672 return "UN_olderyoungersister_alt";
8673 }
8674 if (Portrait.allIds.Contains("UN_" + id + ".png"))
8675 {
8676 return "UN_" + id;
8677 }
8678 return base.c_idPortrait;
8679 }
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 8645 of file Chara.cs.

8646 {
8647 string text = race.id;
8648 if ((text == "mifu" || text == "nefu") && EClass.rnd(2) == 0)
8649 {
8650 return "foxfolk";
8651 }
8652 if (trait is TraitGuard)
8653 {
8654 return "guard";
8655 }
8656 return "";
8657 }

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

7463 {
7464 return GetSprite();
7465 }
override Sprite GetSprite(int dir=0)
Definition: Chara.cs:7076

◆ 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() || !(Aka != text)) ? 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:7776
string Aka
Definition: Chara.cs:220
BackerContentConfig backer
Definition: CoreConfig.cs:631
virtual string Name
Definition: Religion.cs:37
SourceBacker backers
SourceChara charas
virtual void SetName(ref string s)
Definition: Trait.cs:735

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

8598 {
8599 using (List<Chara>.Enumerator enumerator = pos.ListCharasInRadius(this, 3, (Chara c) => c != this && c.race.id == "cat").GetEnumerator())
8600 {
8601 if (enumerator.MoveNext())
8602 {
8603 return enumerator.Current;
8604 }
8605 }
8606 return null;
8607 }
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 10841 of file Chara.cs.

10842 {
10843 if (base._IsPC)
10844 {
10845 return 10 + (int)(Mathf.Sqrt(base.c_daysWithGod) * 2f + (float)Evalue(85)) / 2;
10846 }
10847 return 10 + (int)(Mathf.Sqrt(base.LV) * 5f + (float)Evalue(306)) / 2;
10848 }

◆ GetRandomRangedWeapon()

Thing Chara.GetRandomRangedWeapon ( )
inline

Definition at line 8309 of file Chara.cs.

8310 {
8311 return things.List((Thing t) => t.IsRangedWeapon && CanEquipRanged(t)).RandomItem();
8312 }

References Card.IsRangedWeapon.

◆ GetRevived()

void Chara.GetRevived ( )
inline

Definition at line 5444 of file Chara.cs.

5445 {
5446 Revive(EClass.pc.pos.GetNearestPoint(allowBlock: false, allowChara: false), msg: true);
5447 if (!IsPCFaction)
5448 {
5449 return;
5450 }
5452 {
5453 if (homeZone != null && EClass._zone != homeZone)
5454 {
5455 Msg.Say("returnHome", this, homeZone.Name);
5457 }
5458 }
5459 else if ((!EClass._zone.IsPCFaction || homeBranch != EClass.Branch || base.c_wasInPcParty) && EClass._zone.events.GetEvent<ZoneEventWedding>() == null)
5460 {
5461 EClass.pc.party.AddMemeber(this, showMsg: true);
5462 }
5463 }
static FactionBranch Branch
Definition: EClass.cs:23
void AddMemeber(Chara c, bool showMsg=false)
Definition: Party.cs:71
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, Zone.events, 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 9495 of file Chara.cs.

9496 {
9497 BaseArea result = null;
9498 foreach (Hobby item in ListWorks())
9499 {
9500 AIWork aI = item.GetAI(this);
9501 if (aI.SetDestination())
9502 {
9503 if (aI.destArea != null)
9504 {
9505 result = aI.destArea;
9506 }
9507 else if (aI.destThing != null)
9508 {
9509 result = aI.destThing.pos.cell.room;
9510 }
9511 break;
9512 }
9513 }
9514 return result;
9515 }
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 7076 of file Chara.cs.

7077 {
7078 string str = GetStr("sprite_override");
7079 if (!str.IsEmpty())
7080 {
7081 Sprite sprite = ModUtil.LoadSprite(str);
7082 if ((bool)sprite)
7083 {
7084 return sprite;
7085 }
7086 }
7087 if (IsPCC)
7088 {
7089 PCC pCC = PCC.Get(pccData);
7090 pCC.Build();
7091 return pCC.variation.idle[0, 0];
7092 }
7093 bool snow = EClass.core.IsGameStarted && EClass._zone.IsSnowCovered;
7094 int skin = 0;
7095 if (spriteReplacer?.data != null)
7096 {
7097 Sprite sprite2 = spriteReplacer.GetSprite(dir, skin, snow);
7098 if ((bool)sprite2)
7099 {
7100 return sprite2;
7101 }
7102 }
7103 if (sourceCard.tiles.Length > 1)
7104 {
7105 skin = ((base.idSkin == 0 && !source.staticSkin) ? (base.uid % sourceCard.tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)) : base.idSkin);
7106 }
7107 return sourceCard.GetSprite(dir, skin, snow);
7108 }
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(), CharaActor.ReloadSprite(), Portrait.SetChara(), Person.SetImage(), and ItemPopulation.SetTopic().

◆ GetSubPassData()

override SubPassData Chara.GetSubPassData ( )
inlinevirtual

Reimplemented from Card.

Definition at line 7119 of file Chara.cs.

7120 {
7121 if (IsPCC)
7122 {
7124 {
7126 }
7127 }
7128 else if (conSleep != null && host == null && pos.Equals(EClass.pc.pos) && IsHuman && (GetBool(123) || affinity.CanSleepBeside()))
7129 {
7130 return EClass.setting.pass.subDead;
7131 }
7132 return SubPassData.Default;
7133 }
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:348
bool altHeldPos
Definition: Player.cs:1226
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 7706 of file Chara.cs.

7707 {
7708 return GetHappiness().ToString() ?? "";
7709 }
int GetHappiness()
Definition: Chara.cs:7696

◆ GetTextHobby()

string Chara.GetTextHobby ( bool  simple = false)
inline

Definition at line 9633 of file Chara.cs.

9634 {
9635 string text = (simple ? "" : ("hobby".lang() + ":"));
9636 foreach (Hobby item in ListHobbies())
9637 {
9638 text = text + " " + item.Name.TagColor((item.GetEfficiency(this) > 0) ? FontColor.Good : FontColor.Warning) + ",";
9639 }
9640 return text.TrimEnd(',');
9641 }

References item.

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

◆ GetTextWork()

string Chara.GetTextWork ( bool  simple = false)
inline

Definition at line 9643 of file Chara.cs.

9644 {
9645 string text = (simple ? "" : ("work".lang() + ":"));
9646 foreach (Hobby item in ListWorks())
9647 {
9648 text = text + " " + item.Name.TagColor((item.GetEfficiency(this) > 0) ? FontColor.Good : FontColor.Warning) + ",";
9649 }
9650 return text.TrimEnd(',');
9651 }

References item.

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

◆ GetTopicText()

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

Definition at line 7361 of file Chara.cs.

7362 {
7363 ConTransmuteHuman condition = GetCondition<ConTransmuteHuman>();
7364 string key = ((condition == null) ? source : condition.chara.source).idText.IsEmpty((condition == null) ? id : condition.chara.id);
7365 if (id == "littleOne" && EClass._zone is Zone_LittleGarden)
7366 {
7367 key = "littleOne2";
7368 }
7369 SourceCharaText.Row row = EClass.sources.charaText.map.TryGetValue(key);
7370 if (row == null)
7371 {
7372 return null;
7373 }
7374 string text = row.GetText(topic, returnNull: true);
7375 if (text.IsEmpty())
7376 {
7377 return null;
7378 }
7379 if (text.StartsWith("@"))
7380 {
7381 row = EClass.sources.charaText.map.TryGetValue(text.Replace("@", ""));
7382 if (row == null)
7383 {
7384 return null;
7385 }
7386 text = row.GetText(topic, returnNull: true);
7387 if (text.IsEmpty())
7388 {
7389 return null;
7390 }
7391 }
7392 return text.Split(Environment.NewLine.ToCharArray()).RandomItem();
7393 }
SourceCharaText charaText

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

◆ GetTotalFeat()

int Chara.GetTotalFeat ( )
inline

Definition at line 8619 of file Chara.cs.

8620 {
8621 int num = 0;
8622 if (base.c_upgrades != null)
8623 {
8624 num += base.c_upgrades.spent;
8625 }
8626 if (base.c_genes != null)
8627 {
8628 num += base.c_genes.GetTotalCost();
8629 }
8630 return num + base.feat;
8631 }

◆ GetWork()

Hobby Chara.GetWork ( string  id)
inline

Definition at line 9564 of file Chara.cs.

9565 {
9566 foreach (Hobby item in ListWorks())
9567 {
9568 if (item.source.alias == id)
9569 {
9570 return item;
9571 }
9572 }
9573 foreach (Hobby item2 in ListHobbies())
9574 {
9575 if (item2.source.alias == id)
9576 {
9577 return item2;
9578 }
9579 }
9580 return null;
9581 }
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 9726 of file Chara.cs.

9727 {
9728 if (_workSummary == null)
9729 {
9730 _workSummary = new WorkSummary();
9731 }
9732 return _workSummary;
9733 }
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 8772 of file Chara.cs.

8773 {
8774 if (c.IsHostile() || c.IsDeadOrSleeping)
8775 {
8776 Msg.Say("affinityNone", c, this);
8777 return;
8778 }
8779 if (!t.isCopy && t.IsCursed && t.IsEquipmentOrRanged && !t.IsAmmo && c.HasElement(1414))
8780 {
8781 bool num = t.blessedState == BlessedState.Doomed;
8782 int num2 = 200 + t.LV * 3;
8783 if (t.rarity == Rarity.Legendary)
8784 {
8785 num2 *= 3;
8786 }
8787 if (t.rarity >= Rarity.Mythical)
8788 {
8789 num2 *= 5;
8790 }
8791 if (num)
8792 {
8793 num2 *= 2;
8794 }
8795 PlayEffect("identify");
8796 PlaySound("identify");
8797 c.PlayEffect("mutation");
8798 c.Say("draw_curse", c, t);
8799 t.Destroy();
8800 List<Element> list = new List<Element>();
8801 foreach (Element value in elements.dict.Values)
8802 {
8803 if (value is Spell)
8804 {
8805 list.Add(value);
8806 }
8807 }
8808 if (list.Count == 0)
8809 {
8811 return;
8812 }
8813 Element element = list.RandomItem();
8814 ModExp(element.id, num2);
8815 Say("draw_curse2", this, element.Name);
8816 c.AddExp(Mathf.Min(num2 / 3, c.ExpToNext));
8817 return;
8818 }
8819 if ((t.id == "lovepotion" || t.id == "dreambug") && !Application.isEditor)
8820 {
8821 GiveLovePotion(c, t);
8822 return;
8823 }
8824 if (t.trait is TraitErohon && c.id == t.c_idRefName)
8825 {
8826 c.OnGiveErohon(t);
8827 return;
8828 }
8829 if (t.trait is TraitTicketMassage)
8830 {
8831 t.ModNum(-1);
8832 c.Talk("ticket");
8833 switch (t.id)
8834 {
8835 case "ticket_massage":
8836 c.ModAffinity(EClass.pc, 10);
8838 {
8839 target = c
8840 });
8841 break;
8842 case "ticket_armpillow":
8843 c.ModAffinity(EClass.pc, 20);
8844 EClass.pc.AddCondition<ConSleep>(300, force: true);
8845 c.SetAI(new AI_ArmPillow
8846 {
8847 target = EClass.pc
8848 });
8849 break;
8850 case "ticket_champagne":
8851 c.ModAffinity(EClass.pc, 10);
8853 break;
8854 }
8855 return;
8856 }
8857 if (t.id == "flyer")
8858 {
8859 stamina.Mod(-1);
8860 if (c.things.Find((Thing a) => a.id == "flyer") != null)
8861 {
8862 c.Talk("flyer_miss");
8863 DoHostileAction(c);
8864 return;
8865 }
8866 if (EClass.rnd(20) != 0 && c.CHA > EClass.rnd(base.CHA + Evalue(291) * 3 + 10))
8867 {
8868 Msg.Say("affinityNone", c, this);
8869 t.Destroy();
8870 elements.ModExp(291, 10f);
8871 return;
8872 }
8873 elements.ModExp(291, 50f);
8874 }
8875 if (t.id == "statue_weird")
8876 {
8877 EClass.pc.Say("statue_sell");
8878 }
8879 t.isGifted = true;
8880 c.nextUse = c.affinity.OnGift(t);
8881 if (!t.isDestroyed)
8882 {
8883 EClass.game.quests.list.ForeachReverse(delegate(Quest q)
8884 {
8885 q.OnGiveItem(c, t);
8886 });
8887 if (c.TryEquip(t))
8888 {
8889 c.nextUse = null;
8890 }
8891 }
8892 if (c.IsPCParty)
8893 {
8895 }
8896 }
Thing OnGift(Thing t)
Definition: Affinity.cs:140
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:7314
string c_idRefName
Definition: Card.cs:1681
void TryClearInventory()
Definition: Chara.cs:9062
void GiveLovePotion(Chara c, Thing t)
Definition: Chara.cs:8909
bool TryEquip(Thing t, bool useFav=false)
Definition: Chara.cs:8189
void OnGiveErohon(Thing t)
Definition: Chara.cs:8898
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(), 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.ModNum(), Element.Name, Affinity.OnGift(), OnGiveErohon(), Quest.OnGiveItem(), EClass.pc, Card.PlayEffect(), Game.quests, Card.rarity, EClass.rnd(), Msg.Say(), Card.Say(), 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 8909 of file Chara.cs.

8910 {
8911 c.Say("give_love", c, t);
8912 c.PlaySound(t.material.GetSoundDead());
8913 c.ShowEmo(Emo.angry);
8914 c.ModAffinity(EClass.pc, -20, show: false);
8915 c.Talk("pervert");
8916 t.Destroy();
8917 }

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

6705 {
6706 if (enemy == null && !IsPC)
6707 {
6708 if (GetInt(106) == 0)
6709 {
6710 TalkTopic("aggro");
6711 }
6712 if (OriginalHostility != Hostility.Enemy)
6713 {
6714 ShowEmo(Emo.angry);
6715 }
6716 SetEnemy(_tg.Chara);
6717 }
6719 {
6720 if (hostility >= Hostility.Neutral)
6721 {
6722 Say("angry", this);
6723 }
6724 hostility = Hostility.Enemy;
6725 }
6726 }
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

Definition at line 10010 of file Chara.cs.

10011 {
10012 for (int i = 0; i < conditions.Count; i++)
10013 {
10014 if (conditions[i].source.alias == alias)
10015 {
10016 return true;
10017 }
10018 }
10019 return false;
10020 }

Referenced by _Move(), AM_Adv._OnUpdateInput(), TraitGodStatue._OnUse(), ActPlan._Update(), Element._WriteNote(), ActMelee.Attack(), DramaCustomSequence.Build(), GoalCombat.BuildAbilityList(), AttackProcess.CalcHit(), Point.CallGuard(), ListPeopleParty.CanJoinParty(), ActNTR.CanPerform(), ActRanged.CanPerform(), ActRush.CanPerform(), ActEffect.DamageEle(), Religion.DoPunish(), ZonePreEnterEncounter.Execute(), TraitItemProc.GetHealAction(), AttackProcess.GetRawDamage(), AM_Adv.IsEntangled(), Point.ListWitnesses(), ModAffinity(), FactionBranch.OnAfterSimulate(), TraitDrink.OnDrink(), Zone_Field.OnGenerateMap(), TraitScrollStatic.OnRead(), ConSleep.OnRemoved(), TraitAmmo.OnUse(), Zone_Yowyn.OnVisitNewMapOrRegenerate(), ActRanged.Perform(), ActWater.Perform(), AttackProcess.Perform(), AttackProcess.Prepare(), FoodEffect.Proc(), AttackProcess.ProcAbility(), ActEffect.ProcAt(), FoodEffect.ProcNutrition(), Zone.RefreshDeathSentense(), RequestProtection(), ActRide.Ride(), AI_ArmPillow.Run(), AI_Fuck.Run(), AI_Idle.Run(), GoalCombat.Run(), Card.Teleport(), BaseSong< T >.Tick(), Tick(), ConDeathSentense.Tick(), ConMiasma.Tick(), ConSleep.Tick(), UI.ToggleFeedback(), ConStrife.TryApplyParty(), GoalCombat.TryMove(), ActPray.TryPray(), TraitBaseSpellbook.TryProgress(), Zone.TrySpawnFollower(), GoalCombat.TryUseAbility(), and ActSlime.ValidatePerform().

◆ HasCondition< T >()

override bool Chara.HasCondition< T > ( )
inlinevirtual

Reimplemented from Card.

Definition at line 9998 of file Chara.cs.

9999 {
10000 for (int i = 0; i < conditions.Count; i++)
10001 {
10002 if (conditions[i] is T)
10003 {
10004 return true;
10005 }
10006 }
10007 return false;
10008 }

◆ HasCooldown()

bool Chara.HasCooldown ( int  idEle)
inline

Definition at line 9285 of file Chara.cs.

9286 {
9287 return GetCooldown(idEle) != 0;
9288 }
int GetCooldown(int idEle)
Definition: Chara.cs:9290

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

9415 {
9416 int num = EClass.sources.hobbies.alias.TryGetValue(alias)?.id ?? 0;
9417 listHobby.Clear();
9418 if (_works == null || _hobbies == null)
9419 {
9420 RerollHobby();
9421 }
9422 foreach (int work in _works)
9423 {
9424 if (work == num)
9425 {
9426 return true;
9427 }
9428 }
9429 foreach (int hobby in _hobbies)
9430 {
9431 if (hobby == num)
9432 {
9433 return true;
9434 }
9435 }
9436 return false;
9437 }
static List< Hobby > listHobby
Definition: Chara.cs:13
void RerollHobby(bool extraSlotChance=true)
Definition: Chara.cs:9677
SourceHobby hobbies

References SourceManager.hobbies, and EClass.sources.

Referenced by AI_Idle.Run().

◆ HasMinion()

bool Chara.HasMinion ( string  id)
inline

Definition at line 2600 of file Chara.cs.

2601 {
2602 foreach (Chara chara in EClass._map.charas)
2603 {
2604 if (chara.c_uidMaster == base.uid)
2605 {
2606 return true;
2607 }
2608 }
2609 return false;
2610 }

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

4742 {
4743 if (held == t || t.isDestroyed || t.Num <= 0)
4744 {
4745 return;
4746 }
4747 if (IsPC && t.isNPCProperty)
4748 {
4749 t.isNPCProperty = false;
4750 if (!t.GetBool(128))
4751 {
4753 pos.TryWitnessCrime(this);
4754 }
4755 }
4756 PickHeld();
4757 if (t.isChara)
4758 {
4760 {
4761 t.ShowEmo(Emo.love);
4762 }
4763 EClass.player.altHeldPos = t.renderer.data.ForceAltHeldPosition || EClass.rnd(2) == 0;
4764 }
4765 else
4766 {
4767 if (num == -1 || num > t.Num)
4768 {
4769 num = t.Num;
4770 }
4771 if (num < t.Num)
4772 {
4773 t = t.Split(num);
4774 }
4775 }
4776 if (t.GetRootCard() != this)
4777 {
4778 t = Pick(t.Thing, msg: false, tryStack: false);
4779 if (t.GetRootCard() != this)
4780 {
4781 return;
4782 }
4783 }
4784 held = t;
4786 if (held.GetLightRadius() > 0)
4787 {
4789 }
4790 if (IsPC)
4791 {
4793 WidgetHotbar.dirtyCurrentItem = true;
4794 }
4795 }
Thing Split(int a)
Definition: Card.cs:3665
bool isNPCProperty
Definition: Card.cs:557
virtual CardRenderer _CreateRenderer()
Definition: Card.cs:6436
void RecalculateFOV()
Definition: Card.cs:6857
virtual bool IsAliveInCurrentZone
Definition: Card.cs:2179
int GetLightRadius()
Definition: Card.cs:6904
void PickHeld(bool msg=false)
Definition: Chara.cs:4797
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 9810 of file Chara.cs.

9811 {
9812 if (!onDeserialize)
9813 {
9814 _cints[10] = 20;
9815 _cints[11] = 70;
9816 _cints[13] = 70;
9817 _cints[14] = 70;
9818 _cints[15] = 70;
9819 _cints[17] = 0;
9820 _cints[18] = 0;
9821 }
9822 foreach (Condition condition in conditions)
9823 {
9824 condition.SetOwner(this, onDeserialize);
9825 }
9826 }
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 8027 of file Chara.cs.

8028 {
8029 if (t == null)
8030 {
8031 t = FindBestFoodToEat();
8032 }
8033 if (t == null)
8034 {
8035 t = things.Find((Thing a) => CanEat(a, shouldEat: true) && !a.c_isImportant);
8036 }
8037 if (t == null)
8038 {
8039 t = things.Find((Thing a) => CanEat(a) && !a.c_isImportant);
8040 }
8041 if (t != null)
8042 {
8043 Say("eat_start", this, t.Duplicate(1));
8044 if (sound)
8045 {
8046 PlaySound("eat");
8047 }
8048 FoodEffect.Proc(this, t);
8049 }
8050 }
Thing FindBestFoodToEat()
Definition: Chara.cs:8006
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 6966 of file Chara.cs.

6967 {
6968 if (faction == EClass.Home)
6969 {
6970 return homeZone == EClass.game.activeZone;
6971 }
6972 return false;
6973 }
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 2727 of file Chara.cs.

2728 {
2729 if (!currentZone.IsRegion && p.IsValid)
2730 {
2731 CellDetail detail = p.detail;
2732 if (detail != null && detail.charas.Count > 0)
2733 {
2734 foreach (Chara chara in p.detail.charas)
2735 {
2736 if (chara.mimicry == null && (chara.IsHostile(this) || chara.IsHostile() || !chara.trait.CanBePushed))
2737 {
2738 if (cancelAI && EClass.pc.ai is GoalManualMove)
2739 {
2740 EClass.pc.ai.Cancel();
2741 }
2742 return true;
2743 }
2744 }
2745 }
2746 }
2747 return false;
2748 }
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 2627 of file Chara.cs.

2628 {
2629 if (!IsPCPartyMinion)
2630 {
2631 return false;
2632 }
2633 foreach (Quest item in EClass.game.quests.list)
2634 {
2635 if (item is QuestEscort questEscort && questEscort.uidChara == base.uid)
2636 {
2637 return true;
2638 }
2639 }
2640 return false;
2641 }
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 7010 of file Chara.cs.

7011 {
7012 if (base.IsPCFactionOrMinion || IsFriendOrAbove())
7013 {
7015 {
7016 return true;
7017 }
7018 }
7019 else if (IsHostile() && c.IsHostile())
7020 {
7021 return true;
7022 }
7023 return false;
7024 }

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

◆ IsFusable()

bool Chara.IsFusable ( Chara  c)
inline

Definition at line 1867 of file Chara.cs.

1868 {
1869 if (c == this)
1870 {
1871 return false;
1872 }
1873 if (c.id != id)
1874 {
1875 return false;
1876 }
1877 if (c.IsPCFactionOrMinion || base.IsPCFactionOrMinion)
1878 {
1879 return false;
1880 }
1881 if (c.c_bossType != BossType.none || base.c_bossType != BossType.none)
1882 {
1883 return false;
1884 }
1886 {
1887 return false;
1888 }
1889 return true;
1890 }
BossType c_bossType
Definition: Card.cs:1261
bool enable
Definition: CoreDebug.cs:302

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

6915 {
6916 if (c == null)
6917 {
6918 return false;
6919 }
6920 if (base.IsPCFactionOrMinion)
6921 {
6922 if ((c == EClass.pc.enemy && !c.IsPCFactionOrMinion) || c.hostility <= Hostility.Enemy)
6923 {
6924 return true;
6925 }
6926 }
6927 else
6928 {
6930 {
6931 return true;
6932 }
6933 if (OriginalHostility >= Hostility.Friend)
6934 {
6935 if (hostility <= Hostility.Enemy && c.IsPCFactionOrMinion)
6936 {
6937 return true;
6938 }
6939 if (c.hostility <= Hostility.Enemy && c.OriginalHostility == Hostility.Enemy)
6940 {
6941 return true;
6942 }
6943 }
6944 else if (OriginalHostility <= Hostility.Enemy && (c.IsPCFactionOrMinion || (c.OriginalHostility != Hostility.Enemy && c.hostility >= Hostility.Friend)))
6945 {
6946 return true;
6947 }
6948 }
6949 if (id == "unicorn" && (Evalue(418) < 0 || (c.HasElement(1216) && c.Evalue(418) < 1)))
6950 {
6951 return true;
6952 }
6953 return false;
6954 }
bool IsCriminal
Definition: Player.cs:1412

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

6981 {
6982 return EClass.game.activeZone == currentZone;
6983 }

Referenced by BaseListPeople.IsDisabled().

◆ IsInSpot< T >()

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

Definition at line 6985 of file Chara.cs.

6985 : TraitSpot
6986 {
6987 foreach (T item in EClass._map.props.installed.traits.List<T>())
6988 {
6989 foreach (Point item2 in item.ListPoints())
6990 {
6991 if (pos.Equals(item2))
6992 {
6993 return true;
6994 }
6995 }
6996 }
6997 return false;
6998 }
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 6956 of file Chara.cs.

6957 {
6958 return hostility == Hostility.Neutral;
6959 }

Referenced by ActPlan._Update().

◆ IsNeutralOrAbove()

bool Chara.IsNeutralOrAbove ( )
inline

◆ IsValidGiftWeight()

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

Definition at line 8712 of file Chara.cs.

8713 {
8714 int num2 = ((!HasElement(1411)) ? 1 : 3);
8715 if (GetBurden(t, num) >= num2)
8716 {
8717 return false;
8718 }
8719 return true;
8720 }
int GetBurden(Card t=null, int num=-1)
Definition: Chara.cs:1989

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

◆ Kiss()

void Chara.Kiss ( Chara  c)
inline

Definition at line 6635 of file Chara.cs.

6636 {
6637 EClass.player.forceTalk = true;
6638 Talk("kiss", null, null, IsPC);
6639 PlaySound("kiss");
6640 renderer.PlayAnime(AnimeID.Kiss, c);
6641 int num = 2 + EClass.rnd(4) + ((!c.IsPC && c.affinity.CurrentStage < Affinity.Stage.Fond) ? (-EClass.rnd(10)) : 0);
6642 c.ShowEmo((num > 0) ? Emo.love : Emo.sad);
6643 if (num > 0 && EClass.rnd(IsPC ? 100 : 5000) == 0)
6644 {
6645 c.MakeEgg();
6646 }
6647 if (IsPC && this != c)
6648 {
6649 if (c.interest > 0)
6650 {
6651 c.ModAffinity(EClass.pc, num);
6652 c.interest -= 20 + EClass.rnd(10);
6653 }
6654 else
6655 {
6656 c.Say("affinityNone", c, EClass.pc);
6657 }
6658 }
6659 Effect.Get("love")._Play(pos, isSynced ? renderer.position : pos.Position(), 0f, c.pos);
6660 }
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,
bool  purchaseFeat = false 
)
inline

Definition at line 10498 of file Chara.cs.

10499 {
10500 List<Element> list = new List<Element>();
10501 foreach (SourceElement.Row item in EClass.sources.elements.rows.Where((SourceElement.Row a) => a.group == "FEAT" && a.cost[0] != -1 && !a.categorySub.IsEmpty()))
10502 {
10504 int num = ((feat.ValueWithoutLink <= 0) ? 1 : (feat.ValueWithoutLink + 1));
10505 if (purchaseFeat)
10506 {
10507 num -= feat.GetDNABonus(this);
10508 }
10509 if (num <= feat.source.max && !feat.HasTag("class") && !feat.HasTag("hidden") && !feat.HasTag("innate") && (!pet || !feat.HasTag("noPet")) && (showAll || feat.IsPurchaseFeatReqMet(elements)))
10510 {
10511 list.Add(Element.Create(feat.id, num) as Feat);
10512 }
10513 }
10514 return list;
10515 }
int feat
Definition: Card.cs:377
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1163
Definition: FEAT.cs:343

References Element.Create(), SourceManager.elements, Element.GetDNABonus(), 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 1892 of file Chara.cs.

1893 {
1894 return pos.ListCharasInRadius(this, radius, (Chara c) => IsFusable(c));
1895 }
bool IsFusable(Chara c)
Definition: Chara.cs:1867

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

Referenced by TryFuse().

◆ ListHobbies()

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

Definition at line 9544 of file Chara.cs.

9545 {
9546 listHobby.Clear();
9547 if (!useMemberType || memberType != FactionMemberType.Livestock)
9548 {
9549 if (_hobbies == null)
9550 {
9551 RerollHobby();
9552 }
9553 foreach (int hobby in _hobbies)
9554 {
9555 listHobby.Add(new Hobby
9556 {
9557 id = hobby
9558 });
9559 }
9560 }
9561 return listHobby;
9562 }

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

9518 {
9519 listHobby.Clear();
9520 if (useMemberType && memberType == FactionMemberType.Livestock)
9521 {
9522 listHobby.Add(new Hobby
9523 {
9524 id = 45
9525 });
9526 }
9527 else
9528 {
9529 if (_works == null)
9530 {
9531 RerollHobby();
9532 }
9533 foreach (int work in _works)
9534 {
9535 listHobby.Add(new Hobby
9536 {
9537 id = work
9538 });
9539 }
9540 }
9541 return listHobby;
9542 }

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

3781 {
3782 angle = Util.GetAngle(p.x - pos.x, p.z - pos.z);
3783 if (EClass._zone.IsRegion)
3784 {
3785 if (angle > 100f && angle < 170f)
3786 {
3787 base.dir = 2;
3788 }
3789 else if (angle > 170f && angle < 190f)
3790 {
3791 base.dir = 0;
3792 }
3793 else if (angle > 190f || (angle < -10f && angle > -100f))
3794 {
3795 base.dir = 3;
3796 }
3797 else
3798 {
3799 base.dir = 1;
3800 }
3801 angle -= 45f;
3802 }
3803 else if (angle > 170f && angle < 235f)
3804 {
3805 base.dir = 0;
3806 }
3807 else if (angle > 80f && angle < 145f)
3808 {
3809 base.dir = 1;
3810 }
3811 else if (angle > -100f && angle < -35f)
3812 {
3813 base.dir = 3;
3814 }
3815 else if (angle > -10f && angle < 55f)
3816 {
3817 base.dir = 2;
3818 }
3820 }

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

◆ MakeAlly()

void Chara.MakeAlly ( bool  msg = true)
inline

Definition at line 2493 of file Chara.cs.

2494 {
2495 if (IsLocalChara && !base.IsUnique)
2496 {
2497 Debug.Log("Creating Replacement NPC for:" + this);
2499 }
2500 _MakeAlly();
2501 if (msg)
2502 {
2503 EClass.pc.Say("hire", this);
2504 EClass.Sound.Play("good");
2505 }
2506 EClass.pc.party.AddMemeber(this);
2507 if (EClass._zone.IsTown)
2508 {
2510 }
2511 }
Chara CreateReplacement()
Definition: Chara.cs:8486
void _MakeAlly()
Definition: Chara.cs:2513
virtual bool IsTown
Definition: Zone.cs:230
void RefreshListCitizen()
Definition: Zone.cs:3858

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

8687 {
8688 return DNA.GenerateGene(this, DNA.Type.Brain);
8689 }
Definition: DNA.cs:9
Type
Definition: DNA.cs:11
static Thing GenerateGene(Chara c, Type? type=null)
Definition: DNA.cs:106

References DNA.GenerateGene().

◆ MakeGene()

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

Definition at line 8681 of file Chara.cs.

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

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

5552 {
5553 if (!EClass._zone.IsRegion)
5554 {
5555 List<string> list = new List<string> { "930", "931", "947", "948", "949", "950", "951", "952" };
5556 if (IsPC && EClass.rnd(2) == 0 && EClass.pc.things.Find("letter_will") != null)
5557 {
5558 list = new List<string> { "944", "946", "backerGrave", "backerGrave2" };
5559 }
5560 Thing thing = ThingGen.Create(list.RandomItem());
5561 thing.MakeRefFrom(this);
5562 if (!lastword.IsEmpty())
5563 {
5564 thing.c_note = lastword;
5565 }
5566 thing.isModified = true;
5567 EClass._zone.AddCard(thing, pos).Install();
5568 }
5569 }
Card MakeRefFrom(string id)
Definition: Card.cs:6023

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

2557 {
2558 UnmakeMinion();
2559 Hostility hostility = (base.c_originalHostility = (_master.IsPCFaction ? Hostility.Ally : _master.hostility));
2560 this.hostility = hostility;
2561 base.c_uidMaster = _master.uid;
2562 base.c_minionType = type;
2563 master = _master;
2564 Refresh();
2565 }
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 2487 of file Chara.cs.

2488 {
2489 _MakeAlly();
2490 EClass.pc.party.AddMemeber(this);
2491 }

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

◆ Marry()

void Chara.Marry ( Chara  c)
inline

Definition at line 8573 of file Chara.cs.

8574 {
8575 if (base.c_love == null)
8576 {
8577 base.c_love = new LoveData();
8578 }
8579 base.c_love.dateMarriage = EClass.world.date.GetRaw();
8580 base.c_love.uidZoneMarriage = EClass._zone.uid;
8581 base.c_love.nameZoneMarriage = EClass._zone.Name;
8582 SetFeat(1275, 1, msg: true);
8584 }
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 8408 of file Chara.cs.

8409 {
8410 if (c == this)
8411 {
8412 return;
8413 }
8414 if (IsPC)
8415 {
8416 c.ModAffinity(EClass.pc, a, show);
8417 }
8418 else
8419 {
8421 {
8422 return;
8423 }
8424 int num = StatsHygiene.GetAffinityMod(EClass.pc.hygiene.GetPhase()) + (HasElement(417) ? 30 : 0) + (EClass.pc.HasCondition<ConSmoking>() ? (-30) : 0);
8425 if (IsPCFaction && homeBranch != null)
8426 {
8427 num += (int)Mathf.Sqrt(homeBranch.Evalue(2117)) * 5;
8428 }
8429 bool flag = a > 0;
8430 if (flag)
8431 {
8432 a = a * num / 100;
8433 if (affinity.GetLunchChance() > EClass.rnd(100) && GetInt(71) >= 0 && GetInt(71) < EClass.world.date.GetRaw())
8434 {
8435 SetInt(71, -1);
8436 }
8437 }
8438 if (show)
8439 {
8440 if (a == 0)
8441 {
8442 if (!showOnlyEmo)
8443 {
8444 Say("affinityNone", this, c);
8445 }
8446 }
8447 else
8448 {
8449 ShowEmo((!flag) ? Emo.angry : Emo.love);
8450 c.ShowEmo(flag ? Emo.love : Emo.sad);
8451 if (!showOnlyEmo)
8452 {
8453 Say(flag ? "affinityPlus" : "affinityMinus", this, c);
8454 }
8455 }
8456 }
8457 if (c.IsPC)
8458 {
8459 a = affinity.Mod(a);
8460 }
8461 }
8462 }
int Mod(int a)
Definition: Affinity.cs:212
int GetLunchChance()
Definition: Affinity.cs:97
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:583

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

10456 {
10457 if (a > 0)
10458 {
10459 if (Evalue(962) >= 25 || (ResistLv(962) > 0 && EClass.rnd(ResistLv(962) + 1) != 0))
10460 {
10461 return;
10462 }
10463 int num = Evalue(412);
10464 if (num != 0)
10465 {
10466 float num2 = (float)a * 100f / (float)Mathf.Max(100 + num * 2, 10);
10467 a = (int)num2 + ((EClass.rndf(1f) < num2 % 1f) ? 1 : 0);
10468 }
10469 }
10470 if (a == 0)
10471 {
10472 return;
10473 }
10474 int num3 = (corruption + a) / 100 - corruption / 100;
10475 for (int i = 0; i < Mathf.Abs(num3); i++)
10476 {
10477 if (!MutateRandom((num3 > 0) ? 1 : (-1), 100, ether: true))
10478 {
10479 break;
10480 }
10481 }
10482 corruption += a;
10483 int num4 = 0;
10484 foreach (Element value in elements.dict.Values)
10485 {
10486 if (value.source.category == "ether")
10487 {
10488 num4 += value.Value;
10489 }
10490 }
10491 if (num4 > 0 && IsPC)
10492 {
10493 Tutorial.Reserve("ether");
10494 }
10495 corruption = num4 * 100 + corruption % 100;
10496 }
bool MutateRandom(int vec=0, int tries=100, bool ether=false, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:10637
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 10404 of file Chara.cs.

10405 {
10406 if (!HasElement(450))
10407 {
10408 long num = bio.height;
10409 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
10410 if (num < 1)
10411 {
10412 num = 1L;
10413 }
10414 if (num > 999999999)
10415 {
10416 num = 999999999L;
10417 }
10418 if (num != bio.height)
10419 {
10420 bio.height = (int)num;
10421 Say((a > 0) ? "height_gain" : "height_lose", this);
10422 }
10423 }
10424 }
int height
Definition: Biography.cs:53

◆ ModTempElement()

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

Definition at line 10893 of file Chara.cs.

10894 {
10895 if (a < 0 && !naturalDecay && HasElement(EClass.sources.elements.alias["sustain_" + EClass.sources.elements.map[ele].alias]?.id ?? 0))
10896 {
10897 return;
10898 }
10899 bool flag = HasElement(1215);
10900 if (tempElements == null)
10901 {
10903 tempElements.SetParent(this);
10904 }
10905 if (a > 0 && flag)
10906 {
10907 a = a * 150 / 100;
10908 }
10909 int num = elements.ValueWithoutLink(ele);
10910 int num2 = Mathf.Abs(num) + 100;
10911 int num3 = num2 / (flag ? 2 : 4);
10912 int num4 = -num - 100;
10913 int num5 = tempElements.Base(ele);
10914 int num6 = num5 + a;
10915 if (onlyRenew)
10916 {
10917 num3 = Mathf.Min(a, num3);
10918 num4 = Mathf.Max(a, -num2 / 3);
10919 }
10920 if (a > 0 && num6 > num3)
10921 {
10922 a = ((num3 > num5) ? (num3 - num5) : 0);
10923 }
10924 if (a < 0 && num6 < num4)
10925 {
10926 a = ((num4 < num5) ? (num4 - num5) : 0);
10927 }
10928 Element element = tempElements.ModBase(ele, a);
10929 if (element.vBase == 0)
10930 {
10931 tempElements.Remove(element.id);
10932 if (tempElements.dict.Count == 0)
10933 {
10934 tempElements = null;
10935 }
10936 }
10937 }
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 10426 of file Chara.cs.

10427 {
10428 if (HasElement(450) || a == 0)
10429 {
10430 return;
10431 }
10432 long num = bio.weight;
10433 long num2 = bio.height;
10434 long num3 = num2 * num2 * 18 / 25000;
10435 long num4 = num2 * num2 * 24 / 10000;
10436 if (ignoreLimit || (num > num3 && num < num4))
10437 {
10438 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
10439 if (num < 1)
10440 {
10441 num = 1L;
10442 }
10443 if (num > 999999999)
10444 {
10445 num = 999999999L;
10446 }
10447 if (num != bio.weight)
10448 {
10449 bio.weight = (int)num;
10450 Say((a > 0) ? "weight_gain" : "weight_lose", this);
10451 }
10452 }
10453 }
int weight
Definition: Biography.cs:41

◆ MoveByForce()

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

Definition at line 2841 of file Chara.cs.

2842 {
2843 if (!newPoint.sourceBlock.tileType.IsBlockPass && (!checkWall || (Dist(newPoint) <= 1 && CanMoveTo(newPoint, allowDestroyPath: false))) && _Move(newPoint, MoveType.Force) == MoveResult.Success && ai.Current.CancelWhenMoved)
2844 {
2845 ai.Current.TryCancel(c);
2846 }
2847 }
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:2935

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

3697 {
3698 if (isDead)
3699 {
3700 Revive();
3701 }
3702 else
3703 {
3704 Cure(CureType.Death);
3705 }
3706 CureCondition<ConSuspend>();
3707 if (IsPCParty)
3708 {
3710 }
3711 FactionBranch factionBranch = homeBranch;
3712 if (x == -1)
3713 {
3714 x = 50;
3715 }
3716 if (z == -1)
3717 {
3718 z = 50;
3719 }
3720 Point point = new Point(x, z);
3721 if (zone.IsActiveZone)
3722 {
3723 point = point.GetNearestPoint(allowBlock: false, allowChara: false);
3724 }
3725 zone.AddCard(this, point);
3726 SetHomeZone(zone);
3727 global.transition = new ZoneTransition
3728 {
3729 state = ZoneTransition.EnterState.Dead,
3730 x = point.x,
3731 z = point.z
3732 };
3733 orgPos = new Point(x, z);
3734 if (factionBranch != null)
3735 {
3737 factionBranch.policies.Validate();
3738 }
3739 }
void RefreshWorkElements(ElementContainer parent=null)
Definition: Chara.cs:9583
Chara SetHomeZone(Zone zone)
Definition: Chara.cs:1498
PolicyManager policies
bool IsActiveZone
Definition: Zone.cs:502

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

2824 {
2825 List<Point> list = new List<Point>();
2826 pos.ForeachNeighbor(delegate(Point p)
2827 {
2828 list.Add(p.Copy());
2829 });
2830 list.Shuffle();
2831 foreach (Point item in list)
2832 {
2833 if (!item.Equals(pos) && !item.HasChara && TryMove(item) == MoveResult.Success)
2834 {
2835 return true;
2836 }
2837 }
2838 return false;
2839 }
override MoveResult TryMove(Point newPoint, bool allowDestroyPath=true)
Definition: Chara.cs:2911
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 2809 of file Chara.cs.

2810 {
2811 Point randomNeighbor = pos.GetRandomNeighbor();
2812 if (!randomNeighbor.Equals(pos) && !randomNeighbor.HasChara && HasAccess(randomNeighbor))
2813 {
2814 if ((race.tag.Contains("water") || source.tag.Contains("water")) && pos.cell.IsTopWaterAndNoSnow && !randomNeighbor.IsDeepWater)
2815 {
2816 return false;
2817 }
2818 return TryMove(randomNeighbor) == MoveResult.Success;
2819 }
2820 return false;
2821 }
bool IsTopWaterAndNoSnow
Definition: Cell.cs:732
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 3561 of file Chara.cs.

3562 {
3563 if (z == currentZone)
3564 {
3565 return;
3566 }
3567 if (EClass.game.IsSurvival && z.IsRegion)
3568 {
3569 z = EClass.pc.homeZone;
3570 transition = new ZoneTransition
3571 {
3572 state = ZoneTransition.EnterState.Return
3573 };
3574 }
3575 if (HasCondition<ConInvulnerable>())
3576 {
3577 RemoveCondition<ConInvulnerable>();
3578 }
3579 if (IsPC)
3580 {
3581 EClass.player.nextZone = z;
3583 {
3586 {
3587 if (EClass.player.returnInfo != null)
3588 {
3589 EClass.player.returnInfo.turns += 5;
3590 }
3592 {
3593 EClass.game.Save(isAutoSave: true);
3594 }
3595 }
3596 EClass.player.deathZoneMove = false;
3597 }
3599 if (currentZone.instance != null)
3600 {
3602 z = EClass.game.spatials.Find(instance.uidZone) ?? EClass.pc.homeZone;
3603 transition = new ZoneTransition
3604 {
3605 state = instance.ReturnState,
3606 x = instance.x,
3607 z = instance.z
3608 };
3609 instance.OnLeaveZone();
3610 Debug.Log(z);
3611 }
3612 EInput.Consume(consumeAxis: true);
3613 EClass.player.uidLastZone = currentZone.uid;
3615 {
3617 {
3618 Msg.Say("enterZone", z.Name);
3619 }
3620 else
3621 {
3622 if (z.IsRegion)
3623 {
3624 Msg.Say("leaveZone", currentZone.Name);
3625 }
3626 else if (z.id != currentZone.id)
3627 {
3628 Msg.Say("enterZone", z.Name);
3629 }
3630 EClass.player.lastZonePos = pos.Copy();
3631 }
3632 EClass.player.lastTransition = transition;
3633 }
3634 foreach (Chara item in EClass._map.charas.Where((Chara c) => c.IsPCPartyMinion && c.master != EClass.pc).ToList())
3635 {
3637 }
3638 EClass.player.listCarryoverMap = EClass._map.charas.Where((Chara c) => c.c_uidMaster != 0 && c.FindMaster() == EClass.pc && c.c_minionType == MinionType.Default).ToList();
3639 if (!z.IsRegion && (z is Zone_Tent || currentZone is Zone_Tent))
3640 {
3641 foreach (Chara chara in EClass._map.charas)
3642 {
3643 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))
3644 {
3645 EClass.player.listCarryoverMap.Add(chara);
3646 }
3647 }
3648 }
3649 foreach (Chara item2 in EClass.player.listCarryoverMap)
3650 {
3651 EClass._zone.RemoveCard(item2);
3652 }
3653 }
3654 if (party != null && party.leader == this)
3655 {
3656 foreach (Chara member in party.members)
3657 {
3658 if (member != this && !member.isDead && member.parent is Zone)
3659 {
3660 member.MoveZone(z);
3661 }
3662 }
3663 }
3664 if (global == null)
3665 {
3666 Debug.Log(base.Name);
3667 return;
3668 }
3669 transition.uidLastZone = currentZone?.uid ?? 0;
3670 global.transition = transition;
3671 if (z.IsActiveZone)
3672 {
3673 Point spawnPos = z.GetSpawnPos(this);
3674 global.transition = null;
3675 if (IsPC)
3676 {
3677 EClass.player.lastTransition = null;
3678 }
3679 z.AddCard(this, spawnPos);
3680 if (IsBranchMember())
3681 {
3683 }
3684 }
3685 else
3686 {
3687 z.AddCard(this);
3688 }
3689 }
MinionType c_minionType
Definition: Card.cs:1015
bool IsBranchMember()
Definition: Chara.cs:6966
GlobalData global
Definition: Chara.cs:76
Chara FindMaster()
Definition: Chara.cs:2618
bool ignoreAutoSave
Definition: CoreDebug.cs:142
bool Save(bool isAutoSave=false, bool silent=false)
Definition: Game.cs:1068
bool IsSurvival
Definition: Game.cs:276
RoomManager rooms
Definition: Map.cs:31
Chara leader
Definition: Party.cs:31
bool deathZoneMove
Definition: Player.cs:1242
List< Chara > listCarryoverMap
Definition: Player.cs:1296
ReturnInfo returnInfo
Definition: Player.cs:933
bool simulatingZone
Definition: Player.cs:1252
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:270
Point GetSpawnPos(Chara c, ZoneTransition.EnterState destState=ZoneTransition.EnterState.Auto)
Definition: Zone.cs:1489

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, Game.IsSurvival, 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 3553 of file Chara.cs.

3554 {
3556 {
3557 state = state
3558 });
3559 }

◆ MutateRandom()

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

Definition at line 10637 of file Chara.cs.

10638 {
10639 if (!ether && vec >= 0 && HasElement(406) && EClass.rnd(5) != 0)
10640 {
10641 Say("resistMutation", this);
10642 return false;
10643 }
10644 IEnumerable<SourceElement.Row> ie = EClass.sources.elements.rows.Where((SourceElement.Row a) => a.category == (ether ? "ether" : "mutation") && !a.tag.Contains("noRandomMutation"));
10645 for (int num = 0; num < tries; num++)
10646 {
10647 SourceElement.Row row = ie.RandomItem();
10648 if (num == 0 && vec < 0 && ether && base.c_corruptionHistory != null && base.c_corruptionHistory.Count > 0)
10649 {
10650 if (EClass.sources.elements.map.ContainsKey(base.c_corruptionHistory.LastItem()))
10651 {
10652 row = EClass.sources.elements.map[base.c_corruptionHistory.LastItem()];
10653 }
10654 base.c_corruptionHistory.RemoveAt(base.c_corruptionHistory.Count - 1);
10655 if (base.c_corruptionHistory.Count == 0)
10656 {
10657 base.c_corruptionHistory = null;
10658 }
10659 }
10660 Element element = elements.GetElement(row.id);
10661 int num2 = 1;
10662 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))
10663 {
10664 continue;
10665 }
10666 if (element == null && !row.aliasParent.IsEmpty() && elements.Has(row.aliasParent))
10667 {
10668 row = EClass.sources.elements.alias[row.aliasParent];
10669 element = elements.GetElement(row.id);
10670 }
10671 bool flag = row.tag.Contains("neg");
10672 if (vec > 0)
10673 {
10674 if ((state >= BlessedState.Blessed && flag) || (state <= BlessedState.Cursed && !flag))
10675 {
10676 continue;
10677 }
10678 }
10679 else if (vec < 0 && ((state >= BlessedState.Blessed && !flag) || (state <= BlessedState.Cursed && flag)))
10680 {
10681 continue;
10682 }
10683 bool flag2 = true;
10684 if (element != null)
10685 {
10686 num2 = element.Value + ((vec != 0) ? vec : ((EClass.rnd(2) == 0) ? 1 : (-1)));
10687 if (num2 > element.source.max)
10688 {
10689 num2 = element.source.max - 1;
10690 }
10691 flag = (flag && num2 > element.Value) || (!flag && num2 < element.Value);
10692 flag2 = num2 > element.Value;
10693 if (vec > 0 && !flag2)
10694 {
10695 continue;
10696 }
10697 }
10698 Say(flag2 ? "mutation_gain" : "mutation_loose", this);
10699 SetFeat(row.id, num2);
10700 if (flag2 && ether)
10701 {
10702 if (base.c_corruptionHistory == null)
10703 {
10704 base.c_corruptionHistory = new List<int>();
10705 }
10706 base.c_corruptionHistory.Add(row.id);
10707 if (IsPCFaction)
10708 {
10709 Element element2 = elements.GetElement(row.id);
10710 WidgetPopText.Say("popEther".lang(element2.Name, base.Name));
10711 }
10713 {
10714 EClass.player.flags.gotEtherDisease = true;
10715 Thing thing = ThingGen.Create("parchment");
10716 thing.SetStr(53, "letter_ether");
10717 Thing thing2 = ThingGen.Create("1165");
10718 thing2.SetBlessedState(BlessedState.Normal);
10719 Thing p = ThingGen.CreateParcel(null, thing2, thing);
10721 }
10722 }
10723 if (EClass.core.IsGameStarted && pos != null)
10724 {
10725 PlaySound(ether ? "mutation_ether" : "mutation");
10726 PlayEffect("mutation");
10728 Say(row.GetText(flag ? "textDec" : "textInc", returnNull: true) ?? row.alias, this);
10729 }
10730 return true;
10731 }
10732 Say("nothingHappens");
10733 return false;
10734 }
virtual void SetBlessedState(BlessedState s)
Definition: Card.cs:4076
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 10786 of file Chara.cs.

10787 {
10788 if (_historyFood != null)
10789 {
10790 while (_historyFood.Count > 5)
10791 {
10792 _historyFood.RemoveAt(_historyFood.Count - 1);
10793 }
10794 if (_historyFood[0].Count > 0)
10795 {
10796 _historyFood.Insert(0, new List<string>());
10797 }
10798 }
10799 }

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:4557
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 num2 = 0; num2 < mainElement.Length; num2++)
1638 {
1639 string[] array = mainElement[num2].Split('/');
1640 SourceElement.Row row = EClass.sources.elements.alias["ele" + array[0]];
1641 int num3 = source.LV * row.eleP / 100;
1642 if (list.Count == 0 || num3 < _genLv || array[0] == bp.idEle)
1643 {
1644 list.Add(new Tuple<string, int, int>(array[0], (array.Length > 1) ? int.Parse(array[1]) : 0, num3));
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 num4 = 0; num4 < Mathf.Min(1 + base.LV / 5, 20); num4++)
1680 {
1681 SetFeat(1644, num4 + 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:3115
void DyeRandom()
Definition: Card.cs:6469
void ApplyBacker(int bid)
Definition: Card.cs:7496
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:2271
int happiness
Definition: Chara.cs:110
int contribution
Definition: Chara.cs:18
void CalculateMaxStamina()
Definition: Chara.cs:2203
bool isCreated
Definition: Chara.cs:138
int _idTimeTable
Definition: Chara.cs:345
void TryRestock(bool onCreate)
Definition: Chara.cs:4956
static List< SourceRace.Row > ListAdvRace
Definition: Chara.cs:170
void InitStats(bool onDeserialize=false)
Definition: Chara.cs:9810
bool bossText
Definition: Chara.cs:146
static List< SourceJob.Row > ListAdvJob
Definition: Chara.cs:172
bool ignoreBackerDestoryFlag
Definition: CoreConfig.cs:578
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:3822
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 8898 of file Chara.cs.

8899 {
8900 Say("give_erohon", this);
8901 AddCondition<ConParalyze>(50, force: true);
8902 AddCondition<ConConfuse>(50, force: true);
8903 AddCondition<ConFear>(1000, force: true);
8904 ModAffinity(EClass.pc, 100);
8905 t.Destroy();
8906 Talk("pervert");
8907 }

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

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

◆ OnInsulted()

void Chara.OnInsulted ( )
inline

Definition at line 8691 of file Chara.cs.

8692 {
8693 if (isDead)
8694 {
8695 return;
8696 }
8697 if (HasElement(1231))
8698 {
8699 Talk("insulted");
8700 AddCondition<ConEuphoric>(100 * Evalue(1231));
8701 }
8702 else if (EClass.rnd(20) == 0)
8703 {
8704 SetFeat(1231, 1, msg: true);
8705 if (IsPC)
8706 {
8708 }
8709 }
8710 }

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

10355 {
10356 if (days < 1)
10357 {
10358 days = 1;
10359 }
10360 int num = power * days;
10361 if (stamina.value < 0)
10362 {
10363 stamina.Set(1);
10364 }
10365 if (IsPC)
10366 {
10368 foreach (BodySlot slot in body.slots)
10369 {
10370 if (slot.thing != null && slot.thing.GetBool(135))
10371 {
10373 slot.thing.SetBool(135, enable: false);
10374 }
10375 }
10376 }
10377 if (isWeakToSunlight && isSunLit)
10378 {
10379 base.hp = 0;
10380 if (mana.value > 0)
10381 {
10382 mana.Set(0);
10383 }
10384 AddCondition<ConBurning>(1000, force: true);
10385 }
10386 else
10387 {
10388 HealHP(num);
10389 stamina.Mod(10 + 25 * num / 100 * (100 + elements.GetFeatRef(1642)) / 100);
10390 mana.Mod(num);
10391 }
10392 if (IsPCFaction)
10393 {
10394 hunger.Mod(20);
10395 }
10396 sleepiness.Set(0);
10397 if (!IsMinion)
10398 {
10399 interest = 100;
10400 }
10401 Cure(CureType.Sleep, power);
10402 }
Thing thing
Definition: BodySlot.cs:8
virtual void HealHP(long a, HealSource origin=HealSource.None)
Definition: Card.cs:4188
void SetBool(string id, bool enable)
Definition: Card.cs:2562
bool isWeakToSunlight
Definition: Chara.cs:154
int GetFeatRef(int ele, int idx=0)
int staminaRecovery
Definition: Player.cs:1038
void RecoverStamina(int a)
Definition: Player.cs:1597

References Card.GetBool(), Stats.Mod(), EClass.player, Player.RecoverStamina(), Stats.Set(), Card.SetBool(), LayerInventory.SetDirty(), CharaBody.slots, Player.staminaRecovery, BodySlot.thing, and Stats.value.

◆ OnSleep() [2/2]

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

Definition at line 10334 of file Chara.cs.

10335 {
10336 bool isSunLit = pos.IsSunLit;
10337 TraitPillow traitPillow = pos.FindThing<TraitPillow>();
10338 int num = bed?.Power ?? 20;
10339 if (traitPillow != null)
10340 {
10341 num += traitPillow.owner.Power / 2;
10342 }
10343 if (bed != null)
10344 {
10345 num += bed.Evalue(750) * 5;
10346 if (bed.trait is TraitBedCoffin)
10347 {
10348 isSunLit = false;
10349 }
10350 }
10351 OnSleep(num, days, isSunLit);
10352 }
void OnSleep(Thing bed=null, int days=1)
Definition: Chara.cs:10334
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 2370 of file Chara.cs.

2371 {
2372 return s switch
2373 {
2374 "é ­" => 30,
2375 "首" => 31,
2376 "体" => 32,
2377 "背" => 33,
2378 "手" => 35,
2379 "指" => 36,
2380 "è…•" => 34,
2381 "è…°" => 37,
2382 "è¶³" => 39,
2383 _ => -1,
2384 };
2385 }

Referenced by ApplyRace(), and ResetBody().

◆ PerformWork()

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

Definition at line 9768 of file Chara.cs.

9769 {
9770 Hobby hobby = new Hobby();
9771 hobby.id = session.id;
9772 WorkSummary workSummary = _workSummary;
9773 hobby.GetAI(this).OnPerformWork(IsRealTime);
9774 if (!isHobby)
9775 {
9776 workSummary.progress += EClass.rnd(5) + 5;
9777 }
9778 int num = PerformWork(hobby, 0, isHobby);
9779 int num2 = PerformWork(hobby, 1, isHobby);
9780 int num3 = PerformWork(hobby, 2, isHobby);
9781 int num4 = PerformWork(hobby, 3, isHobby);
9782 workSummary.money += num;
9783 workSummary.food += num2;
9784 workSummary.knowledge += num3;
9785 workSummary.material += num4;
9786 int PerformWork(Hobby work, int idx, bool flag)
9787 {
9788 if (idx >= work.source.resources.Length)
9789 {
9790 return 0;
9791 }
9792 int num5 = work.source.resources[idx];
9793 int num6 = num5;
9794 num5 = Rand.Range(num5 * (100 - work.source.resources[idx]) / 100, num5);
9795 num5 = num5 * (flag ? 50 : 100) * session.efficiency / 10000;
9796 if (num6 > 0 && num5 <= 0)
9797 {
9798 num5 = 1;
9799 }
9800 return num5;
9801 }
9802 }
virtual void OnPerformWork(bool realtime)
Definition: AIWork.cs:155
void PerformWork(WorkSession session, bool isHobby=false, bool IsRealTime=false)
Definition: Chara.cs:9768
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 4577 of file Chara.cs.

4578 {
4579 if (t.trait is TraitCard && t.isNew && EClass.game.config.autoCollectCard && !t.c_idRefCard.IsEmpty())
4580 {
4582 return t;
4583 }
4584 if (t.parent == this)
4585 {
4586 return t;
4587 }
4588 t = TryPoisonPotion(t);
4589 ThingContainer.DestData dest = things.GetDest(t, tryStack);
4590 if (!dest.IsValid)
4591 {
4592 if (t.parent != EClass._zone)
4593 {
4594 if (IsPC)
4595 {
4596 Say("backpack_full_drop", t);
4597 SE.Drop();
4598 }
4599 return EClass._zone.AddCard(t, pos).Thing;
4600 }
4601 if (IsPC)
4602 {
4603 Say("backpack_full", t);
4604 }
4605 return t;
4606 }
4607 if (dest.stack != null)
4608 {
4609 if (msg)
4610 {
4611 PlaySound("pick_thing");
4612 Say("pick_thing", this, t);
4613 }
4614 t.TryStackTo(dest.stack);
4615 return dest.stack;
4616 }
4617 TryAbsorbRod(t);
4618 if (msg)
4619 {
4620 PlaySound("pick_thing");
4621 Say("pick_thing", this, t);
4622 }
4624 return dest.container.AddThing(t, tryStack);
4625 }
bool isNew
Definition: Card.cs:485
bool TryStackTo(Thing to)
Definition: Card.cs:3578
string c_idRefCard
Definition: Card.cs:1777
void TryReservePickupTutorial(Thing t)
Definition: Chara.cs:4671
Thing TryPoisonPotion(Thing t)
Definition: Chara.cs:4627
void TryAbsorbRod(Thing t)
Definition: Chara.cs:4641
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 4797 of file Chara.cs.

4798 {
4799 if (held == null)
4800 {
4801 return;
4802 }
4803 Card card = held;
4804 if (IsPC && held.invY == 1)
4805 {
4806 WidgetHotbar.dirtyCurrentItem = true;
4808 held = null;
4809 return;
4810 }
4811 if (held.isChara)
4812 {
4813 DropHeld();
4814 return;
4815 }
4817 {
4818 Say("canOnlyCarry", held);
4819 DropHeld();
4820 return;
4821 }
4822 bool flag = held != things.TryStack(held.Thing);
4823 if (!flag && things.IsOverflowing())
4824 {
4825 if (IsPC)
4826 {
4827 Say("backpack_full_drop", held);
4828 SE.Drop();
4829 }
4830 DropHeld();
4831 return;
4832 }
4833 if (msg)
4834 {
4835 PlaySound("pick_thing");
4836 Say("pick_held", this, card);
4837 if (IsPC && card.id == "statue_weird")
4838 {
4839 Say("statue_pick");
4840 }
4841 }
4842 if (IsPC)
4843 {
4844 WidgetHotbar.dirtyCurrentItem = true;
4845 if (!flag)
4846 {
4848 if (held.GetRootCard() != EClass.pc)
4849 {
4850 Pick(held.Thing, msg: false);
4851 }
4852 }
4853 }
4854 held = null;
4855 }
int invY
Definition: Card.cs:2007
bool IsHotItem
Definition: Card.cs:122
Card DropHeld(Point dropPos=null)
Definition: Chara.cs:4874
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 4557 of file Chara.cs.

4558 {
4559 if (num != 0)
4560 {
4561 PickOrDrop(p, ThingGen.Create(idThing, idMat).SetNum(num), msg);
4562 }
4563 }

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

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

◆ PickOrDrop() [2/2]

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

Definition at line 4565 of file Chara.cs.

4566 {
4567 if (things.GetDest(t).IsValid)
4568 {
4569 Pick(t, msg);
4570 }
4571 else
4572 {
4573 EClass._zone.AddCard(t, p);
4574 }
4575 }

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:2259
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(), ActEffect.Proc(), Refresh(), ActRide.Ride(), CharaBody.Unequip(), UnmakeMinion(), and ActRide.Unride().

◆ RefreshFaithElement()

void Chara.RefreshFaithElement ( )
inline

Definition at line 10850 of file Chara.cs.

10851 {
10852 if (faithElements != null)
10853 {
10855 }
10857 if (idFaith == "eyth" && !HasElement(1228))
10858 {
10859 return;
10860 }
10861 SourceReligion.Row row = EClass.sources.religions.map.TryGetValue(idFaith);
10862 if (row == null)
10863 {
10864 return;
10865 }
10867 if (!HasCondition<ConExcommunication>())
10868 {
10869 SourceElement.Row row2 = EClass.sources.elements.alias.TryGetValue("featGod_" + row.id + "1");
10870 if (row2 != null)
10871 {
10872 faithElements.SetBase(row2.id, 1);
10873 }
10874 int[] array = row.elements;
10875 int num = GetPietyValue() * (120 + Evalue(1407) * 15 + Evalue(1228) * 20) / 100;
10876 for (int i = 0; i < array.Length; i += 2)
10877 {
10878 int num2 = array[i + 1] * num / 50;
10879 if (array[i] == 79)
10880 {
10881 num2 = EClass.curve(num2, array[i + 1] * 2, 10, 50);
10882 }
10883 if (num2 >= 20 && array[i] >= 950 && array[i] < 970)
10884 {
10885 num2 = 20;
10886 }
10887 faithElements.SetBase(array[i], Mathf.Max(num2, 1));
10888 }
10889 }
10891 }
string idFaith
Definition: Chara.cs:235
ElementContainer faithElements
Definition: Chara.cs:38
int GetPietyValue()
Definition: Chara.cs:10841
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(), ActEffect.Proc(), and SetFaith().

◆ RefreshSpeed()

void Chara.RefreshSpeed ( Element::BonusInfo  info = null)
inline

Definition at line 2049 of file Chara.cs.

2050 {
2051 if (currentZone != EClass._zone)
2052 {
2053 dirtySpeed = true;
2054 return;
2055 }
2056 if (ride != null && !ride.IsDeadOrSleeping)
2057 {
2059 _Speed = ride._Speed;
2060 info?.AddText("rideSpeed".lang(_Speed.ToString() ?? ""));
2061 }
2062 else if (host != null)
2063 {
2064 if (host.ride == this)
2065 {
2066 _Speed = Evalue(79);
2067 int a = Evalue(1423);
2068 int num = ((!HasElement(495)) ? 1 : 3);
2069 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);
2070 _Speed = _Speed * 100 / Mathf.Clamp(value, 100, 1000);
2071 }
2072 else
2073 {
2074 _Speed = (Evalue(79) + host.Evalue(79)) / 2;
2075 }
2076 }
2077 else
2078 {
2079 _Speed = Evalue(79) + Evalue(407) / 2;
2080 }
2081 if (body.GetSlot(37, onlyEmpty: false)?.thing != null && HasElement(1209) && !HasElement(419))
2082 {
2083 _Speed -= 25L;
2084 info?.AddText(-25L, EClass.sources.elements.map[1209].GetName());
2085 }
2086 if (parasite != null)
2087 {
2088 long speed = _Speed;
2089 int num2 = ((!HasElement(495)) ? 1 : 3);
2090 _Speed = _Speed * 100 / Mathf.Clamp(120 + parasite.LV * 2 / num2 - base.STR - Evalue(227) * 2, 100, 1000);
2091 info?.AddText(_Speed - speed, "parasiteSpeed".lang());
2092 }
2093 if (_Speed < elements.ValueWithoutLink(79) / 3)
2094 {
2096 info?.AddText("minSpeed".lang((elements.ValueWithoutLink(79) / 3).ToString() ?? ""));
2097 }
2098 int num3 = 100;
2099 if (EClass._zone.map != null && (EClass._zone.IsUnderwater || (base.Cell.IsTopWaterAndNoSnow && !base.Cell.isFloating)))
2100 {
2101 int num4 = Evalue(200);
2102 int num5 = Evalue(1252);
2103 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);
2104 if (info != null && num3 != 100)
2105 {
2106 info.AddFix(num3 - 100, EClass.sources.elements.map[200].GetName().ToTitleCase());
2107 }
2108 if (num5 > 0)
2109 {
2110 num3 += num5 * 20;
2111 info?.AddFix(num5 * 20, EClass.sources.elements.map[1252].GetName().ToTitleCase());
2112 }
2113 }
2114 if (IsPCFaction)
2115 {
2116 switch (burden.GetPhase())
2117 {
2118 case 1:
2119 num3 -= 10;
2120 info?.AddFix(-10, burden.GetPhaseStr());
2121 break;
2122 case 2:
2123 num3 -= 20;
2124 info?.AddFix(-20, burden.GetPhaseStr());
2125 break;
2126 case 3:
2127 num3 -= 30;
2128 info?.AddFix(-30, burden.GetPhaseStr());
2129 break;
2130 case 4:
2131 num3 -= (IsPC ? 50 : 100);
2132 info?.AddFix(IsPC ? (-50) : (-100), burden.GetPhaseStr());
2133 break;
2134 }
2135 if (IsPC)
2136 {
2137 switch (stamina.GetPhase())
2138 {
2139 case 1:
2140 num3 -= 10;
2141 info?.AddFix(-10, stamina.GetPhaseStr());
2142 break;
2143 case 0:
2144 num3 -= 20;
2145 info?.AddFix(-20, stamina.GetPhaseStr());
2146 break;
2147 }
2148 switch (sleepiness.GetPhase())
2149 {
2150 case 2:
2151 num3 -= 10;
2152 info?.AddFix(-10, sleepiness.GetPhaseStr());
2153 break;
2154 case 3:
2155 num3 -= 20;
2156 info?.AddFix(-20, sleepiness.GetPhaseStr());
2157 break;
2158 }
2159 switch (hunger.GetPhase())
2160 {
2161 case 3:
2162 case 4:
2163 num3 -= 10;
2164 info?.AddFix(-10, hunger.GetPhaseStr());
2165 break;
2166 case 5:
2167 num3 -= 30;
2168 info?.AddFix(-30, hunger.GetPhaseStr());
2169 break;
2170 }
2171 num3 += EClass.player.lastEmptyAlly * Evalue(1646);
2172 info?.AddFix(EClass.player.lastEmptyAlly * Evalue(1646), EClass.sources.elements.map[1646].GetName());
2173 }
2175 {
2176 num3 += EClass.player.lastEmptyAlly * 10 - 10;
2177 info?.AddFix(EClass.player.lastEmptyAlly * 10 - 10, "exceedParty".lang());
2178 }
2179 }
2180 else if (base.LV >= 1000 && !EClass.game.principal.disableVoidBlessing && !base.IsPCFactionOrMinion)
2181 {
2182 num3 += EClass.curve((base.LV - 900) / 100 * 10, 500, 100);
2183 info?.AddFix(EClass.curve((base.LV - 900) / 100 * 10, 500, 100), "enemySpeedBuff".lang());
2184 }
2185 if (HasCondition<ConGravity>())
2186 {
2187 num3 -= 30;
2188 info?.AddFix(-30, GetCondition<ConGravity>().Name);
2189 }
2190 if (_Speed < 10)
2191 {
2192 _Speed = 10L;
2193 }
2194 _Speed = _Speed * num3 / 100;
2195 if (_Speed < 10)
2196 {
2197 _Speed = 10L;
2198 info?.AddText("minSpeed".lang(10.ToString() ?? ""));
2199 }
2200 dirtySpeed = false;
2201 }
Ridability
Definition: Ridability.cs:2
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:1266

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

9584 {
9585 if (workElements != null)
9586 {
9588 }
9589 workElements = null;
9590 if (IsPCParty || homeBranch == null || homeBranch.owner == null)
9591 {
9592 return;
9593 }
9594 foreach (Hobby item in ListHobbies())
9595 {
9596 TryAdd(item);
9597 }
9598 foreach (Hobby item2 in ListWorks())
9599 {
9600 TryAdd(item2);
9601 }
9602 if (workElements != null)
9603 {
9605 }
9606 void TryAdd(Hobby h)
9607 {
9608 if (!h.source.elements.IsEmpty())
9609 {
9610 if (workElements == null)
9611 {
9613 }
9614 for (int i = 0; i < h.source.elements.Length; i += 2)
9615 {
9616 int num = h.source.elements[i];
9617 int num2 = h.source.elements[i + 1];
9618 int num3 = 100;
9619 if (num != 2115 && num != 2207)
9620 {
9621 num3 = h.GetEfficiency(this) * homeBranch.efficiency / 100;
9622 if (num3 <= 0)
9623 {
9624 continue;
9625 }
9626 }
9627 workElements.ModBase(num, (num2 < 0) ? (num2 / 10) : Mathf.Max(1, h.source.elements[i + 1] * num3 / 1000));
9628 }
9629 }
9630 }
9631 }
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 10239 of file Chara.cs.

10240 {
10241 for (int num = conditions.Count - 1; num >= 0; num--)
10242 {
10243 Condition condition = conditions[num];
10244 if (condition.Type == ConditionType.Stance)
10245 {
10246 condition.Kill();
10247 }
10248 }
10249 }

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

10090 : Condition
10091 {
10092 for (int num = conditions.Count - 1; num >= 0; num--)
10093 {
10094 if (conditions[num] is T)
10095 {
10096 conditions[num].Kill();
10097 break;
10098 }
10099 }
10100 }

References Condition.Kill().

◆ RemoveGlobal()

void Chara.RemoveGlobal ( )
inline

◆ RemoveLastBodyPart()

void Chara.RemoveLastBodyPart ( bool  msg = false)
inline

Definition at line 2398 of file Chara.cs.

2399 {
2400 if (body.slots.Count != 0)
2401 {
2402 BodySlot bodySlot = body.slots.LastItem();
2403 body.RemoveBodyPartAt(body.slots.Count - 1);
2404 if (msg)
2405 {
2406 Say("lose_bodyparts", this, Element.Get(bodySlot.elementId).GetName().ToLower());
2407 PlaySound("offering");
2408 }
2409 }
2410 }
int elementId
Definition: BodySlot.cs:6
void RemoveBodyPartAt(int idx)
Definition: CharaBody.cs:373

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

8920 {
8921 if (HasCondition<StanceTaunt>() || base.isRestrained || attacker == this)
8922 {
8923 return false;
8924 }
8925 if (host != null && host.isRestrained)
8926 {
8927 return false;
8928 }
8929 if (base.IsPCFactionOrMinion && attacker.IsPCFactionOrMinion)
8930 {
8931 return false;
8932 }
8933 bool flag = false;
8934 foreach (Chara chara in EClass._map.charas)
8935 {
8936 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))
8937 {
8938 continue;
8939 }
8940 bool flag2 = chara.HasElement(1225) && !chara.GetBool(126);
8941 if ((!flag2 && (flag || EClass.rnd(2) == 0 || !chara.HasCondition<StanceTaunt>())) || chara.HasCooldown(1225))
8942 {
8943 continue;
8944 }
8945 int num = Mathf.Max(chara.Evalue(1649), (!flag2) ? 1 : 3);
8946 int num2 = Dist(chara);
8947 if (num2 > 25)
8948 {
8949 continue;
8950 }
8951 if (num2 > num || !chara.CanSeeLos(pos, num2))
8952 {
8953 if (!flag2)
8954 {
8955 continue;
8956 }
8957 Point nearestPoint = pos.GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: true, ignoreCenter: true);
8958 if (!nearestPoint.IsValid)
8959 {
8960 continue;
8961 }
8962 chara.Teleport(nearestPoint);
8963 chara.AddCooldown(1225, 10);
8964 num2 = Dist(chara);
8965 Say("intercept_loyal", chara, this);
8966 chara.SetEnemy(attacker);
8967 attacker.SetEnemy(chara);
8968 if (num2 > num || !chara.CanSeeLos(pos, num2))
8969 {
8970 continue;
8971 }
8972 }
8973 if (!flag && !HasElement(1225))
8974 {
8975 Say("intercept", chara, this);
8976 if (EClass.rnd(10) == 0)
8977 {
8978 chara.Talk("intercept", base.NameSimple);
8979 }
8980 if (attacker.enemy == this)
8981 {
8982 attacker.SetEnemy(chara);
8983 }
8984 action(chara);
8985 flag = true;
8986 }
8987 }
8988 return flag;
8989 }
void Teleport(Point point, bool silent=false, bool force=false)
Definition: Card.cs:6190
ConSuspend conSuspend
Definition: Chara.cs:104
void AddCooldown(int idEle, int turns=0)
Definition: Chara.cs:9234
bool HasCooldown(int idEle)
Definition: Chara.cs:9285

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

9678 {
9679 if (_hobbies != null && _works != null)
9680 {
9681 _hobbies.Clear();
9682 _works.Clear();
9683 }
9684 else
9685 {
9686 _hobbies = new List<int>();
9687 _works = new List<int>();
9688 }
9689 if (source.hobbies.IsEmpty())
9690 {
9691 AddHobby(EClass.sources.hobbies.listHobbies.RandomItem().id);
9692 }
9693 else
9694 {
9695 string[] hobbies = source.hobbies;
9696 foreach (string text in hobbies)
9697 {
9698 if (EClass.sources.hobbies.alias.TryGetValue(text.Trim(), out var value))
9699 {
9700 AddHobby(value.id);
9701 continue;
9702 }
9703 ModUtil.LogModError("source chara row '" + source.id + "' has invalid hobby '" + text + "'", source);
9704 }
9705 }
9706 if (source.works.IsEmpty())
9707 {
9708 AddWork(EClass.sources.hobbies.listWorks.RandomItem().id);
9709 }
9710 else
9711 {
9712 string[] hobbies = source.works;
9713 foreach (string text2 in hobbies)
9714 {
9715 if (EClass.sources.hobbies.alias.TryGetValue(text2.Trim(), out var value2))
9716 {
9717 AddWork(value2.id);
9718 continue;
9719 }
9720 ModUtil.LogModError("source chara row '" + source.id + "' has invalid work '" + text2 + "'", source);
9721 }
9722 }
9724 }
WorkSummary GetWorkSummary()
Definition: Chara.cs:9726
void AddWork(int id)
Definition: Chara.cs:9665
void AddHobby(int id)
Definition: Chara.cs:9653
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 2412 of file Chara.cs.

2413 {
2414 for (int num = body.slots.Count - 1; num >= 0; num--)
2415 {
2416 BodySlot bodySlot = body.slots[num];
2417 if (bodySlot.elementId == 45 || bodySlot.elementId == 40)
2418 {
2419 return;
2420 }
2421 body.RemoveBodyPart(num);
2422 }
2423 string[] array = race.figure.Split('|');
2424 foreach (string s in array)
2425 {
2426 int num2 = ParseBodySlot(s);
2427 if (num2 != -1)
2428 {
2429 body.AddBodyPart(num2);
2430 }
2431 }
2433 }

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

◆ ResetUpgrade()

void Chara.ResetUpgrade ( )
inline

Definition at line 9119 of file Chara.cs.

9120 {
9121 _ = base.c_upgrades;
9122 }

Referenced by CoreDebug.ResetPetUpgrades().

◆ ResistCon()

void Chara.ResistCon ( Condition  con)
inline

Definition at line 10296 of file Chara.cs.

10297 {
10298 if (con.power > 0 && resistCon != null)
10299 {
10300 int a = ClassExtension.TryGetValue<int, int>((IDictionary<int, int>)resistCon, con.id, 0);
10301 if (1000 < EClass.rnd(a))
10302 {
10303 con.power = 0;
10304 }
10305 else if (500 < EClass.rnd(a))
10306 {
10307 con.power /= 5;
10308 }
10309 else if (200 < EClass.rnd(a))
10310 {
10311 con.power /= 3;
10312 }
10313 else if (100 < EClass.rnd(a))
10314 {
10315 con.power /= 2;
10316 }
10317 }
10318 }

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

◆ RestockEquip()

void Chara.RestockEquip ( bool  onCreate)
inline

Definition at line 4966 of file Chara.cs.

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

5315 {
5316 switch (id)
5317 {
5318 case "lomias":
5319 if (ShouldRestock("_meat"))
5320 {
5321 AddCard(ThingGen.Create("_meat").MakeRefFrom("begger"));
5322 }
5323 break;
5324 case "fiama":
5325 Restock("book_story", 1);
5326 break;
5327 case "rock_thrower":
5328 Restock("stone", 10 + EClass.rnd(10));
5329 break;
5330 case "giant":
5331 Restock("rock", 2 + EClass.rnd(10));
5332 break;
5333 case "farris":
5334 Restock("lute", 1);
5335 Restock("book_story_home", 1);
5336 break;
5337 case "begger":
5338 break;
5339 }
5340 void Restock(string id, int num)
5341 {
5342 if (ShouldRestock(id))
5343 {
5344 AddCard(ThingGen.Create(id).SetNum(num));
5345 }
5346 }
5347 bool ShouldRestock(string id)
5348 {
5349 return things.Find(id) == null;
5350 }
5351 }

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

◆ Revive()

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

Definition at line 5465 of file Chara.cs.

5466 {
5467 if (!isDead)
5468 {
5469 return;
5470 }
5471 isDead = false;
5472 base.hp = MaxHP / 3;
5473 mana.value = 0;
5474 stamina.value = 0;
5475 if (hunger.value > 30)
5476 {
5477 hunger.value = 30;
5478 }
5479 sleepiness.value = 0;
5481 RemoveCondition<StanceTaunt>();
5482 if (id == "keeper_garden")
5483 {
5484 SaiyanRevive();
5485 }
5486 if (IsPC)
5487 {
5489 {
5490 Msg.Say("noDeathPenalty2", this);
5491 }
5493 {
5494 Msg.Say("noDeathPenalty", this);
5495 }
5496 else
5497 {
5499 }
5500 List<Thing> dropList = new List<Thing>();
5501 EClass.pc.things.Foreach(delegate(Thing t)
5502 {
5504 {
5505 t.ignoreAutoPick = true;
5506 dropList.Add(t);
5507 }
5508 }, onlyAccessible: false);
5509 foreach (Thing item in dropList)
5510 {
5512 Msg.Say("backpack_full_drop", item);
5513 }
5514 EClass.player.preventDeathPenalty = false;
5515 }
5516 if (IsPCFaction && homeBranch != null)
5517 {
5518 homeBranch.Log("bRevive", this);
5519 }
5520 if (p != null)
5521 {
5522 if (!p.IsInBounds)
5523 {
5525 }
5526 EClass._zone.AddCard(this, p);
5527 if (msg)
5528 {
5529 SE.Play("revive");
5530 Msg.Say("revive", this);
5531 PlayEffect("revive");
5532 }
5533 SetCensored(enable: false);
5534 }
5535 }
void SetCensored(bool enable)
Definition: Card.cs:8249
Card parentCard
Definition: Card.cs:106
void SaiyanRevive()
Definition: Chara.cs:5537
void ApplyDeathPenalty()
Definition: Chara.cs:5571
bool disableDeathPenaltyProtection
Point GetCenterPos()
Definition: MapBounds.cs:52
int days
Definition: Player.cs:75
bool preventDeathPenalty
Definition: Player.cs:1240
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 3761 of file Chara.cs.

3762 {
3763 if (renderer.hasActor)
3764 {
3765 base.dir = (base.dir + ((!reverse) ? 1 : (-1))).Clamp(0, 3, loop: true);
3766 }
3767 else
3768 {
3769 base.dir = ((base.dir == 0) ? 1 : 0);
3770 }
3771 UpdateAngle();
3773 }

Referenced by AI_Dance.Run().

◆ SaiyanRevive()

void Chara.SaiyanRevive ( )
inline

Definition at line 5537 of file Chara.cs.

5538 {
5539 ModCorruption(-100000);
5540 if (base.LV < 10000000)
5541 {
5542 SetLv(base.LV * 10 + 9);
5543 }
5544 Refresh();
5545 base.hp = MaxHP;
5546 mana.value = mana.max;
5547 stamina.value = stamina.max;
5548 bossText = true;
5549 }
void ModCorruption(int a)
Definition: Chara.cs:10455

References Stats.max.

◆ ScaleByPrincipal()

Chara Chara.ScaleByPrincipal ( )
inline

◆ SetAI()

AIAct Chara.SetAI ( AIAct  g)
inline

Definition at line 9453 of file Chara.cs.

9454 {
9455 if (IsPC)
9456 {
9458 }
9459 if (ai.IsRunning)
9460 {
9461 if (ai == g && ai.IsNoGoal)
9462 {
9463 return g;
9464 }
9465 ai.Cancel();
9466 if (ai == g)
9467 {
9468 Debug.Log("goal is g:" + ai?.ToString() + "/" + this);
9469 return g;
9470 }
9471 }
9472 if (HasCondition<ConWait>())
9473 {
9474 RemoveCondition<ConWait>();
9475 }
9476 ai = g;
9477 ai.SetOwner(this);
9478 if (IsPC)
9479 {
9481 }
9482 return g;
9483 }
virtual bool IsNoGoal
Definition: AIAct.cs:74
void SetOwner(Chara c)
Definition: AIAct.cs:189
QueueManager queues
Definition: Player.cs:1284
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 9443 of file Chara.cs.

9444 {
9445 SetAI(new GoalCombat());
9446 }

Referenced by ZoneEventQuest.AggroEnemy().

◆ SetAIIdle()

void Chara.SetAIIdle ( )
inline

Definition at line 9439 of file Chara.cs.

9440 {
9441 }

◆ SetAIImmediate()

void Chara.SetAIImmediate ( AIAct  g)
inline

◆ SetCooldown()

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

Definition at line 9252 of file Chara.cs.

9253 {
9254 if (_cooldowns == null)
9255 {
9256 _cooldowns = new List<int>();
9257 }
9258 bool flag = false;
9259 for (int i = 0; i < _cooldowns.Count; i++)
9260 {
9261 if (_cooldowns[i] / 1000 == idEle)
9262 {
9263 if (turns == 0)
9264 {
9265 _cooldowns.RemoveAt(i);
9266 }
9267 else
9268 {
9269 _cooldowns[i] = idEle * 1000 + turns;
9270 }
9271 flag = true;
9272 break;
9273 }
9274 }
9275 if (!flag && turns > 0)
9276 {
9277 AddCooldown(idEle, turns);
9278 }
9279 if (_cooldowns.Count == 0)
9280 {
9281 _cooldowns = null;
9282 }
9283 }

Referenced by ConTransmuteBat.OnRemoved().

◆ SetDir()

override void Chara.SetDir ( int  d)
inlinevirtual

Reimplemented from Card.

Definition at line 3754 of file Chara.cs.

3755 {
3756 base.dir = d;
3757 UpdateAngle();
3759 }

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

◆ SetDirtySpeed()

void Chara.SetDirtySpeed ( )
inline

Definition at line 2040 of file Chara.cs.

2041 {
2042 dirtySpeed = true;
2043 if (host != null)
2044 {
2046 }
2047 }

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

6680 {
6681 enemy = c;
6682 if (c == null)
6683 {
6684 if (ai is GoalCombat)
6685 {
6686 ai.Cancel();
6687 }
6688 }
6689 else
6690 {
6691 calmCheckTurn = 10 + EClass.rnd(30);
6692 }
6693 return c;
6694 }

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

5354 {
5356 Rarity rarity = Rarity.Normal;
5357 int num = ((base.LV >= 1000) ? 7 : ((base.LV >= 500) ? 5 : ((base.LV >= 250) ? 3 : ((base.LV >= 100) ? 2 : ((base.LV >= 50) ? 1 : 0)))));
5358 Rarity rarity2 = base.rarity;
5359 if (id == "big_sister")
5360 {
5361 num = (isOnCreate ? 8 : 4);
5362 }
5363 if (!isOnCreate && EClass.rnd(10) != 0)
5364 {
5365 num /= 2;
5366 }
5367 if (rarity2 == Rarity.Superior && EClass.rnd(10) <= num)
5368 {
5369 rarity = Rarity.Superior;
5370 }
5371 else if (rarity2 == Rarity.Legendary)
5372 {
5373 rarity = ((EClass.rnd(10) <= num) ? Rarity.Legendary : ((EClass.rnd(5) <= num) ? Rarity.Superior : Rarity.Normal));
5374 }
5375 else if (rarity2 >= Rarity.Mythical)
5376 {
5377 rarity = ((EClass.rnd(30) <= num) ? Rarity.Mythical : ((EClass.rnd(10) > num) ? Rarity.Superior : Rarity.Legendary));
5378 }
5379 if (rarity == Rarity.Normal && EClass.rnd(1000) == 0)
5380 {
5381 rarity = Rarity.Legendary;
5382 }
5383 CardBlueprint.current.rarity = rarity;
5384 }
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 10517 of file Chara.cs.

10518 {
10519 Feat feat = elements.GetElement(id) as Feat;
10520 int num = 0;
10521 if (feat == null)
10522 {
10523 Debug.Log("1: null/" + EClass.sources.elements.map[id].id);
10524 }
10525 else
10526 {
10527 Debug.Log("1:" + feat.Name + "/" + feat.Value);
10528 }
10529 if (feat != null && feat.Value > 0)
10530 {
10531 if (value == feat.Value)
10532 {
10533 return;
10534 }
10535 num = feat.Value;
10536 feat.Apply(-feat.Value, elements);
10537 }
10538 feat = elements.SetBase(id, value - (feat?.vSource ?? 0)) as Feat;
10539 if (feat == null)
10540 {
10541 Debug.Log("1: null" + EClass.sources.elements.map[id].id);
10542 }
10543 else
10544 {
10545 Debug.Log("1:" + feat.Name + "/" + feat.Value);
10546 }
10547 if (feat != null && feat.Value != 0)
10548 {
10549 feat.Apply(feat.Value, elements);
10550 }
10552 {
10553 Refresh();
10555 }
10556 if (!msg)
10557 {
10558 return;
10559 }
10560 if (feat != null)
10561 {
10562 if (feat.source.textInc.IsEmpty())
10563 {
10564 PlaySound("ding_skill");
10566 Say("gainFeat", this, feat.FullName);
10567 }
10568 else
10569 {
10570 bool flag = value < num;
10571 if (feat.source.tag.Contains("neg"))
10572 {
10573 flag = !flag;
10574 }
10575 switch (id)
10576 {
10577 case 1270:
10578 if (!flag)
10579 {
10580 PlaySound("chime_angel");
10581 }
10582 break;
10583 case 1271:
10584 if (!flag)
10585 {
10586 PlaySound("chime_devil");
10587 }
10588 break;
10589 default:
10590 PlaySound("mutation");
10591 break;
10592 }
10594 Say((value > num) ? feat.source.GetText("textInc") : feat.source.GetText("textDec"), this, feat.FullName);
10595 }
10596 }
10598 }
Color Negative
Definition: MsgColors.cs:15
Color Ding
Definition: MsgColors.cs:11

References Feat.Apply(), Msg.colors, EClass.core, Debug, MsgColors.Ding, SourceManager.elements, Feat.FullName, Core.IsGameStarted, Feat.Name, MsgColors.Negative, Msg.SetColor(), Element.source, EClass.sources, 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(), ActEffect.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 hostility = (base.c_originalHostility = h);
1508 this.hostility = hostility;
1509 return this;
1510 }

References hostility.

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

◆ SetMainElement() [1/2]

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

Definition at line 2280 of file Chara.cs.

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

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

2272 {
2273 if (!id.StartsWith("ele"))
2274 {
2275 id = "ele" + id;
2276 }
2277 SetMainElement(EClass.sources.elements.alias[id].id, v, elemental);
2278 }

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

10601 {
10602 SourceElement.Row row = EClass.sources.elements.map[idEle];
10604 Element element = elements.GetElement(idEle);
10605 Element element2 = elements.GetElement(row2.id);
10606 int num = element?.Value ?? 0;
10607 if (a < 0)
10608 {
10609 a = 0;
10610 }
10611 if (a > row.max)
10612 {
10613 a = row.max;
10614 }
10615 bool flag = (row.tag.Contains("neg") ? (a > num) : (a < num));
10616 if (a == 0 && (element == null || element.Value == 0))
10617 {
10619 return;
10620 }
10621 if (element != null && element.Value == a)
10622 {
10624 return;
10625 }
10626 if (element2 != null && element2.Value > 0)
10627 {
10628 SetFeat(element2.id, 0);
10629 }
10630 SetFeat(idEle, a);
10631 PlaySound("mutation");
10632 PlayEffect("mutation");
10634 Say(row.GetText(flag ? "textDec" : "textInc", returnNull: true) ?? row.alias, this);
10635 }

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

9449 {
9450 return SetAI(_NoGoalPC);
9451 }
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 7068 of file Chara.cs.

7069 {
7070 if (IsPCC)
7071 {
7072 PCC.Get(pccData).Build(state);
7073 }
7074 }

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

7136 {
7137 p.mat = base.material;
7138 p.matColor = base.colorInt;
7139 if (!renderer.usePass)
7140 {
7141 return;
7142 }
7143 if (renderer.replacer != null)
7144 {
7145 p.tile = renderer.replacer.tile * ((!flipX) ? 1 : (-1));
7146 if (renderer.replacer.mat != -1)
7147 {
7148 p.mat = EClass.sources.materials.rows.TryGet(renderer.replacer.mat, 0);
7149 p.matColor = BaseTileMap.GetColorInt(ref p.mat.matColor, 100);
7150 p.color -= 1048576f;
7151 }
7152 }
7153 else if (source._tiles_snow.Length != 0 && EClass._zone.IsSnowCovered)
7154 {
7155 if (source._tiles_snow.Length > 1)
7156 {
7157 int num = ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % source._tiles_snow.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
7158 if (num < 0)
7159 {
7160 num = 0;
7161 }
7162 p.tile = source._tiles_snow[(num < source._tiles_snow.Length) ? num : 0] * ((!flipX) ? 1 : (-1));
7163 }
7164 else
7165 {
7166 p.tile = source._tiles_snow[0] * ((!flipX) ? 1 : (-1));
7167 }
7168 }
7169 else if (sourceCard._tiles.Length > 1)
7170 {
7171 int num2 = ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % sourceCard._tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
7172 if (num2 < 0)
7173 {
7174 num2 = 0;
7175 }
7176 p.tile = sourceCard._tiles[(num2 >= 0 && num2 < sourceCard._tiles.Length) ? num2 : 0] * ((!flipX) ? 1 : (-1));
7177 }
7178 else
7179 {
7180 p.tile = sourceCard._tiles[0] * ((!flipX) ? 1 : (-1));
7181 }
7182 p.dir = base.dir;
7183 }
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 7731 of file Chara.cs.

7732 {
7733 switch (m)
7734 {
7735 case UIList.SortMode.ByJob:
7736 sortVal = job._index * 10000 + sourceCard._index;
7737 break;
7738 case UIList.SortMode.ByRace:
7739 sortVal = race._index * 10000 * ((!IsHuman) ? 1 : (-1)) + sourceCard._index;
7740 break;
7741 case UIList.SortMode.ByFeat:
7742 sortVal = -GetTotalFeat();
7743 break;
7744 case UIList.SortMode.ByPartyOrder:
7745 sortVal = EClass.pc.party.members.IndexOf(this);
7746 return;
7747 default:
7748 sortVal = sourceCard._index * ((!IsHuman) ? 1 : (-1));
7749 break;
7750 case UIList.SortMode.ByWorkk:
7751 break;
7752 }
7753 if (base.isFav)
7754 {
7755 sortVal -= 100000000;
7756 }
7757 }
int sortVal
Definition: Card.cs:104
int GetTotalFeat()
Definition: Chara.cs:8619
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 2259 of file Chara.cs.

2260 {
2261 source = EClass.sources.charas.map.TryGetValue(id);
2262 if (source == null)
2263 {
2264 Debug.LogWarning("Chara " + id + " not found");
2265 id = "chicken";
2266 source = EClass.sources.charas.map[id];
2267 }
2268 path.walker = this;
2269 }

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

Referenced by Refresh().

◆ SetSummon()

void Chara.SetSummon ( int  duration)
inline

Definition at line 2612 of file Chara.cs.

2613 {
2614 base.c_summonDuration = duration;
2615 base.isSummon = true;
2616 }

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

8078 {
8079 if (t.IsRangedWeapon && t.category.slot == 0)
8080 {
8081 if (!CanEquipRanged(t))
8082 {
8083 return false;
8084 }
8085 int num = 0;
8086 foreach (Thing thing in things)
8087 {
8088 if (thing.IsRangedWeapon)
8089 {
8090 if (thing.category.slot != 0 && thing.isEquipped)
8091 {
8092 return false;
8093 }
8094 if (CanEquipRanged(thing) && thing.GetEquipValue() > num)
8095 {
8096 num = thing.GetEquipValue();
8097 }
8098 }
8099 }
8100 if (t.GetEquipValue() > num)
8101 {
8102 return true;
8103 }
8104 return false;
8105 }
8106 BodySlot bodySlot = body.GetSlot(t);
8107 if (bodySlot == null)
8108 {
8109 return false;
8110 }
8111 if (useFav)
8112 {
8113 switch (GetFavAttackStyle())
8114 {
8115 case AttackStyle.Default:
8116 case AttackStyle.TwoHand:
8117 if (t.IsMeleeWeapon)
8118 {
8119 bodySlot = body.slotMainHand;
8120 }
8121 else if (bodySlot.elementId == 35)
8122 {
8123 return false;
8124 }
8125 break;
8126 case AttackStyle.Shield:
8127 if (t.IsMeleeWeapon)
8128 {
8129 bodySlot = body.slotMainHand;
8130 }
8131 else if (bodySlot.elementId == 35 && t.IsMeleeWeapon)
8132 {
8133 return false;
8134 }
8135 break;
8136 case AttackStyle.TwoWield:
8137 if (bodySlot.elementId == 35 && !t.IsMeleeWeapon)
8138 {
8139 return false;
8140 }
8141 break;
8142 }
8143 }
8144 if (!body.IsEquippable(t, bodySlot, text: false))
8145 {
8146 return false;
8147 }
8148 if (bodySlot.thing != null && (bodySlot.thing.blessedState <= BlessedState.Cursed || bodySlot.thing.GetEquipValue() >= t.GetEquipValue()))
8149 {
8150 return false;
8151 }
8152 if (!base.IsPCFactionOrMinion)
8153 {
8154 int num2 = 0;
8155 foreach (Element value in t.elements.dict.Values)
8156 {
8157 if (value.Value <= 0)
8158 {
8159 int num3 = 100;
8160 switch (value.id)
8161 {
8162 case 418:
8163 num3 = 10;
8164 break;
8165 case 60:
8166 case 61:
8167 case 62:
8168 num3 = 200;
8169 break;
8170 case 962:
8171 num3 = 10000;
8172 break;
8173 }
8174 num2 += value.Value * num3 / 100;
8175 }
8176 }
8177 if (num2 < -40)
8178 {
8179 return false;
8180 }
8181 }
8182 if (t.HasTag(CTAG.gift) && t.c_uidAttune != base.uid)
8183 {
8184 return false;
8185 }
8186 return true;
8187 }
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:114
AttackStyle GetFavAttackStyle()
Definition: Chara.cs:4922

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

8992 {
8993 if (IsPCFaction)
8994 {
8995 if (t.IsFood && t.category.id != "fish" && !t.IsDecayed)
8996 {
8997 return false;
8998 }
8999 if (t.trait.GetHealAction(this) != null)
9000 {
9001 return false;
9002 }
9003 if (t.IsThrownWeapon || t.IsRangedWeapon || t.IsAmmo)
9004 {
9005 return false;
9006 }
9007 if (t.trait is TraitBlanket || t.trait is TraitItemProc || t.trait is TraitBookSkill)
9008 {
9009 return false;
9010 }
9011 }
9012 if (t.isEquipped || t.rarity >= Rarity.Legendary || !t.trait.CanBeDestroyed || t.c_isImportant)
9013 {
9014 return false;
9015 }
9016 if (t.trait is TraitCurrency || t.trait is TraitTool)
9017 {
9018 return false;
9019 }
9020 switch (type)
9021 {
9022 case ClearInventoryType.SellAtTown:
9023 if (!t.isGifted && !t.isNPCProperty)
9024 {
9025 return false;
9026 }
9027 break;
9028 case ClearInventoryType.Purge:
9029 switch (t.category.id)
9030 {
9031 case "fish":
9032 if (EClass.rnd(3) == 0)
9033 {
9034 return true;
9035 }
9036 break;
9037 case "junk":
9038 case "garbage":
9039 if (EClass.rnd(3) != 0)
9040 {
9041 return true;
9042 }
9043 break;
9044 }
9045 if (t.id == "flyer")
9046 {
9047 return true;
9048 }
9049 if (!t.IsDecayed && EClass.rnd(3) == 0)
9050 {
9051 return false;
9052 }
9053 if (!things.IsFull() && t.IsRangedWeapon)
9054 {
9055 return false;
9056 }
9057 break;
9058 }
9059 return true;
9060 }
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:637

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

7473 {
7474 Zone_Nymelle zone_Nymelle = EClass._zone as Zone_Nymelle;
7475 if (conSuspend != null && IsPCParty)
7476 {
7477 RemoveCondition<ConSuspend>();
7478 }
7479 if (LayerDrama.forceJump == null)
7480 {
7481 if (IsDeadOrSleeping)
7482 {
7483 ShowDialog("_chara", "sleep");
7484 return;
7485 }
7486 if (EClass.pc.isHidden && !CanSee(EClass.pc))
7487 {
7488 ShowDialog("_chara", "invisible");
7489 return;
7490 }
7492 {
7494 ShowDialog("_chara", "give_card");
7495 Thing thing = ThingGen.Create("figure");
7496 thing.MakeFigureFrom(id);
7497 EClass.player.DropReward(thing);
7498 thing = ThingGen.Create("figure3");
7499 thing.MakeFigureFrom(id);
7500 EClass.player.DropReward(thing);
7501 return;
7502 }
7503 if (GetInt(71) == -2)
7504 {
7505 ShowDialog("_chara", "give_lunch");
7506 Thing t = CraftUtil.MakeLoveLunch(this);
7508 SetInt(71, EClass.world.date.GetRaw() + 43200);
7509 return;
7510 }
7511 if (base.isRestrained)
7512 {
7513 ShowDialog("_chara", "strain");
7514 return;
7515 }
7516 if (IsEscorted())
7517 {
7518 ShowDialog("_chara", "escort");
7519 return;
7520 }
7522 {
7523 string step = ((!(EClass._zone is Zone_Wedding)) ? "party" : (IsPCParty ? "wedding_love" : ((IsMarried || affinity.IsWeddingHater) ? "wedding_hater" : "wedding")));
7524 if (EClass._zone is Zone_Wedding && IsPCParty && base.c_love != null && !base.c_love.gaveCutter)
7525 {
7526 step = "wedding_cutter";
7527 EClass.player.DropReward(ThingGen.Create("dagger_cakecutter"));
7528 base.c_love.gaveCutter = true;
7529 }
7530 ShowDialog("_chara", step);
7531 return;
7532 }
7533 if (EClass.game.quests.OnShowDialog(this))
7534 {
7535 return;
7536 }
7537 if (id == "nino")
7538 {
7540 }
7541 switch (id)
7542 {
7543 case "loytel":
7544 {
7546 {
7547 EClass.game.quests.Get("pre_debt_runaway").Complete();
7548 EClass.player.flags.loytelEscaped = false;
7549 EClass.game.quests.Add("debt", "loytel");
7550 ShowDialog("loytel", "loytelEscaped");
7551 return;
7552 }
7553 QuestDebt questDebt = EClass.game.quests.Get<QuestDebt>();
7554 if (questDebt != null && questDebt.paid)
7555 {
7556 questDebt.stage++;
7557 if (questDebt.stage > 7)
7558 {
7559 questDebt.stage = 7;
7560 }
7561 ShowDialog("loytel", "debt" + questDebt.stage);
7562 return;
7563 }
7564 break;
7565 }
7566 case "farris":
7567 if (EClass._zone.id == "startVillage" || EClass._zone.id == "startVillage3" || EClass.game.IsSurvival)
7568 {
7569 ShowDialog("farris");
7570 return;
7571 }
7573 {
7574 case -1:
7575 ShowDialog("farris", "nymelle_noQuest");
7576 break;
7577 case 0:
7578 ShowDialog("farris", "nymelle_first");
7579 break;
7580 case 1:
7581 ShowDialog("farris", "home_first");
7582 break;
7583 default:
7584 ShowDialog("farris");
7585 break;
7586 }
7587 return;
7588 case "ashland":
7589 ShowDialog("ashland");
7590 return;
7591 case "fiama":
7592 if (zone_Nymelle != null && zone_Nymelle.IsCrystalLv && EClass.game.quests.GetPhase<QuestExploration>() == 3)
7593 {
7594 SoundManager.ForceBGM();
7595 LayerDrama.ActivateMain("mono", "nymelle_crystal");
7596 }
7598 {
7600 {
7601 EClass.player.flags.fiamaFirstDream = true;
7602 ShowDialog("fiama", "firstDream");
7603 }
7605 {
7606 ShowDialog("fiama", "giveStoryBook").SetOnKill(delegate
7607 {
7608 EClass.player.flags.fiamaStoryBookGiven = true;
7609 EClass.player.DropReward(ThingGen.Create("book_story"));
7610 });
7611 }
7612 else
7613 {
7614 ShowDialog("fiama");
7615 }
7616 }
7617 else
7618 {
7619 ShowDialog("fiama");
7620 }
7621 return;
7622 case "big_sister":
7624 {
7625 ShowDialog("big_sister", "little_saved");
7626 EClass.player.flags.little_saved = false;
7627 return;
7628 }
7630 {
7631 ShowDialog("big_sister", "little_dead");
7632 EClass.player.flags.little_killed = false;
7633 return;
7634 }
7635 break;
7636 }
7637 if (trait is TraitGuildDoorman)
7638 {
7639 string tag = ((trait is TraitDoorman_Fighter) ? "fighter" : ((trait is TraitDoorman_Mage) ? "mage" : "thief"));
7640 ShowDialog("guild_doorman", "main", tag);
7641 return;
7642 }
7643 if (trait is TraitGuildClerk)
7644 {
7645 string tag2 = ((trait is TraitClerk_Fighter) ? "fighter" : ((trait is TraitClerk_Mage) ? "mage" : "thief"));
7646 ShowDialog("guild_clerk", "main", tag2);
7647 return;
7648 }
7649 }
7650 bool flag = true;
7651 if (id == "parttimer_jure" && (!EClass._zone.IsFestival || !(EClass._zone is Zone_Noyel) || EClass.pc.faith == EClass.game.religions.Healing))
7652 {
7653 flag = false;
7654 }
7655 string book = "_chara";
7656 if (flag)
7657 {
7658 string text = GetStr("drama_override").IsEmpty(id);
7659 if (File.Exists(PackageIterator.GetFiles("Dialog/Drama/" + text + ".xlsx").LastOrDefault()?.FullName ?? (CorePath.DramaData + id + ".xlsx")))
7660 {
7661 book = text;
7662 }
7663 }
7665 }
bool CanGiveCard()
Definition: Affinity.cs:70
bool IsWeddingHater
Definition: Affinity.cs:36
void MakeFigureFrom(string id)
Definition: Card.cs:6018
void ShowDialog()
Definition: Chara.cs:7472
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
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:1185
bool EnableDreamStory
Definition: Player.cs:1343
Thing DropReward(Thing t, bool silent=false)
Definition: Player.cs:2668
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:216

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

7668 {
7669 return _ShowDialog(book, null, step, tag);
7670 }
LayerDrama _ShowDialog(string book, string sheet, string step="main", string tag="")
Definition: Chara.cs:7672

References book.

◆ Slap()

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

Definition at line 6662 of file Chara.cs.

6663 {
6664 if (id == "olderyoungersister")
6665 {
6667 }
6668 PlaySound("whip");
6669 Say("slap", this, c);
6670 c.PlayAnime(AnimeID.Shiver);
6671 c.DamageHP(slapToDeath ? (c.MaxHP * 2) : (5 + EClass.rndHalf(EClass.pc.MaxHP / 3)), 919, 100, AttackSource.Condition);
6672 c.OnInsulted();
6673 if (slapToDeath && c.IsAliveInCurrentZone)
6674 {
6675 c.Die();
6676 }
6677 }
void PlayAnime(AnimeID id, bool force=false)
Definition: Card.cs:6660
void OnInsulted()
Definition: Chara.cs:8691
override void Die(Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None, Chara originalTarget=null)
Definition: Chara.cs:5634

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

10321 {
10322 RemoveCondition<ConAwakening>();
10323 AddCondition(Condition.Create(100, delegate(ConSleep con)
10324 {
10325 con.pcSleep = 15;
10326 con.pcBed = bed;
10327 con.pcPillow = pillow;
10328 con.pickup = pickup;
10329 con.posBed = posBed;
10330 con.posPillow = posPillow;
10331 }), force: true);
10332 }

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

8610 {
8611 Say("abCatSniff", this, c);
8612 AddCondition<ConHOT>(EClass.curve(50 + c.CHA * 5, 400, 100));
8613 c.ShowEmo(Emo.angry);
8614 ShowEmo(Emo.love);
8615 Talk("sniff");
8616 c.Talk(new string[4] { "labor", "disgust", "scold", "callGuards" }.RandomItem());
8617 }

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

4858 {
4859 return held.Split(a);
4860 }

References Card.Split().

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

◆ Stumble()

void Chara.Stumble ( int  mtp = 100)
inline

Definition at line 2023 of file Chara.cs.

2024 {
2025 bool flag = EClass._map.FindThing((Thing t) => t.IsInstalled && t.pos.Equals(EClass.pc.pos) && t.trait is TraitStairsUp) != null;
2026 Say(flag ? "dmgBurdenStairs" : "dmgBurdenFallDown", this);
2027 long num = MaxHP;
2028 if (Evalue(1421) > 0)
2029 {
2030 num = mana.max;
2031 }
2032 long num2 = (num * (base.ChildrenWeight * 100 / WeightLimit) / (flag ? 100 : 200) + 1) * mtp / 100;
2033 if (base.hp <= 0)
2034 {
2035 num2 *= 2;
2036 }
2037 DamageHP(num2, flag ? AttackSource.BurdenStairs : AttackSource.BurdenFallDown);
2038 }
Thing FindThing(Func< Thing, bool > func)
Definition: Map.cs:2669

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

4194 {
4195 if (host != null)
4196 {
4197 host.SyncRide();
4198 }
4199 if (ride != null)
4200 {
4201 SyncRide(ride);
4202 }
4203 if (parasite != null)
4204 {
4206 }
4207 }

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

4210 {
4211 if (!c.pos.Equals(pos))
4212 {
4213 if (!pos.IsValid)
4214 {
4215 Debug.LogError("exception: pos is not valid:" + pos?.ToString() + "/" + this);
4216 pos = new Point();
4217 }
4218 EClass._map.MoveCard(pos, c);
4219 }
4220 }

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

◆ TalkTopic()

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

Definition at line 7395 of file Chara.cs.

7396 {
7397 if (host == null && !IsInActiveZone)
7398 {
7399 return null;
7400 }
7401 if (!isSynced && (host == null || !host.isSynced) && topic != "dead")
7402 {
7403 return null;
7404 }
7405 if (IsPCParty)
7406 {
7407 int num = EClass.pc.party.members.Count - 1;
7408 switch (topic)
7409 {
7410 case "calm":
7411 if (EClass.rnd(num * 5) != 0)
7412 {
7413 return null;
7414 }
7415 break;
7416 case "aggro":
7417 if (EClass.rnd(num * 10) != 0)
7418 {
7419 return null;
7420 }
7421 break;
7422 case "kill":
7423 if (EClass.rnd(num * 3) != 0)
7424 {
7425 return null;
7426 }
7427 break;
7428 case "fov":
7429 return null;
7430 }
7431 }
7432 string topicText = GetTopicText(topic);
7433 if (topicText.IsEmpty())
7434 {
7435 return null;
7436 }
7437 HashSet<string> obj = new HashSet<string>
7438 {
7439 "_bracketTalk".lang(),
7440 "\"",
7441 "“",
7442 "「"
7443 };
7444 bool flag = topicText.StartsWith("*");
7445 bool flag2 = topicText.StartsWith("(");
7446 bool flag3 = obj.Any(topicText.StartsWith);
7447 topicText = ApplyTone(topicText);
7448 topicText = topicText.Replace('~', '*');
7449 Msg.SetColor(flag2 ? Msg.colors.Thinking : (flag3 ? Msg.colors.Talk : Msg.colors.Ono));
7450 Msg.Say(StripTalkSpecialCharacters(topicText.Replace("&", "")));
7451 if (topic == "dead")
7452 {
7453 EClass.ui.popGame.PopText(ApplyNewLine(topicText.StripBrackets()), null, "PopTextDead", default(Color), pos.Position() + EClass.setting.render.tc.textPosDead);
7454 }
7455 else if (flag || flag3 || flag2)
7456 {
7457 (host ?? this).renderer.Say(ApplyNewLine(topicText.StripBrackets()), default(Color), IsPCParty ? 0.6f : 0f);
7458 }
7459 return topicText;
7460 }
void Say(string text, Color c=default(Color), float duration=0f)
string ApplyNewLine(string text)
Definition: Card.cs:7286
string StripTalkSpecialCharacters(string text)
Definition: Card.cs:7267
string ApplyTone(string text, bool stripPun=false)
Definition: Card.cs:7366
string GetTopicText(string topic="calm")
Definition: Chara.cs:7361
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 4222 of file Chara.cs.

4223 {
4224 SyncRide();
4225 combatCount--;
4226 ignoreSPAbsorb = false;
4227 if (IsPC)
4228 {
4229 if (hasMovedThisTurn)
4230 {
4231 pos.Things.ForeachReverse(delegate(Thing t)
4232 {
4234 {
4235 AI_Goto aI_Goto = ai.Current as AI_Goto;
4236 if ((aI_Goto == null && !(ai is GoalManualMove)) || (aI_Goto != null && !aI_Goto.dest.Equals(pos)))
4237 {
4238 return;
4239 }
4240 }
4241 t.trait.OnStepped(this);
4242 });
4243 if (isDead)
4244 {
4245 return;
4246 }
4247 hasMovedThisTurn = false;
4249 {
4250 EClass.player.haltMove = false;
4251 ActionMode.Adv.TryCancelInteraction(sound: false);
4252 EInput.Consume(1);
4253 return;
4254 }
4255 if (EClass._zone.IsRegion)
4256 {
4258 {
4259 foreach (Chara member in EClass.pc.party.members)
4260 {
4261 if (member.hunger.value > 65)
4262 {
4263 member.InstantEat(null, sound: false);
4264 }
4265 }
4266 }
4267 Chara chara = null;
4269 if (cell != null && (cell.zone == null || (cell.zone is Zone_Field && !cell.zone.IsPCFaction)))
4270 {
4271 foreach (Chara chara2 in EClass._map.charas)
4272 {
4273 if (!chara2.IsPCFactionOrMinion && !chara2.IsGlobal && chara2.pos.Equals(EClass.pc.pos))
4274 {
4275 chara = chara2;
4276 break;
4277 }
4278 }
4279 }
4280 if (chara != null)
4281 {
4283 {
4284 EClass.player.safeTravel = 5 + EClass.rnd(5);
4285 }
4286 EClass._zone.RemoveCard(chara);
4287 Msg.Say("encounter");
4288 EClass.player.EnterLocalZone(encounter: true, chara);
4289 }
4290 else if (EClass.player.safeTravel <= 0)
4291 {
4292 if (cell != null && cell.zone == null && !EClass.debug.ignoreEncounter)
4293 {
4295 if (!tileInfo.shore)
4296 {
4297 bool num = EClass.pc.HasCondition<ConWardMonster>();
4298 bool flag = EClass.pc.HasCondition<ConDrawMonster>();
4299 bool flag2 = EClass.game.quests.Get<QuestEscort>() != null;
4300 int num2 = (tileInfo.isRoad ? 22 : 12);
4301 if (flag2)
4302 {
4303 num2 = (tileInfo.isRoad ? 16 : 10);
4304 }
4305 if (num)
4306 {
4307 num2 *= (flag2 ? 2 : 20);
4308 }
4309 if (flag)
4310 {
4311 num2 /= 2;
4312 }
4313 if (EClass.rnd(num2) == 0)
4314 {
4315 Msg.Say("encounter");
4316 if (!flag)
4317 {
4318 EClass.player.safeTravel = 5 + EClass.rnd(5);
4319 }
4320 EClass.player.EnterLocalZone(encounter: true);
4321 }
4322 }
4323 }
4324 }
4325 else
4326 {
4328 }
4329 }
4330 }
4331 EClass.player.pickupDelay = 0f;
4332 if (EClass.player.returnInfo != null)
4333 {
4335 if (EClass.player.returnInfo.turns <= 0)
4336 {
4338 {
4339 EClass.player.returnInfo = null;
4341 }
4342 else
4343 {
4345 {
4346 int uidDest = EClass.player.returnInfo.uidDest;
4347 Zone zone = null;
4348 if (uidDest != 0)
4349 {
4350 zone = EClass.game.spatials.map.TryGetValue(uidDest) as Zone;
4351 }
4352 if (zone == null || zone.destryoed)
4353 {
4354 zone = EClass.world.region;
4355 }
4357 {
4358 Msg.Say("returnFail");
4359 }
4360 else
4361 {
4362 Msg.Say("returnComplete");
4363 EClass.player.uidLastTravelZone = 0;
4365 EClass.player.lastZonePos = null;
4366 }
4367 EClass.player.returnInfo = null;
4368 return;
4369 }
4370 EClass.player.returnInfo = null;
4371 Msg.Say("returnOverweight");
4372 }
4373 }
4374 }
4375 if ((HasNoGoal || !ai.IsRunning) && !WillConsumeTurn())
4376 {
4378 return;
4379 }
4382 {
4383 RecipeUpdater.dirty = true;
4384 }
4386 }
4387 else
4388 {
4389 actTime = EClass.player.baseActTime * Mathf.Max(0.1f, (float)EClass.pc.Speed / (float)Speed);
4390 hasMovedThisTurn = false;
4391 }
4394 {
4395 return;
4396 }
4398 if (host != null && !consumeTurn)
4399 {
4400 if (host.ride == this && ((host.hasMovedThisTurn && IsInCombat) || (enemy != null && turn % 3 != 0)))
4401 {
4402 consumeTurn = true;
4403 }
4404 if (host.parasite == this && enemy != null && EClass.rnd(10) > EClass.rnd(host.Evalue(227) + 10))
4405 {
4406 if (Dist(enemy) < 3 && EClass.rnd(2) == 0)
4407 {
4408 Say("parasite_fail", this, host);
4409 if (EClass.rnd(2) == 0 && GetInt(106) == 0)
4410 {
4411 Talk("parasite_fail");
4412 }
4413 }
4414 consumeTurn = true;
4415 }
4416 }
4417 if (consumeTurn)
4418 {
4419 if (IsPC)
4420 {
4422 }
4423 }
4424 else
4425 {
4426 if (base.isRestrained)
4427 {
4428 TryUnrestrain();
4429 }
4430 if (enemy != null)
4431 {
4433 {
4434 enemy = null;
4435 }
4436 else if (!IsPC && (ai.CancelOnAggro || !ai.IsRunning))
4437 {
4438 SetAIAggro();
4439 }
4440 }
4441 if (HasNoGoal || !ai.IsRunning)
4442 {
4443 ChooseNewGoal();
4444 }
4445 ai.Tick();
4446 }
4447 Cell cell2 = base.Cell;
4448 if (EClass._zone.IsUnderwater || (cell2.IsTopWaterAndNoSnow && !cell2.isFloating))
4449 {
4450 AddCondition<ConWet>(50);
4451 if (pos.IsHotSpring)
4452 {
4453 hygiene.Mod(2);
4454 }
4455 }
4456 if (cell2.sourceSurface.id == 20)
4457 {
4458 AddCondition<ConBurning>();
4459 }
4460 if (IsPC && !EClass._zone.IsRegion && cell2.CanSuffocate() && !EClass.debug.godMode && !HasElement(1252))
4461 {
4462 AddCondition<ConSuffocation>(800 / (100 + EvalueMax(200, -5) * 10), force: true);
4463 }
4464 CellEffect e;
4465 if (cell2.effect != null)
4466 {
4467 e = cell2.effect;
4468 switch (e.id)
4469 {
4470 case 1:
4471 case 2:
4472 case 4:
4473 if (IsLevitating)
4474 {
4475 Say("levitating");
4476 break;
4477 }
4478 AddCondition<ConWet>(50);
4479 ProcEffect();
4480 break;
4481 case 3:
4482 PlaySound("fire_step");
4483 AddCondition<ConBurning>(30);
4484 break;
4485 case 5:
4486 if (!isWet)
4487 {
4488 PlaySound("bubble");
4489 AddCondition<ConWet>(30);
4490 ProcEffect();
4491 }
4492 break;
4493 case 6:
4494 if (hasMovedThisTurn)
4495 {
4496 Say("abMistOfDarkness_step", this);
4497 }
4498 AddCondition<ConDark>(e.power);
4499 break;
4500 }
4501 }
4502 if (IsPC)
4503 {
4504 if (EClass.player.currentHotItem.Thing != null)
4505 {
4507 }
4509 }
4510 void ClearEffect()
4511 {
4512 EClass._map.SetLiquid(cell2.x, cell2.z, 0, 0);
4513 }
4514 void ProcEffect()
4515 {
4516 if (e.idEffect != EffectId.None)
4517 {
4518 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
4519 {
4520 aliasEle = EClass.sources.elements.map[e.idEle].alias,
4521 n1 = e.n1,
4522 refVal = e.refVal
4523 });
4524 ClearEffect();
4525 }
4526 }
4527 }
virtual bool CancelOnAggro
Definition: AIAct.cs:80
bool TryCancelInteraction(bool sound=true)
Definition: AM_Adv.cs:1120
void SetTurbo(int mtp=-1)
Definition: AM_Adv.cs:1091
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:7600
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:114
byte z
Definition: Cell.cs:76
byte x
Definition: Cell.cs:74
void InstantEat(Thing t=null, bool sound=true)
Definition: Chara.cs:8027
int Speed
Definition: Chara.cs:1142
static bool consumeTurn
Definition: Chara.cs:184
void SetAIAggro()
Definition: Chara.cs:9443
bool ignoreSPAbsorb
Definition: Chara.cs:148
void ChooseNewGoal()
Definition: Chara.cs:9324
bool WillConsumeTurn()
Definition: Chara.cs:3899
bool ignoreEncounter
Definition: CoreDebug.cs:217
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:1521
static string SayNothingHappen()
Definition: Msg.cs:96
int turns
Definition: Player.cs:84
bool haltMove
Definition: Player.cs:1244
float baseActTime
Definition: Player.cs:1272
void EnterLocalZone(bool encounter=false, Chara mob=null)
Definition: Player.cs:2044
HotItem currentHotItem
Definition: Player.cs:1170
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:1245
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 3911 of file Chara.cs.

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

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, Player.RecoverStamina(), ride, EClass.rnd(), EClass.rndf(), Msg.Say(), Player.staminaRecovery, Condition.Tick(), BaseCondition.TimeBased, Player.UpdateNyan(), Stats.value, World.weather, and EClass.world.

Referenced by _Move().

◆ TickCooldown()

void Chara.TickCooldown ( )
inline

Definition at line 9305 of file Chara.cs.

9306 {
9307 for (int num = _cooldowns.Count - 1; num >= 0; num--)
9308 {
9309 if (_cooldowns[num] % 1000 == 1)
9310 {
9311 _cooldowns.RemoveAt(num);
9312 }
9313 else
9314 {
9315 _cooldowns[num]--;
9316 }
9317 }
9318 if (_cooldowns.Count == 0)
9319 {
9320 _cooldowns = null;
9321 }
9322 }

◆ TickWork()

void Chara.TickWork ( VirtualDate  date)
inline

Definition at line 9735 of file Chara.cs.

9736 {
9738 if (span != TimeTable.Span.Work && span != TimeTable.Span.Free)
9739 {
9740 return;
9741 }
9742 WorkSummary workSummary = GetWorkSummary();
9743 if (span == TimeTable.Span.Work)
9744 {
9745 if (workSummary.work != null)
9746 {
9747 PerformWork(workSummary.work, isHobby: false, date.IsRealTime);
9748 }
9749 }
9750 else if (workSummary.hobbies.Count > 0)
9751 {
9752 PerformWork(workSummary.hobbies.RandomItem(), isHobby: true, date.IsRealTime);
9753 }
9754 }
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 4641 of file Chara.cs.

4642 {
4643 if (!IsPC || !(t.trait is TraitRod) || t.c_charges <= 0 || !HasElement(1564))
4644 {
4645 return;
4646 }
4647 Say("absorbRod", this, t);
4648 TraitRod rod = t.trait as TraitRod;
4649 bool flag = false;
4650 if (rod.source != null)
4651 {
4652 using IEnumerator<SourceElement.Row> enumerator = EClass.sources.elements.rows.Where((SourceElement.Row a) => a.id == rod.source.id).GetEnumerator();
4653 if (enumerator.MoveNext())
4654 {
4655 SourceElement.Row current = enumerator.Current;
4656 if (IsPC)
4657 {
4658 GainAbility(current.id, t.c_charges * 100, t);
4659 flag = true;
4660 }
4661 }
4662 }
4663 if (!flag)
4664 {
4665 mana.Mod(-50 * t.c_charges);
4666 }
4667 t.c_charges = 0;
4669 }
int c_charges
Definition: Card.cs:1309
void GainAbility(int ele, int mtp=100, Thing origin=null)
Definition: Chara.cs:10736

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

7787 {
7788 if (!IsPCFaction && !IsGuest())
7789 {
7790 return null;
7791 }
7792 foreach (Card item in EClass._map.props.installed.all)
7793 {
7794 if (item.trait is TraitBed traitBed && traitBed.CanAssign(this))
7795 {
7796 traitBed.AddHolder(this);
7797 Msg.Say("claimBed", this);
7798 return traitBed;
7799 }
7800 }
7801 return null;
7802 }
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 9062 of file Chara.cs.

9063 {
9064 if (IsPC)
9065 {
9066 return;
9067 }
9068 if (IsPCParty)
9069 {
9070 if (!things.IsAlmostFull())
9071 {
9072 return;
9073 }
9074 bool flag = EClass._zone.IsTown;
9075 if (!flag && EClass._zone.IsPCFactionOrTent)
9076 {
9077 foreach (Chara chara in EClass._map.charas)
9078 {
9079 if (chara.IsPCFaction && chara.trait.ShopType != ShopType.None)
9080 {
9081 flag = true;
9082 }
9083 }
9084 }
9085 if (flag)
9086 {
9088 }
9089 }
9090 else
9091 {
9093 }
9094 }
ShopType
Definition: ShopType.cs:2
void ClearInventory(ClearInventoryType type)
Definition: Chara.cs:9096
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 5962 of file Chara.cs.

5963 {
5965 {
5966 return;
5967 }
5968 int num = 0;
5969 bool flag = false;
5970 bool flag2 = false;
5971 Point point = pos.GetNearestPoint(allowBlock: true, allowChara: false, allowInstalled: false, ignoreCenter: true) ?? pos;
5972 TreasureType type = TreasureType.BossQuest;
5973 if (EClass._zone.Boss == this)
5974 {
5975 type = TreasureType.BossNefia;
5976 num = 2 + EClass.rnd(2);
5977 flag = (flag2 = true);
5978 EClass._zone.Boss = null;
5979 Msg.Say("boss_win", EClass._zone.Name);
5981 {
5982 Msg.Say("boss_win_void", EClass._zone.Name);
5983 EClass.player.flags.KilledBossInVoid = true;
5984 }
5985 if (EClass._zone.IsNefia)
5986 {
5989 SE.Play("Jingle/fanfare2");
5990 EClass._zone.SetBGM(114, refresh: true, 3f);
5991 }
5994 }
5995 switch (id)
5996 {
5997 case "azzrasizzle":
5998 num = 5;
5999 flag = (flag2 = true);
6000 EClass.Sound.StopBGM(3f);
6001 EClass._zone.SetBGM(1, refresh: false);
6003 {
6004 EClass.game.quests.Get<QuestIntoDarkness>().UpdateOnTalk();
6005 }
6006 break;
6007 case "vernis_boss":
6008 num = 5;
6009 flag = (flag2 = true);
6010 EClass.Sound.StopBGM(3f);
6011 EClass._zone.SetBGM(1, refresh: false);
6013 {
6014 EClass.game.quests.Get<QuestVernis>().UpdateOnTalk();
6015 }
6016 break;
6017 case "lurie_boss":
6018 if (!(EClass._zone is Zone_Exile))
6019 {
6020 num = 5;
6021 flag = (flag2 = true);
6022 EClass._zone.SetBGM(120, refresh: true, 3f);
6024 {
6025 EClass.game.quests.Get<QuestNegotiationDarkness>().ChangePhase(4);
6026 EClass.player.flags.killedDuponne = true;
6027 }
6028 }
6029 break;
6030 case "ungaga_pap":
6031 num = 5;
6032 flag = (flag2 = true);
6034 {
6035 EClass._zone.SetBGM(46, refresh: true, 3f);
6036 }
6037 break;
6038 case "melilith_boss":
6039 num = 5;
6040 flag = (flag2 = true);
6041 EClass.Sound.StopBGM(3f);
6042 EClass._zone.SetBGM(1, refresh: false);
6043 break;
6044 case "doga":
6045 {
6046 QuestCurry questCurry = EClass.game.quests.Get<QuestCurry>();
6047 if (questCurry != null)
6048 {
6049 num = 5;
6050 flag = (flag2 = true);
6051 EClass.Sound.StopBGM(3f);
6052 EClass._zone.SetBGM(1, refresh: false);
6053 questCurry.NextPhase();
6054 }
6055 break;
6056 }
6057 case "fairy_raina":
6058 case "fairy_poina":
6059 {
6060 bool num2 = EClass._map.FindChara((id == "fairy_raina") ? "fairy_poina" : "fairy_raina") == null;
6061 QuestNasu questNasu = EClass.game.quests.Get<QuestNasu>();
6062 if (num2 && questNasu != null && questNasu.phase <= 1)
6063 {
6064 if (questNasu.phase == 0)
6065 {
6066 questNasu.NextPhase();
6067 }
6068 num = 5;
6069 flag = (flag2 = true);
6070 EClass.Sound.StopBGM(3f);
6071 EClass._zone.SetBGM(1, refresh: false);
6072 EClass.player.DropReward(ThingGen.Create("backpack_holding"));
6073 questNasu.NextPhase();
6074 }
6075 break;
6076 }
6077 case "isygarad":
6078 {
6079 num = 5;
6080 flag = (flag2 = true);
6081 QuestExploration questExploration = EClass.game.quests.Get<QuestExploration>();
6082 if (questExploration != null)
6083 {
6084 SE.Play("kill_boss");
6085 questExploration.ChangePhase(3);
6086 EClass.Sound.StopBGM(3f);
6087 EClass._zone.SetBGM(1, refresh: false);
6088 }
6089 break;
6090 }
6091 case "swordkeeper":
6092 num = 10;
6093 flag = true;
6094 SE.Play("kill_boss");
6095 SoundManager.ForceBGM();
6096 LayerDrama.Activate("_event", "event", "swordkeeper_defeat");
6097 break;
6098 }
6099 if (flag)
6100 {
6101 SE.Play("kill_boss");
6102 }
6103 if (num != 0)
6104 {
6106 {
6107 EClass.player.stats.deepest = EClass._zone.DangerLv;
6108 Msg.Say("update_deepest", EClass.player.stats.deepest.ToString() ?? "");
6109 }
6111 {
6112 EClass.player.stats.deepestVoid = -EClass._zone.lv;
6113 Msg.Say("update_deepest_void", EClass.player.stats.deepestVoid.ToString() ?? "");
6114 }
6115 EClass.player.willAutoSave = true;
6116 Thing thing = ThingGen.CreateTreasure("chest_boss", base.LV, type);
6117 point.SetBlock();
6118 point.SetObj();
6119 EClass._zone.AddCard(thing, point).Install();
6120 ThingGen.TryLickChest(thing);
6121 }
6122 if (flag2)
6123 {
6125 }
6126 }
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:2192
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
bool IsStarted(string id)
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:453
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:292
void SetBGM(List< int > ids, bool refresh=true, float fadeDuration=0f)
Definition: Zone.cs:3245
Chara Boss
Definition: Zone.cs:91

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

4863 {
4864 if (held != null && held.trait.CanOnlyCarry)
4865 {
4866 DropHeld();
4867 }
4868 foreach (Thing item in things.List((Thing t) => t.trait.CanOnlyCarry))
4869 {
4870 DropThing(item);
4871 }
4872 }
void DropThing(Thing t, int num=-1)
Definition: Chara.cs:4894

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

◆ TryDuplicate()

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

Definition at line 1933 of file Chara.cs.

1934 {
1935 if (dest == null)
1936 {
1937 dest = pos;
1938 }
1939 dest = dest.GetRandomPoint(2, requireLos: false, allowChara: false, allowBlocked: false, 200);
1940 if (dest == null || dest.Equals(pos) || !dest.IsValid || !CanDuplicate(con))
1941 {
1942 Say("split_fail", this);
1943 return null;
1944 }
1945 Chara chara = Duplicate();
1946 EClass._zone.AddCard(chara, dest);
1947 if (inheritHostility)
1948 {
1949 chara.SetHostility(hostility);
1950 }
1951 Say("split", this);
1952 return chara;
1953 }
bool CanDuplicate(DuplicateCondition con=DuplicateCondition.Default)
Definition: Chara.cs:1897
Chara Duplicate()
Definition: Chara.cs:1955
Chara SetHostility(Hostility h)
Definition: Chara.cs:1505
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(), hostility, Card.pos, Card.Say(), and SetHostility().

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

◆ TryEquip()

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

Definition at line 8189 of file Chara.cs.

8190 {
8191 if (!ShouldEquip(t, useFav))
8192 {
8193 return false;
8194 }
8195 if (t.category.slot == 0)
8196 {
8197 return false;
8198 }
8199 if (useFav)
8200 {
8201 BodySlot slot = body.GetSlot(t);
8202 switch (GetFavAttackStyle())
8203 {
8204 case AttackStyle.Default:
8205 case AttackStyle.TwoHand:
8206 if (t.IsMeleeWeapon)
8207 {
8208 slot = body.slotMainHand;
8209 }
8210 break;
8211 case AttackStyle.Shield:
8212 if (t.IsMeleeWeapon)
8213 {
8214 slot = body.slotMainHand;
8215 }
8216 break;
8217 }
8218 body.Equip(t, slot);
8219 }
8220 else
8221 {
8222 body.Equip(t);
8223 }
8224 Say("equip", this, t);
8225 return true;
8226 }
bool ShouldEquip(Thing t, bool useFav=false)
Definition: Chara.cs:8077

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

8315 {
8316 if (id == "mamani")
8317 {
8319 }
8320 if (IsPC)
8321 {
8323 if (thing?.trait is TraitToolRange && CanEquipRanged(thing))
8324 {
8325 ranged = thing;
8326 return true;
8327 }
8328 return false;
8329 }
8330 if (ranged != null && ranged.parent == this)
8331 {
8332 return true;
8333 }
8335 return ranged != null;
8336 }
Thing GetBestRangedWeapon()
Definition: Chara.cs:8294
Thing GetRandomRangedWeapon()
Definition: Chara.cs:8309

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 string text = "marshmallow_king";
1843 string text2 = "fusion";
1844 if (id == "imotoroid")
1845 {
1846 text = "imotomaton";
1847 text2 = "";
1848 }
1849 Chara chara = EClass._zone.SpawnMob(text, pos);
1850 chara.SetHostility(hostility);
1851 foreach (Chara item in list)
1852 {
1853 if (!text2.IsEmpty())
1854 {
1855 item.Talk(text2);
1856 }
1857 Effect.Get<EffectIRenderer>("throw_fuse").Play(item, item, item.pos, pos);
1858 item.Destroy();
1859 }
1860 Destroy();
1861 chara.PlayAnime(AnimeID.FallSky);
1862 chara.pos.PlaySound("fuse");
1863 chara.pos.PlayEffect("vanish");
1864 return true;
1865 }
List< Chara > ListFussableCharas(int radius=2)
Definition: Chara.cs:1892
Chara SpawnMob(string id, Point pos=null)
Definition: Zone.cs:2971

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

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

◆ TryGetThrowable()

Thing Chara.TryGetThrowable ( )
inline

Definition at line 8233 of file Chara.cs.

8234 {
8235 Thing dest = null;
8236 if (IsPC)
8237 {
8239 {
8240 return FindThrowable(hotbar: true);
8241 }
8242 return null;
8243 }
8244 things.Foreach(delegate(Thing t)
8245 {
8246 if (t.HasTag(CTAG.throwWeapon) || (!base.IsPCFactionOrMinion && t.HasTag(CTAG.throwWeaponEnemy)))
8247 {
8248 dest = t;
8249 }
8250 });
8251 return dest;
8252 Thing FindThrowable(bool hotbar)
8253 {
8254 things.Foreach(delegate(Thing t)
8255 {
8256 if (dest == null)
8257 {
8258 if (t.IsHotItem)
8259 {
8260 if (!hotbar)
8261 {
8262 return;
8263 }
8264 }
8265 else if (hotbar)
8266 {
8267 return;
8268 }
8269 if (t.HasTag(CTAG.throwWeapon))
8270 {
8271 dest = t;
8272 }
8273 }
8274 });
8275 return dest;
8276 }
8277 }

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

4720 {
4721 if (held == t)
4722 {
4723 return true;
4724 }
4725 if (t.isDestroyed || t.Num <= 0)
4726 {
4727 return false;
4728 }
4729 if (!CanPick(t))
4730 {
4731 if (t.parent == null)
4732 {
4733 EClass._zone.AddCard(t, pos);
4734 }
4735 return false;
4736 }
4737 HoldCard(t, num);
4738 return true;
4739 }
bool CanPick(Card c)
Definition: Chara.cs:4539
void HoldCard(Card t, int num=-1)
Definition: Chara.cs:4741

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

8465 {
8466 int num = Evalue(289);
8467 if (num == 0)
8468 {
8469 return false;
8470 }
8471 int lV = t.LV;
8472 if (EClass.rnd(num * num + 5) > EClass.rnd(lV * lV) * 20)
8473 {
8474 t.Identify(show, (num >= 20) ? IDTSource.SkillHigh : IDTSource.Skill);
8475 int num2 = 50;
8476 if (lV > num)
8477 {
8478 num2 += (lV - num) * 10;
8479 }
8480 elements.ModExp(289, Mathf.Min(num2, 1000));
8481 return true;
8482 }
8483 return false;
8484 }
IDTSource
Definition: IDTSource.cs:2
Thing Identify(bool show=true, IDTSource idtSource=IDTSource.Identify)
Definition: Thing.cs:2155

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

2912 {
2913 foreach (Condition condition in conditions)
2914 {
2915 if (!condition.TryMove(newPoint))
2916 {
2917 return MoveResult.Fail;
2918 }
2919 }
2920 if (base.isRestrained)
2921 {
2922 if (!IsPC)
2923 {
2924 return MoveResult.Fail;
2925 }
2926 base.isRestrained = false;
2927 }
2928 if (!CanMoveTo(newPoint, allowDestroyPath))
2929 {
2930 return MoveResult.Fail;
2931 }
2932 return _Move(newPoint);
2933 }
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 2849 of file Chara.cs.

2850 {
2851 if (p.Equals(pos))
2852 {
2853 return MoveResult.Success;
2854 }
2856 {
2857 return MoveResult.Fail;
2858 }
2859 bool flag = true;
2860 Point point = null;
2861 _sharedPos.Set(p);
2862 if (CanDestroyPath())
2863 {
2865 {
2866 return MoveResult.Success;
2867 }
2868 Debug.Log(CanMoveTo(pos));
2870 }
2871 int num = pos.Distance(p);
2872 PathProgress pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Default, num + 4, 1);
2873 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 4)
2874 {
2875 PathFinderNode pathFinderNode = pathProgress.nodes[pathProgress.nodes.Count - 1];
2876 if (TryMove(new Point(pathFinderNode.X, pathFinderNode.Z)) == MoveResult.Success)
2877 {
2878 return MoveResult.Success;
2879 }
2880 }
2881 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Combat, num + 4, 1);
2882 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 4)
2883 {
2884 PathFinderNode pathFinderNode2 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2885 if (TryMove(new Point(pathFinderNode2.X, pathFinderNode2.Z)) == MoveResult.Success)
2886 {
2887 return MoveResult.Success;
2888 }
2889 }
2890 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Default, num + 25, 2);
2891 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 25)
2892 {
2893 PathFinderNode pathFinderNode3 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2894 if (TryMove(new Point(pathFinderNode3.X, pathFinderNode3.Z)) == MoveResult.Success)
2895 {
2896 return MoveResult.Success;
2897 }
2898 }
2899 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Combat, num + 25, 2);
2900 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 25)
2901 {
2902 PathFinderNode pathFinderNode4 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2903 if (TryMove(new Point(pathFinderNode4.X, pathFinderNode4.Z)) == MoveResult.Success)
2904 {
2905 return MoveResult.Success;
2906 }
2907 }
2908 return MoveResult.Fail;
2909 }
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:2679
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 10251 of file Chara.cs.

10252 {
10253 if (TC == null || TC.HasCondition<ConInvulnerable>() || TC.Evalue(1421) > 0 || !TC.ExistsOnMap)
10254 {
10255 return false;
10256 }
10257 if (TC.hp > (long)TC.MaxHP * (long)(Mathf.Min(5 + (int)Mathf.Sqrt(power), harvest ? 35 : 25) + Evalue(1426) * 5) / (TC.IsPowerful ? 200 : 100))
10258 {
10259 return false;
10260 }
10261 if (TC.HasElement(427))
10262 {
10263 return false;
10264 }
10265 if (TC.IsPC && EClass.player.invlunerable)
10266 {
10267 return false;
10268 }
10269 PlaySound("hit_finish");
10270 Say("finish");
10271 Say("finish2", this, TC);
10272 TC.DamageHP(TC.MaxHP, AttackSource.Finish, this);
10273 return false;
10274 }
@ harvest
bool invlunerable
Definition: Player.cs:1246
Definition: TC.cs:4

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

Referenced by ActEffect.Proc().

◆ TryNullifyCurse()

bool Chara.TryNullifyCurse ( )
inline

Definition at line 10760 of file Chara.cs.

10761 {
10762 if (IsPCParty)
10763 {
10764 foreach (Chara member in EClass.pc.party.members)
10765 {
10766 if (member.HasElement(1641) && EClass.rnd(3) != 0)
10767 {
10768 Msg.Say("curse_nullify", member);
10769 return true;
10770 }
10771 }
10772 }
10773 else if (HasElement(1641) && EClass.rnd(3) != 0)
10774 {
10775 Say("curse_nullify", this);
10776 return true;
10777 }
10778 if (GetCondition<ConHolyVeil>() != null && EClass.rnd(5) != 0)
10779 {
10780 Say("curse_nullify", this);
10781 return true;
10782 }
10783 return false;
10784 }

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

4696 {
4697 foreach (Card item in pos.ListCards())
4698 {
4699 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)))
4700 {
4701 Thing thing = Pick(item.Thing);
4702 if (thing != null && !IsPC)
4703 {
4704 thing.isNPCProperty = true;
4705 }
4706 break;
4707 }
4708 }
4709 }

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

Referenced by AI_Fish.Run().

◆ TryPoisonPotion()

Thing Chara.TryPoisonPotion ( Thing  t)
inline

Definition at line 4627 of file Chara.cs.

4628 {
4629 if (t.trait is TraitPotion && t.id != "1165" && !t.source.tag.Contains("neg") && EClass.rnd(2) == 0 && HasElement(1565))
4630 {
4631 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)
4632 .id;
4633 Say("poisonDrip", this);
4634 int num = t.Num;
4635 t.Destroy();
4636 t = ThingGen.Create(text).SetNum(num);
4637 }
4638 return t;
4639 }
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 3445 of file Chara.cs.

3446 {
3447 List<Chara> list = point.ListCharas();
3448 if (list.Count == 0)
3449 {
3450 return;
3451 }
3452 list.Copy().ForeachReverse(delegate(Chara c)
3453 {
3454 if ((trait is TraitSnitch && c.IsPCFactionOrMinion) || (!c.ai.IsMoveAI && !c.IsPC && c.trait.CanBePushed && c != this && !c.noMove && (!EClass._zone.IsRegion || c.IsPCFactionOrMinion)))
3455 {
3456 List<Point> list2 = new List<Point>();
3457 for (int i = point.x - 1; i <= point.x + 1; i++)
3458 {
3459 for (int j = point.z - 1; j <= point.z + 1; j++)
3460 {
3461 if (i != point.x || j != point.z)
3462 {
3463 Point point2 = new Point(i, j);
3464 if (point2.IsValid && !point2.HasChara && !point2.IsBlocked && !point2.cell.hasDoor && !point2.IsBlockByHeight(point))
3465 {
3466 list2.Add(point2);
3467 }
3468 }
3469 }
3470 }
3471 if (list2.Count > 0)
3472 {
3473 if (list2.Count > 1)
3474 {
3475 list2.ForeachReverse(delegate(Point p)
3476 {
3477 if (p.Equals(new Point(point.x + point.x - pos.x, point.z + point.z - pos.z)))
3478 {
3479 list2.Remove(p);
3480 }
3481 });
3482 }
3483 Point newPoint = list2.RandomItem();
3484 if (IsPC)
3485 {
3486 Say("displace", this, c);
3487 PlaySound("push");
3488 }
3489 else if (c.isSynced)
3490 {
3491 c.PlayEffect("push");
3492 }
3493 c.MoveByForce(newPoint, this, checkWall: true);
3494 if (!c.IsPC && c.trait is TraitRogue && EClass.rnd(3) == 0 && GetCurrency() > 20 && !HasElement(426))
3495 {
3496 int num = EClass.rndHalf(10 + Mathf.Min(GetCurrency() / 100, 1000));
3497 c.Talk("pushed");
3498 Say("pushed_money", this, c);
3499 ModCurrency(-num);
3500 c.ModCurrency(num);
3501 c.PlaySound("steal_money");
3502 }
3503 else if (IsPC && !c.IsPCParty && !c.IsUnique && c.IsHumanSpeak && EClass.rnd(5) == 0)
3504 {
3505 c.Talk("pushed");
3506 }
3507 }
3508 }
3509 });
3510 }
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 4711 of file Chara.cs.

4712 {
4713 if (!EClass._zone.TryAddThingInSharedContainer(t, containers) && dropIfFail)
4714 {
4715 EClass._zone.AddCard(t, pos);
4716 }
4717 }
bool TryAddThingInSharedContainer(Thing t, List< Thing > containers=null, bool add=true, bool msg=false, Chara chara=null, bool sharedOnly=true)
Definition: Zone.cs:2299

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

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

7805 {
7806 if (GetInt(113) != 0)
7807 {
7808 return;
7809 }
7810 _ListItems.Clear();
7811 Thing bestRangedWeapon = GetBestRangedWeapon();
7812 foreach (Thing thing in things)
7813 {
7814 if (!thing.IsAmmo && !thing.c_isImportant)
7815 {
7816 if (thing.category.slot != 0 && !thing.isEquipped && !thing.HasTag(CTAG.gift))
7817 {
7818 _ListItems.Add(thing);
7819 }
7820 else if (thing.IsRangedWeapon && thing.category.slot == 0 && bestRangedWeapon != thing)
7821 {
7822 _ListItems.Add(thing);
7823 }
7824 }
7825 }
7826 if (_ListItems.Count == 0)
7827 {
7828 return;
7829 }
7830 List<Thing> containers2 = containers.ToList();
7831 foreach (Thing listItem in _ListItems)
7832 {
7833 EClass._zone.TryAddThingInSharedContainer(listItem, containers2, add: true, msg: true, this);
7834 }
7835 }
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 4671 of file Chara.cs.

4672 {
4673 if (t.id == "axe")
4674 {
4675 Tutorial.Reserve("tool");
4676 }
4677 if (t.category.id == "mushroom")
4678 {
4679 Tutorial.Reserve("food");
4680 }
4681 if (t.category.id == "herb")
4682 {
4683 Tutorial.Reserve("herb");
4684 }
4685 if (t.id == "pasture")
4686 {
4687 Tutorial.Reserve("pasture");
4688 }
4689 if (t.id == "log")
4690 {
4691 Tutorial.Reserve("process");
4692 }
4693 }

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

◆ TryRestock()

void Chara.TryRestock ( bool  onCreate)
inline

Definition at line 4956 of file Chara.cs.

4957 {
4958 isOnCreate = onCreate;
4959 if (onCreate || (!IsPCFaction && (base.IsUnique || trait is TraitAdventurer || trait is TraitGuard)))
4960 {
4961 RestockEquip((!EClass.core.IsGameStarted || !(EClass._zone is Zone_Music)) && onCreate);
4962 }
4963 RestockInventory(onCreate);
4964 }
void RestockInventory(bool onCreate)
Definition: Chara.cs:5314
void RestockEquip(bool onCreate)
Definition: Chara.cs:4966

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

6697 {
6698 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))
6699 {
6700 SetEnemy(c);
6701 }
6702 }

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

7843 {
7845 }
void TryTakeSharedItems(bool msg=true)
Definition: Chara.cs:7842

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

7848 {
7849 if (base.isSummon || (memberType == FactionMemberType.Livestock && homeBranch != null && !homeBranch.policies.IsActive(2715)))
7850 {
7851 return;
7852 }
7853 int num = 2;
7854 int num2 = 1;
7855 int num3 = 2;
7856 bool flag = GetInt(113) == 0;
7857 int num4 = 2;
7858 int num5 = 2;
7859 int num6 = 2;
7861 {
7862 num5 = 0;
7863 num6 = 0;
7864 }
7865 foreach (Thing thing3 in things)
7866 {
7867 if (CanEat(thing3, shouldEat))
7868 {
7869 if (thing3.HasElement(757))
7870 {
7871 num2 -= thing3.Num;
7872 num -= thing3.Num;
7873 }
7874 else
7875 {
7876 num -= thing3.Num;
7877 }
7878 }
7879 if (thing3.trait.GetHealAction(this) != null)
7880 {
7881 num3 -= thing3.Num;
7882 }
7883 if (thing3.id == "polish_powder")
7884 {
7885 num4 -= thing3.Num;
7886 }
7887 if (thing3.trait is TraitBlanketColdproof)
7888 {
7889 num5 -= thing3.Num;
7890 }
7891 if (thing3.trait is TraitBlanketFireproof)
7892 {
7893 num6 -= thing3.Num;
7894 }
7895 }
7896 _ListItems.Clear();
7897 foreach (Thing container in containers)
7898 {
7899 if (!container.IsSharedContainer)
7900 {
7901 continue;
7902 }
7903 foreach (Thing thing4 in container.things)
7904 {
7905 if (!thing4.c_isImportant && thing4.IsIdentified && thing4 != EClass.pc.held)
7906 {
7907 if (num4 > 0 && thing4.id == "polish_powder")
7908 {
7909 _ListItems.Add(thing4);
7910 num4 -= thing4.Num;
7911 }
7912 else if (num5 > 0 && !HasElement(1236) && thing4.trait is TraitBlanketColdproof)
7913 {
7914 _ListItems.Add(thing4);
7915 num5 -= thing4.Num;
7916 }
7917 else if (num6 > 0 && thing4.trait is TraitBlanketFireproof)
7918 {
7919 _ListItems.Add(thing4);
7920 num6 -= thing4.Num;
7921 }
7922 else if (num2 > 0 && CanEat(thing4, shouldEat) && !thing4.c_isImportant && thing4.HasElement(757))
7923 {
7924 _ListItems.Add(thing4);
7925 num2 -= thing4.Num;
7926 }
7927 else if (num > 0 && CanEat(thing4, shouldEat) && !thing4.c_isImportant)
7928 {
7929 _ListItems.Add(thing4);
7930 num -= thing4.Num;
7931 }
7932 else if (num3 > 0 && thing4.trait.GetHealAction(this) != null)
7933 {
7934 _ListItems.Add(thing4);
7935 num3 -= thing4.Num;
7936 }
7937 else if (flag && thing4.IsEquipmentOrRanged && !thing4.HasTag(CTAG.gift) && ShouldEquip(thing4, useFav: true))
7938 {
7939 _ListItems.Add(thing4);
7940 }
7941 }
7942 }
7943 }
7944 if (_ListItems.Count == 0)
7945 {
7946 return;
7947 }
7948 _ListItems.ForeachReverse(delegate(Thing t)
7949 {
7950 if (t.IsEquipmentOrRanged)
7951 {
7952 bool flag3 = false;
7953 int slot = t.category.slot;
7954 int equipValue = t.GetEquipValue();
7955 foreach (Thing listItem in _ListItems)
7956 {
7957 if (listItem.category.slot == slot && listItem.GetEquipValue() > equipValue)
7958 {
7959 flag3 = true;
7960 break;
7961 }
7962 }
7963 if (flag3)
7964 {
7965 _ListItems.Remove(t);
7966 }
7967 }
7968 });
7969 bool flag2 = false;
7970 foreach (Thing listItem2 in _ListItems)
7971 {
7972 Thing thing = listItem2;
7973 if (things.IsFull(thing))
7974 {
7975 break;
7976 }
7977 Thing thing2 = listItem2.parent as Thing;
7978 if (thing.HasElement(757))
7979 {
7980 if (thing.Num > 1)
7981 {
7982 thing = thing.Split(1);
7983 }
7984 }
7985 else if (thing.Num > 2)
7986 {
7987 thing = thing.Split(2);
7988 }
7989 if (msg)
7990 {
7991 Say("takeSharedItem", this, thing, thing2.GetName(NameStyle.Full));
7992 }
7993 AddCard(thing);
7994 if (ShouldEquip(thing, useFav: true) && thing.category.slot != 0)
7995 {
7996 TryEquip(thing, useFav: true);
7997 flag2 = true;
7998 }
7999 }
8000 if (flag2 && flag)
8001 {
8002 TryPutSharedItems(containers);
8003 }
8004 }
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 9124 of file Chara.cs.

9125 {
9126 if (!EClass.debug.enable || IsPC || !IsGlobal || !IsPCFaction)
9127 {
9128 return;
9129 }
9130 for (int i = 0; i < 100; i++)
9131 {
9132 if (base.feat == 0)
9133 {
9134 break;
9135 }
9136 if (base.c_upgrades == null)
9137 {
9138 base.c_upgrades = new CharaUpgrade();
9139 }
9140 if (base.c_upgrades.halt)
9141 {
9142 break;
9143 }
9144 Rand.SetSeed(base.uid + base.c_upgrades.count);
9145 int num = EClass.rnd(100);
9146 int num2 = 0;
9147 int num3 = 1;
9148 int num4 = 0;
9149 bool flag = false;
9150 IEnumerable<SourceElement.Row> ie = EClass.sources.elements.rows.Where((SourceElement.Row a) => !elements.Has(a) && a.category == "skill" && !a.tag.Contains("noPet"));
9151 List<Element> list = ListAvailabeFeats(pet: true);
9152 if (num >= 90 && list.Count > 0)
9153 {
9154 Element element = list.RandomItem();
9155 num2 = element.id;
9156 num4 = element.CostLearn;
9157 }
9158 else if (num >= 60 && ie.Any())
9159 {
9160 num2 = ie.RandomItem().id;
9161 num4 = 3;
9162 }
9163 else
9164 {
9165 num2 = Element.List_MainAttributesMajor.RandomItem();
9166 num4 = 1;
9167 num3 = 2;
9168 flag = true;
9169 }
9170 Rand.SetSeed();
9171 if (num4 > base.feat)
9172 {
9173 break;
9174 }
9175 base.feat -= num4;
9176 base.c_upgrades.count++;
9177 base.c_upgrades.spent += num4;
9178 bool flag2 = false;
9179 if (flag)
9180 {
9181 foreach (CharaUpgrade.Item item in base.c_upgrades.items)
9182 {
9183 if (item.idEle == num2)
9184 {
9185 item.value += num3;
9186 item.cost += num4;
9187 flag2 = true;
9188 break;
9189 }
9190 }
9191 }
9192 if (!flag2)
9193 {
9194 base.c_upgrades.items.Add(new CharaUpgrade.Item
9195 {
9196 idEle = num2,
9197 value = num3,
9198 cost = num4
9199 });
9200 }
9201 SourceElement.Row row = EClass.sources.elements.map[num2];
9202 if (row.category == "feat")
9203 {
9204 SetFeat(num2, elements.ValueWithoutLink(num2) + 1, msg: true);
9205 }
9206 else if (elements.ValueWithoutLink(row.id) == 0)
9207 {
9208 elements.Learn(row.id);
9209 }
9210 else
9211 {
9212 elements.ModBase(num2, num3);
9213 }
9214 }
9215 }
List< Element > ListAvailabeFeats(bool pet=false, bool showAll=false, bool purchaseFeat=false)
Definition: Chara.cs:10498
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 8347 of file Chara.cs.

8348 {
8349 if (t.id == "338" && t.blessedState >= BlessedState.Normal)
8350 {
8351 Thing thing = things.Find((Thing a) => a.IsEquipmentOrRanged && !a.isAcidproof);
8352 if (thing != null)
8353 {
8354 Say("dip", this, thing, t.GetName(NameStyle.Full, 1));
8355 SE.Change();
8356 t.trait.OnBlend(thing, this);
8357 return true;
8358 }
8359 return false;
8360 }
8361 if (t.IsNegativeGift || t.source.HasTag(CTAG.ignoreUse))
8362 {
8363 return false;
8364 }
8365 if (t.id == "cigar")
8366 {
8367 (t.trait as TraitItemProc).OnUse(this);
8368 return true;
8369 }
8370 if (t.trait.CanDrink(this))
8371 {
8372 Drink(t);
8373 return true;
8374 }
8375 if (t.trait.CanEat(this) && hunger.GetPhase() > ((IsPCFaction || IsPCFactionMinion) ? 2 : 0))
8376 {
8378 {
8379 target = t
8380 });
8381 return true;
8382 }
8383 if (t.trait.CanRead(this))
8384 {
8386 {
8387 target = t
8388 });
8389 return true;
8390 }
8391 if (base.hp < MaxHP * 90 / 100)
8392 {
8393 Action healAction = t.trait.GetHealAction(this);
8394 if (healAction != null)
8395 {
8396 healAction();
8397 return true;
8398 }
8399 }
8400 return false;
8401 }
bool isAcidproof
Definition: Card.cs:689
void SetAIImmediate(AIAct g)
Definition: Chara.cs:9485
virtual bool CanRead(Chara c)
Definition: Trait.cs:1164
virtual bool CanDrink(Chara c)
Definition: Trait.cs:1182
virtual void OnBlend(Thing t, Chara c)
Definition: Trait.cs:647

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

9757 {
9758 if (EClass.world.date.IsExpired(GetInt(51)))
9759 {
9760 Expedition expedition = Expedition.Create(this, sourceWork.expedition.ToEnum<ExpeditionType>());
9761 SetInt(51, EClass.world.date.GetRaw() + 60 * (expedition.hours + 24));
9762 homeBranch.expeditions.Add(expedition);
9763 return true;
9764 }
9765 return false;
9766 }
ExpeditionType
void Add(Expedition ex)
static Expedition Create(Chara c, ExpeditionType type)
Definition: Expedition.cs:119
int hours
Definition: Expedition.cs:7
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 2567 of file Chara.cs.

2568 {
2569 base.c_uidMaster = 0;
2570 master = null;
2571 enemy = null;
2572 foreach (Chara chara in EClass._map.charas)
2573 {
2574 if (chara.enemy == this)
2575 {
2576 chara.SetEnemy();
2577 chara.ai.Cancel();
2578 }
2579 }
2580 ai.Cancel();
2581 Refresh();
2582 }

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

3823 {
3824 if (IsPCC)
3825 {
3826 if (base.dir == 0)
3827 {
3828 angle = 225f;
3829 }
3830 else if (base.dir == 1)
3831 {
3832 angle = 135f;
3833 }
3834 else if (base.dir == 2)
3835 {
3836 angle = 45f;
3837 }
3838 else if (base.dir == 3)
3839 {
3840 angle = -45f;
3841 }
3842 }
3843 else if (base.dir == 0)
3844 {
3845 angle = 165f;
3846 }
3847 else if (base.dir == 1)
3848 {
3849 angle = 300f;
3850 }
3851 else if (base.dir == 2)
3852 {
3853 angle = 0f;
3854 }
3855 else if (base.dir == 3)
3856 {
3857 angle = 120f;
3858 }
3859 }

Referenced by OnDeserialized().

◆ UpdateSight()

void Chara.UpdateSight ( )
inline

Definition at line 3883 of file Chara.cs.

3884 {
3885 int num = 4;
3886 for (int i = -num; i < num + 1; i++)
3887 {
3888 for (int j = -num; j < num + 1; j++)
3889 {
3890 shared.Set(pos.x + i, pos.z + j);
3891 if (shared.IsValid && !shared.cell.isSeen && i >= -1 && i <= 1 && j >= -1)
3892 {
3893 _ = 1;
3894 }
3895 }
3896 }
3897 }
bool isSeen
Definition: Cell.cs:302
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 6138 of file Chara.cs.

6139 {
6140 if (HasCooldown(a.id))
6141 {
6142 return false;
6143 }
6144 if (!a.ValidatePerform(this, tc, pos))
6145 {
6146 return false;
6147 }
6148 if (a.source.proc.TryGet(0) == "Heal" && HasElement(1422) && !IsPC)
6149 {
6150 List<int> list = new List<int> { 8400, 8401, 8402, 8403, 8404, 8405 };
6151 int num = list.IndexOf(a.id);
6152 if (num != -1)
6153 {
6154 int num2 = list.TryGet(num + Evalue(1422));
6155 a = elements.GetElement(num2)?.act ?? ACT.Create(num2);
6156 }
6157 }
6158 int num3 = 1;
6159 Act.Cost cost = a.GetCost(this);
6160 a.GetPower(this);
6161 int n = 1;
6162 int num4 = 0;
6163 bool flag = a.IsTargetHostileParty();
6164 bool flag2 = ability.Has(a.id);
6165 if (IsPC && HasCondition<StanceManaCost>())
6166 {
6167 num4 = Evalue(1657);
6168 }
6169 _pts.Clear();
6170 if (a.TargetType.ForceParty)
6171 {
6172 pt = true;
6173 }
6174 if (pt)
6175 {
6176 n = 0;
6177 if (flag)
6178 {
6179 ForeachEnemy(delegate
6180 {
6181 n++;
6182 });
6183 }
6184 else
6185 {
6186 ForeachParty(delegate
6187 {
6188 n++;
6189 });
6190 }
6191 }
6192 if (a is Spell && IsPC && a.vPotential < n && !flag2)
6193 {
6194 n = 1;
6195 _pts.Clear();
6196 _pts.Add(this);
6197 pt = false;
6198 }
6199 int num5 = 100;
6200 if (!a.TargetType.ForceParty && n > 1)
6201 {
6202 num5 = (IsPC ? (n * 100) : (50 + n * 50));
6203 }
6204 int num6 = cost.cost * num5 / 100;
6205 if (cost.type == Act.CostType.MP && Evalue(483) > 0)
6206 {
6207 num6 = num6 * 100 / (100 + (int)Mathf.Sqrt(Evalue(483) * 10) * 3);
6208 }
6209 if (n == 0)
6210 {
6211 if (IsPC)
6212 {
6214 }
6215 return false;
6216 }
6217 if (!IsPC && cost.type == Act.CostType.MP && mana.value < 0 && (EClass.rnd(4) != 0 || IsPCFaction || (base.IsPowerful && mana.value < -20)))
6218 {
6219 return false;
6220 }
6221 if (IsPC)
6222 {
6223 if (!Dialog.warned && cost.type == Act.CostType.MP && cost.cost > 0 && mana.value < num6 && !EClass.debug.godMode)
6224 {
6225 Card cardBk = EClass.scene.mouseTarget.card;
6226 ActPlan.warning = true;
6227 Dialog.TryWarnMana(delegate
6228 {
6229 EClass.scene.mouseTarget.card = cardBk;
6230 if (UseAbility(a, tc, pos, pt))
6231 {
6233 }
6234 });
6235 return false;
6236 }
6237 EClass.ui.CloseLayers();
6238 }
6239 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))
6240 {
6241 Say("shakeHead", this);
6242 return true;
6243 }
6244 if (tc != null && tc != this)
6245 {
6246 LookAt(tc.pos);
6247 }
6248 if (pos != null && !base.pos.Equals(pos))
6249 {
6250 LookAt(pos);
6251 }
6252 if (a.CanRapidFire && HasElement(1648))
6253 {
6254 num3 = 1 + Evalue(1648);
6255 }
6256 if (IsPC && cost.cost > 0 && a.Value == 0 && !flag2)
6257 {
6259 return false;
6260 }
6261 if (a is Spell)
6262 {
6263 string s = (isConfused ? "_cast_confuse" : (HasCondition<ConDim>() ? "_cast_dim" : ""));
6264 if (!a.source.tag.Contains("useHand"))
6265 {
6266 Say(race.castStyle.IsEmpty("cast"), this, a.source.GetName().ToLower(), s.lang());
6267 }
6268 if (IsPC)
6269 {
6270 _ = (n + 1) / 2;
6271 if (a.vPotential < n && !flag2)
6272 {
6273 Msg.Say("noSpellStock");
6274 EInput.Consume();
6275 return false;
6276 }
6277 if (num4 > 0 && (a.vPotential >= n * 2 || flag2))
6278 {
6279 if (!flag2)
6280 {
6281 a.vPotential -= n * 2;
6282 }
6283 num6 = num6 * (100 - num4 * 20) / 100;
6284 }
6285 else if (!flag2)
6286 {
6287 a.vPotential -= n;
6288 }
6290 }
6291 }
6292 else
6293 {
6294 if (IsPC && a.vPotential < 0 && !flag2 && !a.HasTag("dontForget"))
6295 {
6296 Msg.Say("noSpellStock");
6297 EInput.Consume();
6298 return false;
6299 }
6300 if (a.source.langAct.Length != 0 && tc != null)
6301 {
6302 string text = a.source.langAct[0];
6303 string text2 = ((a.source.langAct.Length >= 2) ? a.source.langAct[1] : "");
6304 if (text == "spell_hand")
6305 {
6306 string[] list2 = Lang.GetList("attack" + race.meleeStyle.IsEmpty("Touch"));
6307 string @ref = text2.lang(list2[4]);
6308 Say(tc.IsPCParty ? "cast_hand_ally" : "cast_hand", this, tc, @ref, tc.IsPCParty ? list2[1] : list2[2]);
6309 }
6310 else
6311 {
6312 Say(text, this, tc, text2.IsEmpty() ? "" : text2.lang());
6313 }
6314 if (a.source.id == 6630)
6315 {
6316 Talk("insult_" + (base.IsMale ? "m" : "f"));
6317 }
6318 }
6319 }
6320 switch (cost.type)
6321 {
6322 case Act.CostType.MP:
6323 if (Evalue(1421) >= 2 && base.hp <= MaxHP / Mathf.Max(1, 9 - Evalue(1421) * 2))
6324 {
6325 num6 /= 2;
6326 }
6327 if (isSynced)
6328 {
6329 PlayEffect("cast");
6330 }
6331 mana.Mod(-num6);
6332 if (isDead)
6333 {
6334 return true;
6335 }
6336 elements.ModExp(304, Mathf.Clamp(num6 * 2, 1, 200));
6337 break;
6338 case Act.CostType.SP:
6339 {
6340 int value = stamina.value;
6341 stamina.Mod(-num6);
6342 if (IsPC && a.HasTag("recovery"))
6343 {
6344 EClass.player.staminaRecovery += value - stamina.value;
6345 }
6346 ignoreSPAbsorb = true;
6347 break;
6348 }
6349 }
6350 if (a is Spell && GetCondition<ConSilence>() != null)
6351 {
6352 Say("cast_silence", this);
6353 return true;
6354 }
6355 if (isDead)
6356 {
6357 return true;
6358 }
6359 int spellExp = elements.GetSpellExp(this, a, num5);
6360 if (EClass.rnd(100) >= CalcCastingChance(a, n) && !EClass.debug.godMode)
6361 {
6362 Say("fizzle", this);
6363 PlayEffect("fizzle");
6364 PlaySound("fizzle");
6365 if (cost.cost > 0 && a.source.lvFactor > 0)
6366 {
6367 ModExp(a.id, spellExp / 5);
6368 }
6369 RemoveCondition<ConInvisibility>();
6370 return true;
6371 }
6372 bool flag3 = true;
6373 if (a.source.cooldown > 0 && (!IsPC || !a.source.tag.Contains("CD_npc")))
6374 {
6375 AddCooldown(a.id, a.source.cooldown);
6376 }
6377 if (HasTalk("phrase_" + a.source.alias))
6378 {
6379 EClass.player.forceTalk = true;
6380 Talk("phrase_" + a.source.alias);
6381 }
6382 if (pt)
6383 {
6384 Act.forcePt = true;
6385 if (flag)
6386 {
6387 ForeachEnemy(delegate(Chara c)
6388 {
6389 a.Perform(this, c, c.pos);
6390 });
6391 }
6392 else
6393 {
6394 ForeachParty(delegate(Chara c)
6395 {
6396 a.Perform(this, c, c.pos);
6397 });
6398 }
6399 Act.forcePt = false;
6400 }
6401 else
6402 {
6403 for (int num7 = 0; num7 < num3; num7++)
6404 {
6405 if (a.TargetType != TargetType.SelfParty && tc != null && !tc.IsAliveInCurrentZone)
6406 {
6407 break;
6408 }
6409 ActEffect.RapidCount = num7;
6410 ActEffect.RapidDelay = a.RapidDelay;
6411 flag3 = a.Perform(this, tc, pos);
6412 }
6413 }
6414 if (flag3 && !isDead)
6415 {
6416 if (IsPC && flag2 && elements.Base(a.id) == 0 && a.PotentialAsStock)
6417 {
6418 elements.ModBase(a.id, 1);
6419 }
6420 if (cost.cost > 0 && a.source.lvFactor > 0)
6421 {
6422 ModExp(a.id, spellExp);
6423 }
6424 }
6425 ActEffect.RapidCount = 0;
6426 if (flag3 && !a.source.tag.Contains("keepInvisi") && EClass.rnd(2) == 0)
6427 {
6428 RemoveCondition<ConInvisibility>();
6429 RemoveCondition<ConDark>();
6430 }
6431 if (!base.IsPCFactionOrMinion && a.HasTag("specialAbility") && renderer.isSynced)
6432 {
6433 string name = a.Name;
6434 renderer.Say("| " + name + " ");
6435 }
6436 return flag3;
6437 void ForeachEnemy(Action<Chara> action)
6438 {
6439 if (_pts.Count == 0)
6440 {
6441 for (int num8 = EClass._map.charas.Count - 1; num8 >= 0; num8--)
6442 {
6443 Chara chara = EClass._map.charas[num8];
6444 if (chara != this && CanSeeLos(chara) && chara.IsHostile(this))
6445 {
6446 _pts.Add(chara);
6447 }
6448 }
6449 }
6450 for (int num9 = _pts.Count - 1; num9 >= 0; num9--)
6451 {
6452 action(_pts[num9]);
6453 }
6454 }
6455 void ForeachParty(Action<Chara> action)
6456 {
6457 if (_pts.Count == 0)
6458 {
6459 if (IsPCParty)
6460 {
6461 for (int num8 = EClass.pc.party.members.Count - 1; num8 >= 0; num8--)
6462 {
6463 Chara chara = EClass.pc.party.members[num8];
6464 if (chara == this || chara.host != null || CanSeeLos(chara))
6465 {
6466 _pts.Add(chara);
6467 }
6468 }
6469 }
6470 else
6471 {
6472 for (int num9 = EClass._map.charas.Count - 1; num9 >= 0; num9--)
6473 {
6474 Chara chara2 = EClass._map.charas[num9];
6475 if ((chara2 == this || (chara2.IsFriendOrAbove(this) && CanSeeLos(chara2))) && (chara2 == tc || _pts.Count < 3 || EClass.rnd(_pts.Count * _pts.Count) > 6))
6476 {
6477 _pts.Add(chara2);
6478 }
6479 }
6480 }
6481 }
6482 int num10 = _pts.IndexOf(this);
6483 if (num10 != -1)
6484 {
6485 _pts.RemoveAt(num10);
6486 _pts.Insert(0, this);
6487 }
6488 for (int num11 = _pts.Count - 1; num11 >= 0; num11--)
6489 {
6490 action(_pts[num11]);
6491 }
6492 }
6493 }
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:7196
bool Has(int id)
static List< Chara > _pts
Definition: Chara.cs:190
int CalcCastingChance(Element e, int num=1)
Definition: Chara.cs:6504
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:1134
virtual Act.Cost GetCost(Chara c)
Definition: ELEMENT.cs:1092
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 6133 of file Chara.cs.

6134 {
6135 return UseAbility(elements.GetElement(idAct)?.act ?? ACT.Create(idAct), tc, pos, pt);
6136 }

References ACT.Create().

◆ ValidateWorks()

void Chara.ValidateWorks ( )
inline

Definition at line 9804 of file Chara.cs.

9805 {
9806 _goalWork.FindWork(this, setAI: false);
9808 }
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 5598 of file Chara.cs.

5599 {
5600 base.c_vomit++;
5601 Say("vomit", this);
5602 PlaySound("vomit");
5603 if (!EClass._zone.IsRegion)
5604 {
5605 Thing thing = ThingGen.Create("731");
5607 {
5608 thing.MakeRefFrom(this);
5609 }
5610 EClass._zone.AddCard(thing, pos);
5611 }
5612 if (HasCondition<ConAnorexia>())
5613 {
5614 ModExp(70, -50);
5615 ModExp(71, -75);
5616 ModExp(77, -100);
5617 }
5618 else if (base.c_vomit > 10)
5619 {
5620 AddCondition<ConAnorexia>();
5621 }
5622 AddCondition<ConDim>();
5623 if (HasCondition<ConAnorexia>())
5624 {
5625 ModWeight(-1 * (1 + EClass.rnd(5)));
5626 }
5627 if (hunger.GetPhase() >= 4)
5628 {
5629 DamageHP(9999L, AttackSource.Hunger);
5630 }
5631 hunger.Mod(30);
5632 }
void ModWeight(int a, bool ignoreLimit=false)
Definition: Chara.cs:10426

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

3900 {
3901 for (int num = conditions.Count - 1; num >= 0; num--)
3902 {
3903 if (conditions[num].ConsumeTurn)
3904 {
3905 return true;
3906 }
3907 }
3908 return false;
3909 }

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

7722 {
7723 n.Clear();
7724 UIItem uIItem = n.AddHeaderCard(base.Name.ToTitleCase());
7725 SetImage(uIItem.image2);
7726 uIItem.text2.SetText(race.GetText().ToTitleCase(wholeText: true) + " " + job.GetText().ToTitleCase(wholeText: true));
7727 n.AddText("");
7728 n.Build();
7729 }
void SetImage(Image image, int dir, int idSkin=0)
Definition: Card.cs:6582
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(), Cuddle(), 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().

◆ 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(), TraitAltar._OnOffer(), 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(), AttackProcess.Perform(), ActEffect.Poison(), ActPray.Pray(), FoodEffect.Proc(), ActEffect.Proc(), ActEffect.ProcAt(), InvOwner.Transaction.Process(), TraitBaseSpellbook.ReadFailEffect(), ButtonRoster.Refresh(), TCOrbitChara.RefreshAll(), WindowChara.RefreshNote(), WindowChara.RefreshProfile(), RefreshSpeed(), CoreDebug.RegenerateNames(), 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(), TaskClean.Run(), TaskPoint.Run(), Map.Save(), WindowChara.SetChara(), CharaRenderer.SetFirst(), LayerDragGrid.SetInv(), AIAct.Start(), ConSleep.SuccubusVisit(), Player.TargetRanged(), BaseSong< T >.Tick(), ConFear.Tick(), ConSleep.Tick(), ConStrife.Tick(), ConSuffocation.Tick(), ConStrife.TryApplyParty(), AIAct.TryCancel(), TaskHarvest.TryGetAct(), AI_Goto.TryGoTo(), GoalCombat.TryMove(), TryMove(), TryMoveTowards(), Trait.TryOpenLock(), ActPray.TryPray(), 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(), AttackProcess.Perform(), 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.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

◆ 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(), AttackProcess.Perform(), ActEffect.ProcAt(), CharaAbility.Refresh(), Card.RefreshColor(), SetMainElement(), and GoalCombat.TryUseAbility().

◆ mana

◆ MaxGeneSlot

int Chara.MaxGeneSlot
get

◆ MaxHP

◆ MaxSummon

int Chara.MaxSummon
get

◆ NameBraced

◆ 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:329
SourcePref sonwputit1
Definition: CoreRef.cs:327
SourcePref replacer1
Definition: CoreRef.cs:333
PrefData prefs
Definition: CoreRef.cs:420
CoreRef refs
Definition: Core.cs:51
SpriteReplacer replacer
Definition: RenderRow.cs:89
SourcePref pref
Definition: RenderRow.cs:68
bool tryFixPrefNotLoadedAtStart
Definition: SpriteData.cs:34
void LoadPrefAndFixDensity()
Definition: SpriteData.cs:70
SourcePref pref
Definition: SpriteData.cs:32
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: