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

Public Attributes

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

Static Public Attributes

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

Protected Member Functions

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

Properties

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

Private Member Functions

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

Private Attributes

Faction _faction
 
long _Speed
 
bool hasMovedThisTurn
 

Static Private Attributes

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

Additional Inherited Members

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

Detailed Description

Definition at line 9 of file Chara.cs.

Member Function Documentation

◆ _CreateRenderer()

override CardRenderer Chara._CreateRenderer ( )
inlinevirtual

Reimplemented from Card.

Definition at line 6875 of file Chara.cs.

6876 {
6877 CardRenderer cardRenderer = renderer;
6878 CharaRenderer charaRenderer = new CharaRenderer();
6879 if (source.skinAntiSpider != 0 && EClass.core.config.game.antiSpider)
6880 {
6881 base.idSkin = source.skinAntiSpider;
6882 }
6883 if (host != null)
6884 {
6885 charaRenderer.pccData = PCCData.Create("ride");
6886 string idPart = base.c_idRidePCC.IsEmpty(EClass.core.pccs.sets["ride"].map["body"].map.Keys.First());
6887 charaRenderer.pccData.SetPart("body", "ride", idPart);
6888 charaRenderer.pccData.ride = EClass.core.pccs.GetRideData(idPart);
6889 }
6890 else
6891 {
6892 foreach (Condition condition in conditions)
6893 {
6894 RendererReplacer rendererReplacer = condition.GetRendererReplacer();
6895 if (rendererReplacer != null)
6896 {
6897 charaRenderer.replacer = rendererReplacer;
6898 charaRenderer.data = rendererReplacer.data;
6899 charaRenderer.pccData = rendererReplacer.pccData;
6900 break;
6901 }
6902 }
6903 if (charaRenderer.replacer == null)
6904 {
6905 charaRenderer.pccData = pccData;
6906 }
6907 }
6908 renderer = charaRenderer;
6909 renderer.SetOwner(this);
6910 if (cardRenderer != null)
6911 {
6912 renderer.SetFirst(first: false, cardRenderer.position);
6913 }
6914 return charaRenderer;
6915 }
virtual RendererReplacer GetRendererReplacer()
RendererReplacer replacer
Definition: CardRenderer.cs:29
Vector3 position
Definition: CardRenderer.cs:21
virtual void SetOwner(Card c)
Definition: CardRenderer.cs:38
virtual void SetFirst(bool first, Vector3 pos)
CardRenderer renderer
Definition: Card.cs:64
PCCData pccData
Chara host
Definition: Chara.cs:33
List< Condition > conditions
Definition: Chara.cs:215
SourceChara.Row source
Definition: Chara.cs:162
PCCData pccData
Definition: Chara.cs:67
new GameConfig game
Definition: CoreConfig.cs:617
PCCManager pccs
Definition: Core.cs:41
CoreConfig config
Definition: Core.cs:70
Definition: EClass.cs:6
static Core core
Definition: EClass.cs:7

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

Referenced by ActPlan._Update(), 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 2416 of file Chara.cs.

2417 {
2418 if (EClass.pc.homeBranch != null)
2419 {
2421 }
2422 else
2423 {
2424 SetGlobal();
2426 }
2427 Hostility hostility2 = (base.c_originalHostility = Hostility.Ally);
2428 this.hostility = hostility2;
2429 orgPos = null;
2430 base.c_summonDuration = 0;
2431 base.isSummon = false;
2432 UnmakeMinion();
2433 SetInt(32);
2434 Refresh();
2435 }
Hostility
Definition: Hostility.cs:2
void SetInt(string id, int value=0)
Definition: Card.cs:2570
void Refresh(bool calledRecursive=false)
Definition: Chara.cs:1772
void UnmakeMinion()
Definition: Chara.cs:2470
Chara SetFaction(Faction f)
Definition: Chara.cs:1466
Point orgPos
Definition: Chara.cs:21
FactionBranch homeBranch
Definition: Chara.cs:1089
Chara SetGlobal()
Definition: Chara.cs:1533
static Faction Home
Definition: EClass.cs:27
static Chara pc
Definition: EClass.cs:15
void AddMemeber(Chara c)

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

Referenced by MakeAlly(), and MakePartyMemeber().

◆ _Move()

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

Reimplemented from Card.

Definition at line 2838 of file Chara.cs.

2839 {
2840 if (isDead)
2841 {
2842 return MoveResult.Fail;
2843 }
2844 if (IsPC)
2845 {
2846 float num = EClass.setting.defaultActPace;
2847 switch (burden.GetPhase())
2848 {
2849 case 3:
2850 num *= 1.5f;
2851 break;
2852 case 4:
2853 num *= 2f;
2854 break;
2855 }
2857 {
2858 int num2 = 30;
2859 if (!EClass.pc.HasElement(408))
2860 {
2862 {
2863 case Weather.Condition.Rain:
2864 num2 += 5;
2865 break;
2866 case Weather.Condition.RainHeavy:
2867 num2 += 10;
2868 num *= 1.5f;
2869 break;
2870 case Weather.Condition.Snow:
2871 num2 += 10;
2872 break;
2873 case Weather.Condition.SnowHeavy:
2874 num2 += 15;
2875 num *= 1.5f;
2876 break;
2877 }
2878 }
2879 if (newPoint.matFloor.id == 48)
2880 {
2881 num2 += 20;
2882 num *= 1.8f;
2883 }
2884 num2 = num2 * 100 / (100 + EClass.sqrt(EvalueMax(240, -20) * 10) + EvalueMax(407, -5) * 5);
2885 EClass.world.date.AdvanceMin(num2 * 6);
2886 EClass.player.lastZonePos = null;
2888 int num3 = base.hp;
2889 for (int i = 0; i < num2 * 4; i++)
2890 {
2891 EClass.pc.party.members.ForeachReverse(delegate(Chara m)
2892 {
2893 if (!m.isDead)
2894 {
2895 m.TickConditions();
2896 }
2897 });
2898 if (base.hp < MaxHP / 5 && base.hp < num3 && !EClass.player.regionMoveWarned)
2899 {
2900 EClass.player.regionMoveWarned = true;
2901 Msg.Say("regionAbortMove");
2902 EInput.Consume(consumeAxis: true);
2903 SetAI(new NoGoal());
2904 return MoveResult.Fail;
2905 }
2906 }
2907 if (newPoint.cell.CanSuffocate())
2908 {
2909 bool flag = HasElement(1252);
2910 if (!flag)
2911 {
2912 AddCondition<ConSuffocation>((Evalue(200) != 0) ? (2000 / (100 + EvalueMax(200, -5) * 10)) : 30, force: true);
2913 }
2914 int num4 = GetCondition<ConSuffocation>()?.GetPhase() ?? 0;
2915 if (num4 >= 2)
2916 {
2917 DamageHP(EClass.rndHalf(10 + MaxHP / 5), AttackSource.Condition);
2918 }
2919 if (!isDead && !HasElement(429))
2920 {
2921 ModExp(200, ((!flag) ? 1 : 10) + num4 * 12);
2922 }
2923 }
2924 EClass.player.regionMoveWarned = false;
2925 if (isDead)
2926 {
2927 return MoveResult.Fail;
2928 }
2929 }
2930 if (num > EClass.setting.defaultActPace * 3f)
2931 {
2932 num = EClass.setting.defaultActPace * 3f;
2933 }
2934 actTime = num;
2935 }
2936 if (IsPCFaction && EClass.rnd(5) == 0 && newPoint.cell.CanSuffocate())
2937 {
2938 int num5 = Mathf.Min(5 + EClass._zone.DangerLv / 10, 200);
2939 ModExp(200, EClass._zone.IsRegion ? 50 : num5);
2940 if (ride != null)
2941 {
2942 ride.ModExp(200, EClass._zone.IsRegion ? 50 : num5);
2943 }
2944 if (parasite != null)
2945 {
2946 parasite.ModExp(200, EClass._zone.IsRegion ? 50 : num5);
2947 }
2948 }
2949 Chara chara = ((ride == null) ? this : ride);
2950 if (!EClass._zone.IsRegion || chara.IsPC)
2951 {
2952 bool flag2 = (chara.isConfused && EClass.rnd(2) == 0) || (chara.isDrunk && EClass.rnd(IsIdle ? 2 : 8) == 0 && !chara.HasElement(1215));
2953 if (host != null && host.ride == this && ((host.isConfused && EClass.rnd(2) == 0) || (host.isDrunk && EClass.rnd(IsIdle ? 2 : 8) == 0 && !host.HasElement(1215))))
2954 {
2955 flag2 = true;
2956 }
2957 if (flag2 && !HasElement(493) && newPoint.Distance(pos) <= 1)
2958 {
2959 Point randomNeighbor = pos.GetRandomNeighbor();
2960 if (CanMoveTo(randomNeighbor, allowDestroyPath: false))
2961 {
2962 newPoint = randomNeighbor;
2963 if (isDrunk)
2964 {
2965 Talk("drunk");
2966 }
2967 }
2968 }
2969 }
2970 if (newPoint.x != pos.x || newPoint.z != pos.z)
2971 {
2972 LookAt(newPoint);
2973 }
2974 CellEffect effect = base.Cell.effect;
2975 if (effect != null && effect.id == 7)
2976 {
2977 CellEffect effect2 = base.Cell.effect;
2978 if (race.height < 500 && !race.tag.Contains("webfree") && !HasElement(493) && EClass.rnd(effect2.power + 25) > EClass.rnd(base.STR + base.DEX + 1))
2979 {
2980 Say("abWeb_caught", this);
2981 PlaySound("web");
2982 effect2.power = effect2.power * 3 / 4;
2983 renderer.PlayAnime(AnimeID.Shiver);
2984 return MoveResult.Fail;
2985 }
2986 Say("abWeb_pass", this);
2987 EClass._map.SetEffect(base.Cell.x, base.Cell.z);
2988 }
2989 if (IsPC)
2990 {
2991 EClass.player.renderExtraTime = 0f;
2992 if (EClass._zone.IsRegion)
2993 {
2995 }
2996 else if ((newPoint.x > pos.x && newPoint.z > pos.z) || (newPoint.x < pos.x && newPoint.z < pos.z))
2997 {
2998 EClass.player.renderExtraTime = actTime * EClass.setting.render.anime.diagonalSpeed;
2999 }
3000 }
3001 if (newPoint.HasChara)
3002 {
3003 foreach (Chara item in newPoint.ListCharas())
3004 {
3005 if (item.mimicry != null && item.IsHostile(this))
3006 {
3007 if (item.mimicry.ShouldRevealOnPush)
3008 {
3009 item.mimicry.Reveal(this, surprise: true);
3010 }
3011 return MoveResult.Event;
3012 }
3013 }
3014 }
3015 if (newPoint.cell.hasDoor)
3016 {
3017 foreach (Thing thing in pos.Things)
3018 {
3019 if (thing.trait is TraitDoor traitDoor && traitDoor.owner.c_lockLv > 0)
3020 {
3021 if (base.INT < 10)
3022 {
3023 return MoveResult.Fail;
3024 }
3025 traitDoor.TryOpenLock(this);
3026 return MoveResult.Door;
3027 }
3028 }
3029 }
3030 Cell cell = newPoint.cell;
3031 Cell cell2 = pos.cell;
3032 bool flag3 = cell.HasLiquid && !IsLevitating;
3033 bool hasBridge = cell.HasBridge;
3034 bool hasRamp = cell.HasRamp;
3035 bool flag4 = EClass._zone.IsSnowCovered && !cell.HasRoof && !cell.isClearSnow;
3036 TileRow tileRow = (hasRamp ? ((TileRow)cell.sourceBlock) : ((TileRow)(hasBridge ? cell.sourceBridge : cell.sourceFloor)));
3037 SourceMaterial.Row row = (hasRamp ? cell.matBlock : (hasBridge ? cell.matBridge : cell.matFloor));
3038 bool flag5 = cell.IsTopWater && !cell.isFloating;
3039 if (!EClass._zone.IsRegion)
3040 {
3041 if (cell.hasDoorBoat)
3042 {
3043 tileRow = FLOOR.sourceWood;
3044 row = MATERIAL.sourceOak;
3045 flag5 = false;
3046 }
3047 else if (flag4 && !tileRow.ignoreSnow)
3048 {
3049 if (tileRow.tileType.IsWater)
3050 {
3051 tileRow = FLOOR.sourceIce;
3052 row = MATERIAL.sourceIce;
3053 }
3054 else
3055 {
3056 tileRow = FLOOR.sourceSnow;
3057 row = MATERIAL.sourceSnow;
3058 }
3059 flag5 = false;
3060 }
3061 }
3062 if ((pos.sourceFloor.isBeach || cell2.IsSnowTile) && !pos.HasObj)
3063 {
3064 EClass._map.SetFoormark(pos, 1, (int)Util.GetAngle(pos.x - newPoint.x, pos.z - newPoint.z), cell2.IsSnowTile ? 312 : 304);
3065 }
3066 if (isSynced)
3067 {
3068 string text = ((flag3 || flag5) ? "water" : tileRow.soundFoot.IsEmpty(row.soundFoot.IsEmpty("default")));
3069 if (cell.obj != 0 && cell.sourceObj.tileType.IsPlayFootSound && !cell.matObj.soundFoot.IsEmpty())
3070 {
3071 text = cell.matObj.soundFoot;
3072 }
3073 if (IsPC)
3074 {
3075 foreach (Thing thing2 in newPoint.Things)
3076 {
3077 if (thing2.IsInstalled && (thing2.trait.IsChangeFloorHeight || thing2.Pref.Surface))
3078 {
3079 text = thing2.material.soundFoot;
3080 }
3081 }
3082 }
3083 if (!text.IsEmpty())
3084 {
3085 SoundManager.altLastData = IsPC;
3086 PlaySound("Footstep/" + text, IsPC ? 1f : 0.9f);
3087 }
3088 if (!flag5)
3089 {
3091 PCOrbit pcOrbit = EClass.screen.pcOrbit;
3092 bool flag6 = scene.actionMode.gameSpeed > 1f;
3093 scene.psFoot.transform.position = renderer.position + pcOrbit.footPos;
3094 scene.psFoot.startColor = row.matColor;
3095 scene.psFoot.Emit(pcOrbit.emitFoot * ((!flag6) ? 1 : 2));
3096 if (flag6 && IsPC)
3097 {
3098 scene.psSmoke.transform.position = renderer.position + pcOrbit.smokePos;
3099 scene.psSmoke.Emit(pcOrbit.emitSmoke);
3100 }
3101 }
3102 if (flag3 || flag5)
3103 {
3104 Effect.Get("ripple").Play(newPoint);
3105 }
3106 }
3107 lastPos.Set(pos);
3108 if (type != MoveType.Force)
3109 {
3110 if (newPoint.HasChara && ai.Current.PushChara)
3111 {
3112 TryPush(newPoint);
3113 }
3114 if (newPoint.HasChara && newPoint.Charas.Count == 1)
3115 {
3116 Chara chara2 = newPoint.Charas[0];
3117 if (CanReplace(chara2))
3118 {
3119 chara2.MoveByForce(lastPos, this);
3120 if (chara.IsPC)
3121 {
3122 Say("replace_pc", chara, chara2);
3123 }
3124 }
3125 }
3126 }
3127 if (cell.hasDoor)
3128 {
3129 foreach (Thing thing3 in newPoint.Things)
3130 {
3131 if (thing3.trait is TraitDoor traitDoor2)
3132 {
3133 traitDoor2.TryOpen(this);
3134 }
3135 }
3136 }
3137 EClass._zone.map.MoveCard(newPoint, this);
3138 SyncRide();
3140 {
3141 foreach (Chara member in EClass.pc.party.members)
3142 {
3143 if (member.isLeashed && !member.IsPC && member.host == null && !member.IsDisabled && !member.HasCondition<ConEntangle>() && !member.IsInCombat && member.Dist(EClass.pc) > 1)
3144 {
3145 member.TryMoveTowards(EClass.pc.pos);
3146 }
3147 }
3148 }
3150 {
3152 }
3153 if (IsPC)
3154 {
3155 PlaySound("Footstep/Extra/pcfootstep");
3156 if (pos.HasThing)
3157 {
3158 foreach (Card item2 in pos.ListCards())
3159 {
3160 if (!item2.isThing || item2.placeState != 0 || item2.ignoreAutoPick)
3161 {
3162 continue;
3163 }
3165 {
3167 ContainerFlag containerFlag = item2.category.GetRoot().id.ToEnum<ContainerFlag>();
3168 if (containerFlag == ContainerFlag.none)
3169 {
3170 containerFlag = ContainerFlag.other;
3171 }
3172 if ((dataPick.noRotten && item2.IsDecayed) || (dataPick.onlyRottable && item2.trait.Decay == 0))
3173 {
3174 continue;
3175 }
3176 if (dataPick.userFilter)
3177 {
3178 switch (dataPick.IsFilterPass(item2.GetName(NameStyle.Full, 1)))
3179 {
3180 case Window.SaveData.FilterResult.PassWithoutFurtherTest:
3181 Pick(item2.Thing);
3182 continue;
3183 case Window.SaveData.FilterResult.Block:
3184 continue;
3185 }
3186 }
3187 if (dataPick.advDistribution)
3188 {
3189 foreach (int cat in dataPick.cats)
3190 {
3191 if (item2.category.uid == cat)
3192 {
3193 Pick(item2.Thing);
3194 }
3195 }
3196 }
3197 else if (!dataPick.flag.HasFlag(containerFlag))
3198 {
3199 Pick(item2.Thing);
3200 }
3201 }
3202 else
3203 {
3204 Pick(item2.Thing);
3205 }
3206 }
3207 }
3208 if (EClass._zone.IsRegion)
3209 {
3211 if (cell3?.zone != null && !cell3.zone.HiddenInRegionMap && (!(cell3.zone is Zone_Field) || cell3.zone.children.Count > 0 || cell3.zone.IsPCFaction))
3212 {
3213 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() ?? "");
3214 }
3215 if (pos.matFloor.alias == "snow" && EClass.rnd(3) == 0)
3216 {
3218 Msg.Say(Lang.GetList("walk_snow").RandomItem());
3219 }
3220 else if (EClass.world.weather.CurrentCondition == Weather.Condition.RainHeavy && EClass.rnd(3) == 0)
3221 {
3223 Msg.Say(Lang.GetList("walk_storm").RandomItem());
3224 }
3225 }
3227 }
3228 if (IsPCC)
3229 {
3230 int num6 = Mathf.Abs(cell2.topHeight - cell.topHeight);
3231 if ((num6 >= 3 && lastPos.sourceBlock.tileType.slopeHeight == 0 && newPoint.sourceBlock.tileType.slopeHeight == 0) || cell2.hasDoorBoat || cell.hasDoorBoat)
3232 {
3233 renderer.PlayAnime((cell2.topHeight >= cell.topHeight) ? AnimeID.JumpDown : ((num6 >= 6) ? AnimeID.Jump : AnimeID.JumpSmall));
3234 }
3235 else
3236 {
3237 float surfaceHeight = cell2.GetSurfaceHeight();
3238 float surfaceHeight2 = cell.GetSurfaceHeight();
3239 num6 = (int)Mathf.Abs((surfaceHeight - surfaceHeight2) * 100f);
3240 if (num6 >= 15)
3241 {
3242 renderer.PlayAnime((surfaceHeight >= surfaceHeight2) ? AnimeID.JumpDown : ((num6 >= 40) ? AnimeID.Jump : AnimeID.JumpSmall));
3243 }
3244 }
3245 }
3246 if (IsPC)
3247 {
3248 if (renderer.anime == null && renderer.replacer != null && renderer.replacer.pccData == null)
3249 {
3251 }
3253 {
3254 if (!FLOOR.IsTatami(pos.cell.sourceSurface.id) && pos.cell.room == null)
3255 {
3256 EClass.player.flags.isShoesOff = false;
3257 EClass.pc.Say("shoes_on", EClass.pc);
3258 EClass.pc.SetPCCState(PCCState.Normal);
3259 }
3260 }
3261 else if (FLOOR.IsTatami(pos.cell.sourceSurface.id) && pos.cell.room != null)
3262 {
3263 EClass.player.flags.isShoesOff = true;
3264 EClass.pc.Say("shoes_off", EClass.pc);
3265 EClass.pc.SetPCCState(PCCState.ShoesOff);
3266 }
3267 }
3268 bool flag7 = flag5 || EClass._zone.IsUnderwater;
3269 if (wasInWater != flag7)
3270 {
3271 wasInWater = flag7;
3272 RefreshSpeed();
3273 }
3274 lastPos.Things.ForeachReverse(delegate(Thing t)
3275 {
3276 t.trait.OnSteppedOut(this);
3277 });
3278 if (!IsPC)
3279 {
3280 pos.Things.ForeachReverse(delegate(Thing t)
3281 {
3282 t.trait.OnStepped(this);
3283 });
3284 }
3285 if (CanDestroyPath())
3286 {
3288 }
3289 if (!isDead)
3290 {
3291 if (Evalue(492) > 0 && EClass.rnd(10000 / (80 + Evalue(492) * 2)) == 0)
3292 {
3293 AddExp(Mathf.Clamp((int)Mathf.Sqrt(base.ExpToNext / 100), 1, 1000));
3294 }
3295 if (pos.IsBlocked && EClass.rnd(2) == 0)
3296 {
3297 stamina.Mod(-1);
3298 }
3299 }
3300 hasMovedThisTurn = true;
3301 return MoveResult.Success;
3302 }
AnimeID
Definition: AnimeID.cs:2
AttackSource
Definition: AttackSource.cs:2
ContainerFlag
Definition: ContainerFlag.cs:5
NameStyle
Definition: NameStyle.cs:2
AIAct Current
Definition: AIAct.cs:103
virtual bool PushChara
Definition: AIAct.cs:82
static void Search(Chara c, bool manual=false)
Definition: ActWait.cs:46
virtual bool isPCC
Definition: CardActor.cs:39
void PlayAnime(AnimeID id, bool force)
TransAnime anime
Definition: CardRenderer.cs:23
virtual void NextFrame()
CardActor actor
Definition: CardRenderer.cs:11
Definition: Card.cs:11
virtual string GetName(NameStyle style, int num=-1)
Definition: Card.cs:2732
bool IsDecayed
Definition: Card.cs:2341
virtual bool isThing
Definition: Card.cs:2133
int EvalueMax(int ele, int min=0)
Definition: Card.cs:2702
SourceMaterial.Row material
Definition: Card.cs:2103
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:6543
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:7103
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:4255
MoveResult
Definition: Card.cs:13
bool IsInstalled
Definition: Card.cs:2435
virtual Thing Thing
Definition: Card.cs:2110
int Evalue(int ele)
Definition: Card.cs:2688
int Dist(Card c)
Definition: Card.cs:8096
void ModExp(string alias, int a)
Definition: Card.cs:2765
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:3100
bool HasElement(int ele, bool includeNagative=false)
Definition: Card.cs:6285
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:7221
Definition: Cell.cs:7
SourceBlock.Row sourceBlock
Definition: Cell.cs:1062
bool IsSnowTile
Definition: Cell.cs:790
bool hasDoorBoat
Definition: Cell.cs:506
bool HasBridge
Definition: Cell.cs:679
bool isClearSnow
Definition: Cell.cs:458
bool isFloating
Definition: Cell.cs:482
SourceMaterial.Row matObj
Definition: Cell.cs:1046
byte topHeight
Definition: Cell.cs:86
SourceMaterial.Row matFloor
Definition: Cell.cs:1040
byte obj
Definition: Cell.cs:40
SourceObj.Row sourceObj
Definition: Cell.cs:1084
bool HasRamp
Definition: Cell.cs:845
bool hasDoor
Definition: Cell.cs:266
SourceFloor.Row sourceSurface
Definition: Cell.cs:1069
float GetSurfaceHeight()
Definition: Cell.cs:1730
bool CanSuffocate()
Definition: Cell.cs:1123
Definition: Chara.cs:10
void TickConditions()
Definition: Chara.cs:3806
bool wasInWater
Definition: Chara.cs:150
bool IsLevitating
Definition: Chara.cs:603
AIAct ai
Definition: Chara.cs:206
override bool IsPC
Definition: Chara.cs:630
bool isDrunk
Definition: Chara.cs:126
Party party
Definition: Chara.cs:43
bool CanDestroyPath()
Definition: Chara.cs:2546
bool IsInCombat
Definition: Chara.cs:887
bool HasCondition(string alias)
Definition: Chara.cs:9803
AIAct SetAI(AIAct g)
Definition: Chara.cs:9262
bool IsIdle
Definition: Chara.cs:876
override bool IsDisabled
Definition: Chara.cs:591
bool hasMovedThisTurn
Definition: Chara.cs:180
override bool isSynced
Definition: Chara.cs:709
bool CanMoveTo(Point p, bool allowDestroyPath=true)
Definition: Chara.cs:2559
void DestroyPath(Point pos)
Definition: Chara.cs:3304
override bool IsPCFaction
Definition: Chara.cs:689
float actTime
Definition: Chara.cs:182
override int MaxHP
Definition: Chara.cs:726
Zone currentZone
Definition: Chara.cs:259
bool CanReplace(Chara c)
Definition: Chara.cs:3415
new Point lastPos
Definition: Chara.cs:90
void MoveByForce(Point newPoint, Card c=null, bool checkWall=false)
Definition: Chara.cs:2744
Stats stamina
Definition: Chara.cs:1181
Stats burden
Definition: Chara.cs:1179
Chara parasite
Definition: Chara.cs:30
Chara ride
Definition: Chara.cs:27
void RefreshSpeed(Element.BonusInfo info=null)
Definition: Chara.cs:1954
MoveResult TryMoveTowards(Point p)
Definition: Chara.cs:2752
void SyncRide()
Definition: Chara.cs:4076
bool isDead
Definition: Chara.cs:393
override void LookAt(Card c)
Definition: Chara.cs:3670
bool isConfused
Definition: Chara.cs:128
override bool IsPCC
Definition: Chara.cs:700
void TryPush(Point point)
Definition: Chara.cs:3348
void SetPCCState(PCCState state)
Definition: Chara.cs:6917
SourceRace.Row race
Definition: Chara.cs:468
bool allyKeepDistance
Definition: ConfigTactics.cs:6
static Game game
Definition: EClass.cs:9
static Scene scene
Definition: EClass.cs:31
static Zone _zone
Definition: EClass.cs:21
static World world
Definition: EClass.cs:41
static Map _map
Definition: EClass.cs:19
static int rnd(long a)
Definition: EClass.cs:59
static BaseGameScreen screen
Definition: EClass.cs:33
static int rndHalf(int a)
Definition: EClass.cs:97
static Player player
Definition: EClass.cs:13
static int sqrt(int a)
Definition: EClass.cs:88
static GameSetting setting
Definition: EClass.cs:35
Definition: EInput.cs:8
static void Consume(int _skipFrame)
Definition: EInput.cs:667
Definition: Effect.cs:7
static Effect Get(Effect original)
Definition: Effect.cs:80
void Play(float delay, Point from, float fixY=0f, Point to=null, Sprite sprite=null)
Definition: Effect.cs:100
Zone zone
Definition: EloMap.cs:11
Cell GetCell(Point pos)
Definition: EloMap.cs:272
Definition: FLOOR.cs:2
static SourceFloor.Row sourceSnow
Definition: FLOOR.cs:31
static SourceFloor.Row sourceIce
Definition: FLOOR.cs:35
static bool IsTatami(int id)
Definition: FLOOR.cs:39
static SourceFloor.Row sourceWood
Definition: FLOOR.cs:37
void AdvanceMin(int a)
Definition: GameDate.cs:22
float defaultActPace
Definition: GameSetting.cs:329
RenderSetting render
Definition: GameSetting.cs:303
ConfigTactics tactics
Definition: Game.cs:91
Config config
Definition: Game.cs:219
Definition: Lang.cs:7
static string[] GetList(string id)
Definition: Lang.cs:117
static SourceMaterial.Row sourceOak
Definition: MATERIAL.cs:47
static SourceMaterial.Row sourceSnow
Definition: MATERIAL.cs:41
static SourceMaterial.Row sourceIce
Definition: MATERIAL.cs:43
void MoveCard(Point p, Card t)
Definition: Map.cs:853
void SetFoormark(Point pos, int id, int angle, int offset=0)
Definition: Map.cs:2086
void SetEffect(int x, int z, CellEffect effect=null)
Definition: Map.cs:1534
Color Ono
Definition: MsgColors.cs:13
Definition: Msg.cs:5
static MsgColors colors
Definition: Msg.cs:20
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
static void SetColor()
Definition: Msg.cs:22
Definition: NoGoal.cs:4
int emitFoot
Definition: PCOrbit.cs:9
int emitSmoke
Definition: PCOrbit.cs:11
Vector3 smokePos
Definition: PCOrbit.cs:15
Vector3 footPos
Definition: PCOrbit.cs:13
List< Chara > members
Definition: Party.cs:19
bool isShoesOff
Definition: Player.cs:376
int distanceTravel
Definition: Player.cs:960
Flags flags
Definition: Player.cs:1161
Window.SaveData dataPick
Definition: Player.cs:1101
bool regionMoveWarned
Definition: Player.cs:1227
Definition: Point.cs:9
SourceMaterial.Row matFloor
Definition: Point.cs:57
SourceBlock.Row sourceBlock
Definition: Point.cs:63
List< Card > ListCards(bool includeMasked=false)
Definition: Point.cs:1057
Point Set(int _x, int _z)
Definition: Point.cs:503
bool IsBlocked
Definition: Point.cs:363
List< Thing > Things
Definition: Point.cs:338
int x
Definition: Point.cs:36
int z
Definition: Point.cs:39
List< Chara > Charas
Definition: Point.cs:340
bool HasThing
Definition: Point.cs:251
List< Chara > ListCharas()
Definition: Point.cs:1177
SourceFloor.Row sourceFloor
Definition: Point.cs:65
bool HasObj
Definition: Point.cs:137
int Distance(Point p)
Definition: Point.cs:995
Cell cell
Definition: Point.cs:51
Point GetRandomNeighbor()
Definition: Point.cs:764
bool HasChara
Definition: Point.cs:238
TileType tileType
Definition: RenderRow.cs:77
Definition: Scene.cs:8
ParticleSystem psSmoke
Definition: Scene.cs:113
ParticleSystem psFoot
Definition: Scene.cs:111
EloMap elomap
Definition: Scene.cs:149
bool Surface
Definition: SourcePref.cs:330
virtual bool ShowDangerLv
Definition: Spatial.cs:503
virtual bool IsRegion
Definition: Spatial.cs:515
virtual string Name
Definition: Spatial.cs:509
SourceZone.Row source
Definition: Spatial.cs:453
List< Spatial > children
Definition: Spatial.cs:37
virtual void Mod(int a)
Definition: Stats.cs:135
override int GetPhase()
Definition: Stats.cs:117
Definition: Thing.cs:8
override SourcePref Pref
Definition: Thing.cs:50
bool ignoreSnow
Definition: TileRow.cs:6
string soundFoot
Definition: TileRow.cs:14
virtual bool IsWater
Definition: TileType.cs:169
virtual void OnSteppedOut(Chara c)
Definition: Trait.cs:1192
virtual bool IsChangeFloorHeight
Definition: Trait.cs:74
virtual void OnStepped(Chara c)
Definition: Trait.cs:1188
Card owner
Definition: Trait.cs:28
Definition: Util.cs:10
static float GetAngle(Vector3 self, Vector3 target)
Definition: Util.cs:121
Condition
Definition: Weather.cs:16
Condition CurrentCondition
Definition: Weather.cs:79
FilterResult IsFilterPass(string text)
Definition: Window.cs:498
ContainerFlag flag
Definition: Window.cs:267
HashSet< int > cats
Definition: Window.cs:119
bool userFilter
Definition: Window.cs:132
bool noRotten
Definition: Window.cs:439
bool advDistribution
Definition: Window.cs:427
Definition: Window.cs:13
GameDate date
Definition: World.cs:6
Weather weather
Definition: World.cs:12
virtual bool PetFollow
Definition: Zone.cs:291
override int DangerLv
Definition: Zone.cs:112
bool IsPCFaction
Definition: Zone.cs:477
virtual bool IsUnderwater
Definition: Zone.cs:273
virtual bool KeepAllyDistance
Definition: Zone.cs:306
virtual bool HiddenInRegionMap
Definition: Zone.cs:417
Map map
Definition: Zone.cs:63

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

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

◆ _ShowDialog()

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

Definition at line 7513 of file Chara.cs.

7514 {
7515 EClass.Sound.Play("pop_drama");
7516 if (book == "_chara" && IsPC)
7517 {
7518 step = "pc";
7519 }
7520 if (id == "lomias")
7521 {
7523 }
7524 return LayerDrama.Activate(book, sheet, step, this, null, tag);
7525 }
ID_Achievement
static SoundManager Sound
Definition: EClass.cs:47
static LayerDrama Activate(string book, string idSheet, string idStep, Chara target=null, Card ref1=null, string tag="")
Definition: LayerDrama.cs:66
Definition: Steam.cs:10
static void GetAchievement(ID_Achievement id)
Definition: Steam.cs:51

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

◆ AddCondition() [1/2]

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

Definition at line 9647 of file Chara.cs.

9648 {
9649 c.owner = this;
9650 if (!(c is ConBurning))
9651 {
9652 if (c is ConBleed && ResistLv(964) >= 3)
9653 {
9654 return null;
9655 }
9656 }
9657 else if (ResistLv(950) >= 3)
9658 {
9659 return null;
9660 }
9662 {
9663 if (c.GainResistFactor >= 400)
9664 {
9665 c.power /= 2;
9666 }
9667 ResistCon(c);
9668 if (c.power <= 0)
9669 {
9670 return null;
9671 }
9672 }
9673 if (!force)
9674 {
9675 if (c.source.negate.Length != 0)
9676 {
9677 string[] negate = c.source.negate;
9678 foreach (string text in negate)
9679 {
9680 if (HasElement(text))
9681 {
9682 return null;
9683 }
9684 }
9685 }
9686 Element defenseAttribute = c.GetDefenseAttribute(this);
9687 if (defenseAttribute != null)
9688 {
9689 c.power = 100 * c.power / Mathf.Max(100 + defenseAttribute.Value, 1);
9690 }
9691 if (c.source.resistance.Length != 0)
9692 {
9693 int num = ResistLv(EClass.sources.elements.alias[c.source.resistance[0]].id);
9694 if (num > 0)
9695 {
9696 c.power /= num * num + 1;
9697 if (c.power <= 40)
9698 {
9699 return null;
9700 }
9701 }
9702 }
9703 c.power = c.EvaluatePower(c.power);
9704 if (c.power <= 0)
9705 {
9706 return null;
9707 }
9708 }
9709 int num2 = c.EvaluateTurn(c.power);
9710 if (num2 == 0)
9711 {
9712 return null;
9713 }
9714 for (int j = 0; j < conditions.Count; j++)
9715 {
9716 if (conditions[j].id != c.id)
9717 {
9718 continue;
9719 }
9720 if (c.Type == ConditionType.Stance || c.IsToggle)
9721 {
9722 conditions[j].Kill();
9723 return null;
9724 }
9725 if (conditions[j].CanStack(c))
9726 {
9727 if (conditions[j].ShouldOverride(c))
9728 {
9729 if (conditions[j].IsOverrideConditionMet(c, num2))
9730 {
9731 conditions[j].Kill(silent: true);
9732 continue;
9733 }
9734 return null;
9735 }
9736 if (CanGainConResist)
9737 {
9738 AddResistCon(c);
9739 }
9740 conditions[j].OnStacked(c.power);
9741 conditions[j].OnStartOrStack();
9742 conditions[j].PlayEffect();
9743 }
9744 if (!conditions[j].AllowMultipleInstance)
9745 {
9746 return null;
9747 }
9748 }
9749 foreach (Condition condition in conditions)
9750 {
9751 if (condition.TryNullify(c))
9752 {
9753 return null;
9754 }
9755 }
9756 c.value = num2;
9757 conditions.Add(c);
9758 if (CanGainConResist)
9759 {
9760 AddResistCon(c);
9761 }
9762 c.SetOwner(this);
9763 c.Start();
9764 SetDirtySpeed();
9765 if (c.ShouldRefresh)
9766 {
9767 Refresh();
9768 }
9769 if (c.CancelAI)
9770 {
9771 ai.Cancel();
9772 }
9773 if (IsPC && c.ConsumeTurn && !EClass.pc.isRestrained)
9774 {
9776 }
9777 if (c.SyncRide && (ride != null || parasite != null))
9778 {
9779 if (ride != null)
9780 {
9782 }
9783 if (parasite != null)
9784 {
9786 }
9787 }
9788 return c;
9789 }
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:6280
void SetDirtySpeed()
Definition: Chara.cs:1945
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:9642
bool CanGainConResist
Definition: Chara.cs:1196
void AddResistCon(Condition con)
Definition: Chara.cs:10056
void ResistCon(Condition con)
Definition: Chara.cs:10076
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:297
void EndTurn(bool consume=true)
Definition: Player.cs:2153
SourceElement elements

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

◆ AddCondition() [2/2]

◆ AddCondition< T >()

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

Definition at line 9637 of file Chara.cs.

9637 : Condition
9638 {
9639 return AddCondition(typeof(T).Name, p, force);
9640 }
string Name
Definition: Card.cs:2191

◆ AddCooldown()

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

Definition at line 9043 of file Chara.cs.

9044 {
9045 if (_cooldowns == null)
9046 {
9047 _cooldowns = new List<int>();
9048 }
9049 if (turns != 0)
9050 {
9051 _cooldowns.Add(idEle * 1000 + turns);
9052 return;
9053 }
9054 SourceElement.Row row = EClass.sources.elements.map[idEle];
9055 if (row.cooldown > 0)
9056 {
9057 _cooldowns.Add(idEle * 1000 + row.cooldown);
9058 }
9059 }
List< int > _cooldowns
Definition: Chara.cs:58

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

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

◆ AddFoodHistory()

void Chara.AddFoodHistory ( Thing  food)
inline

Definition at line 10546 of file Chara.cs.

10547 {
10548 if (!IsPCFaction || !IsGlobal)
10549 {
10550 _historyFood = null;
10551 return;
10552 }
10553 if (_historyFood == null)
10554 {
10555 _historyFood = new List<List<string>>
10556 {
10557 new List<string>()
10558 };
10559 }
10560 if (_historyFood[0].Count < 5)
10561 {
10562 _historyFood[0].Add(food.id);
10563 }
10564 }
override bool IsGlobal
Definition: Chara.cs:628
List< List< string > > _historyFood
Definition: Chara.cs:64

References food.

Referenced by FoodEffect.Proc().

◆ AddHobby()

void Chara.AddHobby ( int  id)
inline

Definition at line 9462 of file Chara.cs.

9463 {
9464 foreach (int hobby in _hobbies)
9465 {
9466 if (hobby == id)
9467 {
9468 return;
9469 }
9470 }
9471 _hobbies.Add(id);
9472 }
List< int > _hobbies
Definition: Chara.cs:49

◆ AddRandomBodyPart()

void Chara.AddRandomBodyPart ( bool  msg = false)
inline

Definition at line 2290 of file Chara.cs.

2291 {
2292 int ele = new int[9] { 30, 31, 33, 35, 35, 36, 34, 37, 39 }.RandomItem();
2293 body.AddBodyPart(ele);
2294 if (msg)
2295 {
2296 Say("gain_bodyparts", this, Element.Get(ele).GetName().ToLower());
2297 PlaySound("offering");
2298 }
2299 }
void AddBodyPart(int ele, Thing thing=null)
Definition: CharaBody.cs:283
CharaBody body
Definition: Chara.cs:94
static SourceElement.Row Get(int id)
Definition: ELEMENT.cs:406

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

Referenced by Feat.Apply().

◆ AddResistCon()

void Chara.AddResistCon ( Condition  con)
inline

Definition at line 10056 of file Chara.cs.

10057 {
10058 if (con.power > 0 && con.GainResistFactor > 0)
10059 {
10060 int key = con.id;
10061 if (resistCon == null)
10062 {
10063 resistCon = new Dictionary<int, int>();
10064 }
10065 if (resistCon.ContainsKey(key))
10066 {
10067 resistCon[key] += con.power * con.GainResistFactor / 100;
10068 }
10069 else
10070 {
10071 resistCon[key] = con.power * con.GainResistFactor / 100;
10072 }
10073 }
10074 }
Dictionary< int, int > resistCon
Definition: Chara.cs:218

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

◆ AddWork()

void Chara.AddWork ( int  id)
inline

Definition at line 9474 of file Chara.cs.

9475 {
9476 foreach (int work in _works)
9477 {
9478 if (work == id)
9479 {
9480 return;
9481 }
9482 }
9483 _works.Add(id);
9484 }
List< int > _works
Definition: Chara.cs:52

◆ ApplyDeathPenalty()

void Chara.ApplyDeathPenalty ( )
inline

Definition at line 5434 of file Chara.cs.

5435 {
5436 if (!IsPC)
5437 {
5438 return;
5439 }
5440 int currency = GetCurrency();
5441 if (currency > 0)
5442 {
5443 int num = currency / 3 + EClass.rnd(currency / 3 + 1);
5444 if (num <= 0)
5445 {
5446 num = 1;
5447 }
5448 Msg.Say("panaltyMoney", this, Lang._currency(num));
5449 ModCurrency(-num);
5451 }
5452 foreach (Element value in EClass.pc.elements.dict.Values)
5453 {
5454 if (EClass.rnd(5) == 0 && value.IsMainAttribute)
5455 {
5456 EClass.pc.elements.ModExp(value.id, -500f);
5457 }
5458 }
5459 }
@ currency
ElementContainerCard elements
Definition: Card.cs:42
int GetCurrency(string id="money")
Definition: Card.cs:4133
void ModCurrency(int a, string id="money")
Definition: Card.cs:4119
void ModExp(int ele, float a, bool chain=false)
Dictionary< int, Element > dict
int id
Definition: ELEMENT.cs:255
bool IsMainAttribute
Definition: ELEMENT.cs:388
static string _currency(object a, string IDCurrency)
Definition: Lang.cs:165
static Thing CreateCurrency(int a, string id="money")
Definition: ThingGen.cs:37
Card AddCard(Card t, Point point)
Definition: Zone.cs:2066

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

2126 {
2127 switch (tag)
2128 {
2129 case EditorTag.HostilityNeutral:
2130 {
2131 Hostility hostility2 = (base.c_originalHostility = Hostility.Neutral);
2132 this.hostility = hostility2;
2133 break;
2134 }
2135 case EditorTag.HostilityEnemy:
2136 {
2137 Hostility hostility2 = (base.c_originalHostility = Hostility.Enemy);
2138 this.hostility = hostility2;
2139 break;
2140 }
2141 case EditorTag.HostilityFriend:
2142 {
2143 Hostility hostility2 = (base.c_originalHostility = Hostility.Friend);
2144 this.hostility = hostility2;
2145 break;
2146 }
2147 case EditorTag.Male:
2148 bio.SetGender(2);
2149 base.c_idPortrait = Portrait.GetRandomPortrait(2, GetIdPortraitCat());
2150 break;
2151 case EditorTag.Female:
2152 bio.SetGender(1);
2153 base.c_idPortrait = Portrait.GetRandomPortrait(1, GetIdPortraitCat());
2154 break;
2155 case EditorTag.baby:
2156 SetFeat(1232);
2157 break;
2158 }
2159 base.ApplyEditorTags(tag);
2160 }
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:10281
string GetIdPortraitCat()
Definition: Chara.cs:8463
static string GetRandomPortrait(string idDict)
Definition: Portrait.cs:105

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

◆ ApplyJob()

void Chara.ApplyJob ( bool  remove = false)
inline

Definition at line 2252 of file Chara.cs.

2253 {
2254 elements.ApplyElementMap(base.uid, SourceValueType.Chara, job.elementMap, base.DefaultLV, remove, applyFeat: true);
2255 if (IsPCC)
2256 {
2257 EClass.game.uniforms.Apply(pccData, job.id, base.IsMale, canUseOtherGender: true);
2258 }
2259 }
SourceValueType
SourceJob.Row job
Definition: Chara.cs:470
void ApplyElementMap(int uid, SourceValueType type, Dictionary< int, int > map, int lv, bool invert=false, bool applyFeat=false)
PCCUniformManager uniforms
Definition: Game.cs:195

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

Referenced by ChangeJob(), and OnCreate().

◆ ApplyRace()

void Chara.ApplyRace ( bool  remove = false)
inline

Definition at line 2338 of file Chara.cs.

2339 {
2340 string[] array = race.figure.Split('|');
2341 foreach (string s in array)
2342 {
2343 int num = ParseBodySlot(s);
2344 if (num != -1)
2345 {
2346 if (remove)
2347 {
2348 body.RemoveBodyPart(num);
2349 }
2350 else
2351 {
2352 body.AddBodyPart(num);
2353 }
2354 }
2355 }
2357 elements.ApplyElementMap(base.uid, SourceValueType.Chara, race.elementMap, base.DefaultLV, remove, applyFeat: true);
2358 if (remove)
2359 {
2360 if (HasElement(1423))
2361 {
2362 SetFeat(1423, 0);
2363 }
2364 return;
2365 }
2366 bool flag = id == "chara" || id == "player";
2367 if (race.id == "bike" && id != "bike_cub")
2368 {
2369 SetFeat(1423, flag ? 10 : (1 + EClass.rnd(10)));
2370 }
2371 if (id == "moa")
2372 {
2373 SetFeat(1423, flag ? 7 : (1 + EClass.rnd(7)));
2374 }
2375 if (race.id == "horse" && EClass.rnd(5) == 0)
2376 {
2377 SetFeat(1423, flag ? 5 : (1 + EClass.rnd(5)));
2378 }
2379 }
void RefreshBodyParts()
Definition: CharaBody.cs:309
void RemoveBodyPart(int ele)
Definition: CharaBody.cs:338
int ParseBodySlot(string s)
Definition: Chara.cs:2273

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

2451 {
2452 owner?.Say("summon_vanish", this);
2453 pos.PlayEffect("vanish");
2454 pos.PlaySound("vanish");
2455 pos.PlayEffect("teleport");
2456 Destroy();
2457 }
void Destroy()
Definition: Card.cs:5268
SoundSource PlaySound(string id, bool synced=true, float v=1f, bool spatial=true)
Definition: Point.cs:1259
Effect PlayEffect(string id)
Definition: Point.cs:1254

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

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

◆ BanishAllMinions()

void Chara.BanishAllMinions ( )
inline

Definition at line 2487 of file Chara.cs.

2488 {
2489 List<Chara> list = new List<Chara>();
2490 foreach (Chara chara in EClass._map.charas)
2491 {
2492 if (chara.IsMinion && chara.master == this)
2493 {
2494 list.Add(chara);
2495 }
2496 }
2497 foreach (Chara item in list)
2498 {
2499 item.Banish(this);
2500 }
2501 }
override bool IsMinion
Definition: Chara.cs:645
Chara master
Definition: Chara.cs:88
List< Chara > charas
Definition: Map.cs:81

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

◆ CalcBurden()

void Chara.CalcBurden ( )
inline

Definition at line 1913 of file Chara.cs.

1914 {
1915 int num = base.ChildrenWeight * 100 / Mathf.Max(1, WeightLimit);
1916 if (num < 0)
1917 {
1918 num = 1000;
1919 }
1921 {
1922 num = 0;
1923 }
1924 burden.Set(num);
1925 SetDirtySpeed();
1926 }
override int WeightLimit
Definition: Chara.cs:728
bool ignoreWeight
Definition: CoreDebug.cs:202
static CoreDebug debug
Definition: EClass.cs:49
Stats Set(int[] _raw, int _rawIndex, Chara _CC)
Definition: Stats.cs:109

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

Referenced by Scene.OnUpdate().

◆ CalcCastingChance()

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

Definition at line 6353 of file Chara.cs.

6354 {
6355 if (!(e is Spell))
6356 {
6357 return 100;
6358 }
6359 if (!IsPC)
6360 {
6361 int num2 = 95;
6362 if (host != null)
6363 {
6364 if (host.ride == this)
6365 {
6366 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.EvalueRiding()));
6367 }
6368 if (host.parasite == this)
6369 {
6370 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.Evalue(227)));
6371 }
6372 }
6373 return num2;
6374 }
6375 int num3 = Evalue(304);
6376 if (!IsPCFaction)
6377 {
6378 num3 = Mathf.Max(num3, base.LV + 5);
6379 }
6380 int num4 = 0;
6381 int num5 = 0;
6382 bool num6 = GetArmorSkill() == 122;
6383 AttackStyle attackStyle = body.GetAttackStyle();
6384 if (num6)
6385 {
6386 num4 = 20 - Evalue(122) / 5;
6387 num5 += 10 - Evalue(1654) * 4;
6388 }
6389 else
6390 {
6391 num4 = 10 - Evalue(120) / 5;
6392 }
6393 if (num4 < 5)
6394 {
6395 num4 = 5;
6396 }
6397 if (ride != null)
6398 {
6399 num4 += 5;
6400 }
6401 if (parasite != null)
6402 {
6403 num4 += 10;
6404 }
6405 if (attackStyle == AttackStyle.TwoWield)
6406 {
6407 num4 += 5;
6408 }
6409 if (attackStyle == AttackStyle.Shield)
6410 {
6411 num4 += 10;
6412 num5 += 20 - Evalue(1654) * 8;
6413 }
6414 if (isConfused)
6415 {
6416 num4 += 10000;
6417 }
6418 if (HasCondition<ConDim>())
6419 {
6420 num4 += ((Evalue(1654) >= 3) ? 1500 : 2500);
6421 }
6422 if (num > 1)
6423 {
6424 num4 += 5 * num;
6425 }
6426 if (num5 < 0)
6427 {
6428 num5 = 0;
6429 }
6430 return Mathf.Clamp(100 + e.Value - 10 - e.source.LV * e.source.cost[0] * num4 / Mathf.Max(10 + num3 * 10, 1), 0, 100 - num5);
6431 }
AttackStyle
Definition: AttackStyle.cs:2
AttackStyle GetAttackStyle()
Definition: CharaBody.cs:479
override int GetArmorSkill()
Definition: Chara.cs:8166
int EvalueRiding()
Definition: Chara.cs:6344
SourceElement.Row source
Definition: ELEMENT.cs:278
Definition: SPELL.cs:630

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

Referenced by Element._WriteNote().

◆ CalculateMaxStamina()

void Chara.CalculateMaxStamina ( )
inline

Definition at line 2106 of file Chara.cs.

2107 {
2108 int num = base.END;
2109 int num2 = 0;
2110 foreach (Element value in elements.dict.Values)
2111 {
2112 if (value.source.category == "skill")
2113 {
2114 num = ((!IsPC) ? (num + Mathf.Max(value.ValueWithoutLink, 0)) : (num + Mathf.Max(value.vBase, 0)));
2115 }
2116 }
2117 num2 = EClass.curve(num, 30, 10, 60);
2118 if (num2 < 10)
2119 {
2120 num2 = 10;
2121 }
2122 _maxStamina = num2 + 15;
2123 }
int _maxStamina
Definition: Chara.cs:369
static int curve(long _a, int start, int step, int rate=75)
Definition: EClass.cs:69
int ValueWithoutLink
Definition: ELEMENT.cs:299
int vBase
Definition: ELEMENT.cs:257

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

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

◆ CallHelp()

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

Definition at line 6659 of file Chara.cs.

6660 {
6661 foreach (Chara chara in EClass._map.charas)
6662 {
6663 if (!chara.IsPCFaction && chara.OriginalHostility == OriginalHostility && (fanatic || Dist(chara) <= 6) && (EClass.rnd(3) != 0 || fanatic))
6664 {
6665 chara.GoHostile(tg);
6666 }
6667 }
6668 }
Hostility OriginalHostility
Definition: Chara.cs:475
void GoHostile(Card _tg)
Definition: Chara.cs:6553

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

8557 {
8558 if (things.IsFull())
8559 {
8560 return false;
8561 }
8562 if (t.c_isImportant)
8563 {
8564 return false;
8565 }
8566 if (t.id == "1084")
8567 {
8568 return true;
8569 }
8570 if (t.trait is TraitBookExp)
8571 {
8572 return true;
8573 }
8574 if (t.trait.CanOnlyCarry || !t.trait.CanBeDestroyed || t.trait.CanExtendBuild || t.rarity == Rarity.Artifact || t.IsContainer)
8575 {
8576 return false;
8577 }
8578 return true;
8579 }
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 bool CanExtendBuild
Definition: Trait.cs:181
virtual bool CanBeDestroyed
Definition: Trait.cs:307
virtual bool CanOnlyCarry
Definition: Trait.cs:305

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

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

◆ CanAcceptItem()

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

Definition at line 8535 of file Chara.cs.

8536 {
8538 {
8539 return true;
8540 }
8541 if (!IsValidGiftWeight(t, num))
8542 {
8543 return false;
8544 }
8545 if (!skipImportantCheck && t.c_isImportant)
8546 {
8547 return false;
8548 }
8549 if ((t.category.IsChildOf("furniture") || t.category.IsChildOf("junk")) && (!(t.trait is TraitFigure) || !HasElement(1427)) && !HasElement(1411))
8550 {
8551 return false;
8552 }
8553 return true;
8554 }
bool IsValidGiftWeight(Card t, int num=-1)
Definition: Chara.cs:8525

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

4418 {
4419 return true;
4420 }

◆ CanBeTempAlly()

bool Chara.CanBeTempAlly ( Chara  c)
inline

Definition at line 2437 of file Chara.cs.

2438 {
2439 if (IsPCFaction || IsGlobal || IsMinion || IsMultisize || EClass._zone.CountMinions(c) > c.MaxSummon || base.rarity >= Rarity.Legendary)
2440 {
2441 return false;
2442 }
2443 if (HasElement(1222))
2444 {
2445 return false;
2446 }
2447 return true;
2448 }
int MaxSummon
Definition: Chara.cs:732
override bool IsMultisize
Definition: Chara.cs:724
int CountMinions(Chara c)
Definition: Zone.cs:3850

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

9027 {
9028 if (IsPC || base.isScaled || HasElement(1273))
9029 {
9030 return false;
9031 }
9032 if (!EClass.debug.godMode)
9033 {
9034 if (base.c_daysWithPC > 360)
9035 {
9036 return affinity.CanSleepBeside();
9037 }
9038 return false;
9039 }
9040 return true;
9041 }
bool CanSleepBeside()
Definition: Affinity.cs:84
Affinity affinity
Definition: Chara.cs:318
bool godMode
Definition: CoreDebug.cs:188

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

Referenced by WindowCharaMini.Refresh().

◆ CanDestroyPath()

bool Chara.CanDestroyPath ( )
inline

Definition at line 2546 of file Chara.cs.

2547 {
2548 if (!IsMultisize)
2549 {
2550 if (base.rarity >= Rarity.Superior && !base.IsPCFactionOrMinion && ai is GoalCombat && !EClass._zone.IsPCFaction)
2551 {
2552 return !(EClass._zone is Zone_Town);
2553 }
2554 return false;
2555 }
2556 return true;
2557 }

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

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

◆ CanDuplicate()

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

Definition at line 1806 of file Chara.cs.

1807 {
1808 if (EClass._zone.IsRegion)
1809 {
1810 return false;
1811 }
1813 {
1814 return false;
1815 }
1816 if (corruption >= 100)
1817 {
1818 return false;
1819 }
1820 if (con != DuplicateCondition.Water && (HasCondition<ConPoison>() || HasCondition<ConConfuse>() || HasCondition<ConDim>() || HasCondition<ConParalyze>() || HasCondition<ConSleep>() || HasCondition<ConBurning>() || HasCondition<ConFreeze>() || HasCondition<ConMiasma>()))
1821 {
1822 return false;
1823 }
1824 switch (con)
1825 {
1826 case DuplicateCondition.Scarab:
1828 {
1829 return false;
1830 }
1831 break;
1832 case DuplicateCondition.SpiderEgg:
1833 if (pos.cell.light > 0 || pos.IsSunLit)
1834 {
1835 return false;
1836 }
1837 break;
1838 }
1839 return true;
1840 }
DuplicateCondition
byte light
Definition: Cell.cs:66
bool HasRoof
Definition: Cell.cs:656
int corruption
Definition: Chara.cs:381
int CurrentGeneSlot
Definition: Chara.cs:1106
bool IsNight
Definition: Date.cs:112
GamePrincipal principal
Definition: Game.cs:225
bool IsIndoor
Definition: Map.cs:131
bool IsSunLit
Definition: Point.cs:182

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

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

◆ CanEat()

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

Definition at line 7893 of file Chara.cs.

7894 {
7895 if (t.IsDecayed && !HasElement(480))
7896 {
7897 return false;
7898 }
7899 if (HasElement(1250) && !t.HasElement(710))
7900 {
7901 return false;
7902 }
7903 if (shouldEat && (!(t.trait is TraitFoodPrepared) || t.c_isImportant))
7904 {
7905 return false;
7906 }
7907 if (!t.IsNegativeGift && !t.HasTag(CTAG.ignoreUse) && !t.isEquipped)
7908 {
7909 return t.trait.CanEat(this);
7910 }
7911 return false;
7912 }
CTAG
Definition: CTAG.cs:2
bool IsNegativeGift
Definition: Card.cs:2450
bool HasTag(CTAG tag)
Definition: Card.cs:2712
bool isEquipped
Definition: Thing.cs:17
virtual bool CanEat(Chara c)
Definition: Trait.cs:1090

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

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

◆ CanEquipRanged()

bool Chara.CanEquipRanged ( Thing  t)
inline

Definition at line 8065 of file Chara.cs.

8066 {
8067 return !body.IsTooHeavyToEquip(t);
8068 }
bool IsTooHeavyToEquip(Thing thing)
Definition: CharaBody.cs:168

References CharaBody.IsTooHeavyToEquip().

Referenced by GoalAutoCombat.TryUseRanged().

◆ CanInsult()

bool Chara.CanInsult ( )
inline

Definition at line 8451 of file Chara.cs.

8452 {
8453 foreach (ActList.Item item in ability.list.items)
8454 {
8455 if (item.act.id == 6630)
8456 {
8457 return true;
8458 }
8459 }
8460 return false;
8461 }
List< Item > items
Definition: ActList.cs:14
ActList list
Definition: CharaAbility.cs:13
CharaAbility ability
Definition: Chara.cs:428

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

◆ CanInteractTo() [1/2]

bool Chara.CanInteractTo ( Card  c)
inline

Definition at line 2653 of file Chara.cs.

2654 {
2655 return CanInteractTo(c.pos);
2656 }
bool CanInteractTo(Card c)
Definition: Chara.cs:2653

References CanInteractTo(), and Card.pos.

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

◆ CanInteractTo() [2/2]

bool Chara.CanInteractTo ( Point  p)
inline

Definition at line 2658 of file Chara.cs.

2659 {
2660 if (!p.IsValid)
2661 {
2662 return false;
2663 }
2664 if (EClass._map.cells[p.x, p.z].blocked)
2665 {
2666 return true;
2667 }
2668 if (!IsMultisize)
2669 {
2670 int num = ((p.z >= pos.z) ? ((p.x > pos.x) ? 1 : ((p.z > pos.z) ? 2 : 3)) : 0);
2671 if (EClass._map.cells[pos.x, pos.z].weights[num] == 0)
2672 {
2673 return false;
2674 }
2675 if (p.x != pos.x && p.z != pos.z)
2676 {
2677 Cell[,] cells = EClass._map.cells;
2678 int x = p.x;
2679 int z = pos.z;
2680 int num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2681 if (cells[pos.x, pos.z].weights[num2] == 0)
2682 {
2683 return false;
2684 }
2685 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2686 if (cells[p.x, p.z].weights[num2] == 0)
2687 {
2688 return false;
2689 }
2690 x = pos.x;
2691 z = p.z;
2692 num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2693 if (cells[pos.x, pos.z].weights[num2] == 0)
2694 {
2695 return false;
2696 }
2697 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2698 if (cells[p.x, p.z].weights[num2] == 0)
2699 {
2700 return false;
2701 }
2702 }
2703 }
2704 return true;
2705 }
Cell[,] cells
Definition: Map.cs:85
bool IsValid
Definition: Point.cs:88

References EClass._map, Algorithms.WeightCell.blocked, Map.cells, IsMultisize, Point.IsValid, Card.pos, Algorithms.WeightCell.weights, Point.x, and Point.z.

◆ CanLift()

bool Chara.CanLift ( Card  c)
inline

Definition at line 4412 of file Chara.cs.

4413 {
4414 return true;
4415 }

Referenced by HotItemNoItem._TrySetAct().

◆ CanMoveTo()

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

Definition at line 2559 of file Chara.cs.

2560 {
2561 if (!p.IsValid)
2562 {
2563 return false;
2564 }
2565 int num = ((p.z >= pos.z) ? ((p.x > pos.x) ? 1 : ((p.z > pos.z) ? 2 : 3)) : 0);
2566 if (allowDestroyPath && CanDestroyPath())
2567 {
2568 if (!p.IsInBounds)
2569 {
2570 return false;
2571 }
2572 }
2573 else
2574 {
2576 {
2577 return false;
2578 }
2579 if (p.x != pos.x && p.z != pos.z)
2580 {
2581 Cell[,] cells = EClass._map.cells;
2582 int x = p.x;
2583 int z = pos.z;
2584 int num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2585 if (cells[pos.x, pos.z].weights[num2] == 0)
2586 {
2587 return false;
2588 }
2589 if (cells[x, z].blocked && (!IsAstralBody || cells[x, z].IsSky || EClass._zone.IsRegion))
2590 {
2591 return false;
2592 }
2593 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2594 if (cells[p.x, p.z].weights[num2] == 0)
2595 {
2596 return false;
2597 }
2598 x = pos.x;
2599 z = p.z;
2600 num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2601 if (cells[pos.x, pos.z].weights[num2] == 0)
2602 {
2603 return false;
2604 }
2605 if (cells[x, z].blocked && (!IsAstralBody || cells[x, z].IsSky || EClass._zone.IsRegion))
2606 {
2607 return false;
2608 }
2609 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2610 if (cells[p.x, p.z].weights[num2] == 0)
2611 {
2612 return false;
2613 }
2614 }
2615 }
2616 if (IsPC)
2617 {
2618 if (IsEnemyOnPath(p))
2619 {
2620 return false;
2621 }
2622 }
2623 else if (p.HasChara && !IsMultisize && !CanReplace(p.FirstChara))
2624 {
2625 return false;
2626 }
2627 return true;
2628 }
bool IsSky
Definition: Cell.cs:942
bool IsAstralBody
Definition: Chara.cs:506
bool IsEnemyOnPath(Point p, bool cancelAI=true)
Definition: Chara.cs:2630
bool Contains(int dx, int dz)
Definition: MapBounds.cs:38
MapBounds bounds
Definition: Map.cs:52
Chara FirstChara
Definition: Point.cs:288
bool IsInBounds
Definition: Point.cs:104

References EClass._map, EClass._zone, Algorithms.WeightCell.blocked, Map.bounds, CanDestroyPath(), CanReplace(), Map.cells, MapBounds.Contains(), Point.FirstChara, Point.HasChara, IsAstralBody, IsEnemyOnPath(), Point.IsInBounds, IsMultisize, IsPC, Spatial.IsRegion, Cell.IsSky, Point.IsValid, Card.pos, Algorithms.WeightCell.weights, Point.x, and Point.z.

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

◆ CanPick()

bool Chara.CanPick ( Card  c)
inline

Definition at line 4422 of file Chara.cs.

4423 {
4424 if (c.isDestroyed)
4425 {
4426 return false;
4427 }
4428 Card rootCard = c.GetRootCard();
4429 if (rootCard.isDestroyed || (rootCard.ExistsOnMap && rootCard.pos.Distance(pos) > 1))
4430 {
4431 return false;
4432 }
4433 if (rootCard != this && things.IsFull(c.Thing))
4434 {
4435 return false;
4436 }
4437 return true;
4438 }
bool isDestroyed
Definition: Card.cs:78
bool ExistsOnMap
Definition: Card.cs:2137
Card GetRootCard()
Definition: Card.cs:3584

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

3416 {
3418 {
3419 return false;
3420 }
3421 if (IsPC)
3422 {
3423 return true;
3424 }
3425 if (c.IsPC || c.pos.Equals(EClass.pc.pos) || c.host != null)
3426 {
3427 return false;
3428 }
3429 if (!IsHostile(c))
3430 {
3431 if (c.c_uidMaster != 0 || c.isSummon || base.IsPowerful || IsEscorted())
3432 {
3433 return true;
3434 }
3435 if (DestDist < c.DestDist)
3436 {
3437 return true;
3438 }
3439 if (IsPCParty && !c.IsPCParty)
3440 {
3441 return true;
3442 }
3443 if (IsPCFaction && !c.IsPCParty)
3444 {
3445 return true;
3446 }
3447 }
3448 return false;
3449 }
bool IsPCFactionOrMinion
Definition: Card.cs:2326
bool isSummon
Definition: Card.cs:713
int c_uidMaster
Definition: Card.cs:1489
bool noMove
Definition: Card.cs:773
new TraitChara trait
Definition: Chara.cs:509
override bool IsPCParty
Definition: Chara.cs:633
int DestDist
Definition: Chara.cs:1021
bool IsHostile()
Definition: Chara.cs:6758
bool IsEscorted()
Definition: Chara.cs:2530
bool Equals(int _x, int _z)
Definition: Point.cs:966
virtual bool CanBePushed
Definition: TraitChara.cs:114

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

5303 {
5304 return EClass.world.date.IsExpired(base.c_dateDeathLock);
5305 }
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 1253 of file Chara.cs.

1254 {
1255 if (c == this)
1256 {
1257 return true;
1258 }
1259 if (!c.pos.IsValid)
1260 {
1261 return false;
1262 }
1263 if (c.isChara)
1264 {
1266 {
1267 return true;
1268 }
1269 if (c.isHidden && c != this && !canSeeInvisible)
1270 {
1271 return false;
1272 }
1273 }
1274 if (IsPC)
1275 {
1276 if (fov != null)
1277 {
1278 return fov.lastPoints.ContainsKey(c.pos.index);
1279 }
1280 return false;
1281 }
1282 return true;
1283 }
virtual Chara Chara
Definition: Card.cs:2122
Fov fov
Definition: Card.cs:58
virtual bool isChara
Definition: Card.cs:2135
bool isHidden
Definition: Card.cs:533
bool canSeeInvisible
Definition: Chara.cs:140
bool visibleWithTelepathy
Definition: Chara.cs:152
bool hasTelepathy
Definition: Chara.cs:142
Dictionary< int, byte > lastPoints
Definition: Fov.cs:36
int index
Definition: Point.cs:49

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

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

◆ CanSeeLos() [1/2]

◆ CanSeeLos() [2/2]

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

Definition at line 1294 of file Chara.cs.

1295 {
1296 if (dist == -1)
1297 {
1298 dist = pos.Distance(p);
1299 }
1300 if (dist > GetSightRadius())
1301 {
1302 return false;
1303 }
1304 if (IsPC)
1305 {
1306 if (fov != null)
1307 {
1308 return fov.lastPoints.ContainsKey(p.index);
1309 }
1310 return false;
1311 }
1312 if ((pos.IsBlocked || p.IsBlocked) && dist <= 1)
1313 {
1314 return true;
1315 }
1316 return Los.IsVisible(pos, p);
1317 }
int GetSightRadius()
Definition: Card.cs:6797
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 1236 of file Chara.cs.

1237 {
1238 if (!p.IsValid || p.IsHidden)
1239 {
1240 return false;
1241 }
1242 if (IsPC)
1243 {
1244 if (fov != null)
1245 {
1246 return fov.lastPoints.ContainsKey(p.index);
1247 }
1248 return false;
1249 }
1250 return true;
1251 }
bool IsHidden
Definition: Point.cs:347

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

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

◆ CanSleep()

bool Chara.CanSleep ( )
inline

Definition at line 1338 of file Chara.cs.

1339 {
1340 if (EClass._zone.events.GetEvent<ZoneEventQuest>() != null)
1341 {
1342 return false;
1343 }
1344 if (!EClass.debug.godMode && sleepiness.GetPhase() == 0)
1345 {
1346 return stamina.GetPhase() <= 1;
1347 }
1348 return true;
1349 }
Stats sleepiness
Definition: Chara.cs:1191
ZoneEventManager events
Definition: Zone.cs:40

References EClass._zone, EClass.debug, Zone.events, Stats.GetPhase(), CoreDebug.godMode, sleepiness, and stamina.

Referenced by AI_Sleep.OnProgressComplete(), HotItemActionSleep.Perform(), and AI_PassTime.Run().

◆ ChangeJob()

void Chara.ChangeJob ( string  idNew)
inline

Definition at line 2261 of file Chara.cs.

2262 {
2263 ApplyJob(remove: true);
2264 base.c_idJob = idNew;
2265 _job = null;
2266 ApplyJob();
2267 if (IsPCC)
2268 {
2269 PCC.Get(pccData).Build();
2270 }
2271 }
void ApplyJob(bool remove=false)
Definition: Chara.cs:2252
SourceJob.Row _job
Definition: Chara.cs:166

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

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

◆ ChangeMemberType()

void Chara.ChangeMemberType ( FactionMemberType  type)
inline

Definition at line 7308 of file Chara.cs.

7309 {
7310 memberType = type;
7311 }
FactionMemberType memberType
Definition: Chara.cs:46

◆ ChangeRace()

void Chara.ChangeRace ( string  idNew)
inline

Definition at line 2381 of file Chara.cs.

2382 {
2383 ApplyRace(remove: true);
2384 base.c_idRace = idNew;
2385 _race = null;
2386 ApplyRace();
2387 ChangeMaterial(source.defMat.IsEmpty(race.material));
2388 }
@ ChangeMaterial
void ApplyRace(bool remove=false)
Definition: Chara.cs:2338
SourceRace.Row _race
Definition: Chara.cs:164

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

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

◆ ChangeRarity()

override void Chara.ChangeRarity ( Rarity  r)
inlinevirtual

Reimplemented from Card.

Definition at line 1453 of file Chara.cs.

1454 {
1455 if (r != base.rarity)
1456 {
1457 base.rarity = r;
1458 if (renderer != null && renderer.isSynced)
1459 {
1461 }
1462 base.hp = MaxHP;
1463 }
1464 }
void RefreshExtra()

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

Referenced by ZonePreEnterBout.Execute().

◆ ChooseNewGoal()

void Chara.ChooseNewGoal ( )
inline

Definition at line 9133 of file Chara.cs.

9134 {
9135 if (IsPC && EClass.AdvMode)
9136 {
9137 SetNoGoal();
9138 return;
9139 }
9140 if (IsPCParty || base.noMove)
9141 {
9142 SetAI(new GoalIdle());
9143 return;
9144 }
9145 if ((IsHomeMember() && IsInHomeZone()) || IsGuest())
9146 {
9147 Goal goalFromTimeTable = GetGoalFromTimeTable(EClass.world.date.hour);
9148 if (goalFromTimeTable != null)
9149 {
9150 SetAI(goalFromTimeTable);
9151 if (goalFromTimeTable is GoalWork)
9152 {
9153 goalFromTimeTable.Tick();
9154 }
9155 return;
9156 }
9157 }
9158 if (goalList.index == -2)
9159 {
9161 }
9162 SetAI(goalList.Next());
9163 }
Status Tick()
Definition: AIAct.cs:366
Goal GetGoalFromTimeTable(int hour)
Definition: Chara.cs:9165
GoalListType goalListType
Definition: Chara.cs:283
AIAct SetNoGoal()
Definition: Chara.cs:9257
bool IsHomeMember()
Definition: Chara.cs:6824
bool IsGuest()
Definition: Chara.cs:6849
GoalList goalList
Definition: Chara.cs:204
bool IsInHomeZone()
Definition: Chara.cs:6829
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 7600 of file Chara.cs.

7601 {
7602 if (map == null)
7603 {
7604 map = EClass._map;
7605 }
7606 foreach (Card item in map.props.installed.all)
7607 {
7608 if (item.trait is TraitBed traitBed && traitBed.IsHolder(this))
7609 {
7610 traitBed.RemoveHolder(this);
7611 }
7612 }
7613 }
PropsManager props
Definition: Map.cs:91
PropsInstalled installed
Definition: PropsManager.cs:8
PropSet all
Definition: Props.cs:8
bool IsHolder(Chara c)
Definition: TraitBed.cs:135

References EClass._map, TraitBed.IsHolder(), and item.

Referenced by FactionBranch.ChangeMemberType(), and FactionBranch.RemoveMemeber().

◆ ClearInventory()

void Chara.ClearInventory ( ClearInventoryType  type)
inline

Definition at line 8905 of file Chara.cs.

8906 {
8907 int num = 0;
8908 for (int num2 = things.Count - 1; num2 >= 0; num2--)
8909 {
8910 Thing thing = things[num2];
8911 if (ShouldThrowAway(thing, type))
8912 {
8913 num += thing.GetPrice(CurrencyType.Money, sell: true, PriceType.Default, this) * thing.Num;
8914 thing.Destroy();
8915 }
8916 }
8917 if (num > 0)
8918 {
8919 ModCurrency(num);
8920 if (type == ClearInventoryType.SellAtTown)
8921 {
8922 Msg.Say("party_sell", this, num.ToString() ?? "");
8923 PlaySound("pay");
8924 }
8925 }
8926 }
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:8800
override int GetPrice(CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
Definition: Thing.cs:829

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

Referenced by AI_Idle.Run().

◆ ClearTempElements()

void Chara.ClearTempElements ( )
inline

Definition at line 10760 of file Chara.cs.

10761 {
10762 if (tempElements != null)
10763 {
10765 tempElements = null;
10766 }
10767 }
ElementContainer tempElements
Definition: Chara.cs:36
void SetParent(Card c)

References ElementContainer.SetParent().

◆ CountDebuff()

int Chara.CountDebuff ( )
inline

Definition at line 9832 of file Chara.cs.

9833 {
9834 int num = 0;
9835 foreach (Condition condition in conditions)
9836 {
9837 if (condition.Type == ConditionType.Debuff)
9838 {
9839 num++;
9840 }
9841 }
9842 return num;
9843 }

References BaseStats.Type.

Referenced by GoalCombat.TryUseAbility().

◆ CountNumEaten()

int Chara.CountNumEaten ( Thing  food)
inline

Definition at line 10566 of file Chara.cs.

10567 {
10568 if (_historyFood == null)
10569 {
10570 return -1;
10571 }
10572 int num = 0;
10573 foreach (List<string> item in _historyFood)
10574 {
10575 foreach (string item2 in item)
10576 {
10577 if (item2 == food.id)
10578 {
10579 num++;
10580 }
10581 }
10582 }
10583 return num;
10584 }

References food, and item.

Referenced by FoodEffect.Proc().

◆ CreateReplacement()

Chara Chara.CreateReplacement ( )
inline

Definition at line 8314 of file Chara.cs.

8315 {
8316 Chara chara = CharaGen.Create(id);
8317 chara.c_originalHostility = base.c_originalHostility;
8318 if (chara.c_originalHostility != 0)
8319 {
8320 chara.hostility = chara.c_originalHostility;
8321 }
8322 if (orgPos != null)
8323 {
8324 chara.orgPos = orgPos.Copy();
8325 }
8326 chara.pos = pos.Copy();
8327 chara.isImported = true;
8328 chara.c_editorTags = base.c_editorTags;
8329 chara.c_editorTraitVal = base.c_editorTraitVal;
8330 chara.c_idTrait = base.c_idTrait;
8331 chara.homeZone = homeZone;
8332 return chara;
8333 }
Hostility c_originalHostility
Definition: Card.cs:1003
static Chara Create(string id, int lv=-1)
Definition: CharaGen.cs:17
Zone homeZone
Definition: Chara.cs:271
Point Copy()
Definition: Point.cs:491

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

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

◆ Cuddle()

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

Definition at line 6445 of file Chara.cs.

6446 {
6447 Talk("goodBoy");
6448 Say(headpat ? "headpat" : "cuddle", this, c);
6449 c.ShowEmo(Emo.love);
6450 if (EClass.rnd(IsPC ? 100 : 5000) == 0)
6451 {
6452 c.MakeEgg();
6453 }
6454 if (headpat && this != c)
6455 {
6456 if (c.interest > 0)
6457 {
6458 c.ModAffinity(EClass.pc, 1 + EClass.rnd(3));
6459 c.interest -= 20 + EClass.rnd(10);
6460 }
6462 {
6463 foreach (Chara member in party.members)
6464 {
6465 if (!member.IsPC && CanSeeLos(member))
6466 {
6467 member.AddCondition<ConEuphoric>(100 + Evalue(6904) * 5);
6468 }
6469 }
6470 }
6471 }
6472 if (c.Evalue(1221) > 0)
6473 {
6474 int ele = ((c.MainElement == Element.Void) ? 924 : c.MainElement.id);
6475 if (c.id == "hedgehog_ether")
6476 {
6477 ele = 922;
6478 }
6479 Say("reflect_thorne", this, c);
6480 DamageHP(10L, ele, Power, AttackSource.Condition);
6481 }
6482 }
Emo
Definition: Emo.cs:2
virtual int Power
Definition: Card.cs:2349
void ShowEmo(Emo _emo=Emo.none, float duration=0f, bool skipSame=true)
Definition: Card.cs:6511
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
Definition: Card.cs:5959
Element MainElement
Definition: Chara.cs:735
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Definition: Chara.cs:8236
int interest
Definition: Chara.cs:321
Religion faith
Definition: Chara.cs:443
static Element Void
Definition: ELEMENT.cs:243
ReligionManager religions
Definition: Game.cs:159
ReligionMoonShadow MoonShadow

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

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

◆ Cure()

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

Definition at line 9895 of file Chara.cs.

9896 {
9897 bool flag = state == BlessedState.Blessed;
9898 switch (type)
9899 {
9900 case CureType.Heal:
9901 case CureType.Prayer:
9902 CureCondition<ConFear>();
9903 CureCondition<ConBlind>(2 * p / 100 + 5);
9904 CureCondition<ConPoison>(5 * p / 100 + 5);
9905 CureCondition<ConConfuse>(10 * p / 100 + 10);
9906 CureCondition<ConDim>(p / 100 + 5);
9907 CureCondition<ConBleed>(2 * p / 100 + 10);
9908 if (flag)
9909 {
9910 SAN.Mod(-15);
9911 }
9912 break;
9913 case CureType.CureBody:
9914 CureCondition<ConBlind>(5 * p / 100 + 15);
9915 CureCondition<ConPoison>(10 * p / 100 + 15);
9916 CureCondition<ConBleed>(5 * p / 100 + 20);
9917 CureTempElements(p, body: true, mind: false);
9918 break;
9919 case CureType.CureMind:
9920 CureCondition<ConFear>();
9921 CureCondition<ConDim>(3 * p / 100 + 10);
9922 CureTempElements(p, body: false, mind: true);
9923 break;
9924 case CureType.Sleep:
9925 {
9926 for (int num2 = conditions.Count - 1; num2 >= 0; num2--)
9927 {
9928 Condition condition2 = conditions[num2];
9929 if (!(condition2 is ConSleep) && !(condition2 is ConFaint))
9930 {
9931 if (condition2.isPerfume)
9932 {
9933 condition2.Mod(-1, force: true);
9934 }
9935 else if (condition2.Type == ConditionType.Bad || condition2.Type == ConditionType.Debuff)
9936 {
9937 condition2.Kill();
9938 }
9939 }
9940 }
9941 CureCondition<ConWait>();
9942 CureCondition<ConDisease>((EClass.rnd(20) + 10) * p / 100);
9943 bool flag2 = HasCondition<ConAnorexia>();
9944 base.c_vomit -= (flag2 ? 3 : 2) * p / 100;
9945 if (base.c_vomit < 0)
9946 {
9947 base.c_vomit = 0;
9948 if (flag2)
9949 {
9950 RemoveCondition<ConAnorexia>();
9951 }
9952 }
9953 break;
9954 }
9955 case CureType.HealComplete:
9956 case CureType.Death:
9957 case CureType.Jure:
9958 case CureType.Boss:
9959 case CureType.Unicorn:
9960 {
9961 CureTempElements(p * 100, body: true, mind: true);
9962 for (int num = conditions.Count - 1; num >= 0; num--)
9963 {
9964 Condition condition = conditions[num];
9965 if (condition is ConAnorexia && type != CureType.Death && type != CureType.Unicorn && type != CureType.Jure)
9966 {
9967 continue;
9968 }
9969 switch (condition.Type)
9970 {
9971 case ConditionType.Bad:
9972 case ConditionType.Debuff:
9973 case ConditionType.Disease:
9974 condition.Kill();
9975 continue;
9976 case ConditionType.Stance:
9977 if (type == CureType.Death)
9978 {
9979 condition.Kill();
9980 continue;
9981 }
9982 break;
9983 }
9984 if (type == CureType.Death && condition.isPerfume)
9985 {
9986 condition.Kill();
9987 }
9988 }
9989 CureCondition<ConWait>();
9990 CureCondition<ConSleep>();
9991 switch (type)
9992 {
9993 case CureType.Death:
9994 case CureType.Boss:
9995 case CureType.Unicorn:
9996 SAN.Mod(-20);
9997 RemoveCondition<ConBrightnessOfLife>();
9998 RemoveCondition<ConDeathSentense>();
9999 break;
10000 case CureType.Jure:
10001 SAN.Mod(-999);
10002 if (HasElement(1206))
10003 {
10004 SetFeat(1206, 0, msg: true);
10005 }
10006 RemoveCondition<ConBrightnessOfLife>();
10007 RemoveCondition<ConDeathSentense>();
10008 break;
10009 case CureType.CureBody:
10010 case CureType.CureMind:
10011 case CureType.Prayer:
10012 break;
10013 }
10014 break;
10015 }
10016 }
10017 }
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:10730
Stats SAN
Definition: Chara.cs:1193
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 9845 of file Chara.cs.

9845 : Condition
9846 {
9847 T condition = GetCondition<T>();
9848 if (condition != null)
9849 {
9850 condition.value -= v;
9851 if (condition.value <= 0)
9852 {
9853 condition.Kill();
9854 }
9855 }
9856 }
override T GetCondition< T >()
Definition: Chara.cs:9858

◆ CureHost()

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

Definition at line 9882 of file Chara.cs.

9883 {
9884 if (parasite != null)
9885 {
9886 parasite.Cure(type, p, state);
9887 }
9888 if (ride != null)
9889 {
9890 ride.Cure(type, p, state);
9891 }
9892 Cure(type, p, state);
9893 }
void Cure(CureType type, int p=100, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:9895

References Cure().

Referenced by FactionBranch.DailyOutcome().

◆ CureTempElements()

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

Definition at line 10730 of file Chara.cs.

10731 {
10732 if (tempElements != null)
10733 {
10734 if (body)
10735 {
10737 }
10738 if (mind)
10739 {
10741 }
10742 }
10743 void Cure(int[] eles)
10744 {
10745 foreach (int ele in eles)
10746 {
10747 if (tempElements == null)
10748 {
10749 break;
10750 }
10751 Element element = tempElements.GetElement(ele);
10752 if (element != null && element.vBase < 0)
10753 {
10754 ModTempElement(ele, Mathf.Clamp(p / 20 + EClass.rnd(p / 20), 1, -element.vBase));
10755 }
10756 }
10757 }
10758 }
void ModTempElement(int ele, int a, bool naturalDecay=false, bool onlyRenew=false)
Definition: Chara.cs:10638
Element GetElement(string alias)
static int[] List_Body
Definition: ELEMENT.cs:249
static int[] List_Mind
Definition: ELEMENT.cs:251

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

◆ DamageTempElement()

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

Definition at line 10696 of file Chara.cs.

10697 {
10698 ModTempElement(ele, onlyRenew ? (-p / 20) : (-(p / 100 + EClass.rnd(p / 100 + 1) + 1)), naturalDecay: false, onlyRenew);
10699 }

References EClass.rnd().

◆ DamageTempElements()

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

Definition at line 10684 of file Chara.cs.

10685 {
10686 if (body)
10687 {
10688 DamageTempElement(Element.List_Body.RandomItem(), p, onlyRenew);
10689 }
10690 if (mind)
10691 {
10692 DamageTempElement(Element.List_Mind.RandomItem(), p, onlyRenew);
10693 }
10694 }
void DamageTempElement(int ele, int p, bool onlyRenew=false)
Definition: Chara.cs:10696

References Element.List_Body, and Element.List_Mind.

◆ DestroyPath()

void Chara.DestroyPath ( Point  pos)
inline

Definition at line 3304 of file Chara.cs.

3305 {
3306 bool broke = false;
3307 pos.ForeachMultiSize(base.W, base.H, delegate(Point _p, bool main)
3308 {
3309 if (_p.IsValid)
3310 {
3311 if (_p.HasBlock)
3312 {
3313 EClass._map.MineBlock(_p, recoverBlock: false, this);
3314 if (_p.HasObj)
3315 {
3316 EClass._map.MineObj(_p, null, this);
3317 }
3318 broke = true;
3319 }
3320 if (_p.HasObj && _p.IsBlocked)
3321 {
3322 EClass._map.MineObj(_p, null, this);
3323 broke = true;
3324 }
3325 _p.Things.ForeachReverse(delegate(Thing t)
3326 {
3327 if (t.IsInstalled && (t.trait.IsBlockPath || t.trait.IsDoor))
3328 {
3329 if (t.isNPCProperty && t.trait.CanBeDestroyed)
3330 {
3331 t.Destroy();
3332 }
3333 else if (!t.IsUnique && !t.trait.CanBeDestroyed)
3334 {
3335 t.SetPlaceState(PlaceState.roaming);
3336 }
3337 }
3338 });
3339 }
3340 });
3341 if (broke)
3342 {
3343 Msg.Say("stomp");
3344 Shaker.ShakeCam("stomp");
3345 }
3346 }
if(!match.Success)
bool IsUnique
Definition: Card.cs:2143
void ForeachMultiSize(int w, int h, Action< Point, bool > action)
Definition: Point.cs:1391
Definition: Shaker.cs:5
static void ShakeCam(string id="default", float magnitude=1f)
Definition: Shaker.cs:25
virtual bool IsBlockPath
Definition: Trait.cs:54
virtual bool IsDoor
Definition: Trait.cs:58

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

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

◆ Die()

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

Reimplemented from Card.

Definition at line 5497 of file Chara.cs.

5498 {
5499 combatCount = 0;
5500 if (isDead)
5501 {
5502 return;
5503 }
5504 if (host != null)
5505 {
5506 base.hp = -1;
5507 if ((uint)(attackSource - 17) > 1u)
5508 {
5509 AddCondition<ConFaint>(200, force: true);
5510 return;
5511 }
5512 ActRide.Unride(host, this);
5513 }
5514 bool isInActiveZone = IsInActiveZone;
5515 if (isInActiveZone)
5516 {
5517 if (id == "putty" && origin != null && origin.IsPCParty)
5518 {
5520 }
5521 if (IsPC)
5522 {
5524 }
5525 if (base.isSummon)
5526 {
5527 if (id == "tsunami")
5528 {
5529 pos.PlaySound("water");
5530 }
5531 else
5532 {
5533 Say("summon_vanish", this);
5534 pos.PlayEffect("vanish");
5535 pos.PlaySound("vanish");
5536 }
5537 Destroy();
5538 return;
5539 }
5540 if ((uint)(attackSource - 17) <= 1u)
5541 {
5542 if (attackSource == AttackSource.Euthanasia && trait is TraitLittleOne)
5543 {
5544 MakeEgg();
5545 if (IsPCFaction)
5546 {
5548 }
5549 }
5550 PlayEffect("revive");
5551 PlaySound("chime_angel");
5552 }
5553 else
5554 {
5555 Effect.Get("blood").Play((parent is Chara) ? (parent as Chara).pos : pos).SetParticleColor(EClass.Colors.matColors[base.material.alias].main)
5556 .Emit(50);
5557 AddBlood(AI_Slaughter.slaughtering ? 12 : (2 + EClass.rnd(2)));
5558 PlaySound(base.material.GetSoundDead(source));
5559 }
5562 ClearFOV();
5563 }
5564 if (base.hp >= 0)
5565 {
5566 base.hp = -1;
5567 }
5568 string text = "";
5569 "dead_in".langGame(EClass._zone.Name);
5570 string text2 = ((origin == null) ? "" : origin.GetName(NameStyle.Full));
5571 if (LangGame.Has("dead_" + attackSource))
5572 {
5573 text = "dead_" + attackSource;
5574 }
5575 else
5576 {
5577 if (e != Element.Void && e != null)
5578 {
5579 text = "dead_" + e.source.alias;
5580 }
5581 if (text == "" || !LangGame.Has(text))
5582 {
5583 text = "dead";
5584 }
5585 }
5586 if (IsPC)
5587 {
5588 EClass._zone.isDeathLocation = true;
5589 string s = ((origin == null) ? text : "dead_by");
5591 if (attackSource == AttackSource.Wrath)
5592 {
5594 }
5595 EClass.player.deathMsg = GameLang.Parse(s.langGame(), thirdPerson: true, EClass.pc.NameBraced, "dead_in".langGame(EClass._zone.Name), text2);
5597 if (EClass._zone.instance is ZoneInstanceRandomQuest zoneInstanceRandomQuest)
5598 {
5599 zoneInstanceRandomQuest.status = ZoneInstance.Status.Fail;
5600 }
5601 AI_PlayMusic.keepPlaying = false;
5602 }
5603 if (isInActiveZone)
5604 {
5605 if (attackSource == AttackSource.DeathSentence || attackSource == AttackSource.Euthanasia)
5606 {
5607 Msg.Say("goto_heaven", this);
5608 }
5609 else
5610 {
5611 if (originalTarget != null || origin == null || !origin.isSynced || (attackSource != AttackSource.Melee && attackSource != AttackSource.Range))
5612 {
5613 Msg.Say(text, this, "", text2);
5614 }
5615 string text3 = TalkTopic("dead");
5616 if (!text3.IsEmpty())
5617 {
5618 text3 = text3.StripBrackets();
5619 }
5620 bool flag = base.rarity >= Rarity.Legendary && !IsPCFaction;
5621 if (!IsPC && flag)
5622 {
5623 MakeGrave(text3);
5624 }
5625 Msg.SetColor();
5626 SpawnLoot(origin);
5627 }
5628 if (IsPC)
5629 {
5631 }
5632 }
5633 if (IsPCFaction)
5634 {
5635 if (homeBranch != null)
5636 {
5637 homeBranch.Log(text, this, "");
5638 }
5639 WidgetPopText.Say("popDead".lang(base.Name), FontColor.Bad);
5640 if (!IsPC)
5641 {
5642 if (EClass.player.stats.allyDeath == 0)
5643 {
5644 Tutorial.Reserve("death_pet");
5645 }
5647 }
5648 }
5649 if (id == "mandrake" || HasElement(488))
5650 {
5651 Say("a_scream", this);
5652 ActEffect.ProcAt(EffectId.Scream, base.LV * 3 + 200, BlessedState.Normal, this, this, pos, isNeg: true);
5653 }
5654 daysStarved = 0;
5655 isDead = true;
5657 enemy = null;
5658 _cooldowns = null;
5659 base.isSale = false;
5660 SetInt(70);
5661 EClass._map.props.sales.Remove(this);
5662 Cure(CureType.Death);
5663 SetAI(new NoGoal());
5665 if (isInActiveZone && EClass._zone.HasLaw && IsHuman && OriginalHostility >= Hostility.Neutral)
5666 {
5667 pos.TalkWitnesses(origin?.Chara, "witness", 3, WitnessType.crime, (Chara c) => !c.IsPCParty && !c.IsUnique);
5668 }
5669 if (IsPC)
5670 {
5671 EClass.player.returnInfo = null;
5672 EClass.player.uidLastTravelZone = 0;
5673 foreach (Chara chara3 in EClass._map.charas)
5674 {
5675 if (chara3.IsHostile())
5676 {
5677 chara3.hostility = chara3.OriginalHostility;
5678 }
5679 if (chara3.enemy == EClass.pc)
5680 {
5681 chara3.enemy = null;
5682 }
5683 }
5684 if (EClass.pc.things.Find("letter_will") != null && EClass.rnd(10) == 0)
5685 {
5686 EClass.player.preventDeathPenalty = true;
5687 }
5688 }
5689 else
5690 {
5691 bool flag2 = currentZone.IsActiveZone && IsLocalChara && !currentZone.IsPCFaction;
5692 if (currentZone is Zone_LittleGarden && id == "littleOne")
5693 {
5694 flag2 = false;
5695 }
5696 if (flag2)
5697 {
5698 EClass._map.deadCharas.Add(this);
5699 }
5700 currentZone.RemoveCard(this);
5701 }
5702 if ((origin != null && origin.IsPCParty) || IsPCFaction)
5703 {
5704 int a = -10;
5705 if (IsPCFaction && !IsPCParty && (origin == null || !origin.IsPCParty))
5706 {
5707 a = -5;
5708 }
5709 ModAffinity(EClass.pc, a, show: false);
5710 string text4 = id;
5711 if (!(text4 == "quru"))
5712 {
5713 if (text4 == "corgon")
5714 {
5715 EClass.game.cards.globalCharas.Find("quru")?.ModAffinity(EClass.pc, -20, show: false);
5716 }
5717 }
5718 else
5719 {
5720 EClass.game.cards.globalCharas.Find("corgon")?.ModAffinity(EClass.pc, -20, show: false);
5721 }
5722 }
5723 if (origin != null)
5724 {
5725 if (origin.IsPCParty || origin.IsPCPartyMinion)
5726 {
5727 int num = 0;
5729 {
5730 num = -20;
5731 }
5732 else if (OriginalHostility >= Hostility.Friend && IsHuman && !base.IsPCFactionOrMinion)
5733 {
5734 num = -5;
5735 }
5736 else if (race.id == "cat" && OriginalHostility >= Hostility.Neutral)
5737 {
5738 EClass.pc.Say("killcat");
5739 num = -1;
5740 }
5741 if (EClass.pc.party.HasElement(1563) && num < 0)
5742 {
5743 num = num * 30 / 100;
5744 }
5745 if (num != 0)
5746 {
5747 EClass.player.ModKarma(num);
5748 }
5749 }
5750 if (origin == EClass.pc)
5751 {
5752 EClass.pc.faith.Revelation("kill", 10);
5753 }
5754 else if (origin.IsPCFaction)
5755 {
5756 origin.Chara.ModAffinity(EClass.pc, 1, show: false);
5757 origin.Chara.ShowEmo(Emo.love);
5758 }
5759 }
5760 if (base.sourceBacker != null && origin != null && origin.IsPCParty)
5761 {
5762 EClass.player.doneBackers.Add(base.sourceBacker.id);
5763 }
5764 if (base.IsPCFactionOrMinion)
5765 {
5767 {
5768 Msg.Say("abort_allyDead");
5769 }
5770 }
5772 {
5773 Msg.Say("abort_enemyDead");
5774 }
5775 if (IsPCParty && !IsPC)
5776 {
5778 base.c_wasInPcParty = true;
5779 EClass.pc.Say("allyDead");
5780 }
5781 switch (id)
5782 {
5783 case "littleOne":
5784 if (attackSource != AttackSource.Euthanasia && !IsPCFaction)
5785 {
5786 EClass.player.flags.little_killed = true;
5788 }
5789 break;
5790 case "big_daddy":
5791 case "big_daddy2":
5792 if (!IsPCFaction)
5793 {
5794 Chara chara = CharaGen.Create("littleOne");
5795 EClass._zone.AddCard(chara, pos.Copy());
5796 Msg.Say("little_pop");
5798 }
5799 break;
5800 case "shark_sister":
5801 if (!IsPCFaction)
5802 {
5803 Chara t = CharaGen.Create("sister_shark");
5804 EClass._zone.AddCard(t, pos.Copy());
5805 Msg.Say("shark_pop");
5806 }
5807 break;
5808 }
5809 if (attackSource == AttackSource.Finish && origin != null && origin.Evalue(665) > 0)
5810 {
5811 Chara chara2 = CharaGen.CreateFromFilter("c_plant", base.LV);
5812 EClass._zone.AddCard(chara2, pos.Copy());
5813 if (chara2.LV < base.LV)
5814 {
5815 chara2.SetLv(base.LV);
5816 }
5817 chara2.MakeMinion((origin.IsPCParty || origin.IsPCPartyMinion) ? EClass.pc : origin.Chara, MinionType.Friend);
5818 Msg.Say("plant_pop", this, chara2);
5819 }
5822 }
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:493
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:6345
virtual bool IsPCParty
Definition: Card.cs:2203
Card SetLv(int a)
Definition: Card.cs:3054
ICardParent parent
Definition: Card.cs:56
virtual bool IsPCPartyMinion
Definition: Card.cs:2207
void ClearFOV()
Definition: Card.cs:6966
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:6577
virtual bool IsPCFaction
Definition: Card.cs:2323
void SpawnLoot(Card origin)
Definition: Card.cs:5308
int LV
Definition: Card.cs:389
virtual bool isSynced
Definition: Card.cs:2139
static Chara CreateFromFilter(string id, int lv=-1, int levelRange=-1)
Definition: CharaGen.cs:22
int combatCount
Definition: Chara.cs:116
bool IsHuman
Definition: Chara.cs:902
int daysStarved
Definition: Chara.cs:333
void MakeMinion(Chara _master, MinionType type=MinionType.Default)
Definition: Chara.cs:2459
string NameBraced
Definition: Chara.cs:520
void ClearTempElements()
Definition: Chara.cs:10760
string TalkTopic(string topic="calm")
Definition: Chara.cs:7236
void TryDropBossLoot()
Definition: Chara.cs:5824
bool IsLocalChara
Definition: Chara.cs:864
Chara enemy
Definition: Chara.cs:86
bool IsInActiveZone
Definition: Chara.cs:861
void TryDropCarryOnly()
Definition: Chara.cs:4745
void MakeGrave(string lastword)
Definition: Chara.cs:5414
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:178
ConfigAutoCombat autoCombat
Definition: Game.cs:94
CardManager cards
Definition: Game.cs:156
static bool Has(string id)
Definition: LangGame.cs:99
List< Chara > deadCharas
Definition: Map.cs:46
static ThirstPersonInfo thirdPerson1
Definition: Msg.cs:6
bool HasElement(int ele, bool excludePC=false)
Definition: Party.cs:198
void RemoveMember(Chara c)
Definition: Party.cs:102
int allyDeath
Definition: Player.cs:111
void ModKarma(int a)
Definition: Player.cs:2610
Stats stats
Definition: Player.cs:1083
int little_dead
Definition: Player.cs:993
HashSet< int > doneBackers
Definition: Player.cs:1140
bool TryAbortAutoCombat(bool immediate=true)
Definition: Player.cs:2504
string deathMsg
Definition: Player.cs:1255
void TalkWitnesses(Chara criminal, string idTalk, int radius=4, WitnessType type=WitnessType.everyone, Func< Chara, bool > talkIf=null, int chance=3)
Definition: Point.cs:820
List< Card > sales
Definition: PropsManager.cs:14
virtual void Revelation(string idTalk, int chance=100)
Definition: Religion.cs:160
static Religion recentWrath
Definition: Religion.cs:22
virtual string NameShort
Definition: Religion.cs:48
Thing Find(int uid)
void Set(string n)
static void Reserve(string idStep, Action onBeforePlay=null)
Definition: Tutorial.cs:55
static void Say(string text, FontColor fontColor=FontColor.Default, Sprite sprite=null)
void OnCharaDie(Chara c)
void RefreshDeathSentense()
Definition: Zone.cs:1164
virtual bool HasLaw
Definition: Zone.cs:233
void RemoveCard(Card t)
Definition: Zone.cs:2106
void ResetHostility()
Definition: Zone.cs:2812
ZoneInstance instance
Definition: Zone.cs:55

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

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

◆ DiminishTempElements()

void Chara.DiminishTempElements ( int  a = 1)
inline

Definition at line 10715 of file Chara.cs.

10716 {
10717 if (tempElements == null)
10718 {
10719 return;
10720 }
10721 foreach (Element item in tempElements.dict.Values.ToList())
10722 {
10723 if (item.vBase > 0)
10724 {
10725 ModTempElement(item.id, -Mathf.Min(item.vBase * 5 / 100 + 1, item.vBase), naturalDecay: true);
10726 }
10727 }
10728 }

References ElementContainer.dict, and item.

◆ Divorce()

void Chara.Divorce ( Chara  c)
inline

Definition at line 8404 of file Chara.cs.

8405 {
8406 if (base.c_love != null)
8407 {
8408 base.c_love.dateMarriage = 0;
8409 base.c_love.dateWedding = 0;
8410 SetFeat(1275, 0);
8412 }
8413 }
int divorced
Definition: Player.cs:135

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

◆ DoAI()

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

Definition at line 6433 of file Chara.cs.

6434 {
6435 SetAI(new DynamicAIAct("", delegate
6436 {
6437 onPerform();
6438 return true;
6439 })
6440 {
6441 wait = wait
6442 });
6443 }

◆ DoHostileAction()

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

Definition at line 6577 of file Chara.cs.

6578 {
6579 if (_tg == null || !_tg.isChara)
6580 {
6581 return;
6582 }
6583 Chara chara = _tg.Chara;
6584 if (chara.IsPC)
6585 {
6586 EClass.pc.combatCount = 10;
6587 }
6588 if (!chara.IsAliveInCurrentZone || !IsAliveInCurrentZone || chara == this)
6589 {
6590 return;
6591 }
6592 if ((IsPCFaction || IsPCFactionMinion) && (chara.IsPCFaction || chara.IsPCFactionMinion))
6593 {
6594 chara.Say("frown", this, chara);
6595 }
6596 else
6597 {
6598 if (EClass._zone.IsRegion)
6599 {
6600 return;
6601 }
6602 if (IsPC)
6603 {
6604 if (chara.IsFriendOrAbove() && !immediate)
6605 {
6606 chara.Say("frown", this, chara);
6607 chara.ShowEmo(Emo.sad);
6608 chara.hostility = Hostility.Neutral;
6609 return;
6610 }
6611 if (!chara.IsPCFaction && chara.hostility >= Hostility.Neutral && !EClass._zone.IsPCFaction)
6612 {
6613 bool flag = chara.id == "fanatic";
6614 if (EClass.rnd(4) == 0 || flag)
6615 {
6616 chara.Say("callHelp", chara);
6617 chara.CallHelp(this, flag);
6618 }
6619 }
6620 if (chara.hostility <= Hostility.Enemy)
6621 {
6622 foreach (Chara member in EClass.pc.party.members)
6623 {
6624 if (member != EClass.pc && member.enemy == null && member.CanSee(chara))
6625 {
6626 member.SetEnemy(chara);
6627 }
6628 }
6629 }
6630 }
6631 else if (chara.IsPC && hostility <= Hostility.Enemy)
6632 {
6633 foreach (Chara member2 in EClass.pc.party.members)
6634 {
6635 if (member2 != EClass.pc && member2.enemy == null && member2.CanSee(this))
6636 {
6637 member2.SetEnemy(this);
6638 }
6639 }
6640 }
6641 if (chara.calmCheckTurn <= 0 || IsPC)
6642 {
6643 chara.calmCheckTurn = (IsPC ? (20 + EClass.rnd(30)) : (10 + EClass.rnd(10)));
6644 }
6645 if (hostility != Hostility.Enemy || chara.hostility != Hostility.Enemy)
6646 {
6647 GoHostile(chara);
6648 chara.GoHostile(this);
6649 if (base.isHidden && !chara.CanSee(this) && !chara.IsDisabled && !chara.IsPCParty && !chara.IsPCPartyMinion && EClass.rnd(10 + Dist(chara) * 10) == 0)
6650 {
6651 Thing t = ThingGen.Create("49");
6652 ActThrow.Throw(chara, pos, t);
6653 Act.TC = chara;
6654 }
6655 }
6656 }
6657 }
static EffectIRenderer Throw(Card c, Point p, Thing t, ThrowMethod method=ThrowMethod.Default, float failChance=0f)
Definition: ActThrow.cs:97
override bool IsAliveInCurrentZone
Definition: Chara.cs:567
override bool IsPCPartyMinion
Definition: Chara.cs:657
int calmCheckTurn
Definition: Chara.cs:118
bool CanSee(Card c)
Definition: Chara.cs:1253
override bool IsPCFactionMinion
Definition: Chara.cs:673
bool IsFriendOrAbove()
Definition: Chara.cs:6854
Chara SetEnemy(Chara c=null)
Definition: Chara.cs:6528
void CallHelp(Chara tg, bool fanatic=false)
Definition: Chara.cs:6659
Hostility hostility
Definition: Chara.cs:295
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53

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

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

◆ Drink()

void Chara.Drink ( Card  t)
inline

Definition at line 5291 of file Chara.cs.

5292 {
5293 Say("drink", this, t.Duplicate(1));
5294 Say("quaff");
5295 PlaySound("drink");
5296 hunger.Mod(-2);
5297 t.ModNum(-1);
5298 t.trait.OnDrink(this);
5299 _ = IsPC;
5300 }
Thing Duplicate(int num)
Definition: Card.cs:3602
void ModNum(int a, bool notify=true)
Definition: Card.cs:3673
Stats hunger
Definition: Chara.cs:1177
virtual void OnDrink(Chara c)
Definition: Trait.cs:1104

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

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

◆ DropHeld()

Card Chara.DropHeld ( Point  dropPos = null)
inline

Definition at line 4757 of file Chara.cs.

4758 {
4759 if (held == null)
4760 {
4761 return null;
4762 }
4763 if (IsPC)
4764 {
4765 WidgetHotbar.dirtyCurrentItem = true;
4767 }
4768 Card card = EClass._zone.AddCard(held, dropPos ?? pos);
4769 card.OnLand();
4770 if (card.trait.CanOnlyCarry)
4771 {
4772 card.SetPlaceState(PlaceState.installed);
4773 }
4774 return card;
4775 }
PlaceState
Definition: PlaceState.cs:2
Card held
Definition: Chara.cs:70
static void SetDirty(Thing t)

References EClass._zone, Zone.AddCard(), card, LayerInventory.SetDirty(), and Card.Thing.

Referenced by Card.Destroy(), TaskMoveInstalled.OnProgressComplete(), AI_Cook.Run(), AI_Offer.Run(), AI_ReleaseHeld.Run(), and AIAct.Start().

◆ DropThing()

void Chara.DropThing ( Thing  t,
int  num = -1 
)
inline

Definition at line 4777 of file Chara.cs.

4778 {
4779 if (t.c_isImportant)
4780 {
4781 Msg.Say("markedImportant");
4782 return;
4783 }
4784 if (!t.trait.CanBeDropped)
4785 {
4786 Msg.Say("cantDrop", t);
4787 return;
4788 }
4789 if (t.trait is TraitAbility)
4790 {
4791 SE.Trash();
4792 t.Destroy();
4793 return;
4794 }
4795 Msg.Say("dropItem", t.Name);
4796 t.ignoreAutoPick = true;
4797 PlaySound("drop");
4798 EClass._zone.AddCard(t, pos);
4799 if (t.trait.CanOnlyCarry)
4800 {
4801 t.Install();
4802 }
4803 }
Card Install()
Definition: Card.cs:3899
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 1860 of file Chara.cs.

1861 {
1862 Chara chara = CharaGen.Create(id);
1863 chara.mana.value = mana.value;
1864 chara.stamina.value = stamina.value;
1865 foreach (KeyValuePair<int, Element> item in elements.dict)
1866 {
1867 if (item.Key != 1275)
1868 {
1869 Element orCreateElement = chara.elements.GetOrCreateElement(item.Key);
1870 orCreateElement.vBase = item.Value.ValueWithoutLink - orCreateElement.vSource;
1871 }
1872 }
1873 chara.SetFaith(faith);
1874 chara.bio = IO.DeepCopy(bio);
1875 chara.LV = base.LV;
1876 chara.c_daysWithGod = base.c_daysWithGod;
1877 chara.RefreshFaithElement();
1878 chara.hp = (int)Mathf.Clamp((float)chara.MaxHP * ((float)base.hp / (float)MaxHP) * 0.99f, 0f, chara.MaxHP);
1879 chara.isCopy = true;
1880 chara.isScaled = base.isScaled;
1881 chara.c_altName = base.c_altName;
1882 chara._alias = _alias;
1883 if (pccData != null)
1884 {
1885 chara.pccData = IO.DeepCopy(pccData);
1886 }
1887 if (HaveFur())
1888 {
1889 chara.c_fur = -1;
1890 }
1891 return chara;
1892 }
bool HaveFur()
Definition: Card.cs:8306
Stats mana
Definition: Chara.cs:1189
void RefreshFaithElement()
Definition: Chara.cs:10595
string _alias
Definition: Chara.cs:223
void SetFaith(string id)
Definition: Chara.cs:1752
Element GetOrCreateElement(Element ele)
int vSource
Definition: ELEMENT.cs:267
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 10710 of file Chara.cs.

10711 {
10712 ModTempElement(ele, onlyRenew ? (p / 20) : (p / 100 + EClass.rnd(p / 100 + 1)), naturalDecay: false, onlyRenew);
10713 }

References EClass.rnd().

◆ EnhanceTempElements()

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

Definition at line 10701 of file Chara.cs.

10702 {
10703 int[] array = (body ? Element.List_Body : Element.List_Mind);
10704 foreach (int ele in array)
10705 {
10706 EnhanceTempElement(ele, p, onlyRenew);
10707 }
10708 }
void EnhanceTempElement(int ele, int p, bool onlyRenew=false)
Definition: Chara.cs:10710

References Element.List_Mind.

◆ EQ_CAT()

void Chara.EQ_CAT ( string  s)
inline

Definition at line 5268 of file Chara.cs.

5269 {
5270 int slot = EClass.sources.categories.map[s].slot;
5271 BodySlot bodySlot = ((slot == 0) ? null : body.GetSlot(slot));
5272 if ((slot == 0 || bodySlot != null) && (slot != 37 || !HasElement(1209)))
5273 {
5274 SetEQQuality();
5275 Thing thing = ThingGen.CreateFromCategory(s, base.LV);
5276 AddThing(thing);
5277 if (bodySlot != null && !body.Equip(thing, bodySlot))
5278 {
5279 thing.Destroy();
5280 }
5281 }
5282 }
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:3257
bool Equip(Thing thing, BodySlot slot=null, bool msg=true)
Definition: CharaBody.cs:194
BodySlot GetSlot(Thing t, bool onlyEmpty=false, bool secondSlot=false)
Definition: CharaBody.cs:369
void SetEQQuality()
Definition: Chara.cs:5215
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 5248 of file Chara.cs.

5249 {
5250 SetEQQuality();
5251 if (r != Rarity.Random)
5252 {
5253 CardBlueprint.current.rarity = r;
5254 }
5255 Thing thing = ThingGen.Create(s, mat, base.LV);
5256 if (body.GetSlot(thing, onlyEmpty: true) == null)
5257 {
5258 return thing;
5259 }
5260 AddThing(thing);
5261 if (!body.Equip(thing))
5262 {
5263 thing.Destroy();
5264 }
5265 return thing;
5266 }

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

5285 {
5286 SetEQQuality();
5287 Thing t = ThingGen.Create(s, -1, base.LV).SetNum(num);
5288 AddThing(t);
5289 }
Thing SetNum(int a)
Definition: Card.cs:3653

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

◆ EvalueRiding()

int Chara.EvalueRiding ( )
inline

Definition at line 6344 of file Chara.cs.

6345 {
6346 if (ride != null && ride.HasCondition<ConTransmuteBroom>() && HasElement(1417))
6347 {
6348 return 25 + Evalue(226) * 125 / 100;
6349 }
6350 return Evalue(226);
6351 }

References HasCondition().

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

◆ FallFromZone()

void Chara.FallFromZone ( )
inline

Definition at line 3636 of file Chara.cs.

3637 {
3638 Msg.Say("skyFall", EClass.pc, EClass._zone.Name);
3639 Zone zone = (EClass._zone.isExternalZone ? null : EClass._zone.GetTopZone().FindZone(EClass._zone.lv - 1));
3640 zone = zone ?? EClass.world.region;
3642 {
3643 state = ZoneTransition.EnterState.Fall,
3644 x = pos.x,
3645 z = pos.z
3646 });
3647 }
void MoveZone(string alias)
Definition: Chara.cs:3451
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:2022

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

8117 {
8118 TraitToolRange ranged = weapon.trait as TraitToolRange;
8119 Thing thing = (IsPC ? EClass.pc.things.Find<TraitQuiver>() : null);
8120 if (thing != null)
8121 {
8122 Thing thing2 = thing.things.Find((Thing t) => ranged.IsAmmo(t));
8123 if (thing2 != null)
8124 {
8125 return thing2;
8126 }
8127 }
8128 return things.Find((Thing t) => ranged.IsAmmo(t));
8129 }
bool IsAmmo
Definition: Card.cs:2301
Thing ranged
Definition: Chara.cs:98

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

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

◆ FindBed()

TraitBed Chara.FindBed ( )
inline

Definition at line 7615 of file Chara.cs.

7616 {
7617 foreach (Card item in EClass._map.props.installed.all)
7618 {
7619 if (item.trait is TraitBed traitBed && traitBed.IsHolder(this))
7620 {
7621 return traitBed;
7622 }
7623 }
7624 return null;
7625 }

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

7848 {
7849 Thing result = null;
7850 int num = -1;
7851 if (IsPC)
7852 {
7853 return null;
7854 }
7855 foreach (Thing item in things.List((Thing t) => CanEat(t, shouldEat: true) && !t.c_isImportant, onlyAccessible: true))
7856 {
7857 int num2 = CountNumEaten(item);
7858 int num3 = 100 - num2 + (item.HasElement(757) ? 10 : 0);
7859 if (num3 > num)
7860 {
7861 result = item;
7862 num = num3;
7863 }
7864 }
7865 return result;
7866 }
bool CanEat(Thing t, bool shouldEat=false)
Definition: Chara.cs:7893
int CountNumEaten(Thing food)
Definition: Chara.cs:10566
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 2521 of file Chara.cs.

2522 {
2523 if (IsMinion)
2524 {
2525 master = EClass._map.FindChara(base.c_uidMaster);
2526 }
2527 return master;
2528 }
Chara FindChara(string id)
Definition: Map.cs:2594

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

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

◆ FindNearestNewEnemy()

bool Chara.FindNearestNewEnemy ( )
inline

Definition at line 6743 of file Chara.cs.

6744 {
6745 for (int i = 0; i < EClass._map.charas.Count; i++)
6746 {
6747 Chara chara = EClass._map.charas[i];
6748 if (chara != this && chara != enemy && (chara.mimicry == null || !chara.mimicry.IsThing) && IsHostile(chara) && Dist(chara) <= 1 && CanInteractTo(chara.pos))
6749 {
6750 DoHostileAction(chara);
6751 enemy = chara;
6752 return true;
6753 }
6754 }
6755 return false;
6756 }
void DoHostileAction(Card _tg, bool immediate=false)
Definition: Chara.cs:6577
ConBaseTransmuteMimic mimicry
Definition: Chara.cs:106

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

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

◆ FindNewEnemy()

bool Chara.FindNewEnemy ( )
inline

Definition at line 6670 of file Chara.cs.

6671 {
6672 if (EClass._zone.isPeace && base.IsPCFactionOrMinion && !IsPC)
6673 {
6674 return false;
6675 }
6676 if (enemy != null && !enemy.IsAliveInCurrentZone)
6677 {
6678 enemy = null;
6679 }
6680 if (enemy != null)
6681 {
6682 return false;
6683 }
6684 if (IsPCParty && EClass.pc.isHidden && base.isHidden)
6685 {
6686 return false;
6687 }
6688 if (mimicry != null && mimicry.IsThing)
6689 {
6690 return false;
6691 }
6692 bool flag = enemy != null || ai is GoalCombat;
6693 int num = (base.PER + Evalue(210) * 2) * ((!flag) ? 1 : 2);
6694 bool flag2 = IsPCParty && !IsPC && EClass.game.config.tactics.dontWander;
6695 bool flag3 = !IsPCParty;
6696 Chara chara = null;
6697 int num2 = 9999;
6698 for (int i = 0; i < EClass._map.charas.Count; i++)
6699 {
6700 Chara chara2 = EClass._map.charas[i];
6701 if (chara2 == this || !IsHostile(chara2) || !CanSee(chara2) || (chara2.mimicry != null && chara2.mimicry.IsThing))
6702 {
6703 continue;
6704 }
6705 int num3 = Dist(chara2);
6706 int num4 = GetSightRadius() + (flag ? 1 : 0);
6707 if (num3 > num4)
6708 {
6709 continue;
6710 }
6711 if (flag3 && EClass.rnd(chara2.Evalue(152) + 5) * (100 + num3 * num3 * 10) / 100 > EClass.rnd(num))
6712 {
6713 if (this == pos.FirstChara)
6714 {
6715 chara2.ModExp(152, Mathf.Clamp((num - chara2.Evalue(152)) / 2, 1, Mathf.Max(30 - stealthSeen * 2, 1)));
6716 }
6717 stealthSeen++;
6718 }
6719 else if (CanSeeLos(chara2) && (!flag2 || EClass.pc.isBlind || EClass.pc.CanSeeLos(chara2)) && (!base.IsPCFactionOrMinion || EClass.pc.ai.ShouldAllyAttack(chara2)))
6720 {
6721 if (!IsPCParty)
6722 {
6723 DoHostileAction(chara2);
6724 enemy = chara2;
6725 return true;
6726 }
6727 if (num3 < num2)
6728 {
6729 num2 = num3;
6730 chara = chara2;
6731 }
6732 }
6733 }
6734 if (chara != null)
6735 {
6736 DoHostileAction(chara);
6737 enemy = chara;
6738 return true;
6739 }
6740 return false;
6741 }
virtual bool ShouldAllyAttack(Chara tg)
Definition: AIAct.cs:134
int stealthSeen
Definition: Chara.cs:192
bool isPeace
Definition: Spatial.cs:406

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

Referenced by GoalCombat.Run().

◆ FindRoom()

Room Chara.FindRoom ( )
inline

Definition at line 8231 of file Chara.cs.

8232 {
8233 return FindBed()?.owner.pos.cell.room;
8234 }
Room room
Definition: Cell.cs:110
TraitBed FindBed()
Definition: Chara.cs:7615

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

10482 {
10483 Element orCreateElement = elements.GetOrCreateElement(ele);
10484 if (orCreateElement.ValueWithoutLink == 0)
10485 {
10486 elements.ModBase(orCreateElement.id, 1);
10487 }
10488 if (orCreateElement is Spell)
10489 {
10490 int num = EClass.curve(Evalue(307), 50, 20) + (HasElement(307) ? 20 : 0);
10491 int num2 = origin?.Evalue(765) ?? 0;
10492 num = num * (100 - num2) / 100;
10493 int a = mtp * orCreateElement.source.charge * (100 + num) / 100 / 100;
10494 a = Mathf.Max(1, EClass.rndHalf(a));
10495 if (orCreateElement.source.charge == 1)
10496 {
10497 a = 1;
10498 }
10499 orCreateElement.vPotential += a;
10500 }
10501 Say("spell_gain", this, orCreateElement.Name);
10502 LayerAbility.SetDirty(orCreateElement);
10503 }
Element ModBase(int ele, int v)
virtual string Name
Definition: ELEMENT.cs:309
static void SetDirty(Element a)

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

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

◆ GetActionText()

string Chara.GetActionText ( )
inline

Definition at line 7552 of file Chara.cs.

7553 {
7554 string result = "?????";
7555 if (ai != null)
7556 {
7557 result = ai.GetCurrentActionText();
7558 }
7559 return result;
7560 }
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 8166 of file Chara.cs.

8167 {
8168 if (body.GetWeight(armorOnly: true) <= (HasElement(1204) ? 6000 : 30000))
8169 {
8170 return 120;
8171 }
8172 return 122;
8173 }
int GetWeight(bool armorOnly=false)
Definition: CharaBody.cs:436

References CharaBody.GetWeight().

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

◆ GetBestRangedWeapon()

Thing Chara.GetBestRangedWeapon ( )
inline

Definition at line 8131 of file Chara.cs.

8132 {
8133 Thing result = null;
8134 int num = 0;
8135 foreach (Thing thing in things)
8136 {
8137 if (thing.IsRangedWeapon && CanEquipRanged(thing) && thing.GetEquipValue() > num)
8138 {
8139 num = thing.GetEquipValue();
8140 result = thing;
8141 }
8142 }
8143 return result;
8144 }
int GetEquipValue()
Definition: Card.cs:7575
bool IsRangedWeapon
Definition: Card.cs:2297
bool CanEquipRanged(Thing t)
Definition: Chara.cs:8065

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

◆ GetBuffStats() [1/2]

Element Chara.GetBuffStats ( int  ele)
inline

Definition at line 9820 of file Chara.cs.

9821 {
9822 for (int i = 0; i < conditions.Count; i++)
9823 {
9824 if (conditions[i] is ConBuffStats conBuffStats && conBuffStats.refVal == ele)
9825 {
9826 return conBuffStats.elements.GetElement(ele);
9827 }
9828 }
9829 return null;
9830 }

References BaseCondition.refVal.

◆ GetBuffStats() [2/2]

Element Chara.GetBuffStats ( string  alias)
inline

Definition at line 9815 of file Chara.cs.

9816 {
9817 return GetBuffStats(EClass.sources.elements.alias[alias].id);
9818 }
Element GetBuffStats(string alias)
Definition: Chara.cs:9815

References SourceManager.elements, and EClass.sources.

Referenced by GoalCombat.TryUseAbility().

◆ GetBurden()

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

Definition at line 1894 of file Chara.cs.

1895 {
1896 int num2 = (base.ChildrenWeight + ((t != null) ? ((num == -1) ? t.ChildrenAndSelfWeight : (t.SelfWeight * num)) : 0)) * 100 / WeightLimit;
1897 if (num2 < 0)
1898 {
1899 num2 = 1000;
1900 }
1902 {
1903 num2 = 0;
1904 }
1905 int num3 = ((num2 >= 100) ? ((num2 - 100) / 10 + 1) : 0);
1906 if (num3 > 9)
1907 {
1908 num3 = 9;
1909 }
1910 return num3;
1911 }

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

◆ GetCondition< T >()

override T Chara.GetCondition< T > ( )
inlinevirtual

Reimplemented from Card.

Definition at line 9858 of file Chara.cs.

9859 {
9860 for (int i = 0; i < conditions.Count; i++)
9861 {
9862 if (conditions[i] is T)
9863 {
9864 return conditions[i] as T;
9865 }
9866 }
9867 return null;
9868 }

◆ GetCooldown()

int Chara.GetCooldown ( int  idEle)
inline

Definition at line 9099 of file Chara.cs.

9100 {
9101 if (_cooldowns != null)
9102 {
9103 for (int i = 0; i < _cooldowns.Count; i++)
9104 {
9105 if (_cooldowns[i] / 1000 == idEle)
9106 {
9107 return _cooldowns[i] % 1000;
9108 }
9109 }
9110 }
9111 return 0;
9112 }

Referenced by NotificationCooldown.OnRefresh().

◆ GetCurrentDir()

int Chara.GetCurrentDir ( )
inline

Definition at line 3756 of file Chara.cs.

3757 {
3758 Debug.Log(angle);
3759 if (!renderer.hasActor)
3760 {
3761 if (angle == 0f || angle == 45f || angle == 90f)
3762 {
3763 return 2;
3764 }
3765 if (angle == -135f || angle == 180f || angle == -90f)
3766 {
3767 return 1;
3768 }
3769 if (angle == 135f)
3770 {
3771 return 0;
3772 }
3773 return 3;
3774 }
3775 return renderer.actor.currentDir;
3776 }
virtual int currentDir
Definition: CardActor.cs:41
float angle
Definition: Card.cs:74

References Debug.

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

◆ GetDestination()

Point Chara.GetDestination ( )
inline

Definition at line 7527 of file Chara.cs.

7528 {
7529 return (ai.IsRunning ? ai.GetDestination() : pos).Copy();
7530 }
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 4830 of file Chara.cs.

4831 {
4832 if (elements.Value(122) > elements.Value(120))
4833 {
4834 return elements.GetElement(122);
4835 }
4836 return elements.GetElement(120);
4837 }
int Value(int ele)

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

◆ GetFavAttackStyle()

AttackStyle Chara.GetFavAttackStyle ( )
inline

Definition at line 4805 of file Chara.cs.

4806 {
4807 int num = Evalue(131);
4808 int num2 = Evalue(130);
4809 int num3 = Evalue(123);
4810 if (num > num2 && num > num3)
4811 {
4812 return AttackStyle.TwoWield;
4813 }
4814 if (num2 > num && num2 > num3)
4815 {
4816 return AttackStyle.TwoHand;
4817 }
4818 if (num3 > num && num3 > num2)
4819 {
4820 return AttackStyle.Shield;
4821 }
4822 return AttackStyle.Default;
4823 }

Referenced by WindowChara.RefreshNote().

◆ GetFavCat()

SourceCategory.Row Chara.GetFavCat ( )
inline

Definition at line 8363 of file Chara.cs.

8364 {
8365 if (ModUtil.TryGetContent<CustomBiographyContent>("Biography/" + id, out var content))
8366 {
8367 content.RefreshCharaBio(this);
8368 if (!content.favCategory.IsEmpty() && EClass.sources.categories.map.TryGetValue(content.favCategory, out var value) && value.gift > 0)
8369 {
8370 return value;
8371 }
8372 }
8373 SourceCategory.Row r = null;
8374 if (_listFavCat.Count == 0)
8375 {
8376 foreach (SourceCategory.Row row in EClass.sources.categories.rows)
8377 {
8378 if (row.gift > 0)
8379 {
8380 _listFavCat.Add(row);
8381 }
8382 }
8383 }
8384 Rand.UseSeed(base.uid + EClass.game.seed, delegate
8385 {
8386 r = _listFavCat.RandomItem();
8387 });
8388 return r;
8389 }
static List< SourceCategory.Row > _listFavCat
Definition: Chara.cs:198
int seed
Definition: Game.cs:201
Definition: Rand.cs:4
static void UseSeed(int seed, Action action)
Definition: Rand.cs:24

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

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

◆ GetFavFood()

SourceThing.Row Chara.GetFavFood ( )
inline

Definition at line 8335 of file Chara.cs.

8336 {
8337 if (ModUtil.TryGetContent<CustomBiographyContent>("Biography/" + id, out var content))
8338 {
8339 content.RefreshCharaBio(this);
8340 if (!content.favFood.IsEmpty() && EClass.sources.things.map.TryGetValue(content.favFood, out var value))
8341 {
8342 return value;
8343 }
8344 }
8345 if (_listFavFood.Count == 0)
8346 {
8347 foreach (SourceThing.Row row in EClass.sources.things.rows)
8348 {
8349 if (row._origin == "dish" && row.value != 0 && row.chance != 0)
8350 {
8351 _listFavFood.Add(row);
8352 }
8353 }
8354 }
8355 SourceThing.Row r = null;
8356 Rand.UseSeed(base.uid + EClass.game.seed, delegate
8357 {
8358 r = _listFavFood.RandomItem();
8359 });
8360 return r;
8361 }
static List< SourceThing.Row > _listFavFood
Definition: Chara.cs:196
SourceThing things

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

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

◆ GetFavWeaponSkill()

Element Chara.GetFavWeaponSkill ( )
inline

Definition at line 4825 of file Chara.cs.

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

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

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

◆ GetFirstStep()

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

Definition at line 2707 of file Chara.cs.

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

9166 {
9167 if (IsPC)
9168 {
9169 return null;
9170 }
9171 switch (TimeTable.GetSpan(idTimeTable, hour))
9172 {
9173 case TimeTable.Span.Sleep:
9175 {
9176 return new GoalSleep();
9177 }
9178 break;
9179 case TimeTable.Span.Eat:
9180 return new GoalIdle();
9181 case TimeTable.Span.Work:
9182 if (IsGuest())
9183 {
9184 return new GoalIdle();
9185 }
9186 return GetGoalWork();
9187 case TimeTable.Span.Free:
9188 if (IsGuest())
9189 {
9190 return new GoalIdle();
9191 }
9192 return GetGoalHobby();
9193 }
9194 return null;
9195 }
Goal GetGoalWork()
Definition: Chara.cs:9197
Goal GetGoalHobby()
Definition: Chara.cs:9210
string idTimeTable
Definition: Chara.cs:472
static Span GetSpan(string id, int hour)
Definition: TimeTable.cs:45
bool isSimulating
Definition: Zone.cs:75

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

◆ GetGoalHobby()

Goal Chara.GetGoalHobby ( )
inline

Definition at line 9210 of file Chara.cs.

9211 {
9212 if (IsPrisoner)
9213 {
9214 return new GoalIdle();
9215 }
9216 if (memberType == FactionMemberType.Livestock)
9217 {
9218 return new GoalGraze();
9219 }
9220 return new GoalHobby();
9221 }
FactionMemberType
bool IsPrisoner
Definition: Chara.cs:1061

Referenced by Zone.Simulate().

◆ GetGoalWork()

Goal Chara.GetGoalWork ( )
inline

Definition at line 9197 of file Chara.cs.

9198 {
9199 if (IsPrisoner)
9200 {
9201 return new GoalIdle();
9202 }
9203 if (memberType == FactionMemberType.Livestock)
9204 {
9205 return new GoalGraze();
9206 }
9207 return new GoalWork();
9208 }

Referenced by Zone.Simulate().

◆ GetHappiness()

int Chara.GetHappiness ( )
inline

Definition at line 7537 of file Chara.cs.

7538 {
7539 int num = 50;
7540 if (FindBed() != null)
7541 {
7542 num += 50;
7543 }
7544 return num;
7545 }

◆ GetHireCost()

int Chara.GetHireCost ( )
inline

Definition at line 7532 of file Chara.cs.

7533 {
7534 return base.LV / 2 + 4;
7535 }

Referenced by CalcGold.Hire().

◆ GetHoverText()

override string Chara.GetHoverText ( )
inlinevirtual

Reimplemented from Card.

Definition at line 7026 of file Chara.cs.

7027 {
7028 if (mimicry != null && mimicry.IsThing)
7029 {
7030 return mimicry.GetHoverText();
7031 }
7032 string text = ((mimicry != null && mimicry.Card != this) ? mimicry.GetName(NameStyle.Full) : base.Name);
7033 if (IsFriendOrAbove())
7034 {
7035 text = text.TagColor(EClass.Colors.colorFriend);
7036 }
7037 else if (IsHostile())
7038 {
7039 text = text.TagColor(EClass.Colors.colorHostile);
7040 }
7041 int num = 2;
7042 int lV = EClass.pc.LV;
7043 if (base.LV >= lV * 5)
7044 {
7045 num = 0;
7046 }
7047 else if (base.LV >= lV * 2)
7048 {
7049 num = 1;
7050 }
7051 else if (base.LV <= lV / 4)
7052 {
7053 num = 4;
7054 }
7055 else if (base.LV <= lV / 2)
7056 {
7057 num = 3;
7058 }
7059 string text2 = Lang.GetList("lvComparison")[num];
7060 text2 = (" (" + text2 + ") ").TagSize(14).TagColor(EClass.Colors.gradientLVComparison.Evaluate(0.25f * (float)num));
7061 string s = (IsFriendOrAbove() ? "HostilityAlly" : (IsNeutral() ? "HostilityNeutral" : "HostilityEnemy"));
7062 s = (" (" + s.lang() + ") ").TagSize(14);
7063 s = "";
7064 if (memberType == FactionMemberType.Guest)
7065 {
7066 s += (" (" + "guest".lang() + ") ").TagSize(14);
7067 }
7068 else if (memberType == FactionMemberType.Livestock)
7069 {
7070 s += (" (" + "livestock".lang() + ") ").TagSize(14);
7071 }
7072 if (!EClass.pc.IsMoving)
7073 {
7074 if (EClass.pc.HasHigherGround(this))
7075 {
7076 text2 += "lowerGround".lang();
7077 }
7078 else if (HasHigherGround(EClass.pc))
7079 {
7080 text2 += "higherGround".lang();
7081 }
7082 }
7083 if (Evalue(1232) > 0)
7084 {
7085 text2 = "milkBaby".lang().TagSize(14) + text2;
7086 }
7087 if (Guild.Fighter.ShowBounty(this) && Guild.Fighter.HasBounty(this))
7088 {
7089 text2 = "hasBounty".lang().TagSize(14) + text2;
7090 }
7091 if (EClass.pc.HasElement(481))
7092 {
7093 text2 += ("(" + faith.Name + ")").TagSize(14);
7094 }
7095 if (EClass.pc.HasElement(6607))
7096 {
7097 s += CraftUtil.GetBloodText(this).TagSize(14).TagColor(EClass.Colors.colorBlood);
7098 }
7099 return text + text2 + s;
7100 }
bool HasHigherGround(Card c)
Definition: Chara.cs:1225
override bool IsMoving
Definition: Chara.cs:626
bool IsNeutral()
Definition: Chara.cs:6805
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:117
bool ShowBounty(Chara c)
Definition: GuildFighter.cs:39
bool HasBounty(Chara c)
Definition: GuildFighter.cs:44
Definition: Guild.cs:2
static GuildFighter Fighter
Definition: Guild.cs:56

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

7103 {
7104 if (mimicry != null && mimicry.IsThing)
7105 {
7106 return mimicry.GetHoverText2();
7107 }
7108 string text = "";
7109 if (knowFav)
7110 {
7111 text += Environment.NewLine;
7112 text = text + "<size=14>" + "favgift".lang(GetFavCat().GetName().ToLower(), GetFavFood().GetName()) + "</size>";
7113 }
7114 string text2 = "";
7116 {
7117 text2 += Environment.NewLine;
7118 text2 = text2 + "Lv:" + base.LV + " HP:" + base.hp + "/" + MaxHP + " MP:" + mana.value + "/" + mana.max + " DV:" + DV + " PV:" + PV + " Hunger:" + hunger.value;
7119 text2 += Environment.NewLine;
7120 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");
7121 text2 += Environment.NewLine;
7122 text2 = text2 + base.uid + IsMinion + "/" + base.c_uidMaster + "/" + master;
7123 text2 = text2 + " dir:" + base.dir + " skin:" + base.idSkin + " scaled:" + base.isScaled;
7124 }
7126 {
7127 text2 += Environment.NewLine;
7128 text2 += "<size=14>";
7129 foreach (Hobby item in ListWorks())
7130 {
7131 text2 = text2 + item.Name + ", ";
7132 }
7133 foreach (Hobby item2 in ListHobbies())
7134 {
7135 text2 = text2 + item2.Name + ", ";
7136 }
7137 text2 = text2.TrimEnd(", ".ToCharArray()) + "</size>";
7138 }
7139 string text3 = "";
7140 IEnumerable<BaseStats> enumerable = conditions.Concat((!IsPCFaction) ? new BaseStats[0] : new BaseStats[2] { hunger, stamina });
7141 if (enumerable.Count() > 0)
7142 {
7143 text3 += Environment.NewLine;
7144 text3 += "<size=14>";
7145 int num = 0;
7146 foreach (BaseStats item3 in enumerable)
7147 {
7148 if (item3 is ConBaseTransmuteMimic)
7149 {
7150 continue;
7151 }
7152 string text4 = item3.GetPhaseStr();
7153 if (text4.IsEmpty() || text4 == "#")
7154 {
7155 continue;
7156 }
7157 Color c = Color.white;
7158 switch (item3.source.group)
7159 {
7160 case "Bad":
7161 case "Debuff":
7162 case "Disease":
7164 break;
7165 case "Buff":
7167 break;
7168 }
7170 {
7171 text4 = text4 + "(" + item3.GetValue() + ")";
7172 if (resistCon != null && resistCon.ContainsKey(item3.id))
7173 {
7174 text4 = text4 + "{" + resistCon[item3.id] + "}";
7175 }
7176 }
7177 num++;
7178 text3 = text3 + text4.TagColor(c) + ", ";
7179 }
7180 if (num == 0)
7181 {
7182 text3 = "";
7183 }
7184 else
7185 {
7186 text = "";
7187 text3 = text3.TrimEnd(", ".ToCharArray()) + "</size>";
7188 }
7189 }
7191 {
7192 text3 += Environment.NewLine;
7193 foreach (ActList.Item item4 in ability.list.items)
7194 {
7195 text3 = text3 + item4.act.Name + ", ";
7196 }
7197 text3 = text3.TrimEnd(", ".ToCharArray());
7198 }
7199 return text + text2 + text3;
7200 }
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:8363
bool knowFav
Definition: Chara.cs:417
override string GetName(NameStyle style, int num=-1)
Definition: Chara.cs:1396
override int DV
Definition: Chara.cs:747
List< Hobby > ListHobbies(bool useMemberType=true)
Definition: Chara.cs:9353
override int PV
Definition: Chara.cs:776
SourceThing.Row GetFavFood()
Definition: Chara.cs:8335
List< Hobby > ListWorks(bool useMemberType=true)
Definition: Chara.cs:9326
Color colorDebuff
virtual string GetHoverText2()
bool showExtra
Definition: CoreDebug.cs:183
Definition: Hobby.cs:5
SourceTactics tactics

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

Referenced by WidgetMouseover.Refresh().

◆ GetIdPortrait()

string Chara.GetIdPortrait ( )
inline

Definition at line 8477 of file Chara.cs.

8478 {
8479 string str = GetStr("portrait_override");
8480 if (!str.IsEmpty() && Portrait.allIds.Contains(str + ".png"))
8481 {
8482 return str;
8483 }
8484 if (id == "olderyoungersister")
8485 {
8486 if (base.idSkin != 2)
8487 {
8488 return "UN_olderyoungersister";
8489 }
8490 return "UN_olderyoungersister_alt";
8491 }
8492 if (Portrait.allIds.Contains("UN_" + id + ".png"))
8493 {
8494 return "UN_" + id;
8495 }
8496 return base.c_idPortrait;
8497 }
string GetStr(string id, string defaultStr=null)
Definition: Card.cs:2579
static HashSet< string > allIds
Definition: Portrait.cs:20

References Portrait.allIds.

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

◆ GetIdPortraitCat()

string Chara.GetIdPortraitCat ( )
inline

Definition at line 8463 of file Chara.cs.

8464 {
8465 string text = race.id;
8466 if ((text == "mifu" || text == "nefu") && EClass.rnd(2) == 0)
8467 {
8468 return "foxfolk";
8469 }
8470 if (trait is TraitGuard)
8471 {
8472 return "guard";
8473 }
8474 return "";
8475 }

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

7304 {
7305 return GetSprite();
7306 }
override Sprite GetSprite(int dir=0)
Definition: Chara.cs:6925

◆ GetName()

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

Reimplemented from Card.

Definition at line 1396 of file Chara.cs.

1397 {
1398 if (mimicry != null && mimicry.Card != this)
1399 {
1400 return mimicry.GetName(style, num);
1401 }
1402 if (base.isBackerContent && EClass.core.config.backer.Show(base.c_idBacker))
1403 {
1404 if (id == "follower" && !IsGlobal)
1405 {
1406 return "_follower".lang(EClass.sources.backers.map[base.c_idBacker].Name, faith.Name);
1407 }
1408 return EClass.sources.backers.map[base.c_idBacker].Name;
1409 }
1410 string text = base.c_altName ?? source.GetName(this);
1411 if (HasCondition<ConTransmuteShadow>())
1412 {
1413 text = EClass.sources.charas.map["shade"].GetName(this);
1414 }
1415 text = text.Replace("#ele5", MainElement.source.GetAltname(3)).Replace("#ele4", MainElement.source.GetAltname(2)).Replace("#ele3", MainElement.source.GetAltname(1))
1416 .Replace("#ele2", MainElement.source.GetAltname(0))
1417 .Replace("#ele", MainElement.source.GetName().ToLower());
1418 if (base.c_bossType == BossType.Evolved)
1419 {
1420 text = "_evolved".lang(text.ToTitleCase(wholeText: true));
1421 }
1422 trait.SetName(ref text);
1423 if (text.Length > 0 && char.IsLower(text[0]))
1424 {
1425 if (base.rarity >= Rarity.Legendary)
1426 {
1427 text = text.ToTitleCase();
1428 }
1429 else if (num != 0)
1430 {
1431 text = text.AddArticle();
1432 }
1433 }
1434 if (style == NameStyle.Simple)
1435 {
1436 return text;
1437 }
1438 int num2 = ((base.rarity == Rarity.Mythical) ? 3 : ((base.rarity >= Rarity.Legendary) ? 2 : ((!_alias.IsEmpty()) ? 1 : (-1))));
1439 if (trait is TraitAdventurer)
1440 {
1441 num2 = 1;
1442 }
1443 text = (Aka.IsEmpty() ? text.Bracket(num2) : (num2 switch
1444 {
1445 -1 => "_aka",
1446 1 => "_aka3",
1447 _ => "_aka2",
1448 }).lang((num2 == -1) ? Aka : Aka.ToTitleCase(wholeText: true), text.Bracket(num2)));
1449 string text2 = (base.isSale ? "forSale".lang(Lang._currency(GetPrice(CurrencyType.Money, sell: true, PriceType.PlayerShop), "money")) : "");
1450 return text + text2;
1451 }
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:7674
string Aka
Definition: Chara.cs:220
BackerContentConfig backer
Definition: CoreConfig.cs:621
virtual string Name
Definition: Religion.cs:30
SourceBacker backers
SourceChara charas
virtual void SetName(ref string s)
Definition: Trait.cs:733

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

Referenced by TraitStoryBookHome.OnRead().

◆ GetNearbyCatToSniff()

Chara Chara.GetNearbyCatToSniff ( )
inline

Definition at line 8415 of file Chara.cs.

8416 {
8417 using (List<Chara>.Enumerator enumerator = pos.ListCharasInRadius(this, 3, (Chara c) => c != this && c.race.id == "cat").GetEnumerator())
8418 {
8419 if (enumerator.MoveNext())
8420 {
8421 return enumerator.Current;
8422 }
8423 }
8424 return null;
8425 }
List< Chara > ListCharasInRadius(Chara cc, int dist, Func< Chara, bool > func, bool onlyVisible=true)
Definition: Point.cs:1226

References race.

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

◆ GetPietyValue()

int Chara.GetPietyValue ( )
inline

Definition at line 10586 of file Chara.cs.

10587 {
10588 if (base._IsPC)
10589 {
10590 return 10 + (int)(Mathf.Sqrt(base.c_daysWithGod) * 2f + (float)Evalue(85)) / 2;
10591 }
10592 return 10 + (int)(Mathf.Sqrt(base.LV) * 5f + (float)Evalue(306)) / 2;
10593 }

◆ GetRevived()

void Chara.GetRevived ( )
inline

Definition at line 5307 of file Chara.cs.

5308 {
5309 Revive(EClass.pc.pos.GetNearestPoint(allowBlock: false, allowChara: false), msg: true);
5310 if (!IsPCFaction)
5311 {
5312 return;
5313 }
5315 {
5316 if (homeZone != null && EClass._zone != homeZone)
5317 {
5318 Msg.Say("returnHome", this, homeZone.Name);
5320 }
5321 }
5322 else if (!EClass._zone.IsPCFaction || homeBranch != EClass.Branch || base.c_wasInPcParty)
5323 {
5324 EClass.pc.party.AddMemeber(this, showMsg: true);
5325 }
5326 }
static FactionBranch Branch
Definition: EClass.cs:23
void AddMemeber(Chara c, bool showMsg=false)
Definition: Party.cs:57
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false, int minRadius=0)
Definition: Point.cs:624
virtual bool CanJoinParty
Definition: TraitChara.cs:48
virtual bool CanJoinPartyResident
Definition: TraitChara.cs:51

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

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

◆ GetRoomWork()

BaseArea Chara.GetRoomWork ( )
inline

Definition at line 9304 of file Chara.cs.

9305 {
9306 BaseArea result = null;
9307 foreach (Hobby item in ListWorks())
9308 {
9309 AIWork aI = item.GetAI(this);
9310 if (aI.SetDestination())
9311 {
9312 if (aI.destArea != null)
9313 {
9314 result = aI.destArea;
9315 }
9316 else if (aI.destThing != null)
9317 {
9318 result = aI.destThing.pos.cell.room;
9319 }
9320 break;
9321 }
9322 }
9323 return result;
9324 }
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 6925 of file Chara.cs.

6926 {
6927 string str = GetStr("sprite_override");
6928 if (!str.IsEmpty())
6929 {
6930 Sprite sprite = ModUtil.LoadSprite(str);
6931 if ((bool)sprite)
6932 {
6933 return sprite;
6934 }
6935 }
6936 if (IsPCC)
6937 {
6938 PCC pCC = PCC.Get(pccData);
6939 pCC.Build();
6940 return pCC.variation.idle[0, 0];
6941 }
6942 bool snow = EClass.core.IsGameStarted && EClass._zone.IsSnowCovered;
6943 int skin = 0;
6944 if (spriteReplacer?.data != null)
6945 {
6946 Sprite sprite2 = spriteReplacer.GetSprite(dir, skin, snow);
6947 if ((bool)sprite2)
6948 {
6949 return sprite2;
6950 }
6951 }
6952 if (sourceCard.tiles.Length > 1)
6953 {
6954 skin = ((base.idSkin == 0 && !source.staticSkin) ? (base.uid % sourceCard.tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)) : base.idSkin);
6955 }
6956 return sourceCard.GetSprite(dir, skin, snow);
6957 }
int dir
Definition: Card.cs:149
SpriteReplacer spriteReplacer
Definition: Chara.cs:158
override CardRow sourceCard
Definition: Chara.cs:454
int[] tiles
Definition: RenderRow.cs:10
Sprite GetSprite(int dir=0, int skin=0, bool snow=false)
Definition: RenderRow.cs:264
virtual bool IsSnowCovered
Definition: Spatial.cs:545
Sprite GetSprite(string suffix="")

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

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

◆ GetSubPassData()

override SubPassData Chara.GetSubPassData ( )
inlinevirtual

Reimplemented from Card.

Definition at line 6968 of file Chara.cs.

6969 {
6970 if (IsPCC)
6971 {
6973 {
6975 }
6976 }
6977 else if (conSleep != null && host == null && pos.Equals(EClass.pc.pos) && IsHuman && (GetBool(123) || affinity.CanSleepBeside()))
6978 {
6979 return EClass.setting.pass.subDead;
6980 }
6981 return SubPassData.Default;
6982 }
bool GetBool(string id)
Definition: Card.cs:2541
ConSleep conSleep
Definition: Chara.cs:102
override bool IsDeadOrSleeping
Definition: Chara.cs:579
PassSetting pass
Definition: GameSetting.cs:305
bool altHeldPos
Definition: Player.cs:1223
static SubPassData Default
Definition: SubPassData.cs:7

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

◆ GetTextHappiness()

string Chara.GetTextHappiness ( )
inline

Definition at line 7547 of file Chara.cs.

7548 {
7549 return GetHappiness().ToString() ?? "";
7550 }
int GetHappiness()
Definition: Chara.cs:7537

◆ GetTextHobby()

string Chara.GetTextHobby ( bool  simple = false)
inline

Definition at line 9442 of file Chara.cs.

9443 {
9444 string text = (simple ? "" : ("hobby".lang() + ":"));
9445 foreach (Hobby item in ListHobbies())
9446 {
9447 text = text + " " + item.Name.TagColor((item.GetEfficiency(this) > 0) ? FontColor.Good : FontColor.Warning) + ",";
9448 }
9449 return text.TrimEnd(',');
9450 }

References item.

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

◆ GetTextWork()

string Chara.GetTextWork ( bool  simple = false)
inline

Definition at line 9452 of file Chara.cs.

9453 {
9454 string text = (simple ? "" : ("work".lang() + ":"));
9455 foreach (Hobby item in ListWorks())
9456 {
9457 text = text + " " + item.Name.TagColor((item.GetEfficiency(this) > 0) ? FontColor.Good : FontColor.Warning) + ",";
9458 }
9459 return text.TrimEnd(',');
9460 }

References item.

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

◆ GetTopicText()

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

Definition at line 7202 of file Chara.cs.

7203 {
7204 ConTransmuteHuman condition = GetCondition<ConTransmuteHuman>();
7205 string key = ((condition == null) ? source : condition.chara.source).idText.IsEmpty((condition == null) ? id : condition.chara.id);
7206 if (id == "littleOne" && EClass._zone is Zone_LittleGarden)
7207 {
7208 key = "littleOne2";
7209 }
7210 SourceCharaText.Row row = EClass.sources.charaText.map.TryGetValue(key);
7211 if (row == null)
7212 {
7213 return null;
7214 }
7215 string text = row.GetText(topic, returnNull: true);
7216 if (text.IsEmpty())
7217 {
7218 return null;
7219 }
7220 if (text.StartsWith("@"))
7221 {
7222 row = EClass.sources.charaText.map.TryGetValue(text.Replace("@", ""));
7223 if (row == null)
7224 {
7225 return null;
7226 }
7227 text = row.GetText(topic, returnNull: true);
7228 if (text.IsEmpty())
7229 {
7230 return null;
7231 }
7232 }
7233 return text.Split(Environment.NewLine.ToCharArray()).RandomItem();
7234 }
SourceCharaText charaText

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

◆ GetTotalFeat()

int Chara.GetTotalFeat ( )
inline

Definition at line 8437 of file Chara.cs.

8438 {
8439 int num = 0;
8440 if (base.c_upgrades != null)
8441 {
8442 num += base.c_upgrades.spent;
8443 }
8444 if (base.c_genes != null)
8445 {
8446 num += base.c_genes.GetTotalCost();
8447 }
8448 return num + base.feat;
8449 }

◆ GetWork()

Hobby Chara.GetWork ( string  id)
inline

Definition at line 9373 of file Chara.cs.

9374 {
9375 foreach (Hobby item in ListWorks())
9376 {
9377 if (item.source.alias == id)
9378 {
9379 return item;
9380 }
9381 }
9382 foreach (Hobby item2 in ListHobbies())
9383 {
9384 if (item2.source.alias == id)
9385 {
9386 return item2;
9387 }
9388 }
9389 return null;
9390 }
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 9535 of file Chara.cs.

9536 {
9537 if (_workSummary == null)
9538 {
9539 _workSummary = new WorkSummary();
9540 }
9541 return _workSummary;
9542 }
WorkSummary _workSummary
Definition: Chara.cs:55

Referenced by AIWork.AddDeliverable(), Expedition.End(), GoalWork.FindWork(), UIHomeInfo.RefreshReport(), GoalWork.TryWork(), and GoalWork.ValidateHobby().

◆ GiveGift()

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

Definition at line 8581 of file Chara.cs.

8582 {
8583 if (c.IsHostile() || c.IsDeadOrSleeping)
8584 {
8585 Msg.Say("affinityNone", c, this);
8586 return;
8587 }
8588 if (!t.isCopy && t.IsCursed && t.IsEquipmentOrRanged && !t.IsAmmo && c.HasElement(1414))
8589 {
8590 bool num = t.blessedState == BlessedState.Doomed;
8591 int num2 = 200 + t.LV * 3;
8592 if (t.rarity == Rarity.Legendary)
8593 {
8594 num2 *= 3;
8595 }
8596 if (t.rarity >= Rarity.Mythical)
8597 {
8598 num2 *= 5;
8599 }
8600 if (num)
8601 {
8602 num2 *= 2;
8603 }
8604 EClass.pc.PlayEffect("identify");
8605 EClass.pc.PlaySound("identify");
8606 c.PlayEffect("mutation");
8607 c.Say("draw_curse", c, t);
8608 t.Destroy();
8609 List<Element> list = new List<Element>();
8610 foreach (Element value in EClass.pc.elements.dict.Values)
8611 {
8612 if (value is Spell)
8613 {
8614 list.Add(value);
8615 }
8616 }
8617 if (list.Count == 0)
8618 {
8620 return;
8621 }
8622 Element element = list.RandomItem();
8623 EClass.pc.ModExp(element.id, num2);
8624 EClass.pc.Say("draw_curse2", EClass.pc, element.Name);
8625 c.AddExp(Mathf.Min(num2 / 3, c.ExpToNext));
8626 return;
8627 }
8628 if ((t.id == "lovepotion" || t.id == "dreambug") && !Application.isEditor)
8629 {
8630 GiveLovePotion(c, t);
8631 return;
8632 }
8633 if (t.trait is TraitErohon && c.id == t.c_idRefName)
8634 {
8635 c.OnGiveErohon(t);
8636 return;
8637 }
8638 if (t.trait is TraitTicketMassage)
8639 {
8640 t.ModNum(-1);
8641 c.Talk("ticket");
8642 switch (t.id)
8643 {
8644 case "ticket_massage":
8645 c.ModAffinity(EClass.pc, 10);
8647 {
8648 target = c
8649 });
8650 break;
8651 case "ticket_armpillow":
8652 c.ModAffinity(EClass.pc, 20);
8653 EClass.pc.AddCondition<ConSleep>(300, force: true);
8654 c.SetAI(new AI_ArmPillow
8655 {
8656 target = EClass.pc
8657 });
8658 break;
8659 case "ticket_champagne":
8660 c.ModAffinity(EClass.pc, 10);
8662 break;
8663 }
8664 return;
8665 }
8666 if (t.id == "flyer")
8667 {
8668 stamina.Mod(-1);
8669 if (c.things.Find((Thing a) => a.id == "flyer") != null)
8670 {
8671 c.Talk("flyer_miss");
8672 DoHostileAction(c);
8673 return;
8674 }
8675 if (EClass.rnd(20) != 0 && c.CHA > EClass.rnd(base.CHA + Evalue(291) * 3 + 10))
8676 {
8677 Msg.Say("affinityNone", c, this);
8678 t.Destroy();
8679 elements.ModExp(291, 10f);
8680 return;
8681 }
8682 elements.ModExp(291, 50f);
8683 }
8684 if (t.id == "statue_weird")
8685 {
8686 EClass.pc.Say("statue_sell");
8687 }
8688 t.isGifted = true;
8689 c.nextUse = c.affinity.OnGift(t);
8690 if (!t.isDestroyed)
8691 {
8692 EClass.game.quests.list.ForeachReverse(delegate(Quest q)
8693 {
8694 q.OnGiveItem(c, t);
8695 });
8696 if (c.TryEquip(t))
8697 {
8698 c.nextUse = null;
8699 }
8700 }
8701 if (c.IsPCParty)
8702 {
8704 }
8705 }
Thing OnGift(Thing t)
Definition: Affinity.cs:136
int ExpToNext
Definition: Card.cs:2060
bool isCopy
Definition: Card.cs:881
bool IsCursed
Definition: Card.cs:2309
int CHA
Definition: Card.cs:2401
bool IsEquipmentOrRanged
Definition: Card.cs:2272
void SayNothingHappans()
Definition: Card.cs:7216
string c_idRefName
Definition: Card.cs:1681
void TryClearInventory()
Definition: Chara.cs:8871
void GiveLovePotion(Chara c, Thing t)
Definition: Chara.cs:8718
bool TryEquip(Thing t, bool useFav=false)
Definition: Chara.cs:8026
void OnGiveErohon(Thing t)
Definition: Chara.cs:8707
QuestManager quests
Definition: Game.cs:183
List< Quest > list
Definition: QuestManager.cs:11
Definition: Quest.cs:7
virtual void OnGiveItem(Chara c, Thing t)
Definition: Quest.cs:536

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

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

◆ GiveLovePotion()

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

Definition at line 8718 of file Chara.cs.

8719 {
8720 c.Say("give_love", c, t);
8721 c.PlaySound(t.material.GetSoundDead());
8722 c.ShowEmo(Emo.angry);
8723 c.ModAffinity(EClass.pc, -20, show: false);
8724 c.Talk("pervert");
8725 t.Destroy();
8726 }

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

6554 {
6555 if (enemy == null && !IsPC)
6556 {
6557 if (GetInt(106) == 0)
6558 {
6559 TalkTopic("aggro");
6560 }
6561 if (OriginalHostility != Hostility.Enemy)
6562 {
6563 ShowEmo(Emo.angry);
6564 }
6565 SetEnemy(_tg.Chara);
6566 }
6568 {
6569 if (hostility >= Hostility.Neutral)
6570 {
6571 Say("angry", this);
6572 }
6573 hostility = Hostility.Enemy;
6574 }
6575 }
virtual bool IsPCFactionMinion
Definition: Card.cs:2209
int GetInt(string id, int? defaultInt=null)
Definition: Card.cs:2551

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

1320 {
1321 return HasAccess(c.pos);
1322 }
bool HasAccess(Card c)
Definition: Chara.cs:1319

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

1325 {
1326 if (!EClass._zone.IsPCFaction || p.cell.room == null || IsPC)
1327 {
1328 return true;
1329 }
1330 return p.cell.room.data.accessType switch
1331 {
1332 BaseArea.AccessType.Resident => memberType == FactionMemberType.Default,
1333 BaseArea.AccessType.Private => false,
1334 _ => true,
1335 };
1336 }

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

◆ HasCondition()

bool Chara.HasCondition ( string  alias)
inline

Definition at line 9803 of file Chara.cs.

9804 {
9805 for (int i = 0; i < conditions.Count; i++)
9806 {
9807 if (conditions[i].source.alias == alias)
9808 {
9809 return true;
9810 }
9811 }
9812 return false;
9813 }

Referenced by _Move(), AM_Adv._OnUpdateInput(), TraitGodStatue._OnUse(), ActPlan._Update(), Element._WriteNote(), ActMelee.Attack(), DramaCustomSequence.Build(), GoalCombat.BuildAbilityList(), Point.CallGuard(), ListPeopleParty.CanJoinParty(), ActNTR.CanPerform(), ActRanged.CanPerform(), ActRush.CanPerform(), ActEffect.DamageEle(), EvalueRiding(), ZonePreEnterEncounter.Execute(), TraitItemProc.GetHealAction(), 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.Prepare(), FoodEffect.Proc(), AttackProcess.ProcAbility(), ActEffect.ProcAt(), Religion.Punish(), Religion.PunishTakeOver(), Zone.RefreshDeathSentense(), RequestProtection(), ActRide.Ride(), AI_ArmPillow.Run(), AI_Fuck.Run(), AI_Idle.Run(), GoalCombat.Run(), Card.Teleport(), BaseSong.Tick(), Tick(), ConDeathSentense.Tick(), ConMiasma.Tick(), ConSleep.Tick(), UI.ToggleFeedback(), ConStrife.TryApplyParty(), GoalCombat.TryMove(), ActPray.TryPray(), TraitBaseSpellbook.TryProgress(), Zone.TrySpawnFollower(), GoalCombat.TryUseAbility(), and ActSlime.ValidatePerform().

◆ HasCondition< T >()

override bool Chara.HasCondition< T > ( )
inlinevirtual

Reimplemented from Card.

Definition at line 9791 of file Chara.cs.

9792 {
9793 for (int i = 0; i < conditions.Count; i++)
9794 {
9795 if (conditions[i] is T)
9796 {
9797 return true;
9798 }
9799 }
9800 return false;
9801 }

◆ HasCooldown()

bool Chara.HasCooldown ( int  idEle)
inline

Definition at line 9094 of file Chara.cs.

9095 {
9096 return GetCooldown(idEle) != 0;
9097 }
int GetCooldown(int idEle)
Definition: Chara.cs:9099

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

◆ HasHigherGround()

bool Chara.HasHigherGround ( Card  c)
inline

Definition at line 1225 of file Chara.cs.

1226 {
1227 if (c == null)
1228 {
1229 return false;
1230 }
1231 float num = renderer.position.y - pos.Position(0).y + (_isLevitating ? 0.4f : 0f);
1232 float num2 = c.renderer.position.y - c.pos.Position(0).y + ((c.isChara && c.Chara._isLevitating) ? 0.4f : 0f);
1233 return num > num2 + 0.1f;
1234 }
bool _isLevitating
Definition: Chara.cs:136
ref Vector3 Position(int height)
Definition: Point.cs:553

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

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

◆ HasHobbyOrWork()

bool Chara.HasHobbyOrWork ( string  alias)
inline

Definition at line 9223 of file Chara.cs.

9224 {
9225 int num = EClass.sources.hobbies.alias.TryGetValue(alias)?.id ?? 0;
9226 listHobby.Clear();
9227 if (_works == null || _hobbies == null)
9228 {
9229 RerollHobby();
9230 }
9231 foreach (int work in _works)
9232 {
9233 if (work == num)
9234 {
9235 return true;
9236 }
9237 }
9238 foreach (int hobby in _hobbies)
9239 {
9240 if (hobby == num)
9241 {
9242 return true;
9243 }
9244 }
9245 return false;
9246 }
static List< Hobby > listHobby
Definition: Chara.cs:13
void RerollHobby(bool extraSlotChance=true)
Definition: Chara.cs:9486
SourceHobby hobbies

References SourceManager.hobbies, and EClass.sources.

Referenced by AI_Idle.Run().

◆ HasMinion()

bool Chara.HasMinion ( string  id)
inline

Definition at line 2503 of file Chara.cs.

2504 {
2505 foreach (Chara chara in EClass._map.charas)
2506 {
2507 if (chara.c_uidMaster == base.uid)
2508 {
2509 return true;
2510 }
2511 }
2512 return false;
2513 }

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

Referenced by ActEffect.ProcAt().

◆ HealAll()

void Chara.HealAll ( )
inline

Definition at line 1763 of file Chara.cs.

1764 {
1765 Cure(CureType.HealComplete);
1766 base.hp = MaxHP;
1767 mana.value = mana.max;
1768 stamina.value = stamina.max;
1769 Refresh();
1770 }
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 4624 of file Chara.cs.

4625 {
4626 if (held == t || t.isDestroyed || t.Num <= 0)
4627 {
4628 return;
4629 }
4630 if (IsPC && t.isNPCProperty)
4631 {
4632 t.isNPCProperty = false;
4633 if (!t.GetBool(128))
4634 {
4636 pos.TryWitnessCrime(this);
4637 }
4638 }
4639 PickHeld();
4640 if (t.isChara)
4641 {
4643 {
4644 t.ShowEmo(Emo.love);
4645 }
4646 EClass.player.altHeldPos = t.renderer.data.ForceAltHeldPosition || EClass.rnd(2) == 0;
4647 }
4648 else
4649 {
4650 if (num == -1 || num > t.Num)
4651 {
4652 num = t.Num;
4653 }
4654 if (num < t.Num)
4655 {
4656 t = t.Split(num);
4657 }
4658 }
4659 if (t.GetRootCard() != this)
4660 {
4661 t = Pick(t.Thing, msg: false, tryStack: false);
4662 if (t.GetRootCard() != this)
4663 {
4664 return;
4665 }
4666 }
4667 held = t;
4669 if (held.GetLightRadius() > 0)
4670 {
4672 }
4673 if (IsPC)
4674 {
4676 WidgetHotbar.dirtyCurrentItem = true;
4677 }
4678 }
Thing Split(int a)
Definition: Card.cs:3642
bool isNPCProperty
Definition: Card.cs:557
virtual CardRenderer _CreateRenderer()
Definition: Card.cs:6338
void RecalculateFOV()
Definition: Card.cs:6759
virtual bool IsAliveInCurrentZone
Definition: Card.cs:2179
int GetLightRadius()
Definition: Card.cs:6806
void PickHeld(bool msg=false)
Definition: Chara.cs:4680
bool TryWitnessCrime(Chara criminal, Chara target=null, int radius=4, Func< Chara, bool > funcWitness=null)
Definition: Point.cs:878

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

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

◆ InitStats()

void Chara.InitStats ( bool  onDeserialize = false)
inline

Definition at line 9619 of file Chara.cs.

9620 {
9621 if (!onDeserialize)
9622 {
9623 _cints[10] = 20;
9624 _cints[11] = 70;
9625 _cints[13] = 70;
9626 _cints[14] = 70;
9627 _cints[15] = 70;
9628 _cints[17] = 0;
9629 _cints[18] = 0;
9630 }
9631 foreach (Condition condition in conditions)
9632 {
9633 condition.SetOwner(this, onDeserialize);
9634 }
9635 }
int[] _cints
Definition: Chara.cs:82

References BaseCondition.SetOwner().

Referenced by OnCreate(), and OnDeserialized().

◆ InstantEat()

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

Definition at line 7868 of file Chara.cs.

7869 {
7870 if (t == null)
7871 {
7872 t = FindBestFoodToEat();
7873 }
7874 if (t == null)
7875 {
7876 t = things.Find((Thing a) => CanEat(a, shouldEat: true) && !a.c_isImportant);
7877 }
7878 if (t == null)
7879 {
7880 t = things.Find((Thing a) => CanEat(a) && !a.c_isImportant);
7881 }
7882 if (t != null)
7883 {
7884 Say("eat_start", this, t.Duplicate(1));
7885 if (sound)
7886 {
7887 PlaySound("eat");
7888 }
7889 FoodEffect.Proc(this, t);
7890 }
7891 }
Thing FindBestFoodToEat()
Definition: Chara.cs:7847
static void Proc(Chara c, Thing food, bool consume=true)
Definition: FoodEffect.cs:12

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

6816 {
6817 if (faction == EClass.Home)
6818 {
6819 return homeZone == EClass.game.activeZone;
6820 }
6821 return false;
6822 }
Faction faction
Definition: Chara.cs:431
Zone activeZone
Definition: Game.cs:252

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

◆ IsCriticallyWounded()

bool Chara.IsCriticallyWounded ( bool  includeRide = false)
inline

Definition at line 1212 of file Chara.cs.

1213 {
1214 if (host == null || includeRide)
1215 {
1216 if (Evalue(1421) <= 0)
1217 {
1218 return base.hp < MaxHP / 5;
1219 }
1220 return base.hp + mana.value < (MaxHP + mana.max) / 5;
1221 }
1222 return false;
1223 }

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

2631 {
2632 if (!currentZone.IsRegion && p.IsValid)
2633 {
2634 CellDetail detail = p.detail;
2635 if (detail != null && detail.charas.Count > 0)
2636 {
2637 foreach (Chara chara in p.detail.charas)
2638 {
2639 if (chara.mimicry == null && (chara.IsHostile(this) || chara.IsHostile() || !chara.trait.CanBePushed))
2640 {
2641 if (cancelAI && EClass.pc.ai is GoalManualMove)
2642 {
2643 EClass.pc.ai.Cancel();
2644 }
2645 return true;
2646 }
2647 }
2648 }
2649 }
2650 return false;
2651 }
List< Chara > charas
Definition: CellDetail.cs:13
CellDetail detail
Definition: Point.cs:71

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

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

◆ IsEscorted()

bool Chara.IsEscorted ( )
inline

Definition at line 2530 of file Chara.cs.

2531 {
2532 if (!IsPCPartyMinion)
2533 {
2534 return false;
2535 }
2536 foreach (Quest item in EClass.game.quests.list)
2537 {
2538 if (item is QuestEscort questEscort && questEscort.uidChara == base.uid)
2539 {
2540 return true;
2541 }
2542 }
2543 return false;
2544 }
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 6859 of file Chara.cs.

6860 {
6861 if (base.IsPCFactionOrMinion || IsFriendOrAbove())
6862 {
6864 {
6865 return true;
6866 }
6867 }
6868 else if (IsHostile() && c.IsHostile())
6869 {
6870 return true;
6871 }
6872 return false;
6873 }

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

◆ IsGuest()

◆ IsHomeMember()

◆ IsHostile() [1/2]

◆ IsHostile() [2/2]

bool Chara.IsHostile ( Chara  c)
inline

Definition at line 6763 of file Chara.cs.

6764 {
6765 if (c == null)
6766 {
6767 return false;
6768 }
6769 if (base.IsPCFactionOrMinion)
6770 {
6771 if ((c == EClass.pc.enemy && !c.IsPCFactionOrMinion) || c.hostility <= Hostility.Enemy)
6772 {
6773 return true;
6774 }
6775 }
6776 else
6777 {
6779 {
6780 return true;
6781 }
6782 if (OriginalHostility >= Hostility.Friend)
6783 {
6784 if (hostility <= Hostility.Enemy && c.IsPCFactionOrMinion)
6785 {
6786 return true;
6787 }
6788 if (c.hostility <= Hostility.Enemy && c.OriginalHostility == Hostility.Enemy)
6789 {
6790 return true;
6791 }
6792 }
6793 else if (OriginalHostility <= Hostility.Enemy && (c.IsPCFactionOrMinion || (c.OriginalHostility != Hostility.Enemy && c.hostility >= Hostility.Friend)))
6794 {
6795 return true;
6796 }
6797 }
6798 if (id == "unicorn" && (Evalue(418) < 0 || (c.HasElement(1216) && c.Evalue(418) < 1)))
6799 {
6800 return true;
6801 }
6802 return false;
6803 }
bool IsCriminal
Definition: Player.cs:1409

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

◆ IsInHomeZone()

bool Chara.IsInHomeZone ( )
inline

Definition at line 6829 of file Chara.cs.

6830 {
6831 return EClass.game.activeZone == currentZone;
6832 }

Referenced by BaseListPeople.IsDisabled().

◆ IsInSpot< T >()

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

Definition at line 6834 of file Chara.cs.

6834 : TraitSpot
6835 {
6836 foreach (T item in EClass._map.props.installed.traits.List<T>())
6837 {
6838 foreach (Point item2 in item.ListPoints())
6839 {
6840 if (pos.Equals(item2))
6841 {
6842 return true;
6843 }
6844 }
6845 }
6846 return false;
6847 }
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 6805 of file Chara.cs.

6806 {
6807 return hostility == Hostility.Neutral;
6808 }

Referenced by ActPlan._Update().

◆ IsNeutralOrAbove()

bool Chara.IsNeutralOrAbove ( )
inline

◆ IsValidGiftWeight()

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

Definition at line 8525 of file Chara.cs.

8526 {
8527 int num2 = ((!HasElement(1411)) ? 1 : 3);
8528 if (GetBurden(t, num) >= num2)
8529 {
8530 return false;
8531 }
8532 return true;
8533 }
int GetBurden(Card t=null, int num=-1)
Definition: Chara.cs:1894

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

◆ Kiss()

void Chara.Kiss ( Chara  c)
inline

Definition at line 6484 of file Chara.cs.

6485 {
6486 EClass.player.forceTalk = true;
6487 Talk("kiss", null, null, IsPC);
6488 PlaySound("kiss");
6489 renderer.PlayAnime(AnimeID.Kiss, c);
6490 int num = 2 + EClass.rnd(4) + ((!c.IsPC && c.affinity.CurrentStage < Affinity.Stage.Fond) ? (-EClass.rnd(10)) : 0);
6491 c.ShowEmo((num > 0) ? Emo.love : Emo.sad);
6492 if (num > 0 && EClass.rnd(IsPC ? 100 : 5000) == 0)
6493 {
6494 c.MakeEgg();
6495 }
6496 if (IsPC && this != c)
6497 {
6498 if (c.interest > 0)
6499 {
6500 c.ModAffinity(EClass.pc, num);
6501 c.interest -= 20 + EClass.rnd(10);
6502 }
6503 else
6504 {
6505 c.Say("affinityNone", c, EClass.pc);
6506 }
6507 }
6508 Effect.Get("love")._Play(pos, isSynced ? renderer.position : pos.Position(), 0f, c.pos);
6509 }
Effect _Play(Point from, Vector3 fromV, float fixY=0f, Point to=null, Sprite sprite=null)
Definition: Effect.cs:117

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

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

◆ ListAvailabeFeats()

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

Definition at line 10266 of file Chara.cs.

10267 {
10268 List<Element> list = new List<Element>();
10269 foreach (SourceElement.Row item in EClass.sources.elements.rows.Where((SourceElement.Row a) => a.group == "FEAT" && a.cost[0] != -1 && !a.categorySub.IsEmpty()))
10270 {
10272 int num = ((feat.ValueWithoutLink <= 0) ? 1 : (feat.ValueWithoutLink + 1));
10273 if (num <= feat.source.max && !feat.HasTag("class") && !feat.HasTag("hidden") && !feat.HasTag("innate") && (!pet || !feat.HasTag("noPet")) && (showAll || feat.IsPurchaseFeatReqMet(elements)))
10274 {
10275 list.Add(Element.Create(feat.id, num) as Feat);
10276 }
10277 }
10278 return list;
10279 }
int feat
Definition: Card.cs:377
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1119
Definition: FEAT.cs:333

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

◆ ListHobbies()

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

Definition at line 9353 of file Chara.cs.

9354 {
9355 listHobby.Clear();
9356 if (!useMemberType || memberType != FactionMemberType.Livestock)
9357 {
9358 if (_hobbies == null)
9359 {
9360 RerollHobby();
9361 }
9362 foreach (int hobby in _hobbies)
9363 {
9364 listHobby.Add(new Hobby
9365 {
9366 id = hobby
9367 });
9368 }
9369 }
9370 return listHobby;
9371 }

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

9327 {
9328 listHobby.Clear();
9329 if (useMemberType && memberType == FactionMemberType.Livestock)
9330 {
9331 listHobby.Add(new Hobby
9332 {
9333 id = 45
9334 });
9335 }
9336 else
9337 {
9338 if (_works == null)
9339 {
9340 RerollHobby();
9341 }
9342 foreach (int work in _works)
9343 {
9344 listHobby.Add(new Hobby
9345 {
9346 id = work
9347 });
9348 }
9349 }
9350 return listHobby;
9351 }

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

3676 {
3677 angle = Util.GetAngle(p.x - pos.x, p.z - pos.z);
3678 if (EClass._zone.IsRegion)
3679 {
3680 if (angle > 100f && angle < 170f)
3681 {
3682 base.dir = 2;
3683 }
3684 else if (angle > 170f && angle < 190f)
3685 {
3686 base.dir = 0;
3687 }
3688 else if (angle > 190f || (angle < -10f && angle > -100f))
3689 {
3690 base.dir = 3;
3691 }
3692 else
3693 {
3694 base.dir = 1;
3695 }
3696 angle -= 45f;
3697 }
3698 else if (angle > 170f && angle < 235f)
3699 {
3700 base.dir = 0;
3701 }
3702 else if (angle > 80f && angle < 145f)
3703 {
3704 base.dir = 1;
3705 }
3706 else if (angle > -100f && angle < -35f)
3707 {
3708 base.dir = 3;
3709 }
3710 else if (angle > -10f && angle < 55f)
3711 {
3712 base.dir = 2;
3713 }
3715 }

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

◆ MakeAlly()

void Chara.MakeAlly ( bool  msg = true)
inline

Definition at line 2396 of file Chara.cs.

2397 {
2398 if (IsLocalChara && !base.IsUnique)
2399 {
2400 Debug.Log("Creating Replacement NPC for:" + this);
2402 }
2403 _MakeAlly();
2404 if (msg)
2405 {
2406 EClass.pc.Say("hire", this);
2407 EClass.Sound.Play("good");
2408 }
2409 EClass.pc.party.AddMemeber(this);
2410 if (EClass._zone.IsTown)
2411 {
2413 }
2414 }
Chara CreateReplacement()
Definition: Chara.cs:8314
void _MakeAlly()
Definition: Chara.cs:2416
virtual bool IsTown
Definition: Zone.cs:227
void RefreshListCitizen()
Definition: Zone.cs:3689

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

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

References DNA.GenerateGene().

◆ MakeGene()

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

Definition at line 8499 of file Chara.cs.

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

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

5415 {
5416 if (!EClass._zone.IsRegion)
5417 {
5418 List<string> list = new List<string> { "930", "931", "947", "948", "949", "950", "951", "952" };
5419 if (IsPC && EClass.rnd(2) == 0 && EClass.pc.things.Find("letter_will") != null)
5420 {
5421 list = new List<string> { "944", "946", "backerGrave", "backerGrave2" };
5422 }
5423 Thing thing = ThingGen.Create(list.RandomItem());
5424 thing.MakeRefFrom(this);
5425 if (!lastword.IsEmpty())
5426 {
5427 thing.c_note = lastword;
5428 }
5429 thing.isModified = true;
5430 EClass._zone.AddCard(thing, pos).Install();
5431 }
5432 }
Card MakeRefFrom(string id)
Definition: Card.cs:5941

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

2460 {
2461 UnmakeMinion();
2462 Hostility hostility2 = (base.c_originalHostility = (_master.IsPCFaction ? Hostility.Ally : _master.hostility));
2463 this.hostility = hostility2;
2464 base.c_uidMaster = _master.uid;
2465 base.c_minionType = type;
2466 master = _master;
2467 Refresh();
2468 }
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 2390 of file Chara.cs.

2391 {
2392 _MakeAlly();
2393 EClass.pc.party.AddMemeber(this);
2394 }

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

◆ Marry()

void Chara.Marry ( Chara  c)
inline

Definition at line 8391 of file Chara.cs.

8392 {
8393 if (base.c_love == null)
8394 {
8395 base.c_love = new LoveData();
8396 }
8397 base.c_love.dateMarriage = EClass.world.date.GetRaw();
8398 base.c_love.uidZoneMarriage = EClass._zone.uid;
8399 base.c_love.nameZoneMarriage = EClass._zone.Name;
8400 SetFeat(1275, 1, msg: true);
8402 }
int GetRaw(int offsetHours=0)
Definition: Date.cs:328
int married
Definition: Player.cs:132
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 8236 of file Chara.cs.

8237 {
8238 if (c == this)
8239 {
8240 return;
8241 }
8242 if (IsPC)
8243 {
8244 c.ModAffinity(EClass.pc, a, show);
8245 }
8246 else
8247 {
8249 {
8250 return;
8251 }
8252 int num = StatsHygiene.GetAffinityMod(EClass.pc.hygiene.GetPhase()) + (HasElement(417) ? 30 : 0) + (EClass.pc.HasCondition<ConSmoking>() ? (-30) : 0);
8253 if (IsPCFaction && homeBranch != null)
8254 {
8255 num += (int)Mathf.Sqrt(homeBranch.Evalue(2117)) * 5;
8256 }
8257 bool flag = a > 0;
8258 if (flag)
8259 {
8260 a = a * num / 100;
8261 if (affinity.GetLunchChance() > EClass.rnd(100) && GetInt(71) >= 0 && GetInt(71) < EClass.world.date.GetRaw())
8262 {
8263 SetInt(71, -1);
8264 }
8265 }
8266 if (show)
8267 {
8268 if (a == 0)
8269 {
8270 if (!showOnlyEmo)
8271 {
8272 Say("affinityNone", this, c);
8273 }
8274 }
8275 else
8276 {
8277 ShowEmo((!flag) ? Emo.angry : Emo.love);
8278 c.ShowEmo(flag ? Emo.love : Emo.sad);
8279 if (!showOnlyEmo)
8280 {
8281 Say(flag ? "affinityPlus" : "affinityMinus", this, c);
8282 }
8283 }
8284 }
8285 if (c.IsPC)
8286 {
8287 a = affinity.Mod(a);
8288 }
8289 }
8290 }
int Mod(int a)
Definition: Affinity.cs:199
int GetLunchChance()
Definition: Affinity.cs:93
Stats hygiene
Definition: Chara.cs:1187
int Evalue(int ele)
static int GetAffinityMod(int phase)
Definition: StatsHygiene.cs:19
virtual bool CanChangeAffinity
Definition: Trait.cs:581

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

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

◆ ModCorruption()

void Chara.ModCorruption ( int  a)
inline

Definition at line 10223 of file Chara.cs.

10224 {
10225 if (a > 0)
10226 {
10227 if (Evalue(962) >= 25 || (ResistLv(962) > 0 && EClass.rnd(ResistLv(962) + 1) != 0))
10228 {
10229 return;
10230 }
10231 int num = Evalue(412);
10232 if (num != 0)
10233 {
10234 float num2 = (float)a * 100f / (float)Mathf.Max(100 + num * 2, 10);
10235 a = (int)num2 + ((EClass.rndf(1f) < num2 % 1f) ? 1 : 0);
10236 }
10237 }
10238 if (a == 0)
10239 {
10240 return;
10241 }
10242 int num3 = (corruption + a) / 100 - corruption / 100;
10243 for (int i = 0; i < Mathf.Abs(num3); i++)
10244 {
10245 if (!MutateRandom((num3 > 0) ? 1 : (-1), 100, ether: true))
10246 {
10247 break;
10248 }
10249 }
10250 corruption += a;
10251 int num4 = 0;
10252 foreach (Element value in elements.dict.Values)
10253 {
10254 if (value.source.category == "ether")
10255 {
10256 num4 += value.Value;
10257 }
10258 }
10259 if (num4 > 0 && IsPC)
10260 {
10261 Tutorial.Reserve("ether");
10262 }
10263 corruption = num4 * 100 + corruption % 100;
10264 }
bool MutateRandom(int vec=0, int tries=100, bool ether=false, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:10382
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 10172 of file Chara.cs.

10173 {
10174 if (!HasElement(450))
10175 {
10176 long num = bio.height;
10177 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
10178 if (num < 1)
10179 {
10180 num = 1L;
10181 }
10182 if (num > 999999999)
10183 {
10184 num = 999999999L;
10185 }
10186 if (num != bio.height)
10187 {
10188 bio.height = (int)num;
10189 Say((a > 0) ? "height_gain" : "height_lose", this);
10190 }
10191 }
10192 }
int height
Definition: Biography.cs:53

◆ ModTempElement()

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

Definition at line 10638 of file Chara.cs.

10639 {
10640 if (a < 0 && !naturalDecay && HasElement(EClass.sources.elements.alias["sustain_" + EClass.sources.elements.map[ele].alias]?.id ?? 0))
10641 {
10642 return;
10643 }
10644 bool flag = HasElement(1215);
10645 if (tempElements == null)
10646 {
10648 tempElements.SetParent(this);
10649 }
10650 if (a > 0 && flag)
10651 {
10652 a = a * 150 / 100;
10653 }
10654 int num = elements.ValueWithoutLink(ele);
10655 int num2 = Mathf.Abs(num) + 100;
10656 int num3 = num2 / (flag ? 2 : 4);
10657 int num4 = -num - 100;
10658 int num5 = tempElements.Base(ele);
10659 int num6 = num5 + a;
10660 if (onlyRenew)
10661 {
10662 num3 = Mathf.Min(a, num3);
10663 num4 = Mathf.Max(a, -num2 / 3);
10664 }
10665 if (a > 0 && num6 > num3)
10666 {
10667 a = ((num3 > num5) ? (num3 - num5) : 0);
10668 }
10669 if (a < 0 && num6 < num4)
10670 {
10671 a = ((num4 < num5) ? (num4 - num5) : 0);
10672 }
10673 Element element = tempElements.ModBase(ele, a);
10674 if (element.vBase == 0)
10675 {
10676 tempElements.Remove(element.id);
10677 if (tempElements.dict.Count == 0)
10678 {
10679 tempElements = null;
10680 }
10681 }
10682 }
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 10194 of file Chara.cs.

10195 {
10196 if (HasElement(450) || a == 0)
10197 {
10198 return;
10199 }
10200 long num = bio.weight;
10201 long num2 = bio.height;
10202 long num3 = num2 * num2 * 18 / 25000;
10203 long num4 = num2 * num2 * 24 / 10000;
10204 if (ignoreLimit || (num > num3 && num < num4))
10205 {
10206 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
10207 if (num < 1)
10208 {
10209 num = 1L;
10210 }
10211 if (num > 999999999)
10212 {
10213 num = 999999999L;
10214 }
10215 if (num != bio.weight)
10216 {
10217 bio.weight = (int)num;
10218 Say((a > 0) ? "weight_gain" : "weight_lose", this);
10219 }
10220 }
10221 }
int weight
Definition: Biography.cs:41

Referenced by FoodEffect.Proc().

◆ MoveByForce()

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

Definition at line 2744 of file Chara.cs.

2745 {
2746 if (!newPoint.sourceBlock.tileType.IsBlockPass && (!checkWall || (Dist(newPoint) <= 1 && CanMoveTo(newPoint, allowDestroyPath: false))) && _Move(newPoint, MoveType.Force) == MoveResult.Success && ai.Current.CancelWhenMoved)
2747 {
2748 ai.Current.TryCancel(c);
2749 }
2750 }
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:2838

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

3592 {
3593 if (isDead)
3594 {
3595 Revive();
3596 }
3597 else
3598 {
3599 Cure(CureType.Death);
3600 }
3601 CureCondition<ConSuspend>();
3602 if (IsPCParty)
3603 {
3605 }
3606 FactionBranch factionBranch = homeBranch;
3607 if (x == -1)
3608 {
3609 x = 50;
3610 }
3611 if (z == -1)
3612 {
3613 z = 50;
3614 }
3615 Point point = new Point(x, z);
3616 if (zone.IsActiveZone)
3617 {
3618 point = point.GetNearestPoint(allowBlock: false, allowChara: false);
3619 }
3620 zone.AddCard(this, point);
3621 SetHomeZone(zone);
3622 global.transition = new ZoneTransition
3623 {
3624 state = ZoneTransition.EnterState.Dead,
3625 x = point.x,
3626 z = point.z
3627 };
3628 orgPos = new Point(x, z);
3629 if (factionBranch != null)
3630 {
3632 factionBranch.policies.Validate();
3633 }
3634 }
void RefreshWorkElements(ElementContainer parent=null)
Definition: Chara.cs:9392
Chara SetHomeZone(Zone zone)
Definition: Chara.cs:1474
PolicyManager policies
bool IsActiveZone
Definition: Zone.cs:499

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

◆ MoveNeighborDefinitely()

bool Chara.MoveNeighborDefinitely ( )
inline

Definition at line 2726 of file Chara.cs.

2727 {
2728 List<Point> list = new List<Point>();
2729 pos.ForeachNeighbor(delegate(Point p)
2730 {
2731 list.Add(p.Copy());
2732 });
2733 list.Shuffle();
2734 foreach (Point item in list)
2735 {
2736 if (!item.Equals(pos) && !item.HasChara && TryMove(item) == MoveResult.Success)
2737 {
2738 return true;
2739 }
2740 }
2741 return false;
2742 }
override MoveResult TryMove(Point newPoint, bool allowDestroyPath=true)
Definition: Chara.cs:2814
void ForeachNeighbor(Action< Point > action, bool diagonal=true)
Definition: Point.cs:1403

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

Referenced by AI_Idle.Run().

◆ MoveRandom()

bool Chara.MoveRandom ( )
inline

Definition at line 2712 of file Chara.cs.

2713 {
2714 Point randomNeighbor = pos.GetRandomNeighbor();
2715 if (!randomNeighbor.Equals(pos) && !randomNeighbor.HasChara && HasAccess(randomNeighbor))
2716 {
2717 if ((race.tag.Contains("water") || source.tag.Contains("water")) && pos.cell.IsTopWaterAndNoSnow && !randomNeighbor.IsDeepWater)
2718 {
2719 return false;
2720 }
2721 return TryMove(randomNeighbor) == MoveResult.Success;
2722 }
2723 return false;
2724 }
bool IsTopWaterAndNoSnow
Definition: Cell.cs:720
bool IsDeepWater
Definition: Point.cs:276

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

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

◆ MoveZone() [1/3]

◆ MoveZone() [2/3]

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

Definition at line 3464 of file Chara.cs.

3465 {
3466 if (z == currentZone)
3467 {
3468 return;
3469 }
3470 if (HasCondition<ConInvulnerable>())
3471 {
3472 RemoveCondition<ConInvulnerable>();
3473 }
3474 if (IsPC)
3475 {
3476 EClass.player.nextZone = z;
3478 {
3481 {
3482 if (EClass.player.returnInfo != null)
3483 {
3484 EClass.player.returnInfo.turns += 5;
3485 }
3487 {
3488 EClass.game.Save(isAutoSave: true);
3489 }
3490 }
3491 EClass.player.deathZoneMove = false;
3492 }
3494 if (currentZone.instance != null)
3495 {
3497 z = EClass.game.spatials.Find(instance.uidZone) ?? EClass.pc.homeZone;
3498 transition = new ZoneTransition
3499 {
3500 state = instance.ReturnState,
3501 x = instance.x,
3502 z = instance.z
3503 };
3504 instance.OnLeaveZone();
3505 Debug.Log(z);
3506 }
3507 EInput.Consume(consumeAxis: true);
3508 EClass.player.uidLastZone = currentZone.uid;
3510 {
3512 {
3513 Msg.Say("enterZone", z.Name);
3514 }
3515 else
3516 {
3517 if (z.IsRegion)
3518 {
3519 Msg.Say("leaveZone", currentZone.Name);
3520 }
3521 else if (z.id != currentZone.id)
3522 {
3523 Msg.Say("enterZone", z.Name);
3524 }
3525 EClass.player.lastZonePos = pos.Copy();
3526 }
3527 EClass.player.lastTransition = transition;
3528 }
3529 foreach (Chara item in EClass._map.charas.Where((Chara c) => c.IsPCPartyMinion && c.master != EClass.pc).ToList())
3530 {
3532 }
3533 EClass.player.listCarryoverMap = EClass._map.charas.Where((Chara c) => c.c_uidMaster != 0 && c.FindMaster() == EClass.pc && c.c_minionType == MinionType.Default).ToList();
3534 if (!z.IsRegion && (z is Zone_Tent || currentZone is Zone_Tent))
3535 {
3536 foreach (Chara chara in EClass._map.charas)
3537 {
3538 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))
3539 {
3540 EClass.player.listCarryoverMap.Add(chara);
3541 }
3542 }
3543 }
3544 foreach (Chara item2 in EClass.player.listCarryoverMap)
3545 {
3546 EClass._zone.RemoveCard(item2);
3547 }
3548 }
3549 if (party != null && party.leader == this)
3550 {
3551 foreach (Chara member in party.members)
3552 {
3553 if (member != this && !member.isDead && member.parent is Zone)
3554 {
3555 member.MoveZone(z);
3556 }
3557 }
3558 }
3559 if (global == null)
3560 {
3561 Debug.Log(base.Name);
3562 return;
3563 }
3564 transition.uidLastZone = currentZone?.uid ?? 0;
3565 global.transition = transition;
3566 if (z.IsActiveZone)
3567 {
3568 Point spawnPos = z.GetSpawnPos(this);
3569 global.transition = null;
3570 if (IsPC)
3571 {
3572 EClass.player.lastTransition = null;
3573 }
3574 z.AddCard(this, spawnPos);
3575 if (IsBranchMember())
3576 {
3578 }
3579 }
3580 else
3581 {
3582 z.AddCard(this);
3583 }
3584 }
MinionType c_minionType
Definition: Card.cs:1015
bool IsBranchMember()
Definition: Chara.cs:6815
GlobalData global
Definition: Chara.cs:76
Chara FindMaster()
Definition: Chara.cs:2521
bool ignoreAutoSave
Definition: CoreDebug.cs:141
bool Save(bool isAutoSave=false, bool silent=false)
Definition: Game.cs:1040
RoomManager rooms
Definition: Map.cs:31
Chara leader
Definition: Party.cs:31
bool deathZoneMove
Definition: Player.cs:1239
List< Chara > listCarryoverMap
Definition: Player.cs:1293
ReturnInfo returnInfo
Definition: Player.cs:933
bool simulatingZone
Definition: Player.cs:1249
void AssignCharas()
Definition: RoomManager.cs:39
string id
Definition: Spatial.cs:13
virtual ZoneTransition.EnterState ReturnState
Definition: ZoneInstance.cs:26
virtual void OnLeaveZone()
Definition: ZoneInstance.cs:36
virtual bool WillAutoSave
Definition: Zone.cs:267
Point GetSpawnPos(Chara c, ZoneTransition.EnterState destState=ZoneTransition.EnterState.Auto)
Definition: Zone.cs:1421

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

◆ MoveZone() [3/3]

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

Definition at line 3456 of file Chara.cs.

3457 {
3459 {
3460 state = state
3461 });
3462 }

◆ MutateRandom()

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

Definition at line 10382 of file Chara.cs.

10383 {
10384 if (!ether && vec >= 0 && HasElement(406) && EClass.rnd(5) != 0)
10385 {
10386 Say("resistMutation", this);
10387 return false;
10388 }
10389 IEnumerable<SourceElement.Row> ie = EClass.sources.elements.rows.Where((SourceElement.Row a) => a.category == (ether ? "ether" : "mutation") && !a.tag.Contains("noRandomMutation"));
10390 for (int i = 0; i < tries; i++)
10391 {
10392 SourceElement.Row row = ie.RandomItem();
10393 if (i == 0 && vec < 0 && ether && base.c_corruptionHistory != null && base.c_corruptionHistory.Count > 0)
10394 {
10395 if (EClass.sources.elements.map.ContainsKey(base.c_corruptionHistory.LastItem()))
10396 {
10397 row = EClass.sources.elements.map[base.c_corruptionHistory.LastItem()];
10398 }
10399 base.c_corruptionHistory.RemoveAt(base.c_corruptionHistory.Count - 1);
10400 if (base.c_corruptionHistory.Count == 0)
10401 {
10402 base.c_corruptionHistory = null;
10403 }
10404 }
10405 Element element = elements.GetElement(row.id);
10406 int num = 1;
10407 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))
10408 {
10409 continue;
10410 }
10411 if (element == null && !row.aliasParent.IsEmpty() && elements.Has(row.aliasParent))
10412 {
10413 row = EClass.sources.elements.alias[row.aliasParent];
10414 element = elements.GetElement(row.id);
10415 }
10416 bool flag = row.tag.Contains("neg");
10417 if (vec > 0)
10418 {
10419 if ((state >= BlessedState.Blessed && flag) || (state <= BlessedState.Cursed && !flag))
10420 {
10421 continue;
10422 }
10423 }
10424 else if (vec < 0 && ((state >= BlessedState.Blessed && !flag) || (state <= BlessedState.Cursed && flag)))
10425 {
10426 continue;
10427 }
10428 bool flag2 = true;
10429 if (element != null)
10430 {
10431 num = element.Value + ((vec != 0) ? vec : ((EClass.rnd(2) == 0) ? 1 : (-1)));
10432 if (num > element.source.max)
10433 {
10434 num = element.source.max - 1;
10435 }
10436 flag = (flag && num > element.Value) || (!flag && num < element.Value);
10437 flag2 = num > element.Value;
10438 if (vec > 0 && !flag2)
10439 {
10440 continue;
10441 }
10442 }
10443 Say(flag2 ? "mutation_gain" : "mutation_loose", this);
10444 SetFeat(row.id, num);
10445 if (flag2 && ether)
10446 {
10447 if (base.c_corruptionHistory == null)
10448 {
10449 base.c_corruptionHistory = new List<int>();
10450 }
10451 base.c_corruptionHistory.Add(row.id);
10452 if (IsPCFaction)
10453 {
10454 Element element2 = elements.GetElement(row.id);
10455 WidgetPopText.Say("popEther".lang(element2.Name, base.Name));
10456 }
10458 {
10459 EClass.player.flags.gotEtherDisease = true;
10460 Thing thing = ThingGen.Create("parchment");
10461 thing.SetStr(53, "letter_ether");
10462 Thing thing2 = ThingGen.Create("1165");
10463 thing2.SetBlessedState(BlessedState.Normal);
10464 Thing p = ThingGen.CreateParcel(null, thing2, thing);
10466 }
10467 }
10468 if (EClass.core.IsGameStarted && pos != null)
10469 {
10470 PlaySound(ether ? "mutation_ether" : "mutation");
10471 PlayEffect("mutation");
10473 Say(row.GetText(flag ? "textDec" : "textInc", returnNull: true) ?? row.alias, this);
10474 }
10475 return true;
10476 }
10477 Say("nothingHappens");
10478 return false;
10479 }
virtual void SetBlessedState(BlessedState s)
Definition: Card.cs:4053
void SetStr(string id, string value=null)
Definition: Card.cs:2584
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 10531 of file Chara.cs.

10532 {
10533 if (_historyFood != null)
10534 {
10535 while (_historyFood.Count > 5)
10536 {
10537 _historyFood.RemoveAt(_historyFood.Count - 1);
10538 }
10539 if (_historyFood[0].Count > 0)
10540 {
10541 _historyFood.Insert(0, new List<string>());
10542 }
10543 }
10544 }

Referenced by GameDate.AdvanceDay().

◆ OnBanish()

void Chara.OnBanish ( )
inline

Definition at line 1488 of file Chara.cs.

1489 {
1490 if (!IsGlobal)
1491 {
1492 return;
1493 }
1494 memberType = FactionMemberType.Default;
1495 foreach (Thing item in things.List((Thing a) => a.HasTag(CTAG.godArtifact)).ToList())
1496 {
1498 }
1499 UniqueData uniqueData = base.c_uniqueData;
1500 if (uniqueData != null)
1501 {
1502 Debug.Log(uniqueData.uidZone + "/" + EClass.game.spatials.map.ContainsKey(uniqueData.uidZone) + "/" + uniqueData.x + "/" + uniqueData.y);
1503 }
1504 if (uniqueData != null && EClass.game.spatials.map.ContainsKey(uniqueData.uidZone))
1505 {
1506 MoveHome(EClass.game.spatials.map[uniqueData.uidZone] as Zone, uniqueData.x, uniqueData.y);
1507 return;
1508 }
1509 Zone z = EClass.game.spatials.Find("somewhere");
1510 if (trait is TraitAdventurer)
1511 {
1512 z = EClass.world.region.ListTowns().RandomItem();
1513 SetHomeZone(z);
1514 }
1515 MoveZone(z, ZoneTransition.EnterState.RandomVisit);
1516 }
void PickOrDrop(Point p, string idThing, int idMat=-1, int num=1, bool msg=true)
Definition: Chara.cs:4440
List< Zone > ListTowns()
Definition: Region.cs:272
GlobalSpatialList map
int uidZone
Definition: UniqueData.cs:12

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

Referenced by FactionBranch.BanishMember().

◆ OnBeforeCreate()

override void Chara.OnBeforeCreate ( )
inlinevirtual

Reimplemented from Card.

Definition at line 1555 of file Chara.cs.

1556 {
1557 if (source.job == "*r")
1558 {
1559 base.c_idJob = EClass.sources.jobs.rows.Where((SourceJob.Row j) => j.playable < 4).RandomItem().id;
1560 }
1561 if (bp.idJob != null)
1562 {
1563 base.c_idJob = bp.idJob;
1564 }
1565 if (bp.idRace != null)
1566 {
1567 base.c_idRace = bp.idRace;
1568 }
1569 }
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 1571 of file Chara.cs.

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

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

1367 {
1368 isCreated = true;
1369 _cbits1.Bits = (uint)_cints[0];
1370 InitStats(onDeserialize: true);
1371 body.SetOwner(this, deserialized: true);
1372 elements.ApplyElementMap(base.uid, SourceValueType.Chara, job.elementMap, base.DefaultLV);
1373 elements.ApplyElementMap(base.uid, SourceValueType.Chara, race.elementMap, base.DefaultLV);
1374 if (global != null && global.goal != null)
1375 {
1376 global.goal.SetOwner(this);
1377 }
1378 if (IsPCC)
1379 {
1380 pccData.state = (base.isCensored ? PCCState.Naked : PCCState.Normal);
1381 }
1382 if (tempElements != null)
1383 {
1384 tempElements.SetParent(this);
1385 }
1386 UpdateAngle();
1388 Refresh();
1389 if (source.tag.Contains("boss"))
1390 {
1391 bossText = true;
1392 }
1393 sharedCheckTurn = EClass.rnd(200);
1394 }
int sharedCheckTurn
Definition: Chara.cs:120
void UpdateAngle()
Definition: Chara.cs:3717
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 8707 of file Chara.cs.

8708 {
8709 Say("give_erohon", this);
8710 AddCondition<ConParalyze>(50, force: true);
8711 AddCondition<ConConfuse>(50, force: true);
8712 AddCondition<ConFear>(1000, force: true);
8713 ModAffinity(EClass.pc, 100);
8714 t.Destroy();
8715 Talk("pervert");
8716 }

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

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

◆ OnInsulted()

void Chara.OnInsulted ( )
inline

Definition at line 8509 of file Chara.cs.

8510 {
8511 if (!isDead)
8512 {
8513 if (HasElement(1231))
8514 {
8515 Talk("insulted");
8516 AddCondition<ConEuphoric>(100 * Evalue(1231));
8517 }
8518 else if (EClass.rnd(20) == 0)
8519 {
8520 SetFeat(1231, 1, msg: true);
8521 }
8522 }
8523 }

References EClass.rnd().

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

◆ OnSerializing()

override void Chara.OnSerializing ( )
inlineprotectedvirtual

Reimplemented from Card.

Definition at line 1351 of file Chara.cs.

1352 {
1353 if (enemy != null)
1354 {
1355 SetInt(55, enemy.uid);
1356 }
1357 _cints[0] = (int)_cbits1.Bits;
1358 List<BodySlot> slots = body.slots;
1359 rawSlots = new int[slots.Count];
1360 for (int i = 0; i < slots.Count; i++)
1361 {
1362 rawSlots[i] = slots[i].elementId;
1363 }
1364 }
List< BodySlot > slots
Definition: CharaBody.cs:8
int[] rawSlots
Definition: Chara.cs:73
BitArray32 _cbits1
Definition: Chara.cs:84
uint Bits
Definition: BitArray32.cs:6

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

◆ OnSleep() [1/2]

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

Definition at line 10134 of file Chara.cs.

10135 {
10136 if (days < 1)
10137 {
10138 days = 1;
10139 }
10140 int num = power * days;
10141 if (stamina.value < 0)
10142 {
10143 stamina.Set(1);
10144 }
10145 if (isWeakToSunlight && isSunLit)
10146 {
10147 base.hp = 0;
10148 if (mana.value > 0)
10149 {
10150 mana.Set(0);
10151 }
10152 AddCondition<ConBurning>(1000, force: true);
10153 }
10154 else
10155 {
10156 HealHP(num);
10157 stamina.Mod(10 + 25 * num / 100 * (100 + elements.GetFeatRef(1642)) / 100);
10158 mana.Mod(num);
10159 }
10160 if (IsPCFaction)
10161 {
10162 hunger.Mod(20);
10163 }
10164 sleepiness.Set(0);
10165 if (!IsMinion)
10166 {
10167 interest = 100;
10168 }
10169 Cure(CureType.Sleep, power);
10170 }
virtual void HealHP(int a, HealSource origin=HealSource.None)
Definition: Card.cs:4165
bool isWeakToSunlight
Definition: Chara.cs:154
int GetFeatRef(int ele, int idx=0)

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

◆ OnSleep() [2/2]

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

Definition at line 10114 of file Chara.cs.

10115 {
10116 bool isSunLit = pos.IsSunLit;
10117 TraitPillow traitPillow = pos.FindThing<TraitPillow>();
10118 int num = bed?.Power ?? 20;
10119 if (traitPillow != null)
10120 {
10121 num += traitPillow.owner.Power / 2;
10122 }
10123 if (bed != null)
10124 {
10125 num += bed.Evalue(750) * 5;
10126 if (bed.trait is TraitBedCoffin)
10127 {
10128 isSunLit = false;
10129 }
10130 }
10131 OnSleep(num, days, isSunLit);
10132 }
void OnSleep(Thing bed=null, int days=1)
Definition: Chara.cs:10114
Thing FindThing(Func< Thing, bool > func)
Definition: Point.cs:1146

References bed.

Referenced by LayerSleep.Advance().

◆ ParseBodySlot()

int Chara.ParseBodySlot ( string  s)
inlineprivate

Definition at line 2273 of file Chara.cs.

2274 {
2275 return s switch
2276 {
2277 "é ­" => 30,
2278 "首" => 31,
2279 "体" => 32,
2280 "背" => 33,
2281 "手" => 35,
2282 "指" => 36,
2283 "è…•" => 34,
2284 "è…°" => 37,
2285 "è¶³" => 39,
2286 _ => -1,
2287 };
2288 }

Referenced by ApplyRace(), and ResetBody().

◆ PerformWork()

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

Definition at line 9577 of file Chara.cs.

9578 {
9579 Hobby hobby = new Hobby();
9580 hobby.id = session.id;
9581 WorkSummary workSummary = _workSummary;
9582 hobby.GetAI(this).OnPerformWork(IsRealTime);
9583 if (!isHobby)
9584 {
9585 workSummary.progress += EClass.rnd(5) + 5;
9586 }
9587 int num = PerformWork(hobby, 0, isHobby);
9588 int num2 = PerformWork(hobby, 1, isHobby);
9589 int num3 = PerformWork(hobby, 2, isHobby);
9590 int num4 = PerformWork(hobby, 3, isHobby);
9591 workSummary.money += num;
9592 workSummary.food += num2;
9593 workSummary.knowledge += num3;
9594 workSummary.material += num4;
9595 int PerformWork(Hobby work, int idx, bool isHobby)
9596 {
9597 if (idx >= work.source.resources.Length)
9598 {
9599 return 0;
9600 }
9601 int num5 = work.source.resources[idx];
9602 int num6 = num5;
9603 num5 = Rand.Range(num5 * (100 - work.source.resources[idx]) / 100, num5);
9604 num5 = num5 * (isHobby ? 50 : 100) * session.efficiency / 10000;
9605 if (num6 > 0 && num5 <= 0)
9606 {
9607 num5 = 1;
9608 }
9609 return num5;
9610 }
9611 }
virtual void OnPerformWork(bool realtime)
Definition: AIWork.cs:150
void PerformWork(WorkSession session, bool isHobby=false, bool IsRealTime=false)
Definition: Chara.cs:9577
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 4460 of file Chara.cs.

4461 {
4462 if (t.trait is TraitCard && t.isNew && EClass.game.config.autoCollectCard && !t.c_idRefCard.IsEmpty())
4463 {
4465 return t;
4466 }
4467 if (t.parent == this)
4468 {
4469 return t;
4470 }
4471 t = TryPoisonPotion(t);
4472 ThingContainer.DestData dest = things.GetDest(t, tryStack);
4473 if (!dest.IsValid)
4474 {
4475 if (t.parent != EClass._zone)
4476 {
4477 if (IsPC)
4478 {
4479 Say("backpack_full_drop", t);
4480 SE.Drop();
4481 }
4482 return EClass._zone.AddCard(t, pos).Thing;
4483 }
4484 if (IsPC)
4485 {
4486 Say("backpack_full", t);
4487 }
4488 return t;
4489 }
4490 if (dest.stack != null)
4491 {
4492 if (msg)
4493 {
4494 PlaySound("pick_thing");
4495 Say("pick_thing", this, t);
4496 }
4497 t.TryStackTo(dest.stack);
4498 return dest.stack;
4499 }
4500 TryAbsorbRod(t);
4501 if (msg)
4502 {
4503 PlaySound("pick_thing");
4504 Say("pick_thing", this, t);
4505 }
4507 return dest.container.AddThing(t, tryStack);
4508 }
bool isNew
Definition: Card.cs:485
bool TryStackTo(Thing to)
Definition: Card.cs:3555
string c_idRefCard
Definition: Card.cs:1777
void TryReservePickupTutorial(Thing t)
Definition: Chara.cs:4554
Thing TryPoisonPotion(Thing t)
Definition: Chara.cs:4510
void TryAbsorbRod(Thing t)
Definition: Chara.cs:4524
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 4680 of file Chara.cs.

4681 {
4682 if (held == null)
4683 {
4684 return;
4685 }
4686 Card card = held;
4687 if (IsPC && held.invY == 1)
4688 {
4689 WidgetHotbar.dirtyCurrentItem = true;
4691 held = null;
4692 return;
4693 }
4694 if (held.isChara)
4695 {
4696 DropHeld();
4697 return;
4698 }
4700 {
4701 Say("canOnlyCarry", held);
4702 DropHeld();
4703 return;
4704 }
4705 bool flag = held != things.TryStack(held.Thing);
4706 if (!flag && things.IsOverflowing())
4707 {
4708 if (IsPC)
4709 {
4710 Say("backpack_full_drop", held);
4711 SE.Drop();
4712 }
4713 DropHeld();
4714 return;
4715 }
4716 if (msg)
4717 {
4718 PlaySound("pick_thing");
4719 Say("pick_held", this, card);
4720 if (IsPC && card.id == "statue_weird")
4721 {
4722 Say("statue_pick");
4723 }
4724 }
4725 if (IsPC)
4726 {
4727 WidgetHotbar.dirtyCurrentItem = true;
4728 if (!flag)
4729 {
4731 if (held.GetRootCard() != EClass.pc)
4732 {
4733 Pick(held.Thing, msg: false);
4734 }
4735 }
4736 }
4737 held = null;
4738 }
int invY
Definition: Card.cs:2007
bool IsHotItem
Definition: Card.cs:122
Card DropHeld(Point dropPos=null)
Definition: Chara.cs:4757
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 4440 of file Chara.cs.

4441 {
4442 if (num != 0)
4443 {
4444 PickOrDrop(p, ThingGen.Create(idThing, idMat).SetNum(num), msg);
4445 }
4446 }

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

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

◆ PickOrDrop() [2/2]

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

Definition at line 4448 of file Chara.cs.

4449 {
4450 if (things.GetDest(t).IsValid)
4451 {
4452 Pick(t, msg);
4453 }
4454 else
4455 {
4456 EClass._zone.AddCard(t, p);
4457 }
4458 }

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

◆ Refresh()

void Chara.Refresh ( bool  calledRecursive = false)
inline

Definition at line 1772 of file Chara.cs.

1773 {
1774 if (source == null)
1775 {
1776 Debug.LogError("source is null");
1777 SetSource();
1778 }
1779 if (ride != null && ride.source != null)
1780 {
1781 ride.Refresh(calledRecursive: true);
1782 }
1783 hasTelepathy = false;
1784 isWet = false;
1785 _isLevitating = HasElement(401) || (ride != null && ride._isLevitating);
1787 isWeakToSunlight = HasElement(1251) && !HasElement(431);
1788 base.isHidden = HasElement(415);
1789 isAstralBody = HasElement(1430);
1790 foreach (Condition condition in conditions)
1791 {
1792 condition.OnRefresh();
1793 }
1794 if (isWet)
1795 {
1796 base.isHidden = false;
1797 }
1799 SetDirtySpeed();
1800 if (host != null && !calledRecursive && host.source != null)
1801 {
1802 host.Refresh(calledRecursive: true);
1803 }
1804 }
virtual void OnRefresh()
bool isWet
Definition: Chara.cs:144
bool isAstralBody
Definition: Chara.cs:156
override void SetSource()
Definition: Chara.cs:2162
bool IsUndead
Definition: Chara.cs:914
bool IsHorror
Definition: Chara.cs:938
bool IsMachine
Definition: Chara.cs:926

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(), ElementContainerFaction.CheckDirty(), CharaBody.Equip(), HealAll(), Condition.Kill(), MakeMinion(), OnCreate(), OnDeserialized(), Game.OnLoad(), Player.OnLoad(), Player.OnStartNewGame(), Refresh(), CharaGenes.Remove(), ActRide.Ride(), CharaBody.Unequip(), UnmakeMinion(), and ActRide.Unride().

◆ RefreshFaithElement()

void Chara.RefreshFaithElement ( )
inline

Definition at line 10595 of file Chara.cs.

10596 {
10597 if (faithElements != null)
10598 {
10600 }
10602 if (idFaith == "eyth" && !HasElement(1228))
10603 {
10604 return;
10605 }
10606 SourceReligion.Row row = EClass.sources.religions.map.TryGetValue(idFaith);
10607 if (row == null)
10608 {
10609 return;
10610 }
10612 if (!HasCondition<ConExcommunication>())
10613 {
10614 SourceElement.Row row2 = EClass.sources.elements.alias.TryGetValue("featGod_" + row.id + "1");
10615 if (row2 != null)
10616 {
10617 faithElements.SetBase(row2.id, 1);
10618 }
10619 int[] array = row.elements;
10620 int num = GetPietyValue() * (120 + Evalue(1407) * 15 + Evalue(1228) * 20) / 100;
10621 for (int i = 0; i < array.Length; i += 2)
10622 {
10623 int num2 = array[i + 1] * num / 50;
10624 if (array[i] == 79)
10625 {
10626 num2 = EClass.curve(num2, array[i + 1] * 2, 10, 50);
10627 }
10628 if (num2 >= 20 && array[i] >= 950 && array[i] < 970)
10629 {
10630 num2 = 20;
10631 }
10632 faithElements.SetBase(array[i], Mathf.Max(num2, 1));
10633 }
10634 }
10636 }
string idFaith
Definition: Chara.cs:235
ElementContainer faithElements
Definition: Chara.cs:38
int GetPietyValue()
Definition: Chara.cs:10586
Element SetBase(string alias, int v, int potential=0)
SourceReligion religions

References EClass.curve(), SourceManager.elements, SourceReligion.Row.elements, SourceElement.Row.id, SourceReligion.Row.id, SourceManager.religions, ElementContainer.SetBase(), ElementContainer.SetParent(), and EClass.sources.

Referenced by TraitAltar._OnOffer(), Religion.JoinFaith(), Religion.LeaveFaith(), ReligionEyth.LeaveFaith(), Player.OnAdvanceDay(), Skill.OnChangeValue(), Player.OnCreateGame(), OnDeserialized(), ConExcommunication.OnRefresh(), ConExcommunication.OnRemoved(), and SetFaith().

◆ RefreshSpeed()

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

Definition at line 1954 of file Chara.cs.

1955 {
1956 if (currentZone != EClass._zone)
1957 {
1958 dirtySpeed = true;
1959 return;
1960 }
1961 if (ride != null && !ride.IsDeadOrSleeping)
1962 {
1964 _Speed = ride._Speed;
1965 info?.AddText("rideSpeed".lang(_Speed.ToString() ?? ""));
1966 }
1967 else if (host != null)
1968 {
1969 if (host.ride == this)
1970 {
1971 _Speed = Evalue(79);
1972 int a = Evalue(1423);
1973 int value = 100 + (int)_Speed * ((!race.tag.Contains("noRide")) ? 1 : 5) * Mathf.Max(a, 1) - base.STR - host.EvalueRiding() * 2 - (race.tag.Contains("ride") ? 50 : 0);
1974 _Speed = _Speed * 100 / Mathf.Clamp(value, 100, 1000);
1975 }
1976 else
1977 {
1978 _Speed = (Evalue(79) + host.Evalue(79)) / 2;
1979 }
1980 }
1981 else
1982 {
1983 _Speed = Evalue(79) + Evalue(407) / 2;
1984 }
1985 if (body.GetSlot(37, onlyEmpty: false)?.thing != null && HasElement(1209) && !HasElement(419))
1986 {
1987 _Speed -= 25L;
1988 info?.AddText(-25L, EClass.sources.elements.map[1209].GetName());
1989 }
1990 if (parasite != null)
1991 {
1992 long speed = _Speed;
1993 _Speed = _Speed * 100 / Mathf.Clamp(120 + parasite.LV * 2 - base.STR - Evalue(227) * 2, 100, 1000);
1994 info?.AddText(_Speed - speed, "parasiteSpeed".lang());
1995 }
1996 if (_Speed < elements.ValueWithoutLink(79) / 3)
1997 {
1999 info?.AddText("minSpeed".lang((elements.ValueWithoutLink(79) / 3).ToString() ?? ""));
2000 }
2001 int num = 100;
2002 if (EClass._zone.map != null && (EClass._zone.IsUnderwater || (base.Cell.IsTopWaterAndNoSnow && !base.Cell.isFloating)))
2003 {
2004 int num2 = Evalue(200);
2005 int num3 = Evalue(1252);
2006 num = 50 + Mathf.Clamp((int)Mathf.Sqrt(num2) * 5 - EClass._zone.DangerLv / 50, (num3 > 0) ? 50 : ((base.IsPowerful || IsMultisize) ? 40 : 0), 50) + Mathf.Clamp((int)Mathf.Sqrt(num2), 0, 25);
2007 if (info != null && num != 100)
2008 {
2009 info.AddFix(num - 100, EClass.sources.elements.map[200].GetName().ToTitleCase());
2010 }
2011 if (num3 > 0)
2012 {
2013 num += num3 * 20;
2014 info?.AddFix(num3 * 20, EClass.sources.elements.map[1252].GetName().ToTitleCase());
2015 }
2016 }
2017 if (IsPCFaction)
2018 {
2019 switch (burden.GetPhase())
2020 {
2021 case 1:
2022 num -= 10;
2023 info?.AddFix(-10, burden.GetPhaseStr());
2024 break;
2025 case 2:
2026 num -= 20;
2027 info?.AddFix(-20, burden.GetPhaseStr());
2028 break;
2029 case 3:
2030 num -= 30;
2031 info?.AddFix(-30, burden.GetPhaseStr());
2032 break;
2033 case 4:
2034 num -= (IsPC ? 50 : 100);
2035 info?.AddFix(IsPC ? (-50) : (-100), burden.GetPhaseStr());
2036 break;
2037 }
2038 if (IsPC)
2039 {
2040 switch (stamina.GetPhase())
2041 {
2042 case 1:
2043 num -= 10;
2044 info?.AddFix(-10, stamina.GetPhaseStr());
2045 break;
2046 case 0:
2047 num -= 20;
2048 info?.AddFix(-20, stamina.GetPhaseStr());
2049 break;
2050 }
2051 switch (sleepiness.GetPhase())
2052 {
2053 case 2:
2054 num -= 10;
2055 info?.AddFix(-10, sleepiness.GetPhaseStr());
2056 break;
2057 case 3:
2058 num -= 20;
2059 info?.AddFix(-20, sleepiness.GetPhaseStr());
2060 break;
2061 }
2062 switch (hunger.GetPhase())
2063 {
2064 case 3:
2065 case 4:
2066 num -= 10;
2067 info?.AddFix(-10, hunger.GetPhaseStr());
2068 break;
2069 case 5:
2070 num -= 30;
2071 info?.AddFix(-30, hunger.GetPhaseStr());
2072 break;
2073 }
2074 num += EClass.player.lastEmptyAlly * Evalue(1646);
2075 info?.AddFix(EClass.player.lastEmptyAlly * Evalue(1646), EClass.sources.elements.map[1646].GetName());
2076 }
2078 {
2079 num += EClass.player.lastEmptyAlly * 10 - 10;
2080 info?.AddFix(EClass.player.lastEmptyAlly * 10 - 10, "exceedParty".lang());
2081 }
2082 }
2083 else if (base.LV >= 1000 && !EClass.game.principal.disableVoidBlessing && !base.IsPCFactionOrMinion)
2084 {
2085 num += EClass.curve((base.LV - 900) / 100 * 10, 500, 100);
2086 info?.AddFix(EClass.curve((base.LV - 900) / 100 * 10, 500, 100), "enemySpeedBuff".lang());
2087 }
2088 if (HasCondition<ConGravity>())
2089 {
2090 num -= 30;
2091 info?.AddFix(-30, GetCondition<ConGravity>().Name);
2092 }
2093 if (_Speed < 10)
2094 {
2095 _Speed = 10L;
2096 }
2097 _Speed = _Speed * num / 100;
2098 if (_Speed < 10)
2099 {
2100 _Speed = 10L;
2101 info?.AddText("minSpeed".lang(10.ToString() ?? ""));
2102 }
2103 dirtySpeed = false;
2104 }
Thing thing
Definition: BodySlot.cs:8
override string ToString()
Definition: Chara.cs:1207
bool dirtySpeed
Definition: Chara.cs:174
long _Speed
Definition: Chara.cs:176
void AddText(string text, FontColor col=FontColor.Warning)
Definition: ELEMENT.cs:111
void AddFix(int v, string text)
Definition: ELEMENT.cs:132
bool disableVoidBlessing
int lastEmptyAlly
Definition: Player.cs:1263

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

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

◆ RefreshWorkElements()

void Chara.RefreshWorkElements ( ElementContainer  parent = null)
inline

Definition at line 9392 of file Chara.cs.

9393 {
9394 if (workElements != null)
9395 {
9397 }
9398 workElements = null;
9399 if (IsPCParty || homeBranch == null || homeBranch.owner == null)
9400 {
9401 return;
9402 }
9403 foreach (Hobby item in ListHobbies())
9404 {
9405 TryAdd(item);
9406 }
9407 foreach (Hobby item2 in ListWorks())
9408 {
9409 TryAdd(item2);
9410 }
9411 if (workElements != null)
9412 {
9414 }
9415 void TryAdd(Hobby h)
9416 {
9417 if (!h.source.elements.IsEmpty())
9418 {
9419 if (workElements == null)
9420 {
9422 }
9423 for (int i = 0; i < h.source.elements.Length; i += 2)
9424 {
9425 int num = h.source.elements[i];
9426 int num2 = h.source.elements[i + 1];
9427 int num3 = 100;
9428 if (num != 2115 && num != 2207)
9429 {
9430 num3 = h.GetEfficiency(this) * homeBranch.efficiency / 100;
9431 if (num3 <= 0)
9432 {
9433 continue;
9434 }
9435 }
9436 workElements.ModBase(num, (num2 < 0) ? (num2 / 10) : Mathf.Max(1, h.source.elements[i + 1] * num3 / 1000));
9437 }
9438 }
9439 }
9440 }
ElementContainer workElements
Definition: Chara.cs:40
int GetEfficiency(Chara c)
Definition: Hobby.cs:31

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

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

◆ RemoveAllStances()

void Chara.RemoveAllStances ( )
inline

Definition at line 10019 of file Chara.cs.

10020 {
10021 for (int num = conditions.Count - 1; num >= 0; num--)
10022 {
10023 Condition condition = conditions[num];
10024 if (condition.Type == ConditionType.Stance)
10025 {
10026 condition.Kill();
10027 }
10028 }
10029 }

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

Referenced by CharaGenes.Remove().

◆ RemoveCondition< T >()

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

Definition at line 9870 of file Chara.cs.

9870 : Condition
9871 {
9872 for (int num = conditions.Count - 1; num >= 0; num--)
9873 {
9874 if (conditions[num] is T)
9875 {
9876 conditions[num].Kill();
9877 break;
9878 }
9879 }
9880 }

References Condition.Kill().

◆ RemoveGlobal()

void Chara.RemoveGlobal ( )
inline

◆ RemoveLastBodyPart()

void Chara.RemoveLastBodyPart ( bool  msg = false)
inline

Definition at line 2301 of file Chara.cs.

2302 {
2303 if (body.slots.Count != 0)
2304 {
2305 BodySlot bodySlot = body.slots.LastItem();
2306 body.RemoveBodyPartAt(body.slots.Count - 1);
2307 if (msg)
2308 {
2309 Say("lose_bodyparts", this, Element.Get(bodySlot.elementId).GetName().ToLower());
2310 PlaySound("offering");
2311 }
2312 }
2313 }
int elementId
Definition: BodySlot.cs:6
void RemoveBodyPartAt(int idx)
Definition: CharaBody.cs:344

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

Referenced by TraitFoodEggFertilized.Incubate().

◆ RequestProtection()

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

Definition at line 8728 of file Chara.cs.

8729 {
8730 if (HasCondition<StanceTaunt>() || base.isRestrained || attacker == this)
8731 {
8732 return false;
8733 }
8734 if (host != null && host.isRestrained)
8735 {
8736 return false;
8737 }
8738 if (base.IsPCFactionOrMinion && attacker.IsPCFactionOrMinion)
8739 {
8740 return false;
8741 }
8742 bool flag = false;
8743 foreach (Chara chara in EClass._map.charas)
8744 {
8745 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))
8746 {
8747 continue;
8748 }
8749 bool flag2 = chara.HasElement(1225) && !chara.GetBool(126);
8750 if ((!flag2 && (flag || EClass.rnd(2) == 0 || !chara.HasCondition<StanceTaunt>())) || chara.HasCooldown(1225))
8751 {
8752 continue;
8753 }
8754 int num = Mathf.Max(chara.Evalue(1649), (!flag2) ? 1 : 3);
8755 int num2 = Dist(chara);
8756 if (num2 > 25)
8757 {
8758 continue;
8759 }
8760 if (num2 > num || !chara.CanSeeLos(pos, num2))
8761 {
8762 if (!flag2)
8763 {
8764 continue;
8765 }
8766 Point nearestPoint = pos.GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: true, ignoreCenter: true);
8767 if (!nearestPoint.IsValid)
8768 {
8769 continue;
8770 }
8771 chara.Teleport(nearestPoint);
8772 chara.AddCooldown(1225, 10);
8773 num2 = Dist(chara);
8774 Say("intercept_loyal", chara, this);
8775 chara.SetEnemy(attacker);
8776 attacker.SetEnemy(chara);
8777 if (num2 > num || !chara.CanSeeLos(pos, num2))
8778 {
8779 continue;
8780 }
8781 }
8782 if (!flag && !HasElement(1225))
8783 {
8784 Say("intercept", chara, this);
8785 if (EClass.rnd(10) == 0)
8786 {
8787 chara.Talk("intercept", base.NameSimple);
8788 }
8789 if (attacker.enemy == this)
8790 {
8791 attacker.SetEnemy(chara);
8792 }
8793 action(chara);
8794 flag = true;
8795 }
8796 }
8797 return flag;
8798 }
void Teleport(Point point, bool silent=false, bool force=false)
Definition: Card.cs:6103
ConSuspend conSuspend
Definition: Chara.cs:104
void AddCooldown(int idEle, int turns=0)
Definition: Chara.cs:9043
bool HasCooldown(int idEle)
Definition: Chara.cs:9094

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

9487 {
9488 if (_hobbies != null && _works != null)
9489 {
9490 _hobbies.Clear();
9491 _works.Clear();
9492 }
9493 else
9494 {
9495 _hobbies = new List<int>();
9496 _works = new List<int>();
9497 }
9498 if (source.hobbies.IsEmpty())
9499 {
9500 AddHobby(EClass.sources.hobbies.listHobbies.RandomItem().id);
9501 }
9502 else
9503 {
9504 string[] hobbies = source.hobbies;
9505 foreach (string text in hobbies)
9506 {
9507 if (EClass.sources.hobbies.alias.TryGetValue(text.Trim(), out var value))
9508 {
9509 AddHobby(value.id);
9510 continue;
9511 }
9512 ModUtil.LogModError("source chara row '" + source.id + "' has invalid hobby '" + text + "'", source);
9513 }
9514 }
9515 if (source.works.IsEmpty())
9516 {
9517 AddWork(EClass.sources.hobbies.listWorks.RandomItem().id);
9518 }
9519 else
9520 {
9521 string[] hobbies = source.works;
9522 foreach (string text2 in hobbies)
9523 {
9524 if (EClass.sources.hobbies.alias.TryGetValue(text2.Trim(), out var value2))
9525 {
9526 AddWork(value2.id);
9527 continue;
9528 }
9529 ModUtil.LogModError("source chara row '" + source.id + "' has invalid work '" + text2 + "'", source);
9530 }
9531 }
9533 }
WorkSummary GetWorkSummary()
Definition: Chara.cs:9535
void AddWork(int id)
Definition: Chara.cs:9474
void AddHobby(int id)
Definition: Chara.cs:9462
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 2315 of file Chara.cs.

2316 {
2317 for (int num = body.slots.Count - 1; num >= 0; num--)
2318 {
2319 BodySlot bodySlot = body.slots[num];
2320 if (bodySlot.elementId == 45 || bodySlot.elementId == 40)
2321 {
2322 return;
2323 }
2324 body.RemoveBodyPart(num);
2325 }
2326 string[] array = race.figure.Split('|');
2327 foreach (string s in array)
2328 {
2329 int num2 = ParseBodySlot(s);
2330 if (num2 != -1)
2331 {
2332 body.AddBodyPart(num2);
2333 }
2334 }
2336 }

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

◆ ResetUpgrade()

void Chara.ResetUpgrade ( )
inline

Definition at line 8928 of file Chara.cs.

8929 {
8930 _ = base.c_upgrades;
8931 }

Referenced by CoreDebug.ResetPetUpgrades().

◆ ResistCon()

void Chara.ResistCon ( Condition  con)
inline

Definition at line 10076 of file Chara.cs.

10077 {
10078 if (con.power > 0 && resistCon != null)
10079 {
10080 int a = ClassExtension.TryGetValue<int, int>((IDictionary<int, int>)resistCon, con.id, 0);
10081 if (1000 < EClass.rnd(a))
10082 {
10083 con.power = 0;
10084 }
10085 else if (500 < EClass.rnd(a))
10086 {
10087 con.power /= 5;
10088 }
10089 else if (200 < EClass.rnd(a))
10090 {
10091 con.power /= 3;
10092 }
10093 else if (100 < EClass.rnd(a))
10094 {
10095 con.power /= 2;
10096 }
10097 }
10098 }

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

◆ RestockEquip()

void Chara.RestockEquip ( bool  onCreate)
inline

Definition at line 4849 of file Chara.cs.

4850 {
4851 string equip = source.equip;
4852 if (equip.IsEmpty())
4853 {
4854 equip = job.equip;
4855 }
4856 if (equip == "none")
4857 {
4858 return;
4859 }
4860 bool flag = true;
4861 switch (id)
4862 {
4863 case "kettle":
4864 case "quru":
4865 case "loytel":
4866 case "shojo":
4867 EQ_ID("staff_long", 1);
4868 EQ_CAT("head");
4869 EQ_CAT("torso");
4870 EQ_CAT("arm");
4871 return;
4872 case "adv_yukiimo":
4873 if (onCreate)
4874 {
4875 EQ_ID("tail_snowleopard");
4876 }
4877 break;
4878 case "adv_kiria":
4879 if (onCreate)
4880 {
4881 EQ_ID("sword_zephir");
4882 }
4883 break;
4884 case "adv_mesherada":
4885 if (onCreate)
4886 {
4887 EQ_ID("dagger_hathaway");
4888 }
4889 break;
4890 case "adv_verna":
4891 if (onCreate)
4892 {
4893 EQ_ID("staff_long", -1, Rarity.Legendary);
4894 }
4895 if (onCreate)
4896 {
4897 EQ_ID("cloak_wing", -1, Rarity.Mythical);
4898 }
4899 break;
4900 case "big_sister":
4901 if (onCreate)
4902 {
4903 EQ_ID("sword_muramasa");
4904 }
4905 break;
4906 case "adv_gaki":
4907 if (onCreate)
4908 {
4909 EQ_ID("dagger_gaki");
4910 }
4911 if (onCreate)
4912 {
4913 EQ_ID("dagger_ninto");
4914 }
4915 break;
4916 case "adv_ivory":
4917 EQ_ID("dagger", -1, Rarity.Legendary);
4918 AddThing("60");
4919 break;
4920 case "adv_wini":
4921 if (onCreate)
4922 {
4923 EQ_ID("staff_Cat", -1, Rarity.Mythical);
4924 }
4926 if (onCreate)
4927 {
4928 AddThing("1071");
4929 }
4930 break;
4931 case "namamani":
4932 if (onCreate)
4933 {
4934 AddThing("gun_gravity2");
4935 }
4936 break;
4937 case "lomias":
4938 if (onCreate)
4939 {
4940 AddThing("bow_vindale");
4941 }
4942 break;
4943 case "unseenhand":
4944 if (onCreate)
4945 {
4946 EQ_ID("martial_ring");
4947 }
4948 break;
4949 case "larnneire":
4950 if (onCreate)
4951 {
4952 EQ_ID("EtherDagger2");
4953 }
4954 break;
4955 case "keeper_garden":
4956 if (!body.HasWeapon())
4957 {
4958 EQ_ID("sword_ragnarok");
4959 }
4960 break;
4961 case "ungaga_pap":
4962 if (onCreate)
4963 {
4964 EQ_ID("axe_destruction");
4965 }
4966 break;
4967 case "lurie_boss":
4968 if (onCreate)
4969 {
4970 EQ_ID("ribbon_duponne");
4971 }
4972 break;
4973 case "seeker":
4974 if (onCreate)
4975 {
4976 EQ_ID("helm_seeker");
4977 }
4978 EQ_ID("robe_pope");
4979 EQ_ID("sword_katana");
4980 EQ_ID("staff");
4981 EQ_ID("sword_katana");
4982 if (onCreate)
4983 {
4984 EQ_ID("boots_seven");
4985 }
4986 if (onCreate)
4987 {
4988 for (int i = 0; i < 20; i++)
4989 {
4991 }
4992 EQ_Item("panty");
4993 AddThing("plat").SetNum(6);
4994 }
4995 break;
4996 case "ephrond":
4997 if (onCreate)
4998 {
4999 AddThing("guitar_efrond");
5000 }
5001 break;
5002 case "ashland":
5003 if (onCreate)
5004 {
5005 AddThing("guitar_ash");
5006 }
5007 break;
5008 case "swordkeeper":
5009 if (onCreate)
5010 {
5011 EQ_ID("EtherDagger");
5012 }
5013 break;
5014 case "mech_angel":
5015 if (onCreate)
5016 {
5017 Thing thing = ThingGen.Create("pole_holy");
5018 thing.SetReplica(on: true);
5019 thing.rarity = Rarity.Normal;
5020 thing.elements.SetTo(60, -15);
5021 thing.elements.SetTo(418, -100);
5022 thing.elements.SetTo(93, 50);
5023 AddThing(thing);
5024 body.Equip(thing);
5025 flag = false;
5026 }
5027 break;
5028 case "azzrasizzle":
5029 if (onCreate)
5030 {
5031 EQ_ID("staff_magius");
5032 }
5033 break;
5034 case "sorin":
5035 if (onCreate)
5036 {
5037 EQ_ID("staff_insanity");
5038 }
5039 break;
5040 case "robot":
5041 if (onCreate)
5042 {
5043 EQ_ID("sword_katana");
5044 }
5045 break;
5046 case "mimu":
5047 if (onCreate)
5048 {
5049 EQ_ID("staff_leek");
5050 }
5051 break;
5052 case "kumatan":
5053 if (onCreate)
5054 {
5055 EQ_ID("dagger_hocho");
5056 }
5057 break;
5058 case "mad_rich":
5059 if (onCreate)
5060 {
5061 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));
5062 ModCurrency(a);
5063 }
5064 break;
5065 }
5066 if (!TryEquipRanged())
5067 {
5068 switch (id)
5069 {
5070 case "tyche":
5071 case "trooper":
5072 case "mech_scarab":
5073 AddThing("gun_laser");
5074 break;
5075 case "rocketman":
5076 {
5077 Thing thing2 = AddThing("panzerfaust");
5078 thing2.ChangeMaterial("iron");
5079 thing2.c_ammo = 0;
5080 break;
5081 }
5082 default:
5083 switch (equip)
5084 {
5085 case "archer":
5086 EQ_CAT((EClass.rnd(4) == 0) ? "crossbow" : "bow");
5087 break;
5088 case "inquisitor":
5089 case "gunner":
5090 EQ_CAT("gun");
5091 break;
5092 }
5093 break;
5094 }
5095 }
5096 int num = ((base.rarity >= Rarity.Mythical) ? (base.LV * 3) : ((base.rarity >= Rarity.Legendary) ? (base.LV * 2) : base.LV));
5097 if (trait is TraitAdventurer)
5098 {
5099 num *= 3;
5100 }
5101 if (race.id == "asura")
5102 {
5103 for (int j = 0; j < 4; j++)
5104 {
5105 EQ_CAT(job.weapon.RandomItem());
5106 }
5107 }
5108 for (int k = 0; k < ((!(race.id == "mutant")) ? 1 : (2 + base.LV / 30)); k++)
5109 {
5110 if (flag)
5111 {
5112 if (source.ContainsTag("boxer"))
5113 {
5114 EQ_CAT("martial");
5115 }
5116 else if (!job.weapon.IsEmpty())
5117 {
5118 if (race.id == "mutant" || (body.slotMainHand != null && body.slotMainHand.thing == null))
5119 {
5120 EQ_CAT(job.weapon.RandomItem());
5121 }
5122 if (race.id == "mutant" || (Evalue(131) > 0 && EClass.rnd(2) == 0))
5123 {
5124 EQ_CAT(job.weapon.RandomItem());
5125 }
5126 }
5127 }
5128 EQ_CAT("torso");
5129 if (EClass.rnd(num) > 5)
5130 {
5131 EQ_CAT("arm");
5132 }
5133 if (EClass.rnd(num) > 10)
5134 {
5135 EQ_CAT("head");
5136 }
5137 if (EClass.rnd(num) > 15)
5138 {
5139 EQ_CAT("back");
5140 }
5141 if (EClass.rnd(num) > 20)
5142 {
5143 EQ_CAT("ring");
5144 }
5145 if (EClass.rnd(num) > 25)
5146 {
5147 EQ_CAT("amulet");
5148 }
5149 if (EClass.rnd(num) > 30)
5150 {
5151 EQ_CAT("foot");
5152 }
5153 if (EClass.rnd(num) > 35)
5154 {
5155 EQ_CAT("waist");
5156 }
5157 if (EClass.rnd(num) > 40)
5158 {
5159 EQ_CAT("ring");
5160 }
5161 }
5162 if (trait is TraitBard)
5163 {
5164 AddThing(ThingGen.Create("lute"));
5165 if (EClass.debug.enable || EClass.rnd(100) == 0)
5166 {
5167 EQ_ID("shield_lute");
5168 }
5169 }
5170 if (HasTag(CTAG.shield))
5171 {
5172 EQ_CAT("shield");
5173 }
5174 }
int FameLv
Definition: Card.cs:2352
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
Definition: Card.cs:3194
Card AddCard(Card c)
Definition: Card.cs:3243
void SetReplica(bool on)
Definition: Card.cs:3228
bool HasWeapon()
Definition: CharaBody.cs:400
BodySlot slotMainHand
Definition: CharaBody.cs:10
void EQ_Item(string s, int num=1)
Definition: Chara.cs:5284
Thing EQ_ID(string s, int mat=-1, Rarity r=Rarity.Random)
Definition: Chara.cs:5248
bool TryEquipRanged()
Definition: Chara.cs:8146
void EQ_CAT(string s)
Definition: Chara.cs:5268
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 5176 of file Chara.cs.

5177 {
5178 switch (id)
5179 {
5180 case "lomias":
5181 if (ShouldRestock("_meat"))
5182 {
5183 AddCard(ThingGen.Create("_meat").MakeRefFrom("begger"));
5184 }
5185 break;
5186 case "fiama":
5187 Restock("book_story", 1);
5188 break;
5189 case "rock_thrower":
5190 Restock("stone", 10 + EClass.rnd(10));
5191 break;
5192 case "giant":
5193 Restock("rock", 2 + EClass.rnd(10));
5194 break;
5195 case "farris":
5196 Restock("lute", 1);
5197 Restock("book_story_home", 1);
5198 break;
5199 case "begger":
5200 break;
5201 }
5202 void Restock(string id, int num)
5203 {
5204 if (ShouldRestock(id))
5205 {
5206 AddCard(ThingGen.Create(id).SetNum(num));
5207 }
5208 }
5209 bool ShouldRestock(string id)
5210 {
5211 return things.Find(id) == null;
5212 }
5213 }

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

◆ Revive()

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

Definition at line 5328 of file Chara.cs.

5329 {
5330 if (!isDead)
5331 {
5332 return;
5333 }
5334 isDead = false;
5335 base.hp = MaxHP / 3;
5336 mana.value = 0;
5337 stamina.value = 0;
5338 if (hunger.value > 30)
5339 {
5340 hunger.value = 30;
5341 }
5342 sleepiness.value = 0;
5344 RemoveCondition<StanceTaunt>();
5345 if (id == "keeper_garden")
5346 {
5347 SaiyanRevive();
5348 }
5349 if (IsPC)
5350 {
5352 {
5353 Msg.Say("noDeathPenalty2", this);
5354 }
5356 {
5357 Msg.Say("noDeathPenalty", this);
5358 }
5359 else
5360 {
5362 }
5363 List<Thing> dropList = new List<Thing>();
5364 EClass.pc.things.Foreach(delegate(Thing t)
5365 {
5367 {
5368 t.ignoreAutoPick = true;
5369 dropList.Add(t);
5370 }
5371 }, onlyAccessible: false);
5372 foreach (Thing item in dropList)
5373 {
5375 Msg.Say("backpack_full_drop", item);
5376 }
5377 EClass.player.preventDeathPenalty = false;
5378 }
5379 if (IsPCFaction && homeBranch != null)
5380 {
5381 homeBranch.Log("bRevive", this);
5382 }
5383 if (p != null)
5384 {
5385 if (!p.IsInBounds)
5386 {
5388 }
5389 EClass._zone.AddCard(this, p);
5390 if (msg)
5391 {
5392 SE.Play("revive");
5393 Msg.Say("revive", this);
5394 PlayEffect("revive");
5395 }
5396 SetCensored(enable: false);
5397 }
5398 }
void SetCensored(bool enable)
Definition: Card.cs:8145
Card parentCard
Definition: Card.cs:106
void SaiyanRevive()
Definition: Chara.cs:5400
void ApplyDeathPenalty()
Definition: Chara.cs:5434
bool disableDeathPenaltyProtection
Point GetCenterPos()
Definition: MapBounds.cs:52
int days
Definition: Player.cs:75
bool preventDeathPenalty
Definition: Player.cs:1237
void Foreach(Action< Thing > action, bool onlyAccessible=true)
override int SelfWeight
Definition: Thing.cs:64

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

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

◆ Rotate()

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

Reimplemented from Card.

Definition at line 3656 of file Chara.cs.

3657 {
3658 if (renderer.hasActor)
3659 {
3660 base.dir = (base.dir + ((!reverse) ? 1 : (-1))).Clamp(0, 3, loop: true);
3661 }
3662 else
3663 {
3664 base.dir = ((base.dir == 0) ? 1 : 0);
3665 }
3666 UpdateAngle();
3668 }

Referenced by AI_Dance.Run().

◆ SaiyanRevive()

void Chara.SaiyanRevive ( )
inline

Definition at line 5400 of file Chara.cs.

5401 {
5402 ModCorruption(-100000);
5403 if (base.LV < 10000000)
5404 {
5405 SetLv(base.LV * 10 + 9);
5406 }
5407 Refresh();
5408 base.hp = MaxHP;
5409 mana.value = mana.max;
5410 stamina.value = stamina.max;
5411 bossText = true;
5412 }
void ModCorruption(int a)
Definition: Chara.cs:10223

References Stats.max.

◆ ScaleByPrincipal()

Chara Chara.ScaleByPrincipal ( )
inline

◆ SetAI()

AIAct Chara.SetAI ( AIAct  g)
inline

Definition at line 9262 of file Chara.cs.

9263 {
9264 if (IsPC)
9265 {
9267 }
9268 if (ai.IsRunning)
9269 {
9270 if (ai == g && ai.IsNoGoal)
9271 {
9272 return g;
9273 }
9274 ai.Cancel();
9275 if (ai == g)
9276 {
9277 Debug.Log("goal is g:" + ai?.ToString() + "/" + this);
9278 return g;
9279 }
9280 }
9281 if (HasCondition<ConWait>())
9282 {
9283 RemoveCondition<ConWait>();
9284 }
9285 ai = g;
9286 ai.SetOwner(this);
9287 if (IsPC)
9288 {
9290 }
9291 return g;
9292 }
virtual bool IsNoGoal
Definition: AIAct.cs:74
void SetOwner(Chara c)
Definition: AIAct.cs:189
QueueManager queues
Definition: Player.cs:1281
void OnSetGoal(AIAct newGoal)
Definition: QueueManager.cs:23

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

Referenced by _Move(), Zone.Activate(), Zone.AddCard(), Thing.DoAct(), UIInventory.DoAct(), Player.EndTurn(), GiveGift(), TraitTrolley.OnActivateTrap(), BaseListPeople.OnClick(), LayerCraft.OnClickCraft(), OnCreate(), ZoneInstanceBout.OnLeaveZone(), AM_Paint.OnUpdateInput(), ActBloodsuck.Perform(), ActNTR.Perform(), ActRanged.Perform(), ActRestrain.Perform(), ActSlime.Perform(), ActPlan.Item.Perform(), LayerCraftFloat.RefreshCraft(), AI_Idle.Run(), GoalSpot.Run(), ZoneEventSiege.ShouldEnd(), Zone.Simulate(), ConSleep.SuccubusVisit(), ActThrow.Throw(), TaskManager.Designations.TryRemoveDesignation(), InvOwnerCraft.TryStartCraft(), and GoalWork.TryWork().

◆ SetAIAggro()

void Chara.SetAIAggro ( )
inline

Definition at line 9252 of file Chara.cs.

9253 {
9254 SetAI(new GoalCombat());
9255 }

Referenced by ZoneEventQuest.AggroEnemy().

◆ SetAIIdle()

void Chara.SetAIIdle ( )
inline

Definition at line 9248 of file Chara.cs.

9249 {
9250 }

◆ SetAIImmediate()

void Chara.SetAIImmediate ( AIAct  g)
inline

◆ SetCooldown()

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

Definition at line 9061 of file Chara.cs.

9062 {
9063 if (_cooldowns == null)
9064 {
9065 _cooldowns = new List<int>();
9066 }
9067 bool flag = false;
9068 for (int i = 0; i < _cooldowns.Count; i++)
9069 {
9070 if (_cooldowns[i] / 1000 == idEle)
9071 {
9072 if (turns == 0)
9073 {
9074 _cooldowns.RemoveAt(i);
9075 }
9076 else
9077 {
9078 _cooldowns[i] = idEle * 1000 + turns;
9079 }
9080 flag = true;
9081 break;
9082 }
9083 }
9084 if (!flag && turns > 0)
9085 {
9086 AddCooldown(idEle, turns);
9087 }
9088 if (_cooldowns.Count == 0)
9089 {
9090 _cooldowns = null;
9091 }
9092 }

Referenced by ConTransmuteBat.OnRemoved().

◆ SetDir()

override void Chara.SetDir ( int  d)
inlinevirtual

Reimplemented from Card.

Definition at line 3649 of file Chara.cs.

3650 {
3651 base.dir = d;
3652 UpdateAngle();
3654 }

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

◆ SetDirtySpeed()

void Chara.SetDirtySpeed ( )
inline

Definition at line 1945 of file Chara.cs.

1946 {
1947 dirtySpeed = true;
1948 if (host != null)
1949 {
1951 }
1952 }

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

6529 {
6530 enemy = c;
6531 if (c == null)
6532 {
6533 if (ai is GoalCombat)
6534 {
6535 ai.Cancel();
6536 }
6537 }
6538 else
6539 {
6540 calmCheckTurn = 10 + EClass.rnd(30);
6541 }
6542 return c;
6543 }

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

5216 {
5218 Rarity rarity = Rarity.Normal;
5219 int num = ((base.LV >= 1000) ? 7 : ((base.LV >= 500) ? 5 : ((base.LV >= 250) ? 3 : ((base.LV >= 100) ? 2 : ((base.LV >= 50) ? 1 : 0)))));
5220 Rarity rarity2 = base.rarity;
5221 if (id == "big_sister")
5222 {
5223 num = (isOnCreate ? 8 : 4);
5224 }
5225 if (!isOnCreate && EClass.rnd(10) != 0)
5226 {
5227 num /= 2;
5228 }
5229 if (rarity2 == Rarity.Superior && EClass.rnd(10) <= num)
5230 {
5231 rarity = Rarity.Superior;
5232 }
5233 else if (rarity2 == Rarity.Legendary)
5234 {
5235 rarity = ((EClass.rnd(10) <= num) ? Rarity.Legendary : ((EClass.rnd(5) <= num) ? Rarity.Superior : Rarity.Normal));
5236 }
5237 else if (rarity2 >= Rarity.Mythical)
5238 {
5239 rarity = ((EClass.rnd(30) <= num) ? Rarity.Mythical : ((EClass.rnd(10) > num) ? Rarity.Superior : Rarity.Legendary));
5240 }
5241 if (rarity == Rarity.Normal && EClass.rnd(1000) == 0)
5242 {
5243 rarity = Rarity.Legendary;
5244 }
5245 CardBlueprint.current.rarity = rarity;
5246 }
static void Set(CardBlueprint _bp=null)
static CardBlueprint CharaGenEQ
static bool isOnCreate
Definition: Chara.cs:188

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

◆ SetFaction()

Chara Chara.SetFaction ( Faction  f)
inline

Definition at line 1466 of file Chara.cs.

1467 {
1468 _faction = null;
1469 faction = f;
1471 return this;
1472 }
Faction _faction
Definition: Chara.cs:160
Hostility GetHostility()
Definition: FACTION.cs:255

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

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

◆ SetFaith() [1/2]

void Chara.SetFaith ( Religion  r)
inline

Definition at line 1757 of file Chara.cs.

1758 {
1759 faith = r;
1761 }

References faith, and RefreshFaithElement().

◆ SetFaith() [2/2]

void Chara.SetFaith ( string  id)
inline

Definition at line 1752 of file Chara.cs.

1753 {
1755 }
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 10281 of file Chara.cs.

10282 {
10283 Feat feat = elements.GetElement(id) as Feat;
10284 int num = 0;
10285 if (feat != null && feat.Value > 0)
10286 {
10287 if (value == feat.Value)
10288 {
10289 return;
10290 }
10291 num = feat.Value;
10292 feat.Apply(-feat.Value, elements);
10293 }
10294 feat = elements.SetBase(id, value - (feat?.vSource ?? 0)) as Feat;
10295 if (feat.Value != 0)
10296 {
10297 feat.Apply(feat.Value, elements);
10298 }
10300 {
10301 Refresh();
10303 }
10304 if (!msg)
10305 {
10306 return;
10307 }
10308 if (feat.source.textInc.IsEmpty())
10309 {
10310 PlaySound("ding_skill");
10312 Say("gainFeat", this, feat.FullName);
10313 }
10314 else
10315 {
10316 bool flag = value < num;
10317 if (feat.source.tag.Contains("neg"))
10318 {
10319 flag = !flag;
10320 }
10321 switch (id)
10322 {
10323 case 1270:
10324 if (!flag)
10325 {
10326 PlaySound("chime_angel");
10327 }
10328 break;
10329 case 1271:
10330 if (!flag)
10331 {
10332 PlaySound("chime_devil");
10333 }
10334 break;
10335 default:
10336 PlaySound("mutation");
10337 break;
10338 }
10340 Say((value > num) ? feat.source.GetText("textInc") : feat.source.GetText("textDec"), this, feat.FullName);
10341 }
10343 }
Color Negative
Definition: MsgColors.cs:15
Color Ding
Definition: MsgColors.cs:11

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

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

◆ SetGlobal() [1/2]

Chara Chara.SetGlobal ( )
inline

Definition at line 1533 of file Chara.cs.

1534 {
1535 if (!IsGlobal)
1536 {
1538 global = new GlobalData();
1539 base.isSubsetCard = false;
1540 enemy = null;
1541 base.c_uidMaster = 0;
1542 }
1543 return this;
1544 }

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

1519 {
1520 SetGlobal();
1521 homeZone = _home;
1522 _home.AddCard(this, x, z);
1523 global.transition = new ZoneTransition
1524 {
1525 state = ZoneTransition.EnterState.Exact,
1526 x = x,
1527 z = z
1528 };
1529 orgPos = new Point(x, z);
1530 return this;
1531 }

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

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

◆ SetHomeZone()

Chara Chara.SetHomeZone ( Zone  zone)
inline

Definition at line 1474 of file Chara.cs.

1475 {
1476 homeZone = zone;
1477 SetGlobal();
1478 return this;
1479 }

References homeZone, and SetGlobal().

Referenced by Game.AddAdventurer(), Game.AddAdventurers(), FactionBranch.AddMemeber(), Zone_Specwing.OnActivate(), OnBanish(), CustomCharaContent.OnGameLoad(), and CoreDebug.QuickStart().

◆ SetHostility()

Chara Chara.SetHostility ( Hostility  h)
inline

Definition at line 1481 of file Chara.cs.

1482 {
1483 Hostility hostility2 = (base.c_originalHostility = h);
1484 this.hostility = hostility2;
1485 return this;
1486 }

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

◆ SetMainElement() [1/2]

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

Definition at line 2183 of file Chara.cs.

2184 {
2185 if (base.c_idMainElement != 0)
2186 {
2187 SetElements(base.c_idMainElement, remove: true);
2188 base.c_idMainElement = 0;
2189 }
2190 if (id != 0)
2191 {
2192 _ = EClass.sources.elements.map[id];
2193 SetElements(id, remove: false);
2194 base.c_idMainElement = id;
2195 if (elemental)
2196 {
2197 base.isElemental = true;
2198 _colorInt = 0;
2199 Color colorSprite = EClass.setting.elements[MainElement.source.alias].colorSprite;
2200 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);
2201 }
2202 _ability = null;
2203 }
2204 void SetElements(int idEle, bool remove)
2205 {
2206 elements.SetBase(idEle, (!remove) ? ((v == 0) ? 10 : v) : 0);
2207 elements.ModBase(EClass.sources.elements.alias[EClass.sources.elements.map[idEle].aliasRef].id, remove ? (-20) : 20);
2208 switch (idEle)
2209 {
2210 case 910:
2211 elements.ModBase(951, remove ? 10 : (-10));
2212 break;
2213 case 911:
2214 elements.ModBase(950, remove ? 10 : (-10));
2215 break;
2216 case 912:
2217 elements.ModBase(953, remove ? 10 : (-10));
2218 break;
2219 case 913:
2220 elements.ModBase(952, remove ? 10 : (-10));
2221 break;
2222 case 916:
2223 elements.ModBase(960, remove ? 10 : (-10));
2224 break;
2225 case 919:
2226 elements.ModBase(956, remove ? 10 : (-10));
2227 break;
2228 case 925:
2229 elements.ModBase(962, remove ? 10 : (-10));
2230 break;
2231 case 922:
2232 elements.ModBase(965, remove ? 10 : (-10));
2233 break;
2234 case 921:
2235 elements.ModBase(971, remove ? 10 : (-10));
2236 break;
2237 case 926:
2238 elements.ModBase(961, remove ? 10 : (-10));
2239 break;
2240 case 914:
2241 case 915:
2242 case 917:
2243 case 918:
2244 case 920:
2245 case 923:
2246 case 924:
2247 break;
2248 }
2249 }
2250 }
int _colorInt
Definition: Card.cs:70
CharaAbility _ability
Definition: Chara.cs:96
UD_String_ElementRef elements
Definition: GameSetting.cs:317

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

◆ SetMainElement() [2/2]

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

Definition at line 2174 of file Chara.cs.

2175 {
2176 if (!id.StartsWith("ele"))
2177 {
2178 id = "ele" + id;
2179 }
2180 SetMainElement(EClass.sources.elements.alias[id].id, v, elemental);
2181 }

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

10346 {
10347 SourceElement.Row row = EClass.sources.elements.map[idEle];
10349 Element element = elements.GetElement(idEle);
10350 Element element2 = elements.GetElement(row2.id);
10351 int num = element?.Value ?? 0;
10352 if (a < 0)
10353 {
10354 a = 0;
10355 }
10356 if (a > row.max)
10357 {
10358 a = row.max;
10359 }
10360 bool flag = (row.tag.Contains("neg") ? (a > num) : (a < num));
10361 if (a == 0 && (element == null || element.Value == 0))
10362 {
10364 return;
10365 }
10366 if (element != null && element.Value == a)
10367 {
10369 return;
10370 }
10371 if (element2 != null && element2.Value > 0)
10372 {
10373 SetFeat(element2.id, 0);
10374 }
10375 SetFeat(idEle, a);
10376 PlaySound("mutation");
10377 PlayEffect("mutation");
10379 Say(row.GetText(flag ? "textDec" : "textInc", returnNull: true) ?? row.alias, this);
10380 }

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

9258 {
9259 return SetAI(_NoGoalPC);
9260 }
static NoGoal _NoGoalPC
Definition: Chara.cs:200

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

◆ SetPCCState()

void Chara.SetPCCState ( PCCState  state)
inline

Definition at line 6917 of file Chara.cs.

6918 {
6919 if (IsPCC)
6920 {
6921 PCC.Get(pccData).Build(state);
6922 }
6923 }

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

6985 {
6986 p.mat = base.material;
6987 p.matColor = base.colorInt;
6988 if (!renderer.usePass)
6989 {
6990 return;
6991 }
6992 if (renderer.replacer != null)
6993 {
6994 p.tile = renderer.replacer.tile * ((!flipX) ? 1 : (-1));
6995 if (renderer.replacer.mat != -1)
6996 {
6997 p.mat = EClass.sources.materials.rows.TryGet(renderer.replacer.mat, 0);
6998 p.matColor = BaseTileMap.GetColorInt(ref p.mat.matColor, 100);
6999 p.color -= 1048576f;
7000 }
7001 }
7002 else if (source._tiles_snow.Length != 0 && EClass._zone.IsSnowCovered)
7003 {
7004 if (source._tiles_snow.Length > 1)
7005 {
7006 int num = ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % source._tiles_snow.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
7007 p.tile = source._tiles_snow[(num < source._tiles_snow.Length) ? num : 0] * ((!flipX) ? 1 : (-1));
7008 }
7009 else
7010 {
7011 p.tile = source._tiles_snow[0] * ((!flipX) ? 1 : (-1));
7012 }
7013 }
7014 else if (sourceCard._tiles.Length > 1)
7015 {
7016 int num2 = ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % sourceCard._tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
7017 p.tile = sourceCard._tiles[(num2 >= 0 && num2 < sourceCard._tiles.Length) ? num2 : 0] * ((!flipX) ? 1 : (-1));
7018 }
7019 else
7020 {
7021 p.tile = sourceCard._tiles[0] * ((!flipX) ? 1 : (-1));
7022 }
7023 p.dir = base.dir;
7024 }
static int GetColorInt(ref Color matColor, int p)
override bool flipX
Definition: Chara.cs:553
SourceMaterial.Row mat
Definition: RenderParam.cs:17
int[] _tiles
Definition: RenderRow.cs:12
SourceMaterial materials

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

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

◆ SetSortVal()

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

Reimplemented from Card.

Definition at line 7572 of file Chara.cs.

7573 {
7574 switch (m)
7575 {
7576 case UIList.SortMode.ByJob:
7577 sortVal = job._index * 10000 + sourceCard._index;
7578 break;
7579 case UIList.SortMode.ByRace:
7580 sortVal = race._index * 10000 * ((!IsHuman) ? 1 : (-1)) + sourceCard._index;
7581 break;
7582 case UIList.SortMode.ByFeat:
7583 sortVal = -GetTotalFeat();
7584 break;
7585 case UIList.SortMode.ByPartyOrder:
7586 sortVal = EClass.pc.party.members.IndexOf(this);
7587 return;
7588 default:
7589 sortVal = sourceCard._index * ((!IsHuman) ? 1 : (-1));
7590 break;
7591 case UIList.SortMode.ByWorkk:
7592 break;
7593 }
7594 if (base.isFav)
7595 {
7596 sortVal -= 100000000;
7597 }
7598 }
int sortVal
Definition: Card.cs:104
int GetTotalFeat()
Definition: Chara.cs:8437
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 2162 of file Chara.cs.

2163 {
2164 source = EClass.sources.charas.map.TryGetValue(id);
2165 if (source == null)
2166 {
2167 Debug.LogWarning("Chara " + id + " not found");
2168 id = "chicken";
2169 source = EClass.sources.charas.map[id];
2170 }
2171 path.walker = this;
2172 }

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

Referenced by Refresh().

◆ SetSummon()

void Chara.SetSummon ( int  duration)
inline

Definition at line 2515 of file Chara.cs.

2516 {
2517 base.c_summonDuration = duration;
2518 base.isSummon = true;
2519 }

Referenced by ActEffect.ProcAt(), and QuestEscort.ReleaseEscort().

◆ SetTempHand()

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

◆ ShouldEquip()

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

Definition at line 7914 of file Chara.cs.

7915 {
7916 if (t.IsRangedWeapon && t.category.slot == 0)
7917 {
7918 if (!CanEquipRanged(t))
7919 {
7920 return false;
7921 }
7922 int num = 0;
7923 foreach (Thing thing in things)
7924 {
7925 if (thing.IsRangedWeapon)
7926 {
7927 if (thing.category.slot != 0 && thing.isEquipped)
7928 {
7929 return false;
7930 }
7931 if (CanEquipRanged(thing) && thing.GetEquipValue() > num)
7932 {
7933 num = thing.GetEquipValue();
7934 }
7935 }
7936 }
7937 if (t.GetEquipValue() > num)
7938 {
7939 return true;
7940 }
7941 return false;
7942 }
7943 BodySlot bodySlot = body.GetSlot(t);
7944 if (bodySlot == null)
7945 {
7946 return false;
7947 }
7948 if (useFav)
7949 {
7950 switch (GetFavAttackStyle())
7951 {
7952 case AttackStyle.Default:
7953 case AttackStyle.TwoHand:
7954 if (t.IsMeleeWeapon)
7955 {
7956 bodySlot = body.slotMainHand;
7957 }
7958 else if (bodySlot.elementId == 35)
7959 {
7960 return false;
7961 }
7962 break;
7963 case AttackStyle.Shield:
7964 if (t.IsMeleeWeapon)
7965 {
7966 bodySlot = body.slotMainHand;
7967 }
7968 else if (bodySlot.elementId == 35 && t.IsMeleeWeapon)
7969 {
7970 return false;
7971 }
7972 break;
7973 case AttackStyle.TwoWield:
7974 if (bodySlot.elementId == 35 && !t.IsMeleeWeapon)
7975 {
7976 return false;
7977 }
7978 break;
7979 }
7980 }
7981 if (!body.IsEquippable(t, bodySlot, text: false))
7982 {
7983 return false;
7984 }
7985 if (bodySlot.thing != null && (bodySlot.thing.blessedState <= BlessedState.Cursed || bodySlot.thing.GetEquipValue() >= t.GetEquipValue()))
7986 {
7987 return false;
7988 }
7989 if (!base.IsPCFactionOrMinion)
7990 {
7991 int num2 = 0;
7992 foreach (Element value in t.elements.dict.Values)
7993 {
7994 if (value.Value <= 0)
7995 {
7996 int num3 = 100;
7997 switch (value.id)
7998 {
7999 case 418:
8000 num3 = 10;
8001 break;
8002 case 60:
8003 case 61:
8004 case 62:
8005 num3 = 200;
8006 break;
8007 case 962:
8008 num3 = 10000;
8009 break;
8010 }
8011 num2 += value.Value * num3 / 100;
8012 }
8013 }
8014 if (num2 < -40)
8015 {
8016 return false;
8017 }
8018 }
8019 if (t.HasTag(CTAG.gift) && t.c_uidAttune != base.uid)
8020 {
8021 return false;
8022 }
8023 return true;
8024 }
bool IsMeleeWeapon
Definition: Card.cs:2295
BlessedState blessedState
Definition: Card.cs:281
int c_uidAttune
Definition: Card.cs:1212
bool IsEquippable(Thing thing, BodySlot slot, bool text=true)
Definition: CharaBody.cs:110
AttackStyle GetFavAttackStyle()
Definition: Chara.cs:4805

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

8801 {
8802 if (IsPCFaction)
8803 {
8804 if (t.IsFood && t.category.id != "fish" && !t.IsDecayed)
8805 {
8806 return false;
8807 }
8808 if (t.trait.GetHealAction(this) != null)
8809 {
8810 return false;
8811 }
8812 if (t.IsThrownWeapon || t.IsRangedWeapon || t.IsAmmo)
8813 {
8814 return false;
8815 }
8816 if (t.trait is TraitBlanket || t.trait is TraitItemProc || t.trait is TraitBookSkill)
8817 {
8818 return false;
8819 }
8820 }
8821 if (t.isEquipped || t.rarity >= Rarity.Legendary || !t.trait.CanBeDestroyed || t.c_isImportant)
8822 {
8823 return false;
8824 }
8825 if (t.trait is TraitCurrency || t.trait is TraitTool)
8826 {
8827 return false;
8828 }
8829 switch (type)
8830 {
8831 case ClearInventoryType.SellAtTown:
8832 if (!t.isGifted && !t.isNPCProperty)
8833 {
8834 return false;
8835 }
8836 break;
8837 case ClearInventoryType.Purge:
8838 switch (t.category.id)
8839 {
8840 case "fish":
8841 if (EClass.rnd(3) == 0)
8842 {
8843 return true;
8844 }
8845 break;
8846 case "junk":
8847 case "garbage":
8848 if (EClass.rnd(3) != 0)
8849 {
8850 return true;
8851 }
8852 break;
8853 }
8854 if (t.id == "flyer")
8855 {
8856 return true;
8857 }
8858 if (!t.IsDecayed && EClass.rnd(3) == 0)
8859 {
8860 return false;
8861 }
8862 if (!things.IsFull() && t.IsRangedWeapon)
8863 {
8864 return false;
8865 }
8866 break;
8867 }
8868 return true;
8869 }
bool IsThrownWeapon
Definition: Card.cs:2299
bool IsFood
Definition: Card.cs:2229
bool isGifted
Definition: Card.cs:785
virtual Action GetHealAction(Chara c)
Definition: Trait.cs:635

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

◆ ShowDialog() [1/2]

void Chara.ShowDialog ( )
inline

Definition at line 7313 of file Chara.cs.

7314 {
7315 Zone_Nymelle zone_Nymelle = EClass._zone as Zone_Nymelle;
7316 if (conSuspend != null && IsPCParty)
7317 {
7318 RemoveCondition<ConSuspend>();
7319 }
7320 if (LayerDrama.forceJump == null)
7321 {
7322 if (IsDeadOrSleeping)
7323 {
7324 ShowDialog("_chara", "sleep");
7325 return;
7326 }
7327 if (EClass.pc.isHidden && !CanSee(EClass.pc))
7328 {
7329 ShowDialog("_chara", "invisible");
7330 return;
7331 }
7333 {
7335 ShowDialog("_chara", "give_card");
7336 Thing thing = ThingGen.Create("figure");
7337 thing.MakeFigureFrom(id);
7338 EClass.player.DropReward(thing);
7339 thing = ThingGen.Create("figure3");
7340 thing.MakeFigureFrom(id);
7341 EClass.player.DropReward(thing);
7342 return;
7343 }
7344 if (GetInt(71) == -2)
7345 {
7346 ShowDialog("_chara", "give_lunch");
7347 Thing t = CraftUtil.MakeLoveLunch(this);
7349 SetInt(71, EClass.world.date.GetRaw() + 43200);
7350 return;
7351 }
7352 if (base.isRestrained)
7353 {
7354 ShowDialog("_chara", "strain");
7355 return;
7356 }
7357 if (IsEscorted())
7358 {
7359 ShowDialog("_chara", "escort");
7360 return;
7361 }
7363 {
7364 string step = ((!(EClass._zone is Zone_Wedding)) ? "party" : (IsPCParty ? "wedding_love" : ((IsMarried || affinity.IsWeddingHater) ? "wedding_hater" : "wedding")));
7365 if (EClass._zone is Zone_Wedding && IsPCParty && base.c_love != null && !base.c_love.gaveCutter)
7366 {
7367 step = "wedding_cutter";
7368 EClass.player.DropReward(ThingGen.Create("dagger_cakecutter"));
7369 base.c_love.gaveCutter = true;
7370 }
7371 ShowDialog("_chara", step);
7372 return;
7373 }
7374 if (EClass.game.quests.OnShowDialog(this))
7375 {
7376 return;
7377 }
7378 if (id == "nino")
7379 {
7381 }
7382 switch (id)
7383 {
7384 case "loytel":
7385 {
7387 {
7388 EClass.game.quests.Get("pre_debt_runaway").Complete();
7389 EClass.player.flags.loytelEscaped = false;
7390 EClass.game.quests.Add("debt", "loytel");
7391 ShowDialog("loytel", "loytelEscaped");
7392 return;
7393 }
7394 QuestDebt questDebt = EClass.game.quests.Get<QuestDebt>();
7395 if (questDebt != null && questDebt.paid)
7396 {
7397 questDebt.stage++;
7398 if (questDebt.stage > 7)
7399 {
7400 questDebt.stage = 7;
7401 }
7402 ShowDialog("loytel", "debt" + questDebt.stage);
7403 return;
7404 }
7405 break;
7406 }
7407 case "farris":
7408 if (EClass._zone.id == "startVillage" || EClass._zone.id == "startVillage3" || EClass.game.IsSurvival)
7409 {
7410 ShowDialog("farris");
7411 return;
7412 }
7414 {
7415 case -1:
7416 ShowDialog("farris", "nymelle_noQuest");
7417 break;
7418 case 0:
7419 ShowDialog("farris", "nymelle_first");
7420 break;
7421 case 1:
7422 ShowDialog("farris", "home_first");
7423 break;
7424 default:
7425 ShowDialog("farris");
7426 break;
7427 }
7428 return;
7429 case "ashland":
7430 ShowDialog("ashland");
7431 return;
7432 case "fiama":
7433 if (zone_Nymelle != null && zone_Nymelle.IsCrystalLv && EClass.game.quests.GetPhase<QuestExploration>() == 3)
7434 {
7435 SoundManager.ForceBGM();
7436 LayerDrama.ActivateMain("mono", "nymelle_crystal");
7437 }
7439 {
7441 {
7442 EClass.player.flags.fiamaFirstDream = true;
7443 ShowDialog("fiama", "firstDream");
7444 }
7446 {
7447 ShowDialog("fiama", "giveStoryBook").SetOnKill(delegate
7448 {
7449 EClass.player.flags.fiamaStoryBookGiven = true;
7450 EClass.player.DropReward(ThingGen.Create("book_story"));
7451 });
7452 }
7453 else
7454 {
7455 ShowDialog("fiama");
7456 }
7457 }
7458 else
7459 {
7460 ShowDialog("fiama");
7461 }
7462 return;
7463 case "big_sister":
7465 {
7466 ShowDialog("big_sister", "little_saved");
7467 EClass.player.flags.little_saved = false;
7468 return;
7469 }
7471 {
7472 ShowDialog("big_sister", "little_dead");
7473 EClass.player.flags.little_killed = false;
7474 return;
7475 }
7476 break;
7477 }
7478 if (trait is TraitGuildDoorman)
7479 {
7480 string tag = ((trait is TraitDoorman_Fighter) ? "fighter" : ((trait is TraitDoorman_Mage) ? "mage" : "thief"));
7481 ShowDialog("guild_doorman", "main", tag);
7482 return;
7483 }
7484 if (trait is TraitGuildClerk)
7485 {
7486 string tag2 = ((trait is TraitClerk_Fighter) ? "fighter" : ((trait is TraitClerk_Mage) ? "mage" : "thief"));
7487 ShowDialog("guild_clerk", "main", tag2);
7488 return;
7489 }
7490 }
7491 bool flag = true;
7492 if (id == "parttimer_jure" && (!EClass._zone.IsFestival || !(EClass._zone is Zone_Noyel) || EClass.pc.faith == EClass.game.religions.Healing))
7493 {
7494 flag = false;
7495 }
7496 string book = "_chara";
7497 if (flag)
7498 {
7499 string text = GetStr("drama_override").IsEmpty(id);
7500 if (File.Exists(PackageIterator.GetFiles("Dialog/Drama/" + text + ".xlsx").LastOrDefault()?.FullName ?? (CorePath.DramaData + id + ".xlsx")))
7501 {
7502 book = text;
7503 }
7504 }
7506 }
bool CanGiveCard()
Definition: Affinity.cs:70
bool IsWeddingHater
Definition: Affinity.cs:36
void MakeFigureFrom(string id)
Definition: Card.cs:5936
void ShowDialog()
Definition: Chara.cs:7313
bool IsMarried
Definition: Chara.cs:615
bool DroppedCard(string id)
Definition: CodexManager.cs:46
void MarkCardDrop(string id)
Definition: CodexManager.cs:41
static string DramaData
Definition: CorePath.cs:174
static Thing MakeLoveLunch(Chara c)
Definition: CraftUtil.cs:220
bool IsSurvival
Definition: Game.cs:276
static string forceJump
Definition: LayerDrama.cs:18
static LayerDrama ActivateMain(string idSheet, string idStep=null, Chara target=null, Card ref1=null, string tag="")
Definition: LayerDrama.cs:61
bool loytelEscaped
Definition: Player.cs:508
int storyFiama
Definition: Player.cs:652
bool little_saved
Definition: Player.cs:472
bool fiamaStoryBookGiven
Definition: Player.cs:328
bool fiamaFirstDream
Definition: Player.cs:340
bool little_killed
Definition: Player.cs:484
CodexManager codex
Definition: Player.cs:1182
bool EnableDreamStory
Definition: Player.cs:1340
Thing DropReward(Thing t, bool silent=false)
Definition: Player.cs:2642
bool paid
Definition: QuestDebt.cs:10
int stage
Definition: QuestDebt.cs:13
bool OnShowDialog(Chara c)
Quest Add(string id, string idGlobalChara=null)
Definition: QuestManager.cs:29
int GetPhase(string id)
Quest Get(string id)
void Complete()
Definition: Quest.cs:473
ReligionHealing Healing
bool IsCrystalLv
Definition: Zone_Nymelle.cs:25
virtual bool IsFestival
Definition: Zone.cs:213

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

7509 {
7510 return _ShowDialog(book, null, step, tag);
7511 }
LayerDrama _ShowDialog(string book, string sheet, string step="main", string tag="")
Definition: Chara.cs:7513

References book.

◆ Slap()

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

Definition at line 6511 of file Chara.cs.

6512 {
6513 if (id == "olderyoungersister")
6514 {
6516 }
6517 PlaySound("whip");
6518 Say("slap", this, c);
6519 c.PlayAnime(AnimeID.Shiver);
6520 c.DamageHP(slapToDeath ? (c.MaxHP * 2) : (5 + EClass.rndHalf(EClass.pc.MaxHP / 3)), 919, 100, AttackSource.Condition);
6521 c.OnInsulted();
6522 if (slapToDeath && c.IsAliveInCurrentZone)
6523 {
6524 c.Die();
6525 }
6526 }
void PlayAnime(AnimeID id, bool force=false)
Definition: Card.cs:6562
void OnInsulted()
Definition: Chara.cs:8509
override void Die(Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None, Chara originalTarget=null)
Definition: Chara.cs:5497

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

10101 {
10102 RemoveCondition<ConAwakening>();
10103 AddCondition(Condition.Create(100, delegate(ConSleep con)
10104 {
10105 con.pcSleep = 15;
10106 con.pcBed = bed;
10107 con.pcPillow = pillow;
10108 con.pickup = pickup;
10109 con.posBed = posBed;
10110 con.posPillow = posPillow;
10111 }), force: true);
10112 }

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

8428 {
8429 Say("abCatSniff", this, c);
8430 AddCondition<ConHOT>(EClass.curve(50 + c.CHA * 5, 400, 100));
8431 c.ShowEmo(Emo.angry);
8432 ShowEmo(Emo.love);
8433 Talk("sniff");
8434 c.Talk(new string[4] { "labor", "disgust", "scold", "callGuards" }.RandomItem());
8435 }

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

4741 {
4742 return held.Split(a);
4743 }

References Card.Split().

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

◆ Stumble()

void Chara.Stumble ( int  mtp = 100)
inline

Definition at line 1928 of file Chara.cs.

1929 {
1930 bool flag = EClass._map.FindThing((Thing t) => t.IsInstalled && t.pos.Equals(EClass.pc.pos) && t.trait is TraitStairsUp) != null;
1931 Say(flag ? "dmgBurdenStairs" : "dmgBurdenFallDown", this);
1932 long num = MaxHP;
1933 if (Evalue(1421) > 0)
1934 {
1935 num = mana.max;
1936 }
1937 long num2 = (num * (base.ChildrenWeight * 100 / WeightLimit) / (flag ? 100 : 200) + 1) * mtp / 100;
1938 if (base.hp <= 0)
1939 {
1940 num2 *= 2;
1941 }
1942 DamageHP(num2, flag ? AttackSource.BurdenStairs : AttackSource.BurdenFallDown);
1943 }
Thing FindThing(Func< Thing, bool > func)
Definition: Map.cs:2618

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

4077 {
4078 if (host != null)
4079 {
4080 host.SyncRide();
4081 }
4082 if (ride != null)
4083 {
4084 SyncRide(ride);
4085 }
4086 if (parasite != null)
4087 {
4089 }
4090 }

References SyncRide().

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

◆ SyncRide() [2/2]

void Chara.SyncRide ( Chara  c)
inline

Definition at line 4092 of file Chara.cs.

4093 {
4094 if (!c.pos.Equals(pos))
4095 {
4096 if (!pos.IsValid)
4097 {
4098 Debug.LogError("exception: pos is not valid:" + pos?.ToString() + "/" + this);
4099 pos = new Point();
4100 }
4101 EClass._map.MoveCard(pos, c);
4102 }
4103 }

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

◆ TalkTopic()

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

Definition at line 7236 of file Chara.cs.

7237 {
7238 if (host == null && !IsInActiveZone)
7239 {
7240 return null;
7241 }
7242 if (!isSynced && (host == null || !host.isSynced) && topic != "dead")
7243 {
7244 return null;
7245 }
7246 if (IsPCParty)
7247 {
7248 int num = EClass.pc.party.members.Count - 1;
7249 switch (topic)
7250 {
7251 case "calm":
7252 if (EClass.rnd(num * 5) != 0)
7253 {
7254 return null;
7255 }
7256 break;
7257 case "aggro":
7258 if (EClass.rnd(num * 10) != 0)
7259 {
7260 return null;
7261 }
7262 break;
7263 case "kill":
7264 if (EClass.rnd(num * 3) != 0)
7265 {
7266 return null;
7267 }
7268 break;
7269 case "fov":
7270 return null;
7271 }
7272 }
7273 string topicText = GetTopicText(topic);
7274 if (topicText.IsEmpty())
7275 {
7276 return null;
7277 }
7278 HashSet<string> obj = new HashSet<string>
7279 {
7280 "_bracketTalk".lang(),
7281 "\"",
7282 "“",
7283 "「"
7284 };
7285 bool flag = topicText.StartsWith("*");
7286 bool flag2 = topicText.StartsWith("(");
7287 bool flag3 = obj.Any(topicText.StartsWith);
7288 topicText = ApplyTone(topicText);
7289 topicText = topicText.Replace('~', '*');
7290 Msg.SetColor(flag2 ? Msg.colors.Thinking : (flag3 ? Msg.colors.Talk : Msg.colors.Ono));
7291 Msg.Say(StripTalkSpecialCharacters(topicText.Replace("&", "")));
7292 if (topic == "dead")
7293 {
7294 EClass.ui.popGame.PopText(ApplyNewLine(topicText.StripBrackets()), null, "PopTextDead", default(Color), pos.Position() + EClass.setting.render.tc.textPosDead);
7295 }
7296 else if (flag || flag3 || flag2)
7297 {
7298 (host ?? this).renderer.Say(ApplyNewLine(topicText.StripBrackets()), default(Color), IsPCParty ? 0.6f : 0f);
7299 }
7300 return topicText;
7301 }
void Say(string text, Color c=default(Color), float duration=0f)
string ApplyNewLine(string text)
Definition: Card.cs:7188
string StripTalkSpecialCharacters(string text)
Definition: Card.cs:7169
string ApplyTone(string text, bool stripPun=false)
Definition: Card.cs:7268
string GetTopicText(string topic="calm")
Definition: Chara.cs:7202
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 4105 of file Chara.cs.

4106 {
4107 SyncRide();
4108 combatCount--;
4109 ignoreSPAbsorb = false;
4110 if (IsPC)
4111 {
4112 if (hasMovedThisTurn)
4113 {
4114 pos.Things.ForeachReverse(delegate(Thing t)
4115 {
4117 {
4118 AI_Goto aI_Goto = ai.Current as AI_Goto;
4119 if ((aI_Goto == null && !(ai is GoalManualMove)) || (aI_Goto != null && !aI_Goto.dest.Equals(pos)))
4120 {
4121 return;
4122 }
4123 }
4124 t.trait.OnStepped(this);
4125 });
4126 if (isDead)
4127 {
4128 return;
4129 }
4130 hasMovedThisTurn = false;
4132 {
4133 EClass.player.haltMove = false;
4134 ActionMode.Adv.TryCancelInteraction(sound: false);
4135 EInput.Consume(1);
4136 return;
4137 }
4138 if (EClass._zone.IsRegion)
4139 {
4141 {
4142 foreach (Chara member in EClass.pc.party.members)
4143 {
4144 if (member.hunger.value > 65)
4145 {
4146 member.InstantEat(null, sound: false);
4147 }
4148 }
4149 }
4150 Chara chara = null;
4152 if (cell2 != null && (cell2.zone == null || (cell2.zone is Zone_Field && !cell2.zone.IsPCFaction)))
4153 {
4154 foreach (Chara chara2 in EClass._map.charas)
4155 {
4156 if (!chara2.IsPCFactionOrMinion && !chara2.IsGlobal && chara2.pos.Equals(EClass.pc.pos))
4157 {
4158 chara = chara2;
4159 break;
4160 }
4161 }
4162 }
4163 if (chara != null)
4164 {
4166 {
4167 EClass.player.safeTravel = 5 + EClass.rnd(5);
4168 }
4169 EClass._zone.RemoveCard(chara);
4170 Msg.Say("encounter");
4171 EClass.player.EnterLocalZone(encounter: true, chara);
4172 }
4173 else if (EClass.player.safeTravel <= 0)
4174 {
4175 if (cell2 != null && cell2.zone == null && !EClass.debug.ignoreEncounter)
4176 {
4178 if (!tileInfo.shore)
4179 {
4180 bool num = EClass.pc.HasCondition<ConWardMonster>();
4181 bool flag = EClass.pc.HasCondition<ConDrawMonster>();
4182 bool flag2 = EClass.game.quests.Get<QuestEscort>() != null;
4183 int num2 = (tileInfo.isRoad ? 22 : 12);
4184 if (flag2)
4185 {
4186 num2 = (tileInfo.isRoad ? 16 : 10);
4187 }
4188 if (num)
4189 {
4190 num2 *= (flag2 ? 2 : 20);
4191 }
4192 if (flag)
4193 {
4194 num2 /= 2;
4195 }
4196 if (EClass.rnd(num2) == 0)
4197 {
4198 Msg.Say("encounter");
4199 if (!flag)
4200 {
4201 EClass.player.safeTravel = 5 + EClass.rnd(5);
4202 }
4203 EClass.player.EnterLocalZone(encounter: true);
4204 }
4205 }
4206 }
4207 }
4208 else
4209 {
4211 }
4212 }
4213 }
4214 EClass.player.pickupDelay = 0f;
4215 if (EClass.player.returnInfo != null)
4216 {
4218 if (EClass.player.returnInfo.turns <= 0)
4219 {
4221 {
4222 EClass.player.returnInfo = null;
4224 }
4225 else
4226 {
4228 {
4229 int uidDest = EClass.player.returnInfo.uidDest;
4230 Zone zone = null;
4231 if (uidDest != 0)
4232 {
4233 zone = EClass.game.spatials.map.TryGetValue(uidDest) as Zone;
4234 }
4235 if (zone == null || zone.destryoed)
4236 {
4237 zone = EClass.world.region;
4238 }
4240 {
4241 Msg.Say("returnFail");
4242 }
4243 else
4244 {
4245 Msg.Say("returnComplete");
4246 EClass.player.uidLastTravelZone = 0;
4248 EClass.player.lastZonePos = null;
4249 }
4250 EClass.player.returnInfo = null;
4251 return;
4252 }
4253 EClass.player.returnInfo = null;
4254 Msg.Say("returnOverweight");
4255 }
4256 }
4257 }
4258 if ((HasNoGoal || !ai.IsRunning) && !WillConsumeTurn())
4259 {
4261 return;
4262 }
4265 {
4266 RecipeUpdater.dirty = true;
4267 }
4269 }
4270 else
4271 {
4272 actTime = EClass.player.baseActTime * Mathf.Max(0.1f, (float)EClass.pc.Speed / (float)Speed);
4273 hasMovedThisTurn = false;
4274 }
4277 {
4278 return;
4279 }
4281 if (host != null && !consumeTurn)
4282 {
4283 if (host.ride == this && ((host.hasMovedThisTurn && IsInCombat) || (enemy != null && turn % 3 != 0)))
4284 {
4285 consumeTurn = true;
4286 }
4287 if (host.parasite == this && enemy != null && EClass.rnd(10) > EClass.rnd(host.Evalue(227) + 10))
4288 {
4289 if (Dist(enemy) < 3 && EClass.rnd(2) == 0)
4290 {
4291 Say("parasite_fail", this, host);
4292 if (EClass.rnd(2) == 0 && GetInt(106) == 0)
4293 {
4294 Talk("parasite_fail");
4295 }
4296 }
4297 consumeTurn = true;
4298 }
4299 }
4300 if (consumeTurn)
4301 {
4302 if (IsPC)
4303 {
4305 }
4306 }
4307 else
4308 {
4309 if (base.isRestrained)
4310 {
4311 TryUnrestrain();
4312 }
4313 if (enemy != null)
4314 {
4316 {
4317 enemy = null;
4318 }
4319 else if (!IsPC && (ai.CancelOnAggro || !ai.IsRunning))
4320 {
4321 SetAIAggro();
4322 }
4323 }
4324 if (HasNoGoal || !ai.IsRunning)
4325 {
4326 ChooseNewGoal();
4327 }
4328 ai.Tick();
4329 }
4330 Cell cell = base.Cell;
4332 {
4333 AddCondition<ConWet>(50);
4334 if (pos.IsHotSpring)
4335 {
4336 hygiene.Mod(2);
4337 }
4338 }
4339 if (cell.sourceSurface.id == 20)
4340 {
4341 AddCondition<ConBurning>();
4342 }
4343 if (IsPC && !EClass._zone.IsRegion && cell.CanSuffocate() && !EClass.debug.godMode && !HasElement(1252))
4344 {
4345 AddCondition<ConSuffocation>(800 / (100 + EvalueMax(200, -5) * 10), force: true);
4346 }
4347 CellEffect e;
4348 if (cell.effect != null)
4349 {
4350 e = cell.effect;
4351 switch (e.id)
4352 {
4353 case 1:
4354 case 2:
4355 case 4:
4356 if (IsLevitating)
4357 {
4358 Say("levitating");
4359 break;
4360 }
4361 AddCondition<ConWet>(50);
4362 ProcEffect();
4363 break;
4364 case 3:
4365 PlaySound("fire_step");
4366 AddCondition<ConBurning>(30);
4367 break;
4368 case 5:
4369 if (!isWet)
4370 {
4371 PlaySound("bubble");
4372 AddCondition<ConWet>(30);
4373 ProcEffect();
4374 }
4375 break;
4376 case 6:
4377 if (hasMovedThisTurn)
4378 {
4379 Say("abMistOfDarkness_step", this);
4380 }
4381 AddCondition<ConDark>(e.power);
4382 break;
4383 }
4384 }
4385 if (IsPC)
4386 {
4387 if (EClass.player.currentHotItem.Thing != null)
4388 {
4390 }
4392 }
4393 void ClearEffect()
4394 {
4395 EClass._map.SetLiquid(cell.x, cell.z, 0, 0);
4396 }
4397 void ProcEffect()
4398 {
4399 if (e.idEffect != 0)
4400 {
4401 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
4402 {
4403 aliasEle = EClass.sources.elements.map[e.idEle].alias,
4404 n1 = e.n1,
4405 refVal = e.refVal
4406 });
4407 ClearEffect();
4408 }
4409 }
4410 }
virtual bool CancelOnAggro
Definition: AIAct.cs:80
bool TryCancelInteraction(bool sound=true)
Definition: AM_Adv.cs:1115
void SetTurbo(int mtp=-1)
Definition: AM_Adv.cs:1086
static AM_Adv Adv
Definition: ActionMode.cs:15
virtual void OnEndPlayerTurn()
int turn
Definition: Card.cs:68
void TryUnrestrain(bool force=false, Chara c=null)
Definition: Card.cs:7502
bool isHostileAct
Definition: CellEffect.cs:74
EffectId idEffect
Definition: CellEffect.cs:38
bool isCursed
Definition: CellEffect.cs:98
bool isBlessed
Definition: CellEffect.cs:86
CellEffect effect
Definition: Cell.cs:102
byte z
Definition: Cell.cs:64
byte x
Definition: Cell.cs:62
void InstantEat(Thing t=null, bool sound=true)
Definition: Chara.cs:7868
int Speed
Definition: Chara.cs:1118
static bool consumeTurn
Definition: Chara.cs:184
void SetAIAggro()
Definition: Chara.cs:9252
bool ignoreSPAbsorb
Definition: Chara.cs:148
void ChooseNewGoal()
Definition: Chara.cs:9133
bool WillConsumeTurn()
Definition: Chara.cs:3794
bool ignoreEncounter
Definition: CoreDebug.cs:216
bool shore
Definition: EloMap.cs:50
TileInfo GetTileInfo(int gx, int gy)
Definition: EloMap.cs:286
ConfigPreference preference
Definition: Game.cs:97
virtual Thing Thing
Definition: HotItem.cs:38
void SetLiquid(int x, int z, CellEffect effect=null)
Definition: Map.cs:1503
static string SayNothingHappen()
Definition: Msg.cs:96
int turns
Definition: Player.cs:84
bool haltMove
Definition: Player.cs:1241
float baseActTime
Definition: Player.cs:1269
void EnterLocalZone(bool encounter=false, Chara mob=null)
Definition: Player.cs:2018
HotItem currentHotItem
Definition: Player.cs:1167
int safeTravel
Definition: Player.cs:987
int eloY
Definition: Point.cs:81
int eloX
Definition: Point.cs:79
bool IsHotSpring
Definition: Point.cs:375
bool destryoed
Definition: Spatial.cs:45
virtual void OnTickHeld()
Definition: Trait.cs:1162
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 3806 of file Chara.cs.

3807 {
3808 if (_cooldowns != null)
3809 {
3810 TickCooldown();
3811 }
3812 turn++;
3813 consumeTurn = false;
3814 preventRegen = false;
3815 emoIcon = Emo2.none;
3816 if (base.isSummon)
3817 {
3818 base.c_summonDuration--;
3819 if (base.c_summonDuration <= 0)
3820 {
3821 Die();
3822 return;
3823 }
3824 }
3826 {
3827 AddCondition<ConWet>(20);
3828 }
3829 switch (turn % 50)
3830 {
3831 case 0:
3832 happiness = (hunger.value + stamina.value + depression.value + bladder.value + hygiene.value) / 5;
3833 break;
3834 case 1:
3835 if (!IsPC || !EClass.debug.godMode)
3836 {
3837 if (EClass.rnd(2) == 0 && !HasCondition<ConAwakening>())
3838 {
3839 sleepiness.Mod(1);
3840 }
3841 if (EClass.rnd(3) == 0)
3842 {
3843 hunger.Mod(1);
3844 }
3845 if (IsPC && (sleepiness.GetPhase() != 0 || stamina.GetPhase() <= 1))
3846 {
3847 Tutorial.Play("sleep");
3848 }
3849 }
3850 break;
3851 case 2:
3852 if (parasite != null)
3853 {
3854 ModExp(227, (int)((EClass._zone.IsRegion ? 5 : 40) + parasite.affinity.CurrentStage));
3855 }
3856 if (ride != null)
3857 {
3858 ModExp(226, (int)((EClass._zone.IsRegion ? 5 : 40) + ride.affinity.CurrentStage));
3859 }
3860 break;
3861 case 3:
3862 {
3863 int phase = hygiene.GetPhase();
3864 int num = 0;
3865 num = ((!IsPC) ? ((phase > 3) ? 50 : 0) : ((phase > 3) ? 50 : 0));
3866 if (num > EClass.rnd(100))
3867 {
3868 hygiene.Mod(-1);
3869 }
3870 break;
3871 }
3872 case 4:
3873 if (IsPC)
3874 {
3876 }
3877 break;
3878 case 5:
3879 case 30:
3881 {
3882 AddCondition<ConBurning>(1000, force: true);
3883 }
3884 break;
3885 case 10:
3886 if (HasElement(1250))
3887 {
3888 if (!HasCondition<ConVampire>())
3889 {
3890 AddCondition<ConVampire>();
3891 }
3892 if (!IsPC && !HasCooldown(8793))
3893 {
3894 bool flag = false;
3895 flag = ((!HasCondition<ConTransmuteBat>()) ? (!HasElement(431) && pos.IsSunLit) : (body.HasElement(431) || (EClass.world.date.IsNight && !pos.IsSunLit)));
3896 if (flag && base.IsPCFactionOrMinion && !EClass._zone.IsPCFactionOrTent && EClass._zone.HasLaw && pos.ListWitnesses(this).Count > 0 && !HasCondition<ConBurning>())
3897 {
3898 flag = false;
3899 }
3900 if (flag)
3901 {
3902 UseAbility("SpTransmuteBat", this);
3903 }
3904 }
3905 }
3906 if (HasElement(1423) && !HasCondition<ConPeaky>())
3907 {
3908 AddCondition<ConPeaky>();
3909 }
3910 break;
3911 }
3912 if (turn % 200 == 0)
3913 {
3915 }
3916 if (IsPCParty)
3917 {
3918 if (dirtyWeight)
3919 {
3920 CalcBurden();
3921 }
3922 int phase2 = burden.GetPhase();
3923 int phase3 = hunger.GetPhase();
3924 if (phase3 >= 4)
3925 {
3926 preventRegen = true;
3927 }
3928 if (EClass.rnd(EClass._zone.IsRegion ? 100 : 30) == 0 && phase2 >= 3)
3929 {
3930 Say("dmgBurden", this);
3931 DamageHP(MaxHP * (base.ChildrenWeight * 100 / WeightLimit) / 1000 + 1, AttackSource.Burden);
3932 if (isDead)
3933 {
3934 return;
3935 }
3936 }
3937 if (EClass.rnd(12) == 0)
3938 {
3939 if (IsPC)
3940 {
3941 if (phase2 > 0)
3942 {
3943 ModExp(207, 1 + phase2 * phase2);
3944 }
3945 }
3946 else
3947 {
3948 ModExp(207, 4);
3949 }
3950 }
3951 if (IsPC)
3952 {
3953 if (phase3 >= 5)
3954 {
3955 if (!(ai is AI_Eat) && EClass.rnd(5) == 0)
3956 {
3957 DamageHP(1 + EClass.rnd(2) + MaxHP / 50, AttackSource.Hunger);
3958 }
3959 if (!isDead && EClass.rnd(3) == 0)
3960 {
3961 stamina.Mod(-1);
3962 }
3963 }
3964 if (isDead)
3965 {
3966 return;
3967 }
3968 phase3 = stamina.GetPhase();
3969 if (phase3 <= 0)
3970 {
3971 preventRegen = true;
3972 }
3974 {
3975 if (EClass.rnd(100) == 0 && !isConfused)
3976 {
3977 Msg.Say("rain_confuse");
3978 AddCondition<ConConfuse>(500);
3979 }
3980 if (EClass.rnd(300) == 0 && !isBlind)
3981 {
3982 Msg.Say("rain_confuse");
3983 AddCondition<ConBlind>(200);
3984 }
3985 }
3986 if (turn % (200000 / Mathf.Max(100 + Evalue(409) * 10, 50)) == 0)
3987 {
3988 ModCorruption(1);
3989 }
3990 }
3991 }
3992 if (!IsPC)
3993 {
3994 int num2 = Evalue(409);
3995 if (num2 > 0 && turn % (200000 / Mathf.Max(100 + num2 * 10, 50)) == 0)
3996 {
3997 ModCorruption(1);
3998 }
3999 }
4000 for (int num3 = conditions.Count - 1; num3 >= 0; num3--)
4001 {
4002 if (num3 < conditions.Count)
4003 {
4004 Condition condition = conditions[num3];
4005 if (!condition.TimeBased)
4006 {
4007 condition.Tick();
4008 }
4009 if (!condition.IsKilled)
4010 {
4011 if (condition.ConsumeTurn)
4012 {
4013 consumeTurn = true;
4014 }
4015 if (condition.PreventRegen)
4016 {
4017 preventRegen = true;
4018 }
4019 if (condition.EmoIcon != 0 && condition.EmoIcon > emoIcon)
4020 {
4021 emoIcon = condition.EmoIcon;
4022 }
4023 }
4024 if (isDead)
4025 {
4026 return;
4027 }
4028 }
4029 }
4030 switch (id)
4031 {
4032 case "cocoon_alien":
4033 case "cocoon":
4034 if (!EClass._zone.IsRegion && !IsDisabled && 1.0005f - (float)base.hp / (float)MaxHP > EClass.rndf(1f) && !pos.IsSunLit)
4035 {
4036 HatchEgg();
4037 return;
4038 }
4039 consumeTurn = true;
4040 break;
4041 case "tsunami":
4042 if (elements.Base(79) >= 30)
4043 {
4044 if (IsInCombat)
4045 {
4046 elements.SetTo(79, elements.Base(79) * 3 / 4);
4047 }
4048 break;
4049 }
4050 Die();
4051 return;
4052 }
4053 if (pos.IsBlocked)
4054 {
4055 preventRegen = true;
4056 }
4057 if (!preventRegen)
4058 {
4059 if (EClass.rnd(25) == 0 && base.hp < MaxHP)
4060 {
4061 HealHP(EClass.rnd(Evalue(300) / 3 + 1) + 1);
4062 elements.ModExp(300, 8f);
4063 }
4064 if (EClass.rnd(8) == 0 && mana.value < mana.max)
4065 {
4066 mana.Mod(EClass.rnd(Evalue(301) / 2 + 1) + 1);
4067 elements.ModExp(301, 8f);
4068 }
4069 if (EClass.rnd(20) == 0 && !IsPC && stamina.value < stamina.max)
4070 {
4071 stamina.Mod(EClass.rnd(5) + 1);
4072 }
4073 }
4074 }
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:6032
bool dirtyWeight
Definition: Card.cs:88
bool HasElement(int idEle)
Definition: CharaBody.cs:412
void TickCooldown()
Definition: Chara.cs:9114
void DiminishTempElements(int a=1)
Definition: Chara.cs:10715
Emo2 emoIcon
Definition: Chara.cs:108
bool UseAbility(int idAct, Card tc=null, Point pos=null, bool pt=false)
Definition: Chara.cs:5990
bool isBlind
Definition: Chara.cs:132
static bool preventRegen
Definition: Chara.cs:186
void CalcBurden()
Definition: Chara.cs:1913
virtual bool IsKilled
Definition: Condition.cs:8
override void Tick()
Definition: Condition.cs:87
void UpdateNyan()
Definition: Player.cs:2482
List< Chara > ListWitnesses(Chara criminal, int radius=4, WitnessType type=WitnessType.crime, Chara target=null)
Definition: Point.cs:835
static void Play(string idStep)
Definition: Tutorial.cs:7
bool IsRaining
Definition: Weather.cs:117
bool IsPCFactionOrTent
Definition: Zone.cs:480

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

Referenced by _Move().

◆ TickCooldown()

void Chara.TickCooldown ( )
inline

Definition at line 9114 of file Chara.cs.

9115 {
9116 for (int num = _cooldowns.Count - 1; num >= 0; num--)
9117 {
9118 if (_cooldowns[num] % 1000 == 1)
9119 {
9120 _cooldowns.RemoveAt(num);
9121 }
9122 else
9123 {
9124 _cooldowns[num]--;
9125 }
9126 }
9127 if (_cooldowns.Count == 0)
9128 {
9129 _cooldowns = null;
9130 }
9131 }

◆ TickWork()

void Chara.TickWork ( VirtualDate  date)
inline

Definition at line 9544 of file Chara.cs.

9545 {
9547 if (span != TimeTable.Span.Work && span != 0)
9548 {
9549 return;
9550 }
9551 WorkSummary workSummary = GetWorkSummary();
9552 if (span == TimeTable.Span.Work)
9553 {
9554 if (workSummary.work != null)
9555 {
9556 PerformWork(workSummary.work, isHobby: false, date.IsRealTime);
9557 }
9558 }
9559 else if (workSummary.hobbies.Count > 0)
9560 {
9561 PerformWork(workSummary.hobbies.RandomItem(), isHobby: true, date.IsRealTime);
9562 }
9563 }
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 1207 of file Chara.cs.

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

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

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

◆ TryAbsorbRod()

void Chara.TryAbsorbRod ( Thing  t)
inline

Definition at line 4524 of file Chara.cs.

4525 {
4526 if (!IsPC || !(t.trait is TraitRod) || t.c_charges <= 0 || !HasElement(1564))
4527 {
4528 return;
4529 }
4530 Say("absorbRod", this, t);
4531 TraitRod rod = t.trait as TraitRod;
4532 bool flag = false;
4533 if (rod.source != null)
4534 {
4535 using IEnumerator<SourceElement.Row> enumerator = EClass.sources.elements.rows.Where((SourceElement.Row a) => a.id == rod.source.id).GetEnumerator();
4536 if (enumerator.MoveNext())
4537 {
4538 SourceElement.Row current = enumerator.Current;
4539 if (IsPC)
4540 {
4541 GainAbility(current.id, t.c_charges * 100, t);
4542 flag = true;
4543 }
4544 }
4545 }
4546 if (!flag)
4547 {
4548 mana.Mod(-50 * t.c_charges);
4549 }
4550 t.c_charges = 0;
4552 }
int c_charges
Definition: Card.cs:1309
void GainAbility(int ele, int mtp=100, Thing origin=null)
Definition: Chara.cs:10481

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

7628 {
7629 if (!IsPCFaction && !IsGuest())
7630 {
7631 return null;
7632 }
7633 foreach (Card item in EClass._map.props.installed.all)
7634 {
7635 if (item.trait is TraitBed traitBed && traitBed.CanAssign(this))
7636 {
7637 traitBed.AddHolder(this);
7638 Msg.Say("claimBed", this);
7639 return traitBed;
7640 }
7641 }
7642 return null;
7643 }
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 8871 of file Chara.cs.

8872 {
8873 if (IsPC)
8874 {
8875 return;
8876 }
8877 if (IsPCParty)
8878 {
8879 if (!things.IsAlmostFull())
8880 {
8881 return;
8882 }
8883 bool flag = EClass._zone.IsTown;
8884 if (!flag && EClass._zone.IsPCFactionOrTent)
8885 {
8886 foreach (Chara chara in EClass._map.charas)
8887 {
8888 if (chara.IsPCFaction && chara.trait.ShopType != 0)
8889 {
8890 flag = true;
8891 }
8892 }
8893 }
8894 if (flag)
8895 {
8897 }
8898 }
8899 else
8900 {
8902 }
8903 }
void ClearInventory(ClearInventoryType type)
Definition: Chara.cs:8905
bool IsAlmostFull(int threshold=2)
virtual ShopType ShopType
Definition: Trait.cs:532

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

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

◆ TryDropBossLoot()

void Chara.TryDropBossLoot ( )
inline

Definition at line 5824 of file Chara.cs.

5825 {
5827 {
5828 return;
5829 }
5830 int num = 0;
5831 bool flag = false;
5832 bool flag2 = false;
5833 Point point = pos.GetNearestPoint(allowBlock: true, allowChara: false, allowInstalled: false, ignoreCenter: true) ?? pos;
5834 TreasureType type = TreasureType.BossQuest;
5835 if (EClass._zone.Boss == this)
5836 {
5837 type = TreasureType.BossNefia;
5838 num = 2 + EClass.rnd(2);
5839 flag = (flag2 = true);
5840 EClass._zone.Boss = null;
5841 Msg.Say("boss_win", EClass._zone.Name);
5843 {
5844 Msg.Say("boss_win_void", EClass._zone.Name);
5845 EClass.player.flags.KilledBossInVoid = true;
5846 }
5847 if (EClass._zone.IsNefia)
5848 {
5851 SE.Play("Jingle/fanfare2");
5852 EClass._zone.SetBGM(114, refresh: true, 3f);
5853 }
5856 }
5857 switch (id)
5858 {
5859 case "azzrasizzle":
5860 num = 5;
5861 flag = (flag2 = true);
5862 EClass.Sound.StopBGM(3f);
5863 EClass._zone.SetBGM(1, refresh: false);
5865 {
5866 EClass.game.quests.Get<QuestIntoDarkness>().UpdateOnTalk();
5867 }
5868 break;
5869 case "vernis_boss":
5870 num = 5;
5871 flag = (flag2 = true);
5872 EClass.Sound.StopBGM(3f);
5873 EClass._zone.SetBGM(1, refresh: false);
5875 {
5876 EClass.game.quests.Get<QuestVernis>().UpdateOnTalk();
5877 }
5878 break;
5879 case "lurie_boss":
5880 if (!(EClass._zone is Zone_Exile))
5881 {
5882 num = 5;
5883 flag = (flag2 = true);
5884 EClass._zone.SetBGM(120, refresh: true, 3f);
5886 {
5887 EClass.game.quests.Get<QuestNegotiationDarkness>().ChangePhase(4);
5888 EClass.player.flags.killedDuponne = true;
5889 }
5890 }
5891 break;
5892 case "ungaga_pap":
5893 num = 5;
5894 flag = (flag2 = true);
5896 {
5897 EClass._zone.SetBGM(46, refresh: true, 3f);
5898 }
5899 break;
5900 case "melilith_boss":
5901 num = 5;
5902 flag = (flag2 = true);
5903 EClass.Sound.StopBGM(3f);
5904 EClass._zone.SetBGM(1, refresh: false);
5905 break;
5906 case "doga":
5907 {
5908 QuestCurry questCurry = EClass.game.quests.Get<QuestCurry>();
5909 if (questCurry != null)
5910 {
5911 num = 5;
5912 flag = (flag2 = true);
5913 EClass.Sound.StopBGM(3f);
5914 EClass._zone.SetBGM(1, refresh: false);
5915 questCurry.NextPhase();
5916 }
5917 break;
5918 }
5919 case "fairy_raina":
5920 case "fairy_poina":
5921 {
5922 bool num2 = EClass._map.FindChara((id == "fairy_raina") ? "fairy_poina" : "fairy_raina") == null;
5923 QuestNasu questNasu = EClass.game.quests.Get<QuestNasu>();
5924 if (num2 && questNasu != null && questNasu.phase <= 1)
5925 {
5926 if (questNasu.phase == 0)
5927 {
5928 questNasu.NextPhase();
5929 }
5930 num = 5;
5931 flag = (flag2 = true);
5932 EClass.Sound.StopBGM(3f);
5933 EClass._zone.SetBGM(1, refresh: false);
5934 EClass.player.DropReward(ThingGen.Create("backpack_holding"));
5935 questNasu.NextPhase();
5936 }
5937 break;
5938 }
5939 case "isygarad":
5940 {
5941 num = 5;
5942 flag = (flag2 = true);
5943 QuestExploration questExploration = EClass.game.quests.Get<QuestExploration>();
5944 if (questExploration != null)
5945 {
5946 SE.Play("kill_boss");
5947 questExploration.ChangePhase(3);
5948 EClass.Sound.StopBGM(3f);
5949 EClass._zone.SetBGM(1, refresh: false);
5950 }
5951 break;
5952 }
5953 case "swordkeeper":
5954 num = 10;
5955 flag = true;
5956 SE.Play("kill_boss");
5957 SoundManager.ForceBGM();
5958 LayerDrama.Activate("_event", "event", "swordkeeper_defeat");
5959 break;
5960 }
5961 if (flag)
5962 {
5963 SE.Play("kill_boss");
5964 }
5965 if (num != 0)
5966 {
5968 {
5969 EClass.player.stats.deepest = EClass._zone.DangerLv;
5970 Msg.Say("update_deepest", EClass.player.stats.deepest.ToString() ?? "");
5971 }
5973 {
5974 EClass.player.stats.deepestVoid = -EClass._zone.lv;
5975 Msg.Say("update_deepest_void", EClass.player.stats.deepestVoid.ToString() ?? "");
5976 }
5977 EClass.player.willAutoSave = true;
5978 Thing thing = ThingGen.CreateTreasure("chest_boss", base.LV, type);
5979 point.SetBlock();
5980 point.SetObj();
5981 EClass._zone.AddCard(thing, point).Install();
5982 ThingGen.TryLickChest(thing);
5983 }
5984 if (flag2)
5985 {
5987 }
5988 }
TreasureType
Definition: TreasureType.cs:2
bool KilledBossInVoid
Definition: Player.cs:448
int deepest
Definition: Player.cs:114
long nefiaBeaten
Definition: Player.cs:153
int deepestVoid
Definition: Player.cs:117
void ModFame(int a)
Definition: Player.cs:2166
void SetObj(int id=0, int value=1, int dir=0)
Definition: Point.cs:934
void SetBlock(int idMat=0, int idBlock=0)
Definition: Point.cs:924
int phase
Definition: Quest.cs:40
void NextPhase()
Definition: Quest.cs:572
void ChangePhase(int a)
Definition: Quest.cs:577
bool isConquered
Definition: Spatial.cs:382
static void TryLickChest(Thing chest)
Definition: ThingGen.cs:417
static Thing CreateTreasure(string id, int lv, TreasureType type=TreasureType.Map)
Definition: ThingGen.cs:264
static Thing CreateScroll(int ele, int num=1)
Definition: ThingGen.cs:190
virtual bool IsNefia
Definition: Zone.cs:289
void SetBGM(List< int > ids, bool refresh=true, float fadeDuration=0f)
Definition: Zone.cs:3094
Chara Boss
Definition: Zone.cs:88

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

Referenced by ActEffect.Proc().

◆ TryDropCarryOnly()

void Chara.TryDropCarryOnly ( )
inline

Definition at line 4745 of file Chara.cs.

4746 {
4747 if (held != null && held.trait.CanOnlyCarry)
4748 {
4749 DropHeld();
4750 }
4751 foreach (Thing item in things.List((Thing t) => t.trait.CanOnlyCarry))
4752 {
4753 DropThing(item);
4754 }
4755 }
void DropThing(Thing t, int num=-1)
Definition: Chara.cs:4777

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

◆ TryDuplicate()

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

Definition at line 1842 of file Chara.cs.

1843 {
1844 if (dest == null)
1845 {
1846 dest = pos;
1847 }
1848 dest = dest.GetRandomPoint(2, requireLos: false, allowChara: false, allowBlocked: false, 200);
1849 if (dest == null || dest.Equals(pos) || !dest.IsValid || !CanDuplicate(con))
1850 {
1851 Say("split_fail", this);
1852 return null;
1853 }
1854 Chara chara = Duplicate();
1855 EClass._zone.AddCard(chara, dest);
1856 Say("split", this);
1857 return chara;
1858 }
bool CanDuplicate(DuplicateCondition con=DuplicateCondition.Default)
Definition: Chara.cs:1806
Chara Duplicate()
Definition: Chara.cs:1860
Point GetRandomPoint(int radius, bool requireLos=true, bool allowChara=true, bool allowBlocked=false, int tries=100)
Definition: Point.cs:774

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

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

◆ TryEquip()

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

Definition at line 8026 of file Chara.cs.

8027 {
8028 if (!ShouldEquip(t, useFav))
8029 {
8030 return false;
8031 }
8032 if (t.category.slot == 0)
8033 {
8034 return false;
8035 }
8036 if (useFav)
8037 {
8038 BodySlot slot = body.GetSlot(t);
8039 switch (GetFavAttackStyle())
8040 {
8041 case AttackStyle.Default:
8042 case AttackStyle.TwoHand:
8043 if (t.IsMeleeWeapon)
8044 {
8045 slot = body.slotMainHand;
8046 }
8047 break;
8048 case AttackStyle.Shield:
8049 if (t.IsMeleeWeapon)
8050 {
8051 slot = body.slotMainHand;
8052 }
8053 break;
8054 }
8055 body.Equip(t, slot);
8056 }
8057 else
8058 {
8059 body.Equip(t);
8060 }
8061 Say("equip", this, t);
8062 return true;
8063 }
bool ShouldEquip(Thing t, bool useFav=false)
Definition: Chara.cs:7914

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

8147 {
8148 if (IsPC)
8149 {
8151 if (thing?.trait is TraitToolRange && CanEquipRanged(thing))
8152 {
8153 ranged = thing;
8154 return true;
8155 }
8156 return false;
8157 }
8158 if (ranged != null && ranged.parent == this)
8159 {
8160 return true;
8161 }
8163 return ranged != null;
8164 }
Thing GetBestRangedWeapon()
Definition: Chara.cs:8131

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

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

◆ TryGetThrowable()

Thing Chara.TryGetThrowable ( )
inline

Definition at line 8070 of file Chara.cs.

8071 {
8072 Thing dest = null;
8073 if (IsPC)
8074 {
8076 {
8077 return FindThrowable(hotbar: true);
8078 }
8079 return null;
8080 }
8081 things.Foreach(delegate(Thing t)
8082 {
8083 if (t.HasTag(CTAG.throwWeapon) || (!base.IsPCFactionOrMinion && t.HasTag(CTAG.throwWeaponEnemy)))
8084 {
8085 dest = t;
8086 }
8087 });
8088 return dest;
8089 Thing FindThrowable(bool hotbar)
8090 {
8091 things.Foreach(delegate(Thing t)
8092 {
8093 if (dest == null)
8094 {
8095 if (t.IsHotItem)
8096 {
8097 if (!hotbar)
8098 {
8099 return;
8100 }
8101 }
8102 else if (hotbar)
8103 {
8104 return;
8105 }
8106 if (t.HasTag(CTAG.throwWeapon))
8107 {
8108 dest = t;
8109 }
8110 }
8111 });
8112 return dest;
8113 }
8114 }

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

4603 {
4604 if (held == t)
4605 {
4606 return true;
4607 }
4608 if (t.isDestroyed || t.Num <= 0)
4609 {
4610 return false;
4611 }
4612 if (!CanPick(t))
4613 {
4614 if (t.parent == null)
4615 {
4616 EClass._zone.AddCard(t, pos);
4617 }
4618 return false;
4619 }
4620 HoldCard(t, num);
4621 return true;
4622 }
bool CanPick(Card c)
Definition: Chara.cs:4422
void HoldCard(Card t, int num=-1)
Definition: Chara.cs:4624

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

8293 {
8294 int num = Evalue(289);
8295 if (num == 0)
8296 {
8297 return false;
8298 }
8299 int lV = t.LV;
8300 if (EClass.rnd(num * num + 5) > EClass.rnd(lV * lV) * 20)
8301 {
8302 t.Identify(show, (num >= 20) ? IDTSource.SkillHigh : IDTSource.Skill);
8303 int num2 = 50;
8304 if (lV > num)
8305 {
8306 num2 += (lV - num) * 10;
8307 }
8308 elements.ModExp(289, Mathf.Min(num2, 1000));
8309 return true;
8310 }
8311 return false;
8312 }
IDTSource
Definition: IDTSource.cs:2
Thing Identify(bool show=true, IDTSource idtSource=IDTSource.Identify)
Definition: Thing.cs:2128

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

2815 {
2816 foreach (Condition condition in conditions)
2817 {
2818 if (!condition.TryMove(newPoint))
2819 {
2820 return MoveResult.Fail;
2821 }
2822 }
2823 if (base.isRestrained)
2824 {
2825 if (!IsPC)
2826 {
2827 return MoveResult.Fail;
2828 }
2829 base.isRestrained = false;
2830 }
2831 if (!CanMoveTo(newPoint, allowDestroyPath))
2832 {
2833 return MoveResult.Fail;
2834 }
2835 return _Move(newPoint);
2836 }
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 2752 of file Chara.cs.

2753 {
2754 if (p.Equals(pos))
2755 {
2756 return MoveResult.Success;
2757 }
2759 {
2760 return MoveResult.Fail;
2761 }
2762 bool flag = true;
2763 Point point = null;
2764 _sharedPos.Set(p);
2765 if (CanDestroyPath())
2766 {
2768 {
2769 return MoveResult.Success;
2770 }
2771 Debug.Log(CanMoveTo(pos));
2773 }
2774 int num = pos.Distance(p);
2775 PathProgress pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Default, num + 4, 1);
2776 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 4)
2777 {
2778 PathFinderNode pathFinderNode = pathProgress.nodes[pathProgress.nodes.Count - 1];
2779 if (TryMove(new Point(pathFinderNode.X, pathFinderNode.Z)) == MoveResult.Success)
2780 {
2781 return MoveResult.Success;
2782 }
2783 }
2784 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Combat, num + 4, 1);
2785 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 4)
2786 {
2787 PathFinderNode pathFinderNode2 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2788 if (TryMove(new Point(pathFinderNode2.X, pathFinderNode2.Z)) == MoveResult.Success)
2789 {
2790 return MoveResult.Success;
2791 }
2792 }
2793 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Default, num + 25, 2);
2794 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 25)
2795 {
2796 PathFinderNode pathFinderNode3 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2797 if (TryMove(new Point(pathFinderNode3.X, pathFinderNode3.Z)) == MoveResult.Success)
2798 {
2799 return MoveResult.Success;
2800 }
2801 }
2802 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Combat, num + 25, 2);
2803 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 25)
2804 {
2805 PathFinderNode pathFinderNode4 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2806 if (TryMove(new Point(pathFinderNode4.X, pathFinderNode4.Z)) == MoveResult.Success)
2807 {
2808 return MoveResult.Success;
2809 }
2810 }
2811 return MoveResult.Fail;
2812 }
static Point _sharedPos
Definition: Chara.cs:178
void RequestPathImmediate(PathProgress progress)
Definition: PathManager.cs:41
List< PathFinderNode > nodes
Definition: PathProgress.cs:16
bool TooHeavyToMove()
Definition: Player.cs:2653
Point GetPointTowards(Point dest)
Definition: Point.cs:806

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

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

◆ TryNeckHunt()

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

Definition at line 10031 of file Chara.cs.

10032 {
10033 if (TC == null || TC.HasCondition<ConInvulnerable>() || TC.Evalue(1421) > 0 || !TC.ExistsOnMap)
10034 {
10035 return false;
10036 }
10037 if (TC.hp > (long)TC.MaxHP * (long)(Mathf.Min(5 + (int)Mathf.Sqrt(power), harvest ? 35 : 25) + Evalue(1426) * 5) / (TC.IsPowerful ? 200 : 100))
10038 {
10039 return false;
10040 }
10041 if (TC.HasElement(427))
10042 {
10043 return false;
10044 }
10045 if (TC.IsPC && EClass.player.invlunerable)
10046 {
10047 return false;
10048 }
10049 PlaySound("hit_finish");
10050 Say("finish");
10051 Say("finish2", this, TC);
10052 TC.DamageHP(TC.MaxHP, AttackSource.Finish, this);
10053 return false;
10054 }
@ harvest
bool invlunerable
Definition: Player.cs:1243
Definition: TC.cs:4

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

Referenced by ActEffect.Proc().

◆ TryNullifyCurse()

bool Chara.TryNullifyCurse ( )
inline

Definition at line 10505 of file Chara.cs.

10506 {
10507 if (IsPCParty)
10508 {
10509 foreach (Chara member in EClass.pc.party.members)
10510 {
10511 if (member.HasElement(1641) && EClass.rnd(3) != 0)
10512 {
10513 Msg.Say("curse_nullify", member);
10514 return true;
10515 }
10516 }
10517 }
10518 else if (HasElement(1641) && EClass.rnd(3) != 0)
10519 {
10520 Say("curse_nullify", this);
10521 return true;
10522 }
10523 if (GetCondition<ConHolyVeil>() != null && EClass.rnd(5) != 0)
10524 {
10525 Say("curse_nullify", this);
10526 return true;
10527 }
10528 return false;
10529 }

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

4579 {
4580 foreach (Card item in pos.ListCards())
4581 {
4582 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)))
4583 {
4584 Thing thing = Pick(item.Thing);
4585 if (thing != null && !IsPC)
4586 {
4587 thing.isNPCProperty = true;
4588 }
4589 break;
4590 }
4591 }
4592 }

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

Referenced by AI_Fish.Run().

◆ TryPoisonPotion()

Thing Chara.TryPoisonPotion ( Thing  t)
inline

Definition at line 4510 of file Chara.cs.

4511 {
4512 if (t.trait is TraitPotion && t.id != "1165" && !t.source.tag.Contains("neg") && EClass.rnd(2) == 0 && HasElement(1565))
4513 {
4514 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)
4515 .id;
4516 Say("poisonDrip", this);
4517 int num = t.Num;
4518 t.Destroy();
4519 t = ThingGen.Create(text).SetNum(num);
4520 }
4521 return t;
4522 }
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 3348 of file Chara.cs.

3349 {
3350 List<Chara> list = point.ListCharas();
3351 if (list.Count == 0)
3352 {
3353 return;
3354 }
3355 list.Copy().ForeachReverse(delegate(Chara c)
3356 {
3357 if ((trait is TraitSnitch && c.IsPCFactionOrMinion) || (!c.ai.IsMoveAI && !c.IsPC && c.trait.CanBePushed && c != this && !c.noMove && (!EClass._zone.IsRegion || c.IsPCFactionOrMinion)))
3358 {
3359 List<Point> list2 = new List<Point>();
3360 for (int i = point.x - 1; i <= point.x + 1; i++)
3361 {
3362 for (int j = point.z - 1; j <= point.z + 1; j++)
3363 {
3364 if (i != point.x || j != point.z)
3365 {
3366 Point point2 = new Point(i, j);
3367 if (point2.IsValid && !point2.HasChara && !point2.IsBlocked && !point2.cell.hasDoor && !point2.IsBlockByHeight(point))
3368 {
3369 list2.Add(point2);
3370 }
3371 }
3372 }
3373 }
3374 if (list2.Count > 0)
3375 {
3376 if (list2.Count > 1)
3377 {
3378 list2.ForeachReverse(delegate(Point p)
3379 {
3380 if (p.Equals(new Point(point.x + point.x - pos.x, point.z + point.z - pos.z)))
3381 {
3382 list2.Remove(p);
3383 }
3384 });
3385 }
3386 Point newPoint = list2.RandomItem();
3387 if (IsPC)
3388 {
3389 Say("displace", this, c);
3390 PlaySound("push");
3391 }
3392 else if (c.isSynced)
3393 {
3394 c.PlayEffect("push");
3395 }
3396 c.MoveByForce(newPoint, this, checkWall: true);
3397 if (!c.IsPC && c.trait is TraitRogue && EClass.rnd(3) == 0 && GetCurrency() > 20 && !HasElement(426))
3398 {
3399 int num = EClass.rndHalf(10 + Mathf.Min(GetCurrency() / 100, 1000));
3400 c.Talk("pushed");
3401 Say("pushed_money", this, c);
3402 ModCurrency(-num);
3403 c.ModCurrency(num);
3404 c.PlaySound("steal_money");
3405 }
3406 else if (IsPC && !c.IsPCParty && !c.IsUnique && c.IsHumanSpeak && EClass.rnd(5) == 0)
3407 {
3408 c.Talk("pushed");
3409 }
3410 }
3411 }
3412 });
3413 }
bool IsMoveAI
Definition: AIAct.cs:55
bool IsHumanSpeak
Definition: Chara.cs:1038

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

4595 {
4596 if (!EClass._zone.TryAddThingInSharedContainer(t, containers) && dropIfFail)
4597 {
4598 EClass._zone.AddCard(t, pos);
4599 }
4600 }
bool TryAddThingInSharedContainer(Thing t, List< Thing > containers=null, bool add=true, bool msg=false, Chara chara=null, bool sharedOnly=true)
Definition: Zone.cs:2209

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

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

7646 {
7647 if (GetInt(113) != 0)
7648 {
7649 return;
7650 }
7651 _ListItems.Clear();
7652 Thing bestRangedWeapon = GetBestRangedWeapon();
7653 foreach (Thing thing in things)
7654 {
7655 if (!thing.IsAmmo && !thing.c_isImportant)
7656 {
7657 if (thing.category.slot != 0 && !thing.isEquipped && !thing.HasTag(CTAG.gift))
7658 {
7659 _ListItems.Add(thing);
7660 }
7661 else if (thing.IsRangedWeapon && thing.category.slot == 0 && bestRangedWeapon != thing)
7662 {
7663 _ListItems.Add(thing);
7664 }
7665 }
7666 }
7667 if (_ListItems.Count == 0)
7668 {
7669 return;
7670 }
7671 List<Thing> containers2 = containers.ToList();
7672 foreach (Thing listItem in _ListItems)
7673 {
7674 EClass._zone.TryAddThingInSharedContainer(listItem, containers2, add: true, msg: true, this);
7675 }
7676 }
void Add(Act a, string s="")
Definition: ActPlan.cs:11
static List< Thing > _ListItems
Definition: Chara.cs:194

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

Referenced by AI_Idle.Run().

◆ TryReservePickupTutorial()

void Chara.TryReservePickupTutorial ( Thing  t)
inline

Definition at line 4554 of file Chara.cs.

4555 {
4556 if (t.id == "axe")
4557 {
4558 Tutorial.Reserve("tool");
4559 }
4560 if (t.category.id == "mushroom")
4561 {
4562 Tutorial.Reserve("food");
4563 }
4564 if (t.category.id == "herb")
4565 {
4566 Tutorial.Reserve("herb");
4567 }
4568 if (t.id == "pasture")
4569 {
4570 Tutorial.Reserve("pasture");
4571 }
4572 if (t.id == "log")
4573 {
4574 Tutorial.Reserve("process");
4575 }
4576 }

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

◆ TryRestock()

void Chara.TryRestock ( bool  onCreate)
inline

Definition at line 4839 of file Chara.cs.

4840 {
4841 isOnCreate = onCreate;
4842 if (onCreate || (!IsPCFaction && (base.IsUnique || trait is TraitAdventurer || trait is TraitGuard)))
4843 {
4844 RestockEquip((!EClass.core.IsGameStarted || !(EClass._zone is Zone_Music)) && onCreate);
4845 }
4846 RestockInventory(onCreate);
4847 }
void RestockInventory(bool onCreate)
Definition: Chara.cs:5176
void RestockEquip(bool onCreate)
Definition: Chara.cs:4849

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

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

◆ TrySetEnemy()

void Chara.TrySetEnemy ( Chara  c)
inline

Definition at line 6545 of file Chara.cs.

6546 {
6547 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))
6548 {
6549 SetEnemy(c);
6550 }
6551 }

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

7684 {
7686 }
void TryTakeSharedItems(bool msg=true)
Definition: Chara.cs:7683

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

7689 {
7690 if (base.isSummon || (memberType == FactionMemberType.Livestock && homeBranch != null && !homeBranch.policies.IsActive(2715)))
7691 {
7692 return;
7693 }
7694 int num = 2;
7695 int num2 = 1;
7696 int num3 = 2;
7697 bool flag = GetInt(113) == 0;
7698 int num4 = 2;
7699 int num5 = 2;
7700 int num6 = 2;
7702 {
7703 num5 = 0;
7704 num6 = 0;
7705 }
7706 foreach (Thing thing3 in things)
7707 {
7708 if (CanEat(thing3, shouldEat))
7709 {
7710 if (thing3.HasElement(757))
7711 {
7712 num2 -= thing3.Num;
7713 num -= thing3.Num;
7714 }
7715 else
7716 {
7717 num -= thing3.Num;
7718 }
7719 }
7720 if (thing3.trait.GetHealAction(this) != null)
7721 {
7722 num3 -= thing3.Num;
7723 }
7724 if (thing3.id == "polish_powder")
7725 {
7726 num4 -= thing3.Num;
7727 }
7728 if (thing3.trait is TraitBlanketColdproof)
7729 {
7730 num5 -= thing3.Num;
7731 }
7732 if (thing3.trait is TraitBlanketFireproof)
7733 {
7734 num6 -= thing3.Num;
7735 }
7736 }
7737 _ListItems.Clear();
7738 foreach (Thing container in containers)
7739 {
7740 if (!container.IsSharedContainer)
7741 {
7742 continue;
7743 }
7744 foreach (Thing thing4 in container.things)
7745 {
7746 if (!thing4.c_isImportant && thing4.IsIdentified && thing4 != EClass.pc.held)
7747 {
7748 if (num4 > 0 && thing4.id == "polish_powder")
7749 {
7750 _ListItems.Add(thing4);
7751 num4 -= thing4.Num;
7752 }
7753 else if (num5 > 0 && !HasElement(1236) && thing4.trait is TraitBlanketColdproof)
7754 {
7755 _ListItems.Add(thing4);
7756 num5 -= thing4.Num;
7757 }
7758 else if (num6 > 0 && thing4.trait is TraitBlanketFireproof)
7759 {
7760 _ListItems.Add(thing4);
7761 num6 -= thing4.Num;
7762 }
7763 else if (num2 > 0 && CanEat(thing4, shouldEat) && !thing4.c_isImportant && thing4.HasElement(757))
7764 {
7765 _ListItems.Add(thing4);
7766 num2 -= thing4.Num;
7767 }
7768 else if (num > 0 && CanEat(thing4, shouldEat) && !thing4.c_isImportant)
7769 {
7770 _ListItems.Add(thing4);
7771 num -= thing4.Num;
7772 }
7773 else if (num3 > 0 && thing4.trait.GetHealAction(this) != null)
7774 {
7775 _ListItems.Add(thing4);
7776 num3 -= thing4.Num;
7777 }
7778 else if (flag && thing4.IsEquipmentOrRanged && !thing4.HasTag(CTAG.gift) && ShouldEquip(thing4, useFav: true))
7779 {
7780 _ListItems.Add(thing4);
7781 }
7782 }
7783 }
7784 }
7785 if (_ListItems.Count == 0)
7786 {
7787 return;
7788 }
7789 _ListItems.ForeachReverse(delegate(Thing t)
7790 {
7791 if (t.IsEquipmentOrRanged)
7792 {
7793 bool flag3 = false;
7794 int slot = t.category.slot;
7795 int equipValue = t.GetEquipValue();
7796 foreach (Thing listItem in _ListItems)
7797 {
7798 if (listItem.category.slot == slot && listItem.GetEquipValue() > equipValue)
7799 {
7800 flag3 = true;
7801 break;
7802 }
7803 }
7804 if (flag3)
7805 {
7806 _ListItems.Remove(t);
7807 }
7808 }
7809 });
7810 bool flag2 = false;
7811 foreach (Thing listItem2 in _ListItems)
7812 {
7813 Thing thing = listItem2;
7814 if (things.IsFull(thing))
7815 {
7816 break;
7817 }
7818 Thing thing2 = listItem2.parent as Thing;
7819 if (thing.HasElement(757))
7820 {
7821 if (thing.Num > 1)
7822 {
7823 thing = thing.Split(1);
7824 }
7825 }
7826 else if (thing.Num > 2)
7827 {
7828 thing = thing.Split(2);
7829 }
7830 if (msg)
7831 {
7832 Say("takeSharedItem", this, thing, thing2.GetName(NameStyle.Full));
7833 }
7834 AddCard(thing);
7835 if (ShouldEquip(thing, useFav: true) && thing.category.slot != 0)
7836 {
7837 TryEquip(thing, useFav: true);
7838 flag2 = true;
7839 }
7840 }
7841 if (flag2 && flag)
7842 {
7843 TryPutSharedItems(containers);
7844 }
7845 }
bool IsIdentified
Definition: Card.cs:2431
bool HasItemProtection
bool IsActive(int id, int days=-1)
override string GetName(NameStyle style, int _num=-1)
Definition: Thing.cs:532
bool IsSharedContainer
Definition: Thing.cs:110

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

◆ TryUpgrade()

void Chara.TryUpgrade ( bool  msg = true)
inline

Definition at line 8933 of file Chara.cs.

8934 {
8935 if (!EClass.debug.enable || IsPC || !IsGlobal || !IsPCFaction)
8936 {
8937 return;
8938 }
8939 for (int i = 0; i < 100; i++)
8940 {
8941 if (base.feat == 0)
8942 {
8943 break;
8944 }
8945 if (base.c_upgrades == null)
8946 {
8947 base.c_upgrades = new CharaUpgrade();
8948 }
8949 if (base.c_upgrades.halt)
8950 {
8951 break;
8952 }
8953 Rand.SetSeed(base.uid + base.c_upgrades.count);
8954 int num = EClass.rnd(100);
8955 int num2 = 0;
8956 int num3 = 1;
8957 int num4 = 0;
8958 bool flag = false;
8959 IEnumerable<SourceElement.Row> ie = EClass.sources.elements.rows.Where((SourceElement.Row a) => !elements.Has(a) && a.category == "skill" && !a.tag.Contains("noPet"));
8960 List<Element> list = ListAvailabeFeats(pet: true);
8961 if (num >= 90 && list.Count > 0)
8962 {
8963 Element element = list.RandomItem();
8964 num2 = element.id;
8965 num4 = element.CostLearn;
8966 }
8967 else if (num >= 60 && ie.Any())
8968 {
8969 num2 = ie.RandomItem().id;
8970 num4 = 3;
8971 }
8972 else
8973 {
8974 num2 = Element.List_MainAttributesMajor.RandomItem();
8975 num4 = 1;
8976 num3 = 2;
8977 flag = true;
8978 }
8979 Rand.SetSeed();
8980 if (num4 > base.feat)
8981 {
8982 break;
8983 }
8984 base.feat -= num4;
8985 base.c_upgrades.count++;
8986 base.c_upgrades.spent += num4;
8987 bool flag2 = false;
8988 if (flag)
8989 {
8990 foreach (CharaUpgrade.Item item in base.c_upgrades.items)
8991 {
8992 if (item.idEle == num2)
8993 {
8994 item.value += num3;
8995 item.cost += num4;
8996 flag2 = true;
8997 break;
8998 }
8999 }
9000 }
9001 if (!flag2)
9002 {
9003 base.c_upgrades.items.Add(new CharaUpgrade.Item
9004 {
9005 idEle = num2,
9006 value = num3,
9007 cost = num4
9008 });
9009 }
9010 SourceElement.Row row = EClass.sources.elements.map[num2];
9011 if (row.category == "feat")
9012 {
9013 SetFeat(num2, elements.ValueWithoutLink(num2) + 1, msg: true);
9014 }
9015 else if (elements.ValueWithoutLink(row.id) == 0)
9016 {
9017 elements.Learn(row.id);
9018 }
9019 else
9020 {
9021 elements.ModBase(num2, num3);
9022 }
9023 }
9024 }
List< Element > ListAvailabeFeats(bool pet=false, bool showAll=false)
Definition: Chara.cs:10266
void Learn(int ele, int v=1)
virtual int CostLearn
Definition: ELEMENT.cs:319
static int[] List_MainAttributesMajor
Definition: ELEMENT.cs:247
static void SetSeed(int a=-1)
Definition: Rand.cs: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 8175 of file Chara.cs.

8176 {
8177 if (t.id == "338" && t.blessedState >= BlessedState.Normal)
8178 {
8179 Thing thing = things.Find((Thing a) => a.IsEquipmentOrRanged && !a.isAcidproof);
8180 if (thing != null)
8181 {
8182 Say("dip", this, thing, t.GetName(NameStyle.Full, 1));
8183 SE.Change();
8184 t.trait.OnBlend(thing, this);
8185 return true;
8186 }
8187 return false;
8188 }
8189 if (t.IsNegativeGift || t.source.HasTag(CTAG.ignoreUse))
8190 {
8191 return false;
8192 }
8193 if (t.id == "cigar")
8194 {
8195 (t.trait as TraitItemProc).OnUse(this);
8196 return true;
8197 }
8198 if (t.trait.CanEat(this) && hunger.GetPhase() > ((IsPCFaction || IsPCFactionMinion) ? 2 : 0))
8199 {
8201 {
8202 target = t
8203 });
8204 return true;
8205 }
8206 if (t.trait.CanDrink(this))
8207 {
8208 Drink(t);
8209 return true;
8210 }
8211 if (t.trait.CanRead(this))
8212 {
8214 {
8215 target = t
8216 });
8217 return true;
8218 }
8219 if (base.hp < MaxHP * 90 / 100)
8220 {
8221 Action healAction = t.trait.GetHealAction(this);
8222 if (healAction != null)
8223 {
8224 healAction();
8225 return true;
8226 }
8227 }
8228 return false;
8229 }
bool isAcidproof
Definition: Card.cs:689
void SetAIImmediate(AIAct g)
Definition: Chara.cs:9294
virtual bool CanRead(Chara c)
Definition: Trait.cs:1081
virtual bool CanDrink(Chara c)
Definition: Trait.cs:1099
virtual void OnBlend(Thing t, Chara c)
Definition: Trait.cs:645

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

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

◆ TryWorkOutside()

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

Definition at line 9565 of file Chara.cs.

9566 {
9567 if (EClass.world.date.IsExpired(GetInt(51)))
9568 {
9569 Expedition expedition = Expedition.Create(this, sourceWork.expedition.ToEnum<ExpeditionType>());
9570 SetInt(51, EClass.world.date.GetRaw() + 60 * (expedition.hours + 24));
9571 homeBranch.expeditions.Add(expedition);
9572 return true;
9573 }
9574 return false;
9575 }
ExpeditionType
void Add(Expedition ex)
static Expedition Create(Chara c, ExpeditionType type)
Definition: Expedition.cs:112
int hours
Definition: Expedition.cs:6
ExpeditionManager expeditions
string expedition
Definition: SourceHobby.cs:29

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

◆ UnmakeMinion()

void Chara.UnmakeMinion ( )
inline

Definition at line 2470 of file Chara.cs.

2471 {
2472 base.c_uidMaster = 0;
2473 master = null;
2474 enemy = null;
2475 foreach (Chara chara in EClass._map.charas)
2476 {
2477 if (chara.enemy == this)
2478 {
2479 chara.SetEnemy();
2480 chara.ai.Cancel();
2481 }
2482 }
2483 ai.Cancel();
2484 Refresh();
2485 }

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

3718 {
3719 if (IsPCC)
3720 {
3721 if (base.dir == 0)
3722 {
3723 angle = 225f;
3724 }
3725 else if (base.dir == 1)
3726 {
3727 angle = 135f;
3728 }
3729 else if (base.dir == 2)
3730 {
3731 angle = 45f;
3732 }
3733 else if (base.dir == 3)
3734 {
3735 angle = -45f;
3736 }
3737 }
3738 else if (base.dir == 0)
3739 {
3740 angle = 165f;
3741 }
3742 else if (base.dir == 1)
3743 {
3744 angle = 300f;
3745 }
3746 else if (base.dir == 2)
3747 {
3748 angle = 0f;
3749 }
3750 else if (base.dir == 3)
3751 {
3752 angle = 120f;
3753 }
3754 }

Referenced by OnDeserialized().

◆ UpdateSight()

void Chara.UpdateSight ( )
inline

Definition at line 3778 of file Chara.cs.

3779 {
3780 int num = 4;
3781 for (int i = -num; i < num + 1; i++)
3782 {
3783 for (int j = -num; j < num + 1; j++)
3784 {
3785 shared.Set(pos.x + i, pos.z + j);
3786 if (shared.IsValid && !shared.cell.isSeen && i >= -1 && i <= 1 && j >= -1)
3787 {
3788 _ = 1;
3789 }
3790 }
3791 }
3792 }
bool isSeen
Definition: Cell.cs:290
static Point shared
Definition: Chara.cs:11

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

◆ UseAbility() [1/3]

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

Definition at line 6000 of file Chara.cs.

6001 {
6002 if (HasCooldown(a.id))
6003 {
6004 return false;
6005 }
6006 if (!a.ValidatePerform(this, tc, pos))
6007 {
6008 return false;
6009 }
6010 if (a.source.proc.TryGet(0) == "Heal" && HasElement(1422) && !IsPC)
6011 {
6012 List<int> list = new List<int> { 8400, 8401, 8402, 8403, 8404, 8405 };
6013 int num = list.IndexOf(a.id);
6014 if (num != -1)
6015 {
6016 int num2 = list.TryGet(num + Evalue(1422));
6017 a = elements.GetElement(num2)?.act ?? ACT.Create(num2);
6018 }
6019 }
6020 int num3 = 1;
6021 Act.Cost cost = a.GetCost(this);
6022 a.GetPower(this);
6023 int i = 1;
6024 int num4 = 0;
6025 bool flag = a.IsTargetHostileParty();
6026 bool flag2 = ability.Has(a.id);
6027 if (IsPC && HasCondition<StanceManaCost>())
6028 {
6029 num4 = Evalue(1657);
6030 }
6031 _pts.Clear();
6032 if (a.TargetType.ForceParty)
6033 {
6034 pt = true;
6035 }
6036 if (pt)
6037 {
6038 i = 0;
6039 if (flag)
6040 {
6041 ForeachEnemy(delegate
6042 {
6043 i++;
6044 });
6045 }
6046 else
6047 {
6048 ForeachParty(delegate
6049 {
6050 i++;
6051 });
6052 }
6053 }
6054 if (a is Spell && IsPC && a.vPotential < i && !flag2)
6055 {
6056 i = 1;
6057 _pts.Clear();
6058 _pts.Add(this);
6059 pt = false;
6060 }
6061 int num5 = 100;
6062 if (!a.TargetType.ForceParty && i > 1)
6063 {
6064 num5 = (IsPC ? (i * 100) : (50 + i * 50));
6065 }
6066 int num6 = cost.cost * num5 / 100;
6067 if (cost.type == Act.CostType.MP && Evalue(483) > 0)
6068 {
6069 num6 = num6 * 100 / (100 + (int)Mathf.Sqrt(Evalue(483) * 10) * 3);
6070 }
6071 if (i == 0)
6072 {
6073 if (IsPC)
6074 {
6076 }
6077 return false;
6078 }
6079 if (!IsPC && cost.type == Act.CostType.MP && mana.value < 0 && (EClass.rnd(4) != 0 || IsPCFaction || (base.IsPowerful && mana.value < -20)))
6080 {
6081 return false;
6082 }
6083 if (IsPC)
6084 {
6085 if (!Dialog.warned && cost.type == Act.CostType.MP && cost.cost > 0 && mana.value < num6 && !EClass.debug.godMode)
6086 {
6087 Card cardBk = EClass.scene.mouseTarget.card;
6088 ActPlan.warning = true;
6089 Dialog.TryWarnMana(delegate
6090 {
6091 EClass.scene.mouseTarget.card = cardBk;
6092 if (UseAbility(a, tc, pos, pt))
6093 {
6095 }
6096 });
6097 return false;
6098 }
6099 EClass.ui.CloseLayers();
6100 }
6101 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))
6102 {
6103 Say("shakeHead", this);
6104 return true;
6105 }
6106 if (tc != null && tc != this)
6107 {
6108 LookAt(tc.pos);
6109 }
6110 if (pos != null && !base.pos.Equals(pos))
6111 {
6112 LookAt(pos);
6113 }
6114 if (a.CanRapidFire && HasElement(1648))
6115 {
6116 num3 = 1 + Evalue(1648);
6117 }
6118 if (IsPC && cost.cost > 0 && a.Value == 0 && !flag2)
6119 {
6121 return false;
6122 }
6123 if (a is Spell)
6124 {
6125 string s = (isConfused ? "_cast_confuse" : (HasCondition<ConDim>() ? "_cast_dim" : ""));
6126 if (!a.source.tag.Contains("useHand"))
6127 {
6128 Say(race.castStyle.IsEmpty("cast"), this, a.source.GetName().ToLower(), s.lang());
6129 }
6130 if (IsPC)
6131 {
6132 _ = (i + 1) / 2;
6133 if (a.vPotential < i && !flag2)
6134 {
6135 Msg.Say("noSpellStock");
6136 EInput.Consume();
6137 return false;
6138 }
6139 if (num4 > 0 && (a.vPotential >= i * 2 || flag2))
6140 {
6141 if (!flag2)
6142 {
6143 a.vPotential -= i * 2;
6144 }
6145 num6 = num6 * (100 - num4 * 20) / 100;
6146 }
6147 else if (!flag2)
6148 {
6149 a.vPotential -= i;
6150 }
6152 }
6153 }
6154 else
6155 {
6156 if (IsPC && HasElement(1274) && a.vPotential < 0 && !flag2 && !a.HasTag("dontForget"))
6157 {
6158 Msg.Say("noSpellStock");
6159 EInput.Consume();
6160 return false;
6161 }
6162 if (a.source.langAct.Length != 0 && tc != null)
6163 {
6164 string text = a.source.langAct[0];
6165 string text2 = ((a.source.langAct.Length >= 2) ? a.source.langAct[1] : "");
6166 if (text == "spell_hand")
6167 {
6168 string[] list2 = Lang.GetList("attack" + race.meleeStyle.IsEmpty("Touch"));
6169 string @ref = text2.lang(list2[4]);
6170 Say(tc.IsPCParty ? "cast_hand_ally" : "cast_hand", this, tc, @ref, tc.IsPCParty ? list2[1] : list2[2]);
6171 }
6172 else
6173 {
6174 Say(text, this, tc, text2.IsEmpty() ? "" : text2.lang());
6175 }
6176 if (a.source.id == 6630)
6177 {
6178 Talk("insult_" + (base.IsMale ? "m" : "f"));
6179 }
6180 }
6181 }
6182 switch (cost.type)
6183 {
6184 case Act.CostType.MP:
6185 if (Evalue(1421) >= 2 && base.hp <= MaxHP / Mathf.Max(1, 9 - Evalue(1421) * 2))
6186 {
6187 num6 /= 2;
6188 }
6189 if (isSynced)
6190 {
6191 PlayEffect("cast");
6192 }
6193 mana.Mod(-num6);
6194 if (isDead)
6195 {
6196 return true;
6197 }
6198 elements.ModExp(304, Mathf.Clamp(num6 * 2, 1, 200));
6199 break;
6200 case Act.CostType.SP:
6201 stamina.Mod(-num6);
6202 ignoreSPAbsorb = true;
6203 break;
6204 }
6205 if (a is Spell && GetCondition<ConSilence>() != null)
6206 {
6207 Say("cast_silence", this);
6208 return true;
6209 }
6210 if (isDead)
6211 {
6212 return true;
6213 }
6214 int spellExp = elements.GetSpellExp(this, a, num5);
6215 if (EClass.rnd(100) >= CalcCastingChance(a, i) && !EClass.debug.godMode)
6216 {
6217 Say("fizzle", this);
6218 PlayEffect("fizzle");
6219 PlaySound("fizzle");
6220 if (cost.cost > 0 && a.source.lvFactor > 0)
6221 {
6222 ModExp(a.id, spellExp / 5);
6223 }
6224 RemoveCondition<ConInvisibility>();
6225 return true;
6226 }
6227 bool flag3 = true;
6228 if (a.source.cooldown > 0 && (!IsPC || !a.source.tag.Contains("CD_npc")))
6229 {
6230 AddCooldown(a.id, a.source.cooldown);
6231 }
6232 if (HasTalk("phrase_" + a.source.alias))
6233 {
6234 EClass.player.forceTalk = true;
6235 Talk("phrase_" + a.source.alias);
6236 }
6237 if (pt)
6238 {
6239 Act.forcePt = true;
6240 if (flag)
6241 {
6242 ForeachEnemy(delegate(Chara c)
6243 {
6244 a.Perform(this, c, c.pos);
6245 });
6246 }
6247 else
6248 {
6249 ForeachParty(delegate(Chara c)
6250 {
6251 a.Perform(this, c, c.pos);
6252 });
6253 }
6254 Act.forcePt = false;
6255 }
6256 else
6257 {
6258 for (int j = 0; j < num3; j++)
6259 {
6260 if (a.TargetType != TargetType.SelfParty && tc != null && !tc.IsAliveInCurrentZone)
6261 {
6262 break;
6263 }
6264 ActEffect.RapidCount = j;
6265 ActEffect.RapidDelay = a.RapidDelay;
6266 flag3 = a.Perform(this, tc, pos);
6267 }
6268 }
6269 if (flag3 && !isDead)
6270 {
6271 if (IsPC && flag2 && elements.Base(a.id) == 0 && a.PotentialAsStock)
6272 {
6273 elements.ModBase(a.id, 1);
6274 }
6275 if (cost.cost > 0 && a.source.lvFactor > 0)
6276 {
6277 ModExp(a.id, spellExp);
6278 }
6279 }
6280 ActEffect.RapidCount = 0;
6281 if (flag3 && !a.source.tag.Contains("keepInvisi") && EClass.rnd(2) == 0)
6282 {
6283 RemoveCondition<ConInvisibility>();
6284 RemoveCondition<ConDark>();
6285 }
6286 if (!base.IsPCFactionOrMinion && a.HasTag("specialAbility"))
6287 {
6288 string name = a.Name;
6289 renderer.Say("| " + name + " ");
6290 }
6291 return flag3;
6292 void ForeachEnemy(Action<Chara> action)
6293 {
6294 if (_pts.Count == 0)
6295 {
6296 for (int num10 = EClass._map.charas.Count - 1; num10 >= 0; num10--)
6297 {
6298 Chara chara3 = EClass._map.charas[num10];
6299 if (chara3 != this && CanSeeLos(chara3) && chara3.IsHostile(this))
6300 {
6301 _pts.Add(chara3);
6302 }
6303 }
6304 }
6305 for (int num11 = _pts.Count - 1; num11 >= 0; num11--)
6306 {
6307 action(_pts[num11]);
6308 }
6309 }
6310 void ForeachParty(Action<Chara> action)
6311 {
6312 if (_pts.Count == 0)
6313 {
6314 if (IsPCParty)
6315 {
6316 for (int num7 = EClass.pc.party.members.Count - 1; num7 >= 0; num7--)
6317 {
6318 Chara chara = EClass.pc.party.members[num7];
6319 if (chara == this || chara.host != null || CanSeeLos(chara))
6320 {
6321 _pts.Add(chara);
6322 }
6323 }
6324 }
6325 else
6326 {
6327 for (int num8 = EClass._map.charas.Count - 1; num8 >= 0; num8--)
6328 {
6329 Chara chara2 = EClass._map.charas[num8];
6330 if ((chara2 == this || (chara2.IsFriendOrAbove(this) && CanSeeLos(chara2))) && (chara2 == tc || _pts.Count < 3 || EClass.rnd(_pts.Count * _pts.Count) > 6))
6331 {
6332 _pts.Add(chara2);
6333 }
6334 }
6335 }
6336 }
6337 for (int num9 = _pts.Count - 1; num9 >= 0; num9--)
6338 {
6339 action(_pts[num9]);
6340 }
6341 }
6342 }
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:7098
bool Has(int id)
static List< Chara > _pts
Definition: Chara.cs:190
int CalcCastingChance(Element e, int num=1)
Definition: Chara.cs:6353
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:261
virtual int GetPower(Card c)
Definition: ELEMENT.cs:1090
virtual Act.Cost GetCost(Chara c)
Definition: ELEMENT.cs:1049
virtual bool PotentialAsStock
Definition: ELEMENT.cs:341
Act act
Definition: ELEMENT.cs:399
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 5995 of file Chara.cs.

5996 {
5997 return UseAbility(elements.GetElement(idAct)?.act ?? ACT.Create(idAct), tc, pos, pt);
5998 }

References ACT.Create().

◆ ValidateWorks()

void Chara.ValidateWorks ( )
inline

Definition at line 9613 of file Chara.cs.

9614 {
9615 _goalWork.FindWork(this, setAI: false);
9617 }
static GoalHobby _goalHobby
Definition: Chara.cs:212
static GoalWork _goalWork
Definition: Chara.cs:210
void ValidateHobby(Chara c)
Definition: GoalWork.cs:21
bool FindWork(Chara c, bool setAI=true)
Definition: GoalWork.cs:55

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

Referenced by Zone.Deactivate().

◆ Vomit()

void Chara.Vomit ( )
inline

Definition at line 5461 of file Chara.cs.

5462 {
5463 base.c_vomit++;
5464 Say("vomit", this);
5465 PlaySound("vomit");
5466 if (!EClass._zone.IsRegion)
5467 {
5468 Thing thing = ThingGen.Create("731");
5470 {
5471 thing.MakeRefFrom(this);
5472 }
5473 EClass._zone.AddCard(thing, pos);
5474 }
5475 if (HasCondition<ConAnorexia>())
5476 {
5477 ModExp(70, -50);
5478 ModExp(71, -75);
5479 ModExp(77, -100);
5480 }
5481 else if (base.c_vomit > 10)
5482 {
5483 AddCondition<ConAnorexia>();
5484 }
5485 AddCondition<ConDim>();
5486 if (HasCondition<ConAnorexia>())
5487 {
5488 ModWeight(-1 * (1 + EClass.rnd(5)));
5489 }
5490 if (hunger.GetPhase() >= 4)
5491 {
5492 DamageHP(9999L, AttackSource.Hunger);
5493 }
5494 hunger.Mod(30);
5495 }
void ModWeight(int a, bool ignoreLimit=false)
Definition: Chara.cs:10194

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

3795 {
3796 for (int num = conditions.Count - 1; num >= 0; num--)
3797 {
3798 if (conditions[num].ConsumeTurn)
3799 {
3800 return true;
3801 }
3802 }
3803 return false;
3804 }

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

7563 {
7564 n.Clear();
7565 UIItem uIItem = n.AddHeaderCard(base.Name.ToTitleCase());
7566 SetImage(uIItem.image2);
7567 uIItem.text2.SetText(race.GetText().ToTitleCase(wholeText: true) + " " + job.GetText().ToTitleCase(wholeText: true));
7568 n.AddText("");
7569 n.Build();
7570 }
void SetImage(Image image, int dir, int idSkin=0)
Definition: Card.cs:6484
Definition: UIItem.cs:5
Image image2
Definition: UIItem.cs:16
UIText text2
Definition: UIItem.cs:8
UIItem AddHeaderCard(string text, Sprite sprite=null)
Definition: UINote.cs:84
void Clear()
Definition: UINote.cs:35
UIItem AddText(string text, FontColor color=FontColor.DontChange)
Definition: UINote.cs:113
void Build()
Definition: UINote.cs:49
void SetText(string s)
Definition: UIText.cs:163

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

Member Data Documentation

◆ _ability

CharaAbility Chara._ability

Definition at line 96 of file Chara.cs.

Referenced by SetMainElement().

◆ _baseWorkElements

ElementContainer Chara._baseWorkElements

Definition at line 208 of file Chara.cs.

◆ _cbits1

BitArray32 Chara._cbits1

Definition at line 84 of file Chara.cs.

Referenced by OnSerializing().

◆ _cints

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

Definition at line 82 of file Chara.cs.

Referenced by OnDeserialized(), and OnSerializing().

◆ _cooldowns

List<int> Chara._cooldowns

◆ _faction

Faction Chara._faction
private

Definition at line 160 of file Chara.cs.

Referenced by SetFaction().

◆ _goalHobby

GoalHobby Chara._goalHobby = new GoalHobby()
staticprivate

Definition at line 212 of file Chara.cs.

◆ _goalWork

GoalWork Chara._goalWork = new GoalWork()
staticprivate

Definition at line 210 of file Chara.cs.

◆ _historyFood

List<List<string> > Chara._historyFood

Definition at line 64 of file Chara.cs.

◆ _hobbies

List<int> Chara._hobbies

Definition at line 49 of file Chara.cs.

◆ _isLevitating

bool Chara._isLevitating

Definition at line 136 of file Chara.cs.

Referenced by HasHigherGround(), and Refresh().

◆ _job

SourceJob.Row Chara._job

Definition at line 166 of file Chara.cs.

Referenced by ChangeJob(), and OnCreate().

◆ _listAbility

List<int> Chara._listAbility

◆ _listFavCat

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

Definition at line 198 of file Chara.cs.

◆ _listFavFood

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

Definition at line 196 of file Chara.cs.

◆ _ListItems

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

Definition at line 194 of file Chara.cs.

◆ _NoGoalPC

NoGoal Chara._NoGoalPC = new NoGoal()
static

Definition at line 200 of file Chara.cs.

◆ _NoGoalRepeat

NoGoal Chara._NoGoalRepeat = new NoGoal()
static

Definition at line 202 of file Chara.cs.

Referenced by ActPlan.Item.Perform().

◆ _pts

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

Definition at line 190 of file Chara.cs.

◆ _race

SourceRace.Row Chara._race

Definition at line 164 of file Chara.cs.

Referenced by ChangeRace(), and OnCreate().

◆ _sharedPos

Point Chara._sharedPos = new Point()
staticprivate

Definition at line 178 of file Chara.cs.

Referenced by TryMoveTowards().

◆ _Speed

long Chara._Speed
private

Definition at line 176 of file Chara.cs.

Referenced by RefreshSpeed().

◆ _strs

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

Definition at line 79 of file Chara.cs.

◆ _tactics

Tactics Chara._tactics

Definition at line 168 of file Chara.cs.

◆ _works

List<int> Chara._works

Definition at line 52 of file Chara.cs.

◆ _workSummary

WorkSummary Chara._workSummary

Definition at line 55 of file Chara.cs.

◆ actTime

float Chara.actTime = 0.3f

Definition at line 182 of file Chara.cs.

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

◆ ai

◆ body

◆ bossText

bool Chara.bossText

Definition at line 146 of file Chara.cs.

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

◆ calmCheckTurn

int Chara.calmCheckTurn

Definition at line 118 of file Chara.cs.

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

◆ canSeeInvisible

bool Chara.canSeeInvisible

Definition at line 140 of file Chara.cs.

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

◆ combatCount

int Chara.combatCount

Definition at line 116 of file Chara.cs.

◆ conditions

◆ conSleep

◆ consumeTurn

bool Chara.consumeTurn
static

Definition at line 184 of file Chara.cs.

◆ conSuspend

◆ contribution

int Chara.contribution

Definition at line 18 of file Chara.cs.

Referenced by OnCreate().

◆ dirtySpeed

bool Chara.dirtySpeed = true

Definition at line 174 of file Chara.cs.

Referenced by RefreshSpeed(), and SetDirtySpeed().

◆ emoIcon

Emo2 Chara.emoIcon

Definition at line 108 of file Chara.cs.

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

◆ enemy

◆ faithElements

◆ global

◆ goalList

GoalList Chara.goalList = new GoalList()

Definition at line 204 of file Chara.cs.

◆ happiness

int Chara.happiness

Definition at line 110 of file Chara.cs.

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

◆ hasMovedThisTurn

bool Chara.hasMovedThisTurn
private

Definition at line 180 of file Chara.cs.

Referenced by _Move().

◆ hasTelepathy

bool Chara.hasTelepathy

◆ held

◆ host

◆ idleActTimer

int Chara.idleActTimer

Definition at line 114 of file Chara.cs.

Referenced by AI_Idle.Run().

◆ idleTimer

float Chara.idleTimer

Definition at line 122 of file Chara.cs.

Referenced by CharaRenderer.UpdatePosition().

◆ IDTimeTable

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

Definition at line 15 of file Chara.cs.

◆ ignoreSPAbsorb

bool Chara.ignoreSPAbsorb

Definition at line 148 of file Chara.cs.

◆ isAstralBody

bool Chara.isAstralBody

Definition at line 156 of file Chara.cs.

Referenced by Refresh().

◆ isBerserk

bool Chara.isBerserk

◆ isBlind

◆ isConfused

◆ isCreated

bool Chara.isCreated

Definition at line 138 of file Chara.cs.

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

◆ isDrunk

bool Chara.isDrunk

Definition at line 126 of file Chara.cs.

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

◆ isFainted

bool Chara.isFainted

Definition at line 130 of file Chara.cs.

◆ isOnCreate

bool Chara.isOnCreate
static

Definition at line 188 of file Chara.cs.

◆ isParalyzed

bool Chara.isParalyzed

Definition at line 134 of file Chara.cs.

Referenced by Point.ListWitnesses().

◆ isWeakToSunlight

bool Chara.isWeakToSunlight

Definition at line 154 of file Chara.cs.

Referenced by Refresh().

◆ isWet

bool Chara.isWet

◆ lastPos

new Point Chara.lastPos = new Point()

Definition at line 90 of file Chara.cs.

Referenced by _Move().

◆ ListAdvJob

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

Definition at line 172 of file Chara.cs.

Referenced by OnCreate().

◆ ListAdvRace

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

Definition at line 170 of file Chara.cs.

Referenced by OnCreate().

◆ listHobby

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

Definition at line 13 of file Chara.cs.

◆ master

◆ memberType

◆ mimicry

◆ nextUse

Thing Chara.nextUse

Definition at line 100 of file Chara.cs.

Referenced by AI_Idle.Run().

◆ orgPos

◆ parasite

◆ party

Party Chara.party

Definition at line 43 of file Chara.cs.

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

◆ path

PathProgress Chara.path = new PathProgress()

Definition at line 92 of file Chara.cs.

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

◆ pccData

◆ preventRegen

bool Chara.preventRegen
static

Definition at line 186 of file Chara.cs.

◆ quest

◆ ranged

◆ rawSlots

int [] Chara.rawSlots

Definition at line 73 of file Chara.cs.

Referenced by OnSerializing().

◆ resistCon

Dictionary<int, int> Chara.resistCon

Definition at line 218 of file Chara.cs.

◆ ride

◆ shared

Point Chara.shared = new Point()
staticprivate

Definition at line 11 of file Chara.cs.

◆ sharedCheckTurn

int Chara.sharedCheckTurn

Definition at line 120 of file Chara.cs.

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

◆ source

◆ spriteReplacer

SpriteReplacer Chara.spriteReplacer

Definition at line 158 of file Chara.cs.

Referenced by LayerEditSkin.RefreshImage().

◆ stealthSeen

int Chara.stealthSeen

Definition at line 192 of file Chara.cs.

◆ tempElements

◆ turnLastSeen

int Chara.turnLastSeen = -100

Definition at line 112 of file Chara.cs.

Referenced by AI_Idle.Run().

◆ visibleWithTelepathy

bool Chara.visibleWithTelepathy

◆ wasInWater

bool Chara.wasInWater

Definition at line 150 of file Chara.cs.

Referenced by _Move().

◆ workElements

ElementContainer Chara.workElements

Definition at line 40 of file Chara.cs.

Property Documentation

◆ _affinity

int Chara._affinity
getset

Definition at line 306 of file Chara.cs.

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

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

◆ _alias

string Chara._alias
getset

Definition at line 222 of file Chara.cs.

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

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

◆ _idTimeTable

int Chara._idTimeTable
getset

Definition at line 344 of file Chara.cs.

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

Referenced by OnCreate().

◆ _maxStamina

int Chara._maxStamina
getset

Definition at line 368 of file Chara.cs.

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

Referenced by CalculateMaxStamina().

◆ ability

◆ actorPrefab

override string Chara.actorPrefab
get

Definition at line 524 of file Chara.cs.

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

◆ affinity

◆ Aka

◆ AliasMaterialOnCreate

override string Chara.AliasMaterialOnCreate
get

Definition at line 564 of file Chara.cs.

◆ baseWorkElements

ElementContainer Chara.baseWorkElements
get

Definition at line 1145 of file Chara.cs.

1146 {
1147 get
1148 {
1149 if (_baseWorkElements == null)
1150 {
1152 foreach (Hobby item in ListHobbies())
1153 {
1154 Build(item);
1155 }
1156 foreach (Hobby item2 in ListWorks())
1157 {
1158 Build(item2);
1159 }
1160 }
1161 return _baseWorkElements;
1162 void Build(Hobby h)
1163 {
1164 if (!h.source.elements.IsEmpty())
1165 {
1166 for (int i = 0; i < h.source.elements.Length; i += 2)
1167 {
1168 int ele = h.source.elements[i];
1169 int v = h.source.elements[i + 1];
1170 _baseWorkElements.ModBase(ele, v);
1171 }
1172 }
1173 }
1174 }
1175 }
ElementContainer _baseWorkElements
Definition: Chara.cs:208

◆ bladder

Stats Chara.bladder
get

Definition at line 1185 of file Chara.cs.

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

◆ burden

◆ CanGainConResist

bool Chara.CanGainConResist
get

Definition at line 1195 of file Chara.cs.

1196 {
1197 get
1198 {
1199 if (base.rarity >= Rarity.Legendary)
1200 {
1201 return !IsPCFaction;
1202 }
1203 return false;
1204 }
1205 }

◆ CanOpenDoor

bool Chara.CanOpenDoor
get

Definition at line 841 of file Chara.cs.

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

◆ CanWitness

bool Chara.CanWitness
get

Definition at line 1025 of file Chara.cs.

1026 {
1027 get
1028 {
1029 if (!IsHuman && !IsFairy && !IsGod)
1030 {
1031 return race.id == "mutant";
1032 }
1033 return true;
1034 }
1035 }
bool IsFairy
Definition: Chara.cs:962
bool IsGod
Definition: Chara.cs:974

Referenced by Point.ListWitnesses().

◆ corruption

int Chara.corruption
getset

Definition at line 380 of file Chara.cs.

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

Referenced by CanDuplicate().

◆ CurrentGeneSlot

int Chara.CurrentGeneSlot
get

Definition at line 1105 of file Chara.cs.

1106 {
1107 get
1108 {
1109 if (base.c_genes != null)
1110 {
1111 return base.c_genes.GetGeneSlot(this);
1112 }
1113 return 0;
1114 }
1115 }

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

◆ CurrentSpan

TimeTable.Span Chara.CurrentSpan
get

Definition at line 859 of file Chara.cs.

Referenced by ConSleep.Tick().

◆ currentZone

Zone Chara.currentZone
getset

Definition at line 258 of file Chara.cs.

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

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

◆ daysStarved

int Chara.daysStarved
getset

Definition at line 332 of file Chara.cs.

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

◆ depression

Stats Chara.depression
get

Definition at line 1183 of file Chara.cs.

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

◆ DestDist

int Chara.DestDist
get

Definition at line 1021 of file Chara.cs.

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

◆ DV

override int Chara.DV
get

Definition at line 746 of file Chara.cs.

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

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

◆ faction

Faction Chara.faction
getset

Definition at line 430 of file Chara.cs.

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

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

◆ faith

◆ flipX

override bool Chara.flipX
get

Definition at line 552 of file Chara.cs.

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

Referenced by CharaActor.RefreshSprite().

◆ GeneCostMTP

int Chara.GeneCostMTP
get

Definition at line 1093 of file Chara.cs.

1094 {
1095 get
1096 {
1097 if (!IsPC)
1098 {
1099 return 100;
1100 }
1101 return 5;
1102 }
1103 }

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

◆ goalListType

GoalListType Chara.goalListType
getset

Definition at line 282 of file Chara.cs.

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

◆ HasHost

override bool Chara.HasHost
get

Definition at line 706 of file Chara.cs.

Referenced by ActEffect.Proc().

◆ HasNoGoal

◆ homeBranch

◆ homeZone

◆ hostility

◆ hunger

◆ hygiene

Stats Chara.hygiene
get

Definition at line 1187 of file Chara.cs.

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

◆ idFaction

string Chara.idFaction
getset

Definition at line 246 of file Chara.cs.

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

◆ idFaith

string Chara.idFaith
getset

Definition at line 234 of file Chara.cs.

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

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

◆ IDPCCBodySet

string Chara.IDPCCBodySet
get

Definition at line 494 of file Chara.cs.

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

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

◆ idTimeTable

string Chara.idTimeTable
get

Definition at line 472 of file Chara.cs.

Referenced by LayerQuestBoard.RefreshHire().

◆ interest

int Chara.interest
getset

Definition at line 320 of file Chara.cs.

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

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

◆ IsAdventurer

bool Chara.IsAdventurer
get

Definition at line 1063 of file Chara.cs.

1064 {
1065 get
1066 {
1067 if (global != null && faction != EClass.pc.faction)
1068 {
1069 return IsPCC;
1070 }
1071 return false;
1072 }
1073 }

◆ isAlawysVisible

bool Chara.isAlawysVisible
getset

Definition at line 404 of file Chara.cs.

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

◆ IsAliveInCurrentZone

◆ IsAnimal

bool Chara.IsAnimal
get

Definition at line 889 of file Chara.cs.

890 {
891 get
892 {
893 if (!race.IsAnimal)
894 {
895 return HasTag(CTAG.animal);
896 }
897 return true;
898 }
899 }

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

◆ IsAstralBody

bool Chara.IsAstralBody
get

Implements IPathfindWalker.

Definition at line 506 of file Chara.cs.

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

◆ IsCat

bool Chara.IsCat
get

Definition at line 1009 of file Chara.cs.

1010 {
1011 get
1012 {
1013 if (!(race.id == "cat") && !(race.id == "catsister"))
1014 {
1015 return race.id == "catgod";
1016 }
1017 return true;
1018 }
1019 }

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

◆ isChara

override bool Chara.isChara
get

Definition at line 704 of file Chara.cs.

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

◆ isDead

◆ IsDeadOrSleeping

override bool Chara.IsDeadOrSleeping
get

◆ IsDisabled

override bool Chara.IsDisabled
get

◆ IsDragon

bool Chara.IsDragon
get

Definition at line 985 of file Chara.cs.

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

◆ IsEyth

bool Chara.IsEyth
get

Definition at line 1075 of file Chara.cs.

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

◆ IsFairy

bool Chara.IsFairy
get

Definition at line 961 of file Chara.cs.

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

Referenced by Faction.IsWearingPanty().

◆ IsFish

bool Chara.IsFish
get

Definition at line 949 of file Chara.cs.

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

◆ IsGlobal

◆ IsGod

bool Chara.IsGod
get

Definition at line 973 of file Chara.cs.

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

◆ IsHorror

bool Chara.IsHorror
get

Definition at line 937 of file Chara.cs.

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

Referenced by Refresh().

◆ IsHuman

bool Chara.IsHuman
get

Definition at line 901 of file Chara.cs.

902 {
903 get
904 {
905 if (!race.IsHuman)
906 {
907 return HasTag(CTAG.human);
908 }
909 return true;
910 }
911 }

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

1038 {
1039 get
1040 {
1041 if (!IsHuman && !race.tag.Contains("humanSpeak"))
1042 {
1043 return HasTag(CTAG.humanSpeak);
1044 }
1045 return true;
1046 }
1047 }

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

◆ IsIdle

bool Chara.IsIdle
get

Definition at line 875 of file Chara.cs.

876 {
877 get
878 {
879 if (!IsDeadOrSleeping)
880 {
881 return ai.Current.IsIdle;
882 }
883 return false;
884 }
885 }
virtual bool IsIdle
Definition: AIAct.cs:78

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

◆ IsInActiveZone

◆ IsInCombat

◆ IsLevitating

bool Chara.IsLevitating
get

Definition at line 602 of file Chara.cs.

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

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

◆ IsLocalChara

bool Chara.IsLocalChara
get

Definition at line 863 of file Chara.cs.

864 {
865 get
866 {
867 if (!IsGlobal && !base.isSubsetCard)
868 {
869 return homeZone == EClass._zone;
870 }
871 return false;
872 }
873 }

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

◆ IsMachine

bool Chara.IsMachine
get

Definition at line 925 of file Chara.cs.

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

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

◆ IsMaid

bool Chara.IsMaid
get

Definition at line 1049 of file Chara.cs.

1050 {
1051 get
1052 {
1053 if (EClass.Branch != null)
1054 {
1055 return EClass.Branch.uidMaid == base.uid;
1056 }
1057 return false;
1058 }
1059 }

Referenced by FactionBranch.GetMaid().

◆ IsMarried

bool Chara.IsMarried
get

Definition at line 614 of file Chara.cs.

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

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

◆ IsMinion

override bool Chara.IsMinion
get

Definition at line 644 of file Chara.cs.

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

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

◆ IsMofuable

bool Chara.IsMofuable
get

Definition at line 1133 of file Chara.cs.

1134 {
1135 get
1136 {
1137 if (!race.tag.Contains("mofu"))
1138 {
1139 return HasElement(419);
1140 }
1141 return true;
1142 }
1143 }

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

◆ IsMoving

override bool Chara.IsMoving
get

Definition at line 626 of file Chara.cs.

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

◆ IsMultisize

◆ IsPC

override bool Chara.IsPC
get

Definition at line 630 of file Chara.cs.

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

◆ IsPCC

◆ IsPCFaction

override bool Chara.IsPCFaction
get

Definition at line 688 of file Chara.cs.

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

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

◆ IsPCFactionMinion

override bool Chara.IsPCFactionMinion
get

Definition at line 672 of file Chara.cs.

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

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

◆ IsPCParty

override bool Chara.IsPCParty
get

Definition at line 632 of file Chara.cs.

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

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

◆ IsPCPartyMinion

override bool Chara.IsPCPartyMinion
get

Definition at line 656 of file Chara.cs.

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

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

◆ IsPlant

bool Chara.IsPlant
get

Definition at line 997 of file Chara.cs.

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

Referenced by GoalCombat.Run().

◆ IsPrisoner

bool Chara.IsPrisoner
get

Definition at line 1061 of file Chara.cs.

◆ isSynced

override bool Chara.isSynced
get

Definition at line 708 of file Chara.cs.

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

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

◆ isThing

override bool Chara.isThing
get

Definition at line 702 of file Chara.cs.

◆ IsUndead

bool Chara.IsUndead
get

Definition at line 913 of file Chara.cs.

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

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

◆ IsWealthy

bool Chara.IsWealthy
get

Definition at line 1077 of file Chara.cs.

1078 {
1079 get
1080 {
1081 if (!source.works.Contains("Rich"))
1082 {
1083 return source.hobbies.Contains("Rich");
1084 }
1085 return true;
1086 }
1087 }

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

◆ job

◆ knowFav

bool Chara.knowFav
getset

Definition at line 416 of file Chara.cs.

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

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

◆ MainElement

Element Chara.MainElement
get

Definition at line 734 of file Chara.cs.

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

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

◆ mana

◆ MaxGeneSlot

int Chara.MaxGeneSlot
get

◆ MaxHP

◆ MaxSummon

int Chara.MaxSummon
get

◆ NameBraced

◆ NameTitled

string Chara.NameTitled
get

Definition at line 522 of file Chara.cs.

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

◆ OriginalHostility

Hostility Chara.OriginalHostility
get

Definition at line 474 of file Chara.cs.

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

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

◆ Pref

override SourcePref Chara.Pref
get

Definition at line 804 of file Chara.cs.

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

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

◆ PrefIndex

override int Chara.PrefIndex
get

Definition at line 536 of file Chara.cs.

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

◆ PV

override int Chara.PV
get

Definition at line 775 of file Chara.cs.

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

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

◆ race

◆ SAN

◆ SelfWeight

override int Chara.SelfWeight
get

Definition at line 730 of file Chara.cs.

◆ sleepiness

Stats Chara.sleepiness
get

◆ sourceCard

override CardRow Chara.sourceCard
get

◆ sourceRenderCard

override CardRow Chara.sourceRenderCard
get

Definition at line 456 of file Chara.cs.

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

◆ Speed

int Chara.Speed
get

Definition at line 1117 of file Chara.cs.

1118 {
1119 get
1120 {
1121 if (dirtySpeed)
1122 {
1123 RefreshSpeed();
1124 }
1125 if (_Speed > 100000000)
1126 {
1127 return 100000000;
1128 }
1129 return (int)_Speed;
1130 }
1131 }

Referenced by GameUpdater.ConditionUpdater.FixedUpdate().

◆ stamina

◆ tactics

Tactics Chara.tactics
get

Definition at line 857 of file Chara.cs.

Referenced by GoalCombat.Run().

◆ trait

◆ uidEditor

int Chara.uidEditor
getset

Definition at line 356 of file Chara.cs.

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

Referenced by SerializedCards.Add().

◆ WeightLimit

override int Chara.WeightLimit
get

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