Elin Decompiled Documentation EA 23.356.1 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< Chara > ListFussableCharas (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, bool dropCorpse=false)
 
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< Hobby > ListWorks (bool useMemberType=true)
 
List< Hobby > ListHobbies (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< Element > ListAvailabeFeats (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)
 
T GetObj< T > (string id)
 
void SetObj (string id, object o)
 
T 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)
 
T 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< Element > ListCraftBonusTraits ()
 
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)
 
T GetObj< T > (int id)
 
void SetObj (int id, object o)
 
T 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< Condition > conditions = 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

const int LevelLimit = 99999999
 
static string[] IDTimeTable = new string[2] { "default", "owl" }
 
static List< SourceRace.Row > ListAdvRace = new List<SourceRace.Row>()
 
static List< SourceJob.Row > ListAdvJob = 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< SocketData > socketList [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< Hobby > listHobby = 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 7069 of file Chara.cs.

7070 {
7071 CardRenderer cardRenderer = renderer;
7072 CharaRenderer charaRenderer = new CharaRenderer();
7073 if (source.skinAntiSpider != 0)
7074 {
7075 base.idSkin = (EClass.core.config.game.antiSpider ? source.skinAntiSpider : 0);
7076 }
7077 if (host != null)
7078 {
7079 charaRenderer.pccData = PCCData.Create("ride");
7080 string idPart = base.c_idRidePCC.IsEmpty(EClass.core.pccs.sets["ride"].map["body"].map.Keys.First());
7081 charaRenderer.pccData.SetPart("body", "ride", idPart);
7082 charaRenderer.pccData.ride = EClass.core.pccs.GetRideData(idPart);
7083 }
7084 else
7085 {
7086 foreach (Condition condition in conditions)
7087 {
7088 RendererReplacer rendererReplacer = condition.GetRendererReplacer();
7089 if (rendererReplacer != null)
7090 {
7091 charaRenderer.replacer = rendererReplacer;
7092 charaRenderer.data = rendererReplacer.data;
7093 charaRenderer.pccData = rendererReplacer.pccData;
7094 break;
7095 }
7096 }
7097 if (charaRenderer.replacer == null)
7098 {
7099 charaRenderer.pccData = pccData;
7100 }
7101 }
7102 renderer = charaRenderer;
7103 renderer.SetOwner(this);
7104 if (cardRenderer != null)
7105 {
7106 renderer.SetFirst(first: false, cardRenderer.position);
7107 }
7108 return charaRenderer;
7109 }
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:35
List< Condition > conditions
Definition: Chara.cs:217
SourceChara.Row source
Definition: Chara.cs:164
PCCData pccData
Definition: Chara.cs:69
PCCManager pccs
Definition: Core.cs:41
Definition: EClass.cs:6
static Core core
Definition: EClass.cs:7

References EClass.core, RendererReplacer.data, 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 2544 of file Chara.cs.

2545 {
2546 if (EClass.pc.homeBranch != null)
2547 {
2549 }
2550 else
2551 {
2552 SetGlobal();
2554 }
2555 Hostility hostility = (base.c_originalHostility = Hostility.Ally);
2556 this.hostility = hostility;
2557 orgPos = null;
2558 base.c_summonDuration = 0;
2559 base.isSummon = false;
2560 UnmakeMinion();
2561 SetInt(32);
2562 Refresh();
2563 }
Hostility
Definition: Hostility.cs:2
void SetInt(string id, int value=0)
Definition: Card.cs:2586
void Refresh(bool calledRecursive=false)
Definition: Chara.cs:1806
void UnmakeMinion()
Definition: Chara.cs:2598
Chara SetFaction(Faction f)
Definition: Chara.cs:1492
Point orgPos
Definition: Chara.cs:23
FactionBranch homeBranch
Definition: Chara.cs:1115
Hostility hostility
Definition: Chara.cs:297
Chara SetGlobal()
Definition: Chara.cs:1561
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 2970 of file Chara.cs.

2971 {
2972 if (isDead)
2973 {
2974 return MoveResult.Fail;
2975 }
2976 if (IsPC)
2977 {
2978 float num = EClass.setting.defaultActPace;
2979 switch (burden.GetPhase())
2980 {
2981 case 3:
2982 num *= 1.5f;
2983 break;
2984 case 4:
2985 num *= 2f;
2986 break;
2987 }
2989 {
2990 int num2 = 30;
2991 if (!EClass.pc.HasElement(408))
2992 {
2994 {
2995 case Weather.Condition.Rain:
2996 num2 += 5;
2997 break;
2998 case Weather.Condition.RainHeavy:
2999 num2 += 10;
3000 num *= 1.5f;
3001 break;
3002 case Weather.Condition.Snow:
3003 num2 += 10;
3004 break;
3005 case Weather.Condition.SnowHeavy:
3006 num2 += 15;
3007 num *= 1.5f;
3008 break;
3009 }
3010 }
3011 if (newPoint.matFloor.id == 48)
3012 {
3013 num2 += 20;
3014 num *= 1.8f;
3015 }
3016 num2 = num2 * 100 / (100 + EClass.sqrt(EvalueMax(240, -20) * 10) + EvalueMax(407, -5) * 5);
3017 EClass.world.date.AdvanceMin(num2 * 6);
3018 EClass.player.lastZonePos = null;
3020 int num3 = base.hp;
3021 for (int i = 0; i < num2 * 4; i++)
3022 {
3023 EClass.pc.party.members.ForeachReverse(delegate(Chara m)
3024 {
3025 if (!m.isDead)
3026 {
3027 m.TickConditions();
3028 }
3029 });
3030 if (base.hp < MaxHP / 5 && base.hp < num3 && !EClass.player.regionMoveWarned)
3031 {
3032 EClass.player.regionMoveWarned = true;
3033 Msg.Say("regionAbortMove");
3034 EInput.Consume(consumeAxis: true);
3035 SetAI(new NoGoal());
3036 return MoveResult.Fail;
3037 }
3038 }
3039 if (newPoint.cell.CanSuffocate())
3040 {
3041 bool flag = HasElement(1252);
3042 if (!flag)
3043 {
3044 AddCondition<ConSuffocation>((Evalue(200) != 0) ? (2000 / (100 + EvalueMax(200, -5) * 10)) : 30, force: true);
3045 }
3046 int num4 = GetCondition<ConSuffocation>()?.GetPhase() ?? 0;
3047 if (num4 >= 2)
3048 {
3049 DamageHP(EClass.rndHalf(10 + MaxHP / 5), AttackSource.Condition);
3050 }
3051 if (!isDead && !HasElement(429))
3052 {
3053 ModExp(200, ((!flag) ? 1 : 10) + num4 * 12);
3054 }
3055 }
3056 EClass.player.regionMoveWarned = false;
3057 if (isDead)
3058 {
3059 return MoveResult.Fail;
3060 }
3061 }
3062 if (num > EClass.setting.defaultActPace * 3f)
3063 {
3064 num = EClass.setting.defaultActPace * 3f;
3065 }
3066 actTime = num;
3067 }
3068 if (IsPCFaction && EClass.rnd(5) == 0 && newPoint.cell.CanSuffocate())
3069 {
3070 int num5 = Mathf.Min(5 + EClass._zone.DangerLv / 10, 200);
3071 ModExp(200, EClass._zone.IsRegion ? 50 : num5);
3072 if (ride != null)
3073 {
3074 ride.ModExp(200, EClass._zone.IsRegion ? 50 : num5);
3075 }
3076 if (parasite != null)
3077 {
3078 parasite.ModExp(200, EClass._zone.IsRegion ? 50 : num5);
3079 }
3080 }
3081 Chara chara = ((ride == null) ? this : ride);
3082 if (!EClass._zone.IsRegion || chara.IsPC)
3083 {
3084 bool flag2 = (chara.isConfused && EClass.rnd(2) == 0) || (chara.isDrunk && EClass.rnd(IsIdle ? 2 : 8) == 0 && !chara.HasElement(1215));
3085 if (host != null && host.ride == this && ((host.isConfused && EClass.rnd(2) == 0) || (host.isDrunk && EClass.rnd(IsIdle ? 2 : 8) == 0 && !host.HasElement(1215))))
3086 {
3087 flag2 = true;
3088 }
3089 if (flag2 && !HasElement(493) && newPoint.Distance(pos) <= 1)
3090 {
3091 Point randomNeighbor = pos.GetRandomNeighbor();
3092 if (CanMoveTo(randomNeighbor, allowDestroyPath: false))
3093 {
3094 newPoint = randomNeighbor;
3095 if (isDrunk)
3096 {
3097 Talk("drunk");
3098 }
3099 }
3100 }
3101 }
3102 if (newPoint.x != pos.x || newPoint.z != pos.z)
3103 {
3104 LookAt(newPoint);
3105 }
3106 CellEffect effect = base.Cell.effect;
3107 if (effect != null && effect.id == 7)
3108 {
3109 CellEffect effect2 = base.Cell.effect;
3110 if (race.height < 500 && !race.tag.Contains("webfree") && !HasElement(493) && EClass.rnd(effect2.power + 25) > EClass.rnd(base.STR + base.DEX + 1))
3111 {
3112 Say("abWeb_caught", this);
3113 PlaySound("web");
3114 effect2.power = effect2.power * 3 / 4;
3115 renderer.PlayAnime(AnimeID.Shiver);
3116 return MoveResult.Fail;
3117 }
3118 Say("abWeb_pass", this);
3119 EClass._map.SetEffect(base.Cell.x, base.Cell.z);
3120 }
3121 if (IsPC)
3122 {
3123 EClass.player.renderExtraTime = 0f;
3124 if (EClass._zone.IsRegion)
3125 {
3127 }
3128 else if ((newPoint.x > pos.x && newPoint.z > pos.z) || (newPoint.x < pos.x && newPoint.z < pos.z))
3129 {
3130 EClass.player.renderExtraTime = actTime * EClass.setting.render.anime.diagonalSpeed;
3131 }
3132 }
3133 if (newPoint.HasChara)
3134 {
3135 foreach (Chara item in newPoint.ListCharas())
3136 {
3137 if (item.mimicry != null && item.IsHostile(this))
3138 {
3139 if (item.mimicry.ShouldRevealOnPush)
3140 {
3141 item.mimicry.Reveal(this, surprise: true);
3142 }
3143 return MoveResult.Event;
3144 }
3145 }
3146 }
3147 if (newPoint.cell.hasDoor)
3148 {
3149 foreach (Thing thing in pos.Things)
3150 {
3151 if (thing.trait is TraitDoor traitDoor && traitDoor.owner.c_lockLv > 0)
3152 {
3153 if (base.INT < 10)
3154 {
3155 return MoveResult.Fail;
3156 }
3157 traitDoor.TryOpenLock(this);
3158 return MoveResult.Door;
3159 }
3160 }
3161 }
3162 Cell cell = newPoint.cell;
3163 Cell cell2 = pos.cell;
3164 bool flag3 = cell.HasLiquid && !IsLevitating;
3165 bool hasBridge = cell.HasBridge;
3166 bool hasRamp = cell.HasRamp;
3167 bool flag4 = EClass._zone.IsSnowCovered && !cell.HasRoof && !cell.isClearSnow;
3168 TileRow tileRow = (hasRamp ? ((TileRow)cell.sourceBlock) : ((TileRow)(hasBridge ? cell.sourceBridge : cell.sourceFloor)));
3169 SourceMaterial.Row row = (hasRamp ? cell.matBlock : (hasBridge ? cell.matBridge : cell.matFloor));
3170 bool flag5 = cell.IsTopWater && !cell.isFloating;
3171 if (!EClass._zone.IsRegion)
3172 {
3173 if (cell.hasDoorBoat)
3174 {
3175 tileRow = FLOOR.sourceWood;
3176 row = MATERIAL.sourceOak;
3177 flag5 = false;
3178 }
3179 else if (flag4 && !tileRow.ignoreSnow)
3180 {
3181 if (tileRow.tileType.IsWater)
3182 {
3183 tileRow = FLOOR.sourceIce;
3184 row = MATERIAL.sourceIce;
3185 }
3186 else
3187 {
3188 tileRow = FLOOR.sourceSnow;
3189 row = MATERIAL.sourceSnow;
3190 }
3191 flag5 = false;
3192 }
3193 }
3194 if ((pos.sourceFloor.isBeach || cell2.IsSnowTile) && !pos.HasObj)
3195 {
3196 EClass._map.SetFoormark(pos, 1, (int)Util.GetAngle(pos.x - newPoint.x, pos.z - newPoint.z), cell2.IsSnowTile ? 312 : 304);
3197 }
3198 if (isSynced)
3199 {
3200 string text = ((flag3 || flag5) ? "water" : tileRow.soundFoot.IsEmpty(row.soundFoot.IsEmpty("default")));
3201 if (cell.obj != 0 && cell.sourceObj.tileType.IsPlayFootSound && !cell.matObj.soundFoot.IsEmpty())
3202 {
3203 text = cell.matObj.soundFoot;
3204 }
3205 if (IsPC)
3206 {
3207 foreach (Thing thing2 in newPoint.Things)
3208 {
3209 if (thing2.IsInstalled && (thing2.trait.IsChangeFloorHeight || thing2.Pref.Surface))
3210 {
3211 text = thing2.material.soundFoot;
3212 }
3213 }
3214 }
3215 if (!text.IsEmpty())
3216 {
3217 SoundManager.altLastData = IsPC;
3218 PlaySound("Footstep/" + text, IsPC ? 1f : 0.9f);
3219 }
3220 if (!flag5)
3221 {
3223 PCOrbit pcOrbit = EClass.screen.pcOrbit;
3224 bool flag6 = scene.actionMode.gameSpeed > 1f;
3225 scene.psFoot.transform.position = renderer.position + pcOrbit.footPos;
3226 scene.psFoot.startColor = row.matColor;
3227 scene.psFoot.Emit(pcOrbit.emitFoot * ((!flag6) ? 1 : 2));
3228 if (flag6 && IsPC)
3229 {
3230 scene.psSmoke.transform.position = renderer.position + pcOrbit.smokePos;
3231 scene.psSmoke.Emit(pcOrbit.emitSmoke);
3232 }
3233 }
3234 if (flag3 || flag5)
3235 {
3236 Effect.Get("ripple").Play(newPoint);
3237 }
3238 }
3239 lastPos.Set(pos);
3240 if (type != MoveType.Force)
3241 {
3242 if (newPoint.HasChara && ai.Current.PushChara)
3243 {
3244 TryPush(newPoint);
3245 }
3246 if (newPoint.HasChara && newPoint.Charas.Count == 1)
3247 {
3248 Chara chara2 = newPoint.Charas[0];
3249 if (CanReplace(chara2))
3250 {
3251 chara2.MoveByForce(lastPos, this);
3252 if (chara.IsPC)
3253 {
3254 Say("replace_pc", chara, chara2);
3255 }
3256 }
3257 }
3258 }
3259 if (cell.hasDoor)
3260 {
3261 foreach (Thing thing3 in newPoint.Things)
3262 {
3263 if (thing3.trait is TraitDoor traitDoor2)
3264 {
3265 traitDoor2.TryOpen(this);
3266 }
3267 }
3268 }
3269 EClass._zone.map.MoveCard(newPoint, this);
3270 SyncRide();
3272 {
3273 foreach (Chara member in EClass.pc.party.members)
3274 {
3275 if (member.isLeashed && !member.IsPC && member.host == null && !member.IsDisabled && !member.HasCondition<ConEntangle>() && !member.IsInCombat && member.Dist(EClass.pc) > 1)
3276 {
3277 member.TryMoveTowards(EClass.pc.pos);
3278 }
3279 }
3280 }
3282 {
3284 }
3285 if (IsPC)
3286 {
3287 PlaySound("Footstep/Extra/pcfootstep");
3288 if (pos.HasThing)
3289 {
3290 foreach (Card item2 in pos.ListCards())
3291 {
3292 if (!item2.isThing || item2.placeState != PlaceState.roaming || item2.ignoreAutoPick)
3293 {
3294 continue;
3295 }
3297 {
3299 ContainerFlag containerFlag = item2.category.GetRoot().id.ToEnum<ContainerFlag>();
3300 if (containerFlag == ContainerFlag.none)
3301 {
3302 containerFlag = ContainerFlag.other;
3303 }
3304 if ((dataPick.noRotten && item2.IsDecayed) || (dataPick.onlyRottable && item2.trait.Decay == 0))
3305 {
3306 continue;
3307 }
3308 if (dataPick.userFilter)
3309 {
3310 switch (dataPick.IsFilterPass(item2.GetName(NameStyle.Full, 1)))
3311 {
3312 case Window.SaveData.FilterResult.PassWithoutFurtherTest:
3313 Pick(item2.Thing);
3314 continue;
3315 case Window.SaveData.FilterResult.Block:
3316 continue;
3317 }
3318 }
3319 if (dataPick.advDistribution)
3320 {
3321 foreach (int cat in dataPick.cats)
3322 {
3323 if (item2.category.uid == cat)
3324 {
3325 Pick(item2.Thing);
3326 }
3327 }
3328 }
3329 else if (!dataPick.flag.HasFlag(containerFlag))
3330 {
3331 Pick(item2.Thing);
3332 }
3333 }
3334 else
3335 {
3336 Pick(item2.Thing);
3337 }
3338 }
3339 }
3340 if (EClass._zone.IsRegion)
3341 {
3343 if (cell3?.zone != null && !cell3.zone.HiddenInRegionMap && (!(cell3.zone is Zone_Field) || cell3.zone.children.Count > 0 || cell3.zone.IsPCFaction))
3344 {
3345 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() ?? "");
3346 }
3347 if (pos.matFloor.alias == "snow" && EClass.rnd(3) == 0)
3348 {
3350 Msg.Say(Lang.GetList("walk_snow").RandomItem());
3351 }
3352 else if (EClass.world.weather.CurrentCondition == Weather.Condition.RainHeavy && EClass.rnd(3) == 0)
3353 {
3355 Msg.Say(Lang.GetList("walk_storm").RandomItem());
3356 }
3357 }
3358 ActWait.Search(this);
3359 }
3360 if (IsPCC)
3361 {
3362 int num6 = Mathf.Abs(cell2.topHeight - cell.topHeight);
3363 if ((num6 >= 3 && lastPos.sourceBlock.tileType.slopeHeight == 0 && newPoint.sourceBlock.tileType.slopeHeight == 0) || cell2.hasDoorBoat || cell.hasDoorBoat)
3364 {
3365 renderer.PlayAnime((cell2.topHeight >= cell.topHeight) ? AnimeID.JumpDown : ((num6 >= 6) ? AnimeID.Jump : AnimeID.JumpSmall));
3366 }
3367 else
3368 {
3369 float surfaceHeight = cell2.GetSurfaceHeight();
3370 float surfaceHeight2 = cell.GetSurfaceHeight();
3371 num6 = (int)Mathf.Abs((surfaceHeight - surfaceHeight2) * 100f);
3372 if (num6 >= 15)
3373 {
3374 renderer.PlayAnime((surfaceHeight >= surfaceHeight2) ? AnimeID.JumpDown : ((num6 >= 40) ? AnimeID.Jump : AnimeID.JumpSmall));
3375 }
3376 }
3377 }
3378 if (IsPC)
3379 {
3380 if (renderer.anime == null && renderer.replacer != null && renderer.replacer.pccData == null)
3381 {
3383 }
3385 {
3386 if (!FLOOR.IsTatami(pos.cell.sourceSurface.id) && pos.cell.room == null)
3387 {
3388 EClass.player.flags.isShoesOff = false;
3389 EClass.pc.Say("shoes_on", EClass.pc);
3390 EClass.pc.SetPCCState(PCCState.Normal);
3391 }
3392 }
3393 else if (FLOOR.IsTatami(pos.cell.sourceSurface.id) && pos.cell.room != null)
3394 {
3395 EClass.player.flags.isShoesOff = true;
3396 EClass.pc.Say("shoes_off", EClass.pc);
3397 EClass.pc.SetPCCState(PCCState.ShoesOff);
3398 }
3399 }
3400 bool flag7 = flag5 || EClass._zone.IsUnderwater;
3401 if (wasInWater != flag7)
3402 {
3403 wasInWater = flag7;
3404 RefreshSpeed();
3405 }
3406 lastPos.Things.ForeachReverse(delegate(Thing t)
3407 {
3408 t.trait.OnSteppedOut(this);
3409 });
3410 if (!IsPC)
3411 {
3412 pos.Things.ForeachReverse(delegate(Thing t)
3413 {
3414 t.trait.OnStepped(this);
3415 });
3416 }
3417 if (CanDestroyPath())
3418 {
3420 }
3421 if (!isDead)
3422 {
3423 if (Evalue(492) > 0 && EClass.rnd(10000 / (80 + Evalue(492) * 2)) == 0)
3424 {
3425 AddExp(Mathf.Clamp((int)Mathf.Sqrt(base.ExpToNext / 100), 1, 1000));
3426 }
3427 if (pos.IsBlocked && EClass.rnd(IsPC ? 1 : 20) == 0)
3428 {
3429 stamina.Mod(-1);
3430 }
3431 }
3432 hasMovedThisTurn = true;
3433 return MoveResult.Success;
3434 }
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:41
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:6645
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:7206
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:8241
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:6383
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:7324
Definition: Cell.cs:7
SourceBlock.Row sourceBlock
Definition: Cell.cs:1090
bool IsSnowTile
Definition: Cell.cs:818
int obj
Definition: Cell.cs:50
bool hasDoorBoat
Definition: Cell.cs:510
bool HasBridge
Definition: Cell.cs:707
bool isClearSnow
Definition: Cell.cs:462
bool isFloating
Definition: Cell.cs:486
SourceMaterial.Row matObj
Definition: Cell.cs:1074
byte topHeight
Definition: Cell.cs:100
SourceMaterial.Row matFloor
Definition: Cell.cs:1068
SourceObj.Row sourceObj
Definition: Cell.cs:1112
bool HasRamp
Definition: Cell.cs:873
bool hasDoor
Definition: Cell.cs:279
SourceFloor.Row sourceSurface
Definition: Cell.cs:1097
float GetSurfaceHeight()
Definition: Cell.cs:1766
bool CanSuffocate()
Definition: Cell.cs:1151
Definition: Chara.cs:10
void TickConditions()
Definition: Chara.cs:3946
bool wasInWater
Definition: Chara.cs:152
bool IsLevitating
Definition: Chara.cs:605
AIAct ai
Definition: Chara.cs:208
override bool IsPC
Definition: Chara.cs:632
bool isDrunk
Definition: Chara.cs:128
Party party
Definition: Chara.cs:45
bool CanDestroyPath()
Definition: Chara.cs:2678
bool IsInCombat
Definition: Chara.cs:913
bool HasCondition(string alias)
Definition: Chara.cs:10053
AIAct SetAI(AIAct g)
Definition: Chara.cs:9496
bool IsIdle
Definition: Chara.cs:902
override bool IsDisabled
Definition: Chara.cs:593
bool hasMovedThisTurn
Definition: Chara.cs:182
override bool isSynced
Definition: Chara.cs:711
bool CanMoveTo(Point p, bool allowDestroyPath=true)
Definition: Chara.cs:2691
void DestroyPath(Point pos)
Definition: Chara.cs:3436
override bool IsPCFaction
Definition: Chara.cs:691
float actTime
Definition: Chara.cs:184
override int MaxHP
Definition: Chara.cs:728
Zone currentZone
Definition: Chara.cs:261
bool CanReplace(Chara c)
Definition: Chara.cs:3547
new Point lastPos
Definition: Chara.cs:92
void MoveByForce(Point newPoint, Card c=null, bool checkWall=false)
Definition: Chara.cs:2876
Stats stamina
Definition: Chara.cs:1207
Stats burden
Definition: Chara.cs:1205
Chara parasite
Definition: Chara.cs:32
Chara ride
Definition: Chara.cs:29
void RefreshSpeed(Element.BonusInfo info=null)
Definition: Chara.cs:2080
MoveResult TryMoveTowards(Point p)
Definition: Chara.cs:2884
void SyncRide()
Definition: Chara.cs:4228
bool isDead
Definition: Chara.cs:395
override void LookAt(Card c)
Definition: Chara.cs:3810
bool isConfused
Definition: Chara.cs:130
override bool IsPCC
Definition: Chara.cs:702
void TryPush(Point point)
Definition: Chara.cs:3480
void SetPCCState(PCCState state)
Definition: Chara.cs:7111
SourceRace.Row race
Definition: Chara.cs:470
bool allyKeepDistance
Definition: ConfigTactics.cs:6
new GameConfig game
Definition: CoreConfig.cs:629
CoreConfig config
Definition: Core.cs:70
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:374
RenderSetting render
Definition: GameSetting.cs:348
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:946
void SetFoormark(Point pos, int id, int angle, int offset=0)
Definition: Map.cs:2214
void SetEffect(int x, int z, CellEffect effect=null)
Definition: Map.cs:1662
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:53
SourceBlock.Row sourceBlock
Definition: Point.cs:59
List< Card > ListCards(bool includeMasked=false)
Definition: Point.cs:1053
Point Set(int _x, int _z)
Definition: Point.cs:499
bool IsBlocked
Definition: Point.cs:359
List< Thing > Things
Definition: Point.cs:334
int x
Definition: Point.cs:36
int z
Definition: Point.cs:39
List< Chara > Charas
Definition: Point.cs:336
bool HasThing
Definition: Point.cs:247
List< Chara > ListCharas()
Definition: Point.cs:1173
SourceFloor.Row sourceFloor
Definition: Point.cs:61
bool HasObj
Definition: Point.cs:133
int Distance(Point p)
Definition: Point.cs:991
Cell cell
Definition: Point.cs:47
Point GetRandomNeighbor()
Definition: Point.cs:760
bool HasChara
Definition: Point.cs:234
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:7
string soundFoot
Definition: TileRow.cs:15
virtual bool IsWater
Definition: TileType.cs:171
virtual void OnSteppedOut(Chara c)
Definition: Trait.cs:1281
virtual bool IsChangeFloorHeight
Definition: Trait.cs:74
virtual void OnStepped(Chara c)
Definition: Trait.cs:1277
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 7715 of file Chara.cs.

7716 {
7717 EClass.Sound.Play("pop_drama");
7718 if (book == "_chara" && IsPC)
7719 {
7720 step = "pc";
7721 }
7722 if (id == "lomias")
7723 {
7725 }
7726 return LayerDrama.Activate(book, sheet, step, this, null, tag);
7727 }
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 9893 of file Chara.cs.

9894 {
9895 c.owner = this;
9896 if (!(c is ConBurning))
9897 {
9898 if (c is ConBleed && ResistLv(964) >= 3)
9899 {
9900 return null;
9901 }
9902 }
9903 else if (ResistLv(950) >= 3)
9904 {
9905 return null;
9906 }
9908 {
9909 if (c.GainResistFactor >= 400)
9910 {
9911 c.power /= 2;
9912 }
9913 ResistCon(c);
9914 if (c.power <= 0)
9915 {
9916 return null;
9917 }
9918 }
9919 if (!force)
9920 {
9921 if (c.source.negate.Length != 0)
9922 {
9923 string[] negate = c.source.negate;
9924 foreach (string text in negate)
9925 {
9926 if (HasElement(text))
9927 {
9928 return null;
9929 }
9930 }
9931 }
9932 Element defenseAttribute = c.GetDefenseAttribute(this);
9933 if (defenseAttribute != null)
9934 {
9935 c.power = MathEx.ClampToInt(100L * (long)c.power / Mathf.Max(100 + defenseAttribute.Value, 1));
9936 }
9937 if (c.source.resistance.Length != 0)
9938 {
9939 int num = ResistLv(EClass.sources.elements.alias[c.source.resistance[0]].id);
9940 if (num > 0)
9941 {
9942 c.power /= num * num + 1;
9943 if (c.power <= 40)
9944 {
9945 return null;
9946 }
9947 }
9948 }
9949 c.power = c.EvaluatePower(c.power);
9950 if (c.power <= 0)
9951 {
9952 return null;
9953 }
9954 }
9955 int num2 = c.EvaluateTurn(c.power);
9956 if (c is ConDeathSentense && HasElement(494))
9957 {
9958 num2 = num2 * (100 + (int)Mathf.Sqrt(Evalue(494)) * 10) / 100;
9959 }
9960 if (num2 == 0)
9961 {
9962 return null;
9963 }
9964 for (int j = 0; j < conditions.Count; j++)
9965 {
9966 if (conditions[j].id != c.id)
9967 {
9968 continue;
9969 }
9970 if (c.Type == ConditionType.Stance || c.IsToggle)
9971 {
9972 conditions[j].Kill();
9973 return null;
9974 }
9975 if (conditions[j].CanStack(c))
9976 {
9977 if (conditions[j].ShouldOverride(c))
9978 {
9979 if (conditions[j].IsOverrideConditionMet(c, num2))
9980 {
9981 conditions[j].Kill(silent: true);
9982 continue;
9983 }
9984 return null;
9985 }
9986 if (CanGainConResist)
9987 {
9988 AddResistCon(c);
9989 }
9990 conditions[j].OnStacked(c.power);
9991 conditions[j].OnStartOrStack();
9992 conditions[j].PlayEffect();
9993 }
9994 if (!conditions[j].AllowMultipleInstance)
9995 {
9996 return null;
9997 }
9998 }
9999 foreach (Condition condition in conditions)
10000 {
10001 if (condition.TryNullify(c))
10002 {
10003 return null;
10004 }
10005 }
10006 c.value = num2;
10007 conditions.Add(c);
10008 if (CanGainConResist)
10009 {
10010 AddResistCon(c);
10011 }
10012 c.SetOwner(this);
10013 c.Start();
10014 SetDirtySpeed();
10015 if (c.ShouldRefresh)
10016 {
10017 Refresh();
10018 }
10019 if (c.CancelAI)
10020 {
10021 ai.Cancel();
10022 }
10023 if (IsPC && c.ConsumeTurn && !EClass.pc.isRestrained)
10024 {
10026 }
10027 if (c.SyncRide && (ride != null || parasite != null))
10028 {
10029 if (ride != null)
10030 {
10032 }
10033 if (parasite != null)
10034 {
10036 }
10037 }
10038 return c;
10039 }
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:6378
void SetDirtySpeed()
Definition: Chara.cs:2071
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:9881
bool CanGainConResist
Definition: Chara.cs:1222
void AddResistCon(Condition con)
Definition: Chara.cs:10319
void ResistCon(Condition con)
Definition: Chara.cs:10339
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 9886 of file Chara.cs.

9887 {
9888 Condition condition = Condition.Create(id, p);
9889 condition.P2 = p2;
9890 return AddCondition(condition, force);
9891 }

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

9876 : Condition
9877 {
9878 return AddCondition(typeof(T).Name, p, p2, force);
9879 }
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 9871 of file Chara.cs.

9871 : Condition
9872 {
9873 return AddCondition(typeof(T).Name, p, force);
9874 }

◆ AddCooldown()

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

Definition at line 9277 of file Chara.cs.

9278 {
9279 if (_cooldowns == null)
9280 {
9281 _cooldowns = new List<int>();
9282 }
9283 if (turns != 0)
9284 {
9285 _cooldowns.Add(idEle * 1000 + turns);
9286 return;
9287 }
9288 SourceElement.Row row = EClass.sources.elements.map[idEle];
9289 if (row.cooldown > 0)
9290 {
9291 _cooldowns.Add(idEle * 1000 + row.cooldown);
9292 }
9293 }
List< int > _cooldowns
Definition: Chara.cs:60

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

10829 {
10830 if (!IsPCFaction || !IsGlobal)
10831 {
10832 _historyFood = null;
10833 return;
10834 }
10835 if (_historyFood == null)
10836 {
10837 _historyFood = new List<List<string>>
10838 {
10839 new List<string>()
10840 };
10841 }
10842 if (_historyFood[0].Count < 5)
10843 {
10844 _historyFood[0].Add(food.id);
10845 }
10846 }
override bool IsGlobal
Definition: Chara.cs:630
List< List< string > > _historyFood
Definition: Chara.cs:66

References food.

Referenced by FoodEffect.Proc().

◆ AddHobby()

void Chara.AddHobby ( int  id)
inline

Definition at line 9696 of file Chara.cs.

9697 {
9698 foreach (int hobby in _hobbies)
9699 {
9700 if (hobby == id)
9701 {
9702 return;
9703 }
9704 }
9705 _hobbies.Add(id);
9706 }
List< int > _hobbies
Definition: Chara.cs:51

◆ AddRandomBodyPart()

void Chara.AddRandomBodyPart ( bool  msg = false)
inline

Definition at line 2418 of file Chara.cs.

2419 {
2420 int ele = new int[9] { 30, 31, 33, 35, 35, 36, 34, 37, 39 }.RandomItem();
2421 body.AddBodyPart(ele);
2422 if (msg)
2423 {
2424 Say("gain_bodyparts", this, Element.Get(ele).GetName().ToLower());
2425 PlaySound("offering");
2426 }
2427 }
void AddBodyPart(int ele, Thing thing=null)
Definition: CharaBody.cs:312
CharaBody body
Definition: Chara.cs:96
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 10319 of file Chara.cs.

10320 {
10321 if (con.power > 0 && con.GainResistFactor > 0)
10322 {
10323 int key = con.id;
10324 if (resistCon == null)
10325 {
10326 resistCon = new Dictionary<int, int>();
10327 }
10328 if (resistCon.ContainsKey(key))
10329 {
10330 resistCon[key] += con.power * con.GainResistFactor / 100;
10331 }
10332 else
10333 {
10334 resistCon[key] = con.power * con.GainResistFactor / 100;
10335 }
10336 }
10337 }
Dictionary< int, int > resistCon
Definition: Chara.cs:220

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

◆ AddWork()

void Chara.AddWork ( int  id)
inline

Definition at line 9708 of file Chara.cs.

9709 {
9710 foreach (int work in _works)
9711 {
9712 if (work == id)
9713 {
9714 return;
9715 }
9716 }
9717 _works.Add(id);
9718 }
List< int > _works
Definition: Chara.cs:54

◆ ApplyDeathPenalty()

void Chara.ApplyDeathPenalty ( )
inline

Definition at line 5609 of file Chara.cs.

5610 {
5611 if (!IsPC)
5612 {
5613 return;
5614 }
5615 int currency = GetCurrency();
5616 if (currency > 0)
5617 {
5618 int num = currency / 3 + EClass.rnd(currency / 3 + 1);
5619 if (num <= 0)
5620 {
5621 num = 1;
5622 }
5623 Msg.Say("panaltyMoney", this, Lang._currency(num));
5624 ModCurrency(-num);
5626 }
5627 foreach (Element value in EClass.pc.elements.dict.Values)
5628 {
5629 if (EClass.rnd(5) == 0 && value.IsMainAttribute)
5630 {
5631 EClass.pc.elements.ModExp(value.id, -500f);
5632 }
5633 }
5634 }
@ 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:2159

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

2254 {
2255 switch (tag)
2256 {
2257 case EditorTag.HostilityNeutral:
2258 {
2259 Hostility hostility = (base.c_originalHostility = Hostility.Neutral);
2260 this.hostility = hostility;
2261 break;
2262 }
2263 case EditorTag.HostilityEnemy:
2264 {
2265 Hostility hostility = (base.c_originalHostility = Hostility.Enemy);
2266 this.hostility = hostility;
2267 break;
2268 }
2269 case EditorTag.HostilityFriend:
2270 {
2271 Hostility hostility = (base.c_originalHostility = Hostility.Friend);
2272 this.hostility = hostility;
2273 break;
2274 }
2275 case EditorTag.Male:
2276 bio.SetGender(2);
2277 base.c_idPortrait = Portrait.GetRandomPortrait(2, GetIdPortraitCat());
2278 break;
2279 case EditorTag.Female:
2280 bio.SetGender(1);
2281 base.c_idPortrait = Portrait.GetRandomPortrait(1, GetIdPortraitCat());
2282 break;
2283 case EditorTag.baby:
2284 SetFeat(1232);
2285 break;
2286 }
2287 base.ApplyEditorTags(tag);
2288 }
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:10560
string GetIdPortraitCat()
Definition: Chara.cs:8688
static string GetRandomPortrait(string idDict)
Definition: Portrait.cs:155

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

◆ ApplyJob()

void Chara.ApplyJob ( bool  remove = false)
inline

Definition at line 2380 of file Chara.cs.

2381 {
2382 elements.ApplyElementMap(base.uid, SourceValueType.Chara, job.elementMap, base.DefaultLV, remove, applyFeat: true);
2383 if (IsPCC)
2384 {
2385 EClass.game.uniforms.Apply(pccData, job.id, base.IsMale, canUseOtherGender: true);
2386 }
2387 }
SourceValueType
SourceJob.Row job
Definition: Chara.cs:472
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 2466 of file Chara.cs.

2467 {
2468 string[] array = race.figure.Split('|');
2469 foreach (string s in array)
2470 {
2471 int num = ParseBodySlot(s);
2472 if (num != -1)
2473 {
2474 if (remove)
2475 {
2476 body.RemoveBodyPart(num);
2477 }
2478 else
2479 {
2480 body.AddBodyPart(num);
2481 }
2482 }
2483 }
2485 elements.ApplyElementMap(base.uid, SourceValueType.Chara, race.elementMap, base.DefaultLV, remove, applyFeat: true);
2486 if (remove)
2487 {
2488 if (HasElement(1423))
2489 {
2490 SetFeat(1423, 0);
2491 }
2492 return;
2493 }
2494 bool flag = id == "chara" || id == "player";
2495 if (race.id == "bike" && id != "bike_cub")
2496 {
2497 SetFeat(1423, flag ? 10 : (1 + EClass.rnd(10)));
2498 }
2499 if (id == "moa")
2500 {
2501 SetFeat(1423, flag ? 7 : (1 + EClass.rnd(7)));
2502 }
2503 if (race.id == "horse" && EClass.rnd(5) == 0)
2504 {
2505 SetFeat(1423, flag ? 5 : (1 + EClass.rnd(5)));
2506 }
2507 }
void RefreshBodyParts()
Definition: CharaBody.cs:338
void RemoveBodyPart(int ele)
Definition: CharaBody.cs:367
int ParseBodySlot(string s)
Definition: Chara.cs:2401

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

2579 {
2580 owner?.Say("summon_vanish", this);
2581 pos.PlayEffect("vanish");
2582 pos.PlaySound("vanish");
2583 pos.PlayEffect("teleport");
2584 Destroy();
2585 }
void Destroy()
Definition: Card.cs:5314
SoundSource PlaySound(string id, bool synced=true, float v=1f, bool spatial=true)
Definition: Point.cs:1255
Effect PlayEffect(string id)
Definition: Point.cs:1250

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

2616 {
2617 List<Chara> list = new List<Chara>();
2618 foreach (Chara chara in EClass._map.charas)
2619 {
2620 if (chara.IsMinion && chara.master == this)
2621 {
2622 list.Add(chara);
2623 }
2624 }
2625 foreach (Chara item in list)
2626 {
2627 item.Banish(this);
2628 }
2629 }
override bool IsMinion
Definition: Chara.cs:647
Chara master
Definition: Chara.cs:90
List< Chara > charas
Definition: Map.cs:84

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

◆ CalcBurden()

void Chara.CalcBurden ( )
inline

Definition at line 2039 of file Chara.cs.

2040 {
2041 int num = base.ChildrenWeight * 100 / Mathf.Max(1, WeightLimit);
2042 if (num < 0)
2043 {
2044 num = 1000;
2045 }
2047 {
2048 num = 0;
2049 }
2050 burden.Set(num);
2051 SetDirtySpeed();
2052 }
override int WeightLimit
Definition: Chara.cs:730
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 6543 of file Chara.cs.

6544 {
6545 if (!(e is Spell))
6546 {
6547 return 100;
6548 }
6549 if (!IsPC)
6550 {
6551 int num2 = 95;
6552 if (host != null)
6553 {
6554 if (host.ride == this)
6555 {
6556 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.EvalueRiding()));
6557 }
6558 if (host.parasite == this)
6559 {
6560 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.Evalue(227)));
6561 }
6562 }
6563 return num2;
6564 }
6565 int num3 = Evalue(304);
6566 if (!IsPCFaction)
6567 {
6568 num3 = Mathf.Max(num3, base.LV + 5);
6569 }
6570 int num4 = 0;
6571 int num5 = 0;
6572 bool num6 = GetArmorSkill() == 122;
6573 AttackStyle attackStyle = body.GetAttackStyle();
6574 if (num6)
6575 {
6576 num4 = 20 - Evalue(122) / 5;
6577 num5 += 10 - Evalue(1654) * 4;
6578 }
6579 else
6580 {
6581 num4 = 10 - Evalue(120) / 5;
6582 }
6583 if (num4 < 5)
6584 {
6585 num4 = 5;
6586 }
6587 if (ride != null)
6588 {
6589 num4 += 5;
6590 }
6591 if (parasite != null)
6592 {
6593 num4 += 10;
6594 }
6595 if (attackStyle == AttackStyle.TwoWield)
6596 {
6597 num4 += 5;
6598 }
6599 if (attackStyle == AttackStyle.Shield)
6600 {
6601 num4 += 10;
6602 num5 += 20 - Evalue(1654) * 8;
6603 }
6604 if (isConfused)
6605 {
6606 num4 += 10000;
6607 }
6608 if (HasCondition<ConDim>())
6609 {
6610 num4 += ((Evalue(1654) >= 3) ? 1500 : 2500);
6611 }
6612 if (num > 1)
6613 {
6614 num4 += 5 * num;
6615 }
6616 if (num5 < 0)
6617 {
6618 num5 = 0;
6619 }
6620 return Mathf.Clamp(100 + e.Value - 10 - e.source.LV * e.source.cost[0] * num4 / Mathf.Max(10 + num3 * 10, 1), 0, 100 - num5);
6621 }
AttackStyle
Definition: AttackStyle.cs:2
AttackStyle GetAttackStyle()
Definition: CharaBody.cs:508
override int GetArmorSkill()
Definition: Chara.cs:8381
int EvalueRiding()
Definition: Chara.cs:6534
SourceElement.Row source
Definition: ELEMENT.cs:282
Definition: SPELL.cs:710

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

2235 {
2236 int num = base.END;
2237 int num2 = 0;
2238 foreach (Element value in elements.dict.Values)
2239 {
2240 if (value.source.category == "skill")
2241 {
2242 num = ((!IsPC) ? (num + Mathf.Max(value.ValueWithoutLink, 0)) : (num + Mathf.Max(value.vBase, 0)));
2243 }
2244 }
2245 num2 = EClass.curve(num, 30, 10, 60);
2246 if (num2 < 10)
2247 {
2248 num2 = 10;
2249 }
2250 _maxStamina = num2 + 15;
2251 }
int _maxStamina
Definition: Chara.cs:371
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 6849 of file Chara.cs.

6850 {
6851 foreach (Chara chara in EClass._map.charas)
6852 {
6853 if (!chara.IsPCFaction && chara.OriginalHostility == OriginalHostility && (fanatic || Dist(chara) <= 6) && (EClass.rnd(3) != 0 || fanatic))
6854 {
6855 chara.GoHostile(tg);
6856 }
6857 }
6858 }
Hostility OriginalHostility
Definition: Chara.cs:477
void GoHostile(Card _tg)
Definition: Chara.cs:6743

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

8787 {
8788 if (things.IsFull())
8789 {
8790 return false;
8791 }
8792 if (t.c_isImportant)
8793 {
8794 return false;
8795 }
8796 if (t.id == "1084")
8797 {
8798 return true;
8799 }
8800 if (t.trait is TraitBookExp)
8801 {
8802 return true;
8803 }
8804 if (t.trait.CanOnlyCarry || !t.trait.CanBeDestroyed || t.trait.CanExtendBuild || t.rarity == Rarity.Artifact || t.IsContainer)
8805 {
8806 return false;
8807 }
8808 if (base.IsPowerful && t.trait is TraitScroll { source: not null } traitScroll && traitScroll.source.abilityType.Contains("summon"))
8809 {
8810 return false;
8811 }
8812 return true;
8813 }
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 8765 of file Chara.cs.

8766 {
8768 {
8769 return true;
8770 }
8771 if (!IsValidGiftWeight(t, num))
8772 {
8773 return false;
8774 }
8775 if (!skipImportantCheck && t.c_isImportant)
8776 {
8777 return false;
8778 }
8779 if ((t.category.IsChildOf("furniture") || t.category.IsChildOf("junk")) && (!(t.trait is TraitFigure) || !HasElement(1427)) && !HasElement(1411))
8780 {
8781 return false;
8782 }
8783 return true;
8784 }
bool IsValidGiftWeight(Card t, int num=-1)
Definition: Chara.cs:8755

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

4570 {
4571 return true;
4572 }

◆ CanBeTempAlly()

bool Chara.CanBeTempAlly ( Chara  c)
inline

Definition at line 2565 of file Chara.cs.

2566 {
2567 if (IsPCFaction || IsGlobal || IsMinion || IsMultisize || EClass._zone.CountMinions(c) > c.MaxSummon || base.rarity >= Rarity.Legendary)
2568 {
2569 return false;
2570 }
2571 if (HasElement(1222))
2572 {
2573 return false;
2574 }
2575 return true;
2576 }
int MaxSummon
Definition: Chara.cs:734
override bool IsMultisize
Definition: Chara.cs:726
int CountMinions(Chara c)
Definition: Zone.cs:4037

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

9261 {
9262 if (IsPC || base.isScaled || HasElement(1273))
9263 {
9264 return false;
9265 }
9266 if (!EClass.debug.godMode)
9267 {
9268 if (base.c_daysWithPC > 360)
9269 {
9270 return affinity.CanSleepBeside();
9271 }
9272 return false;
9273 }
9274 return true;
9275 }
bool CanSleepBeside()
Definition: Affinity.cs:88
Affinity affinity
Definition: Chara.cs:320
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 2678 of file Chara.cs.

2679 {
2680 if (!IsMultisize)
2681 {
2682 if (base.rarity >= Rarity.Superior && !base.IsPCFactionOrMinion && ai is GoalCombat)
2683 {
2684 return !EClass._zone.IsPCFaction;
2685 }
2686 return false;
2687 }
2688 return true;
2689 }

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

1929 {
1930 if (EClass._zone.IsRegion)
1931 {
1932 return false;
1933 }
1935 {
1936 return false;
1937 }
1938 if (corruption >= 100)
1939 {
1940 return false;
1941 }
1942 if (con != DuplicateCondition.Water && con != DuplicateCondition.Quantum && (HasCondition<ConPoison>() || HasCondition<ConConfuse>() || HasCondition<ConDim>() || HasCondition<ConParalyze>() || HasCondition<ConSleep>() || HasCondition<ConBurning>() || HasCondition<ConFreeze>() || HasCondition<ConMiasma>()))
1943 {
1944 return false;
1945 }
1946 switch (con)
1947 {
1948 case DuplicateCondition.Scarab:
1950 {
1951 return false;
1952 }
1953 break;
1954 case DuplicateCondition.SpiderEgg:
1955 if (pos.cell.light > 0 || pos.IsSunLit)
1956 {
1957 return false;
1958 }
1959 break;
1960 }
1961 return true;
1962 }
DuplicateCondition
byte light
Definition: Cell.cs:80
bool HasRoof
Definition: Cell.cs:684
int corruption
Definition: Chara.cs:383
int CurrentGeneSlot
Definition: Chara.cs:1132
bool IsNight
Definition: Date.cs:112
GamePrincipal principal
Definition: Game.cs:225
bool IsIndoor
Definition: Map.cs:136
bool IsSunLit
Definition: Point.cs:178

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

8096 {
8097 if (t.IsDecayed && !HasElement(480))
8098 {
8099 return false;
8100 }
8101 if (HasElement(1250) && !t.HasElement(710))
8102 {
8103 return false;
8104 }
8105 if (shouldEat && (!(t.trait is TraitFoodPrepared) || t.c_isImportant))
8106 {
8107 return false;
8108 }
8109 if ((IsPC || (homeBranch != null && homeBranch.GetCivility() >= 50)) && (t.HasTag(CTAG.dish_fail) || t.id == "731"))
8110 {
8111 return false;
8112 }
8113 if (!t.IsNegativeGift && !t.HasTag(CTAG.ignoreUse) && !t.isEquipped)
8114 {
8115 return t.trait.CanEat(this);
8116 }
8117 return false;
8118 }
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:1175

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

8272 {
8273 return !body.IsTooHeavyToEquip(t);
8274 }
bool IsTooHeavyToEquip(Thing thing)
Definition: CharaBody.cs:187

References CharaBody.IsTooHeavyToEquip().

Referenced by GoalAutoCombat.TryUseRanged().

◆ CanInsult()

bool Chara.CanInsult ( )
inline

Definition at line 8676 of file Chara.cs.

8677 {
8678 foreach (ActList.Item item in ability.list.items)
8679 {
8680 if (item.act.id == 6630)
8681 {
8682 return true;
8683 }
8684 }
8685 return false;
8686 }
List< Item > items
Definition: ActList.cs:14
ActList list
Definition: CharaAbility.cs:13
CharaAbility ability
Definition: Chara.cs:430

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

◆ CanInteractTo() [1/2]

bool Chara.CanInteractTo ( Card  c)
inline

Definition at line 2785 of file Chara.cs.

2786 {
2787 return CanInteractTo(c.pos);
2788 }
bool CanInteractTo(Card c)
Definition: Chara.cs:2785

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

2791 {
2792 if (!p.IsValid)
2793 {
2794 return false;
2795 }
2796 if (EClass._map.cells[p.x, p.z].blocked)
2797 {
2798 return true;
2799 }
2800 if (!IsMultisize)
2801 {
2802 int num = ((p.z >= pos.z) ? ((p.x > pos.x) ? 1 : ((p.z > pos.z) ? 2 : 3)) : 0);
2803 if (EClass._map.cells[pos.x, pos.z].weights[num] == 0)
2804 {
2805 return false;
2806 }
2807 if (p.x != pos.x && p.z != pos.z)
2808 {
2809 Cell[,] cells = EClass._map.cells;
2810 int x = p.x;
2811 int z = pos.z;
2812 int num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2813 if (cells[pos.x, pos.z].weights[num2] == 0)
2814 {
2815 return false;
2816 }
2817 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2818 if (cells[p.x, p.z].weights[num2] == 0)
2819 {
2820 return false;
2821 }
2822 x = pos.x;
2823 z = p.z;
2824 num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2825 if (cells[pos.x, pos.z].weights[num2] == 0)
2826 {
2827 return false;
2828 }
2829 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2830 if (cells[p.x, p.z].weights[num2] == 0)
2831 {
2832 return false;
2833 }
2834 }
2835 }
2836 return true;
2837 }
Cell[,] cells
Definition: Map.cs:88
bool IsValid
Definition: Point.cs:84

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

4565 {
4566 return true;
4567 }

Referenced by HotItemNoItem._TrySetAct().

◆ CanMoveTo()

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

Definition at line 2691 of file Chara.cs.

2692 {
2693 if (!p.IsValid)
2694 {
2695 return false;
2696 }
2697 int num = ((p.z >= pos.z) ? ((p.x > pos.x) ? 1 : ((p.z > pos.z) ? 2 : 3)) : 0);
2698 if (allowDestroyPath && CanDestroyPath())
2699 {
2700 if (!p.IsInBounds)
2701 {
2702 return false;
2703 }
2704 }
2705 else
2706 {
2708 {
2709 return false;
2710 }
2711 if (p.x != pos.x && p.z != pos.z)
2712 {
2713 Cell[,] cells = EClass._map.cells;
2714 int x = p.x;
2715 int z = pos.z;
2716 int num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2717 if (cells[pos.x, pos.z].weights[num2] == 0)
2718 {
2719 return false;
2720 }
2721 if (cells[x, z].blocked && (!IsAstralBody || cells[x, z].IsSky || EClass._zone.IsRegion))
2722 {
2723 return false;
2724 }
2725 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2726 if (cells[p.x, p.z].weights[num2] == 0)
2727 {
2728 return false;
2729 }
2730 x = pos.x;
2731 z = p.z;
2732 num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2733 if (cells[pos.x, pos.z].weights[num2] == 0)
2734 {
2735 return false;
2736 }
2737 if (cells[x, z].blocked && (!IsAstralBody || cells[x, z].IsSky || EClass._zone.IsRegion))
2738 {
2739 return false;
2740 }
2741 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2742 if (cells[p.x, p.z].weights[num2] == 0)
2743 {
2744 return false;
2745 }
2746 }
2747 }
2748 if (IsPC)
2749 {
2750 if (IsEnemyOnPath(p))
2751 {
2752 return false;
2753 }
2754 }
2755 else if (p.HasChara && !IsMultisize && !CanReplace(p.FirstChara))
2756 {
2757 return false;
2758 }
2759 return true;
2760 }
bool IsSky
Definition: Cell.cs:970
bool IsAstralBody
Definition: Chara.cs:508
bool IsEnemyOnPath(Point p, bool cancelAI=true)
Definition: Chara.cs:2762
bool Contains(int dx, int dz)
Definition: MapBounds.cs:38
MapBounds bounds
Definition: Map.cs:55
Chara FirstChara
Definition: Point.cs:284
bool IsInBounds
Definition: Point.cs:100

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

4575 {
4576 if (c.isDestroyed)
4577 {
4578 return false;
4579 }
4580 Card rootCard = c.GetRootCard();
4581 if (rootCard.isDestroyed || (rootCard.ExistsOnMap && rootCard.pos.Distance(pos) > 1))
4582 {
4583 return false;
4584 }
4585 if (rootCard != this && things.IsFull(c.Thing))
4586 {
4587 return false;
4588 }
4589 return true;
4590 }
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 3547 of file Chara.cs.

3548 {
3550 {
3551 return false;
3552 }
3553 if (IsPC)
3554 {
3555 return true;
3556 }
3557 if (c.IsPC || c.pos.Equals(EClass.pc.pos) || c.host != null)
3558 {
3559 return false;
3560 }
3561 if (!IsHostile(c))
3562 {
3563 if (c.c_uidMaster != 0 || c.isSummon || base.IsPowerful || IsEscorted())
3564 {
3565 return true;
3566 }
3567 if (DestDist < c.DestDist)
3568 {
3569 return true;
3570 }
3571 if (IsPCParty && !c.IsPCParty)
3572 {
3573 return true;
3574 }
3575 if (IsPCFaction && !c.IsPCParty)
3576 {
3577 return true;
3578 }
3579 }
3580 return false;
3581 }
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:511
override bool IsPCParty
Definition: Chara.cs:635
int DestDist
Definition: Chara.cs:1047
bool IsHostile()
Definition: Chara.cs:6952
bool IsEscorted()
Definition: Chara.cs:2662
bool Equals(int _x, int _z)
Definition: Point.cs:962
virtual bool CanBePushed
Definition: TraitChara.cs:120

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

5478 {
5479 return EClass.world.date.IsExpired(base.c_dateDeathLock);
5480 }
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 1279 of file Chara.cs.

1280 {
1281 if (c == this)
1282 {
1283 return true;
1284 }
1285 if (!c.pos.IsValid)
1286 {
1287 return false;
1288 }
1289 if (c.isChara)
1290 {
1292 {
1293 return true;
1294 }
1295 if (c.isHidden && c != this && !canSeeInvisible)
1296 {
1297 return false;
1298 }
1299 }
1300 if (IsPC)
1301 {
1302 if (fov != null)
1303 {
1304 return fov.lastPoints.ContainsKey(c.pos.index);
1305 }
1306 return false;
1307 }
1308 return true;
1309 }
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:142
bool visibleWithTelepathy
Definition: Chara.cs:154
bool hasTelepathy
Definition: Chara.cs:144
Dictionary< int, byte > lastPoints
Definition: Fov.cs:36
int index
Definition: Point.cs:45

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

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

1263 {
1264 if (!p.IsValid || p.IsHidden)
1265 {
1266 return false;
1267 }
1268 if (IsPC)
1269 {
1270 if (fov != null)
1271 {
1272 return fov.lastPoints.ContainsKey(p.index);
1273 }
1274 return false;
1275 }
1276 return true;
1277 }
bool IsHidden
Definition: Point.cs:343

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

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

2390 {
2391 ApplyJob(remove: true);
2392 base.c_idJob = idNew;
2393 _job = null;
2394 ApplyJob();
2395 if (IsPCC)
2396 {
2397 PCC.Get(pccData).Build();
2398 }
2399 }
void ApplyJob(bool remove=false)
Definition: Chara.cs:2380
SourceJob.Row _job
Definition: Chara.cs:168

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

7511 {
7512 memberType = type;
7513 }
FactionMemberType memberType
Definition: Chara.cs:48

◆ ChangeRace()

void Chara.ChangeRace ( string  idNew)
inline

Definition at line 2509 of file Chara.cs.

2510 {
2511 ApplyRace(remove: true);
2512 base.c_idRace = idNew;
2513 _race = null;
2514 ApplyRace();
2515 ChangeMaterial(source.defMat.IsEmpty(race.material));
2516 }
@ ChangeMaterial
void ApplyRace(bool remove=false)
Definition: Chara.cs:2466
SourceRace.Row _race
Definition: Chara.cs:166

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

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

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

Referenced by ZonePreEnterBout.Execute().

◆ ChooseNewGoal()

void Chara.ChooseNewGoal ( )
inline

Definition at line 9367 of file Chara.cs.

9368 {
9369 if (IsPC && EClass.AdvMode)
9370 {
9371 SetNoGoal();
9372 return;
9373 }
9374 if (IsPCParty || base.noMove)
9375 {
9376 SetAI(new GoalIdle());
9377 return;
9378 }
9379 if ((IsHomeMember() && IsInHomeZone()) || IsGuest())
9380 {
9381 Goal goalFromTimeTable = GetGoalFromTimeTable(EClass.world.date.hour);
9382 if (goalFromTimeTable != null)
9383 {
9384 SetAI(goalFromTimeTable);
9385 if (goalFromTimeTable is GoalWork)
9386 {
9387 goalFromTimeTable.Tick();
9388 }
9389 return;
9390 }
9391 }
9392 if (goalList.index == -2)
9393 {
9395 }
9396 SetAI(goalList.Next());
9397 }
Status Tick()
Definition: AIAct.cs:366
Goal GetGoalFromTimeTable(int hour)
Definition: Chara.cs:9399
GoalListType goalListType
Definition: Chara.cs:285
AIAct SetNoGoal()
Definition: Chara.cs:9491
bool IsHomeMember()
Definition: Chara.cs:7018
bool IsGuest()
Definition: Chara.cs:7043
GoalList goalList
Definition: Chara.cs:206
bool IsInHomeZone()
Definition: Chara.cs:7023
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 7802 of file Chara.cs.

7803 {
7804 if (map == null)
7805 {
7806 map = EClass._map;
7807 }
7808 foreach (Card item in map.props.installed.all)
7809 {
7810 if (item.trait is TraitBed traitBed && traitBed.IsHolder(this))
7811 {
7812 traitBed.RemoveHolder(this);
7813 }
7814 }
7815 }
PropsManager props
Definition: Map.cs:94
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 9139 of file Chara.cs.

9140 {
9141 int num = 0;
9142 for (int num2 = things.Count - 1; num2 >= 0; num2--)
9143 {
9144 Thing thing = things[num2];
9145 if (ShouldThrowAway(thing, type))
9146 {
9147 num += thing.GetPrice(CurrencyType.Money, sell: true, PriceType.Default, this) * thing.Num;
9148 thing.Destroy();
9149 }
9150 }
9151 if (num > 0)
9152 {
9153 ModCurrency(num);
9154 if (type == ClearInventoryType.SellAtTown)
9155 {
9156 Msg.Say("party_sell", this, num.ToString() ?? "");
9157 PlaySound("pay");
9158 }
9159 }
9160 }
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:9034
override int GetPrice(CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
Definition: Thing.cs:833

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

Referenced by AI_Idle.Run().

◆ ClearTempElements()

void Chara.ClearTempElements ( )
inline

Definition at line 11042 of file Chara.cs.

11043 {
11044 if (tempElements != null)
11045 {
11047 tempElements = null;
11048 }
11049 }
ElementContainer tempElements
Definition: Chara.cs:38
void SetParent(Card c)

References ElementContainer.SetParent().

◆ CountDebuff()

int Chara.CountDebuff ( )
inline

Definition at line 10082 of file Chara.cs.

10083 {
10084 int num = 0;
10085 foreach (Condition condition in conditions)
10086 {
10087 if (condition.Type == ConditionType.Debuff)
10088 {
10089 num++;
10090 }
10091 }
10092 return num;
10093 }

References BaseStats.Type.

Referenced by GoalCombat.TryUseAbility().

◆ CountNumEaten()

int Chara.CountNumEaten ( Thing  food)
inline

Definition at line 10848 of file Chara.cs.

10849 {
10850 if (_historyFood == null)
10851 {
10852 return -1;
10853 }
10854 int num = 0;
10855 foreach (List<string> item in _historyFood)
10856 {
10857 foreach (string item2 in item)
10858 {
10859 if (item2 == food.id)
10860 {
10861 num++;
10862 }
10863 }
10864 }
10865 return num;
10866 }

References food, and item.

Referenced by FoodEffect.Proc().

◆ CreateReplacement()

Chara Chara.CreateReplacement ( )
inline

Definition at line 8529 of file Chara.cs.

8530 {
8531 Chara chara = CharaGen.Create(id);
8532 chara.c_originalHostility = base.c_originalHostility;
8533 if (chara.c_originalHostility != 0)
8534 {
8535 chara.hostility = chara.c_originalHostility;
8536 }
8537 if (orgPos != null)
8538 {
8539 chara.orgPos = orgPos.Copy();
8540 }
8541 chara.pos = pos.Copy();
8542 chara.isImported = true;
8543 chara.c_editorTags = base.c_editorTags;
8544 chara.c_editorTraitVal = base.c_editorTraitVal;
8545 chara.c_idTrait = base.c_idTrait;
8546 chara.homeZone = homeZone;
8547 return chara;
8548 }
Hostility c_originalHostility
Definition: Card.cs:1003
static Chara Create(string id, int lv=-1)
Definition: CharaGen.cs:17
Zone homeZone
Definition: Chara.cs:273
Point Copy()
Definition: Point.cs:487

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

6636 {
6637 Talk("goodBoy");
6638 Say(headpat ? "headpat" : "cuddle", this, c);
6639 c.ShowEmo(Emo.love);
6640 if (EClass.rnd(IsPC ? 100 : 5000) == 0)
6641 {
6642 c.MakeEgg();
6643 }
6644 if (headpat && this != c)
6645 {
6646 if (c.interest > 0)
6647 {
6648 c.ModAffinity(EClass.pc, 1 + EClass.rnd(3));
6649 c.interest -= 20 + EClass.rnd(10);
6650 }
6652 {
6653 foreach (Chara member in c.party.members)
6654 {
6655 if (!member.IsPC && CanSeeLos(member))
6656 {
6657 member.AddCondition<ConEuphoric>(100 + Evalue(6904) * 5);
6658 }
6659 }
6660 }
6661 }
6662 if (c.Evalue(1221) > 0)
6663 {
6664 int ele = ((c.MainElement == Element.Void) ? 924 : c.MainElement.id);
6665 if (c.id == "hedgehog_ether")
6666 {
6667 ele = 922;
6668 }
6669 Say("reflect_thorne", this, c);
6670 DamageHP(10L, ele, Power, AttackSource.Condition);
6671 }
6672 }
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:6613
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
Definition: Card.cs:6045
Element MainElement
Definition: Chara.cs:737
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Definition: Chara.cs:8451
int interest
Definition: Chara.cs:323
Religion faith
Definition: Chara.cs:445
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 10158 of file Chara.cs.

10159 {
10160 bool flag = state == BlessedState.Blessed;
10161 switch (type)
10162 {
10163 case CureType.Heal:
10164 case CureType.Prayer:
10165 CureCondition<ConFear>();
10166 CureCondition<ConBlind>(2 * p / 100 + 5);
10167 CureCondition<ConPoison>(5 * p / 100 + 5);
10168 CureCondition<ConConfuse>(10 * p / 100 + 10);
10169 CureCondition<ConDim>(p / 100 + 5);
10170 CureCondition<ConBleed>(2 * p / 100 + 10);
10171 if (flag)
10172 {
10173 SAN.Mod(-15);
10174 }
10175 break;
10176 case CureType.CureBody:
10177 CureCondition<ConBlind>(5 * p / 100 + 15);
10178 CureCondition<ConPoison>(10 * p / 100 + 15);
10179 CureCondition<ConBleed>(5 * p / 100 + 20);
10180 CureTempElements(p, body: true, mind: false);
10181 break;
10182 case CureType.CureMind:
10183 CureCondition<ConFear>();
10184 CureCondition<ConDim>(3 * p / 100 + 10);
10185 CureTempElements(p, body: false, mind: true);
10186 break;
10187 case CureType.Sleep:
10188 {
10189 for (int num2 = conditions.Count - 1; num2 >= 0; num2--)
10190 {
10191 Condition condition2 = conditions[num2];
10192 if (!(condition2 is ConSleep) && !(condition2 is ConFaint))
10193 {
10194 if (condition2.isPerfume)
10195 {
10196 condition2.Mod(-1, force: true);
10197 }
10198 else if (condition2.Type == ConditionType.Bad || condition2.Type == ConditionType.Debuff)
10199 {
10200 condition2.Kill();
10201 }
10202 }
10203 }
10204 CureCondition<ConWait>();
10205 CureCondition<ConDisease>((EClass.rnd(20) + 10) * p / 100);
10206 bool flag2 = HasCondition<ConAnorexia>();
10207 base.c_vomit -= (flag2 ? 3 : 2) * p / 100;
10208 if (base.c_vomit < 0)
10209 {
10210 base.c_vomit = 0;
10211 if (flag2)
10212 {
10213 RemoveCondition<ConAnorexia>();
10214 }
10215 }
10216 break;
10217 }
10218 case CureType.HealComplete:
10219 case CureType.Death:
10220 case CureType.Jure:
10221 case CureType.Boss:
10222 case CureType.Unicorn:
10223 {
10224 CureTempElements(p * 100, body: true, mind: true);
10225 for (int num = conditions.Count - 1; num >= 0; num--)
10226 {
10227 Condition condition = conditions[num];
10228 if (condition is ConAnorexia && type != CureType.Death && type != CureType.Unicorn && type != CureType.Jure)
10229 {
10230 continue;
10231 }
10232 switch (condition.Type)
10233 {
10234 case ConditionType.Bad:
10235 case ConditionType.Debuff:
10236 case ConditionType.Disease:
10237 condition.Kill();
10238 continue;
10239 case ConditionType.Stance:
10240 if (type == CureType.Death)
10241 {
10242 condition.Kill();
10243 continue;
10244 }
10245 break;
10246 }
10247 if (type == CureType.Death && condition.isPerfume)
10248 {
10249 condition.Kill();
10250 }
10251 }
10252 CureCondition<ConWait>();
10253 CureCondition<ConSleep>();
10254 switch (type)
10255 {
10256 case CureType.Death:
10257 case CureType.Boss:
10258 case CureType.Unicorn:
10259 SAN.Mod(-20);
10260 RemoveCondition<ConBrightnessOfLife>();
10261 RemoveCondition<ConDeathSentense>();
10262 break;
10263 case CureType.Jure:
10264 SAN.Mod(-999);
10265 if (HasElement(1206))
10266 {
10267 SetFeat(1206, 0, msg: true);
10268 }
10269 RemoveCondition<ConBrightnessOfLife>();
10270 RemoveCondition<ConDeathSentense>();
10271 break;
10272 case CureType.CureBody:
10273 case CureType.CureMind:
10274 case CureType.Prayer:
10275 break;
10276 }
10277 break;
10278 }
10279 }
10280 }
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:11012
Stats SAN
Definition: Chara.cs:1219
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 10095 of file Chara.cs.

10095 : Condition
10096 {
10097 T condition = GetCondition<T>();
10098 if (condition != null)
10099 {
10100 int value = condition.value - v;
10101 condition.value = value;
10102 if (condition.value <= 0)
10103 {
10104 condition.Kill();
10105 }
10106 }
10107 }
override T GetCondition< T >()
Definition: Chara.cs:10121

◆ CureHost()

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

Definition at line 10145 of file Chara.cs.

10146 {
10147 if (parasite != null)
10148 {
10149 parasite.Cure(type, p, state);
10150 }
10151 if (ride != null)
10152 {
10153 ride.Cure(type, p, state);
10154 }
10155 Cure(type, p, state);
10156 }
void Cure(CureType type, int p=100, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:10158

References Cure(), and ride.

Referenced by FactionBranch.DailyOutcome().

◆ CureTempElements()

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

Definition at line 11012 of file Chara.cs.

11013 {
11014 if (tempElements != null)
11015 {
11016 if (body)
11017 {
11019 }
11020 if (mind)
11021 {
11023 }
11024 }
11025 void Cure(int[] eles)
11026 {
11027 foreach (int ele in eles)
11028 {
11029 if (tempElements == null)
11030 {
11031 break;
11032 }
11033 Element element = tempElements.GetElement(ele);
11034 if (element != null && element.vBase < 0)
11035 {
11036 ModTempElement(ele, Mathf.Clamp(p / 20 + EClass.rnd(p / 20), 1, -element.vBase));
11037 }
11038 }
11039 }
11040 }
void ModTempElement(int ele, int a, bool naturalDecay=false, bool onlyRenew=false)
Definition: Chara.cs:10920
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 10978 of file Chara.cs.

10979 {
10980 ModTempElement(ele, onlyRenew ? (-p / 20) : (-(p / 100 + EClass.rnd(p / 100 + 1) + 1)), naturalDecay: false, onlyRenew);
10981 }

References EClass.rnd().

◆ DamageTempElements()

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

Definition at line 10966 of file Chara.cs.

10967 {
10968 if (body)
10969 {
10970 DamageTempElement(Element.List_Body.RandomItem(), p, onlyRenew);
10971 }
10972 if (mind)
10973 {
10974 DamageTempElement(Element.List_Mind.RandomItem(), p, onlyRenew);
10975 }
10976 }
void DamageTempElement(int ele, int p, bool onlyRenew=false)
Definition: Chara.cs:10978

References Element.List_Body, and Element.List_Mind.

◆ DestroyPath()

void Chara.DestroyPath ( Point  pos)
inline

Definition at line 3436 of file Chara.cs.

3437 {
3438 bool broke = false;
3439 pos.ForeachMultiSize(base.W, base.H, delegate(Point _p, bool main)
3440 {
3441 if (_p.IsValid)
3442 {
3443 if (_p.HasBlock)
3444 {
3445 EClass._map.MineBlock(_p, recoverBlock: false, this);
3446 if (_p.HasObj)
3447 {
3448 EClass._map.MineObj(_p, null, this);
3449 }
3450 broke = true;
3451 }
3452 if (_p.HasObj && _p.IsBlocked)
3453 {
3454 EClass._map.MineObj(_p, null, this);
3455 broke = true;
3456 }
3457 _p.Things.ForeachReverse(delegate(Thing t)
3458 {
3459 if (t.IsInstalled && (t.trait.IsBlockPath || t.trait.IsDoor))
3460 {
3461 if (t.isNPCProperty && t.trait.CanBeDestroyed)
3462 {
3463 t.Destroy();
3464 }
3465 else if (!t.IsUnique && !t.trait.CanBeDestroyed)
3466 {
3467 t.SetPlaceState(PlaceState.roaming);
3468 }
3469 }
3470 });
3471 }
3472 });
3473 if (broke)
3474 {
3475 Msg.Say("stomp");
3476 Shaker.ShakeCam("stomp");
3477 }
3478 }
if(!match.Success)
bool IsUnique
Definition: Card.cs:2143
void ForeachMultiSize(int w, int h, Action< Point, bool > action)
Definition: Point.cs:1387
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 5672 of file Chara.cs.

5673 {
5674 combatCount = 0;
5675 if (isDead)
5676 {
5677 return;
5678 }
5679 if (host != null)
5680 {
5681 base.hp = -1;
5682 if ((uint)(attackSource - 17) > 1u)
5683 {
5684 AddCondition<ConFaint>(200, force: true);
5685 return;
5686 }
5687 ActRide.Unride(host, this);
5688 }
5689 bool isInActiveZone = IsInActiveZone;
5690 if (isInActiveZone)
5691 {
5692 if (id == "putty" && origin != null && origin.IsPCParty)
5693 {
5695 }
5696 if (IsPC)
5697 {
5699 }
5700 if (base.isSummon && !GetBool(136))
5701 {
5702 if (id == "tsunami")
5703 {
5704 pos.PlaySound("water");
5705 }
5706 else
5707 {
5708 Say("summon_vanish", this);
5709 pos.PlayEffect("vanish");
5710 pos.PlaySound("vanish");
5711 }
5712 Destroy();
5713 return;
5714 }
5715 if ((uint)(attackSource - 17) <= 1u)
5716 {
5717 if (attackSource == AttackSource.Euthanasia && trait is TraitLittleOne)
5718 {
5719 MakeEgg();
5720 if (IsPCFaction)
5721 {
5723 }
5724 }
5725 PlayEffect("revive");
5726 PlaySound("chime_angel");
5727 }
5728 else
5729 {
5730 Effect.Get("blood").Play((parent is Chara) ? (parent as Chara).pos : pos).SetParticleColor(EClass.Colors.matColors[base.material.alias].main)
5731 .Emit(50);
5732 AddBlood(AI_Slaughter.slaughtering ? 12 : (2 + EClass.rnd(2)));
5733 PlaySound(base.material.GetSoundDead(source));
5734 }
5737 ClearFOV();
5738 }
5739 if (base.hp >= 0)
5740 {
5741 base.hp = -1;
5742 }
5743 string text = "";
5744 "dead_in".langGame(EClass._zone.Name);
5745 string text2 = ((origin == null) ? "" : origin.GetName(NameStyle.Full));
5746 if (LangGame.Has("dead_" + attackSource))
5747 {
5748 text = "dead_" + attackSource;
5749 }
5750 else
5751 {
5752 if (e != Element.Void && e != null)
5753 {
5754 text = "dead_" + e.source.alias;
5755 }
5756 if (text == "" || !LangGame.Has(text))
5757 {
5758 text = "dead";
5759 }
5760 }
5761 if (IsPC)
5762 {
5763 EClass.player.staminaRecovery = 0;
5764 EClass._zone.isDeathLocation = true;
5765 string s = ((origin == null) ? text : "dead_by");
5767 if (attackSource == AttackSource.Wrath)
5768 {
5770 }
5771 EClass.player.deathMsg = GameLang.Parse(s.langGame(), thirdPerson: true, EClass.pc.NameBraced, "dead_in".langGame(EClass._zone.Name), text2);
5773 if (EClass._zone.instance is ZoneInstanceRandomQuest zoneInstanceRandomQuest)
5774 {
5775 zoneInstanceRandomQuest.status = ZoneInstance.Status.Fail;
5776 }
5777 AI_PlayMusic.keepPlaying = false;
5778 }
5779 if (isInActiveZone)
5780 {
5781 if (attackSource == AttackSource.DeathSentence || attackSource == AttackSource.Euthanasia)
5782 {
5783 Msg.Say("goto_heaven", this);
5784 }
5785 else
5786 {
5787 if (originalTarget != null || origin == null || !origin.isSynced || (attackSource != AttackSource.Melee && attackSource != AttackSource.Range))
5788 {
5789 Msg.Say(text, this, "", text2);
5790 }
5791 string text3 = TalkTopic("dead");
5792 if (!text3.IsEmpty())
5793 {
5794 text3 = text3.StripBrackets();
5795 }
5796 bool flag = base.rarity >= Rarity.Legendary && !IsPCFaction;
5797 if (!IsPC && flag)
5798 {
5799 MakeGrave(text3);
5800 }
5801 Msg.SetColor();
5802 SpawnLoot(origin);
5803 }
5804 if (IsPC)
5805 {
5807 }
5808 }
5809 if (IsPCFaction)
5810 {
5811 if (homeBranch != null)
5812 {
5813 homeBranch.Log(text, this, "");
5814 }
5815 WidgetPopText.Say("popDead".lang(base.Name), FontColor.Bad);
5816 if (!IsPC)
5817 {
5818 if (EClass.player.stats.allyDeath == 0)
5819 {
5820 Tutorial.Reserve("death_pet");
5821 }
5823 }
5824 }
5825 if (id == "mandrake" || HasElement(488))
5826 {
5827 Say("a_scream", this);
5828 ActEffect.ProcAt(EffectId.Scream, base.LV * 3 + 200, BlessedState.Normal, this, this, pos, isNeg: true);
5829 }
5830 daysStarved = 0;
5831 isDead = true;
5833 enemy = null;
5834 _cooldowns = null;
5835 base.isSale = false;
5836 SetInt(70);
5837 EClass._map.props.sales.Remove(this);
5838 Cure(CureType.Death);
5839 SetAI(new NoGoal());
5841 if (isInActiveZone && EClass._zone.HasLaw && IsHuman && OriginalHostility >= Hostility.Neutral)
5842 {
5843 pos.TalkWitnesses(origin?.Chara, "witness", 3, WitnessType.crime, (Chara c) => !c.IsPCParty && !c.IsUnique);
5844 }
5845 if (IsPC)
5846 {
5847 EClass.player.returnInfo = null;
5848 EClass.player.uidLastTravelZone = 0;
5849 foreach (Chara chara3 in EClass._map.charas)
5850 {
5851 if (chara3.IsHostile())
5852 {
5853 chara3.hostility = chara3.OriginalHostility;
5854 }
5855 if (chara3.enemy == EClass.pc)
5856 {
5857 chara3.enemy = null;
5858 }
5859 }
5860 if (EClass.pc.things.Find("letter_will") != null && EClass.rnd(10) == 0)
5861 {
5862 EClass.player.preventDeathPenalty = true;
5863 }
5864 }
5865 else
5866 {
5867 bool flag2 = currentZone.IsActiveZone && IsLocalChara && !currentZone.IsPCFaction;
5868 if (currentZone is Zone_LittleGarden && id == "littleOne")
5869 {
5870 flag2 = false;
5871 }
5872 if (flag2)
5873 {
5874 EClass._map.deadCharas.Add(this);
5875 }
5876 currentZone.RemoveCard(this);
5877 }
5878 if ((origin != null && origin.IsPCParty) || IsPCFaction)
5879 {
5880 int a = -10;
5881 if (IsPCFaction && !IsPCParty && (origin == null || !origin.IsPCParty))
5882 {
5883 a = -5;
5884 }
5885 ModAffinity(EClass.pc, a, show: false);
5886 string text4 = id;
5887 if (!(text4 == "quru"))
5888 {
5889 if (text4 == "corgon")
5890 {
5891 EClass.game.cards.globalCharas.Find("quru")?.ModAffinity(EClass.pc, -20, show: false);
5892 }
5893 }
5894 else
5895 {
5896 EClass.game.cards.globalCharas.Find("corgon")?.ModAffinity(EClass.pc, -20, show: false);
5897 }
5898 }
5899 if (origin != null)
5900 {
5901 if (origin.IsPCParty || origin.IsPCPartyMinion)
5902 {
5903 int num = 0;
5904 if (trait is TraitMerchantTravel && !base.isSummon)
5905 {
5906 num = -20;
5907 }
5908 else if (OriginalHostility >= Hostility.Friend && IsHuman && !base.IsPCFactionOrMinion)
5909 {
5910 num = -5;
5911 }
5912 else if (race.id == "cat" && OriginalHostility >= Hostility.Neutral)
5913 {
5914 EClass.pc.Say("killcat");
5915 num = -1;
5916 }
5917 if (EClass.pc.party.HasElement(1563) && num < 0)
5918 {
5919 num = num * 30 / 100;
5920 }
5921 if (num != 0)
5922 {
5923 EClass.player.ModKarma(num);
5924 }
5925 }
5926 if (origin == EClass.pc)
5927 {
5928 EClass.pc.faith.Revelation("kill", EClass.pc, 10);
5929 }
5930 else if (origin.IsPCFaction)
5931 {
5932 origin.Chara.ModAffinity(EClass.pc, 1, show: false);
5933 origin.Chara.ShowEmo(Emo.love);
5934 }
5935 }
5936 if (base.sourceBacker != null && origin != null && origin.IsPCParty)
5937 {
5938 EClass.player.doneBackers.Add(base.sourceBacker.id);
5939 }
5940 if (base.IsPCFactionOrMinion)
5941 {
5943 {
5944 Msg.Say("abort_allyDead");
5945 }
5946 }
5948 {
5949 Msg.Say("abort_enemyDead");
5950 }
5951 if (IsPCParty && !IsPC)
5952 {
5954 base.c_wasInPcParty = true;
5955 EClass.pc.Say("allyDead");
5956 }
5957 switch (id)
5958 {
5959 case "littleOne":
5960 if (attackSource != AttackSource.Euthanasia && !IsPCFaction)
5961 {
5962 EClass.player.flags.little_killed = true;
5964 }
5965 break;
5966 case "big_daddy":
5967 case "big_daddy2":
5968 if (!IsPCFaction)
5969 {
5970 Chara chara = CharaGen.Create("littleOne");
5971 EClass._zone.AddCard(chara, pos.Copy());
5972 Msg.Say("little_pop");
5974 }
5975 break;
5976 case "shark_sister":
5977 if (!IsPCFaction)
5978 {
5979 Chara t = CharaGen.Create("sister_shark");
5980 EClass._zone.AddCard(t, pos.Copy());
5981 Msg.Say("shark_pop");
5982 }
5983 break;
5984 }
5985 if (attackSource == AttackSource.Finish && origin != null && origin.Evalue(665) > 0)
5986 {
5987 Chara chara2 = CharaGen.CreateFromFilter("c_plant", base.LV);
5988 EClass._zone.AddCard(chara2, pos.Copy());
5989 if (chara2.LV < base.LV)
5990 {
5991 chara2.SetLv(base.LV);
5992 }
5993 chara2.MakeMinion((origin.IsPCParty || origin.IsPCPartyMinion) ? EClass.pc : origin.Chara, MinionType.Friend);
5994 Msg.Say("plant_pop", this, chara2);
5995 }
5998 trait.OnDie();
5999 }
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:6447
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:7069
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:6679
bool GetBool(string id)
Definition: Card.cs:2557
virtual bool IsPCFaction
Definition: Card.cs:2339
void SpawnLoot(Card origin)
Definition: Card.cs:5354
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:118
bool IsHuman
Definition: Chara.cs:928
int daysStarved
Definition: Chara.cs:335
void MakeMinion(Chara _master, MinionType type=MinionType.Default)
Definition: Chara.cs:2587
string NameBraced
Definition: Chara.cs:522
void ClearTempElements()
Definition: Chara.cs:11042
string TalkTopic(string topic="calm")
Definition: Chara.cs:7438
void TryDropBossLoot()
Definition: Chara.cs:6001
bool IsLocalChara
Definition: Chara.cs:890
Chara enemy
Definition: Chara.cs:88
bool IsInActiveZone
Definition: Chara.cs:887
void TryDropCarryOnly()
Definition: Chara.cs:4897
void MakeGrave(string lastword)
Definition: Chara.cs:5589
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:49
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:816
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)
virtual void OnDie()
Definition: Trait.cs:1273
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:1208
virtual bool HasLaw
Definition: Zone.cs:236
void RemoveCard(Card t)
Definition: Zone.cs:2199
void ResetHostility()
Definition: Zone.cs:2922
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(), TraitBaseSpellbook.OnRead(), ActEffect.ProcAt(), TaskCullLife.Run(), Slap(), and ConDeathSentense.Tick().

◆ DiminishTempElements()

void Chara.DiminishTempElements ( int  a = 1)
inline

Definition at line 10997 of file Chara.cs.

10998 {
10999 if (tempElements == null)
11000 {
11001 return;
11002 }
11003 foreach (Element item in tempElements.dict.Values.ToList())
11004 {
11005 if (item.vBase > 0)
11006 {
11007 ModTempElement(item.id, -Mathf.Min(item.vBase * 5 / 100 + 1, item.vBase), naturalDecay: true);
11008 }
11009 }
11010 }

References ElementContainer.dict, and item.

◆ Divorce()

void Chara.Divorce ( Chara  c)
inline

Definition at line 8629 of file Chara.cs.

8630 {
8631 if (base.c_love != null)
8632 {
8633 base.c_love.dateMarriage = 0;
8634 base.c_love.dateWedding = 0;
8635 SetFeat(1275, 0);
8637 }
8638 }
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 6623 of file Chara.cs.

6624 {
6625 SetAI(new DynamicAIAct("", delegate
6626 {
6627 onPerform();
6628 return true;
6629 })
6630 {
6631 wait = wait
6632 });
6633 }

◆ DoHostileAction()

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

Definition at line 6767 of file Chara.cs.

6768 {
6769 if (_tg == null || !_tg.isChara)
6770 {
6771 return;
6772 }
6773 Chara chara = _tg.Chara;
6774 if (chara.IsPC)
6775 {
6776 EClass.pc.combatCount = 10;
6777 }
6778 if (!chara.IsAliveInCurrentZone || !IsAliveInCurrentZone || chara == this)
6779 {
6780 return;
6781 }
6782 if ((IsPCFaction || IsPCFactionMinion) && (chara.IsPCFaction || chara.IsPCFactionMinion))
6783 {
6784 chara.Say("frown", this, chara);
6785 }
6786 else
6787 {
6788 if (EClass._zone.IsRegion)
6789 {
6790 return;
6791 }
6792 if (IsPC)
6793 {
6794 if (chara.IsFriendOrAbove() && !immediate)
6795 {
6796 chara.Say("frown", this, chara);
6797 chara.ShowEmo(Emo.sad);
6798 chara.hostility = Hostility.Neutral;
6799 return;
6800 }
6801 if (!chara.IsPCFaction && chara.hostility >= Hostility.Neutral && !EClass._zone.IsPCFaction)
6802 {
6803 bool flag = chara.id == "fanatic";
6804 if (EClass.rnd(4) == 0 || flag)
6805 {
6806 chara.Say("callHelp", chara);
6807 chara.CallHelp(this, flag);
6808 }
6809 }
6810 if (chara.hostility <= Hostility.Enemy)
6811 {
6812 foreach (Chara member in EClass.pc.party.members)
6813 {
6814 if (member != EClass.pc && member.enemy == null && member.CanSee(chara))
6815 {
6816 member.SetEnemy(chara);
6817 }
6818 }
6819 }
6820 }
6821 else if (chara.IsPC && hostility <= Hostility.Enemy)
6822 {
6823 foreach (Chara member2 in EClass.pc.party.members)
6824 {
6825 if (member2 != EClass.pc && member2.enemy == null && member2.CanSee(this))
6826 {
6827 member2.SetEnemy(this);
6828 }
6829 }
6830 }
6831 if (chara.calmCheckTurn <= 0 || IsPC)
6832 {
6833 chara.calmCheckTurn = (IsPC ? (20 + EClass.rnd(30)) : (10 + EClass.rnd(10)));
6834 }
6835 if (hostility != Hostility.Enemy || chara.hostility != Hostility.Enemy)
6836 {
6837 GoHostile(chara);
6838 chara.GoHostile(this);
6839 if (base.isHidden && !chara.CanSee(this) && !chara.IsDisabled && !chara.IsPCParty && !chara.IsPCPartyMinion && EClass.rnd(10 + Dist(chara) * 10) == 0)
6840 {
6841 Thing t = ThingGen.Create("49");
6842 ActThrow.Throw(chara, pos, t);
6843 Act.TC = chara;
6844 }
6845 }
6846 }
6847 }
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:569
override bool IsPCPartyMinion
Definition: Chara.cs:659
int calmCheckTurn
Definition: Chara.cs:120
bool CanSee(Card c)
Definition: Chara.cs:1279
override bool IsPCFactionMinion
Definition: Chara.cs:675
bool IsFriendOrAbove()
Definition: Chara.cs:7048
Chara SetEnemy(Chara c=null)
Definition: Chara.cs:6718
void CallHelp(Chara tg, bool fanatic=false)
Definition: Chara.cs:6849
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 5467 of file Chara.cs.

5468 {
5469 Say("drink", this, t.Duplicate(1));
5470 Say("quaff");
5471 PlaySound("drink");
5472 t.ModNum(-1);
5473 FoodEffect.ProcDrink(this, t.Thing);
5474 _ = IsPC;
5475 }
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 4909 of file Chara.cs.

4910 {
4911 if (held == null)
4912 {
4913 return null;
4914 }
4915 if (IsPC)
4916 {
4917 WidgetHotbar.dirtyCurrentItem = true;
4919 }
4920 Card card = EClass._zone.AddCard(held, dropPos ?? pos);
4921 card.OnLand();
4922 if (card.trait.CanOnlyCarry)
4923 {
4924 card.SetPlaceState(PlaceState.installed);
4925 }
4926 return card;
4927 }
Card held
Definition: Chara.cs:72
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 4929 of file Chara.cs.

4930 {
4931 if (t.c_isImportant)
4932 {
4933 Msg.Say("markedImportant");
4934 return;
4935 }
4936 if (!t.trait.CanBeDropped)
4937 {
4938 Msg.Say("cantDrop", t);
4939 return;
4940 }
4941 if (t.trait is TraitAbility)
4942 {
4943 SE.Trash();
4944 t.Destroy();
4945 return;
4946 }
4947 Msg.Say("dropItem", t.Name);
4948 t.ignoreAutoPick = true;
4949 PlaySound("drop");
4950 EClass._zone.AddCard(t, pos);
4951 if (t.trait.CanOnlyCarry)
4952 {
4953 t.Install();
4954 }
4955 }
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 1986 of file Chara.cs.

1987 {
1988 Chara chara = CharaGen.Create(id);
1989 chara.mana.value = mana.value;
1990 chara.stamina.value = stamina.value;
1991 foreach (KeyValuePair<int, Element> item in elements.dict)
1992 {
1993 if (item.Key != 1275)
1994 {
1995 Element orCreateElement = chara.elements.GetOrCreateElement(item.Key);
1996 orCreateElement.vBase = item.Value.ValueWithoutLink - orCreateElement.vSource;
1997 }
1998 }
1999 chara.SetFaith(faith);
2000 chara.bio = IO.DeepCopy(bio);
2001 chara.LV = base.LV;
2002 chara.c_daysWithGod = base.c_daysWithGod;
2003 chara.RefreshFaithElement();
2004 chara.hp = (int)Mathf.Clamp((float)chara.MaxHP * ((float)base.hp / (float)MaxHP) * 0.99f, 0f, chara.MaxHP);
2005 chara.isCopy = true;
2006 chara.isScaled = base.isScaled;
2007 chara.c_altName = base.c_altName;
2008 chara._alias = _alias;
2009 if (pccData != null)
2010 {
2011 chara.pccData = IO.DeepCopy(pccData);
2012 }
2013 if (HaveFur())
2014 {
2015 chara.c_fur = -1;
2016 }
2017 return chara;
2018 }
bool HaveFur()
Definition: Card.cs:8451
Stats mana
Definition: Chara.cs:1215
void RefreshFaithElement()
Definition: Chara.cs:10877
string _alias
Definition: Chara.cs:225
void SetFaith(string id)
Definition: Chara.cs:1786
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 10992 of file Chara.cs.

10993 {
10994 ModTempElement(ele, onlyRenew ? (p / 20) : (p / 100 + EClass.rnd(p / 100 + 1)), naturalDecay: false, onlyRenew);
10995 }

References EClass.rnd().

◆ EnhanceTempElements()

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

Definition at line 10983 of file Chara.cs.

10984 {
10985 int[] array = (body ? Element.List_Body : Element.List_Mind);
10986 foreach (int ele in array)
10987 {
10988 EnhanceTempElement(ele, p, onlyRenew);
10989 }
10990 }
void EnhanceTempElement(int ele, int p, bool onlyRenew=false)
Definition: Chara.cs:10992

References Element.List_Mind.

◆ EQ_CAT()

void Chara.EQ_CAT ( string  s)
inline

Definition at line 5444 of file Chara.cs.

5445 {
5446 int slot = EClass.sources.categories.map[s].slot;
5447 BodySlot bodySlot = ((slot == 0) ? null : body.GetSlot(slot));
5448 if ((slot == 0 || bodySlot != null) && (slot != 37 || !HasElement(1209)))
5449 {
5450 SetEQQuality();
5451 Thing thing = ThingGen.CreateFromCategory(s, base.LV);
5452 AddThing(thing);
5453 if (bodySlot != null && !body.Equip(thing, bodySlot))
5454 {
5455 thing.Destroy();
5456 }
5457 }
5458 }
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:5391
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 5424 of file Chara.cs.

5425 {
5426 SetEQQuality();
5427 if (r != Rarity.Random)
5428 {
5429 CardBlueprint.current.rarity = r;
5430 }
5431 Thing thing = ThingGen.Create(s, mat, base.LV);
5432 if (body.GetSlot(thing, onlyEmpty: true) == null)
5433 {
5434 return thing;
5435 }
5436 AddThing(thing);
5437 if (!body.Equip(thing))
5438 {
5439 thing.Destroy();
5440 }
5441 return thing;
5442 }

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

5461 {
5462 SetEQQuality();
5463 Thing t = ThingGen.Create(s, -1, base.LV).SetNum(num);
5464 AddThing(t);
5465 }
Thing SetNum(int a)
Definition: Card.cs:3676

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

◆ EvalueRiding()

int Chara.EvalueRiding ( )
inline

Definition at line 6534 of file Chara.cs.

6535 {
6536 if (ride != null && ride.HasCondition<ConTransmuteBroom>() && HasElement(1417))
6537 {
6538 return 25 + Evalue(226) * 125 / 100;
6539 }
6540 return Evalue(226);
6541 }

References ride.

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

◆ FallFromZone()

void Chara.FallFromZone ( )
inline

Definition at line 3776 of file Chara.cs.

3777 {
3778 Msg.Say("skyFall", EClass.pc, EClass._zone.Name);
3779 Zone zone = (EClass._zone.isExternalZone ? null : EClass._zone.GetTopZone().FindZone(EClass._zone.lv - 1));
3780 zone = zone ?? EClass.world.region;
3782 {
3783 state = ZoneTransition.EnterState.Fall,
3784 x = pos.x,
3785 z = pos.z
3786 });
3787 }
void MoveZone(string alias)
Definition: Chara.cs:3583
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:2115

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

8323 {
8324 TraitToolRange ranged = weapon.trait as TraitToolRange;
8325 Thing thing = (IsPC ? EClass.pc.things.Find<TraitQuiver>() : null);
8326 if (thing != null)
8327 {
8328 Thing thing2 = thing.things.Find((Thing t) => ranged.IsAmmo(t));
8329 if (thing2 != null)
8330 {
8331 return thing2;
8332 }
8333 }
8334 return things.Find((Thing t) => ranged.IsAmmo(t));
8335 }
bool IsAmmo
Definition: Card.cs:2301
Thing ranged
Definition: Chara.cs:100

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

7818 {
7819 foreach (Card item in EClass._map.props.installed.all)
7820 {
7821 if (item.trait is TraitBed traitBed && traitBed.IsHolder(this))
7822 {
7823 return traitBed;
7824 }
7825 }
7826 return null;
7827 }

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

8050 {
8051 Thing result = null;
8052 int num = -1;
8053 if (IsPC)
8054 {
8055 return null;
8056 }
8057 foreach (Thing item in things.List((Thing t) => CanEat(t, shouldEat: true) && !t.c_isImportant, onlyAccessible: true))
8058 {
8059 int num2 = CountNumEaten(item);
8060 int num3 = 100 - num2 + (item.HasElement(757) ? 10 : 0);
8061 if (num3 > num)
8062 {
8063 result = item;
8064 num = num3;
8065 }
8066 }
8067 return result;
8068 }
bool CanEat(Thing t, bool shouldEat=false)
Definition: Chara.cs:8095
int CountNumEaten(Thing food)
Definition: Chara.cs:10848
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 2653 of file Chara.cs.

2654 {
2655 if (IsMinion)
2656 {
2657 master = EClass._map.FindChara(base.c_uidMaster);
2658 }
2659 return master;
2660 }
Chara FindChara(string id)
Definition: Map.cs:2768

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

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

◆ FindNearestNewEnemy()

bool Chara.FindNearestNewEnemy ( )
inline

Definition at line 6937 of file Chara.cs.

6938 {
6939 for (int i = 0; i < EClass._map.charas.Count; i++)
6940 {
6941 Chara chara = EClass._map.charas[i];
6942 if (chara != this && chara != enemy && (chara.mimicry == null || !chara.mimicry.IsThing) && IsHostile(chara) && Dist(chara) <= 1 && CanInteractTo(chara.pos))
6943 {
6944 DoHostileAction(chara);
6945 enemy = chara;
6946 return true;
6947 }
6948 }
6949 return false;
6950 }
void DoHostileAction(Card _tg, bool immediate=false)
Definition: Chara.cs:6767
ConBaseTransmuteMimic mimicry
Definition: Chara.cs:108

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

6861 {
6862 if (EClass._zone.isPeace && base.IsPCFactionOrMinion && !IsPC)
6863 {
6864 return false;
6865 }
6866 if (enemy != null && !enemy.IsAliveInCurrentZone)
6867 {
6868 enemy = null;
6869 }
6870 if (enemy != null)
6871 {
6872 return false;
6873 }
6874 if (IsPCParty && EClass.pc.isHidden && base.isHidden)
6875 {
6876 return false;
6877 }
6878 if (mimicry != null && mimicry.IsThing)
6879 {
6880 return false;
6881 }
6882 if (!base.IsPCFactionOrMinion && OriginalHostility == Hostility.Neutral && !(trait is TraitGuard) && id != "unicorn")
6883 {
6884 return false;
6885 }
6886 bool flag = enemy != null || ai is GoalCombat;
6887 int num = (base.PER + Evalue(210) * 2) * ((!flag) ? 1 : 2);
6888 bool flag2 = IsPCParty && !IsPC && EClass.game.config.tactics.dontWander;
6889 bool flag3 = !IsPCParty;
6890 Chara chara = null;
6891 int num2 = 9999;
6892 for (int i = 0; i < EClass._map.charas.Count; i++)
6893 {
6894 Chara chara2 = EClass._map.charas[i];
6895 if (chara2 == this || !IsHostile(chara2) || !CanSee(chara2) || (chara2.mimicry != null && chara2.mimicry.IsThing))
6896 {
6897 continue;
6898 }
6899 int num3 = Dist(chara2);
6900 int num4 = GetSightRadius() + (flag ? 1 : 0);
6901 if (num3 > num4)
6902 {
6903 continue;
6904 }
6905 if (flag3 && EClass.rnd(chara2.Evalue(152) + 5) * (100 + num3 * num3 * 10) / 100 > EClass.rnd(num))
6906 {
6907 if (this == pos.FirstChara)
6908 {
6909 chara2.ModExp(152, Mathf.Clamp((num - chara2.Evalue(152)) / 2, 1, Mathf.Max(30 - stealthSeen * 2, 1)));
6910 }
6911 stealthSeen++;
6912 }
6913 else if (CanSeeLos(chara2) && (!flag2 || EClass.pc.isBlind || EClass.pc.CanSeeLos(chara2)) && (!base.IsPCFactionOrMinion || EClass.pc.ai.ShouldAllyAttack(chara2)))
6914 {
6915 if (!IsPCParty)
6916 {
6917 DoHostileAction(chara2);
6918 enemy = chara2;
6919 return true;
6920 }
6921 if (num3 < num2)
6922 {
6923 num2 = num3;
6924 chara = chara2;
6925 }
6926 }
6927 }
6928 if (chara != null)
6929 {
6930 DoHostileAction(chara);
6931 enemy = chara;
6932 return true;
6933 }
6934 return false;
6935 }
virtual bool ShouldAllyAttack(Chara tg)
Definition: AIAct.cs:134
int stealthSeen
Definition: Chara.cs:194
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 8446 of file Chara.cs.

8447 {
8448 return FindBed()?.owner.pos.cell.room;
8449 }
Room room
Definition: Cell.cs:122
TraitBed FindBed()
Definition: Chara.cs:7817

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

10764 {
10765 Element orCreateElement = elements.GetOrCreateElement(ele);
10766 if (orCreateElement.ValueWithoutLink == 0)
10767 {
10768 elements.ModBase(orCreateElement.id, 1);
10769 }
10770 if (orCreateElement is Spell)
10771 {
10772 int num = EClass.curve(Evalue(307), 50, 20) + (HasElement(307) ? 20 : 0);
10773 int num2 = origin?.Evalue(765) ?? 0;
10774 num = num * (100 - num2) / 100;
10775 int a = mtp * orCreateElement.source.charge * (100 + num) / 100 / 100;
10776 a = Mathf.Max(1, EClass.rndHalf(a));
10777 if (orCreateElement.source.charge == 1)
10778 {
10779 a = 1;
10780 }
10781 orCreateElement.vPotential += a;
10782 }
10783 Say("spell_gain", this, orCreateElement.Name);
10784 LayerAbility.SetDirty(orCreateElement);
10785 }
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 7754 of file Chara.cs.

7755 {
7756 string result = "?????";
7757 if (ai != null)
7758 {
7759 result = ai.GetCurrentActionText();
7760 }
7761 return result;
7762 }
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 8381 of file Chara.cs.

8382 {
8383 if (body.GetWeight(armorOnly: true) <= (HasElement(1204) ? 6000 : 30000))
8384 {
8385 return 120;
8386 }
8387 return 122;
8388 }
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 8337 of file Chara.cs.

8338 {
8339 Thing result = null;
8340 int num = 0;
8341 foreach (Thing thing in things)
8342 {
8343 if (thing.IsRangedWeapon && CanEquipRanged(thing) && thing.GetEquipValue() > num)
8344 {
8345 num = thing.GetEquipValue();
8346 result = thing;
8347 }
8348 }
8349 return result;
8350 }
int GetEquipValue()
Definition: Card.cs:7678
bool IsRangedWeapon
Definition: Card.cs:2297
bool CanEquipRanged(Thing t)
Definition: Chara.cs:8271

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

◆ GetBuffStats() [1/2]

Element Chara.GetBuffStats ( int  ele)
inline

Definition at line 10070 of file Chara.cs.

10071 {
10072 for (int i = 0; i < conditions.Count; i++)
10073 {
10074 if (conditions[i] is ConBuffStats conBuffStats && conBuffStats.refVal == ele)
10075 {
10076 return conBuffStats.elements.GetElement(ele);
10077 }
10078 }
10079 return null;
10080 }

References BaseCondition.refVal.

◆ GetBuffStats() [2/2]

Element Chara.GetBuffStats ( string  alias)
inline

Definition at line 10065 of file Chara.cs.

10066 {
10067 return GetBuffStats(EClass.sources.elements.alias[alias].id);
10068 }
Element GetBuffStats(string alias)
Definition: Chara.cs:10065

References SourceManager.elements, and EClass.sources.

Referenced by GoalCombat.TryUseAbility().

◆ GetBurden()

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

Definition at line 2020 of file Chara.cs.

2021 {
2022 int num2 = (base.ChildrenWeight + ((t != null) ? ((num == -1) ? t.ChildrenAndSelfWeight : (t.SelfWeight * num)) : 0)) * 100 / WeightLimit;
2023 if (num2 < 0)
2024 {
2025 num2 = 1000;
2026 }
2028 {
2029 num2 = 0;
2030 }
2031 int num3 = ((num2 >= 100) ? ((num2 - 100) / 10 + 1) : 0);
2032 if (num3 > 9)
2033 {
2034 num3 = 9;
2035 }
2036 return num3;
2037 }

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

◆ GetCondition()

◆ GetCondition< T >()

override T Chara.GetCondition< T > ( )
inlinevirtual

Reimplemented from Card.

Definition at line 10121 of file Chara.cs.

10122 {
10123 for (int i = 0; i < conditions.Count; i++)
10124 {
10125 if (conditions[i] is T)
10126 {
10127 return conditions[i] as T;
10128 }
10129 }
10130 return null;
10131 }

◆ GetCooldown()

int Chara.GetCooldown ( int  idEle)
inline

Definition at line 9333 of file Chara.cs.

9334 {
9335 if (_cooldowns != null)
9336 {
9337 for (int i = 0; i < _cooldowns.Count; i++)
9338 {
9339 if (_cooldowns[i] / 1000 == idEle)
9340 {
9341 return _cooldowns[i] % 1000;
9342 }
9343 }
9344 }
9345 return 0;
9346 }

Referenced by NotificationCooldown.OnRefresh().

◆ GetCurrentDir()

int Chara.GetCurrentDir ( )
inline

Definition at line 3896 of file Chara.cs.

3897 {
3898 Debug.Log(angle);
3899 if (!renderer.hasActor)
3900 {
3901 if (angle == 0f || angle == 45f || angle == 90f)
3902 {
3903 return 2;
3904 }
3905 if (angle == -135f || angle == 180f || angle == -90f)
3906 {
3907 return 1;
3908 }
3909 if (angle == 135f)
3910 {
3911 return 0;
3912 }
3913 return 3;
3914 }
3915 return renderer.actor.currentDir;
3916 }
virtual int currentDir
Definition: CardActor.cs:43
float angle
Definition: Card.cs:74

References Debug.

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

◆ GetDestination()

Point Chara.GetDestination ( )
inline

Definition at line 7729 of file Chara.cs.

7730 {
7731 return (ai.IsRunning ? ai.GetDestination() : pos).Copy();
7732 }
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 4982 of file Chara.cs.

4983 {
4984 if (elements.Value(122) > elements.Value(120))
4985 {
4986 return elements.GetElement(122);
4987 }
4988 return elements.GetElement(120);
4989 }
int Value(int ele)

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

◆ GetFavAttackStyle()

AttackStyle Chara.GetFavAttackStyle ( )
inline

Definition at line 4957 of file Chara.cs.

4958 {
4959 int num = Evalue(131);
4960 int num2 = Evalue(130);
4961 int num3 = Evalue(123);
4962 if (num > num2 && num > num3)
4963 {
4964 return AttackStyle.TwoWield;
4965 }
4966 if (num2 > num && num2 > num3)
4967 {
4968 return AttackStyle.TwoHand;
4969 }
4970 if (num3 > num && num3 > num2)
4971 {
4972 return AttackStyle.Shield;
4973 }
4974 return AttackStyle.Default;
4975 }

Referenced by WindowChara.RefreshNote().

◆ GetFavCat()

SourceCategory.Row Chara.GetFavCat ( )
inline

Definition at line 8583 of file Chara.cs.

8584 {
8585 if (ModUtil.TryGetContent<CustomBiographyContent>("Biography/" + id, out var content))
8586 {
8587 content.RefreshCharaBio(this);
8588 if (!content.favCategory.IsEmpty() && EClass.sources.categories.map.TryGetValue(content.favCategory, out var value) && value.gift > 0)
8589 {
8590 return value;
8591 }
8592 }
8593 string str = GetStr(73);
8594 if (!str.IsEmpty() && EClass.sources.categories.map[str] != null)
8595 {
8596 return EClass.sources.categories.map[str];
8597 }
8598 SourceCategory.Row r = null;
8599 if (_listFavCat.Count == 0)
8600 {
8601 foreach (SourceCategory.Row row in EClass.sources.categories.rows)
8602 {
8603 if (row.gift > 0)
8604 {
8605 _listFavCat.Add(row);
8606 }
8607 }
8608 }
8609 Rand.UseSeed(base.uid + EClass.game.seed, delegate
8610 {
8611 r = _listFavCat.RandomItem();
8612 });
8613 return r;
8614 }
string GetStr(string id, string defaultStr=null)
Definition: Card.cs:2595
static List< SourceCategory.Row > _listFavCat
Definition: Chara.cs:200
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 8550 of file Chara.cs.

8551 {
8552 if (ModUtil.TryGetContent<CustomBiographyContent>("Biography/" + id, out var content))
8553 {
8554 content.RefreshCharaBio(this);
8555 if (!content.favFood.IsEmpty() && EClass.sources.things.map.TryGetValue(content.favFood, out var value))
8556 {
8557 return value;
8558 }
8559 }
8560 string str = GetStr(72);
8561 if (!str.IsEmpty() && EClass.sources.things.map.TryGetValue(str, out var value2))
8562 {
8563 return value2;
8564 }
8565 if (_listFavFood.Count == 0)
8566 {
8567 foreach (SourceThing.Row row in EClass.sources.things.rows)
8568 {
8569 if (row._origin == "dish" && row.value != 0 && row.chance != 0)
8570 {
8571 _listFavFood.Add(row);
8572 }
8573 }
8574 }
8575 SourceThing.Row r = null;
8576 Rand.UseSeed(base.uid + EClass.game.seed, delegate
8577 {
8578 r = _listFavFood.RandomItem();
8579 });
8580 return r;
8581 }
static List< SourceThing.Row > _listFavFood
Definition: Chara.cs:198
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 4977 of file Chara.cs.

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

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

9400 {
9401 if (IsPC)
9402 {
9403 return null;
9404 }
9405 switch (TimeTable.GetSpan(idTimeTable, hour))
9406 {
9407 case TimeTable.Span.Sleep:
9409 {
9410 return new GoalSleep();
9411 }
9412 break;
9413 case TimeTable.Span.Eat:
9414 return new GoalIdle();
9415 case TimeTable.Span.Work:
9416 if (IsGuest())
9417 {
9418 return new GoalIdle();
9419 }
9420 return GetGoalWork();
9421 case TimeTable.Span.Free:
9422 if (IsGuest())
9423 {
9424 return new GoalIdle();
9425 }
9426 return GetGoalHobby();
9427 }
9428 return null;
9429 }
Goal GetGoalWork()
Definition: Chara.cs:9431
Goal GetGoalHobby()
Definition: Chara.cs:9444
string idTimeTable
Definition: Chara.cs:474
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 9444 of file Chara.cs.

9445 {
9446 if (IsPrisoner)
9447 {
9448 return new GoalIdle();
9449 }
9450 if (memberType == FactionMemberType.Livestock)
9451 {
9452 return new GoalGraze();
9453 }
9454 return new GoalHobby();
9455 }
FactionMemberType
bool IsPrisoner
Definition: Chara.cs:1087

Referenced by Zone.Simulate().

◆ GetGoalWork()

Goal Chara.GetGoalWork ( )
inline

Definition at line 9431 of file Chara.cs.

9432 {
9433 if (IsPrisoner)
9434 {
9435 return new GoalIdle();
9436 }
9437 if (memberType == FactionMemberType.Livestock)
9438 {
9439 return new GoalGraze();
9440 }
9441 return new GoalWork();
9442 }

Referenced by Zone.Simulate().

◆ GetHappiness()

int Chara.GetHappiness ( )
inline

Definition at line 7739 of file Chara.cs.

7740 {
7741 int num = 50;
7742 if (FindBed() != null)
7743 {
7744 num += 50;
7745 }
7746 return num;
7747 }

◆ GetHireCost()

int Chara.GetHireCost ( )
inline

Definition at line 7734 of file Chara.cs.

7735 {
7736 return base.LV / 2 + 4;
7737 }

Referenced by CalcGold.Hire().

◆ GetHoverText()

override string Chara.GetHoverText ( )
inlinevirtual

Reimplemented from Card.

Definition at line 7228 of file Chara.cs.

7229 {
7230 if (mimicry != null && mimicry.IsThing)
7231 {
7232 return mimicry.GetHoverText();
7233 }
7234 string text = ((mimicry != null && mimicry.Card != this) ? mimicry.GetName(NameStyle.Full) : base.Name);
7235 if (IsFriendOrAbove())
7236 {
7237 text = text.TagColor(EClass.Colors.colorFriend);
7238 }
7239 else if (IsHostile())
7240 {
7241 text = text.TagColor(EClass.Colors.colorHostile);
7242 }
7243 int num = 2;
7244 int lV = EClass.pc.LV;
7245 if (base.LV >= lV * 5)
7246 {
7247 num = 0;
7248 }
7249 else if (base.LV >= lV * 2)
7250 {
7251 num = 1;
7252 }
7253 else if (base.LV <= lV / 4)
7254 {
7255 num = 4;
7256 }
7257 else if (base.LV <= lV / 2)
7258 {
7259 num = 3;
7260 }
7261 string text2 = Lang.GetList("lvComparison")[num];
7262 text2 = (" (" + text2 + ") ").TagSize(14).TagColor(EClass.Colors.gradientLVComparison.Evaluate(0.25f * (float)num));
7263 string s = (IsFriendOrAbove() ? "HostilityAlly" : (IsNeutral() ? "HostilityNeutral" : "HostilityEnemy"));
7264 s = (" (" + s.lang() + ") ").TagSize(14);
7265 s = "";
7266 if (memberType == FactionMemberType.Guest)
7267 {
7268 s += (" (" + "guest".lang() + ") ").TagSize(14);
7269 }
7270 else if (memberType == FactionMemberType.Livestock)
7271 {
7272 s += (" (" + "livestock".lang() + ") ").TagSize(14);
7273 }
7274 if (!EClass.pc.IsMoving)
7275 {
7276 if (EClass.pc.HasHigherGround(this))
7277 {
7278 text2 += "lowerGround".lang();
7279 }
7280 else if (HasHigherGround(EClass.pc))
7281 {
7282 text2 += "higherGround".lang();
7283 }
7284 }
7285 if (Evalue(1232) > 0)
7286 {
7287 text2 = "milkBaby".lang().TagSize(14) + text2;
7288 }
7289 if (Guild.Fighter.ShowBounty(this) && Guild.Fighter.HasBounty(this))
7290 {
7291 text2 = "hasBounty".lang().TagSize(14) + text2;
7292 }
7293 if (EClass.pc.HasElement(481))
7294 {
7295 text2 += ("(" + faith.Name + ")").TagSize(14);
7296 }
7297 if (EClass.pc.HasElement(6607))
7298 {
7299 s += CraftUtil.GetBloodText(this).TagSize(14).TagColor(EClass.Colors.colorBlood);
7300 }
7301 return text + text2 + s;
7302 }
bool HasHigherGround(Card c)
Definition: Chara.cs:1251
override bool IsMoving
Definition: Chara.cs:628
bool IsNeutral()
Definition: Chara.cs:6999
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 7304 of file Chara.cs.

7305 {
7306 if (mimicry != null && mimicry.IsThing)
7307 {
7308 return mimicry.GetHoverText2();
7309 }
7310 string text = "";
7311 if (knowFav)
7312 {
7313 text += Environment.NewLine;
7314 text = text + "<size=14>" + "favgift".lang(GetFavCat().GetName().ToLower(), GetFavFood().GetName()) + "</size>";
7315 }
7316 string text2 = "";
7318 {
7319 text2 += Environment.NewLine;
7320 text2 = text2 + "Lv:" + base.LV + " HP:" + base.hp + "/" + MaxHP + " MP:" + mana.value + "/" + mana.max + " DV:" + DV + " PV:" + PV + " Hunger:" + hunger.value;
7321 text2 += Environment.NewLine;
7322 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");
7323 text2 += Environment.NewLine;
7324 text2 = text2 + base.uid + IsMinion + "/" + base.c_uidMaster + "/" + master;
7325 text2 = text2 + " dir:" + base.dir + " skin:" + base.idSkin + " scaled:" + base.isScaled;
7326 }
7328 {
7329 text2 += Environment.NewLine;
7330 text2 += "<size=14>";
7331 foreach (Hobby item in ListWorks())
7332 {
7333 text2 = text2 + item.Name + ", ";
7334 }
7335 foreach (Hobby item2 in ListHobbies())
7336 {
7337 text2 = text2 + item2.Name + ", ";
7338 }
7339 text2 = text2.TrimEnd(", ".ToCharArray()) + "</size>";
7340 }
7341 string text3 = "";
7342 IEnumerable<BaseStats> enumerable = conditions.Concat((!IsPCFaction) ? new BaseStats[0] : new BaseStats[2] { hunger, stamina });
7343 if (enumerable.Count() > 0)
7344 {
7345 text3 += Environment.NewLine;
7346 text3 += "<size=14>";
7347 int num = 0;
7348 foreach (BaseStats item3 in enumerable)
7349 {
7350 if (item3 is ConBaseTransmuteMimic)
7351 {
7352 continue;
7353 }
7354 string text4 = item3.GetPhaseStr();
7355 if (text4.IsEmpty() || text4 == "#")
7356 {
7357 continue;
7358 }
7359 Color c = Color.white;
7360 switch (item3.source.group)
7361 {
7362 case "Bad":
7363 case "Debuff":
7364 case "Disease":
7366 break;
7367 case "Buff":
7369 break;
7370 }
7372 {
7373 text4 = text4 + "(" + item3.GetValue() + ")";
7374 if (resistCon != null && resistCon.ContainsKey(item3.id))
7375 {
7376 text4 = text4 + "{" + resistCon[item3.id] + "}";
7377 }
7378 }
7379 num++;
7380 text3 = text3 + text4.TagColor(c) + ", ";
7381 }
7382 if (num == 0)
7383 {
7384 text3 = "";
7385 }
7386 else
7387 {
7388 text = "";
7389 text3 = text3.TrimEnd(", ".ToCharArray()) + "</size>";
7390 }
7391 }
7393 {
7394 text3 += Environment.NewLine;
7395 foreach (ActList.Item item4 in ability.list.items)
7396 {
7397 text3 = text3 + item4.act.Name + ", ";
7398 }
7399 text3 = text3.TrimEnd(", ".ToCharArray());
7400 }
7401 return text + text2 + text3;
7402 }
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:8583
bool knowFav
Definition: Chara.cs:419
Stats hunger
Definition: Chara.cs:1203
override string GetName(NameStyle style, int num=-1)
Definition: Chara.cs:1422
override int DV
Definition: Chara.cs:749
List< Hobby > ListHobbies(bool useMemberType=true)
Definition: Chara.cs:9587
override int PV
Definition: Chara.cs:778
SourceThing.Row GetFavFood()
Definition: Chara.cs:8550
List< Hobby > ListWorks(bool useMemberType=true)
Definition: Chara.cs:9560
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 8702 of file Chara.cs.

8703 {
8704 string str = GetStr("portrait_override");
8705 if (!str.IsEmpty() && Portrait.allIds.Contains(str + ".png"))
8706 {
8707 return str;
8708 }
8709 if (id == "olderyoungersister")
8710 {
8711 if (base.idSkin != 2)
8712 {
8713 return "UN_olderyoungersister";
8714 }
8715 return "UN_olderyoungersister_alt";
8716 }
8717 if (Portrait.allIds.Contains("UN_" + id + ".png"))
8718 {
8719 return "UN_" + id;
8720 }
8721 return base.c_idPortrait;
8722 }
static HashSet< string > allIds
Definition: Portrait.cs:34

References Portrait.allIds.

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

◆ GetIdPortraitCat()

string Chara.GetIdPortraitCat ( )
inline

Definition at line 8688 of file Chara.cs.

8689 {
8690 string text = race.id;
8691 if ((text == "mifu" || text == "nefu") && EClass.rnd(2) == 0)
8692 {
8693 return "foxfolk";
8694 }
8695 if (trait is TraitGuard)
8696 {
8697 return "guard";
8698 }
8699 return "";
8700 }

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

7506 {
7507 return GetSprite();
7508 }
override Sprite GetSprite(int dir=0)
Definition: Chara.cs:7119

◆ GetName()

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

Reimplemented from Card.

Definition at line 1422 of file Chara.cs.

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

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

8641 {
8642 using (List<Chara>.Enumerator enumerator = pos.ListCharasInRadius(this, 3, (Chara c) => c != this && c.race.id == "cat").GetEnumerator())
8643 {
8644 if (enumerator.MoveNext())
8645 {
8646 return enumerator.Current;
8647 }
8648 }
8649 return null;
8650 }
List< Chara > ListCharasInRadius(Chara cc, int dist, Func< Chara, bool > func, bool onlyVisible=true)
Definition: Point.cs:1222

References race.

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

◆ GetPietyValue()

int Chara.GetPietyValue ( )
inline

Definition at line 10868 of file Chara.cs.

10869 {
10870 if (base._IsPC)
10871 {
10872 return 10 + (int)(Mathf.Sqrt(base.c_daysWithGod) * 2f + (float)Evalue(85)) / 2;
10873 }
10874 return 10 + (int)(Mathf.Sqrt(base.LV) * 5f + (float)Evalue(306)) / 2;
10875 }

◆ GetRandomRangedWeapon()

Thing Chara.GetRandomRangedWeapon ( )
inline

Definition at line 8352 of file Chara.cs.

8353 {
8354 return things.List((Thing t) => t.IsRangedWeapon && CanEquipRanged(t)).RandomItem();
8355 }

References Card.IsRangedWeapon.

◆ GetRevived()

void Chara.GetRevived ( )
inline

Definition at line 5482 of file Chara.cs.

5483 {
5484 Revive(EClass.pc.pos.GetNearestPoint(allowBlock: false, allowChara: false), msg: true);
5485 if (!IsPCFaction)
5486 {
5487 return;
5488 }
5490 {
5491 if (homeZone != null && EClass._zone != homeZone)
5492 {
5493 Msg.Say("returnHome", this, homeZone.Name);
5495 }
5496 }
5497 else if ((!EClass._zone.IsPCFaction || homeBranch != EClass.Branch || base.c_wasInPcParty) && EClass._zone.events.GetEvent<ZoneEventWedding>() == null)
5498 {
5499 EClass.pc.party.AddMemeber(this, showMsg: true);
5500 }
5501 }
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:620
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 9538 of file Chara.cs.

9539 {
9540 BaseArea result = null;
9541 foreach (Hobby item in ListWorks())
9542 {
9543 AIWork aI = item.GetAI(this);
9544 if (aI.SetDestination())
9545 {
9546 if (aI.destArea != null)
9547 {
9548 result = aI.destArea;
9549 }
9550 else if (aI.destThing != null)
9551 {
9552 result = aI.destThing.pos.cell.room;
9553 }
9554 break;
9555 }
9556 }
9557 return result;
9558 }
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 7119 of file Chara.cs.

7120 {
7121 string str = GetStr("sprite_override");
7122 if (!str.IsEmpty())
7123 {
7124 Sprite sprite = ModUtil.LoadSprite(str);
7125 if ((bool)sprite)
7126 {
7127 return sprite;
7128 }
7129 }
7130 if (IsPCC)
7131 {
7132 PCC pCC = PCC.Get(pccData);
7133 pCC.Build();
7134 return pCC.variation.idle[0, 0];
7135 }
7136 bool snow = EClass.core.IsGameStarted && EClass._zone.IsSnowCovered;
7137 int skin = 0;
7138 if (spriteReplacer?.data != null)
7139 {
7140 Sprite sprite2 = spriteReplacer.GetSprite(dir, skin, snow);
7141 if ((bool)sprite2)
7142 {
7143 return sprite2;
7144 }
7145 }
7146 if (sourceCard.tiles.Length > 1)
7147 {
7148 skin = ((base.idSkin == 0 && !source.staticSkin) ? (base.uid % sourceCard.tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)) : base.idSkin);
7149 }
7150 return sourceCard.GetSprite(dir, skin, snow);
7151 }
int dir
Definition: Card.cs:149
SpriteReplacer spriteReplacer
Definition: Chara.cs:160
override CardRow sourceCard
Definition: Chara.cs:456
int[] tiles
Definition: RenderRow.cs:10
Sprite GetSprite(int dir=0, int skin=0, bool snow=false)
Definition: RenderRow.cs:286
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 7162 of file Chara.cs.

7163 {
7164 if (IsPCC)
7165 {
7167 {
7169 }
7170 }
7171 else if (conSleep != null && host == null && pos.Equals(EClass.pc.pos) && IsHuman && (GetBool(123) || affinity.CanSleepBeside()))
7172 {
7173 return EClass.setting.pass.subDead;
7174 }
7175 return SubPassData.Default;
7176 }
ConSleep conSleep
Definition: Chara.cs:104
override bool IsDeadOrSleeping
Definition: Chara.cs:581
PassSetting pass
Definition: GameSetting.cs:350
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 7749 of file Chara.cs.

7750 {
7751 return GetHappiness().ToString() ?? "";
7752 }
int GetHappiness()
Definition: Chara.cs:7739

◆ GetTextHobby()

string Chara.GetTextHobby ( bool  simple = false)
inline

Definition at line 9676 of file Chara.cs.

9677 {
9678 string text = (simple ? "" : ("hobby".lang() + ":"));
9679 foreach (Hobby item in ListHobbies())
9680 {
9681 text = text + " " + item.Name.TagColor((item.GetEfficiency(this) > 0) ? FontColor.Good : FontColor.Warning) + ",";
9682 }
9683 return text.TrimEnd(',');
9684 }

References item.

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

◆ GetTextWork()

string Chara.GetTextWork ( bool  simple = false)
inline

Definition at line 9686 of file Chara.cs.

9687 {
9688 string text = (simple ? "" : ("work".lang() + ":"));
9689 foreach (Hobby item in ListWorks())
9690 {
9691 text = text + " " + item.Name.TagColor((item.GetEfficiency(this) > 0) ? FontColor.Good : FontColor.Warning) + ",";
9692 }
9693 return text.TrimEnd(',');
9694 }

References item.

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

◆ GetTopicText()

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

Definition at line 7404 of file Chara.cs.

7405 {
7406 ConTransmuteHuman condition = GetCondition<ConTransmuteHuman>();
7407 string key = ((condition == null) ? source : condition.chara.source).idText.IsEmpty((condition == null) ? id : condition.chara.id);
7408 if (id == "littleOne" && EClass._zone is Zone_LittleGarden)
7409 {
7410 key = "littleOne2";
7411 }
7412 SourceCharaText.Row row = EClass.sources.charaText.map.TryGetValue(key);
7413 if (row == null)
7414 {
7415 return null;
7416 }
7417 string text = row.GetText(topic, returnNull: true);
7418 if (text.IsEmpty())
7419 {
7420 return null;
7421 }
7422 if (text.StartsWith("@"))
7423 {
7424 row = EClass.sources.charaText.map.TryGetValue(text.Replace("@", ""));
7425 if (row == null)
7426 {
7427 return null;
7428 }
7429 text = row.GetText(topic, returnNull: true);
7430 if (text.IsEmpty())
7431 {
7432 return null;
7433 }
7434 }
7435 return text.Split(Environment.NewLine.ToCharArray()).RandomItem();
7436 }
SourceCharaText charaText

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

◆ GetTotalFeat()

int Chara.GetTotalFeat ( )
inline

Definition at line 8662 of file Chara.cs.

8663 {
8664 int num = 0;
8665 if (base.c_upgrades != null)
8666 {
8667 num += base.c_upgrades.spent;
8668 }
8669 if (base.c_genes != null)
8670 {
8671 num += base.c_genes.GetTotalCost();
8672 }
8673 return num + base.feat;
8674 }

◆ GetWork()

Hobby Chara.GetWork ( string  id)
inline

Definition at line 9607 of file Chara.cs.

9608 {
9609 foreach (Hobby item in ListWorks())
9610 {
9611 if (item.source.alias == id)
9612 {
9613 return item;
9614 }
9615 }
9616 foreach (Hobby item2 in ListHobbies())
9617 {
9618 if (item2.source.alias == id)
9619 {
9620 return item2;
9621 }
9622 }
9623 return null;
9624 }
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 9769 of file Chara.cs.

9770 {
9771 if (_workSummary == null)
9772 {
9773 _workSummary = new WorkSummary();
9774 }
9775 return _workSummary;
9776 }
WorkSummary _workSummary
Definition: Chara.cs:57

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

8816 {
8817 if (c.IsHostile() || c.IsDeadOrSleeping)
8818 {
8819 Msg.Say("affinityNone", c, this);
8820 return;
8821 }
8822 if (!t.isCopy && t.IsCursed && t.IsEquipmentOrRanged && !t.IsAmmo && c.HasElement(1414))
8823 {
8824 bool num = t.blessedState == BlessedState.Doomed;
8825 int num2 = 200 + t.LV * 3;
8826 if (t.rarity == Rarity.Legendary)
8827 {
8828 num2 *= 3;
8829 }
8830 if (t.rarity >= Rarity.Mythical)
8831 {
8832 num2 *= 5;
8833 }
8834 if (num)
8835 {
8836 num2 *= 2;
8837 }
8838 PlayEffect("identify");
8839 PlaySound("identify");
8840 c.PlayEffect("mutation");
8841 c.Say("draw_curse", c, t);
8842 t.Destroy();
8843 List<Element> list = new List<Element>();
8844 foreach (Element value in elements.dict.Values)
8845 {
8846 if (value is Spell)
8847 {
8848 list.Add(value);
8849 }
8850 }
8851 if (list.Count == 0)
8852 {
8854 return;
8855 }
8856 Element element = list.RandomItem();
8857 ModExp(element.id, num2);
8858 Say("draw_curse2", this, element.Name);
8859 c.AddExp(Mathf.Min(num2 / 3, c.ExpToNext));
8860 return;
8861 }
8862 if ((t.id == "lovepotion" || t.id == "dreambug") && !Application.isEditor)
8863 {
8864 GiveLovePotion(c, t);
8865 return;
8866 }
8867 if (t.trait is TraitErohon && c.id == t.c_idRefName)
8868 {
8869 c.OnGiveErohon(t);
8870 return;
8871 }
8872 if (t.trait is TraitTicketMassage)
8873 {
8874 t.ModNum(-1);
8875 c.Talk("ticket");
8876 switch (t.id)
8877 {
8878 case "ticket_massage":
8879 c.ModAffinity(EClass.pc, 10);
8881 {
8882 target = c
8883 });
8884 break;
8885 case "ticket_armpillow":
8886 c.ModAffinity(EClass.pc, 20);
8887 EClass.pc.AddCondition<ConSleep>(300, force: true);
8888 c.SetAI(new AI_ArmPillow
8889 {
8890 target = EClass.pc
8891 });
8892 break;
8893 case "ticket_champagne":
8894 c.ModAffinity(EClass.pc, 10);
8896 break;
8897 }
8898 return;
8899 }
8900 if (t.id == "flyer")
8901 {
8902 stamina.Mod(-1);
8903 if (c.things.Find((Thing a) => a.id == "flyer") != null)
8904 {
8905 c.Talk("flyer_miss");
8906 DoHostileAction(c);
8907 return;
8908 }
8909 if (EClass.rnd(20) != 0 && c.CHA > EClass.rnd(base.CHA + Evalue(291) * 3 + 10))
8910 {
8911 Msg.Say("affinityNone", c, this);
8912 t.Destroy();
8913 elements.ModExp(291, 10f);
8914 return;
8915 }
8916 elements.ModExp(291, 50f);
8917 }
8918 if (t.id == "statue_weird")
8919 {
8920 EClass.pc.Say("statue_sell");
8921 }
8922 t.isGifted = true;
8923 c.nextUse = c.affinity.OnGift(t);
8924 if (!t.isDestroyed)
8925 {
8926 EClass.game.quests.list.ForeachReverse(delegate(Quest q)
8927 {
8928 q.OnGiveItem(c, t);
8929 });
8930 if (c.TryEquip(t))
8931 {
8932 c.nextUse = null;
8933 }
8934 }
8935 if (c.IsPCParty)
8936 {
8938 }
8939 }
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:7319
string c_idRefName
Definition: Card.cs:1681
void TryClearInventory()
Definition: Chara.cs:9105
void GiveLovePotion(Chara c, Thing t)
Definition: Chara.cs:8952
bool TryEquip(Thing t, bool useFav=false)
Definition: Chara.cs:8232
void OnGiveErohon(Thing t)
Definition: Chara.cs:8941
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 8952 of file Chara.cs.

8953 {
8954 c.Say("give_love", c, t);
8955 c.PlaySound(t.material.GetSoundDead());
8956 c.ShowEmo(Emo.angry);
8957 c.ModAffinity(EClass.pc, -20, show: false);
8958 c.Talk("pervert");
8959 t.Destroy();
8960 }

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

6744 {
6745 if (enemy == null && !IsPC)
6746 {
6747 if (GetInt(106) == 0)
6748 {
6749 TalkTopic("aggro");
6750 }
6751 if (OriginalHostility != Hostility.Enemy)
6752 {
6753 ShowEmo(Emo.angry);
6754 }
6755 SetEnemy(_tg.Chara);
6756 }
6758 {
6759 if (hostility >= Hostility.Neutral)
6760 {
6761 Say("angry", this);
6762 }
6763 hostility = Hostility.Enemy;
6764 }
6765 }
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 1345 of file Chara.cs.

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

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

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

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

◆ HasCondition()

bool Chara.HasCondition ( string  alias)
inline

Definition at line 10053 of file Chara.cs.

10054 {
10055 for (int i = 0; i < conditions.Count; i++)
10056 {
10057 if (conditions[i].source.alias == alias)
10058 {
10059 return true;
10060 }
10061 }
10062 return false;
10063 }

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

10042 {
10043 for (int i = 0; i < conditions.Count; i++)
10044 {
10045 if (conditions[i] is T)
10046 {
10047 return true;
10048 }
10049 }
10050 return false;
10051 }

◆ HasCooldown()

bool Chara.HasCooldown ( int  idEle)
inline

Definition at line 9328 of file Chara.cs.

9329 {
9330 return GetCooldown(idEle) != 0;
9331 }
int GetCooldown(int idEle)
Definition: Chara.cs:9333

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

◆ HasHigherGround()

bool Chara.HasHigherGround ( Card  c)
inline

Definition at line 1251 of file Chara.cs.

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

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

9458 {
9459 int num = EClass.sources.hobbies.alias.TryGetValue(alias)?.id ?? 0;
9460 listHobby.Clear();
9461 if (_works == null || _hobbies == null)
9462 {
9463 RerollHobby();
9464 }
9465 foreach (int work in _works)
9466 {
9467 if (work == num)
9468 {
9469 return true;
9470 }
9471 }
9472 foreach (int hobby in _hobbies)
9473 {
9474 if (hobby == num)
9475 {
9476 return true;
9477 }
9478 }
9479 return false;
9480 }
static List< Hobby > listHobby
Definition: Chara.cs:15
void RerollHobby(bool extraSlotChance=true)
Definition: Chara.cs:9720
SourceHobby hobbies

References SourceManager.hobbies, and EClass.sources.

Referenced by AI_Idle.Run().

◆ HasMinion()

bool Chara.HasMinion ( string  id)
inline

Definition at line 2631 of file Chara.cs.

2632 {
2633 foreach (Chara chara in EClass._map.charas)
2634 {
2635 if (chara.c_uidMaster == base.uid)
2636 {
2637 return true;
2638 }
2639 }
2640 return false;
2641 }

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

Referenced by ActEffect.ProcAt().

◆ HealAll()

void Chara.HealAll ( )
inline

Definition at line 1797 of file Chara.cs.

1798 {
1799 Cure(CureType.HealComplete);
1800 base.hp = MaxHP;
1801 mana.value = mana.max;
1802 stamina.value = stamina.max;
1803 Refresh();
1804 }
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 4776 of file Chara.cs.

4777 {
4778 if (held == t || t.isDestroyed || t.Num <= 0)
4779 {
4780 return;
4781 }
4782 if (IsPC && t.isNPCProperty)
4783 {
4784 t.isNPCProperty = false;
4785 if (!t.GetBool(128))
4786 {
4788 pos.TryWitnessCrime(this);
4789 }
4790 }
4791 PickHeld();
4792 if (t.isChara)
4793 {
4795 {
4796 t.ShowEmo(Emo.love);
4797 }
4798 EClass.player.altHeldPos = t.renderer.data.ForceAltHeldPosition || EClass.rnd(2) == 0;
4799 }
4800 else
4801 {
4802 if (num == -1 || num > t.Num)
4803 {
4804 num = t.Num;
4805 }
4806 if (num < t.Num)
4807 {
4808 t = t.Split(num);
4809 }
4810 }
4811 if (t.GetRootCard() != this)
4812 {
4813 t = Pick(t.Thing, msg: false, tryStack: false);
4814 if (t.GetRootCard() != this)
4815 {
4816 return;
4817 }
4818 }
4819 held = t;
4821 if (held.GetLightRadius() > 0)
4822 {
4824 }
4825 if (IsPC)
4826 {
4828 WidgetHotbar.dirtyCurrentItem = true;
4829 }
4830 }
Thing Split(int a)
Definition: Card.cs:3665
bool isNPCProperty
Definition: Card.cs:557
virtual CardRenderer _CreateRenderer()
Definition: Card.cs:6440
void RecalculateFOV()
Definition: Card.cs:6862
virtual bool IsAliveInCurrentZone
Definition: Card.cs:2179
int GetLightRadius()
Definition: Card.cs:6909
void PickHeld(bool msg=false)
Definition: Chara.cs:4832
bool TryWitnessCrime(Chara criminal, Chara target=null, int radius=4, Func< Chara, bool > funcWitness=null)
Definition: Point.cs:874

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

9854 {
9855 if (!onDeserialize)
9856 {
9857 _cints[10] = 20;
9858 _cints[11] = 70;
9859 _cints[13] = 70;
9860 _cints[14] = 70;
9861 _cints[15] = 70;
9862 _cints[17] = 0;
9863 _cints[18] = 0;
9864 }
9865 foreach (Condition condition in conditions)
9866 {
9867 condition.SetOwner(this, onDeserialize);
9868 }
9869 }
int[] _cints
Definition: Chara.cs:84

References BaseCondition.SetOwner().

Referenced by OnCreate(), and OnDeserialized().

◆ InstantEat()

void Chara.InstantEat ( Thing  t = null,
bool  sound = true 
)
inline

Definition at line 8070 of file Chara.cs.

8071 {
8072 if (t == null)
8073 {
8074 t = FindBestFoodToEat();
8075 }
8076 if (t == null)
8077 {
8078 t = things.Find((Thing a) => CanEat(a, shouldEat: true) && !a.c_isImportant);
8079 }
8080 if (t == null)
8081 {
8082 t = things.Find((Thing a) => CanEat(a) && !a.c_isImportant);
8083 }
8084 if (t != null)
8085 {
8086 Say("eat_start", this, t.Duplicate(1));
8087 if (sound)
8088 {
8089 PlaySound("eat");
8090 }
8091 FoodEffect.Proc(this, t);
8092 }
8093 }
Thing FindBestFoodToEat()
Definition: Chara.cs:8049
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 7009 of file Chara.cs.

7010 {
7011 if (faction == EClass.Home)
7012 {
7013 return homeZone == EClass.game.activeZone;
7014 }
7015 return false;
7016 }
Faction faction
Definition: Chara.cs:433
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 1238 of file Chara.cs.

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

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

2763 {
2764 if (!currentZone.IsRegion && p.IsValid)
2765 {
2766 CellDetail detail = p.detail;
2767 if (detail != null && detail.charas.Count > 0)
2768 {
2769 foreach (Chara chara in p.detail.charas)
2770 {
2771 if (chara.mimicry == null && (chara.IsHostile(this) || chara.IsHostile() || !chara.trait.CanBePushed))
2772 {
2773 if (cancelAI && EClass.pc.ai is GoalManualMove)
2774 {
2775 EClass.pc.ai.Cancel();
2776 }
2777 return true;
2778 }
2779 }
2780 }
2781 }
2782 return false;
2783 }
List< Chara > charas
Definition: CellDetail.cs:13
CellDetail detail
Definition: Point.cs:67

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

2663 {
2664 if (!IsPCPartyMinion)
2665 {
2666 return false;
2667 }
2668 foreach (Quest item in EClass.game.quests.list)
2669 {
2670 if (item is QuestEscort questEscort && questEscort.uidChara == base.uid)
2671 {
2672 return true;
2673 }
2674 }
2675 return false;
2676 }
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 7053 of file Chara.cs.

7054 {
7055 if (base.IsPCFactionOrMinion || IsFriendOrAbove())
7056 {
7058 {
7059 return true;
7060 }
7061 }
7062 else if (IsHostile() && c.IsHostile())
7063 {
7064 return true;
7065 }
7066 return false;
7067 }

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

◆ IsFusable()

bool Chara.IsFusable ( Chara  c)
inline

Definition at line 1898 of file Chara.cs.

1899 {
1900 if (c == this)
1901 {
1902 return false;
1903 }
1904 if (c.id != id)
1905 {
1906 return false;
1907 }
1908 if (c.IsPCFactionOrMinion || base.IsPCFactionOrMinion)
1909 {
1910 return false;
1911 }
1912 if (c.c_bossType != BossType.none || base.c_bossType != BossType.none)
1913 {
1914 return false;
1915 }
1917 {
1918 return false;
1919 }
1920 return true;
1921 }
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 6957 of file Chara.cs.

6958 {
6959 if (c == null)
6960 {
6961 return false;
6962 }
6963 if (base.IsPCFactionOrMinion)
6964 {
6965 if ((c == EClass.pc.enemy && !c.IsPCFactionOrMinion) || c.hostility <= Hostility.Enemy)
6966 {
6967 return true;
6968 }
6969 }
6970 else
6971 {
6973 {
6974 return true;
6975 }
6976 if (OriginalHostility >= Hostility.Friend)
6977 {
6978 if (hostility <= Hostility.Enemy && c.IsPCFactionOrMinion)
6979 {
6980 return true;
6981 }
6982 if (c.hostility <= Hostility.Enemy && c.OriginalHostility == Hostility.Enemy)
6983 {
6984 return true;
6985 }
6986 }
6987 else if (OriginalHostility <= Hostility.Enemy && (c.IsPCFactionOrMinion || (c.OriginalHostility != Hostility.Enemy && c.hostility >= Hostility.Friend)))
6988 {
6989 return true;
6990 }
6991 }
6992 if (id == "unicorn" && (Evalue(418) < 0 || (c.HasElement(1216) && c.Evalue(418) < 1)))
6993 {
6994 return true;
6995 }
6996 return false;
6997 }
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 7023 of file Chara.cs.

7024 {
7025 return EClass.game.activeZone == currentZone;
7026 }

Referenced by BaseListPeople.IsDisabled().

◆ IsInSpot< T >()

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

Definition at line 7028 of file Chara.cs.

7028 : TraitSpot
7029 {
7030 foreach (T item in EClass._map.props.installed.traits.List<T>())
7031 {
7032 foreach (Point item2 in item.ListPoints())
7033 {
7034 if (pos.Equals(item2))
7035 {
7036 return true;
7037 }
7038 }
7039 }
7040 return false;
7041 }
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 6999 of file Chara.cs.

7000 {
7001 return hostility == Hostility.Neutral;
7002 }

Referenced by ActPlan._Update().

◆ IsNeutralOrAbove()

bool Chara.IsNeutralOrAbove ( )
inline

◆ IsValidGiftWeight()

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

Definition at line 8755 of file Chara.cs.

8756 {
8757 int num2 = ((!HasElement(1411)) ? 1 : 3);
8758 if (GetBurden(t, num) >= num2)
8759 {
8760 return false;
8761 }
8762 return true;
8763 }
int GetBurden(Card t=null, int num=-1)
Definition: Chara.cs:2020

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

◆ Kiss()

void Chara.Kiss ( Chara  c)
inline

Definition at line 6674 of file Chara.cs.

6675 {
6676 EClass.player.forceTalk = true;
6677 Talk("kiss", null, null, IsPC);
6678 PlaySound("kiss");
6679 renderer.PlayAnime(AnimeID.Kiss, c);
6680 int num = 2 + EClass.rnd(4) + ((!c.IsPC && c.affinity.CurrentStage < Affinity.Stage.Fond) ? (-EClass.rnd(10)) : 0);
6681 c.ShowEmo((num > 0) ? Emo.love : Emo.sad);
6682 if (num > 0 && EClass.rnd(IsPC ? 100 : 5000) == 0)
6683 {
6684 c.MakeEgg();
6685 }
6686 if (IsPC && this != c)
6687 {
6688 if (c.interest > 0)
6689 {
6690 c.ModAffinity(EClass.pc, num);
6691 c.interest -= 20 + EClass.rnd(10);
6692 }
6693 else
6694 {
6695 c.Say("affinityNone", c, EClass.pc);
6696 }
6697 }
6698 Effect.Get("love")._Play(pos, isSynced ? renderer.position : pos.Position(), 0f, c.pos);
6699 }
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 10541 of file Chara.cs.

10542 {
10543 List<Element> list = new List<Element>();
10544 foreach (SourceElement.Row item in EClass.sources.elements.rows.Where((SourceElement.Row a) => a.group == "FEAT" && a.cost[0] != -1 && !a.categorySub.IsEmpty()))
10545 {
10547 int num = ((feat.ValueWithoutLink <= 0) ? 1 : (feat.ValueWithoutLink + 1));
10548 if (purchaseFeat)
10549 {
10550 num -= feat.GetDNABonus(this);
10551 }
10552 if (num <= feat.source.max && !feat.HasTag("class") && !feat.HasTag("hidden") && !feat.HasTag("innate") && (!pet || !feat.HasTag("noPet")) && (showAll || feat.IsPurchaseFeatReqMet(elements)))
10553 {
10554 list.Add(Element.Create(feat.id, num) as Feat);
10555 }
10556 }
10557 return list;
10558 }
int feat
Definition: Card.cs:377
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1163
Definition: FEAT.cs:345

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

1924 {
1925 return pos.ListCharasInRadius(this, radius, (Chara c) => IsFusable(c));
1926 }
bool IsFusable(Chara c)
Definition: Chara.cs:1898

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

Referenced by TryFuse().

◆ ListHobbies()

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

Definition at line 9587 of file Chara.cs.

9588 {
9589 listHobby.Clear();
9590 if (!useMemberType || memberType != FactionMemberType.Livestock)
9591 {
9592 if (_hobbies == null)
9593 {
9594 RerollHobby();
9595 }
9596 foreach (int hobby in _hobbies)
9597 {
9598 listHobby.Add(new Hobby
9599 {
9600 id = hobby
9601 });
9602 }
9603 }
9604 return listHobby;
9605 }

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

9561 {
9562 listHobby.Clear();
9563 if (useMemberType && memberType == FactionMemberType.Livestock)
9564 {
9565 listHobby.Add(new Hobby
9566 {
9567 id = 45
9568 });
9569 }
9570 else
9571 {
9572 if (_works == null)
9573 {
9574 RerollHobby();
9575 }
9576 foreach (int work in _works)
9577 {
9578 listHobby.Add(new Hobby
9579 {
9580 id = work
9581 });
9582 }
9583 }
9584 return listHobby;
9585 }

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

3816 {
3817 angle = Util.GetAngle(p.x - pos.x, p.z - pos.z);
3818 if (EClass._zone.IsRegion)
3819 {
3820 if (angle > 100f && angle < 170f)
3821 {
3822 base.dir = 2;
3823 }
3824 else if (angle > 170f && angle < 190f)
3825 {
3826 base.dir = 0;
3827 }
3828 else if (angle > 190f || (angle < -10f && angle > -100f))
3829 {
3830 base.dir = 3;
3831 }
3832 else
3833 {
3834 base.dir = 1;
3835 }
3836 angle -= 45f;
3837 }
3838 else if (angle > 170f && angle < 235f)
3839 {
3840 base.dir = 0;
3841 }
3842 else if (angle > 80f && angle < 145f)
3843 {
3844 base.dir = 1;
3845 }
3846 else if (angle > -100f && angle < -35f)
3847 {
3848 base.dir = 3;
3849 }
3850 else if (angle > -10f && angle < 55f)
3851 {
3852 base.dir = 2;
3853 }
3855 }

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

◆ MakeAlly()

void Chara.MakeAlly ( bool  msg = true)
inline

Definition at line 2524 of file Chara.cs.

2525 {
2526 if (IsLocalChara && !base.IsUnique)
2527 {
2528 Debug.Log("Creating Replacement NPC for:" + this);
2530 }
2531 _MakeAlly();
2532 if (msg)
2533 {
2534 EClass.pc.Say("hire", this);
2535 EClass.Sound.Play("good");
2536 }
2537 EClass.pc.party.AddMemeber(this);
2538 if (EClass._zone.IsTown)
2539 {
2541 }
2542 }
Chara CreateReplacement()
Definition: Chara.cs:8529
void _MakeAlly()
Definition: Chara.cs:2544
virtual bool IsTown
Definition: Zone.cs:230
void RefreshListCitizen()
Definition: Zone.cs:3876

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

8730 {
8731 return DNA.GenerateGene(this, DNA.Type.Brain);
8732 }
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 8724 of file Chara.cs.

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

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

5590 {
5591 if (!EClass._zone.IsRegion)
5592 {
5593 List<string> list = new List<string> { "930", "931", "947", "948", "949", "950", "951", "952" };
5594 if (IsPC && EClass.rnd(2) == 0 && EClass.pc.things.Find("letter_will") != null)
5595 {
5596 list = new List<string> { "944", "946", "backerGrave", "backerGrave2" };
5597 }
5598 Thing thing = ThingGen.Create(list.RandomItem());
5599 thing.MakeRefFrom(this);
5600 if (!lastword.IsEmpty())
5601 {
5602 thing.c_note = lastword;
5603 }
5604 thing.isModified = true;
5605 EClass._zone.AddCard(thing, pos).Install();
5606 }
5607 }
Card MakeRefFrom(string id)
Definition: Card.cs:6027

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

2588 {
2589 UnmakeMinion();
2590 Hostility hostility = (base.c_originalHostility = (_master.IsPCFaction ? Hostility.Ally : _master.hostility));
2591 this.hostility = hostility;
2592 base.c_uidMaster = _master.uid;
2593 base.c_minionType = type;
2594 master = _master;
2595 Refresh();
2596 }
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 2518 of file Chara.cs.

2519 {
2520 _MakeAlly();
2521 EClass.pc.party.AddMemeber(this);
2522 }

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

◆ Marry()

void Chara.Marry ( Chara  c)
inline

Definition at line 8616 of file Chara.cs.

8617 {
8618 if (base.c_love == null)
8619 {
8620 base.c_love = new LoveData();
8621 }
8622 base.c_love.dateMarriage = EClass.world.date.GetRaw();
8623 base.c_love.uidZoneMarriage = EClass._zone.uid;
8624 base.c_love.nameZoneMarriage = EClass._zone.Name;
8625 SetFeat(1275, 1, msg: true);
8627 }
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 8451 of file Chara.cs.

8452 {
8453 if (c == this)
8454 {
8455 return;
8456 }
8457 if (IsPC)
8458 {
8459 c.ModAffinity(EClass.pc, a, show);
8460 }
8461 else
8462 {
8464 {
8465 return;
8466 }
8467 int num = StatsHygiene.GetAffinityMod(EClass.pc.hygiene.GetPhase()) + (HasElement(417) ? 30 : 0) + (EClass.pc.HasCondition<ConSmoking>() ? (-30) : 0);
8468 if (IsPCFaction && homeBranch != null)
8469 {
8470 num += (int)Mathf.Sqrt(homeBranch.Evalue(2117)) * 5;
8471 }
8472 bool flag = a > 0;
8473 if (flag)
8474 {
8475 a = a * num / 100;
8476 if (affinity.GetLunchChance() > EClass.rnd(100) && GetInt(71) >= 0 && GetInt(71) < EClass.world.date.GetRaw())
8477 {
8478 SetInt(71, -1);
8479 }
8480 }
8481 if (show)
8482 {
8483 if (a == 0)
8484 {
8485 if (!showOnlyEmo)
8486 {
8487 Say("affinityNone", this, c);
8488 }
8489 }
8490 else
8491 {
8492 ShowEmo((!flag) ? Emo.angry : Emo.love);
8493 c.ShowEmo(flag ? Emo.love : Emo.sad);
8494 if (!showOnlyEmo)
8495 {
8496 Say(flag ? "affinityPlus" : "affinityMinus", this, c);
8497 }
8498 }
8499 }
8500 if (c.IsPC)
8501 {
8502 a = affinity.Mod(a);
8503 }
8504 }
8505 }
int Mod(int a)
Definition: Affinity.cs:212
int GetLunchChance()
Definition: Affinity.cs:97
Stats hygiene
Definition: Chara.cs:1213
int Evalue(int ele)
static int GetAffinityMod(int phase)
Definition: StatsHygiene.cs:19
virtual bool CanChangeAffinity
Definition: Trait.cs:585

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

10499 {
10500 if (a > 0)
10501 {
10502 if (Evalue(962) >= 25 || (ResistLv(962) > 0 && EClass.rnd(ResistLv(962) + 1) != 0))
10503 {
10504 return;
10505 }
10506 int num = Evalue(412);
10507 if (num != 0)
10508 {
10509 float num2 = (float)a * 100f / (float)Mathf.Max(100 + num * 2, 10);
10510 a = (int)num2 + ((EClass.rndf(1f) < num2 % 1f) ? 1 : 0);
10511 }
10512 }
10513 if (a == 0)
10514 {
10515 return;
10516 }
10517 int num3 = (corruption + a) / 100 - corruption / 100;
10518 for (int i = 0; i < Mathf.Abs(num3); i++)
10519 {
10520 if (!MutateRandom((num3 > 0) ? 1 : (-1), 100, ether: true))
10521 {
10522 break;
10523 }
10524 }
10525 corruption += a;
10526 int num4 = 0;
10527 foreach (Element value in elements.dict.Values)
10528 {
10529 if (value.source.category == "ether")
10530 {
10531 num4 += value.Value;
10532 }
10533 }
10534 if (num4 > 0 && IsPC)
10535 {
10536 Tutorial.Reserve("ether");
10537 }
10538 corruption = num4 * 100 + corruption % 100;
10539 }
bool MutateRandom(int vec=0, int tries=100, bool ether=false, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:10664
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 10447 of file Chara.cs.

10448 {
10449 if (!HasElement(450))
10450 {
10451 long num = bio.height;
10452 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
10453 if (num < 1)
10454 {
10455 num = 1L;
10456 }
10457 if (num > 999999999)
10458 {
10459 num = 999999999L;
10460 }
10461 if (num != bio.height)
10462 {
10463 bio.height = (int)num;
10464 Say((a > 0) ? "height_gain" : "height_lose", this);
10465 }
10466 }
10467 }
int height
Definition: Biography.cs:53

◆ ModTempElement()

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

Definition at line 10920 of file Chara.cs.

10921 {
10922 if (a < 0 && !naturalDecay && HasElement(EClass.sources.elements.alias["sustain_" + EClass.sources.elements.map[ele].alias]?.id ?? 0))
10923 {
10924 return;
10925 }
10926 bool flag = HasElement(1215);
10927 if (tempElements == null)
10928 {
10930 tempElements.SetParent(this);
10931 }
10932 if (a > 0 && flag)
10933 {
10934 a = a * 150 / 100;
10935 }
10936 int num = elements.ValueWithoutLink(ele);
10937 int num2 = Mathf.Abs(num) + 100;
10938 int num3 = num2 / (flag ? 2 : 4);
10939 int num4 = -num - 100;
10940 int num5 = tempElements.Base(ele);
10941 int num6 = num5 + a;
10942 if (onlyRenew)
10943 {
10944 num3 = Mathf.Min(a, num3);
10945 num4 = Mathf.Max(a, -num2 / 3);
10946 }
10947 if (a > 0 && num6 > num3)
10948 {
10949 a = ((num3 > num5) ? (num3 - num5) : 0);
10950 }
10951 if (a < 0 && num6 < num4)
10952 {
10953 a = ((num4 < num5) ? (num4 - num5) : 0);
10954 }
10955 Element element = tempElements.ModBase(ele, a);
10956 if (element.vBase == 0)
10957 {
10958 tempElements.Remove(element.id);
10959 if (tempElements.dict.Count == 0)
10960 {
10961 tempElements = null;
10962 }
10963 }
10964 }
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 10469 of file Chara.cs.

10470 {
10471 if (HasElement(450) || a == 0)
10472 {
10473 return;
10474 }
10475 long num = bio.weight;
10476 long num2 = bio.height;
10477 long num3 = num2 * num2 * 18 / 25000;
10478 long num4 = num2 * num2 * 24 / 10000;
10479 if (ignoreLimit || (num > num3 && num < num4))
10480 {
10481 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
10482 if (num < 1)
10483 {
10484 num = 1L;
10485 }
10486 if (num > 999999999)
10487 {
10488 num = 999999999L;
10489 }
10490 if (num != bio.weight)
10491 {
10492 bio.weight = (int)num;
10493 Say((a > 0) ? "weight_gain" : "weight_lose", this);
10494 }
10495 }
10496 }
int weight
Definition: Biography.cs:41

◆ MoveByForce()

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

Definition at line 2876 of file Chara.cs.

2877 {
2878 if (!newPoint.sourceBlock.tileType.IsBlockPass && (!checkWall || (Dist(newPoint) <= 1 && CanMoveTo(newPoint, allowDestroyPath: false))) && _Move(newPoint, MoveType.Force) == MoveResult.Success && ai.Current.CancelWhenMoved)
2879 {
2880 ai.Current.TryCancel(c);
2881 }
2882 }
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:2970

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

3732 {
3733 if (isDead)
3734 {
3735 Revive();
3736 }
3737 else
3738 {
3739 Cure(CureType.Death);
3740 }
3741 CureCondition<ConSuspend>();
3742 if (IsPCParty)
3743 {
3745 }
3746 FactionBranch factionBranch = homeBranch;
3747 if (x == -1)
3748 {
3749 x = 50;
3750 }
3751 if (z == -1)
3752 {
3753 z = 50;
3754 }
3755 Point point = new Point(x, z);
3756 if (zone.IsActiveZone)
3757 {
3758 point = point.GetNearestPoint(allowBlock: false, allowChara: false);
3759 }
3760 zone.AddCard(this, point);
3761 SetHomeZone(zone);
3762 global.transition = new ZoneTransition
3763 {
3764 state = ZoneTransition.EnterState.Dead,
3765 x = point.x,
3766 z = point.z
3767 };
3768 orgPos = new Point(x, z);
3769 if (factionBranch != null)
3770 {
3772 factionBranch.policies.Validate();
3773 }
3774 }
void RefreshWorkElements(ElementContainer parent=null)
Definition: Chara.cs:9626
Chara SetHomeZone(Zone zone)
Definition: Chara.cs:1500
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 2858 of file Chara.cs.

2859 {
2860 List<Point> list = new List<Point>();
2861 pos.ForeachNeighbor(delegate(Point p)
2862 {
2863 list.Add(p.Copy());
2864 });
2865 list.Shuffle();
2866 foreach (Point item in list)
2867 {
2868 if (!item.Equals(pos) && !item.HasChara && TryMove(item) == MoveResult.Success)
2869 {
2870 return true;
2871 }
2872 }
2873 return false;
2874 }
override MoveResult TryMove(Point newPoint, bool allowDestroyPath=true)
Definition: Chara.cs:2946
void ForeachNeighbor(Action< Point > action, bool diagonal=true)
Definition: Point.cs:1399

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

Referenced by AI_Idle.Run().

◆ MoveRandom()

bool Chara.MoveRandom ( )
inline

Definition at line 2844 of file Chara.cs.

2845 {
2846 Point randomNeighbor = pos.GetRandomNeighbor();
2847 if (!randomNeighbor.Equals(pos) && !randomNeighbor.HasChara && HasAccess(randomNeighbor))
2848 {
2849 if ((race.tag.Contains("water") || source.tag.Contains("water")) && pos.cell.IsTopWaterAndNoSnow && !randomNeighbor.IsDeepWater)
2850 {
2851 return false;
2852 }
2853 return TryMove(randomNeighbor) == MoveResult.Success;
2854 }
2855 return false;
2856 }
bool IsTopWaterAndNoSnow
Definition: Cell.cs:748
bool IsDeepWater
Definition: Point.cs:272

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

3597 {
3598 if (z == currentZone)
3599 {
3600 return;
3601 }
3602 if (EClass.game.IsSurvival && z.IsRegion)
3603 {
3604 z = EClass.pc.homeZone;
3605 transition = new ZoneTransition
3606 {
3607 state = ZoneTransition.EnterState.Return
3608 };
3609 }
3610 if (HasCondition<ConInvulnerable>())
3611 {
3612 RemoveCondition<ConInvulnerable>();
3613 }
3614 if (IsPC)
3615 {
3616 EClass.player.nextZone = z;
3618 {
3621 {
3622 if (EClass.player.returnInfo != null)
3623 {
3624 EClass.player.returnInfo.turns += 5;
3625 }
3627 {
3628 EClass.game.Save(isAutoSave: true);
3629 }
3630 }
3631 EClass.player.deathZoneMove = false;
3632 }
3634 if (currentZone.instance != null)
3635 {
3637 z = EClass.game.spatials.Find(instance.uidZone) ?? EClass.pc.homeZone;
3638 transition = new ZoneTransition
3639 {
3640 state = instance.ReturnState,
3641 x = instance.x,
3642 z = instance.z
3643 };
3644 instance.OnLeaveZone();
3645 Debug.Log(z);
3646 }
3647 EInput.Consume(consumeAxis: true);
3648 EClass.player.uidLastZone = currentZone.uid;
3650 {
3652 {
3653 Msg.Say("enterZone", z.Name);
3654 }
3655 else
3656 {
3657 if (z.IsRegion)
3658 {
3659 Msg.Say("leaveZone", currentZone.Name);
3660 }
3661 else if (z.id != currentZone.id)
3662 {
3663 Msg.Say("enterZone", z.Name);
3664 }
3665 EClass.player.lastZonePos = pos.Copy();
3666 }
3667 EClass.player.lastTransition = transition;
3668 }
3669 foreach (Chara item in EClass._map.charas.Where((Chara c) => c.IsPCPartyMinion && c.master != EClass.pc).ToList())
3670 {
3672 }
3673 EClass.player.listCarryoverMap = EClass._map.charas.Where((Chara c) => c.c_uidMaster != 0 && c.FindMaster() == EClass.pc && c.c_minionType == MinionType.Default).ToList();
3674 if (!z.IsRegion && (z is Zone_Tent || currentZone is Zone_Tent))
3675 {
3676 foreach (Chara chara in EClass._map.charas)
3677 {
3678 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))
3679 {
3680 EClass.player.listCarryoverMap.Add(chara);
3681 }
3682 }
3683 }
3684 foreach (Chara item2 in EClass.player.listCarryoverMap)
3685 {
3686 EClass._zone.RemoveCard(item2);
3687 }
3688 }
3689 if (party != null && party.leader == this)
3690 {
3691 foreach (Chara member in party.members)
3692 {
3693 if (member != this && !member.isDead && member.parent is Zone)
3694 {
3695 member.MoveZone(z);
3696 }
3697 }
3698 }
3699 if (global == null)
3700 {
3701 Debug.Log(base.Name);
3702 return;
3703 }
3704 transition.uidLastZone = currentZone?.uid ?? 0;
3705 global.transition = transition;
3706 if (z.IsActiveZone)
3707 {
3708 Point spawnPos = z.GetSpawnPos(this);
3709 global.transition = null;
3710 if (IsPC)
3711 {
3712 EClass.player.lastTransition = null;
3713 }
3714 z.AddCard(this, spawnPos);
3715 if (IsBranchMember())
3716 {
3718 }
3719 }
3720 else
3721 {
3722 z.AddCard(this);
3723 }
3724 }
MinionType c_minionType
Definition: Card.cs:1015
bool IsBranchMember()
Definition: Chara.cs:7009
GlobalData global
Definition: Chara.cs:78
Chara FindMaster()
Definition: Chara.cs:2653
bool ignoreAutoSave
Definition: CoreDebug.cs:142
bool Save(bool isAutoSave=false, bool silent=false)
Definition: Game.cs:1090
bool IsSurvival
Definition: Game.cs:276
RoomManager rooms
Definition: Map.cs:34
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:1500

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

3589 {
3591 {
3592 state = state
3593 });
3594 }

◆ MutateRandom()

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

Definition at line 10664 of file Chara.cs.

10665 {
10666 if (!ether && vec >= 0 && HasElement(406) && EClass.rnd(5) != 0)
10667 {
10668 Say("resistMutation", this);
10669 return false;
10670 }
10671 IEnumerable<SourceElement.Row> ie = EClass.sources.elements.rows.Where((SourceElement.Row a) => a.category == (ether ? "ether" : "mutation") && !a.tag.Contains("noRandomMutation"));
10672 for (int num = 0; num < tries; num++)
10673 {
10674 SourceElement.Row row = ie.RandomItem();
10675 if (num == 0 && vec < 0 && ether && base.c_corruptionHistory != null && base.c_corruptionHistory.Count > 0)
10676 {
10677 if (EClass.sources.elements.map.ContainsKey(base.c_corruptionHistory.LastItem()))
10678 {
10679 row = EClass.sources.elements.map[base.c_corruptionHistory.LastItem()];
10680 }
10681 base.c_corruptionHistory.RemoveAt(base.c_corruptionHistory.Count - 1);
10682 if (base.c_corruptionHistory.Count == 0)
10683 {
10684 base.c_corruptionHistory = null;
10685 }
10686 }
10687 Element element = elements.GetElement(row.id);
10688 int num2 = 1;
10689 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))
10690 {
10691 continue;
10692 }
10693 if (element == null && !row.aliasParent.IsEmpty() && elements.Has(row.aliasParent))
10694 {
10695 row = EClass.sources.elements.alias[row.aliasParent];
10696 element = elements.GetElement(row.id);
10697 }
10698 bool flag = row.tag.Contains("neg");
10699 if (vec > 0)
10700 {
10701 if ((state >= BlessedState.Blessed && flag) || (state <= BlessedState.Cursed && !flag))
10702 {
10703 continue;
10704 }
10705 }
10706 else if (vec < 0 && ((state >= BlessedState.Blessed && !flag) || (state <= BlessedState.Cursed && flag)))
10707 {
10708 continue;
10709 }
10710 bool flag2 = true;
10711 if (element != null)
10712 {
10713 num2 = element.Value + ((vec != 0) ? vec : ((EClass.rnd(2) == 0) ? 1 : (-1)));
10714 if (num2 > element.source.max)
10715 {
10716 num2 = element.source.max - 1;
10717 }
10718 flag = (flag && num2 > element.Value) || (!flag && num2 < element.Value);
10719 flag2 = num2 > element.Value;
10720 if (vec > 0 && !flag2)
10721 {
10722 continue;
10723 }
10724 }
10725 Say(flag2 ? "mutation_gain" : "mutation_loose", this);
10726 SetFeat(row.id, num2);
10727 if (flag2 && ether)
10728 {
10729 if (base.c_corruptionHistory == null)
10730 {
10731 base.c_corruptionHistory = new List<int>();
10732 }
10733 base.c_corruptionHistory.Add(row.id);
10734 if (IsPCFaction)
10735 {
10736 Element element2 = elements.GetElement(row.id);
10737 WidgetPopText.Say("popEther".lang(element2.Name, base.Name));
10738 }
10740 {
10741 EClass.player.flags.gotEtherDisease = true;
10742 Thing thing = ThingGen.Create("parchment");
10743 thing.SetStr(53, "letter_ether");
10744 Thing thing2 = ThingGen.Create("1165");
10745 thing2.SetBlessedState(BlessedState.Normal);
10746 Thing p = ThingGen.CreateParcel(null, thing2, thing);
10748 }
10749 }
10750 if (EClass.core.IsGameStarted && pos != null)
10751 {
10752 PlaySound(ether ? "mutation_ether" : "mutation");
10753 PlayEffect("mutation");
10755 Say(row.GetText(flag ? "textDec" : "textInc", returnNull: true) ?? row.alias, this);
10756 }
10757 return true;
10758 }
10759 Say("nothingHappens");
10760 return false;
10761 }
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 10813 of file Chara.cs.

10814 {
10815 if (_historyFood != null)
10816 {
10817 while (_historyFood.Count > 5)
10818 {
10819 _historyFood.RemoveAt(_historyFood.Count - 1);
10820 }
10821 if (_historyFood[0].Count > 0)
10822 {
10823 _historyFood.Insert(0, new List<string>());
10824 }
10825 }
10826 }

Referenced by GameDate.AdvanceDay().

◆ OnBanish()

void Chara.OnBanish ( )
inline

Definition at line 1514 of file Chara.cs.

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

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

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

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

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

8942 {
8943 Say("give_erohon", this);
8944 AddCondition<ConParalyze>(50, force: true);
8945 AddCondition<ConConfuse>(50, force: true);
8946 AddCondition<ConFear>(1000, force: true);
8947 ModAffinity(EClass.pc, 100);
8948 t.Destroy();
8949 Talk("pervert");
8950 }

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

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

◆ OnInsulted()

void Chara.OnInsulted ( )
inline

Definition at line 8734 of file Chara.cs.

8735 {
8736 if (isDead)
8737 {
8738 return;
8739 }
8740 if (HasElement(1231))
8741 {
8742 Talk("insulted");
8743 AddCondition<ConEuphoric>(100 * Evalue(1231));
8744 }
8745 else if (EClass.rnd(20) == 0)
8746 {
8747 SetFeat(1231, 1, msg: true);
8748 if (IsPC)
8749 {
8751 }
8752 }
8753 }

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

1378 {
1379 if (enemy != null)
1380 {
1381 SetInt(55, enemy.uid);
1382 }
1383 _cints[0] = (int)_cbits1.Bits;
1384 List<BodySlot> slots = body.slots;
1385 rawSlots = new int[slots.Count];
1386 for (int i = 0; i < slots.Count; i++)
1387 {
1388 rawSlots[i] = slots[i].elementId;
1389 }
1390 }
List< BodySlot > slots
Definition: CharaBody.cs:8
int[] rawSlots
Definition: Chara.cs:75
BitArray32 _cbits1
Definition: Chara.cs:86
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 10397 of file Chara.cs.

10398 {
10399 if (days < 1)
10400 {
10401 days = 1;
10402 }
10403 int num = power * days;
10404 if (stamina.value < 0)
10405 {
10406 stamina.Set(1);
10407 }
10408 if (IsPC)
10409 {
10411 foreach (BodySlot slot in body.slots)
10412 {
10413 if (slot.thing != null && slot.thing.GetBool(135))
10414 {
10416 slot.thing.SetBool(135, enable: false);
10417 }
10418 }
10419 }
10420 if (isWeakToSunlight && isSunLit)
10421 {
10422 base.hp = 0;
10423 if (mana.value > 0)
10424 {
10425 mana.Set(0);
10426 }
10427 AddCondition<ConBurning>(1000, force: true);
10428 }
10429 else
10430 {
10431 HealHP(num);
10432 stamina.Mod(10 + 25 * num / 100 * (100 + elements.GetFeatRef(1642)) / 100);
10433 mana.Mod(num);
10434 }
10435 if (IsPCFaction)
10436 {
10437 hunger.Mod(20);
10438 }
10439 sleepiness.Set(0);
10440 if (!IsMinion)
10441 {
10442 interest = 100;
10443 }
10444 Cure(CureType.Sleep, power);
10445 }
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:156
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 10377 of file Chara.cs.

10378 {
10379 bool isSunLit = pos.IsSunLit;
10380 TraitPillow traitPillow = pos.FindThing<TraitPillow>();
10381 int num = bed?.Power ?? 20;
10382 if (traitPillow != null)
10383 {
10384 num += traitPillow.owner.Power / 2;
10385 }
10386 if (bed != null)
10387 {
10388 num += bed.Evalue(750) * 5;
10389 if (bed.trait is TraitBedCoffin)
10390 {
10391 isSunLit = false;
10392 }
10393 }
10394 OnSleep(num, days, isSunLit);
10395 }
void OnSleep(Thing bed=null, int days=1)
Definition: Chara.cs:10377
Thing FindThing(Func< Thing, bool > func)
Definition: Point.cs:1142

References bed.

Referenced by LayerSleep.Advance().

◆ ParseBodySlot()

int Chara.ParseBodySlot ( string  s)
inlineprivate

Definition at line 2401 of file Chara.cs.

2402 {
2403 return s switch
2404 {
2405 "é ­" => 30,
2406 "首" => 31,
2407 "体" => 32,
2408 "背" => 33,
2409 "手" => 35,
2410 "指" => 36,
2411 "è…•" => 34,
2412 "è…°" => 37,
2413 "è¶³" => 39,
2414 _ => -1,
2415 };
2416 }

Referenced by ApplyRace(), and ResetBody().

◆ PerformWork()

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

Definition at line 9811 of file Chara.cs.

9812 {
9813 Hobby hobby = new Hobby();
9814 hobby.id = session.id;
9815 WorkSummary workSummary = _workSummary;
9816 hobby.GetAI(this).OnPerformWork(IsRealTime);
9817 if (!isHobby)
9818 {
9819 workSummary.progress += EClass.rnd(5) + 5;
9820 }
9821 int num = PerformWork(hobby, 0, isHobby);
9822 int num2 = PerformWork(hobby, 1, isHobby);
9823 int num3 = PerformWork(hobby, 2, isHobby);
9824 int num4 = PerformWork(hobby, 3, isHobby);
9825 workSummary.money += num;
9826 workSummary.food += num2;
9827 workSummary.knowledge += num3;
9828 workSummary.material += num4;
9829 int PerformWork(Hobby work, int idx, bool flag)
9830 {
9831 if (idx >= work.source.resources.Length)
9832 {
9833 return 0;
9834 }
9835 int num5 = work.source.resources[idx];
9836 int num6 = num5;
9837 num5 = Rand.Range(num5 * (100 - work.source.resources[idx]) / 100, num5);
9838 num5 = num5 * (flag ? 50 : 100) * session.efficiency / 10000;
9839 if (num6 > 0 && num5 <= 0)
9840 {
9841 num5 = 1;
9842 }
9843 return num5;
9844 }
9845 }
virtual void OnPerformWork(bool realtime)
Definition: AIWork.cs:155
void PerformWork(WorkSession session, bool isHobby=false, bool IsRealTime=false)
Definition: Chara.cs:9811
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 4612 of file Chara.cs.

4613 {
4614 if (t.trait is TraitCard && t.isNew && EClass.game.config.autoCollectCard && !t.c_idRefCard.IsEmpty())
4615 {
4617 return t;
4618 }
4619 if (t.parent == this)
4620 {
4621 return t;
4622 }
4623 t = TryPoisonPotion(t);
4624 ThingContainer.DestData dest = things.GetDest(t, tryStack);
4625 if (!dest.IsValid)
4626 {
4627 if (t.parent != EClass._zone)
4628 {
4629 if (IsPC)
4630 {
4631 Say("backpack_full_drop", t);
4632 SE.Drop();
4633 }
4634 return EClass._zone.AddCard(t, pos).Thing;
4635 }
4636 if (IsPC)
4637 {
4638 Say("backpack_full", t);
4639 }
4640 return t;
4641 }
4642 if (dest.stack != null)
4643 {
4644 if (msg)
4645 {
4646 PlaySound("pick_thing");
4647 Say("pick_thing", this, t);
4648 }
4649 t.TryStackTo(dest.stack);
4650 return dest.stack;
4651 }
4652 TryAbsorbRod(t);
4653 if (msg)
4654 {
4655 PlaySound("pick_thing");
4656 Say("pick_thing", this, t);
4657 }
4659 return dest.container.AddThing(t, tryStack);
4660 }
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:4706
Thing TryPoisonPotion(Thing t)
Definition: Chara.cs:4662
void TryAbsorbRod(Thing t)
Definition: Chara.cs:4676
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 4832 of file Chara.cs.

4833 {
4834 if (held == null)
4835 {
4836 return;
4837 }
4838 Card card = held;
4839 if (IsPC && held.invY == 1)
4840 {
4841 WidgetHotbar.dirtyCurrentItem = true;
4843 held = null;
4844 return;
4845 }
4846 if (held.isChara)
4847 {
4848 DropHeld();
4849 return;
4850 }
4852 {
4853 Say("canOnlyCarry", held);
4854 DropHeld();
4855 return;
4856 }
4857 bool flag = held != things.TryStack(held.Thing);
4858 if (!flag && things.IsOverflowing())
4859 {
4860 if (IsPC)
4861 {
4862 Say("backpack_full_drop", held);
4863 SE.Drop();
4864 }
4865 DropHeld();
4866 return;
4867 }
4868 if (msg)
4869 {
4870 PlaySound("pick_thing");
4871 Say("pick_held", this, card);
4872 if (IsPC && card.id == "statue_weird")
4873 {
4874 Say("statue_pick");
4875 }
4876 }
4877 if (IsPC)
4878 {
4879 WidgetHotbar.dirtyCurrentItem = true;
4880 if (!flag)
4881 {
4883 if (held.GetRootCard() != EClass.pc)
4884 {
4885 Pick(held.Thing, msg: false);
4886 }
4887 }
4888 }
4889 held = null;
4890 }
int invY
Definition: Card.cs:2007
bool IsHotItem
Definition: Card.cs:122
Card DropHeld(Point dropPos=null)
Definition: Chara.cs:4909
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 4592 of file Chara.cs.

4593 {
4594 if (num != 0)
4595 {
4596 PickOrDrop(p, ThingGen.Create(idThing, idMat).SetNum(num), msg);
4597 }
4598 }

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

4601 {
4602 if (things.GetDest(t).IsValid)
4603 {
4604 Pick(t, msg);
4605 }
4606 else
4607 {
4608 EClass._zone.AddCard(t, p);
4609 }
4610 }

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

◆ Refresh()

void Chara.Refresh ( bool  calledRecursive = false)
inline

Definition at line 1806 of file Chara.cs.

1807 {
1808 if (source == null)
1809 {
1810 Debug.LogError("source is null");
1811 SetSource();
1812 }
1813 if (ride != null && ride.source != null)
1814 {
1815 ride.Refresh(calledRecursive: true);
1816 }
1817 hasTelepathy = false;
1818 isWet = false;
1819 _isLevitating = HasElement(401) || (ride != null && ride._isLevitating);
1821 isWeakToSunlight = HasElement(1251) && !HasElement(431);
1822 base.isHidden = HasElement(415);
1823 isAstralBody = HasElement(1430);
1824 foreach (Condition condition in conditions)
1825 {
1826 condition.OnRefresh();
1827 }
1828 if (isWet)
1829 {
1830 base.isHidden = false;
1831 }
1833 SetDirtySpeed();
1834 if (host != null && !calledRecursive && host.source != null)
1835 {
1836 host.Refresh(calledRecursive: true);
1837 }
1838 }
virtual void OnRefresh()
bool isWet
Definition: Chara.cs:146
bool isAstralBody
Definition: Chara.cs:158
override void SetSource()
Definition: Chara.cs:2290
bool IsUndead
Definition: Chara.cs:940
bool IsHorror
Definition: Chara.cs:964
bool IsMachine
Definition: Chara.cs:952

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

10878 {
10879 if (faithElements != null)
10880 {
10882 }
10884 if (idFaith == "eyth" && !HasElement(1228))
10885 {
10886 return;
10887 }
10888 SourceReligion.Row row = EClass.sources.religions.map.TryGetValue(idFaith);
10889 if (row == null)
10890 {
10891 return;
10892 }
10894 if (!HasCondition<ConExcommunication>())
10895 {
10896 SourceElement.Row row2 = EClass.sources.elements.alias.TryGetValue("featGod_" + row.id + "1");
10897 if (row2 != null)
10898 {
10899 faithElements.SetBase(row2.id, 1);
10900 }
10901 int[] array = row.elements;
10902 int num = GetPietyValue() * (120 + Evalue(1407) * 15 + Evalue(1228) * 20) / 100;
10903 for (int i = 0; i < array.Length; i += 2)
10904 {
10905 int num2 = array[i + 1] * num / 50;
10906 if (array[i] == 79)
10907 {
10908 num2 = EClass.curve(num2, array[i + 1] * 2, 10, 50);
10909 }
10910 if (num2 >= 20 && array[i] >= 950 && array[i] < 970)
10911 {
10912 num2 = 20;
10913 }
10914 faithElements.SetBase(array[i], Mathf.Max(num2, 1));
10915 }
10916 }
10918 }
string idFaith
Definition: Chara.cs:237
ElementContainer faithElements
Definition: Chara.cs:40
int GetPietyValue()
Definition: Chara.cs:10868
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 2080 of file Chara.cs.

2081 {
2082 if (currentZone != EClass._zone)
2083 {
2084 dirtySpeed = true;
2085 return;
2086 }
2087 if (ride != null && !ride.IsDeadOrSleeping)
2088 {
2090 _Speed = ride._Speed;
2091 info?.AddText("rideSpeed".lang(_Speed.ToString() ?? ""));
2092 }
2093 else if (host != null)
2094 {
2095 if (host.ride == this)
2096 {
2097 _Speed = Evalue(79);
2098 int a = Evalue(1423);
2099 int num = ((!HasElement(495)) ? 1 : 3);
2100 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);
2101 _Speed = _Speed * 100 / Mathf.Clamp(value, 100, 1000);
2102 }
2103 else
2104 {
2105 _Speed = (Evalue(79) + host.Evalue(79)) / 2;
2106 }
2107 }
2108 else
2109 {
2110 _Speed = Evalue(79) + Evalue(407) / 2;
2111 }
2112 if (body.GetSlot(37, onlyEmpty: false)?.thing != null && HasElement(1209) && !HasElement(419))
2113 {
2114 _Speed -= 25L;
2115 info?.AddText(-25L, EClass.sources.elements.map[1209].GetName());
2116 }
2117 if (parasite != null)
2118 {
2119 long speed = _Speed;
2120 int num2 = ((!HasElement(495)) ? 1 : 3);
2121 _Speed = _Speed * 100 / Mathf.Clamp(120 + parasite.LV * 2 / num2 - base.STR - Evalue(227) * 2, 100, 1000);
2122 info?.AddText(_Speed - speed, "parasiteSpeed".lang());
2123 }
2124 if (_Speed < elements.ValueWithoutLink(79) / 3)
2125 {
2127 info?.AddText("minSpeed".lang((elements.ValueWithoutLink(79) / 3).ToString() ?? ""));
2128 }
2129 int num3 = 100;
2130 if (EClass._zone.map != null && (EClass._zone.IsUnderwater || (base.Cell.IsTopWaterAndNoSnow && !base.Cell.isFloating)))
2131 {
2132 int num4 = Evalue(200);
2133 int num5 = Evalue(1252);
2134 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);
2135 if (info != null && num3 != 100)
2136 {
2137 info.AddFix(num3 - 100, EClass.sources.elements.map[200].GetName().ToTitleCase());
2138 }
2139 if (num5 > 0)
2140 {
2141 num3 += num5 * 20;
2142 info?.AddFix(num5 * 20, EClass.sources.elements.map[1252].GetName().ToTitleCase());
2143 }
2144 }
2145 if (IsPCFaction)
2146 {
2147 switch (burden.GetPhase())
2148 {
2149 case 1:
2150 num3 -= 10;
2151 info?.AddFix(-10, burden.GetPhaseStr());
2152 break;
2153 case 2:
2154 num3 -= 20;
2155 info?.AddFix(-20, burden.GetPhaseStr());
2156 break;
2157 case 3:
2158 num3 -= 30;
2159 info?.AddFix(-30, burden.GetPhaseStr());
2160 break;
2161 case 4:
2162 num3 -= (IsPC ? 50 : 100);
2163 info?.AddFix(IsPC ? (-50) : (-100), burden.GetPhaseStr());
2164 break;
2165 }
2166 if (IsPC)
2167 {
2168 switch (stamina.GetPhase())
2169 {
2170 case 1:
2171 num3 -= 10;
2172 info?.AddFix(-10, stamina.GetPhaseStr());
2173 break;
2174 case 0:
2175 num3 -= 20;
2176 info?.AddFix(-20, stamina.GetPhaseStr());
2177 break;
2178 }
2179 switch (sleepiness.GetPhase())
2180 {
2181 case 2:
2182 num3 -= 10;
2183 info?.AddFix(-10, sleepiness.GetPhaseStr());
2184 break;
2185 case 3:
2186 num3 -= 20;
2187 info?.AddFix(-20, sleepiness.GetPhaseStr());
2188 break;
2189 }
2190 switch (hunger.GetPhase())
2191 {
2192 case 3:
2193 case 4:
2194 num3 -= 10;
2195 info?.AddFix(-10, hunger.GetPhaseStr());
2196 break;
2197 case 5:
2198 num3 -= 30;
2199 info?.AddFix(-30, hunger.GetPhaseStr());
2200 break;
2201 }
2202 num3 += EClass.player.lastEmptyAlly * Evalue(1646);
2203 info?.AddFix(EClass.player.lastEmptyAlly * Evalue(1646), EClass.sources.elements.map[1646].GetName());
2204 }
2206 {
2207 num3 += EClass.player.lastEmptyAlly * 10 - 10;
2208 info?.AddFix(EClass.player.lastEmptyAlly * 10 - 10, "exceedParty".lang());
2209 }
2210 }
2211 else if (base.LV >= 1000 && !EClass.game.principal.disableVoidBlessing && !base.IsPCFactionOrMinion)
2212 {
2213 num3 += EClass.curve((base.LV - 900) / 100 * 10, 500, 100);
2214 info?.AddFix(EClass.curve((base.LV - 900) / 100 * 10, 500, 100), "enemySpeedBuff".lang());
2215 }
2216 if (HasCondition<ConGravity>())
2217 {
2218 num3 -= 30;
2219 info?.AddFix(-30, GetCondition<ConGravity>().Name);
2220 }
2221 if (_Speed < 10)
2222 {
2223 _Speed = 10L;
2224 }
2225 _Speed = _Speed * num3 / 100;
2226 if (_Speed < 10)
2227 {
2228 _Speed = 10L;
2229 info?.AddText("minSpeed".lang(10.ToString() ?? ""));
2230 }
2231 dirtySpeed = false;
2232 }
Ridability
Definition: Ridability.cs:2
override string ToString()
Definition: Chara.cs:1233
bool dirtySpeed
Definition: Chara.cs:176
long _Speed
Definition: Chara.cs:178
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 9626 of file Chara.cs.

9627 {
9628 if (workElements != null)
9629 {
9631 }
9632 workElements = null;
9633 if (IsPCParty || homeBranch == null || homeBranch.owner == null)
9634 {
9635 return;
9636 }
9637 foreach (Hobby item in ListHobbies())
9638 {
9639 TryAdd(item);
9640 }
9641 foreach (Hobby item2 in ListWorks())
9642 {
9643 TryAdd(item2);
9644 }
9645 if (workElements != null)
9646 {
9648 }
9649 void TryAdd(Hobby h)
9650 {
9651 if (!h.source.elements.IsEmpty())
9652 {
9653 if (workElements == null)
9654 {
9656 }
9657 for (int i = 0; i < h.source.elements.Length; i += 2)
9658 {
9659 int num = h.source.elements[i];
9660 int num2 = h.source.elements[i + 1];
9661 int num3 = 100;
9662 if (num != 2115 && num != 2207)
9663 {
9664 num3 = h.GetEfficiency(this) * homeBranch.efficiency / 100;
9665 if (num3 <= 0)
9666 {
9667 continue;
9668 }
9669 }
9670 workElements.ModBase(num, (num2 < 0) ? (num2 / 10) : Mathf.Max(1, h.source.elements[i + 1] * num3 / 1000));
9671 }
9672 }
9673 }
9674 }
ElementContainer workElements
Definition: Chara.cs:42
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 10282 of file Chara.cs.

10283 {
10284 for (int num = conditions.Count - 1; num >= 0; num--)
10285 {
10286 Condition condition = conditions[num];
10287 if (condition.Type == ConditionType.Stance)
10288 {
10289 condition.Kill();
10290 }
10291 }
10292 }

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

Referenced by DNA.Apply(), ConBaseTransmuteMimic.Change(), Religion.LeaveFaith(), and ConBaseTransmuteMimic.OnRemoved().

◆ RemoveCondition< T >()

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

Definition at line 10133 of file Chara.cs.

10133 : Condition
10134 {
10135 for (int num = conditions.Count - 1; num >= 0; num--)
10136 {
10137 if (conditions[num] is T)
10138 {
10139 conditions[num].Kill();
10140 break;
10141 }
10142 }
10143 }

References Condition.Kill().

◆ RemoveGlobal()

void Chara.RemoveGlobal ( )
inline

◆ RemoveLastBodyPart()

void Chara.RemoveLastBodyPart ( bool  msg = false)
inline

Definition at line 2429 of file Chara.cs.

2430 {
2431 if (body.slots.Count != 0)
2432 {
2433 BodySlot bodySlot = body.slots.LastItem();
2434 body.RemoveBodyPartAt(body.slots.Count - 1);
2435 if (msg)
2436 {
2437 Say("lose_bodyparts", this, Element.Get(bodySlot.elementId).GetName().ToLower());
2438 PlaySound("offering");
2439 }
2440 }
2441 }
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 8962 of file Chara.cs.

8963 {
8964 if (HasCondition<StanceTaunt>() || base.isRestrained || attacker == this)
8965 {
8966 return false;
8967 }
8968 if (host != null && host.isRestrained)
8969 {
8970 return false;
8971 }
8972 if (base.IsPCFactionOrMinion && attacker.IsPCFactionOrMinion)
8973 {
8974 return false;
8975 }
8976 bool flag = false;
8977 foreach (Chara chara in EClass._map.charas)
8978 {
8979 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))
8980 {
8981 continue;
8982 }
8983 bool flag2 = chara.HasElement(1225) && !chara.GetBool(126);
8984 if ((!flag2 && (flag || EClass.rnd(2) == 0 || !chara.HasCondition<StanceTaunt>())) || chara.HasCooldown(1225))
8985 {
8986 continue;
8987 }
8988 int num = Mathf.Max(chara.Evalue(1649), (!flag2) ? 1 : 3);
8989 int num2 = Dist(chara);
8990 if (num2 > 25)
8991 {
8992 continue;
8993 }
8994 if (num2 > num || !chara.CanSeeLos(pos, num2))
8995 {
8996 if (!flag2)
8997 {
8998 continue;
8999 }
9000 Point nearestPoint = pos.GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: true, ignoreCenter: true);
9001 if (!nearestPoint.IsValid)
9002 {
9003 continue;
9004 }
9005 chara.Teleport(nearestPoint);
9006 chara.AddCooldown(1225, 10);
9007 num2 = Dist(chara);
9008 Say("intercept_loyal", chara, this);
9009 chara.SetEnemy(attacker);
9010 attacker.SetEnemy(chara);
9011 if (num2 > num || !chara.CanSeeLos(pos, num2))
9012 {
9013 continue;
9014 }
9015 }
9016 if (!flag && !HasElement(1225))
9017 {
9018 Say("intercept", chara, this);
9019 if (EClass.rnd(10) == 0)
9020 {
9021 chara.Talk("intercept", base.NameSimple);
9022 }
9023 if (attacker.enemy == this)
9024 {
9025 attacker.SetEnemy(chara);
9026 }
9027 action(chara);
9028 flag = true;
9029 }
9030 }
9031 return flag;
9032 }
void Teleport(Point point, bool silent=false, bool force=false)
Definition: Card.cs:6194
ConSuspend conSuspend
Definition: Chara.cs:106
void AddCooldown(int idEle, int turns=0)
Definition: Chara.cs:9277
bool HasCooldown(int idEle)
Definition: Chara.cs:9328

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

9721 {
9722 if (_hobbies != null && _works != null)
9723 {
9724 _hobbies.Clear();
9725 _works.Clear();
9726 }
9727 else
9728 {
9729 _hobbies = new List<int>();
9730 _works = new List<int>();
9731 }
9732 if (source.hobbies.IsEmpty())
9733 {
9734 AddHobby(EClass.sources.hobbies.listHobbies.RandomItem().id);
9735 }
9736 else
9737 {
9738 string[] hobbies = source.hobbies;
9739 foreach (string text in hobbies)
9740 {
9741 if (EClass.sources.hobbies.alias.TryGetValue(text.Trim(), out var value))
9742 {
9743 AddHobby(value.id);
9744 continue;
9745 }
9746 ModUtil.LogModError("source chara row '" + source.id + "' has invalid hobby '" + text + "'", source);
9747 }
9748 }
9749 if (source.works.IsEmpty())
9750 {
9751 AddWork(EClass.sources.hobbies.listWorks.RandomItem().id);
9752 }
9753 else
9754 {
9755 string[] hobbies = source.works;
9756 foreach (string text2 in hobbies)
9757 {
9758 if (EClass.sources.hobbies.alias.TryGetValue(text2.Trim(), out var value2))
9759 {
9760 AddWork(value2.id);
9761 continue;
9762 }
9763 ModUtil.LogModError("source chara row '" + source.id + "' has invalid work '" + text2 + "'", source);
9764 }
9765 }
9767 }
WorkSummary GetWorkSummary()
Definition: Chara.cs:9769
void AddWork(int id)
Definition: Chara.cs:9708
void AddHobby(int id)
Definition: Chara.cs:9696
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 2443 of file Chara.cs.

2444 {
2445 for (int num = body.slots.Count - 1; num >= 0; num--)
2446 {
2447 BodySlot bodySlot = body.slots[num];
2448 if (bodySlot.elementId == 45 || bodySlot.elementId == 40)
2449 {
2450 return;
2451 }
2452 body.RemoveBodyPart(num);
2453 }
2454 string[] array = race.figure.Split('|');
2455 foreach (string s in array)
2456 {
2457 int num2 = ParseBodySlot(s);
2458 if (num2 != -1)
2459 {
2460 body.AddBodyPart(num2);
2461 }
2462 }
2464 }

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

◆ ResetUpgrade()

void Chara.ResetUpgrade ( )
inline

Definition at line 9162 of file Chara.cs.

9163 {
9164 _ = base.c_upgrades;
9165 }

Referenced by CoreDebug.ResetPetUpgrades().

◆ ResistCon()

void Chara.ResistCon ( Condition  con)
inline

Definition at line 10339 of file Chara.cs.

10340 {
10341 if (con.power > 0 && resistCon != null)
10342 {
10343 int a = ClassExtension.TryGetValue<int, int>((IDictionary<int, int>)resistCon, con.id, 0);
10344 if (1000 < EClass.rnd(a))
10345 {
10346 con.power = 0;
10347 }
10348 else if (500 < EClass.rnd(a))
10349 {
10350 con.power /= 5;
10351 }
10352 else if (200 < EClass.rnd(a))
10353 {
10354 con.power /= 3;
10355 }
10356 else if (100 < EClass.rnd(a))
10357 {
10358 con.power /= 2;
10359 }
10360 }
10361 }

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

◆ RestockEquip()

void Chara.RestockEquip ( bool  onCreate)
inline

Definition at line 5001 of file Chara.cs.

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

5353 {
5354 switch (id)
5355 {
5356 case "lomias":
5357 if (ShouldRestock("_meat"))
5358 {
5359 AddCard(ThingGen.Create("_meat").MakeRefFrom("begger"));
5360 }
5361 break;
5362 case "fiama":
5363 Restock("book_story", 1);
5364 break;
5365 case "rock_thrower":
5366 Restock("stone", 10 + EClass.rnd(10));
5367 break;
5368 case "giant":
5369 Restock("rock", 2 + EClass.rnd(10));
5370 break;
5371 case "farris":
5372 Restock("lute", 1);
5373 Restock("book_story_home", 1);
5374 break;
5375 case "begger":
5376 break;
5377 }
5378 void Restock(string id, int num)
5379 {
5380 if (ShouldRestock(id))
5381 {
5382 AddCard(ThingGen.Create(id).SetNum(num));
5383 }
5384 }
5385 bool ShouldRestock(string id)
5386 {
5387 return things.Find(id) == null;
5388 }
5389 }

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

◆ Revive()

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

Definition at line 5503 of file Chara.cs.

5504 {
5505 if (!isDead)
5506 {
5507 return;
5508 }
5509 isDead = false;
5510 base.hp = MaxHP / 3;
5511 mana.value = 0;
5512 stamina.value = 0;
5513 if (hunger.value > 30)
5514 {
5515 hunger.value = 30;
5516 }
5517 sleepiness.value = 0;
5519 RemoveCondition<StanceTaunt>();
5520 if (id == "keeper_garden")
5521 {
5522 SaiyanRevive();
5523 }
5524 if (IsPC)
5525 {
5527 {
5528 Msg.Say("noDeathPenalty2", this);
5529 }
5531 {
5532 Msg.Say("noDeathPenalty", this);
5533 }
5534 else
5535 {
5537 }
5538 List<Thing> dropList = new List<Thing>();
5539 EClass.pc.things.Foreach(delegate(Thing t)
5540 {
5542 {
5543 t.ignoreAutoPick = true;
5544 dropList.Add(t);
5545 }
5546 }, onlyAccessible: false);
5547 foreach (Thing item in dropList)
5548 {
5550 Msg.Say("backpack_full_drop", item);
5551 }
5552 EClass.player.preventDeathPenalty = false;
5553 }
5554 if (IsPCFaction && homeBranch != null)
5555 {
5556 homeBranch.Log("bRevive", this);
5557 }
5558 if (p != null)
5559 {
5560 if (!p.IsInBounds)
5561 {
5563 }
5564 EClass._zone.AddCard(this, p);
5565 if (msg)
5566 {
5567 SE.Play("revive");
5568 Msg.Say("revive", this);
5569 PlayEffect("revive");
5570 }
5571 SetCensored(enable: false);
5572 }
5573 }
void SetCensored(bool enable)
Definition: Card.cs:8290
Card parentCard
Definition: Card.cs:106
void SaiyanRevive()
Definition: Chara.cs:5575
void ApplyDeathPenalty()
Definition: Chara.cs:5609
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 3796 of file Chara.cs.

3797 {
3798 if (renderer.hasActor)
3799 {
3800 base.dir = (base.dir + ((!reverse) ? 1 : (-1))).Clamp(0, 3, loop: true);
3801 }
3802 else
3803 {
3804 base.dir = ((base.dir == 0) ? 1 : 0);
3805 }
3806 UpdateAngle();
3808 }

Referenced by AI_Dance.Run().

◆ SaiyanRevive()

void Chara.SaiyanRevive ( )
inline

Definition at line 5575 of file Chara.cs.

5576 {
5577 ModCorruption(-100000);
5578 if (base.LV < 10000000)
5579 {
5580 SetLv(base.LV * 10 + 9);
5581 }
5582 Refresh();
5583 base.hp = MaxHP;
5584 mana.value = mana.max;
5585 stamina.value = stamina.max;
5586 bossText = true;
5587 }
void ModCorruption(int a)
Definition: Chara.cs:10498

References Stats.max.

◆ ScaleByPrincipal()

Chara Chara.ScaleByPrincipal ( )
inline

◆ SetAI()

AIAct Chara.SetAI ( AIAct  g)
inline

Definition at line 9496 of file Chara.cs.

9497 {
9498 if (IsPC)
9499 {
9501 }
9502 if (ai.IsRunning)
9503 {
9504 if (ai == g && ai.IsNoGoal)
9505 {
9506 return g;
9507 }
9508 ai.Cancel();
9509 if (ai == g)
9510 {
9511 Debug.Log("goal is g:" + ai?.ToString() + "/" + this);
9512 return g;
9513 }
9514 }
9515 if (HasCondition<ConWait>())
9516 {
9517 RemoveCondition<ConWait>();
9518 }
9519 ai = g;
9520 ai.SetOwner(this);
9521 if (IsPC)
9522 {
9524 }
9525 return g;
9526 }
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.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 9486 of file Chara.cs.

9487 {
9488 SetAI(new GoalCombat());
9489 }

Referenced by ZoneEventQuest.AggroEnemy().

◆ SetAIIdle()

void Chara.SetAIIdle ( )
inline

Definition at line 9482 of file Chara.cs.

9483 {
9484 }

◆ SetAIImmediate()

void Chara.SetAIImmediate ( AIAct  g)
inline

◆ SetCooldown()

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

Definition at line 9295 of file Chara.cs.

9296 {
9297 if (_cooldowns == null)
9298 {
9299 _cooldowns = new List<int>();
9300 }
9301 bool flag = false;
9302 for (int i = 0; i < _cooldowns.Count; i++)
9303 {
9304 if (_cooldowns[i] / 1000 == idEle)
9305 {
9306 if (turns == 0)
9307 {
9308 _cooldowns.RemoveAt(i);
9309 }
9310 else
9311 {
9312 _cooldowns[i] = idEle * 1000 + turns;
9313 }
9314 flag = true;
9315 break;
9316 }
9317 }
9318 if (!flag && turns > 0)
9319 {
9320 AddCooldown(idEle, turns);
9321 }
9322 if (_cooldowns.Count == 0)
9323 {
9324 _cooldowns = null;
9325 }
9326 }

Referenced by ConTransmuteBat.OnRemoved().

◆ SetDir()

override void Chara.SetDir ( int  d)
inlinevirtual

Reimplemented from Card.

Definition at line 3789 of file Chara.cs.

3790 {
3791 base.dir = d;
3792 UpdateAngle();
3794 }

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

◆ SetDirtySpeed()

void Chara.SetDirtySpeed ( )
inline

Definition at line 2071 of file Chara.cs.

2072 {
2073 dirtySpeed = true;
2074 if (host != null)
2075 {
2077 }
2078 }

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

6719 {
6720 enemy = c;
6721 if (c == null)
6722 {
6723 if (ai is GoalCombat)
6724 {
6725 ai.Cancel();
6726 }
6727 }
6728 else
6729 {
6730 calmCheckTurn = 10 + EClass.rnd(30);
6731 }
6732 return c;
6733 }

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

5392 {
5394 Rarity rarity = Rarity.Normal;
5395 int num = ((base.LV >= 1000) ? 7 : ((base.LV >= 500) ? 5 : ((base.LV >= 250) ? 3 : ((base.LV >= 100) ? 2 : ((base.LV >= 50) ? 1 : 0)))));
5396 Rarity rarity2 = base.rarity;
5397 if (id == "big_sister")
5398 {
5399 num = (isOnCreate ? 8 : 4);
5400 }
5401 if (!isOnCreate && EClass.rnd(10) != 0)
5402 {
5403 num /= 2;
5404 }
5405 if (rarity2 == Rarity.Superior && EClass.rnd(10) <= num)
5406 {
5407 rarity = Rarity.Superior;
5408 }
5409 else if (rarity2 == Rarity.Legendary)
5410 {
5411 rarity = ((EClass.rnd(10) <= num) ? Rarity.Legendary : ((EClass.rnd(5) <= num) ? Rarity.Superior : Rarity.Normal));
5412 }
5413 else if (rarity2 >= Rarity.Mythical)
5414 {
5415 rarity = ((EClass.rnd(30) <= num) ? Rarity.Mythical : ((EClass.rnd(10) > num) ? Rarity.Superior : Rarity.Legendary));
5416 }
5417 if (rarity == Rarity.Normal && EClass.rnd(1000) == 0)
5418 {
5419 rarity = Rarity.Legendary;
5420 }
5421 CardBlueprint.current.rarity = rarity;
5422 }
static void Set(CardBlueprint _bp=null)
static CardBlueprint CharaGenEQ
static bool isOnCreate
Definition: Chara.cs:190

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

◆ SetFaction()

Chara Chara.SetFaction ( Faction  f)
inline

Definition at line 1492 of file Chara.cs.

1493 {
1494 _faction = null;
1495 faction = f;
1497 return this;
1498 }
Faction _faction
Definition: Chara.cs:162
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 1791 of file Chara.cs.

1792 {
1793 faith = r;
1795 }

References faith, and RefreshFaithElement().

◆ SetFaith() [2/2]

void Chara.SetFaith ( string  id)
inline

Definition at line 1786 of file Chara.cs.

1787 {
1789 }
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 10560 of file Chara.cs.

10561 {
10562 Feat feat = elements.GetElement(id) as Feat;
10563 int num = 0;
10564 if (feat != null && feat.ValueWithoutLink > 0)
10565 {
10566 if (value == feat.ValueWithoutLink)
10567 {
10568 return;
10569 }
10570 num = feat.ValueWithoutLink;
10571 feat.Apply(-feat.ValueWithoutLink, elements);
10572 }
10573 feat = elements.SetBase(id, value - (feat?.vSource ?? 0)) as Feat;
10574 if (feat != null && feat.ValueWithoutLink != 0)
10575 {
10576 feat.Apply(feat.ValueWithoutLink, elements);
10577 }
10579 {
10580 Refresh();
10582 }
10583 if (!msg)
10584 {
10585 return;
10586 }
10587 if (feat != null)
10588 {
10589 if (feat.source.textInc.IsEmpty())
10590 {
10591 PlaySound("ding_skill");
10593 Say("gainFeat", this, feat.FullName);
10594 }
10595 else
10596 {
10597 bool flag = value < num;
10598 if (feat.source.tag.Contains("neg"))
10599 {
10600 flag = !flag;
10601 }
10602 switch (id)
10603 {
10604 case 1270:
10605 if (!flag)
10606 {
10607 PlaySound("chime_angel");
10608 }
10609 break;
10610 case 1271:
10611 if (!flag)
10612 {
10613 PlaySound("chime_devil");
10614 }
10615 break;
10616 default:
10617 PlaySound("mutation");
10618 break;
10619 }
10621 Say((value > num) ? feat.source.GetText("textInc") : feat.source.GetText("textDec"), this, feat.FullName);
10622 }
10623 }
10625 }
Color Negative
Definition: MsgColors.cs:15
Color Ding
Definition: MsgColors.cs:11

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

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

1562 {
1563 if (!IsGlobal)
1564 {
1566 global = new GlobalData();
1567 base.isSubsetCard = false;
1568 enemy = null;
1569 base.c_uidMaster = 0;
1570 }
1571 return this;
1572 }

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

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

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

◆ SetMainElement() [1/2]

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

Definition at line 2311 of file Chara.cs.

2312 {
2313 if (base.c_idMainElement != 0)
2314 {
2315 SetElements(base.c_idMainElement, remove: true);
2316 base.c_idMainElement = 0;
2317 }
2318 if (id != 0)
2319 {
2320 _ = EClass.sources.elements.map[id];
2321 SetElements(id, remove: false);
2322 base.c_idMainElement = id;
2323 if (elemental)
2324 {
2325 base.isElemental = true;
2326 _colorInt = 0;
2327 Color colorSprite = EClass.setting.elements[MainElement.source.alias].colorSprite;
2328 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);
2329 }
2330 _ability = null;
2331 }
2332 void SetElements(int idEle, bool remove)
2333 {
2334 elements.SetBase(idEle, (!remove) ? ((v == 0) ? 10 : v) : 0);
2335 elements.ModBase(EClass.sources.elements.alias[EClass.sources.elements.map[idEle].aliasRef].id, remove ? (-20) : 20);
2336 switch (idEle)
2337 {
2338 case 910:
2339 elements.ModBase(951, remove ? 10 : (-10));
2340 break;
2341 case 911:
2342 elements.ModBase(950, remove ? 10 : (-10));
2343 break;
2344 case 912:
2345 elements.ModBase(953, remove ? 10 : (-10));
2346 break;
2347 case 913:
2348 elements.ModBase(952, remove ? 10 : (-10));
2349 break;
2350 case 916:
2351 elements.ModBase(960, remove ? 10 : (-10));
2352 break;
2353 case 919:
2354 elements.ModBase(956, remove ? 10 : (-10));
2355 break;
2356 case 925:
2357 elements.ModBase(962, remove ? 10 : (-10));
2358 break;
2359 case 922:
2360 elements.ModBase(965, remove ? 10 : (-10));
2361 break;
2362 case 921:
2363 elements.ModBase(971, remove ? 10 : (-10));
2364 break;
2365 case 926:
2366 elements.ModBase(961, remove ? 10 : (-10));
2367 break;
2368 case 914:
2369 case 915:
2370 case 917:
2371 case 918:
2372 case 920:
2373 case 923:
2374 case 924:
2375 break;
2376 }
2377 }
2378 }
int _colorInt
Definition: Card.cs:70
CharaAbility _ability
Definition: Chara.cs:98
UD_String_ElementRef elements
Definition: GameSetting.cs:362

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

2303 {
2304 if (!id.StartsWith("ele"))
2305 {
2306 id = "ele" + id;
2307 }
2308 SetMainElement(EClass.sources.elements.alias[id].id, v, elemental);
2309 }

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

10628 {
10629 SourceElement.Row row = EClass.sources.elements.map[idEle];
10631 Element element = elements.GetElement(idEle);
10632 Element element2 = elements.GetElement(row2.id);
10633 int num = element?.Value ?? 0;
10634 if (a < 0)
10635 {
10636 a = 0;
10637 }
10638 if (a > row.max)
10639 {
10640 a = row.max;
10641 }
10642 bool flag = (row.tag.Contains("neg") ? (a > num) : (a < num));
10643 if (a == 0 && (element == null || element.Value == 0))
10644 {
10646 return;
10647 }
10648 if (element != null && element.Value == a)
10649 {
10651 return;
10652 }
10653 if (element2 != null && element2.Value > 0)
10654 {
10655 SetFeat(element2.id, 0);
10656 }
10657 SetFeat(idEle, a);
10658 PlaySound("mutation");
10659 PlayEffect("mutation");
10661 Say(row.GetText(flag ? "textDec" : "textInc", returnNull: true) ?? row.alias, this);
10662 }

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

9492 {
9493 return SetAI(_NoGoalPC);
9494 }
static NoGoal _NoGoalPC
Definition: Chara.cs:202

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

◆ SetPCCState()

void Chara.SetPCCState ( PCCState  state)
inline

Definition at line 7111 of file Chara.cs.

7112 {
7113 if (IsPCC)
7114 {
7115 PCC.Get(pccData).Build(state);
7116 }
7117 }

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

7179 {
7180 p.mat = base.material;
7181 p.matColor = base.colorInt;
7182 if (!renderer.usePass)
7183 {
7184 return;
7185 }
7186 if (renderer.replacer != null)
7187 {
7188 p.tile = renderer.replacer.tile * ((!flipX) ? 1 : (-1));
7189 if (renderer.replacer.mat != -1)
7190 {
7191 p.mat = EClass.sources.materials.rows.TryGet(renderer.replacer.mat, 0);
7192 p.matColor = BaseTileMap.GetColorInt(ref p.mat.matColor, 100);
7193 p.color -= 1048576f;
7194 }
7195 }
7196 else if (source._tiles_snow.Length != 0 && EClass._zone.IsSnowCovered)
7197 {
7198 if (source._tiles_snow.Length > 1)
7199 {
7200 int num = ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % source._tiles_snow.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
7201 if (num < 0)
7202 {
7203 num = 0;
7204 }
7205 p.tile = source._tiles_snow[(num < source._tiles_snow.Length) ? num : 0] * ((!flipX) ? 1 : (-1));
7206 }
7207 else
7208 {
7209 p.tile = source._tiles_snow[0] * ((!flipX) ? 1 : (-1));
7210 }
7211 }
7212 else if (sourceCard._tiles.Length > 1)
7213 {
7214 int num2 = ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % sourceCard._tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
7215 if (num2 < 0)
7216 {
7217 num2 = 0;
7218 }
7219 p.tile = sourceCard._tiles[(num2 >= 0 && num2 < sourceCard._tiles.Length) ? num2 : 0] * ((!flipX) ? 1 : (-1));
7220 }
7221 else
7222 {
7223 p.tile = sourceCard._tiles[0] * ((!flipX) ? 1 : (-1));
7224 }
7225 p.dir = base.dir;
7226 }
static int GetColorInt(ref Color matColor, int p)
override bool flipX
Definition: Chara.cs:555
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 7774 of file Chara.cs.

7775 {
7776 switch (m)
7777 {
7778 case UIList.SortMode.ByJob:
7779 sortVal = job._index * 10000 + sourceCard._index;
7780 break;
7781 case UIList.SortMode.ByRace:
7782 sortVal = race._index * 10000 * ((!IsHuman) ? 1 : (-1)) + sourceCard._index;
7783 break;
7784 case UIList.SortMode.ByFeat:
7785 sortVal = -GetTotalFeat();
7786 break;
7787 case UIList.SortMode.ByPartyOrder:
7788 sortVal = EClass.pc.party.members.IndexOf(this);
7789 return;
7790 default:
7791 sortVal = sourceCard._index * ((!IsHuman) ? 1 : (-1));
7792 break;
7793 case UIList.SortMode.ByWorkk:
7794 break;
7795 }
7796 if (base.isFav)
7797 {
7798 sortVal -= 100000000;
7799 }
7800 }
int sortVal
Definition: Card.cs:104
int GetTotalFeat()
Definition: Chara.cs:8662
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 2290 of file Chara.cs.

2291 {
2292 source = EClass.sources.charas.map.TryGetValue(id);
2293 if (source == null)
2294 {
2295 Debug.LogWarning("Chara " + id + " not found");
2296 id = "chicken";
2297 source = EClass.sources.charas.map[id];
2298 }
2299 path.walker = this;
2300 }

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

Referenced by Refresh().

◆ SetSummon()

void Chara.SetSummon ( int  duration,
bool  dropCorpse = false 
)
inline

Definition at line 2643 of file Chara.cs.

2644 {
2645 base.c_summonDuration = duration;
2646 base.isSummon = true;
2647 if (dropCorpse)
2648 {
2649 SetBool(136, enable: true);
2650 }
2651 }

References Card.SetBool().

Referenced by TraitStrangePainting.OnDie(), TraitStrangeStatue.OnDie(), ActEffect.ProcAt(), and QuestEscort.ReleaseEscort().

◆ SetTempHand()

void Chara.SetTempHand ( int  right = 0,
int  left = 0 
)
inline

Definition at line 7153 of file Chara.cs.

7154 {
7155 if (IsPC && !IsPC)
7156 {
7157 pccData.tempRight = EClass.scene.screenElin.renderTempEQ.ConvertTile(right);
7158 pccData.tempLeft = EClass.scene.screenElin.renderTempEQ.ConvertTile(left);
7159 }
7160 }
RenderData renderTempEQ
Definition: GameScreen.cs:7
int ConvertTile(int tile)
Definition: RenderData.cs:111
GameScreen screenElin
Definition: Scene.cs:93

References RenderData.ConvertTile(), left, GameScreen.renderTempEQ, right, EClass.scene, and Scene.screenElin.

Referenced by CharaBody.Equip(), AI_Water.OnProgress(), TaskCut.OnProgress(), AI_Idle.OnStart(), AI_Bladder.Run(), AI_Fuck.Run(), AI_UseCrafter.Run(), and AIAct.Start().

◆ ShouldEquip()

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

Definition at line 8120 of file Chara.cs.

8121 {
8122 if (t.IsRangedWeapon && t.category.slot == 0)
8123 {
8124 if (!CanEquipRanged(t))
8125 {
8126 return false;
8127 }
8128 int num = 0;
8129 foreach (Thing thing in things)
8130 {
8131 if (thing.IsRangedWeapon)
8132 {
8133 if (thing.category.slot != 0 && thing.isEquipped)
8134 {
8135 return false;
8136 }
8137 if (CanEquipRanged(thing) && thing.GetEquipValue() > num)
8138 {
8139 num = thing.GetEquipValue();
8140 }
8141 }
8142 }
8143 if (t.GetEquipValue() > num)
8144 {
8145 return true;
8146 }
8147 return false;
8148 }
8149 BodySlot bodySlot = body.GetSlot(t);
8150 if (bodySlot == null)
8151 {
8152 return false;
8153 }
8154 if (useFav)
8155 {
8156 switch (GetFavAttackStyle())
8157 {
8158 case AttackStyle.Default:
8159 case AttackStyle.TwoHand:
8160 if (t.IsMeleeWeapon)
8161 {
8162 bodySlot = body.slotMainHand;
8163 }
8164 else if (bodySlot.elementId == 35)
8165 {
8166 return false;
8167 }
8168 break;
8169 case AttackStyle.Shield:
8170 if (t.IsMeleeWeapon)
8171 {
8172 bodySlot = body.slotMainHand;
8173 }
8174 else if (bodySlot.elementId == 35 && t.IsMeleeWeapon)
8175 {
8176 return false;
8177 }
8178 break;
8179 case AttackStyle.TwoWield:
8180 if (bodySlot.elementId == 35 && !t.IsMeleeWeapon)
8181 {
8182 return false;
8183 }
8184 break;
8185 }
8186 }
8187 if (!body.IsEquippable(t, bodySlot, text: false))
8188 {
8189 return false;
8190 }
8191 if (bodySlot.thing != null && (bodySlot.thing.blessedState <= BlessedState.Cursed || bodySlot.thing.GetEquipValue() >= t.GetEquipValue()))
8192 {
8193 return false;
8194 }
8195 if (!base.IsPCFactionOrMinion)
8196 {
8197 int num2 = 0;
8198 foreach (Element value in t.elements.dict.Values)
8199 {
8200 if (value.Value <= 0)
8201 {
8202 int num3 = 100;
8203 switch (value.id)
8204 {
8205 case 418:
8206 num3 = 10;
8207 break;
8208 case 60:
8209 case 61:
8210 case 62:
8211 num3 = 200;
8212 break;
8213 case 962:
8214 num3 = 10000;
8215 break;
8216 }
8217 num2 += value.Value * num3 / 100;
8218 }
8219 }
8220 if (num2 < -40)
8221 {
8222 return false;
8223 }
8224 }
8225 if (t.HasTag(CTAG.gift) && t.c_uidAttune != base.uid)
8226 {
8227 return false;
8228 }
8229 return true;
8230 }
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:4957

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

9035 {
9036 if (IsPCFaction)
9037 {
9038 if (t.IsFood && t.category.id != "fish" && !t.IsDecayed)
9039 {
9040 return false;
9041 }
9042 if (t.trait.GetHealAction(this) != null)
9043 {
9044 return false;
9045 }
9046 if (t.IsThrownWeapon || t.IsRangedWeapon || t.IsAmmo)
9047 {
9048 return false;
9049 }
9050 if (t.trait is TraitBlanket || t.trait is TraitItemProc || t.trait is TraitBookSkill)
9051 {
9052 return false;
9053 }
9054 }
9055 if (t.isEquipped || t.rarity >= Rarity.Legendary || !t.trait.CanBeDestroyed || t.c_isImportant)
9056 {
9057 return false;
9058 }
9059 if (t.trait is TraitCurrency || t.trait is TraitTool)
9060 {
9061 return false;
9062 }
9063 switch (type)
9064 {
9065 case ClearInventoryType.SellAtTown:
9066 if (!t.isGifted && !t.isNPCProperty)
9067 {
9068 return false;
9069 }
9070 break;
9071 case ClearInventoryType.Purge:
9072 switch (t.category.id)
9073 {
9074 case "fish":
9075 if (EClass.rnd(3) == 0)
9076 {
9077 return true;
9078 }
9079 break;
9080 case "junk":
9081 case "garbage":
9082 if (EClass.rnd(3) != 0)
9083 {
9084 return true;
9085 }
9086 break;
9087 }
9088 if (t.id == "flyer")
9089 {
9090 return true;
9091 }
9092 if (!t.IsDecayed && EClass.rnd(3) == 0)
9093 {
9094 return false;
9095 }
9096 if (!things.IsFull() && t.IsRangedWeapon)
9097 {
9098 return false;
9099 }
9100 break;
9101 }
9102 return true;
9103 }
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:639

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

7516 {
7517 Zone_Nymelle zone_Nymelle = EClass._zone as Zone_Nymelle;
7518 if (conSuspend != null && IsPCParty)
7519 {
7520 RemoveCondition<ConSuspend>();
7521 }
7522 if (LayerDrama.forceJump == null)
7523 {
7524 if (IsDeadOrSleeping)
7525 {
7526 ShowDialog("_chara", "sleep");
7527 return;
7528 }
7529 if (EClass.pc.isHidden && !CanSee(EClass.pc))
7530 {
7531 ShowDialog("_chara", "invisible");
7532 return;
7533 }
7535 {
7537 ShowDialog("_chara", "give_card");
7538 Thing thing = ThingGen.Create("figure");
7539 thing.MakeFigureFrom(id);
7540 EClass.player.DropReward(thing);
7541 thing = ThingGen.Create("figure3");
7542 thing.MakeFigureFrom(id);
7543 EClass.player.DropReward(thing);
7544 return;
7545 }
7546 if (GetInt(71) == -2)
7547 {
7548 ShowDialog("_chara", "give_lunch");
7549 Thing t = CraftUtil.MakeLoveLunch(this);
7551 SetInt(71, EClass.world.date.GetRaw() + 43200);
7552 return;
7553 }
7554 if (base.isRestrained)
7555 {
7556 ShowDialog("_chara", "strain");
7557 return;
7558 }
7559 if (IsEscorted())
7560 {
7561 ShowDialog("_chara", "escort");
7562 return;
7563 }
7565 {
7566 string step = ((!(EClass._zone is Zone_Wedding)) ? "party" : (IsPCParty ? "wedding_love" : ((IsMarried || affinity.IsWeddingHater) ? "wedding_hater" : "wedding")));
7567 if (EClass._zone is Zone_Wedding && IsPCParty && base.c_love != null && !base.c_love.gaveCutter)
7568 {
7569 step = "wedding_cutter";
7570 EClass.player.DropReward(ThingGen.Create("dagger_cakecutter"));
7571 base.c_love.gaveCutter = true;
7572 }
7573 ShowDialog("_chara", step);
7574 return;
7575 }
7576 if (EClass.game.quests.OnShowDialog(this))
7577 {
7578 return;
7579 }
7580 if (id == "nino")
7581 {
7583 }
7584 switch (id)
7585 {
7586 case "loytel":
7587 {
7589 {
7590 EClass.game.quests.Get("pre_debt_runaway").Complete();
7591 EClass.player.flags.loytelEscaped = false;
7592 EClass.game.quests.Add("debt", "loytel");
7593 ShowDialog("loytel", "loytelEscaped");
7594 return;
7595 }
7596 QuestDebt questDebt = EClass.game.quests.Get<QuestDebt>();
7597 if (questDebt != null && questDebt.paid)
7598 {
7599 questDebt.stage++;
7600 if (questDebt.stage > 7)
7601 {
7602 questDebt.stage = 7;
7603 }
7604 ShowDialog("loytel", "debt" + questDebt.stage);
7605 return;
7606 }
7607 break;
7608 }
7609 case "farris":
7610 if (EClass._zone.id == "startVillage" || EClass._zone.id == "startVillage3" || EClass.game.IsSurvival)
7611 {
7612 ShowDialog("farris");
7613 return;
7614 }
7616 {
7617 case -1:
7618 ShowDialog("farris", "nymelle_noQuest");
7619 break;
7620 case 0:
7621 ShowDialog("farris", "nymelle_first");
7622 break;
7623 case 1:
7624 ShowDialog("farris", "home_first");
7625 break;
7626 default:
7627 ShowDialog("farris");
7628 break;
7629 }
7630 return;
7631 case "ashland":
7632 ShowDialog("ashland");
7633 return;
7634 case "fiama":
7635 if (zone_Nymelle != null && zone_Nymelle.IsCrystalLv && EClass.game.quests.GetPhase<QuestExploration>() == 3)
7636 {
7637 SoundManager.ForceBGM();
7638 LayerDrama.ActivateMain("mono", "nymelle_crystal");
7639 }
7641 {
7643 {
7644 EClass.player.flags.fiamaFirstDream = true;
7645 ShowDialog("fiama", "firstDream");
7646 }
7648 {
7649 ShowDialog("fiama", "giveStoryBook").SetOnKill(delegate
7650 {
7651 EClass.player.flags.fiamaStoryBookGiven = true;
7652 EClass.player.DropReward(ThingGen.Create("book_story"));
7653 });
7654 }
7655 else
7656 {
7657 ShowDialog("fiama");
7658 }
7659 }
7660 else
7661 {
7662 ShowDialog("fiama");
7663 }
7664 return;
7665 case "big_sister":
7667 {
7668 ShowDialog("big_sister", "little_saved");
7669 EClass.player.flags.little_saved = false;
7670 return;
7671 }
7673 {
7674 ShowDialog("big_sister", "little_dead");
7675 EClass.player.flags.little_killed = false;
7676 return;
7677 }
7678 break;
7679 }
7680 if (trait is TraitGuildDoorman)
7681 {
7682 string tag = ((trait is TraitDoorman_Fighter) ? "fighter" : ((trait is TraitDoorman_Mage) ? "mage" : "thief"));
7683 ShowDialog("guild_doorman", "main", tag);
7684 return;
7685 }
7686 if (trait is TraitGuildClerk)
7687 {
7688 string tag2 = ((trait is TraitClerk_Fighter) ? "fighter" : ((trait is TraitClerk_Mage) ? "mage" : "thief"));
7689 ShowDialog("guild_clerk", "main", tag2);
7690 return;
7691 }
7692 }
7693 bool flag = true;
7694 if (id == "parttimer_jure" && (!EClass._zone.IsFestival || !(EClass._zone is Zone_Noyel) || EClass.pc.faith == EClass.game.religions.Healing))
7695 {
7696 flag = false;
7697 }
7698 string book = "_chara";
7699 if (flag)
7700 {
7701 string text = GetStr("drama_override").IsEmpty(id);
7702 if (File.Exists(PackageIterator.GetFiles("Dialog/Drama/" + text + ".xlsx").LastOrDefault()?.FullName ?? (CorePath.DramaData + id + ".xlsx")))
7703 {
7704 book = text;
7705 }
7706 }
7708 }
bool CanGiveCard()
Definition: Affinity.cs:70
bool IsWeddingHater
Definition: Affinity.cs:36
void MakeFigureFrom(string id)
Definition: Card.cs:6022
void ShowDialog()
Definition: Chara.cs:7515
bool IsMarried
Definition: Chara.cs:617
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 7710 of file Chara.cs.

7711 {
7712 return _ShowDialog(book, null, step, tag);
7713 }
LayerDrama _ShowDialog(string book, string sheet, string step="main", string tag="")
Definition: Chara.cs:7715

References book.

◆ Slap()

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

Definition at line 6701 of file Chara.cs.

6702 {
6703 if (id == "olderyoungersister")
6704 {
6706 }
6707 PlaySound("whip");
6708 Say("slap", this, c);
6709 c.PlayAnime(AnimeID.Shiver);
6710 c.DamageHP(slapToDeath ? (c.MaxHP * 2) : (5 + EClass.rndHalf(EClass.pc.MaxHP / 3)), 919, 100, AttackSource.Condition);
6711 c.OnInsulted();
6712 if (slapToDeath && c.IsAliveInCurrentZone)
6713 {
6714 c.Die();
6715 }
6716 }
void PlayAnime(AnimeID id, bool force=false)
Definition: Card.cs:6664
void OnInsulted()
Definition: Chara.cs:8734
override void Die(Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None, Chara originalTarget=null)
Definition: Chara.cs:5672

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

10364 {
10365 RemoveCondition<ConAwakening>();
10366 AddCondition(Condition.Create(100, delegate(ConSleep con)
10367 {
10368 con.pcSleep = 15;
10369 con.pcBed = bed;
10370 con.pcPillow = pillow;
10371 con.pickup = pickup;
10372 con.posBed = posBed;
10373 con.posPillow = posPillow;
10374 }), force: true);
10375 }

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

8653 {
8654 Say("abCatSniff", this, c);
8655 AddCondition<ConHOT>(EClass.curve(50 + c.CHA * 5, 400, 100));
8656 c.ShowEmo(Emo.angry);
8657 ShowEmo(Emo.love);
8658 Talk("sniff");
8659 c.Talk(new string[4] { "labor", "disgust", "scold", "callGuards" }.RandomItem());
8660 }

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

4893 {
4894 return held.Split(a);
4895 }

References Card.Split().

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

◆ Stumble()

void Chara.Stumble ( int  mtp = 100)
inline

Definition at line 2054 of file Chara.cs.

2055 {
2056 bool flag = EClass._map.FindThing((Thing t) => t.IsInstalled && t.pos.Equals(EClass.pc.pos) && t.trait is TraitStairsUp) != null;
2057 Say(flag ? "dmgBurdenStairs" : "dmgBurdenFallDown", this);
2058 long num = MaxHP;
2059 if (Evalue(1421) > 0)
2060 {
2061 num = mana.max;
2062 }
2063 long num2 = (num * (base.ChildrenWeight * 100 / WeightLimit) / (flag ? 100 : 200) + 1) * mtp / 100;
2064 if (base.hp <= 0)
2065 {
2066 num2 *= 2;
2067 }
2068 DamageHP(num2, flag ? AttackSource.BurdenStairs : AttackSource.BurdenFallDown);
2069 }
Thing FindThing(Func< Thing, bool > func)
Definition: Map.cs:2792

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

4229 {
4230 if (host != null)
4231 {
4232 host.SyncRide();
4233 }
4234 if (ride != null)
4235 {
4236 SyncRide(ride);
4237 }
4238 if (parasite != null)
4239 {
4241 }
4242 }

References ride, and SyncRide().

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

◆ SyncRide() [2/2]

void Chara.SyncRide ( Chara  c)
inline

Definition at line 4244 of file Chara.cs.

4245 {
4246 if (!c.pos.Equals(pos))
4247 {
4248 if (!pos.IsValid)
4249 {
4250 Debug.LogError("exception: pos is not valid:" + pos?.ToString() + "/" + this);
4251 pos = new Point();
4252 }
4253 EClass._map.MoveCard(pos, c);
4254 }
4255 }

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

◆ TalkTopic()

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

Definition at line 7438 of file Chara.cs.

7439 {
7440 if (host == null && !IsInActiveZone)
7441 {
7442 return null;
7443 }
7444 if (!isSynced && (host == null || !host.isSynced) && topic != "dead")
7445 {
7446 return null;
7447 }
7448 if (IsPCParty)
7449 {
7450 int num = EClass.pc.party.members.Count - 1;
7451 switch (topic)
7452 {
7453 case "calm":
7454 if (EClass.rnd(num * 5) != 0)
7455 {
7456 return null;
7457 }
7458 break;
7459 case "aggro":
7460 if (EClass.rnd(num * 10) != 0)
7461 {
7462 return null;
7463 }
7464 break;
7465 case "kill":
7466 if (EClass.rnd(num * 3) != 0)
7467 {
7468 return null;
7469 }
7470 break;
7471 case "fov":
7472 return null;
7473 }
7474 }
7475 string topicText = GetTopicText(topic);
7476 if (topicText.IsEmpty())
7477 {
7478 return null;
7479 }
7480 HashSet<string> obj = new HashSet<string>
7481 {
7482 "_bracketTalk".lang(),
7483 "\"",
7484 "“",
7485 "「"
7486 };
7487 bool flag = topicText.StartsWith("*");
7488 bool flag2 = topicText.StartsWith("(");
7489 bool flag3 = obj.Any(topicText.StartsWith);
7490 topicText = ApplyTone(topicText);
7491 topicText = topicText.Replace('~', '*');
7492 Msg.SetColor(flag2 ? Msg.colors.Thinking : (flag3 ? Msg.colors.Talk : Msg.colors.Ono));
7493 Msg.Say(StripTalkSpecialCharacters(topicText.Replace("&", "")));
7494 if (topic == "dead")
7495 {
7496 EClass.ui.popGame.PopText(ApplyNewLine(topicText.StripBrackets()), null, "PopTextDead", default(Color), pos.Position() + EClass.setting.render.tc.textPosDead);
7497 }
7498 else if (flag || flag3 || flag2)
7499 {
7500 (host ?? this).renderer.Say(ApplyNewLine(topicText.StripBrackets()), default(Color), IsPCParty ? 0.6f : 0f);
7501 }
7502 return topicText;
7503 }
void Say(string text, Color c=default(Color), float duration=0f)
string ApplyNewLine(string text)
Definition: Card.cs:7291
string StripTalkSpecialCharacters(string text)
Definition: Card.cs:7272
string ApplyTone(string text, bool stripPun=false)
Definition: Card.cs:7371
string GetTopicText(string topic="calm")
Definition: Chara.cs:7404
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 4257 of file Chara.cs.

4258 {
4259 SyncRide();
4260 combatCount--;
4261 ignoreSPAbsorb = false;
4262 if (IsPC)
4263 {
4264 if (hasMovedThisTurn)
4265 {
4266 pos.Things.ForeachReverse(delegate(Thing t)
4267 {
4269 {
4270 AI_Goto aI_Goto = ai.Current as AI_Goto;
4271 if ((aI_Goto == null && !(ai is GoalManualMove)) || (aI_Goto != null && !aI_Goto.dest.Equals(pos)))
4272 {
4273 return;
4274 }
4275 }
4276 t.trait.OnStepped(this);
4277 });
4278 if (isDead)
4279 {
4280 return;
4281 }
4282 hasMovedThisTurn = false;
4284 {
4285 EClass.player.haltMove = false;
4286 ActionMode.Adv.TryCancelInteraction(sound: false);
4287 EInput.Consume(1);
4288 return;
4289 }
4290 if (EClass._zone.IsRegion)
4291 {
4293 {
4294 foreach (Chara member in EClass.pc.party.members)
4295 {
4296 if (member.hunger.value > 65)
4297 {
4298 member.InstantEat(null, sound: false);
4299 }
4300 }
4301 }
4302 Chara chara = null;
4304 if (cell != null && (cell.zone == null || (cell.zone is Zone_Field && !cell.zone.IsPCFaction)))
4305 {
4306 foreach (Chara chara2 in EClass._map.charas)
4307 {
4308 if (!chara2.IsPCFactionOrMinion && !chara2.IsGlobal && chara2.pos.Equals(EClass.pc.pos))
4309 {
4310 chara = chara2;
4311 break;
4312 }
4313 }
4314 }
4315 if (chara != null)
4316 {
4318 {
4319 EClass.player.safeTravel = 5 + EClass.rnd(5);
4320 }
4321 EClass._zone.RemoveCard(chara);
4322 Msg.Say("encounter");
4323 EClass.player.EnterLocalZone(encounter: true, chara);
4324 }
4325 else if (EClass.player.safeTravel <= 0)
4326 {
4327 if (cell != null && cell.zone == null && !EClass.debug.ignoreEncounter)
4328 {
4330 if (!tileInfo.shore)
4331 {
4332 bool num = EClass.pc.HasCondition<ConWardMonster>();
4333 bool flag = EClass.pc.HasCondition<ConDrawMonster>();
4334 bool flag2 = EClass.game.quests.Get<QuestEscort>() != null;
4335 int num2 = (tileInfo.isRoad ? 22 : 12);
4336 if (flag2)
4337 {
4338 num2 = (tileInfo.isRoad ? 16 : 10);
4339 }
4340 if (num)
4341 {
4342 num2 *= (flag2 ? 2 : 20);
4343 }
4344 if (flag)
4345 {
4346 num2 /= 2;
4347 }
4348 if (EClass.rnd(num2) == 0)
4349 {
4350 Msg.Say("encounter");
4351 if (!flag)
4352 {
4353 EClass.player.safeTravel = 5 + EClass.rnd(5);
4354 }
4355 EClass.player.EnterLocalZone(encounter: true);
4356 }
4357 }
4358 }
4359 }
4360 else
4361 {
4363 }
4364 }
4365 }
4366 EClass.player.pickupDelay = 0f;
4367 if (EClass.player.returnInfo != null)
4368 {
4370 if (EClass.player.returnInfo.turns <= 0)
4371 {
4373 {
4374 EClass.player.returnInfo = null;
4376 }
4377 else
4378 {
4380 {
4381 int uidDest = EClass.player.returnInfo.uidDest;
4382 Zone zone = null;
4383 if (uidDest != 0)
4384 {
4385 zone = EClass.game.spatials.map.TryGetValue(uidDest) as Zone;
4386 }
4387 if (zone == null || zone.destryoed)
4388 {
4389 zone = EClass.world.region;
4390 }
4392 {
4393 Msg.Say("returnFail");
4394 }
4395 else
4396 {
4397 Msg.Say("returnComplete");
4398 EClass.player.uidLastTravelZone = 0;
4400 EClass.player.lastZonePos = null;
4401 }
4402 EClass.player.returnInfo = null;
4403 return;
4404 }
4405 EClass.player.returnInfo = null;
4406 Msg.Say("returnOverweight");
4407 }
4408 }
4409 }
4410 if ((HasNoGoal || !ai.IsRunning) && !WillConsumeTurn())
4411 {
4413 return;
4414 }
4417 {
4418 RecipeUpdater.dirty = true;
4419 }
4421 }
4422 else
4423 {
4424 actTime = EClass.player.baseActTime * Mathf.Max(0.1f, (float)EClass.pc.Speed / (float)Speed);
4425 hasMovedThisTurn = false;
4426 }
4429 {
4430 return;
4431 }
4433 if (host != null && !consumeTurn)
4434 {
4435 if (host.ride == this && ((host.hasMovedThisTurn && IsInCombat) || (enemy != null && turn % 3 != 0)))
4436 {
4437 consumeTurn = true;
4438 }
4439 if (host.parasite == this && enemy != null && EClass.rnd(10) > EClass.rnd(host.Evalue(227) + 10))
4440 {
4441 if (Dist(enemy) < 3 && EClass.rnd(2) == 0)
4442 {
4443 Say("parasite_fail", this, host);
4444 if (EClass.rnd(2) == 0 && GetInt(106) == 0)
4445 {
4446 Talk("parasite_fail");
4447 }
4448 }
4449 consumeTurn = true;
4450 }
4451 }
4452 if (consumeTurn)
4453 {
4454 if (IsPC)
4455 {
4457 }
4458 }
4459 else
4460 {
4461 if (base.isRestrained)
4462 {
4463 TryUnrestrain();
4464 }
4465 if (enemy != null)
4466 {
4468 {
4469 enemy = null;
4470 }
4471 else if (!IsPC && (ai.CancelOnAggro || !ai.IsRunning))
4472 {
4473 SetAIAggro();
4474 }
4475 }
4476 if (HasNoGoal || !ai.IsRunning)
4477 {
4478 ChooseNewGoal();
4479 }
4480 ai.Tick();
4481 }
4482 Cell cell2 = base.Cell;
4483 if (EClass._zone.IsUnderwater || (cell2.IsTopWaterAndNoSnow && !cell2.isFloating))
4484 {
4485 AddCondition<ConWet>(50);
4486 if (pos.IsHotSpring)
4487 {
4488 hygiene.Mod(2);
4489 }
4490 }
4491 if (cell2.sourceSurface.id == 20)
4492 {
4493 AddCondition<ConBurning>();
4494 }
4495 if (IsPC && !EClass._zone.IsRegion && cell2.CanSuffocate() && !EClass.debug.godMode && !HasElement(1252))
4496 {
4497 AddCondition<ConSuffocation>(800 / (100 + EvalueMax(200, -5) * 10), force: true);
4498 }
4499 CellEffect e;
4500 if (cell2.effect != null)
4501 {
4502 e = cell2.effect;
4503 switch (e.id)
4504 {
4505 case 1:
4506 case 2:
4507 case 4:
4508 if (IsLevitating)
4509 {
4510 Say("levitating");
4511 break;
4512 }
4513 AddCondition<ConWet>(50);
4514 ProcEffect();
4515 break;
4516 case 3:
4517 PlaySound("fire_step");
4518 AddCondition<ConBurning>(30);
4519 break;
4520 case 5:
4521 if (!isWet)
4522 {
4523 PlaySound("bubble");
4524 AddCondition<ConWet>(30);
4525 ProcEffect();
4526 }
4527 break;
4528 case 6:
4529 if (hasMovedThisTurn)
4530 {
4531 Say("abMistOfDarkness_step", this);
4532 }
4533 AddCondition<ConDark>(e.power);
4534 break;
4535 }
4536 }
4537 if (IsPC)
4538 {
4539 if (EClass.player.currentHotItem.Thing != null)
4540 {
4542 }
4544 }
4545 void ClearEffect()
4546 {
4547 EClass._map.SetLiquid(cell2.x, cell2.z, 0, 0);
4548 }
4549 void ProcEffect()
4550 {
4551 if (e.idEffect != EffectId.None)
4552 {
4553 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
4554 {
4555 aliasEle = EClass.sources.elements.map[e.idEle].alias,
4556 n1 = e.n1,
4557 refVal = e.refVal
4558 });
4559 ClearEffect();
4560 }
4561 }
4562 }
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:7605
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:78
byte x
Definition: Cell.cs:76
void InstantEat(Thing t=null, bool sound=true)
Definition: Chara.cs:8070
int Speed
Definition: Chara.cs:1144
static bool consumeTurn
Definition: Chara.cs:186
void SetAIAggro()
Definition: Chara.cs:9486
bool ignoreSPAbsorb
Definition: Chara.cs:150
void ChooseNewGoal()
Definition: Chara.cs:9367
bool WillConsumeTurn()
Definition: Chara.cs:3934
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:1631
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:77
int eloX
Definition: Point.cs:75
bool IsHotSpring
Definition: Point.cs:371
bool destryoed
Definition: Spatial.cs:45
virtual void OnTickHeld()
Definition: Trait.cs:1247
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 3946 of file Chara.cs.

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

9349 {
9350 for (int num = _cooldowns.Count - 1; num >= 0; num--)
9351 {
9352 if (_cooldowns[num] % 1000 == 1)
9353 {
9354 _cooldowns.RemoveAt(num);
9355 }
9356 else
9357 {
9358 _cooldowns[num]--;
9359 }
9360 }
9361 if (_cooldowns.Count == 0)
9362 {
9363 _cooldowns = null;
9364 }
9365 }

◆ TickWork()

void Chara.TickWork ( VirtualDate  date)
inline

Definition at line 9778 of file Chara.cs.

9779 {
9781 if (span != TimeTable.Span.Work && span != TimeTable.Span.Free)
9782 {
9783 return;
9784 }
9785 WorkSummary workSummary = GetWorkSummary();
9786 if (span == TimeTable.Span.Work)
9787 {
9788 if (workSummary.work != null)
9789 {
9790 PerformWork(workSummary.work, isHobby: false, date.IsRealTime);
9791 }
9792 }
9793 else if (workSummary.hobbies.Count > 0)
9794 {
9795 PerformWork(workSummary.hobbies.RandomItem(), isHobby: true, date.IsRealTime);
9796 }
9797 }
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 1233 of file Chara.cs.

1234 {
1235 return base.Name + "(" + ai?.ToString() + ")" + pos?.ToString() + "/" + base.ExistsOnMap + "/" + isDead;
1236 }
override string ToString()
Definition: Point.cs:520

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

4677 {
4678 if (!IsPC || !(t.trait is TraitRod) || t.c_charges <= 0 || !HasElement(1564))
4679 {
4680 return;
4681 }
4682 Say("absorbRod", this, t);
4683 TraitRod rod = t.trait as TraitRod;
4684 bool flag = false;
4685 if (rod.source != null)
4686 {
4687 using IEnumerator<SourceElement.Row> enumerator = EClass.sources.elements.rows.Where((SourceElement.Row a) => a.id == rod.source.id).GetEnumerator();
4688 if (enumerator.MoveNext())
4689 {
4690 SourceElement.Row current = enumerator.Current;
4691 if (IsPC)
4692 {
4693 GainAbility(current.id, t.c_charges * 100, t);
4694 flag = true;
4695 }
4696 }
4697 }
4698 if (!flag)
4699 {
4700 mana.Mod(-50 * t.c_charges);
4701 }
4702 t.c_charges = 0;
4704 }
int c_charges
Definition: Card.cs:1309
void GainAbility(int ele, int mtp=100, Thing origin=null)
Definition: Chara.cs:10763

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

7830 {
7831 if (!IsPCFaction && !IsGuest())
7832 {
7833 return null;
7834 }
7835 foreach (Card item in EClass._map.props.installed.all)
7836 {
7837 if (item.trait is TraitBed traitBed && traitBed.CanAssign(this))
7838 {
7839 traitBed.AddHolder(this);
7840 Msg.Say("claimBed", this);
7841 return traitBed;
7842 }
7843 }
7844 return null;
7845 }
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 9105 of file Chara.cs.

9106 {
9107 if (IsPC)
9108 {
9109 return;
9110 }
9111 if (IsPCParty)
9112 {
9113 if (!things.IsAlmostFull())
9114 {
9115 return;
9116 }
9117 bool flag = EClass._zone.IsTown;
9118 if (!flag && EClass._zone.IsPCFactionOrTent)
9119 {
9120 foreach (Chara chara in EClass._map.charas)
9121 {
9122 if (chara.IsPCFaction && chara.trait.ShopType != ShopType.None)
9123 {
9124 flag = true;
9125 }
9126 }
9127 }
9128 if (flag)
9129 {
9131 }
9132 }
9133 else
9134 {
9136 }
9137 }
ShopType
Definition: ShopType.cs:2
void ClearInventory(ClearInventoryType type)
Definition: Chara.cs:9139
bool IsAlmostFull(int threshold=2)
virtual ShopType ShopType
Definition: Trait.cs:534

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

6002 {
6004 {
6005 return;
6006 }
6007 int num = 0;
6008 bool flag = false;
6009 bool flag2 = false;
6010 Point point = pos.GetNearestPoint(allowBlock: true, allowChara: false, allowInstalled: false, ignoreCenter: true) ?? pos;
6011 TreasureType type = TreasureType.BossQuest;
6012 if (EClass._zone.Boss == this)
6013 {
6014 type = TreasureType.BossNefia;
6015 num = 2 + EClass.rnd(2);
6016 flag = (flag2 = true);
6017 EClass._zone.Boss = null;
6018 Msg.Say("boss_win", EClass._zone.Name);
6020 {
6021 Msg.Say("boss_win_void", EClass._zone.Name);
6022 EClass.player.flags.KilledBossInVoid = true;
6023 }
6024 if (EClass._zone.IsNefia)
6025 {
6028 SE.Play("Jingle/fanfare2");
6029 EClass._zone.SetBGM(114, refresh: true, 3f);
6030 }
6033 }
6034 switch (id)
6035 {
6036 case "azzrasizzle":
6037 num = 5;
6038 flag = (flag2 = true);
6039 EClass.Sound.StopBGM(3f);
6040 EClass._zone.SetBGM(1, refresh: false);
6042 {
6043 EClass.game.quests.Get<QuestIntoDarkness>().UpdateOnTalk();
6044 }
6045 break;
6046 case "vernis_boss":
6047 num = 5;
6048 flag = (flag2 = true);
6049 EClass.Sound.StopBGM(3f);
6050 EClass._zone.SetBGM(1, refresh: false);
6052 {
6053 EClass.game.quests.Get<QuestVernis>().UpdateOnTalk();
6054 }
6055 break;
6056 case "lurie_boss":
6057 if (!(EClass._zone is Zone_Exile))
6058 {
6059 num = 5;
6060 flag = (flag2 = true);
6061 EClass._zone.SetBGM(120, refresh: true, 3f);
6063 {
6064 EClass.game.quests.Get<QuestNegotiationDarkness>().ChangePhase(4);
6065 EClass.player.flags.killedDuponne = true;
6066 }
6067 }
6068 break;
6069 case "ungaga_pap":
6070 num = 5;
6071 flag = (flag2 = true);
6073 {
6074 EClass._zone.SetBGM(46, refresh: true, 3f);
6075 }
6076 break;
6077 case "melilith_boss":
6078 num = 5;
6079 flag = (flag2 = true);
6080 EClass.Sound.StopBGM(3f);
6081 EClass._zone.SetBGM(1, refresh: false);
6082 break;
6083 case "doga":
6084 {
6085 QuestCurry questCurry = EClass.game.quests.Get<QuestCurry>();
6086 if (questCurry != null)
6087 {
6088 num = 5;
6089 flag = (flag2 = true);
6090 EClass.Sound.StopBGM(3f);
6091 EClass._zone.SetBGM(1, refresh: false);
6092 questCurry.NextPhase();
6093 }
6094 break;
6095 }
6096 case "fairy_raina":
6097 case "fairy_poina":
6098 {
6099 bool num2 = EClass._map.FindChara((id == "fairy_raina") ? "fairy_poina" : "fairy_raina") == null;
6100 QuestNasu questNasu = EClass.game.quests.Get<QuestNasu>();
6101 if (num2 && questNasu != null && questNasu.phase <= 1)
6102 {
6103 if (questNasu.phase == 0)
6104 {
6105 questNasu.NextPhase();
6106 }
6107 num = 5;
6108 flag = (flag2 = true);
6109 EClass.Sound.StopBGM(3f);
6110 EClass._zone.SetBGM(1, refresh: false);
6111 EClass.player.DropReward(ThingGen.Create("backpack_holding"));
6112 questNasu.NextPhase();
6113 }
6114 break;
6115 }
6116 case "isygarad":
6117 {
6118 num = 5;
6119 flag = (flag2 = true);
6120 QuestExploration questExploration = EClass.game.quests.Get<QuestExploration>();
6121 if (questExploration != null)
6122 {
6123 SE.Play("kill_boss");
6124 questExploration.ChangePhase(3);
6125 EClass.Sound.StopBGM(3f);
6126 EClass._zone.SetBGM(1, refresh: false);
6127 }
6128 break;
6129 }
6130 case "swordkeeper":
6131 num = 10;
6132 flag = true;
6133 SE.Play("kill_boss");
6134 SoundManager.ForceBGM();
6135 LayerDrama.Activate("_event", "event", "swordkeeper_defeat");
6136 break;
6137 }
6138 if (flag)
6139 {
6140 SE.Play("kill_boss");
6141 }
6142 if (num != 0)
6143 {
6145 {
6146 EClass.player.stats.deepest = EClass._zone.DangerLv;
6147 Msg.Say("update_deepest", EClass.player.stats.deepest.ToString() ?? "");
6148 }
6150 {
6151 EClass.player.stats.deepestVoid = -EClass._zone.lv;
6152 Msg.Say("update_deepest_void", EClass.player.stats.deepestVoid.ToString() ?? "");
6153 }
6154 EClass.player.willAutoSave = true;
6155 Thing thing = ThingGen.CreateTreasure("chest_boss", base.LV, type);
6156 point.SetBlock();
6157 point.SetObj();
6158 EClass._zone.AddCard(thing, point).Install();
6159 ThingGen.TryLickChest(thing);
6160 }
6161 if (flag2)
6162 {
6164 }
6165 }
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:930
void SetBlock(int idMat=0, int idBlock=0)
Definition: Point.cs:920
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:3262
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 4897 of file Chara.cs.

4898 {
4899 if (held != null && held.trait.CanOnlyCarry)
4900 {
4901 DropHeld();
4902 }
4903 foreach (Thing item in things.List((Thing t) => t.trait.CanOnlyCarry))
4904 {
4905 DropThing(item);
4906 }
4907 }
void DropThing(Thing t, int num=-1)
Definition: Chara.cs:4929

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

1965 {
1966 if (dest == null)
1967 {
1968 dest = pos;
1969 }
1970 dest = dest.GetRandomPoint(2, requireLos: false, allowChara: false, allowBlocked: false, 200);
1971 if (dest == null || dest.Equals(pos) || !dest.IsValid || !CanDuplicate(con))
1972 {
1973 Say("split_fail", this);
1974 return null;
1975 }
1976 Chara chara = Duplicate();
1977 EClass._zone.AddCard(chara, dest);
1978 if (inheritHostility)
1979 {
1980 chara.SetHostility(hostility);
1981 }
1982 Say("split", this);
1983 return chara;
1984 }
bool CanDuplicate(DuplicateCondition con=DuplicateCondition.Default)
Definition: Chara.cs:1928
Chara Duplicate()
Definition: Chara.cs:1986
Chara SetHostility(Hostility h)
Definition: Chara.cs:1507
Point GetRandomPoint(int radius, bool requireLos=true, bool allowChara=true, bool allowBlocked=false, int tries=100)
Definition: Point.cs:770

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

8233 {
8234 if (!ShouldEquip(t, useFav))
8235 {
8236 return false;
8237 }
8238 if (t.category.slot == 0)
8239 {
8240 return false;
8241 }
8242 if (useFav)
8243 {
8244 BodySlot slot = body.GetSlot(t);
8245 switch (GetFavAttackStyle())
8246 {
8247 case AttackStyle.Default:
8248 case AttackStyle.TwoHand:
8249 if (t.IsMeleeWeapon)
8250 {
8251 slot = body.slotMainHand;
8252 }
8253 break;
8254 case AttackStyle.Shield:
8255 if (t.IsMeleeWeapon)
8256 {
8257 slot = body.slotMainHand;
8258 }
8259 break;
8260 }
8261 body.Equip(t, slot);
8262 }
8263 else
8264 {
8265 body.Equip(t);
8266 }
8267 Say("equip", this, t);
8268 return true;
8269 }
bool ShouldEquip(Thing t, bool useFav=false)
Definition: Chara.cs:8120

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

8358 {
8359 if (id == "mamani")
8360 {
8362 }
8363 if (IsPC)
8364 {
8366 if (thing?.trait is TraitToolRange && CanEquipRanged(thing))
8367 {
8368 ranged = thing;
8369 return true;
8370 }
8371 return false;
8372 }
8373 if (ranged != null && ranged.parent == this)
8374 {
8375 return true;
8376 }
8378 return ranged != null;
8379 }
Thing GetBestRangedWeapon()
Definition: Chara.cs:8337
Thing GetRandomRangedWeapon()
Definition: Chara.cs:8352

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

1841 {
1842 if (chance < EClass.rndf(1f))
1843 {
1844 return false;
1845 }
1846 List<Chara> list = ListFussableCharas(3);
1847 if (list.Count < 7)
1848 {
1849 return false;
1850 }
1851 Say("fuse", this);
1852 string text = "marshmallow_king";
1853 string text2 = "fusion";
1854 switch (id)
1855 {
1856 case "imotoroid":
1857 text = "imotomaton";
1858 text2 = "fusion2";
1859 break;
1860 case "shojo":
1861 text = "shojomaton";
1862 text2 = "fusion2";
1863 break;
1864 case "sister_cat":
1865 text = "sister_catmaton";
1866 text2 = "fusion2";
1867 break;
1868 case "younglady":
1869 text = "youngladymaton";
1870 text2 = "fusion2";
1871 break;
1872 }
1873 Chara chara = EClass._zone.SpawnMob(text, pos);
1874 chara.SetHostility(hostility);
1875 list.Shuffle();
1876 int num = 0;
1877 foreach (Chara item in list)
1878 {
1879 if (!text2.IsEmpty())
1880 {
1881 item.Talk(text2);
1882 }
1883 Effect.Get<EffectIRenderer>("throw_fuse").Play(item, item, item.pos, pos);
1884 item.Destroy();
1885 num++;
1886 if (num >= 7)
1887 {
1888 break;
1889 }
1890 }
1891 Destroy();
1892 chara.PlayAnime(AnimeID.FallSky);
1893 chara.pos.PlaySound("fuse");
1894 chara.pos.PlayEffect("vanish");
1895 return true;
1896 }
List< Chara > ListFussableCharas(int radius=2)
Definition: Chara.cs:1923
Chara SpawnMob(string id, Point pos=null)
Definition: Zone.cs:2988

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

8277 {
8278 Thing dest = null;
8279 if (IsPC)
8280 {
8282 {
8283 return FindThrowable(hotbar: true);
8284 }
8285 return null;
8286 }
8287 things.Foreach(delegate(Thing t)
8288 {
8289 if (t.HasTag(CTAG.throwWeapon) || (!base.IsPCFactionOrMinion && t.HasTag(CTAG.throwWeaponEnemy)))
8290 {
8291 dest = t;
8292 }
8293 });
8294 return dest;
8295 Thing FindThrowable(bool hotbar)
8296 {
8297 things.Foreach(delegate(Thing t)
8298 {
8299 if (dest == null)
8300 {
8301 if (t.IsHotItem)
8302 {
8303 if (!hotbar)
8304 {
8305 return;
8306 }
8307 }
8308 else if (hotbar)
8309 {
8310 return;
8311 }
8312 if (t.HasTag(CTAG.throwWeapon))
8313 {
8314 dest = t;
8315 }
8316 }
8317 });
8318 return dest;
8319 }
8320 }

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

4755 {
4756 if (held == t)
4757 {
4758 return true;
4759 }
4760 if (t.isDestroyed || t.Num <= 0)
4761 {
4762 return false;
4763 }
4764 if (!CanPick(t))
4765 {
4766 if (t.parent == null)
4767 {
4768 EClass._zone.AddCard(t, pos);
4769 }
4770 return false;
4771 }
4772 HoldCard(t, num);
4773 return true;
4774 }
bool CanPick(Card c)
Definition: Chara.cs:4574
void HoldCard(Card t, int num=-1)
Definition: Chara.cs:4776

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

8508 {
8509 int num = Evalue(289);
8510 if (num == 0)
8511 {
8512 return false;
8513 }
8514 int lV = t.LV;
8515 if (EClass.rnd(num * num + 5) > EClass.rnd(lV * lV) * 20)
8516 {
8517 t.Identify(show, (num >= 20) ? IDTSource.SkillHigh : IDTSource.Skill);
8518 int num2 = 50;
8519 if (lV > num)
8520 {
8521 num2 += (lV - num) * 10;
8522 }
8523 elements.ModExp(289, Mathf.Min(num2, 1000));
8524 return true;
8525 }
8526 return false;
8527 }
IDTSource
Definition: IDTSource.cs:2
Thing Identify(bool show=true, IDTSource idtSource=IDTSource.Identify)
Definition: Thing.cs:2159

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

2947 {
2948 foreach (Condition condition in conditions)
2949 {
2950 if (!condition.TryMove(newPoint))
2951 {
2952 return MoveResult.Fail;
2953 }
2954 }
2955 if (base.isRestrained)
2956 {
2957 if (!IsPC)
2958 {
2959 return MoveResult.Fail;
2960 }
2961 base.isRestrained = false;
2962 }
2963 if (!CanMoveTo(newPoint, allowDestroyPath))
2964 {
2965 return MoveResult.Fail;
2966 }
2967 return _Move(newPoint);
2968 }
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 2884 of file Chara.cs.

2885 {
2886 if (p.Equals(pos))
2887 {
2888 return MoveResult.Success;
2889 }
2891 {
2892 return MoveResult.Fail;
2893 }
2894 bool flag = true;
2895 Point point = null;
2896 _sharedPos.Set(p);
2897 if (CanDestroyPath())
2898 {
2900 {
2901 return MoveResult.Success;
2902 }
2903 Debug.Log(CanMoveTo(pos));
2905 }
2906 int num = pos.Distance(p);
2907 PathProgress pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Default, num + 4, 1);
2908 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 4)
2909 {
2910 PathFinderNode pathFinderNode = pathProgress.nodes[pathProgress.nodes.Count - 1];
2911 if (TryMove(new Point(pathFinderNode.X, pathFinderNode.Z)) == MoveResult.Success)
2912 {
2913 return MoveResult.Success;
2914 }
2915 }
2916 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Combat, num + 4, 1);
2917 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 4)
2918 {
2919 PathFinderNode pathFinderNode2 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2920 if (TryMove(new Point(pathFinderNode2.X, pathFinderNode2.Z)) == MoveResult.Success)
2921 {
2922 return MoveResult.Success;
2923 }
2924 }
2925 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Default, num + 25, 2);
2926 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 25)
2927 {
2928 PathFinderNode pathFinderNode3 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2929 if (TryMove(new Point(pathFinderNode3.X, pathFinderNode3.Z)) == MoveResult.Success)
2930 {
2931 return MoveResult.Success;
2932 }
2933 }
2934 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Combat, num + 25, 2);
2935 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 25)
2936 {
2937 PathFinderNode pathFinderNode4 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2938 if (TryMove(new Point(pathFinderNode4.X, pathFinderNode4.Z)) == MoveResult.Success)
2939 {
2940 return MoveResult.Success;
2941 }
2942 }
2943 return MoveResult.Fail;
2944 }
static Point _sharedPos
Definition: Chara.cs:180
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:802

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

10295 {
10296 if (TC == null || TC.HasCondition<ConInvulnerable>() || TC.Evalue(1421) > 0 || !TC.ExistsOnMap)
10297 {
10298 return false;
10299 }
10300 if (TC.hp > (long)TC.MaxHP * (long)(Mathf.Min(5 + (int)Mathf.Sqrt(power), harvest ? 35 : 25) + Evalue(1426) * 5) / (TC.IsPowerful ? 200 : 100))
10301 {
10302 return false;
10303 }
10304 if (TC.HasElement(427))
10305 {
10306 return false;
10307 }
10308 if (TC.IsPC && EClass.player.invlunerable)
10309 {
10310 return false;
10311 }
10312 PlaySound("hit_finish");
10313 Say("finish");
10314 Say("finish2", this, TC);
10315 TC.DamageHP(TC.MaxHP, AttackSource.Finish, this);
10316 return false;
10317 }
@ 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 10787 of file Chara.cs.

10788 {
10789 if (IsPCParty)
10790 {
10791 foreach (Chara member in EClass.pc.party.members)
10792 {
10793 if (member.HasElement(1641) && EClass.rnd(3) != 0)
10794 {
10795 Msg.Say("curse_nullify", member);
10796 return true;
10797 }
10798 }
10799 }
10800 else if (HasElement(1641) && EClass.rnd(3) != 0)
10801 {
10802 Say("curse_nullify", this);
10803 return true;
10804 }
10805 if (GetCondition<ConHolyVeil>() != null && EClass.rnd(5) != 0)
10806 {
10807 Say("curse_nullify", this);
10808 return true;
10809 }
10810 return false;
10811 }

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

4731 {
4732 foreach (Card item in pos.ListCards())
4733 {
4734 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)))
4735 {
4736 Thing thing = Pick(item.Thing);
4737 if (thing != null && !IsPC)
4738 {
4739 thing.isNPCProperty = true;
4740 }
4741 break;
4742 }
4743 }
4744 }

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

Referenced by AI_Fish.Run().

◆ TryPoisonPotion()

Thing Chara.TryPoisonPotion ( Thing  t)
inline

Definition at line 4662 of file Chara.cs.

4663 {
4664 if (t.trait is TraitPotion && t.id != "1165" && !t.source.tag.Contains("neg") && EClass.rnd(2) == 0 && HasElement(1565))
4665 {
4666 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)
4667 .id;
4668 Say("poisonDrip", this);
4669 int num = t.Num;
4670 t.Destroy();
4671 t = ThingGen.Create(text).SetNum(num);
4672 }
4673 return t;
4674 }
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 3480 of file Chara.cs.

3481 {
3482 List<Chara> list = point.ListCharas();
3483 if (list.Count == 0)
3484 {
3485 return;
3486 }
3487 list.ForeachReverse(delegate(Chara c)
3488 {
3489 if ((trait is TraitSnitch && c.IsPCFactionOrMinion) || (!c.ai.IsMoveAI && !c.IsPC && c.trait.CanBePushed && c != this && !c.noMove && (!EClass._zone.IsRegion || c.IsPCFactionOrMinion)))
3490 {
3491 List<Point> list2 = new List<Point>();
3492 for (int i = point.x - 1; i <= point.x + 1; i++)
3493 {
3494 for (int j = point.z - 1; j <= point.z + 1; j++)
3495 {
3496 if (i != point.x || j != point.z)
3497 {
3498 Point point2 = new Point(i, j);
3499 if (point2.IsValid && !point2.HasChara && !point2.IsBlocked && !point2.cell.hasDoor && !point2.IsBlockByHeight(point))
3500 {
3501 list2.Add(point2);
3502 }
3503 }
3504 }
3505 }
3506 if (list2.Count > 0)
3507 {
3508 if (list2.Count > 1)
3509 {
3510 list2.ForeachReverse(delegate(Point p)
3511 {
3512 if (p.Equals(new Point(point.x + point.x - pos.x, point.z + point.z - pos.z)))
3513 {
3514 list2.Remove(p);
3515 }
3516 });
3517 }
3518 Point newPoint = list2.RandomItem();
3519 if (IsPC)
3520 {
3521 Say("displace", this, c);
3522 PlaySound("push");
3523 }
3524 else if (c.isSynced)
3525 {
3526 c.PlayEffect("push");
3527 }
3528 c.MoveByForce(newPoint, this, checkWall: true);
3529 if (!c.IsPC && c.trait is TraitRogue && EClass.rnd(3) == 0 && GetCurrency() > 20 && !HasElement(426))
3530 {
3531 int num = EClass.rndHalf(10 + Mathf.Min(GetCurrency() / 100, 1000));
3532 c.Talk("pushed");
3533 Say("pushed_money", this, c);
3534 ModCurrency(-num);
3535 c.ModCurrency(num);
3536 c.PlaySound("steal_money");
3537 }
3538 else if (IsPC && !c.IsPCParty && !c.IsUnique && c.IsHumanSpeak && EClass.rnd(5) == 0)
3539 {
3540 c.Talk("pushed");
3541 }
3542 }
3543 }
3544 });
3545 }
bool IsMoveAI
Definition: AIAct.cs:55
bool IsHumanSpeak
Definition: Chara.cs:1064

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

4747 {
4748 if (!EClass._zone.TryAddThingInSharedContainer(t, containers) && dropIfFail)
4749 {
4750 EClass._zone.AddCard(t, pos);
4751 }
4752 }
bool TryAddThingInSharedContainer(Thing t, List< Thing > containers=null, bool add=true, bool msg=false, Chara chara=null, bool sharedOnly=true)
Definition: Zone.cs:2316

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

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

7848 {
7849 if (GetInt(113) != 0)
7850 {
7851 return;
7852 }
7853 _ListItems.Clear();
7854 Thing bestRangedWeapon = GetBestRangedWeapon();
7855 foreach (Thing thing in things)
7856 {
7857 if (!thing.IsAmmo && !thing.c_isImportant)
7858 {
7859 if (thing.category.slot != 0 && !thing.isEquipped && !thing.HasTag(CTAG.gift))
7860 {
7861 _ListItems.Add(thing);
7862 }
7863 else if (thing.IsRangedWeapon && thing.category.slot == 0 && bestRangedWeapon != thing)
7864 {
7865 _ListItems.Add(thing);
7866 }
7867 }
7868 }
7869 if (_ListItems.Count == 0)
7870 {
7871 return;
7872 }
7873 List<Thing> containers2 = containers.ToList();
7874 foreach (Thing listItem in _ListItems)
7875 {
7876 EClass._zone.TryAddThingInSharedContainer(listItem, containers2, add: true, msg: true, this);
7877 }
7878 }
void Add(Act a, string s="")
Definition: ActPlan.cs:11
static List< Thing > _ListItems
Definition: Chara.cs:196

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

4707 {
4708 if (t.id == "axe")
4709 {
4710 Tutorial.Reserve("tool");
4711 }
4712 if (t.category.id == "mushroom")
4713 {
4714 Tutorial.Reserve("food");
4715 }
4716 if (t.category.id == "herb")
4717 {
4718 Tutorial.Reserve("herb");
4719 }
4720 if (t.id == "pasture")
4721 {
4722 Tutorial.Reserve("pasture");
4723 }
4724 if (t.id == "log")
4725 {
4726 Tutorial.Reserve("process");
4727 }
4728 }

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

◆ TryRestock()

void Chara.TryRestock ( bool  onCreate)
inline

Definition at line 4991 of file Chara.cs.

4992 {
4993 isOnCreate = onCreate;
4994 if (onCreate || (!IsPCFaction && (base.IsUnique || trait is TraitAdventurer || trait is TraitGuard)))
4995 {
4996 RestockEquip((!EClass.core.IsGameStarted || !(EClass._zone is Zone_Music)) && onCreate);
4997 }
4998 RestockInventory(onCreate);
4999 }
void RestockInventory(bool onCreate)
Definition: Chara.cs:5352
void RestockEquip(bool onCreate)
Definition: Chara.cs:5001

References EClass._zone, EClass.core, and Core.IsGameStarted.

Referenced by OnCreate(), Zone.OnVisit(), ScaleByPrincipal(), and ZoneEventMusic.Spawn().

◆ TrySetEnemy()

void Chara.TrySetEnemy ( Chara  c)
inline

Definition at line 6735 of file Chara.cs.

6736 {
6737 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))
6738 {
6739 SetEnemy(c);
6740 }
6741 }

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

7886 {
7888 }
void TryTakeSharedItems(bool msg=true)
Definition: Chara.cs:7885

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

7891 {
7892 if (base.isSummon || (memberType == FactionMemberType.Livestock && homeBranch != null && !homeBranch.policies.IsActive(2715)))
7893 {
7894 return;
7895 }
7896 int num = 2;
7897 int num2 = 1;
7898 int num3 = 2;
7899 bool flag = GetInt(113) == 0;
7900 int num4 = 2;
7901 int num5 = 2;
7902 int num6 = 2;
7904 {
7905 num5 = 0;
7906 num6 = 0;
7907 }
7908 foreach (Thing thing3 in things)
7909 {
7910 if (CanEat(thing3, shouldEat))
7911 {
7912 if (thing3.HasElement(757))
7913 {
7914 num2 -= thing3.Num;
7915 num -= thing3.Num;
7916 }
7917 else
7918 {
7919 num -= thing3.Num;
7920 }
7921 }
7922 if (thing3.trait.GetHealAction(this) != null)
7923 {
7924 num3 -= thing3.Num;
7925 }
7926 if (thing3.id == "polish_powder")
7927 {
7928 num4 -= thing3.Num;
7929 }
7930 if (thing3.trait is TraitBlanketColdproof)
7931 {
7932 num5 -= thing3.Num;
7933 }
7934 if (thing3.trait is TraitBlanketFireproof)
7935 {
7936 num6 -= thing3.Num;
7937 }
7938 }
7939 _ListItems.Clear();
7940 foreach (Thing container in containers)
7941 {
7942 if (!container.IsSharedContainer)
7943 {
7944 continue;
7945 }
7946 foreach (Thing thing4 in container.things)
7947 {
7948 if (!thing4.c_isImportant && thing4.IsIdentified && thing4 != EClass.pc.held)
7949 {
7950 if (num4 > 0 && thing4.id == "polish_powder")
7951 {
7952 _ListItems.Add(thing4);
7953 num4 -= thing4.Num;
7954 }
7955 else if (num5 > 0 && !HasElement(1236) && thing4.trait is TraitBlanketColdproof)
7956 {
7957 _ListItems.Add(thing4);
7958 num5 -= thing4.Num;
7959 }
7960 else if (num6 > 0 && thing4.trait is TraitBlanketFireproof)
7961 {
7962 _ListItems.Add(thing4);
7963 num6 -= thing4.Num;
7964 }
7965 else if (num2 > 0 && CanEat(thing4, shouldEat) && !thing4.c_isImportant && thing4.HasElement(757))
7966 {
7967 _ListItems.Add(thing4);
7968 num2 -= thing4.Num;
7969 }
7970 else if (num > 0 && CanEat(thing4, shouldEat) && !thing4.c_isImportant)
7971 {
7972 _ListItems.Add(thing4);
7973 num -= thing4.Num;
7974 }
7975 else if (num3 > 0 && thing4.trait.GetHealAction(this) != null)
7976 {
7977 _ListItems.Add(thing4);
7978 num3 -= thing4.Num;
7979 }
7980 else if (flag && thing4.IsEquipmentOrRanged && !thing4.HasTag(CTAG.gift) && ShouldEquip(thing4, useFav: true))
7981 {
7982 _ListItems.Add(thing4);
7983 }
7984 }
7985 }
7986 }
7987 if (_ListItems.Count == 0)
7988 {
7989 return;
7990 }
7991 _ListItems.ForeachReverse(delegate(Thing t)
7992 {
7993 if (t.IsEquipmentOrRanged)
7994 {
7995 bool flag3 = false;
7996 int slot = t.category.slot;
7997 int equipValue = t.GetEquipValue();
7998 foreach (Thing listItem in _ListItems)
7999 {
8000 if (listItem.category.slot == slot && listItem.GetEquipValue() > equipValue)
8001 {
8002 flag3 = true;
8003 break;
8004 }
8005 }
8006 if (flag3)
8007 {
8008 _ListItems.Remove(t);
8009 }
8010 }
8011 });
8012 bool flag2 = false;
8013 foreach (Thing listItem2 in _ListItems)
8014 {
8015 Thing thing = listItem2;
8016 if (things.IsFull(thing))
8017 {
8018 break;
8019 }
8020 Thing thing2 = listItem2.parent as Thing;
8021 if (thing.HasElement(757))
8022 {
8023 if (thing.Num > 1)
8024 {
8025 thing = thing.Split(1);
8026 }
8027 }
8028 else if (thing.Num > 2)
8029 {
8030 thing = thing.Split(2);
8031 }
8032 if (msg)
8033 {
8034 Say("takeSharedItem", this, thing, thing2.GetName(NameStyle.Full));
8035 }
8036 AddCard(thing);
8037 if (ShouldEquip(thing, useFav: true) && thing.category.slot != 0)
8038 {
8039 TryEquip(thing, useFav: true);
8040 flag2 = true;
8041 }
8042 }
8043 if (flag2 && flag)
8044 {
8045 TryPutSharedItems(containers);
8046 }
8047 }
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:536
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 9167 of file Chara.cs.

9168 {
9169 if (!EClass.debug.enable || IsPC || !IsGlobal || !IsPCFaction)
9170 {
9171 return;
9172 }
9173 for (int i = 0; i < 100; i++)
9174 {
9175 if (base.feat == 0)
9176 {
9177 break;
9178 }
9179 if (base.c_upgrades == null)
9180 {
9181 base.c_upgrades = new CharaUpgrade();
9182 }
9183 if (base.c_upgrades.halt)
9184 {
9185 break;
9186 }
9187 Rand.SetSeed(base.uid + base.c_upgrades.count);
9188 int num = EClass.rnd(100);
9189 int num2 = 0;
9190 int num3 = 1;
9191 int num4 = 0;
9192 bool flag = false;
9193 IEnumerable<SourceElement.Row> ie = EClass.sources.elements.rows.Where((SourceElement.Row a) => !elements.Has(a) && a.category == "skill" && !a.tag.Contains("noPet"));
9194 List<Element> list = ListAvailabeFeats(pet: true);
9195 if (num >= 90 && list.Count > 0)
9196 {
9197 Element element = list.RandomItem();
9198 num2 = element.id;
9199 num4 = element.CostLearn;
9200 }
9201 else if (num >= 60 && ie.Any())
9202 {
9203 num2 = ie.RandomItem().id;
9204 num4 = 3;
9205 }
9206 else
9207 {
9208 num2 = Element.List_MainAttributesMajor.RandomItem();
9209 num4 = 1;
9210 num3 = 2;
9211 flag = true;
9212 }
9213 Rand.SetSeed();
9214 if (num4 > base.feat)
9215 {
9216 break;
9217 }
9218 base.feat -= num4;
9219 base.c_upgrades.count++;
9220 base.c_upgrades.spent += num4;
9221 bool flag2 = false;
9222 if (flag)
9223 {
9224 foreach (CharaUpgrade.Item item in base.c_upgrades.items)
9225 {
9226 if (item.idEle == num2)
9227 {
9228 item.value += num3;
9229 item.cost += num4;
9230 flag2 = true;
9231 break;
9232 }
9233 }
9234 }
9235 if (!flag2)
9236 {
9237 base.c_upgrades.items.Add(new CharaUpgrade.Item
9238 {
9239 idEle = num2,
9240 value = num3,
9241 cost = num4
9242 });
9243 }
9244 SourceElement.Row row = EClass.sources.elements.map[num2];
9245 if (row.category == "feat")
9246 {
9247 SetFeat(num2, elements.ValueWithoutLink(num2) + 1, msg: true);
9248 }
9249 else if (elements.ValueWithoutLink(row.id) == 0)
9250 {
9251 elements.Learn(row.id);
9252 }
9253 else
9254 {
9255 elements.ModBase(num2, num3);
9256 }
9257 }
9258 }
List< Element > ListAvailabeFeats(bool pet=false, bool showAll=false, bool purchaseFeat=false)
Definition: Chara.cs:10541
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 8390 of file Chara.cs.

8391 {
8392 if (t.id == "338" && t.blessedState >= BlessedState.Normal)
8393 {
8394 Thing thing = things.Find((Thing a) => a.IsEquipmentOrRanged && !a.isAcidproof);
8395 if (thing != null)
8396 {
8397 Say("dip", this, thing, t.GetName(NameStyle.Full, 1));
8398 SE.Change();
8399 t.trait.OnBlend(thing, this);
8400 return true;
8401 }
8402 return false;
8403 }
8404 if (t.IsNegativeGift || t.source.HasTag(CTAG.ignoreUse))
8405 {
8406 return false;
8407 }
8408 if (t.id == "cigar")
8409 {
8410 (t.trait as TraitItemProc).OnUse(this);
8411 return true;
8412 }
8413 if (t.trait.CanDrink(this))
8414 {
8415 Drink(t);
8416 return true;
8417 }
8418 if (t.trait.CanEat(this) && hunger.GetPhase() > ((IsPCFaction || IsPCFactionMinion) ? 2 : 0))
8419 {
8421 {
8422 target = t
8423 });
8424 return true;
8425 }
8426 if (t.trait.CanRead(this))
8427 {
8429 {
8430 target = t
8431 });
8432 return true;
8433 }
8434 if (base.hp < MaxHP * 90 / 100)
8435 {
8436 Action healAction = t.trait.GetHealAction(this);
8437 if (healAction != null)
8438 {
8439 healAction();
8440 return true;
8441 }
8442 }
8443 return false;
8444 }
bool isAcidproof
Definition: Card.cs:689
void SetAIImmediate(AIAct g)
Definition: Chara.cs:9528
virtual bool CanRead(Chara c)
Definition: Trait.cs:1166
virtual bool CanDrink(Chara c)
Definition: Trait.cs:1184
virtual void OnBlend(Thing t, Chara c)
Definition: Trait.cs:649

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

9800 {
9801 if (EClass.world.date.IsExpired(GetInt(51)))
9802 {
9803 Expedition expedition = Expedition.Create(this, sourceWork.expedition.ToEnum<ExpeditionType>());
9804 SetInt(51, EClass.world.date.GetRaw() + 60 * (expedition.hours + 24));
9805 homeBranch.expeditions.Add(expedition);
9806 return true;
9807 }
9808 return false;
9809 }
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 2598 of file Chara.cs.

2599 {
2600 base.c_uidMaster = 0;
2601 master = null;
2602 enemy = null;
2603 foreach (Chara chara in EClass._map.charas)
2604 {
2605 if (chara.enemy == this)
2606 {
2607 chara.SetEnemy();
2608 chara.ai.Cancel();
2609 }
2610 }
2611 ai.Cancel();
2612 Refresh();
2613 }

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

3858 {
3859 if (IsPCC)
3860 {
3861 if (base.dir == 0)
3862 {
3863 angle = 225f;
3864 }
3865 else if (base.dir == 1)
3866 {
3867 angle = 135f;
3868 }
3869 else if (base.dir == 2)
3870 {
3871 angle = 45f;
3872 }
3873 else if (base.dir == 3)
3874 {
3875 angle = -45f;
3876 }
3877 }
3878 else if (base.dir == 0)
3879 {
3880 angle = 165f;
3881 }
3882 else if (base.dir == 1)
3883 {
3884 angle = 300f;
3885 }
3886 else if (base.dir == 2)
3887 {
3888 angle = 0f;
3889 }
3890 else if (base.dir == 3)
3891 {
3892 angle = 120f;
3893 }
3894 }

Referenced by OnDeserialized().

◆ UpdateSight()

void Chara.UpdateSight ( )
inline

Definition at line 3918 of file Chara.cs.

3919 {
3920 int num = 4;
3921 for (int i = -num; i < num + 1; i++)
3922 {
3923 for (int j = -num; j < num + 1; j++)
3924 {
3925 shared.Set(pos.x + i, pos.z + j);
3926 if (shared.IsValid && !shared.cell.isSeen && i >= -1 && i <= 1 && j >= -1)
3927 {
3928 _ = 1;
3929 }
3930 }
3931 }
3932 }
bool isSeen
Definition: Cell.cs:294
static Point shared
Definition: Chara.cs:13

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

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

6173 {
6174 return UseAbility(elements.GetElement(idAct)?.act ?? ACT.Create(idAct), tc, pos, pt);
6175 }

References ACT.Create().

◆ ValidateWorks()

void Chara.ValidateWorks ( )
inline

Definition at line 9847 of file Chara.cs.

9848 {
9849 _goalWork.FindWork(this, setAI: false);
9851 }
static GoalHobby _goalHobby
Definition: Chara.cs:214
static GoalWork _goalWork
Definition: Chara.cs:212
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 5636 of file Chara.cs.

5637 {
5638 base.c_vomit++;
5639 Say("vomit", this);
5640 PlaySound("vomit");
5641 if (!EClass._zone.IsRegion)
5642 {
5643 Thing thing = ThingGen.Create("731");
5645 {
5646 thing.MakeRefFrom(this);
5647 }
5648 EClass._zone.AddCard(thing, pos);
5649 }
5650 if (HasCondition<ConAnorexia>())
5651 {
5652 ModExp(70, -50);
5653 ModExp(71, -75);
5654 ModExp(77, -100);
5655 }
5656 else if (base.c_vomit > 10)
5657 {
5658 AddCondition<ConAnorexia>();
5659 }
5660 AddCondition<ConDim>();
5661 if (HasCondition<ConAnorexia>())
5662 {
5663 ModWeight(-1 * (1 + EClass.rnd(5)));
5664 }
5665 if (hunger.GetPhase() >= 4)
5666 {
5667 DamageHP(9999L, AttackSource.Hunger);
5668 }
5669 hunger.Mod(30);
5670 }
void ModWeight(int a, bool ignoreLimit=false)
Definition: Chara.cs:10469

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

3935 {
3936 for (int num = conditions.Count - 1; num >= 0; num--)
3937 {
3938 if (conditions[num].ConsumeTurn)
3939 {
3940 return true;
3941 }
3942 }
3943 return false;
3944 }

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

7765 {
7766 n.Clear();
7767 UIItem uIItem = n.AddHeaderCard(base.Name.ToTitleCase());
7768 SetImage(uIItem.image2);
7769 uIItem.text2.SetText(race.GetText().ToTitleCase(wholeText: true) + " " + job.GetText().ToTitleCase(wholeText: true));
7770 n.AddText("");
7771 n.Build();
7772 }
void SetImage(Image image, int dir, int idSkin=0)
Definition: Card.cs:6586
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 98 of file Chara.cs.

Referenced by SetMainElement().

◆ _baseWorkElements

ElementContainer Chara._baseWorkElements

Definition at line 210 of file Chara.cs.

◆ _cbits1

BitArray32 Chara._cbits1

Definition at line 86 of file Chara.cs.

Referenced by OnSerializing().

◆ _cints

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

Definition at line 84 of file Chara.cs.

Referenced by OnDeserialized(), and OnSerializing().

◆ _cooldowns

List<int> Chara._cooldowns

◆ _faction

Faction Chara._faction
private

Definition at line 162 of file Chara.cs.

Referenced by SetFaction().

◆ _goalHobby

GoalHobby Chara._goalHobby = new GoalHobby()
staticprivate

Definition at line 214 of file Chara.cs.

◆ _goalWork

GoalWork Chara._goalWork = new GoalWork()
staticprivate

Definition at line 212 of file Chara.cs.

◆ _historyFood

List<List<string> > Chara._historyFood

Definition at line 66 of file Chara.cs.

◆ _hobbies

List<int> Chara._hobbies

Definition at line 51 of file Chara.cs.

◆ _isLevitating

bool Chara._isLevitating

Definition at line 138 of file Chara.cs.

Referenced by HasHigherGround(), and Refresh().

◆ _job

SourceJob.Row Chara._job

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

◆ _listFavFood

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

Definition at line 198 of file Chara.cs.

◆ _ListItems

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

Definition at line 196 of file Chara.cs.

◆ _NoGoalPC

NoGoal Chara._NoGoalPC = new NoGoal()
static

Definition at line 202 of file Chara.cs.

◆ _NoGoalRepeat

NoGoal Chara._NoGoalRepeat = new NoGoal()
static

Definition at line 204 of file Chara.cs.

Referenced by ActPlan.Item.Perform().

◆ _pts

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

Definition at line 192 of file Chara.cs.

◆ _race

SourceRace.Row Chara._race

Definition at line 166 of file Chara.cs.

Referenced by ChangeRace(), and OnCreate().

◆ _sharedPos

Point Chara._sharedPos = new Point()
staticprivate

Definition at line 180 of file Chara.cs.

Referenced by TryMoveTowards().

◆ _Speed

long Chara._Speed
private

Definition at line 178 of file Chara.cs.

Referenced by RefreshSpeed().

◆ _strs

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

Definition at line 81 of file Chara.cs.

◆ _tactics

Tactics Chara._tactics

Definition at line 170 of file Chara.cs.

◆ _works

List<int> Chara._works

Definition at line 54 of file Chara.cs.

◆ _workSummary

WorkSummary Chara._workSummary

Definition at line 57 of file Chara.cs.

◆ actTime

float Chara.actTime = 0.3f

Definition at line 184 of file Chara.cs.

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

◆ ai

◆ body

◆ bossText

bool Chara.bossText

Definition at line 148 of file Chara.cs.

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

◆ calmCheckTurn

int Chara.calmCheckTurn

Definition at line 120 of file Chara.cs.

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

◆ canSeeInvisible

bool Chara.canSeeInvisible

Definition at line 142 of file Chara.cs.

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

◆ combatCount

int Chara.combatCount

Definition at line 118 of file Chara.cs.

◆ conditions

◆ conSleep

◆ consumeTurn

bool Chara.consumeTurn
static

Definition at line 186 of file Chara.cs.

◆ conSuspend

◆ contribution

int Chara.contribution

Definition at line 20 of file Chara.cs.

Referenced by OnCreate().

◆ dirtySpeed

bool Chara.dirtySpeed = true

Definition at line 176 of file Chara.cs.

Referenced by RefreshSpeed(), and SetDirtySpeed().

◆ emoIcon

Emo2 Chara.emoIcon

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

◆ happiness

int Chara.happiness

Definition at line 112 of file Chara.cs.

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

◆ hasMovedThisTurn

bool Chara.hasMovedThisTurn
private

Definition at line 182 of file Chara.cs.

Referenced by _Move().

◆ hasTelepathy

bool Chara.hasTelepathy

◆ held

◆ host

◆ idleActTimer

int Chara.idleActTimer

Definition at line 116 of file Chara.cs.

Referenced by AI_Idle.Run().

◆ idleTimer

float Chara.idleTimer

Definition at line 124 of file Chara.cs.

Referenced by CharaRenderer.UpdatePosition().

◆ IDTimeTable

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

Definition at line 17 of file Chara.cs.

◆ ignoreSPAbsorb

bool Chara.ignoreSPAbsorb

Definition at line 150 of file Chara.cs.

◆ isAstralBody

bool Chara.isAstralBody

Definition at line 158 of file Chara.cs.

Referenced by Refresh().

◆ isBerserk

bool Chara.isBerserk

◆ isBlind

◆ isConfused

◆ isCreated

bool Chara.isCreated

Definition at line 140 of file Chara.cs.

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

◆ isDrunk

bool Chara.isDrunk

Definition at line 128 of file Chara.cs.

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

◆ isFainted

bool Chara.isFainted

Definition at line 132 of file Chara.cs.

◆ isOnCreate

bool Chara.isOnCreate
static

Definition at line 190 of file Chara.cs.

◆ isParalyzed

bool Chara.isParalyzed

Definition at line 136 of file Chara.cs.

Referenced by Point.ListWitnesses().

◆ isWeakToSunlight

bool Chara.isWeakToSunlight

Definition at line 156 of file Chara.cs.

Referenced by Refresh().

◆ isWet

bool Chara.isWet

◆ lastPos

new Point Chara.lastPos = new Point()

Definition at line 92 of file Chara.cs.

Referenced by _Move().

◆ LevelLimit

const int Chara.LevelLimit = 99999999
static

Definition at line 11 of file Chara.cs.

◆ ListAdvJob

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

Definition at line 174 of file Chara.cs.

Referenced by OnCreate().

◆ ListAdvRace

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

Definition at line 172 of file Chara.cs.

Referenced by OnCreate().

◆ listHobby

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

Definition at line 15 of file Chara.cs.

◆ master

◆ memberType

◆ mimicry

◆ nextUse

Thing Chara.nextUse

Definition at line 102 of file Chara.cs.

Referenced by AI_Idle.Run().

◆ orgPos

◆ parasite

◆ party

Party Chara.party

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

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

◆ pccData

◆ preventRegen

bool Chara.preventRegen
static

Definition at line 188 of file Chara.cs.

◆ quest

◆ ranged

◆ rawSlots

int [] Chara.rawSlots

Definition at line 75 of file Chara.cs.

Referenced by OnSerializing().

◆ resistCon

Dictionary<int, int> Chara.resistCon

Definition at line 220 of file Chara.cs.

◆ ride

◆ shared

Point Chara.shared = new Point()
staticprivate

Definition at line 13 of file Chara.cs.

◆ sharedCheckTurn

int Chara.sharedCheckTurn

Definition at line 122 of file Chara.cs.

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

◆ source

◆ spriteReplacer

SpriteReplacer Chara.spriteReplacer

Definition at line 160 of file Chara.cs.

Referenced by LayerEditSkin.RefreshImage().

◆ stealthSeen

int Chara.stealthSeen

Definition at line 194 of file Chara.cs.

◆ tempElements

◆ turnLastSeen

int Chara.turnLastSeen = -100

Definition at line 114 of file Chara.cs.

Referenced by AI_Idle.Run().

◆ visibleWithTelepathy

bool Chara.visibleWithTelepathy

◆ wasInWater

bool Chara.wasInWater

Definition at line 152 of file Chara.cs.

Referenced by _Move().

◆ workElements

ElementContainer Chara.workElements

Definition at line 42 of file Chara.cs.

Property Documentation

◆ _affinity

int Chara._affinity
getset

Definition at line 308 of file Chara.cs.

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

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

◆ _alias

string Chara._alias
getset

Definition at line 224 of file Chara.cs.

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

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

◆ _idTimeTable

int Chara._idTimeTable
getset

Definition at line 346 of file Chara.cs.

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

Referenced by OnCreate().

◆ _maxStamina

int Chara._maxStamina
getset

Definition at line 370 of file Chara.cs.

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

Referenced by CalculateMaxStamina().

◆ ability

◆ actorPrefab

override string Chara.actorPrefab
get

Definition at line 526 of file Chara.cs.

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

◆ affinity

◆ Aka

◆ AliasMaterialOnCreate

override string Chara.AliasMaterialOnCreate
get

Definition at line 566 of file Chara.cs.

◆ baseWorkElements

ElementContainer Chara.baseWorkElements
get

Definition at line 1171 of file Chara.cs.

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

◆ bladder

Stats Chara.bladder
get

Definition at line 1211 of file Chara.cs.

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

◆ burden

◆ CanGainConResist

bool Chara.CanGainConResist
get

Definition at line 1221 of file Chara.cs.

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

◆ CanOpenDoor

bool Chara.CanOpenDoor
get

Definition at line 843 of file Chara.cs.

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

◆ CanWitness

bool Chara.CanWitness
get

Definition at line 1051 of file Chara.cs.

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

Referenced by Point.ListWitnesses().

◆ corruption

int Chara.corruption
getset

Definition at line 382 of file Chara.cs.

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

Referenced by CanDuplicate().

◆ CurrentGeneSlot

int Chara.CurrentGeneSlot
get

Definition at line 1131 of file Chara.cs.

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

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

◆ CurrentSpan

TimeTable.Span Chara.CurrentSpan
get

Definition at line 861 of file Chara.cs.

Referenced by ConSleep.Tick().

◆ currentZone

Zone Chara.currentZone
getset

Definition at line 260 of file Chara.cs.

261 {
262 get
263 {
264 return RefZone.Get(_cints[1]);
265 }
266 set
267 {
268 _cints[1] = RefZone.Set(value);
269 }
270 }
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 334 of file Chara.cs.

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

◆ depression

Stats Chara.depression
get

Definition at line 1209 of file Chara.cs.

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

◆ DestDist

int Chara.DestDist
get

Definition at line 1047 of file Chara.cs.

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

◆ DV

override int Chara.DV
get

Definition at line 748 of file Chara.cs.

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

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

◆ faction

Faction Chara.faction
getset

Definition at line 432 of file Chara.cs.

433 {
434 get
435 {
436 return _faction ?? (_faction = EClass.game.factions.dictAll.TryGetValue(idFaction));
437 }
438 set
439 {
440 idFaction = value?.uid;
441 }
442 }
string idFaction
Definition: Chara.cs:249
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 554 of file Chara.cs.

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

Referenced by CharaActor.RefreshSprite().

◆ GeneCostMTP

int Chara.GeneCostMTP
get

Definition at line 1119 of file Chara.cs.

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

Referenced by TraitGene.TrySetHeldAct().

◆ goalListType

GoalListType Chara.goalListType
getset

Definition at line 284 of file Chara.cs.

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

◆ HasHost

override bool Chara.HasHost
get

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

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

◆ idFaith

string Chara.idFaith
getset

Definition at line 236 of file Chara.cs.

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

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

◆ IDPCCBodySet

string Chara.IDPCCBodySet
get

Definition at line 496 of file Chara.cs.

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

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

◆ idTimeTable

string Chara.idTimeTable
get

Definition at line 474 of file Chara.cs.

Referenced by LayerQuestBoard.RefreshHire().

◆ interest

int Chara.interest
getset

Definition at line 322 of file Chara.cs.

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

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

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

◆ isAlawysVisible

bool Chara.isAlawysVisible
getset

Definition at line 406 of file Chara.cs.

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

◆ IsAliveInCurrentZone

◆ IsAnimal

bool Chara.IsAnimal
get

Definition at line 915 of file Chara.cs.

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

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

◆ IsAstralBody

bool Chara.IsAstralBody
get

Implements IPathfindWalker.

Definition at line 508 of file Chara.cs.

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

◆ IsCat

bool Chara.IsCat
get

Definition at line 1035 of file Chara.cs.

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

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

◆ isChara

override bool Chara.isChara
get

Definition at line 706 of file Chara.cs.

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

◆ isDead

bool Chara.isDead
getset

Definition at line 394 of file Chara.cs.

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

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

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

◆ IsEyth

bool Chara.IsEyth
get

Definition at line 1101 of file Chara.cs.

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

◆ IsFairy

bool Chara.IsFairy
get

Definition at line 987 of file Chara.cs.

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

Referenced by Faction.IsWearingPanty().

◆ IsFish

bool Chara.IsFish
get

Definition at line 975 of file Chara.cs.

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

◆ IsGlobal

◆ IsGod

bool Chara.IsGod
get

Definition at line 999 of file Chara.cs.

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

◆ IsHorror

bool Chara.IsHorror
get

Definition at line 963 of file Chara.cs.

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

Referenced by Refresh().

◆ IsHuman

bool Chara.IsHuman
get

Definition at line 927 of file Chara.cs.

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

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

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

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

◆ IsIdle

bool Chara.IsIdle
get

Definition at line 901 of file Chara.cs.

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

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

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

◆ IsLocalChara

bool Chara.IsLocalChara
get

Definition at line 889 of file Chara.cs.

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

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

◆ IsMachine

bool Chara.IsMachine
get

Definition at line 951 of file Chara.cs.

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

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

◆ IsMaid

bool Chara.IsMaid
get

Definition at line 1075 of file Chara.cs.

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

Referenced by FactionBranch.GetMaid().

◆ IsMarried

bool Chara.IsMarried
get

Definition at line 616 of file Chara.cs.

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

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

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

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

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

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

◆ IsMoving

override bool Chara.IsMoving
get

Definition at line 628 of file Chara.cs.

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

◆ IsMultisize

◆ IsPC

override bool Chara.IsPC
get

Definition at line 632 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(), CharaAbility.Has(), 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 690 of file Chara.cs.

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

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

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

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

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

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

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

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

◆ IsPlant

bool Chara.IsPlant
get

Definition at line 1023 of file Chara.cs.

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

Referenced by GoalCombat.Run().

◆ IsPrisoner

bool Chara.IsPrisoner
get

Definition at line 1087 of file Chara.cs.

◆ isSynced

override bool Chara.isSynced
get

◆ isThing

override bool Chara.isThing
get

Definition at line 704 of file Chara.cs.

◆ IsUndead

bool Chara.IsUndead
get

Definition at line 939 of file Chara.cs.

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

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

◆ IsWealthy

bool Chara.IsWealthy
get

Definition at line 1103 of file Chara.cs.

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

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

◆ job

◆ knowFav

bool Chara.knowFav
getset

Definition at line 418 of file Chara.cs.

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

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

◆ MainElement

Element Chara.MainElement
get

Definition at line 736 of file Chara.cs.

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

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

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

◆ OriginalHostility

Hostility Chara.OriginalHostility
get

Definition at line 476 of file Chara.cs.

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

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

807 {
808 get
809 {
810 if (spriteReplacer != null)
811 {
813 {
814 spriteReplacer.data.tryFixPrefNotLoadedAtStart = true;
816 }
818 }
819 if (base.idSkin > 0)
820 {
821 switch (sourceCard.tiles.TryGet(base.idSkin))
822 {
823 case 2319:
824 case 2619:
825 case 2621:
826 case 2623:
827 case 2625:
829 case 2320:
830 case 2611:
831 case 2620:
832 case 2622:
833 case 2624:
834 case 2626:
835 case 2828:
837 }
838 }
840 }
841 }
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:92
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 538 of file Chara.cs.

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

◆ PV

override int Chara.PV
get

Definition at line 777 of file Chara.cs.

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

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

◆ race

◆ Ridability

Ridability Chara.Ridability
get

Definition at line 863 of file Chara.cs.

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

Referenced by ActRide.Ride().

◆ SAN

◆ SelfWeight

override int Chara.SelfWeight
get

Definition at line 732 of file Chara.cs.

◆ sleepiness

Stats Chara.sleepiness
get

◆ sourceCard

override CardRow Chara.sourceCard
get

◆ sourceRenderCard

override CardRow Chara.sourceRenderCard
get

Definition at line 458 of file Chara.cs.

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

◆ Speed

int Chara.Speed
get

Definition at line 1143 of file Chara.cs.

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

Referenced by GameUpdater.ConditionUpdater.FixedUpdate().

◆ stamina

◆ tactics

Tactics Chara.tactics
get

Definition at line 859 of file Chara.cs.

Referenced by GoalCombat.Run().

◆ trait

◆ uidEditor

int Chara.uidEditor
getset

Definition at line 358 of file Chara.cs.

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

Referenced by SerializedCards.Add().

◆ WeightLimit

override int Chara.WeightLimit
get

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