Elin Decompiled Documentation EA 23.200 Stable
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)
 
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 MakeMinion (Chara _master, MinionType type=MinionType.Default)
 
bool HasMinion (string id)
 
void ReleaseMinion ()
 
void SetSummon (int duration)
 
Chara FindMaster ()
 
bool IsEscorted ()
 
bool CanDestroyPath ()
 
bool CanMoveTo (Point p, bool allowDestroyPath=true)
 
bool IsEnemyOnPath (Point p, bool cancelAI=true)
 
bool CanInteractTo (Card c)
 
bool CanInteractTo (Point p)
 
Point GetFirstStep (Point newPoint, PathManager.MoveType moveType=PathManager.MoveType.Default)
 
bool MoveRandom ()
 
bool MoveNeighborDefinitely ()
 
void MoveByForce (Point newPoint, Card c=null, bool checkWall=false)
 
MoveResult TryMoveTowards (Point p)
 
MoveResult TryMoveFrom (Point p)
 
MoveResult TryMove (Point newPoint, bool allowDestroyPath=true)
 
override MoveResult _Move (Point newPoint, MoveType type=MoveType.Walk)
 
void DestroyPath (Point pos)
 
void TryPush (Point point)
 
bool CanReplace (Chara c)
 
void MoveZone (string alias)
 
void MoveZone (Zone z, ZoneTransition.EnterState state=ZoneTransition.EnterState.Auto)
 
void MoveZone (Zone z, ZoneTransition transition)
 
void MoveHome (string id, int x=-1, int z=-1)
 
void MoveHome (Zone zone, int x=-1, int z=-1)
 
void FallFromZone ()
 
override void SetDir (int d)
 
override void Rotate (bool reverse=false)
 
override void LookAt (Card c)
 
override void LookAt (Point p)
 
void UpdateAngle ()
 
int GetCurrentDir ()
 
void UpdateSight ()
 
bool WillConsumeTurn ()
 
void TickConditions ()
 
void SyncRide ()
 
void SyncRide (Chara c)
 
override void Tick ()
 
bool CanLift (Card c)
 
bool CanAutoPick (Card c)
 
bool CanPick (Card c)
 
void PickOrDrop (Point p, string idThing, int idMat=-1, int num=1, bool msg=true)
 
void PickOrDrop (Point p, Thing t, bool msg=true)
 
Thing Pick (Thing t, bool msg=true, bool tryStack=true)
 
Thing TryPoisonPotion (Thing t)
 
void TryAbsorbRod (Thing t)
 
void TryReservePickupTutorial (Thing t)
 
void TryPickGroundItem ()
 
void TryPutShared (Thing t, List< Thing > containers=null, bool dropIfFail=true)
 
bool TryHoldCard (Card t, int num=-1, bool pickHeld=false)
 
void HoldCard (Card t, int num=-1)
 
void PickHeld (bool msg=false)
 
Card SplitHeld (int a)
 
void TryDropCarryOnly ()
 
Card DropHeld (Point dropPos=null)
 
void DropThing (Thing t, int num=-1)
 
AttackStyle GetFavAttackStyle ()
 
Element GetFavWeaponSkill ()
 
Element GetFavArmorSkill ()
 
void TryRestock (bool onCreate)
 
void RestockEquip (bool onCreate)
 
void RestockInventory (bool onCreate)
 
Thing EQ_ID (string s, int mat=-1, Rarity r=Rarity.Random)
 
void EQ_CAT (string s)
 
void EQ_Item (string s, int num=1)
 
void Drink (Card t)
 
bool CanRevive ()
 
void GetRevived ()
 
void Revive (Point p=null, bool msg=false)
 
void MakeGrave (string lastword)
 
void ApplyDeathPenalty ()
 
void Vomit ()
 
override void Die (Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None, Chara originalTarget=null)
 
void TryDropBossLoot ()
 
void Kick (Point p, bool ignoreSelf=false, bool checkWall=true)
 
void Kick (Chara t, bool ignoreSelf=false, bool karmaLoss=true, bool show=true, bool checkWall=true)
 
bool UseAbility (string idAct, Card tc=null, Point pos=null, bool pt=false)
 
bool UseAbility (Act a, Card tc=null, Point pos=null, bool pt=false)
 
int EvalueRiding ()
 
int CalcCastingChance (Element e, int num=1)
 
void DoAI (int wait, Action onPerform)
 
void Cuddle (Chara c, bool headpat=false)
 
Chara SetEnemy (Chara c=null)
 
void TrySetEnemy (Chara c)
 
void DoHostileAction (Card _tg, bool immediate=false)
 
void CallHelp (Chara tg, bool fanatic=false)
 
bool FindNewEnemy ()
 
bool FindNearestNewEnemy ()
 
bool IsHostile ()
 
bool IsHostile (Chara c)
 
bool IsNeutral ()
 
bool IsNeutralOrAbove ()
 
bool IsBranchMember ()
 
bool IsHomeMember ()
 
bool IsInHomeZone ()
 
bool IsInSpot< T > ()
 
bool IsGuest ()
 
bool IsFriendOrAbove ()
 
bool IsFriendOrAbove (Chara c)
 
override CardRenderer _CreateRenderer ()
 
void SetPCCState (PCCState state)
 
override Sprite GetSprite (int dir=0)
 
void SetTempHand (int right=0, int left=0)
 
override SubPassData GetSubPassData ()
 
override void SetRenderParam (RenderParam p)
 
override string GetHoverText ()
 
override string GetHoverText2 ()
 
string GetTopicText (string topic="calm")
 
string TalkTopic (string topic="calm")
 
override Sprite GetImageSprite ()
 
void ChangeMemberType (FactionMemberType type)
 
void ShowDialog ()
 
LayerDrama ShowDialog (string book, string step="main", string tag="")
 
Point GetDestination ()
 
int GetHireCost ()
 
int GetHappiness ()
 
string GetTextHappiness ()
 
string GetActionText ()
 
override void WriteNote (UINote n, Action< UINote > onWriteNote=null, IInspect.NoteMode mode=IInspect.NoteMode.Default, Recipe recipe=null)
 
override void SetSortVal (UIList.SortMode m, CurrencyType currency=CurrencyType.Money)
 
void ClearBed (Map map=null)
 
TraitBed FindBed ()
 
TraitBed TryAssignBed ()
 
void TryPutSharedItems (IEnumerable< Thing > containers, bool msg=true)
 
void TryPutSharedItems (bool msg=true)
 
void TryTakeSharedItems (bool msg=true)
 
void TryTakeSharedItems (IEnumerable< Thing > containers, bool msg=true, bool shouldEat=true)
 
Thing FindBestFoodToEat ()
 
void InstantEat (Thing t=null, bool sound=true)
 
bool CanEat (Thing t, bool shouldEat=false)
 
bool ShouldEquip (Thing t, bool useFav=false)
 
bool TryEquip (Thing t, bool useFav=false)
 
bool CanEquipRanged (Thing t)
 
Thing TryGetThrowable ()
 
Thing FindAmmo (Thing weapon)
 
Thing GetBestRangedWeapon ()
 
bool TryEquipRanged ()
 
override int GetArmorSkill ()
 
bool TryUse (Thing t)
 
Room FindRoom ()
 
void ModAffinity (Chara c, int a, bool show=true, bool showOnlyEmo=false)
 
bool TryIdentify (Thing t, int count=1, bool show=true)
 
Chara CreateReplacement ()
 
SourceThing.Row GetFavFood ()
 
SourceCategory.Row GetFavCat ()
 
Chara GetNearbyCatToSniff ()
 
void Sniff (Chara c)
 
int GetTotalFeat ()
 
bool CanInsult ()
 
string GetIdPortraitCat ()
 
string GetIdPortrait ()
 
Thing MakeGene (DNA.Type? type=null)
 
Thing MakeBraineCell ()
 
void OnInsulted ()
 
bool IsValidGiftWeight (Card t, int num=-1)
 
bool CanAcceptItem (Card t, int num=-1)
 
bool CanAcceptGift (Chara c, Card t)
 
void GiveGift (Chara c, Thing t)
 
void OnGiveErohon (Thing t)
 
void GiveLovePotion (Chara c, Thing t)
 
bool RequestProtection (Chara attacker, Action< Chara > action)
 
bool ShouldThrowAway (Thing t, ClearInventoryType type)
 
void ClearInventory (ClearInventoryType type)
 
void ResetUpgrade ()
 
void TryUpgrade (bool msg=true)
 
void AddCooldown (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)
 
void CureCondition< T > (int v=99999)
 
GetCondition< T > ()
 
void RemoveCondition< T > ()
 
void CureHost (CureType type, int p=100, BlessedState state=BlessedState.Normal)
 
void Cure (CureType type, int p=100, BlessedState state=BlessedState.Normal)
 
void RemoveAllStances ()
 
bool TryNeckHunt (Chara TC, int power, bool harvest=false)
 
void AddResistCon (Condition con)
 
void ResistCon (Condition con)
 
void Sleep (Thing bed=null, Thing pillow=null, bool pickup=false, ItemPosition posBed=null, ItemPosition posPillow=null)
 
void OnSleep (Thing bed=null, int days=1)
 
void OnSleep (int power, int days=1)
 
void ModHeight (int a)
 
void ModWeight (int a, bool ignoreLimit=false)
 
void ModCorruption (int a)
 
List< ElementListAvailabeFeats (bool pet=false, bool showAll=false)
 
void SetFeat (int id, int value=1, bool msg=false)
 
void SetMutation (int idEle, int a=0)
 
bool MutateRandom (int vec=0, int tries=100, bool ether=false, BlessedState state=BlessedState.Normal)
 
void GainAbility (int ele, int mtp=100, Thing origin=null)
 
bool TryNullifyCurse ()
 
void OnAdvanceDay ()
 
void AddFoodHistory (Thing food)
 
int CountNumEaten (Thing food)
 
int GetPietyValue ()
 
void RefreshFaithElement ()
 
void ModTempElement (int ele, int a, bool naturalDecay=false, bool onlyRenew=false)
 
void DamageTempElements (int p, bool body, bool mind, bool onlyRenew=false)
 
void DamageTempElement (int ele, int p, bool onlyRenew=false)
 
void EnhanceTempElements (int p, bool body, bool mind, bool onlyRenew=false)
 
void EnhanceTempElement (int ele, int p, bool onlyRenew=false)
 
void DiminishTempElements (int a=1)
 
void CureTempElements (int p, bool body, bool mind)
 
void ClearTempElements ()
 
- Public Member Functions inherited from Card
override string ToString ()
 
bool CanReserve (AIAct act)
 
bool TryReserve (AIAct act)
 
void Mod ()
 
Window.SaveData GetWindowSaveData ()
 
bool IsExcludeFromCraft (Recipe.Ingredient ing)
 
void SetDirtyWeight ()
 
void ChangeWeight (int a)
 
int Evalue (int ele)
 
int Evalue (int ele, bool ignoreGlobalElement)
 
int EvalueMax (int ele, int min=0)
 
int Evalue (string alias)
 
bool HasTag (CTAG tag)
 
bool HasEditorTag (EditorTag tag)
 
void AddEditorTag (EditorTag tag)
 
void RemoveEditorTag (EditorTag tag)
 
virtual string GetName (NameStyle style, int num=-1)
 
virtual string GetExtraName ()
 
virtual string GetDetail ()
 
int GetBestAttribute ()
 
void ModExp (string alias, int a)
 
void ModExp (int ele, int a)
 
bool IsChildOf (Card c)
 
FindTool< T > ()
 
string ReferenceId ()
 
void Create (string _id, int _idMat=-1, int genLv=-1)
 
virtual void OnBeforeCreate ()
 
virtual void OnCreate (int genLv)
 
virtual void SetSource ()
 
virtual void ApplyEditorTags (EditorTag tag)
 
void ApplyTrait ()
 
Card SetLv (int a)
 
void ClampInitialSkill ()
 
void AddExp (int a)
 
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 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 int ApplyProtection (int dmg, int mod=100)
 
void DamageHP (int dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
 
void DamageHP (int dmg, int ele, int eleP=100, AttackSource attackSource=AttackSource.None, Card origin=null, bool showEffect=true, Thing weapon=null, Chara originalTarget=null)
 
void ApplyElementEffect (Element e, int eleP, Card origin, bool checkHostileAct=false)
 
virtual void Die (Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None, Chara originalTarget=null)
 
void Explode (Point p, Card origin)
 
void Deconstruct ()
 
void Destroy ()
 
void SpawnLoot (Card origin)
 
Thing TryMakeRandomItem (int lv=-1, TryMakeRandomItemSource itemSource=TryMakeRandomItemSource.Default, Chara crafter=null)
 
Card MakeFoodFrom (string _id)
 
Card MakeFoodFrom (Card c)
 
void MakeFoodRef (Card c1, Card c2=null)
 
string TryGetFoodName (Card c)
 
string GetFoodName (string s)
 
void MakeFigureFrom (string id)
 
Card MakeRefFrom (string id)
 
void MakeRefFrom (Card c1, Card c2=null)
 
Thing MakeEgg (bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
 
Thing MakeMilk (bool effect=true, int num=1, bool addToZone=true, BlessedState? state=null)
 
Thing GiveBirth (Thing t, bool effect)
 
Card SetHidden (bool hide=true)
 
virtual MoveResult _Move (Point p, MoveType type=MoveType.Walk)
 
void MoveImmediate (Point p, bool focus=true, bool cancelAI=true)
 
void Teleport (Point point, bool silent=false, bool force=false)
 
virtual void OnLand ()
 
int ResistLvFrom (int ele)
 
int ResistLv (int res)
 
bool HasElement (int ele, int req=1)
 
bool HasElement (string id, int req=1)
 
bool HasGlobalElement (int ele)
 
bool HasElementNoCopy ()
 
virtual CardRenderer _CreateRenderer ()
 
void AddBlood (int a=1, int id=-1)
 
RenderParam GetRenderParam ()
 
virtual void SetRenderParam (RenderParam p)
 
void DyeRandom ()
 
void Dye (string idMat)
 
void Dye (SourceMaterial.Row mat)
 
void RefreshColor ()
 
ref Color GetRandomColor ()
 
virtual Sprite GetSprite (int dir=0)
 
virtual Sprite GetImageSprite ()
 
void SetImage (Image image, int dir, int idSkin=0)
 
virtual void SetImage (Image image)
 
void ShowEmo (Emo _emo=Emo.none, float duration=0f, bool skipSame=true)
 
void PlaySoundHold (bool spatial=true)
 
void PlaySoundDrop (bool spatial=true)
 
void PlaySoundImpact (bool spatial=true)
 
void PlaySoundDead (bool spatial=true)
 
SoundSource PlaySound (string id, float v=1f, bool spatial=true)
 
void KillAnime ()
 
void PlayAnime (AnimeID id, bool force=false)
 
void PlayAnime (AnimeID id, Point dest, bool force=false)
 
void PlayAnimeLoot ()
 
Effect PlayEffect (string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
 
void PlayEffect (int ele, bool useRenderPos=true, float range=0f)
 
virtual void SetDir (int d)
 
void SetRandomDir ()
 
virtual void LookAt (Card c)
 
virtual void LookAt (Point p)
 
virtual void Rotate (bool reverse=false)
 
void ChangeAltitude (int a)
 
virtual SubPassData GetSubPassData ()
 
void SetFreePos (Point point)
 
void RenderMarker (Point point, bool active, HitResult result, bool main, int dir, bool useCurrentPosition=false)
 
void RecalculateFOV ()
 
bool HasLight ()
 
float GetLightPower ()
 
int 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 ApplyNewLine (string text)
 
void SayRaw (string text, string ref1=null, string ref2=null)
 
void SayNothingHappans ()
 
void Say (string lang, string ref1=null, string ref2=null)
 
void Say (string lang, Card c1, Card c2, string ref1=null, string ref2=null)
 
void Say (string lang, Card c1, string ref1=null, string ref2=null)
 
string GetTalkText (string idTopic, bool stripPun=false, bool useDefault=true)
 
string ApplyTone (string text, bool stripPun=false)
 
void SetRandomTalk ()
 
void SetRandomTone ()
 
bool HasCraftBonusTrait ()
 
List< ElementListCraftBonusTraits ()
 
void TryStack (Thing t)
 
void ApplyBacker (int bid)
 
void RemoveBacker ()
 
void SetPaintData ()
 
byte[] GetPaintData ()
 
void ClearPaintSprite ()
 
Sprite GetPaintSprite ()
 
void TryUnrestrain (bool force=false, Chara c=null)
 
TraitShackle GetRestrainer ()
 
virtual void Tick ()
 
Thing SetPriceFix (int a)
 
int GetEquipValue ()
 
void SetSale (bool sale)
 
int GetValue (PriceType priceType=PriceType.Default, bool sell=false)
 
virtual int GetPrice (CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
 
virtual string GetHoverText ()
 
virtual string GetHoverText2 ()
 
int Dist (Card c)
 
int Dist (Point p)
 
bool IsInMutterDistance (int d=10)
 
void SetCensored (bool enable)
 
void SetDeconstruct (bool deconstruct)
 
virtual bool MatchEncSearch (string s)
 
virtual void SetSortVal (UIList.SortMode m, CurrencyType currency=CurrencyType.Money)
 
virtual int SecondaryCompare (UIList.SortMode m, Card c)
 
void ForeachFOV (Func< Point, bool > func)
 
void ForeachPoint (Action< Point, bool > action)
 
void OnInspect ()
 
virtual void WriteNote (UINote n, Action< UINote > onWriteNote=null, IInspect.NoteMode mode=IInspect.NoteMode.Default, Recipe recipe=null)
 
void Inspect ()
 
virtual bool HasCondition< T > ()
 
bool HaveFur ()
 
bool CanBeSheared ()
 
- Public Member Functions inherited from BaseCard
bool GetBool (int id)
 
void SetBool (int id, bool enable)
 
int GetInt (int id, int? defaultInt=null)
 
void AddInt (int id, int value)
 
void SetInt (int id, int value=0)
 
string GetStr (int id, string defaultStr=null)
 
void SetStr (int id, string value=null)
 
GetObj< T > (int id)
 
void SetObj (int id, object o)
 
SetObj< T > (int id, object o)
 
ICardParent GetRoot ()
 
void RemoveCard (Card c)
 
void OnChildNumChange (Card c)
 
string ReferenceId ()
 
void WriteNote (UINote n, Action< UINote > onWriteNote=null, NoteMode mode=NoteMode.Default, Recipe recipe=null)
 
void OnInspect ()
 

Public Attributes

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

Static Public Attributes

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

Protected Member Functions

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

Properties

string Aka [get]
 
string _alias [get, set]
 
string idFaith [get, set]
 
string idFaction [get, set]
 
Zone currentZone [get, set]
 
Zone homeZone [get, set]
 
GoalListType goalListType [get, set]
 
Hostility hostility [get, set]
 
int _affinity [get, set]
 
Affinity affinity [get]
 
int interest [get, set]
 
int daysStarved [get, set]
 
int _idTimeTable [get, set]
 
int uidEditor [get, set]
 
int _maxStamina [get, set]
 
int corruption [get, set]
 
bool isDead [get, set]
 
bool isAlawysVisible [get, set]
 
bool knowFav [get, set]
 
CharaAbility ability [get]
 
Faction faction [get, set]
 
Religion faith [get, set]
 
override CardRow sourceCard [get]
 
override CardRow sourceRenderCard [get]
 
SourceRace.Row race [get]
 
SourceJob.Row job [get]
 
string idTimeTable [get]
 
Hostility OriginalHostility [get]
 
string IDPCCBodySet [get]
 
new TraitChara trait [get, set]
 
string NameBraced [get]
 
string NameTitled [get]
 
override string actorPrefab [get]
 
override int PrefIndex [get]
 
override bool flipX [get]
 
override string AliasMaterialOnCreate [get]
 
override bool IsAliveInCurrentZone [get]
 
override bool IsDeadOrSleeping [get]
 
override bool IsDisabled [get]
 
bool IsLevitating [get]
 
override bool IsMoving [get]
 
override bool IsGlobal [get]
 
override bool IsPC [get]
 
override bool IsPCParty [get]
 
override bool IsMinion [get]
 
override bool IsPCPartyMinion [get]
 
override bool IsPCFactionMinion [get]
 
override bool IsPCFaction [get]
 
override bool IsPCC [get]
 
override bool isThing [get]
 
override bool isChara [get]
 
override bool HasHost [get]
 
override bool isSynced [get]
 
override bool IsMultisize [get]
 
override int MaxHP [get]
 
override int WeightLimit [get]
 
override int SelfWeight [get]
 
int MaxSummon [get]
 
Element MainElement [get]
 
override int DV [get]
 
override int PV [get]
 
override SourcePref Pref [get]
 
bool CanOpenDoor [get]
 
Tactics tactics [get]
 
TimeTable.Span CurrentSpan [get]
 
bool IsInActiveZone [get]
 
bool IsLocalChara [get]
 
bool IsIdle [get]
 
bool IsInCombat [get]
 
bool IsAnimal [get]
 
bool IsHuman [get]
 
bool IsUndead [get]
 
bool IsMachine [get]
 
bool IsHorror [get]
 
bool IsFish [get]
 
bool IsFairy [get]
 
bool IsGod [get]
 
bool IsDragon [get]
 
bool IsPlant [get]
 
int DestDist [get]
 
bool HasNoGoal [get]
 
bool CanWitness [get]
 
bool IsHumanSpeak [get]
 
bool IsMaid [get]
 
bool IsPrisoner [get]
 
bool IsAdventurer [get]
 
bool IsEyth [get]
 
bool IsWealthy [get]
 
FactionBranch homeBranch [get]
 
int MaxGeneSlot [get]
 
int CurrentGeneSlot [get]
 
int Speed [get]
 
bool IsMofuable [get]
 
ElementContainer baseWorkElements [get]
 
Stats hunger [get]
 
Stats burden [get]
 
Stats stamina [get]
 
Stats depression [get]
 
Stats bladder [get]
 
Stats hygiene [get]
 
Stats mana [get]
 
Stats sleepiness [get]
 
Stats SAN [get]
 
bool CanGainConResist [get]
 
- Properties inherited from Card
Card parentCard [get]
 
Thing parentThing [get]
 
int colorInt [get]
 
bool IsHotItem [get]
 
int uid [get, set]
 
int idMaterial [get, set]
 
int dir [get, set]
 
int Num [get, set]
 
int _x [get, set]
 
int _z [get, set]
 
int 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 isBackerContent [get]
 
SourceBacker.Row sourceBacker [get]
 
BedType c_bedType [get, set]
 
int c_equippedSlot [get, set]
 
int c_lockLv [get, set]
 
Hostility c_originalHostility [get, set]
 
MinionType c_minionType [get, set]
 
int c_vomit [get, set]
 
bool c_wasInPcParty [get, set]
 
bool c_isImportant [get, set]
 
bool c_lockedHard [get, set]
 
bool c_revealLock [get, set]
 
bool c_isTrained [get, set]
 
bool c_isPrayed [get, set]
 
bool c_isDisableStockUse [get, set]
 
int c_lightColor [get, set]
 
Color LightColor [get]
 
int c_uidZone [get, set]
 
int c_uidRefCard [get, set]
 
int c_priceFix [get, set]
 
int c_priceAdd [get, set]
 
int c_priceCopy [get, set]
 
int c_fixedValue [get, set]
 
int c_dyeMat [get, set]
 
VisitorState visitorState [get, set]
 
RescueState c_rescueState [get, set]
 
BossType c_bossType [get, set]
 
int c_dateStockExpire [get, set]
 
int c_dateDeathLock [get, set]
 
int c_IDTState [get, set]
 
int c_charges [get, set]
 
int c_bill [get, set]
 
int c_invest [get, set]
 
int c_seed [get, set]
 
int c_allowance [get, set]
 
int c_fur [get, set]
 
int c_dateCooked [get, set]
 
int c_lockedAge [get, set]
 
int c_containerSize [get, set]
 
int c_weight [get, set]
 
int c_diceDim [get, set]
 
int c_indexContainerIcon [get, set]
 
int c_idMainElement [get, set]
 
int c_summonDuration [get, set]
 
int c_idBacker [get, set]
 
int c_uidMaster [get, set]
 
int c_ammo [get, set]
 
int c_daysWithGod [get, set]
 
int c_daysWithPC [get, set]
 
string c_idPortrait [get, set]
 
string c_idRace [get, set]
 
string c_idJob [get, set]
 
string c_idTone [get, set]
 
string c_color [get, set]
 
string c_idSpriteReplacer [get, set]
 
string c_idTalk [get, set]
 
string c_idDeity [get, set]
 
string c_altName [get, set]
 
string c_altName2 [get, set]
 
string c_extraNameRef [get, set]
 
string c_refText [get, set]
 
string c_idRefName [get, set]
 
string c_idRidePCC [get, set]
 
string c_idAbility [get, set]
 
string c_context [get, set]
 
string c_idEditor [get, set]
 
string c_editorTags [get, set]
 
string c_editorTraitVal [get, set]
 
string c_idTrait [get, set]
 
string c_idRefCard [get, set]
 
string c_idRefCard2 [get, set]
 
string c_note [get, set]
 
UniqueData c_uniqueData [get, set]
 
Thing ammoData [get, set]
 
List< SocketDatasocketList [get, set]
 
Thing c_copyContainer [get, set]
 
Window.SaveData c_windowSaveData [get, set]
 
CharaUpgrade c_upgrades [get, set]
 
CharaGenes c_genes [get, set]
 
List< int > c_corruptionHistory [get, set]
 
ContainerUpgrade c_containerUpgrade [get, set]
 
DNA c_DNA [get, set]
 
CharaList c_charaList [get, set]
 
MixedFoodData c_mixedFoodData [get, set]
 
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]
 
TileType TileType [get]
 
string Name [get]
 
string NameSimple [get]
 
string NameOne [get]
 
virtual bool IsPC [get]
 
bool _IsPC [get]
 
virtual bool IsPCC [get]
 
virtual bool IsPCParty [get]
 
virtual bool IsMinion [get]
 
virtual bool IsPCPartyMinion [get]
 
virtual bool IsPCFactionMinion [get]
 
virtual bool IsMultisize [get]
 
bool IsToolbelt [get]
 
bool IsLightsource [get]
 
bool IsEquipment [get]
 
bool IsFood [get]
 
bool IsInheritFoodTraits [get]
 
bool ShowFoodEnc [get]
 
bool IsWeapon [get]
 
bool IsEquipmentOrRanged [get]
 
bool IsEquipmentOrRangedOrAmmo [get]
 
bool IsMeleeWeapon [get]
 
bool IsRangedWeapon [get]
 
bool IsThrownWeapon [get]
 
bool IsAmmo [get]
 
bool IsAgent [get]
 
bool IsFurniture [get]
 
bool IsBlessed [get]
 
bool IsCursed [get]
 
bool IsRestrainedResident [get]
 
virtual bool IsPCFaction [get]
 
bool IsPCFactionOrMinion [get]
 
virtual bool IsGlobal [get]
 
virtual int MaxDecay [get]
 
bool IsDecayed [get]
 
bool IsRotting [get]
 
bool IsFresn [get]
 
virtual int MaxHP [get]
 
virtual int Power [get]
 
int FameLv [get]
 
virtual int[] Tiles [get]
 
virtual int PrefIndex [get]
 
bool IsVariation [get]
 
virtual int DV [get]
 
virtual int PV [get]
 
int HIT [get]
 
int DMG [get]
 
int STR [get]
 
int DEX [get]
 
int END [get]
 
int PER [get]
 
int LER [get]
 
int WIL [get]
 
int MAG [get]
 
int CHA [get]
 
int INT [get]
 
int LUC [get]
 
int W [get]
 
int H [get]
 
bool IsIdentified [get]
 
string TextRarity [get]
 
bool IsInstalled [get]
 
bool IsMale [get]
 
bool IsNegativeGift [get]
 
bool HasContainerSize [get]
 
Thing Tool [get]
 
virtual SourceMaterial.Row DefaultMaterial [get]
 
virtual bool HasHost [get]
 
int Quality [get]
 
int QualityLv [get]
 
LightData LightData [get]
 
CardRenderer HostRenderer [get]
 
bool ShouldShowMsg [get]
 
bool CanInspect [get]
 
string InspectName [get]
 
Point InspectPoint [get]
 
Vector3 InspectPosition [get]
 
- Properties inherited from EClass
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Faction Wilds [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 
- Properties inherited from IInspect
bool CanInspect [get]
 
string InspectName [get]
 
Point InspectPoint [get]
 
Vector3 InspectPosition [get]
 

Private Member Functions

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

Private Attributes

Faction _faction
 
int _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 }
 
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 (int a, int start, int step, int rate=75)
 
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 6407 of file Chara.cs.

6408 {
6409 CardRenderer cardRenderer = renderer;
6410 CharaRenderer charaRenderer = new CharaRenderer();
6411 if (source.skinAntiSpider != 0 && EClass.core.config.game.antiSpider)
6412 {
6413 base.idSkin = source.skinAntiSpider;
6414 }
6415 if (host != null)
6416 {
6417 charaRenderer.pccData = PCCData.Create("ride");
6418 string idPart = base.c_idRidePCC.IsEmpty(EClass.core.pccs.sets["ride"].map["body"].map.Keys.First());
6419 charaRenderer.pccData.SetPart("body", "ride", idPart);
6420 charaRenderer.pccData.ride = EClass.core.pccs.GetRideData(idPart);
6421 }
6422 else
6423 {
6424 foreach (Condition condition in conditions)
6425 {
6426 RendererReplacer rendererReplacer = condition.GetRendererReplacer();
6427 if (rendererReplacer != null)
6428 {
6429 charaRenderer.replacer = rendererReplacer;
6430 charaRenderer.data = rendererReplacer.data;
6431 break;
6432 }
6433 }
6434 if (charaRenderer.replacer == null)
6435 {
6436 charaRenderer.pccData = pccData;
6437 }
6438 }
6439 renderer = charaRenderer;
6440 renderer.SetOwner(this);
6441 if (cardRenderer != null)
6442 {
6443 renderer.SetFirst(first: false, cardRenderer.position);
6444 }
6445 return charaRenderer;
6446 }
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:59
PCCData pccData
Chara host
Definition: Chara.cs:33
List< Condition > conditions
Definition: Chara.cs:209
SourceChara.Row source
Definition: Chara.cs:156
PCCData pccData
Definition: Chara.cs:67
new GameConfig game
Definition: CoreConfig.cs:604
PCCManager pccs
Definition: Core.cs:41
CoreConfig config
Definition: Core.cs:70
Definition: EClass.cs:5
static Core core
Definition: EClass.cs:6

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

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

◆ _MakeAlly()

void Chara._MakeAlly ( )
inline

Definition at line 2252 of file Chara.cs.

2253 {
2254 if (EClass.pc.homeBranch != null)
2255 {
2257 }
2258 else
2259 {
2260 SetGlobal();
2262 }
2263 Hostility hostility2 = (base.c_originalHostility = Hostility.Ally);
2264 this.hostility = hostility2;
2265 orgPos = null;
2266 base.c_summonDuration = 0;
2267 base.isSummon = false;
2268 ReleaseMinion();
2269 SetInt(32);
2270 Refresh();
2271 }
Hostility
Definition: Hostility.cs:2
list. Refresh()
void SetInt(int id, int value=0)
Definition: BaseCard.cs:39
void ReleaseMinion()
Definition: Chara.cs:2309
Chara SetFaction(Faction f)
Definition: Chara.cs:1401
Point orgPos
Definition: Chara.cs:21
FactionBranch homeBranch
Definition: Chara.cs:1052
Chara SetGlobal()
Definition: Chara.cs:1468
static Faction Home
Definition: EClass.cs:26
static Chara pc
Definition: EClass.cs:14
void AddMemeber(Chara c)

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

Referenced by MakeAlly(), and MakePartyMemeber().

◆ _Move()

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

Reimplemented from Card.

Definition at line 2689 of file Chara.cs.

2690 {
2691 if (isDead)
2692 {
2693 return MoveResult.Fail;
2694 }
2695 if (IsPC)
2696 {
2697 float num = EClass.setting.defaultActPace;
2698 switch (burden.GetPhase())
2699 {
2700 case 3:
2701 num *= 1.5f;
2702 break;
2703 case 4:
2704 num *= 2f;
2705 break;
2706 }
2708 {
2709 int num2 = 30;
2710 if (!EClass.pc.HasElement(408))
2711 {
2713 {
2714 case Weather.Condition.Rain:
2715 num2 += 5;
2716 break;
2717 case Weather.Condition.RainHeavy:
2718 num2 += 10;
2719 num *= 1.5f;
2720 break;
2721 case Weather.Condition.Snow:
2722 num2 += 10;
2723 break;
2724 case Weather.Condition.SnowHeavy:
2725 num2 += 15;
2726 num *= 1.5f;
2727 break;
2728 }
2729 }
2730 if (newPoint.matFloor.id == 48)
2731 {
2732 num2 += 20;
2733 num *= 1.8f;
2734 }
2735 num2 = num2 * 100 / (100 + EvalueMax(240, -20) + EvalueMax(407, -5) * 5);
2736 EClass.world.date.AdvanceMin(num2 * 6);
2737 EClass.player.lastZonePos = null;
2739 int num3 = base.hp;
2740 for (int i = 0; i < num2 * 4; i++)
2741 {
2742 EClass.pc.party.members.ForeachReverse(delegate(Chara m)
2743 {
2744 if (!m.isDead)
2745 {
2746 m.TickConditions();
2747 }
2748 });
2749 if (base.hp < MaxHP / 5 && base.hp < num3 && !EClass.player.regionMoveWarned)
2750 {
2751 EClass.player.regionMoveWarned = true;
2752 Msg.Say("regionAbortMove");
2753 EInput.Consume(consumeAxis: true);
2754 SetAI(new NoGoal());
2755 return MoveResult.Fail;
2756 }
2757 }
2758 if (newPoint.cell.CanSuffocate())
2759 {
2760 AddCondition<ConSuffocation>((EClass.pc.Evalue(200) != 0) ? (2000 / (100 + EvalueMax(200, -5) * 10)) : 30, force: true);
2761 int num4 = GetCondition<ConSuffocation>()?.GetPhase() ?? 0;
2762 if (num4 >= 2)
2763 {
2764 DamageHP(EClass.rndHalf(10 + MaxHP / 5), AttackSource.Condition);
2765 }
2766 if (!isDead && !HasElement(429))
2767 {
2768 ModExp(200, 1 + num4 * 12);
2769 }
2770 }
2771 EClass.player.regionMoveWarned = false;
2772 if (isDead)
2773 {
2774 return MoveResult.Fail;
2775 }
2776 }
2777 if (num > EClass.setting.defaultActPace * 3f)
2778 {
2779 num = EClass.setting.defaultActPace * 3f;
2780 }
2781 actTime = num;
2782 }
2783 if (IsPCFaction && EClass.rnd(5) == 0 && newPoint.cell.CanSuffocate())
2784 {
2785 ModExp(200, EClass._zone.IsRegion ? 50 : 5);
2786 if (ride != null)
2787 {
2788 ride.ModExp(200, EClass._zone.IsRegion ? 50 : 5);
2789 }
2790 if (parasite != null)
2791 {
2792 parasite.ModExp(200, EClass._zone.IsRegion ? 50 : 5);
2793 }
2794 }
2795 Chara chara = ((ride == null) ? this : ride);
2796 if (!EClass._zone.IsRegion || chara.IsPC)
2797 {
2798 bool flag = (chara.isConfused && EClass.rnd(2) == 0) || (chara.isDrunk && EClass.rnd(IsIdle ? 2 : 8) == 0 && !chara.HasElement(1215));
2799 if (host != null && host.ride == this && ((host.isConfused && EClass.rnd(2) == 0) || (host.isDrunk && EClass.rnd(IsIdle ? 2 : 8) == 0 && !host.HasElement(1215))))
2800 {
2801 flag = true;
2802 }
2803 if (flag && newPoint.Distance(pos) <= 1)
2804 {
2805 Point randomNeighbor = pos.GetRandomNeighbor();
2806 if (CanMoveTo(randomNeighbor, allowDestroyPath: false))
2807 {
2808 newPoint = randomNeighbor;
2809 if (isDrunk)
2810 {
2811 Talk("drunk");
2812 }
2813 }
2814 }
2815 }
2816 if (newPoint.x != pos.x || newPoint.z != pos.z)
2817 {
2818 LookAt(newPoint);
2819 }
2820 CellEffect effect = base.Cell.effect;
2821 if (effect != null && effect.id == 7)
2822 {
2823 CellEffect effect2 = base.Cell.effect;
2824 if (race.height < 500 && !race.tag.Contains("webfree") && EClass.rnd(effect2.power + 25) > EClass.rnd(base.STR + base.DEX + 1))
2825 {
2826 Say("abWeb_caught", this);
2827 PlaySound("web");
2828 effect2.power = effect2.power * 3 / 4;
2829 renderer.PlayAnime(AnimeID.Shiver);
2830 return MoveResult.Fail;
2831 }
2832 Say("abWeb_pass", this);
2833 EClass._map.SetEffect(base.Cell.x, base.Cell.z);
2834 }
2835 if (IsPC)
2836 {
2837 if (EClass._zone.IsRegion)
2838 {
2840 }
2841 else if ((newPoint.x > pos.x && newPoint.z > pos.z) || (newPoint.x < pos.x && newPoint.z < pos.z))
2842 {
2844 }
2845 }
2846 if (newPoint.cell.hasDoor)
2847 {
2848 foreach (Thing thing in pos.Things)
2849 {
2850 if (thing.trait is TraitDoor traitDoor && traitDoor.owner.c_lockLv > 0)
2851 {
2852 if (base.INT < 10)
2853 {
2854 return MoveResult.Fail;
2855 }
2856 traitDoor.TryOpenLock(this);
2857 return MoveResult.Door;
2858 }
2859 }
2860 }
2861 Cell cell = newPoint.cell;
2862 Cell cell2 = pos.cell;
2863 bool flag2 = cell.HasLiquid && !IsLevitating;
2864 bool hasBridge = cell.HasBridge;
2865 bool hasRamp = cell.HasRamp;
2866 bool flag3 = EClass._zone.IsSnowCovered && !cell.HasRoof && !cell.isClearSnow;
2867 TileRow tileRow = (hasRamp ? ((TileRow)cell.sourceBlock) : ((TileRow)(hasBridge ? cell.sourceBridge : cell.sourceFloor)));
2868 SourceMaterial.Row row = (hasRamp ? cell.matBlock : (hasBridge ? cell.matBridge : cell.matFloor));
2869 bool flag4 = cell.IsTopWater && !cell.isFloating;
2870 if (!EClass._zone.IsRegion)
2871 {
2872 if (cell.hasDoorBoat)
2873 {
2874 tileRow = FLOOR.sourceWood;
2875 row = MATERIAL.sourceOak;
2876 flag4 = false;
2877 }
2878 else if (flag3 && !tileRow.ignoreSnow)
2879 {
2880 if (tileRow.tileType.IsWater)
2881 {
2882 tileRow = FLOOR.sourceIce;
2883 row = MATERIAL.sourceIce;
2884 }
2885 else
2886 {
2887 tileRow = FLOOR.sourceSnow;
2888 row = MATERIAL.sourceSnow;
2889 }
2890 flag4 = false;
2891 }
2892 }
2893 if ((pos.sourceFloor.isBeach || cell2.IsSnowTile) && !pos.HasObj)
2894 {
2895 EClass._map.SetFoormark(pos, 1, (int)Util.GetAngle(pos.x - newPoint.x, pos.z - newPoint.z), cell2.IsSnowTile ? 312 : 304);
2896 }
2897 if (isSynced)
2898 {
2899 string text = ((flag2 || flag4) ? "water" : tileRow.soundFoot.IsEmpty(row.soundFoot.IsEmpty("default")));
2900 if (cell.obj != 0 && cell.sourceObj.tileType.IsPlayFootSound && !cell.matObj.soundFoot.IsEmpty())
2901 {
2902 text = cell.matObj.soundFoot;
2903 }
2904 if (IsPC)
2905 {
2906 foreach (Thing thing2 in newPoint.Things)
2907 {
2908 if (thing2.IsInstalled && (thing2.trait.IsChangeFloorHeight || thing2.Pref.Surface))
2909 {
2910 text = thing2.material.soundFoot;
2911 }
2912 }
2913 }
2914 if (!text.IsEmpty())
2915 {
2916 SoundManager.altLastData = IsPC;
2917 PlaySound("Footstep/" + text, IsPC ? 1f : 0.9f);
2918 }
2919 if (!flag4)
2920 {
2922 PCOrbit pcOrbit = EClass.screen.pcOrbit;
2923 bool flag5 = scene.actionMode.gameSpeed > 1f;
2924 scene.psFoot.transform.position = renderer.position + pcOrbit.footPos;
2925 scene.psFoot.startColor = row.matColor;
2926 scene.psFoot.Emit(pcOrbit.emitFoot * ((!flag5) ? 1 : 2));
2927 if (flag5 && IsPC)
2928 {
2929 scene.psSmoke.transform.position = renderer.position + pcOrbit.smokePos;
2930 scene.psSmoke.Emit(pcOrbit.emitSmoke);
2931 }
2932 }
2933 if (flag2 || flag4)
2934 {
2935 Effect.Get("ripple").Play(0.4f * actTime * EClass.scene.actionMode.gameSpeed, newPoint);
2936 }
2937 }
2938 lastPos.Set(pos);
2939 if (type != MoveType.Force)
2940 {
2941 if (newPoint.HasChara && ai.Current.PushChara)
2942 {
2943 TryPush(newPoint);
2944 }
2945 if (newPoint.HasChara && newPoint.Charas.Count == 1)
2946 {
2947 Chara chara2 = newPoint.Charas[0];
2948 if (CanReplace(chara2))
2949 {
2950 chara2.MoveByForce(lastPos, this);
2951 if (chara.IsPC)
2952 {
2953 Say("replace_pc", chara, chara2);
2954 }
2955 }
2956 }
2957 }
2958 if (cell.hasDoor)
2959 {
2960 foreach (Thing thing3 in newPoint.Things)
2961 {
2962 if (thing3.trait is TraitDoor traitDoor2)
2963 {
2964 traitDoor2.TryOpen(this);
2965 }
2966 }
2967 }
2968 EClass._zone.map.MoveCard(newPoint, this);
2969 SyncRide();
2971 {
2972 foreach (Chara member in EClass.pc.party.members)
2973 {
2974 if (member.isLeashed && !member.IsPC && member.host == null && !member.IsDisabled && !member.HasCondition<ConEntangle>() && !member.IsInCombat && member.Dist(EClass.pc) > 1)
2975 {
2976 member.TryMoveTowards(EClass.pc.pos);
2977 }
2978 }
2979 }
2981 {
2983 }
2984 if (IsPC)
2985 {
2986 PlaySound("Footstep/Extra/pcfootstep");
2987 if (pos.HasThing)
2988 {
2989 foreach (Card item in pos.ListCards())
2990 {
2991 if (!item.isThing || item.placeState != 0 || item.ignoreAutoPick)
2992 {
2993 continue;
2994 }
2996 {
2998 ContainerFlag containerFlag = item.category.GetRoot().id.ToEnum<ContainerFlag>();
2999 if (containerFlag == ContainerFlag.none)
3000 {
3001 containerFlag = ContainerFlag.other;
3002 }
3003 if ((dataPick.noRotten && item.IsDecayed) || (dataPick.onlyRottable && item.trait.Decay == 0))
3004 {
3005 continue;
3006 }
3007 if (dataPick.userFilter)
3008 {
3009 switch (dataPick.IsFilterPass(item.GetName(NameStyle.Full, 1)))
3010 {
3011 case Window.SaveData.FilterResult.PassWithoutFurtherTest:
3012 Pick(item.Thing);
3013 continue;
3014 case Window.SaveData.FilterResult.Block:
3015 continue;
3016 }
3017 }
3018 if (dataPick.advDistribution)
3019 {
3020 foreach (int cat in dataPick.cats)
3021 {
3022 if (item.category.uid == cat)
3023 {
3024 Pick(item.Thing);
3025 }
3026 }
3027 }
3028 else if (!dataPick.flag.HasFlag(containerFlag))
3029 {
3030 Pick(item.Thing);
3031 }
3032 }
3033 else
3034 {
3035 Pick(item.Thing);
3036 }
3037 }
3038 }
3039 if (EClass._zone.IsRegion)
3040 {
3042 if (cell3?.zone != null && !cell3.zone.HiddenInRegionMap && (!(cell3.zone is Zone_Field) || cell3.zone.children.Count > 0 || cell3.zone.IsPCFaction))
3043 {
3044 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() ?? "");
3045 }
3046 if (pos.matFloor.alias == "snow" && EClass.rnd(3) == 0)
3047 {
3049 Msg.Say(Lang.GetList("walk_snow").RandomItem());
3050 }
3051 else if (EClass.world.weather.CurrentCondition == Weather.Condition.RainHeavy && EClass.rnd(3) == 0)
3052 {
3054 Msg.Say(Lang.GetList("walk_storm").RandomItem());
3055 }
3056 }
3058 }
3059 if (IsPCC)
3060 {
3061 int num5 = Mathf.Abs(cell2.topHeight - cell.topHeight);
3062 if ((num5 >= 3 && lastPos.sourceBlock.tileType.slopeHeight == 0 && newPoint.sourceBlock.tileType.slopeHeight == 0) || cell2.hasDoorBoat || cell.hasDoorBoat)
3063 {
3064 renderer.PlayAnime((cell2.topHeight >= cell.topHeight) ? AnimeID.JumpDown : ((num5 >= 6) ? AnimeID.Jump : AnimeID.JumpSmall));
3065 }
3066 else
3067 {
3068 float surfaceHeight = cell2.GetSurfaceHeight();
3069 float surfaceHeight2 = cell.GetSurfaceHeight();
3070 num5 = (int)Mathf.Abs((surfaceHeight - surfaceHeight2) * 100f);
3071 if (num5 >= 15)
3072 {
3073 renderer.PlayAnime((surfaceHeight >= surfaceHeight2) ? AnimeID.JumpDown : ((num5 >= 40) ? AnimeID.Jump : AnimeID.JumpSmall));
3074 }
3075 }
3076 }
3077 lastPos.Things.ForeachReverse(delegate(Thing t)
3078 {
3079 t.trait.OnSteppedOut(this);
3080 });
3081 if (!IsPC)
3082 {
3083 pos.Things.ForeachReverse(delegate(Thing t)
3084 {
3085 t.trait.OnStepped(this);
3086 });
3087 }
3088 if (CanDestroyPath())
3089 {
3091 }
3092 if (IsPC)
3093 {
3094 if (renderer.anime == null && renderer.replacer != null)
3095 {
3097 }
3099 {
3100 if (!FLOOR.IsTatami(pos.cell.sourceSurface.id) && pos.cell.room == null)
3101 {
3102 EClass.player.flags.isShoesOff = false;
3103 EClass.pc.Say("shoes_on", EClass.pc);
3104 EClass.pc.SetPCCState(PCCState.Normal);
3105 }
3106 }
3107 else if (FLOOR.IsTatami(pos.cell.sourceSurface.id) && pos.cell.room != null)
3108 {
3109 EClass.player.flags.isShoesOff = true;
3110 EClass.pc.Say("shoes_off", EClass.pc);
3111 EClass.pc.SetPCCState(PCCState.ShoesOff);
3112 }
3113 }
3114 hasMovedThisTurn = true;
3115 return MoveResult.Success;
3116 }
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:44
virtual float gameSpeed
Definition: ActionMode.cs:119
virtual bool isPCC
Definition: CardActor.cs:39
void PlayAnime(AnimeID id, bool force)
TransAnime anime
Definition: CardRenderer.cs:23
virtual void NextFrame()
CardActor actor
Definition: CardRenderer.cs:11
Definition: Card.cs:11
int EvalueMax(int ele, int min=0)
Definition: Card.cs:2547
void DamageHP(int dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
Definition: Card.cs:3961
bool HasElement(int ele, int req=1)
Definition: Card.cs:5725
SourceMaterial.Row material
Definition: Card.cs:2013
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:5939
int c_lockLv
Definition: Card.cs:938
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
Definition: Card.cs:6489
Point pos
Definition: Card.cs:57
Trait trait
Definition: Card.cs:51
MoveType
Definition: Card.cs:20
MoveResult
Definition: Card.cs:13
bool IsInstalled
Definition: Card.cs:2343
int Evalue(int ele)
Definition: Card.cs:2533
int Dist(Card c)
Definition: Card.cs:7406
void ModExp(string alias, int a)
Definition: Card.cs:2610
bool isLeashed
Definition: Card.cs:828
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:6586
Definition: Cell.cs:7
Room room
Definition: Cell.cs:102
SourceBlock.Row sourceBlock
Definition: Cell.cs:1052
bool IsSnowTile
Definition: Cell.cs:782
bool hasDoorBoat
Definition: Cell.cs:498
bool HasBridge
Definition: Cell.cs:671
bool isClearSnow
Definition: Cell.cs:450
bool isFloating
Definition: Cell.cs:474
SourceMaterial.Row matObj
Definition: Cell.cs:1036
byte topHeight
Definition: Cell.cs:78
SourceMaterial.Row matFloor
Definition: Cell.cs:1032
byte obj
Definition: Cell.cs:38
SourceObj.Row sourceObj
Definition: Cell.cs:1072
bool HasRamp
Definition: Cell.cs:837
bool hasDoor
Definition: Cell.cs:258
SourceFloor.Row sourceSurface
Definition: Cell.cs:1059
float GetSurfaceHeight()
Definition: Cell.cs:1688
bool CanSuffocate()
Definition: Cell.cs:1111
Definition: Chara.cs:10
void TickConditions()
Definition: Chara.cs:3610
bool IsLevitating
Definition: Chara.cs:595
AIAct ai
Definition: Chara.cs:200
override bool IsPC
Definition: Chara.cs:610
bool isDrunk
Definition: Chara.cs:124
Party party
Definition: Chara.cs:43
bool CanDestroyPath()
Definition: Chara.cs:2357
bool IsInCombat
Definition: Chara.cs:862
bool HasCondition(string alias)
Definition: Chara.cs:9054
AIAct SetAI(AIAct g)
Definition: Chara.cs:8527
bool IsIdle
Definition: Chara.cs:851
override bool IsDisabled
Definition: Chara.cs:583
bool hasMovedThisTurn
Definition: Chara.cs:174
override bool isSynced
Definition: Chara.cs:689
bool CanMoveTo(Point p, bool allowDestroyPath=true)
Definition: Chara.cs:2370
void DestroyPath(Point pos)
Definition: Chara.cs:3118
override bool IsPCFaction
Definition: Chara.cs:669
float actTime
Definition: Chara.cs:176
override int MaxHP
Definition: Chara.cs:706
Zone currentZone
Definition: Chara.cs:253
bool CanReplace(Chara c)
Definition: Chara.cs:3229
Point lastPos
Definition: Chara.cs:90
void MoveByForce(Point newPoint, Card c=null, bool checkWall=false)
Definition: Chara.cs:2555
Stats burden
Definition: Chara.cs:1126
Chara parasite
Definition: Chara.cs:30
Chara ride
Definition: Chara.cs:27
MoveResult TryMoveTowards(Point p)
Definition: Chara.cs:2563
void SyncRide()
Definition: Chara.cs:3826
bool isDead
Definition: Chara.cs:387
override void LookAt(Card c)
Definition: Chara.cs:3474
bool isConfused
Definition: Chara.cs:126
override bool IsPCC
Definition: Chara.cs:680
void TryPush(Point point)
Definition: Chara.cs:3162
void SetPCCState(PCCState state)
Definition: Chara.cs:6448
SourceRace.Row race
Definition: Chara.cs:462
bool allyKeepDistance
Definition: ConfigTactics.cs:6
static Game game
Definition: EClass.cs:8
static Scene scene
Definition: EClass.cs:30
static Zone _zone
Definition: EClass.cs:20
static World world
Definition: EClass.cs:40
static Map _map
Definition: EClass.cs:18
static int rnd(long a)
Definition: EClass.cs:58
static BaseGameScreen screen
Definition: EClass.cs:32
static int rndHalf(int a)
Definition: EClass.cs:87
static Player player
Definition: EClass.cs:12
static GameSetting setting
Definition: EClass.cs:34
Definition: EInput.cs:8
static void Consume(int _skipFrame)
Definition: EInput.cs:656
Definition: Effect.cs:7
static Effect Get(Effect original)
Definition: Effect.cs:85
void Play(float delay, Point from, float fixY=0f, Point to=null, Sprite sprite=null)
Definition: Effect.cs:100
Zone zone
Definition: EloMap.cs:11
Cell GetCell(Point pos)
Definition: EloMap.cs:272
Definition: FLOOR.cs:2
static SourceFloor.Row sourceSnow
Definition: FLOOR.cs:31
static SourceFloor.Row sourceIce
Definition: FLOOR.cs:35
static bool IsTatami(int id)
Definition: FLOOR.cs:39
static SourceFloor.Row sourceWood
Definition: FLOOR.cs:37
void AdvanceMin(int a)
Definition: GameDate.cs:22
float defaultActPace
Definition: GameSetting.cs:327
RenderSetting render
Definition: GameSetting.cs:301
ConfigTactics tactics
Definition: Game.cs:90
Config config
Definition: Game.cs:215
Definition: Lang.cs:6
static string[] GetList(string id)
Definition: Lang.cs:114
static SourceMaterial.Row sourceOak
Definition: MATERIAL.cs:43
static SourceMaterial.Row sourceSnow
Definition: MATERIAL.cs:37
static SourceMaterial.Row sourceIce
Definition: MATERIAL.cs:39
void MoveCard(Point p, Card t)
Definition: Map.cs:841
void SetFoormark(Point pos, int id, int angle, int offset=0)
Definition: Map.cs:2060
void SetEffect(int x, int z, CellEffect effect=null)
Definition: Map.cs:1508
Color Ono
Definition: MsgColors.cs:13
Definition: Msg.cs:5
static MsgColors colors
Definition: Msg.cs:20
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
static void SetColor()
Definition: Msg.cs:22
Definition: NoGoal.cs:4
int emitFoot
Definition: PCOrbit.cs:9
int emitSmoke
Definition: PCOrbit.cs:11
Vector3 smokePos
Definition: PCOrbit.cs:15
Vector3 footPos
Definition: PCOrbit.cs:13
List< Chara > members
Definition: Party.cs:18
bool isShoesOff
Definition: Player.cs:338
int distanceTravel
Definition: Player.cs:852
Flags flags
Definition: Player.cs:1050
Window.SaveData dataPick
Definition: Player.cs:990
bool regionMoveWarned
Definition: Player.cs:1113
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:1035
Point Set(int _x, int _z)
Definition: Point.cs:491
List< Thing > Things
Definition: Point.cs:326
int x
Definition: Point.cs:36
int z
Definition: Point.cs:39
List< Chara > Charas
Definition: Point.cs:328
bool HasThing
Definition: Point.cs:239
SourceFloor.Row sourceFloor
Definition: Point.cs:65
bool HasObj
Definition: Point.cs:137
int Distance(Point p)
Definition: Point.cs:973
Cell cell
Definition: Point.cs:51
Point GetRandomNeighbor()
Definition: Point.cs:747
bool HasChara
Definition: Point.cs:226
TileType tileType
Definition: RenderRow.cs:77
Definition: Scene.cs:8
ParticleSystem psSmoke
Definition: Scene.cs:113
ActionMode actionMode
Definition: Scene.cs:79
ParticleSystem psFoot
Definition: Scene.cs:111
EloMap elomap
Definition: Scene.cs:149
bool Surface
Definition: SourcePref.cs:318
virtual bool ShowDangerLv
Definition: Spatial.cs:491
virtual bool IsRegion
Definition: Spatial.cs:503
virtual string Name
Definition: Spatial.cs:497
SourceZone.Row source
Definition: Spatial.cs:441
List< Spatial > children
Definition: Spatial.cs:37
override int GetPhase()
Definition: Stats.cs:117
Definition: Thing.cs:8
override SourcePref Pref
Definition: Thing.cs:50
bool ignoreSnow
Definition: TileRow.cs:6
string soundFoot
Definition: TileRow.cs:14
virtual bool IsWater
Definition: TileType.cs:163
virtual void OnSteppedOut(Chara c)
Definition: Trait.cs:1075
virtual bool IsChangeFloorHeight
Definition: Trait.cs:73
virtual void OnStepped(Chara c)
Definition: Trait.cs:1071
Card owner
Definition: Trait.cs:27
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:282
override int DangerLv
Definition: Zone.cs:107
bool IsPCFaction
Definition: Zone.cs:468
virtual bool KeepAllyDistance
Definition: Zone.cs:297
virtual bool HiddenInRegionMap
Definition: Zone.cs:408
Map map
Definition: Zone.cs:60

References EClass._map, EClass._zone, Scene.actionMode, CardRenderer.actor, actTime, CoreConfig.GameConfig.advancedMenu, GameDate.AdvanceMin(), Window.SaveData.advDistribution, ai, ConfigTactics.allyKeepDistance, CardRenderer.anime, GameSetting.RenderSetting.anime, CoreConfig.Test.animeFramePCC, burden, Card.c_lockLv, CanDestroyPath(), CanMoveTo(), CanReplace(), Cell.CanSuffocate(), Window.SaveData.cats, Point.cell, Point.Charas, Spatial.children, Msg.colors, Core.config, Game.config, EInput.Consume(), EClass.core, AIAct.Current, Weather.CurrentCondition, currentZone, Card.DamageHP(), Zone.DangerLv, Player.dataPick, World.date, GameSetting.defaultActPace, DestroyPath(), GameSetting.RenderSetting.AnimeSetting.diagonalSpeed, Card.Dist(), Point.Distance(), Player.distanceTravel, Scene.elomap, PCOrbit.emitFoot, PCOrbit.emitSmoke, Card.Evalue(), Card.EvalueMax(), Window.SaveData.flag, Player.flags, PCOrbit.footPos, CoreConfig.game, EClass.game, ActionMode.gameSpeed, Effect.Get(), EloMap.GetCell(), Lang.GetList(), 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, TileRow.ignoreSnow, Trait.IsChangeFloorHeight, Cell.isClearSnow, isConfused, isDead, 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(), TileType.IsWater, item, Zone.KeepAllyDistance, lastPos, Point.ListCards(), LookAt(), Zone.map, SourceMaterial.Row.matColor, Card.material, Cell.matFloor, Point.matFloor, Cell.matObj, MaxHP, Party.members, Card.ModExp(), MoveByForce(), Map.MoveCard(), Spatial.Name, CardRenderer.NextFrame(), Window.SaveData.noRotten, Cell.obj, MsgColors.Ono, Trait.OnStepped(), Trait.OnSteppedOut(), Trait.owner, parasite, party, EClass.pc, BaseGameScreen.pcOrbit, Zone.PetFollow, Pick, Effect.Play(), CardRenderer.PlayAnime(), EClass.player, Card.PlaySound(), Card.pos, CellEffect.power, Thing.Pref, Scene.psFoot, Scene.psSmoke, AIAct.PushChara, race, Player.regionMoveWarned, GameSetting.RenderSetting.AnimeSetting.regionSpeed, GameSetting.render, Card.renderer, CardRenderer.replacer, ride, EClass.rnd(), EClass.rndHalf(), Cell.room, Msg.Say(), Card.Say(), EClass.scene, EClass.screen, ActWait.Search(), Point.Set(), SetAI(), Msg.SetColor(), Map.SetEffect(), Map.SetFoormark(), SetPCCState(), EClass.setting, Spatial.ShowDangerLv, PCOrbit.smokePos, SourceMaterial.Row.soundFoot, TileRow.soundFoot, Spatial.source, Cell.sourceBlock, Point.sourceBlock, Cell.sourceBridge, Cell.sourceFloor, Point.sourceFloor, FLOOR.sourceIce, MATERIAL.sourceIce, MATERIAL.sourceOak, Cell.sourceObj, FLOOR.sourceSnow, MATERIAL.sourceSnow, Cell.sourceSurface, FLOOR.sourceWood, SourcePref.Surface, SyncRide(), Game.Config.tactics, Card.Talk(), CoreConfig.test, Point.Things, TickConditions(), RenderRow.tileType, Cell.topHeight, Card.trait, TryMoveTowards(), TryPush(), Window.SaveData.userFilter, Util, 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 6983 of file Chara.cs.

6984 {
6985 EClass.Sound.Play("pop_drama");
6986 if (book == "_chara" && IsPC)
6987 {
6988 step = "pc";
6989 }
6990 return LayerDrama.Activate(book, sheet, step, this, null, tag);
6991 }
static SoundManager Sound
Definition: EClass.cs:46
static LayerDrama Activate(string book, string idSheet, string idStep, Chara target=null, Card ref1=null, string tag="")
Definition: LayerDrama.cs:66

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

◆ AddCondition() [1/2]

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

Definition at line 8902 of file Chara.cs.

8903 {
8904 c.owner = this;
8905 if (!(c is ConBurning))
8906 {
8907 if (c is ConBleed && ResistLv(964) >= 3)
8908 {
8909 return null;
8910 }
8911 }
8912 else if (ResistLv(950) >= 3)
8913 {
8914 return null;
8915 }
8917 {
8918 if (c.GainResistFactor >= 400)
8919 {
8920 c.power /= 2;
8921 }
8922 ResistCon(c);
8923 if (c.power <= 0)
8924 {
8925 return null;
8926 }
8927 }
8928 if (!force)
8929 {
8930 if (c.source.negate.Length != 0)
8931 {
8932 string[] negate = c.source.negate;
8933 foreach (string text in negate)
8934 {
8935 if (HasElement(text))
8936 {
8937 return null;
8938 }
8939 }
8940 }
8941 Element defenseAttribute = c.GetDefenseAttribute(this);
8942 if (defenseAttribute != null)
8943 {
8944 c.power = 100 * c.power / Mathf.Max(100 + defenseAttribute.Value, 1);
8945 }
8946 if (c.source.resistance.Length != 0)
8947 {
8948 int num = ResistLv(EClass.sources.elements.alias[c.source.resistance[0]].id);
8949 if (num > 0)
8950 {
8951 c.power /= num * num + 1;
8952 if (c.power <= 40)
8953 {
8954 return null;
8955 }
8956 }
8957 }
8958 c.power = c.EvaluatePower(c.power);
8959 if (c.power <= 0)
8960 {
8961 return null;
8962 }
8963 }
8964 for (int j = 0; j < conditions.Count; j++)
8965 {
8966 if (conditions[j].id != c.id)
8967 {
8968 continue;
8969 }
8970 if (c.Type == ConditionType.Stance || c.IsToggle)
8971 {
8972 conditions[j].Kill();
8973 return null;
8974 }
8975 if (conditions[j].CanStack(c))
8976 {
8977 if (conditions[j].WillOverride)
8978 {
8979 conditions[j].Kill(silent: true);
8980 continue;
8981 }
8982 if (CanGainConResist)
8983 {
8984 AddResistCon(c);
8985 }
8986 conditions[j].OnStacked(c.power);
8987 conditions[j].OnStartOrStack();
8988 conditions[j].PlayEffect();
8989 }
8990 if (!conditions[j].AllowMultipleInstance)
8991 {
8992 return null;
8993 }
8994 }
8995 foreach (Condition condition in conditions)
8996 {
8997 if (condition.TryNullify(c))
8998 {
8999 return null;
9000 }
9001 }
9002 int num2 = c.EvaluateTurn(c.power);
9003 if (num2 == 0)
9004 {
9005 return null;
9006 }
9007 c.value = num2;
9008 conditions.Add(c);
9009 if (CanGainConResist)
9010 {
9011 AddResistCon(c);
9012 }
9013 c.SetOwner(this);
9014 c.Start();
9015 SetDirtySpeed();
9016 if (c.ShouldRefresh)
9017 {
9018 Refresh();
9019 }
9020 if (c.CancelAI)
9021 {
9022 ai.Cancel();
9023 }
9024 if (IsPC && c.ConsumeTurn && !EClass.pc.isRestrained)
9025 {
9027 }
9028 if (c.SyncRide && (ride != null || parasite != null))
9029 {
9030 if (ride != null)
9031 {
9033 }
9034 if (parasite != null)
9035 {
9037 }
9038 }
9039 return c;
9040 }
ConditionType
Definition: ConditionType.cs:2
virtual Status Cancel()
Definition: AIAct.cs:291
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)
bool TryNullify(Condition c)
virtual void SetOwner(Chara _owner, bool onDeserialize=false)
virtual ConditionType Type
Definition: BaseStats.cs:19
SourceStat.Row source
Definition: BaseStats.cs:15
int id
Definition: BaseStats.cs:11
bool isRestrained
Definition: Card.cs:552
int ResistLv(int res)
Definition: Card.cs:5720
void SetDirtySpeed()
Definition: Chara.cs:1815
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:8897
bool CanGainConResist
Definition: Chara.cs:1143
void AddResistCon(Condition con)
Definition: Chara.cs:9284
void ResistCon(Condition con)
Definition: Chara.cs:9304
static Condition Create(string alias, int power=100, Action< Condition > onCreate=null)
Definition: Condition.cs:46
static SourceManager sources
Definition: EClass.cs:42
int Value
Definition: ELEMENT.cs:292
void EndTurn(bool consume=true)
Definition: Player.cs:2020
SourceElement elements

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

◆ AddCondition() [2/2]

◆ AddCondition< T >()

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

Definition at line 8892 of file Chara.cs.

8892 : Condition
8893 {
8894 return AddCondition(typeof(T).Name, p, force);
8895 }
string Name
Definition: Card.cs:2099

◆ AddCooldown()

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

Definition at line 8341 of file Chara.cs.

8342 {
8343 if (_cooldowns == null)
8344 {
8345 _cooldowns = new List<int>();
8346 }
8347 if (turns != 0)
8348 {
8349 _cooldowns.Add(idEle * 1000 + turns);
8350 return;
8351 }
8352 SourceElement.Row row = EClass.sources.elements.map[idEle];
8353 if (row.cooldown > 0)
8354 {
8355 _cooldowns.Add(idEle * 1000 + row.cooldown);
8356 }
8357 }
List< int > _cooldowns
Definition: Chara.cs:58

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

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

◆ AddFoodHistory()

void Chara.AddFoodHistory ( Thing  food)
inline

Definition at line 9733 of file Chara.cs.

9734 {
9735 if (!IsPCFaction || !IsGlobal)
9736 {
9737 _historyFood = null;
9738 return;
9739 }
9740 if (_historyFood == null)
9741 {
9742 _historyFood = new List<List<string>>
9743 {
9744 new List<string>()
9745 };
9746 }
9747 if (_historyFood[0].Count < 5)
9748 {
9749 _historyFood[0].Add(food.id);
9750 }
9751 }
override bool IsGlobal
Definition: Chara.cs:608
List< List< string > > _historyFood
Definition: Chara.cs:64

References food.

Referenced by FoodEffect.Proc().

◆ AddHobby()

void Chara.AddHobby ( int  id)
inline

Definition at line 8727 of file Chara.cs.

8728 {
8729 foreach (int hobby in _hobbies)
8730 {
8731 if (hobby == id)
8732 {
8733 return;
8734 }
8735 }
8736 _hobbies.Add(id);
8737 }
List< int > _hobbies
Definition: Chara.cs:49

◆ AddRandomBodyPart()

void Chara.AddRandomBodyPart ( bool  msg = false)
inline

Definition at line 2147 of file Chara.cs.

2148 {
2149 int ele = new int[9] { 30, 31, 33, 35, 35, 36, 34, 37, 39 }.RandomItem();
2150 body.AddBodyPart(ele);
2151 if (msg)
2152 {
2153 Say("gain_bodyparts", this, Element.Get(ele).GetName().ToLower());
2154 PlaySound("offering");
2155 }
2156 }
void AddBodyPart(int ele, Thing thing=null)
Definition: CharaBody.cs:261
CharaBody body
Definition: Chara.cs:94
static SourceElement.Row Get(int id)
Definition: ELEMENT.cs:401

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

9285 {
9286 if (con.power > 0 && con.GainResistFactor > 0)
9287 {
9288 int key = con.id;
9289 if (resistCon == null)
9290 {
9291 resistCon = new Dictionary<int, int>();
9292 }
9293 if (resistCon.ContainsKey(key))
9294 {
9295 resistCon[key] += con.power * con.GainResistFactor / 100;
9296 }
9297 else
9298 {
9299 resistCon[key] = con.power * con.GainResistFactor / 100;
9300 }
9301 }
9302 }
Dictionary< int, int > resistCon
Definition: Chara.cs:212

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

◆ AddWork()

void Chara.AddWork ( int  id)
inline

Definition at line 8739 of file Chara.cs.

8740 {
8741 foreach (int work in _works)
8742 {
8743 if (work == id)
8744 {
8745 return;
8746 }
8747 }
8748 _works.Add(id);
8749 }
List< int > _works
Definition: Chara.cs:52

◆ ApplyDeathPenalty()

void Chara.ApplyDeathPenalty ( )
inline

Definition at line 5069 of file Chara.cs.

5070 {
5071 if (!IsPC)
5072 {
5073 return;
5074 }
5075 int currency = GetCurrency();
5076 if (currency > 0)
5077 {
5078 int num = currency / 3 + EClass.rnd(currency / 3 + 1);
5079 if (num <= 0)
5080 {
5081 num = 1;
5082 }
5083 Msg.Say("panaltyMoney", this, Lang._currency(num));
5084 ModCurrency(-num);
5086 }
5087 foreach (Element value in EClass.pc.elements.dict.Values)
5088 {
5089 if (EClass.rnd(5) == 0 && value.IsMainAttribute)
5090 {
5091 EClass.pc.elements.ModExp(value.id, -500f);
5092 }
5093 }
5094 }
@ currency
ElementContainerCard elements
Definition: Card.cs:39
int GetCurrency(string id="money")
Definition: Card.cs:3873
void ModCurrency(int a, string id="money")
Definition: Card.cs:3859
void ModExp(int ele, float a, bool chain=false)
Dictionary< int, Element > dict
int id
Definition: ELEMENT.cs:250
bool IsMainAttribute
Definition: ELEMENT.cs:383
static string _currency(object a, string IDCurrency)
Definition: Lang.cs:162
static Thing CreateCurrency(int a, string id="money")
Definition: ThingGen.cs:37
Card AddCard(Card t, Point point)
Definition: Zone.cs:1943

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

1983 {
1984 switch (tag)
1985 {
1986 case EditorTag.HostilityNeutral:
1987 {
1988 Hostility hostility2 = (base.c_originalHostility = Hostility.Neutral);
1989 this.hostility = hostility2;
1990 break;
1991 }
1992 case EditorTag.HostilityEnemy:
1993 {
1994 Hostility hostility2 = (base.c_originalHostility = Hostility.Enemy);
1995 this.hostility = hostility2;
1996 break;
1997 }
1998 case EditorTag.HostilityFriend:
1999 {
2000 Hostility hostility2 = (base.c_originalHostility = Hostility.Friend);
2001 this.hostility = hostility2;
2002 break;
2003 }
2004 case EditorTag.Male:
2005 bio.SetGender(2);
2006 base.c_idPortrait = Portrait.GetRandomPortrait(2, GetIdPortraitCat());
2007 break;
2008 case EditorTag.Female:
2009 bio.SetGender(1);
2010 base.c_idPortrait = Portrait.GetRandomPortrait(1, GetIdPortraitCat());
2011 break;
2012 case EditorTag.baby:
2013 SetFeat(1232);
2014 break;
2015 }
2016 base.ApplyEditorTags(tag);
2017 }
EditorTag
Definition: EditorTag.cs:2
void SetGender(int g)
Definition: Biography.cs:469
Biography bio
Definition: Card.cs:42
void SetFeat(int id, int value=1, bool msg=false)
Definition: Chara.cs:9484
string GetIdPortraitCat()
Definition: Chara.cs:7821
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 2109 of file Chara.cs.

2110 {
2111 elements.ApplyElementMap(base.uid, SourceValueType.Chara, job.elementMap, base.DefaultLV, remove, applyFeat: true);
2112 if (IsPCC)
2113 {
2114 EClass.game.uniforms.Apply(pccData, job.id, base.IsMale, canUseOtherGender: true);
2115 }
2116 }
SourceValueType
SourceJob.Row job
Definition: Chara.cs:464
void ApplyElementMap(int uid, SourceValueType type, Dictionary< int, int > map, int lv, bool invert=false, bool applyFeat=false)
PCCUniformManager uniforms
Definition: Game.cs:191

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

2196 {
2197 string[] array = race.figure.Split('|');
2198 foreach (string s in array)
2199 {
2200 int num = ParseBodySlot(s);
2201 if (num != -1)
2202 {
2203 if (remove)
2204 {
2205 body.RemoveBodyPart(num);
2206 }
2207 else
2208 {
2209 body.AddBodyPart(num);
2210 }
2211 }
2212 }
2214 elements.ApplyElementMap(base.uid, SourceValueType.Chara, race.elementMap, base.DefaultLV, remove, applyFeat: true);
2215 }
void RefreshBodyParts()
Definition: CharaBody.cs:287
void RemoveBodyPart(int ele)
Definition: CharaBody.cs:316
int ParseBodySlot(string s)
Definition: Chara.cs:2130

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

Referenced by ChangeRace(), and OnCreate().

◆ CalcBurden()

void Chara.CalcBurden ( )
inline

Definition at line 1783 of file Chara.cs.

1784 {
1785 int num = base.ChildrenWeight * 100 / Mathf.Max(1, WeightLimit);
1786 if (num < 0)
1787 {
1788 num = 1000;
1789 }
1791 {
1792 num = 0;
1793 }
1794 burden.Set(num);
1795 SetDirtySpeed();
1796 }
override int WeightLimit
Definition: Chara.cs:708
bool ignoreWeight
Definition: CoreDebug.cs:187
static CoreDebug debug
Definition: EClass.cs:48
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 5941 of file Chara.cs.

5942 {
5943 if (!(e is Spell))
5944 {
5945 return 100;
5946 }
5947 if (!IsPC)
5948 {
5949 int num2 = 95;
5950 if (host != null)
5951 {
5952 if (host.ride == this)
5953 {
5954 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.EvalueRiding()));
5955 }
5956 if (host.parasite == this)
5957 {
5958 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.Evalue(227)));
5959 }
5960 }
5961 return num2;
5962 }
5963 int num3 = Evalue(304);
5964 if (!IsPCFaction)
5965 {
5966 num3 = Mathf.Max(num3, base.LV + 5);
5967 }
5968 int num4 = 0;
5969 int num5 = 0;
5970 bool num6 = GetArmorSkill() == 122;
5971 AttackStyle attackStyle = body.GetAttackStyle();
5972 if (num6)
5973 {
5974 num4 = 20 - Evalue(122) / 5;
5975 num5 += 10 - Evalue(1654) * 4;
5976 }
5977 else
5978 {
5979 num4 = 10 - Evalue(120) / 5;
5980 }
5981 if (num4 < 5)
5982 {
5983 num4 = 5;
5984 }
5985 if (ride != null)
5986 {
5987 num4 += 5;
5988 }
5989 if (parasite != null)
5990 {
5991 num4 += 10;
5992 }
5993 if (attackStyle == AttackStyle.TwoWield)
5994 {
5995 num4 += 5;
5996 }
5997 if (attackStyle == AttackStyle.Shield)
5998 {
5999 num4 += 10;
6000 num5 += 20 - Evalue(1654) * 8;
6001 }
6002 if (isConfused)
6003 {
6004 num4 += 10000;
6005 }
6006 if (HasCondition<ConDim>())
6007 {
6008 num4 += ((Evalue(1654) >= 3) ? 1500 : 2500);
6009 }
6010 if (num > 1)
6011 {
6012 num4 += 5 * num;
6013 }
6014 if (num5 < 0)
6015 {
6016 num5 = 0;
6017 }
6018 return Mathf.Clamp(100 + e.Value - 10 - e.source.LV * e.source.cost[0] * num4 / Mathf.Max(10 + num3 * 10, 1), 0, 100 - num5);
6019 }
AttackStyle
Definition: AttackStyle.cs:2
AttackStyle GetAttackStyle()
Definition: CharaBody.cs:433
override int GetArmorSkill()
Definition: Chara.cs:7570
int EvalueRiding()
Definition: Chara.cs:5932
SourceElement.Row source
Definition: ELEMENT.cs:273
Definition: SPELL.cs:529

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

1964 {
1965 int num = base.END;
1966 int num2 = 0;
1967 foreach (Element value in elements.dict.Values)
1968 {
1969 if (value.source.category == "skill")
1970 {
1971 num = ((!IsPC) ? (num + Mathf.Max(value.ValueWithoutLink, 0)) : (num + Mathf.Max(value.vBase, 0)));
1972 }
1973 }
1974 num2 = EClass.curve(num, 30, 10, 60);
1975 if (num2 < 10)
1976 {
1977 num2 = 10;
1978 }
1979 _maxStamina = num2 + 15;
1980 }
int _maxStamina
Definition: Chara.cs:363
static int curve(int a, int start, int step, int rate=75)
Definition: EClass.cs:68
int ValueWithoutLink
Definition: ELEMENT.cs:294
int vBase
Definition: ELEMENT.cs:252

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

6204 {
6205 foreach (Chara chara in EClass._map.charas)
6206 {
6207 if (!chara.IsPCFaction && chara.OriginalHostility == OriginalHostility && (fanatic || Dist(chara) <= 6) && (EClass.rnd(3) != 0 || fanatic))
6208 {
6209 chara.GoHostile(tg);
6210 }
6211 }
6212 }
Hostility OriginalHostility
Definition: Chara.cs:469
void GoHostile(Card _tg)
Definition: Chara.cs:6097
List< Chara > charas
Definition: Map.cs:81

References EClass._map, Map.charas, GoHostile(), IsPCFaction, OriginalHostility, and EClass.rnd().

Referenced by DoHostileAction().

◆ CanAcceptGift()

bool Chara.CanAcceptGift ( Chara  c,
Card  t 
)
inline

Definition at line 7909 of file Chara.cs.

7910 {
7911 if (things.IsFull())
7912 {
7913 return false;
7914 }
7915 if (t.c_isImportant)
7916 {
7917 return false;
7918 }
7919 if (t.id == "1084")
7920 {
7921 return true;
7922 }
7923 if (t.trait is TraitBookSecret)
7924 {
7925 return true;
7926 }
7927 if (t.trait.CanOnlyCarry || !t.trait.CanBeDestroyed || t.trait.CanExtendBuild || t.rarity == Rarity.Artifact || t.IsContainer)
7928 {
7929 return false;
7930 }
7931 return true;
7932 }
Rarity
Definition: Rarity.cs:2
string id
Definition: Card.cs:33
Rarity rarity
Definition: Card.cs:300
bool c_isImportant
Definition: Card.cs:998
ThingContainer things
Definition: Card.cs:36
bool IsContainer
Definition: Card.cs:2051
bool IsFull(int y=0)
virtual bool CanExtendBuild
Definition: Trait.cs:168
virtual bool CanBeDestroyed
Definition: Trait.cs:294
virtual bool CanOnlyCarry
Definition: Trait.cs:292

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

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

◆ CanAcceptItem()

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

Definition at line 7888 of file Chara.cs.

7889 {
7891 {
7892 return true;
7893 }
7894 if (!IsValidGiftWeight(t, num))
7895 {
7896 return false;
7897 }
7898 if (t.c_isImportant)
7899 {
7900 return false;
7901 }
7902 if ((t.category.IsChildOf("furniture") || t.category.IsChildOf("junk")) && !HasElement(1411))
7903 {
7904 return false;
7905 }
7906 return true;
7907 }
SourceCategory.Row category
Definition: Card.cs:2011
bool IsValidGiftWeight(Card t, int num=-1)
Definition: Chara.cs:7878

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

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

◆ CanAutoPick()

bool Chara.CanAutoPick ( Card  c)
inline

Definition at line 4161 of file Chara.cs.

4162 {
4163 return true;
4164 }

◆ CanBeTempAlly()

bool Chara.CanBeTempAlly ( Chara  c)
inline

Definition at line 2273 of file Chara.cs.

2274 {
2275 if (IsPCFaction || IsGlobal || IsMinion || IsMultisize || EClass._zone.CountMinions(c) > c.MaxSummon || base.rarity >= Rarity.Legendary)
2276 {
2277 return false;
2278 }
2279 if (HasElement(1222))
2280 {
2281 return false;
2282 }
2283 return true;
2284 }
override bool IsMinion
Definition: Chara.cs:625
int MaxSummon
Definition: Chara.cs:712
override bool IsMultisize
Definition: Chara.cs:704
int CountMinions(Chara c)
Definition: Zone.cs:3581

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

Referenced by GoalCombat.Run().

◆ CanDestroyPath()

bool Chara.CanDestroyPath ( )
inline

Definition at line 2357 of file Chara.cs.

2358 {
2359 if (!IsMultisize)
2360 {
2361 if (base.rarity >= Rarity.Superior && !base.IsPCFactionOrMinion && ai is GoalCombat && !EClass._zone.IsPCFaction)
2362 {
2363 return !(EClass._zone is Zone_Town);
2364 }
2365 return false;
2366 }
2367 return true;
2368 }

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

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

◆ CanEat()

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

Definition at line 7331 of file Chara.cs.

7332 {
7333 if (t.IsDecayed && !HasElement(480))
7334 {
7335 return false;
7336 }
7337 if (shouldEat && (!(t.trait is TraitFoodPrepared) || t.c_isImportant))
7338 {
7339 return false;
7340 }
7341 if (!t.IsNegativeGift && !t.HasTag(CTAG.ignoreUse) && !t.isEquipped)
7342 {
7343 return t.trait.CanEat(this);
7344 }
7345 return false;
7346 }
CTAG
Definition: CTAG.cs:2
bool IsNegativeGift
Definition: Card.cs:2358
bool IsDecayed
Definition: Card.cs:2249
bool HasTag(CTAG tag)
Definition: Card.cs:2557
bool isEquipped
Definition: Thing.cs:17
virtual bool CanEat(Chara c)
Definition: Trait.cs:973

References Card.c_isImportant, Trait.CanEat(), 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 7469 of file Chara.cs.

7470 {
7471 return !body.IsTooHeavyToEquip(t);
7472 }
bool IsTooHeavyToEquip(Thing thing)
Definition: CharaBody.cs:156

References CharaBody.IsTooHeavyToEquip().

Referenced by GoalAutoCombat.TryUseRanged().

◆ CanInsult()

bool Chara.CanInsult ( )
inline

Definition at line 7809 of file Chara.cs.

7810 {
7811 foreach (ActList.Item item in ability.list.items)
7812 {
7813 if (item.act.id == 6630)
7814 {
7815 return true;
7816 }
7817 }
7818 return false;
7819 }
List< Item > items
Definition: ActList.cs:14
ActList list
Definition: CharaAbility.cs:12
CharaAbility ability
Definition: Chara.cs:422

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

◆ CanInteractTo() [1/2]

bool Chara.CanInteractTo ( Card  c)
inline

Definition at line 2464 of file Chara.cs.

2465 {
2466 return CanInteractTo(c.pos);
2467 }
bool CanInteractTo(Card c)
Definition: Chara.cs:2464

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

2470 {
2471 if (!p.IsValid)
2472 {
2473 return false;
2474 }
2475 if (EClass._map.cells[p.x, p.z].blocked)
2476 {
2477 return true;
2478 }
2479 if (!IsMultisize)
2480 {
2481 int num = ((p.z >= pos.z) ? ((p.x > pos.x) ? 1 : ((p.z > pos.z) ? 2 : 3)) : 0);
2482 if (EClass._map.cells[pos.x, pos.z].weights[num] == 0)
2483 {
2484 return false;
2485 }
2486 if (p.x != pos.x && p.z != pos.z)
2487 {
2488 Cell[,] cells = EClass._map.cells;
2489 int x = p.x;
2490 int z = pos.z;
2491 int num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2492 if (cells[pos.x, pos.z].weights[num2] == 0)
2493 {
2494 return false;
2495 }
2496 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2497 if (cells[p.x, p.z].weights[num2] == 0)
2498 {
2499 return false;
2500 }
2501 x = pos.x;
2502 z = p.z;
2503 num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2504 if (cells[pos.x, pos.z].weights[num2] == 0)
2505 {
2506 return false;
2507 }
2508 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2509 if (cells[p.x, p.z].weights[num2] == 0)
2510 {
2511 return false;
2512 }
2513 }
2514 }
2515 return true;
2516 }
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 4156 of file Chara.cs.

4157 {
4158 return true;
4159 }

◆ CanMoveTo()

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

Definition at line 2370 of file Chara.cs.

2371 {
2372 if (!p.IsValid)
2373 {
2374 return false;
2375 }
2376 int num = ((p.z >= pos.z) ? ((p.x > pos.x) ? 1 : ((p.z > pos.z) ? 2 : 3)) : 0);
2377 if (allowDestroyPath && CanDestroyPath())
2378 {
2379 if (!p.IsInBounds)
2380 {
2381 return false;
2382 }
2383 }
2384 else
2385 {
2386 if (EClass._map.cells[p.x, p.z].blocked || EClass._map.cells[pos.x, pos.z].weights[num] == 0)
2387 {
2388 return false;
2389 }
2390 if (p.x != pos.x && p.z != pos.z)
2391 {
2392 Cell[,] cells = EClass._map.cells;
2393 int x = p.x;
2394 int z = pos.z;
2395 int num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2396 if (cells[pos.x, pos.z].weights[num2] == 0)
2397 {
2398 return false;
2399 }
2400 if (cells[x, z].blocked)
2401 {
2402 return false;
2403 }
2404 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2405 if (cells[p.x, p.z].weights[num2] == 0)
2406 {
2407 return false;
2408 }
2409 x = pos.x;
2410 z = p.z;
2411 num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2412 if (cells[pos.x, pos.z].weights[num2] == 0)
2413 {
2414 return false;
2415 }
2416 if (cells[x, z].blocked)
2417 {
2418 return false;
2419 }
2420 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2421 if (cells[p.x, p.z].weights[num2] == 0)
2422 {
2423 return false;
2424 }
2425 }
2426 }
2427 if (IsPC)
2428 {
2429 if (IsEnemyOnPath(p))
2430 {
2431 return false;
2432 }
2433 }
2434 else if (p.HasChara && !IsMultisize && !CanReplace(p.FirstChara))
2435 {
2436 return false;
2437 }
2438 return true;
2439 }
bool IsEnemyOnPath(Point p, bool cancelAI=true)
Definition: Chara.cs:2441
Chara FirstChara
Definition: Point.cs:276
bool IsInBounds
Definition: Point.cs:104

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

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

◆ CanPick()

bool Chara.CanPick ( Card  c)
inline

Definition at line 4166 of file Chara.cs.

4167 {
4168 if (c.isDestroyed)
4169 {
4170 return false;
4171 }
4172 Card rootCard = c.GetRootCard();
4173 if (rootCard.isDestroyed || (rootCard.ExistsOnMap && rootCard.pos.Distance(pos) > 1))
4174 {
4175 return false;
4176 }
4177 if (rootCard != this && things.IsFull(c.Thing))
4178 {
4179 return false;
4180 }
4181 return true;
4182 }
bool isDestroyed
Definition: Card.cs:73
bool ExistsOnMap
Definition: Card.cs:2047
virtual Thing Thing
Definition: Card.cs:2020
Card GetRootCard()
Definition: Card.cs:3324

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

3230 {
3232 {
3233 return false;
3234 }
3235 if (IsPC)
3236 {
3237 return true;
3238 }
3239 if (c.IsPC || c.pos.Equals(EClass.pc.pos) || c.host != null)
3240 {
3241 return false;
3242 }
3243 if (!IsHostile(c))
3244 {
3245 if (c.c_uidMaster != 0 || c.isSummon || base.IsPowerful || IsEscorted())
3246 {
3247 return true;
3248 }
3249 if (DestDist < c.DestDist)
3250 {
3251 return true;
3252 }
3253 if (IsPCParty && !c.IsPCParty)
3254 {
3255 return true;
3256 }
3257 if (IsPCFaction && !c.IsPCParty)
3258 {
3259 return true;
3260 }
3261 }
3262 return false;
3263 }
bool IsPCFactionOrMinion
Definition: Card.cs:2234
bool isSummon
Definition: Card.cs:696
int c_uidMaster
Definition: Card.cs:1423
bool noMove
Definition: Card.cs:756
new TraitChara trait
Definition: Chara.cs:501
override bool IsPCParty
Definition: Chara.cs:613
int DestDist
Definition: Chara.cs:984
bool IsHostile()
Definition: Chara.cs:6298
bool IsEscorted()
Definition: Chara.cs:2341
bool Equals(int _x, int _z)
Definition: Point.cs:944
virtual bool CanBePushed
Definition: TraitChara.cs:113

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

Referenced by _Move(), and CanMoveTo().

◆ CanRevive()

bool Chara.CanRevive ( )
inline

Definition at line 4955 of file Chara.cs.

4956 {
4957 return EClass.world.date.IsExpired(base.c_dateDeathLock);
4958 }
bool IsExpired(int time)
Definition: Date.cs:332

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

1201 {
1202 if (c == this)
1203 {
1204 return true;
1205 }
1206 if (!c.pos.IsValid)
1207 {
1208 return false;
1209 }
1210 if (c.isChara)
1211 {
1213 {
1214 return true;
1215 }
1216 if (c.isHidden && c != this && !canSeeInvisible)
1217 {
1218 return false;
1219 }
1220 }
1221 if (IsPC)
1222 {
1223 if (fov != null)
1224 {
1225 return fov.lastPoints.ContainsKey(c.pos.index);
1226 }
1227 return false;
1228 }
1229 return true;
1230 }
virtual Chara Chara
Definition: Card.cs:2032
Fov fov
Definition: Card.cs:55
virtual bool isChara
Definition: Card.cs:2045
bool isHidden
Definition: Card.cs:516
bool canSeeInvisible
Definition: Chara.cs:138
bool visibleWithTelepathy
Definition: Chara.cs:150
bool hasTelepathy
Definition: Chara.cs:140
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(), 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 1241 of file Chara.cs.

1242 {
1243 if (dist == -1)
1244 {
1245 dist = pos.Distance(p);
1246 }
1247 if (dist > GetSightRadius())
1248 {
1249 return false;
1250 }
1251 if (IsPC)
1252 {
1253 if (fov != null)
1254 {
1255 return fov.lastPoints.ContainsKey(p.index);
1256 }
1257 return false;
1258 }
1259 return Los.IsVisible(pos, p);
1260 }
int GetSightRadius()
Definition: Card.cs:6184
Definition: Los.cs:5
static bool IsVisible(Point p1, Point p2, Action< Point, bool > _onVisit=null)
Definition: Los.cs:167

References Point.Distance(), Card.fov, Card.GetSightRadius(), Point.index, IsPC, Los.IsVisible(), Fov.lastPoints, and Card.pos.

◆ CanSeeSimple()

bool Chara.CanSeeSimple ( Point  p)
inline

Definition at line 1183 of file Chara.cs.

1184 {
1185 if (!p.IsValid || p.IsHidden)
1186 {
1187 return false;
1188 }
1189 if (IsPC)
1190 {
1191 if (fov != null)
1192 {
1193 return fov.lastPoints.ContainsKey(p.index);
1194 }
1195 return false;
1196 }
1197 return true;
1198 }
bool IsHidden
Definition: Point.cs:335

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

1282 {
1283 if (EClass._zone.events.GetEvent<ZoneEventQuest>() != null)
1284 {
1285 return false;
1286 }
1287 if (!EClass.debug.godMode && sleepiness.GetPhase() == 0)
1288 {
1289 return stamina.GetPhase() <= 1;
1290 }
1291 return true;
1292 }
Stats sleepiness
Definition: Chara.cs:1138
Stats stamina
Definition: Chara.cs:1128
bool godMode
Definition: CoreDebug.cs:173
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 2118 of file Chara.cs.

2119 {
2120 ApplyJob(remove: true);
2121 base.c_idJob = idNew;
2122 _job = null;
2123 ApplyJob();
2124 if (IsPCC)
2125 {
2126 PCC.Get(pccData).Build();
2127 }
2128 }
void ApplyJob(bool remove=false)
Definition: Chara.cs:2109
SourceJob.Row _job
Definition: Chara.cs:160

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

6792 {
6793 memberType = type;
6794 }
FactionMemberType memberType
Definition: Chara.cs:46

◆ ChangeRace()

void Chara.ChangeRace ( string  idNew)
inline

Definition at line 2217 of file Chara.cs.

2218 {
2219 ApplyRace(remove: true);
2220 base.c_idRace = idNew;
2221 _race = null;
2222 ApplyRace();
2223 ChangeMaterial(race.material);
2224 }
@ ChangeMaterial
void ApplyRace(bool remove=false)
Definition: Chara.cs:2195
SourceRace.Row _race
Definition: Chara.cs:158

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

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

1389 {
1390 if (r != base.rarity)
1391 {
1392 base.rarity = r;
1393 if (renderer != null && renderer.isSynced)
1394 {
1396 }
1397 base.hp = MaxHP;
1398 }
1399 }
void RefreshExtra()

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

Referenced by ZonePreEnterBout.Execute().

◆ ChooseNewGoal()

void Chara.ChooseNewGoal ( )
inline

Definition at line 8398 of file Chara.cs.

8399 {
8400 if (IsPC && EClass.AdvMode)
8401 {
8402 SetNoGoal();
8403 return;
8404 }
8405 if (IsPCParty || base.noMove)
8406 {
8407 SetAI(new GoalIdle());
8408 return;
8409 }
8410 if ((IsHomeMember() && IsInHomeZone()) || IsGuest())
8411 {
8412 Goal goalFromTimeTable = GetGoalFromTimeTable(EClass.world.date.hour);
8413 if (goalFromTimeTable != null)
8414 {
8415 SetAI(goalFromTimeTable);
8416 if (goalFromTimeTable is GoalWork)
8417 {
8418 goalFromTimeTable.Tick();
8419 }
8420 return;
8421 }
8422 }
8423 if (goalList.index == -2)
8424 {
8426 }
8427 SetAI(goalList.Next());
8428 }
Status Tick()
Definition: AIAct.cs:352
Goal GetGoalFromTimeTable(int hour)
Definition: Chara.cs:8430
GoalListType goalListType
Definition: Chara.cs:277
AIAct SetNoGoal()
Definition: Chara.cs:8522
bool IsHomeMember()
Definition: Chara.cs:6356
bool IsGuest()
Definition: Chara.cs:6381
GoalList goalList
Definition: Chara.cs:198
bool IsInHomeZone()
Definition: Chara.cs:6361
int hour
Definition: Date.cs:74
static bool AdvMode
Definition: EClass.cs:10
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 7059 of file Chara.cs.

7060 {
7061 if (map == null)
7062 {
7063 map = EClass._map;
7064 }
7065 foreach (Card item in map.props.installed.all)
7066 {
7067 if (item.trait is TraitBed traitBed && traitBed.IsHolder(this))
7068 {
7069 traitBed.RemoveHolder(this);
7070 }
7071 }
7072 }
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 8220 of file Chara.cs.

8221 {
8222 int num = 0;
8223 for (int num2 = things.Count - 1; num2 >= 0; num2--)
8224 {
8225 Thing thing = things[num2];
8226 if (ShouldThrowAway(thing, type))
8227 {
8228 num += thing.GetPrice(CurrencyType.Money, sell: true, PriceType.Default, this) * thing.Num;
8229 thing.Destroy();
8230 }
8231 }
8232 if (num > 0)
8233 {
8234 ModCurrency(num);
8235 if (type == ClearInventoryType.SellAtTown)
8236 {
8237 Msg.Say("party_sell", this, num.ToString() ?? "");
8238 PlaySound("pay");
8239 }
8240 }
8241 }
ClearInventoryType
CurrencyType
Definition: CurrencyType.cs:2
PriceType
Definition: PriceType.cs:2
virtual int GetPrice(CurrencyType currency=CurrencyType.Money, bool sell=false, PriceType priceType=PriceType.Default, Chara c=null)
Definition: Card.cs:7038
void Destroy()
Definition: Card.cs:4931
int Num
Definition: Card.cs:156
bool ShouldThrowAway(Thing t, ClearInventoryType type)
Definition: Chara.cs:8149

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

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

◆ ClearTempElements()

void Chara.ClearTempElements ( )
inline

Definition at line 9947 of file Chara.cs.

9948 {
9949 if (tempElements != null)
9950 {
9952 tempElements = null;
9953 }
9954 }
ElementContainer tempElements
Definition: Chara.cs:36
void SetParent(Card c)

References ElementContainer.SetParent().

◆ CountNumEaten()

int Chara.CountNumEaten ( Thing  food)
inline

Definition at line 9753 of file Chara.cs.

9754 {
9755 if (_historyFood == null)
9756 {
9757 return -1;
9758 }
9759 int num = 0;
9760 foreach (List<string> item in _historyFood)
9761 {
9762 foreach (string item2 in item)
9763 {
9764 if (item2 == food.id)
9765 {
9766 num++;
9767 }
9768 }
9769 }
9770 return num;
9771 }

References food, and item.

Referenced by FoodEffect.Proc().

◆ CreateReplacement()

Chara Chara.CreateReplacement ( )
inline

Definition at line 7712 of file Chara.cs.

7713 {
7714 Chara chara = CharaGen.Create(id);
7715 chara.c_originalHostility = base.c_originalHostility;
7716 if (chara.c_originalHostility != 0)
7717 {
7718 chara.hostility = chara.c_originalHostility;
7719 }
7720 if (orgPos != null)
7721 {
7722 chara.orgPos = orgPos.Copy();
7723 }
7724 chara.pos = pos.Copy();
7725 chara.isImported = true;
7726 chara.c_editorTags = base.c_editorTags;
7727 chara.c_editorTraitVal = base.c_editorTraitVal;
7728 chara.c_idTrait = base.c_idTrait;
7729 chara.homeZone = homeZone;
7730 return chara;
7731 }
Hostility c_originalHostility
Definition: Card.cs:950
static Chara Create(string id, int lv=-1)
Definition: CharaGen.cs:17
Zone homeZone
Definition: Chara.cs:265
Point Copy()
Definition: Point.cs:479

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

6034 {
6035 Talk("goodBoy");
6036 Say(headpat ? "headpat" : "cuddle", this, c);
6037 c.ShowEmo(Emo.love);
6038 if (EClass.rnd(IsPC ? 100 : 5000) == 0)
6039 {
6040 c.MakeEgg();
6041 }
6042 if (headpat && this != c)
6043 {
6044 if (c.interest > 0)
6045 {
6046 c.ModAffinity(EClass.pc, 1 + EClass.rnd(3));
6047 c.interest -= 20 + EClass.rnd(10);
6048 }
6050 {
6051 foreach (Chara member in party.members)
6052 {
6053 if (!member.IsPC && CanSeeLos(member))
6054 {
6055 member.AddCondition<ConEuphoric>(100 + Evalue(6904) * 5);
6056 }
6057 }
6058 }
6059 }
6060 if (c.Evalue(1221) > 0)
6061 {
6062 int ele = ((c.MainElement == Element.Void) ? 924 : c.MainElement.id);
6063 if (c.id == "hedgehog_ether")
6064 {
6065 ele = 922;
6066 }
6067 Say("reflect_thorne", c, this);
6068 DamageHP(10, ele, Power, AttackSource.Condition);
6069 }
6070 }
Emo
Definition: Emo.cs:2
virtual int Power
Definition: Card.cs:2257
void ShowEmo(Emo _emo=Emo.none, float duration=0f, bool skipSame=true)
Definition: Card.cs:5907
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
Definition: Card.cs:5562
Element MainElement
Definition: Chara.cs:715
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Definition: Chara.cs:7640
int interest
Definition: Chara.cs:315
Religion faith
Definition: Chara.cs:437
static Element Void
Definition: ELEMENT.cs:238
ReligionManager religions
Definition: Game.cs:158
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(), AI_Idle.Run(), and AI_Mofu.Run().

◆ Cure()

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

Definition at line 9133 of file Chara.cs.

9134 {
9135 bool flag = state == BlessedState.Blessed;
9136 switch (type)
9137 {
9138 case CureType.Heal:
9139 case CureType.Prayer:
9140 CureCondition<ConFear>();
9141 CureCondition<ConBlind>(2 * p / 100 + 5);
9142 CureCondition<ConPoison>(5 * p / 100 + 5);
9143 CureCondition<ConConfuse>(10 * p / 100 + 10);
9144 CureCondition<ConDim>(p / 100 + 5);
9145 CureCondition<ConBleed>(2 * p / 100 + 10);
9146 if (flag)
9147 {
9148 SAN.Mod(-15);
9149 }
9150 break;
9151 case CureType.CureBody:
9152 CureCondition<ConBlind>(5 * p / 100 + 15);
9153 CureCondition<ConPoison>(10 * p / 100 + 15);
9154 CureCondition<ConBleed>(5 * p / 100 + 20);
9155 CureTempElements(p, body: true, mind: false);
9156 break;
9157 case CureType.CureMind:
9158 CureCondition<ConFear>();
9159 CureCondition<ConDim>(3 * p / 100 + 10);
9160 CureTempElements(p, body: false, mind: true);
9161 break;
9162 case CureType.Sleep:
9163 {
9164 for (int num2 = conditions.Count - 1; num2 >= 0; num2--)
9165 {
9166 Condition condition2 = conditions[num2];
9167 if (!(condition2 is ConSleep) && !(condition2 is ConFaint))
9168 {
9169 if (condition2.isPerfume)
9170 {
9171 condition2.Mod(-1, force: true);
9172 }
9173 else if (condition2.Type == ConditionType.Bad || condition2.Type == ConditionType.Debuff)
9174 {
9175 condition2.Kill();
9176 }
9177 }
9178 }
9179 CureCondition<ConWait>();
9180 CureCondition<ConDisease>((EClass.rnd(20) + 10) * p / 100);
9181 bool flag3 = HasCondition<ConAnorexia>();
9182 base.c_vomit -= (flag3 ? 3 : 2) * p / 100;
9183 if (base.c_vomit < 0)
9184 {
9185 base.c_vomit = 0;
9186 if (flag3)
9187 {
9188 RemoveCondition<ConAnorexia>();
9189 }
9190 }
9191 break;
9192 }
9193 case CureType.HealComplete:
9194 case CureType.Death:
9195 case CureType.Jure:
9196 case CureType.Boss:
9197 {
9198 bool flag2 = type == CureType.Death;
9199 CureTempElements(p * 100, body: true, mind: true);
9200 for (int num = conditions.Count - 1; num >= 0; num--)
9201 {
9202 Condition condition = conditions[num];
9203 if (condition is ConAnorexia && !flag2)
9204 {
9205 continue;
9206 }
9207 switch (condition.Type)
9208 {
9209 case ConditionType.Bad:
9210 case ConditionType.Debuff:
9211 case ConditionType.Disease:
9212 condition.Kill();
9213 continue;
9214 case ConditionType.Stance:
9215 if (flag2)
9216 {
9217 condition.Kill();
9218 continue;
9219 }
9220 break;
9221 }
9222 if (flag2 && condition.isPerfume)
9223 {
9224 condition.Kill();
9225 }
9226 }
9227 CureCondition<ConWait>();
9228 CureCondition<ConSleep>();
9229 if (flag2 || type == CureType.Boss)
9230 {
9231 SAN.Mod(-20);
9232 RemoveCondition<ConBrightnessOfLife>();
9233 }
9234 if (type == CureType.Jure)
9235 {
9236 SAN.Mod(-999);
9237 if (HasElement(1206))
9238 {
9239 SetFeat(1206, 0, msg: true);
9240 }
9241 }
9242 break;
9243 }
9244 }
9245 }
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:9917
Stats SAN
Definition: Chara.cs:1140
void Kill(bool silent=false)
Definition: Condition.cs:91
virtual void Mod(int a)
Definition: Stats.cs:135

References BaseCondition.isPerfume, Condition.Kill(), Stats.Mod(), BaseCondition.Mod(), EClass.rnd(), and BaseStats.Type.

Referenced by CureHost(), HealAll(), StatsMana.Mod(), ActPray.Pray(), and Zone.Simulate().

◆ CureCondition< T >()

void Chara.CureCondition< T > ( int  v = 99999)
inline
Type Constraints
T :Condition 

Definition at line 9083 of file Chara.cs.

9083 : Condition
9084 {
9085 T condition = GetCondition<T>();
9086 if (condition != null)
9087 {
9088 condition.value -= v;
9089 if (condition.value <= 0)
9090 {
9091 condition.Kill();
9092 }
9093 }
9094 }
T GetCondition< T >()
Definition: Chara.cs:9096

◆ CureHost()

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

Definition at line 9120 of file Chara.cs.

9121 {
9122 if (parasite != null)
9123 {
9124 parasite.Cure(type, p, state);
9125 }
9126 if (ride != null)
9127 {
9128 ride.Cure(type, p, state);
9129 }
9130 Cure(type, p, state);
9131 }
void Cure(CureType type, int p=100, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:9133

References Cure().

Referenced by FactionBranch.DailyOutcome().

◆ CureTempElements()

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

Definition at line 9917 of file Chara.cs.

9918 {
9919 if (tempElements != null)
9920 {
9921 if (body)
9922 {
9924 }
9925 if (mind)
9926 {
9928 }
9929 }
9930 void Cure(int[] eles)
9931 {
9932 foreach (int ele in eles)
9933 {
9934 if (tempElements == null)
9935 {
9936 break;
9937 }
9938 Element element = tempElements.GetElement(ele);
9939 if (element != null && element.vBase < 0)
9940 {
9941 ModTempElement(ele, Mathf.Clamp(p / 20 + EClass.rnd(p / 20), 1, -element.vBase));
9942 }
9943 }
9944 }
9945 }
void ModTempElement(int ele, int a, bool naturalDecay=false, bool onlyRenew=false)
Definition: Chara.cs:9825
Element GetElement(string alias)
static int[] List_Body
Definition: ELEMENT.cs:244
static int[] List_Mind
Definition: ELEMENT.cs:246

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

9884 {
9885 ModTempElement(ele, onlyRenew ? (-p / 20) : (-(p / 100 + EClass.rnd(p / 100 + 1) + 1)), naturalDecay: false, onlyRenew);
9886 }

References EClass.rnd().

◆ DamageTempElements()

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

Definition at line 9871 of file Chara.cs.

9872 {
9873 if (body)
9874 {
9875 DamageTempElement(Element.List_Body.RandomItem(), p, onlyRenew);
9876 }
9877 if (mind)
9878 {
9879 DamageTempElement(Element.List_Mind.RandomItem(), p, onlyRenew);
9880 }
9881 }
void DamageTempElement(int ele, int p, bool onlyRenew=false)
Definition: Chara.cs:9883

References Element.List_Body, and Element.List_Mind.

◆ DestroyPath()

void Chara.DestroyPath ( Point  pos)
inline

Definition at line 3118 of file Chara.cs.

3119 {
3120 bool broke = false;
3121 pos.ForeachMultiSize(base.W, base.H, delegate(Point _p, bool main)
3122 {
3123 if (_p.IsValid)
3124 {
3125 if (_p.HasBlock)
3126 {
3127 EClass._map.MineBlock(_p, recoverBlock: false, this);
3128 if (_p.HasObj)
3129 {
3130 EClass._map.MineObj(_p, null, this);
3131 }
3132 broke = true;
3133 }
3134 if (_p.HasObj && _p.IsBlocked)
3135 {
3136 EClass._map.MineObj(_p, null, this);
3137 broke = true;
3138 }
3139 _p.Things.ForeachReverse(delegate(Thing t)
3140 {
3141 if (t.IsInstalled && (t.trait.IsBlockPath || t.trait.IsDoor))
3142 {
3143 if (t.isNPCProperty && t.trait.CanBeDestroyed)
3144 {
3145 t.Destroy();
3146 }
3147 else if (!t.IsUnique && !t.trait.CanBeDestroyed)
3148 {
3149 t.SetPlaceState(PlaceState.roaming);
3150 }
3151 }
3152 });
3153 }
3154 });
3155 if (broke)
3156 {
3157 Msg.Say("stomp");
3158 Shaker.ShakeCam("stomp");
3159 }
3160 }
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
bool IsUnique
Definition: Card.cs:2053
void ForeachMultiSize(int w, int h, Action< Point, bool > action)
Definition: Point.cs:1369
bool IsBlocked
Definition: Point.cs:351
Definition: Shaker.cs:5
static void ShakeCam(string id="default", float magnitude=1f)
Definition: Shaker.cs:25
virtual bool IsBlockPath
Definition: Trait.cs:53
virtual bool IsDoor
Definition: Trait.cs:57

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

5133 {
5134 combatCount = 0;
5135 if (isDead || host != null)
5136 {
5137 return;
5138 }
5139 bool isInActiveZone = IsInActiveZone;
5140 if (isInActiveZone)
5141 {
5142 if (IsPC)
5143 {
5145 }
5146 if (base.isSummon)
5147 {
5148 if (id == "tsunami")
5149 {
5150 pos.PlaySound("water");
5151 }
5152 else
5153 {
5154 Say("summon_vanish", this);
5155 pos.PlayEffect("vanish");
5156 pos.PlaySound("vanish");
5157 }
5158 Destroy();
5159 return;
5160 }
5161 if (attackSource == AttackSource.DeathSentense)
5162 {
5163 if (trait is TraitLittleOne)
5164 {
5165 MakeEgg();
5166 if (IsPCFaction)
5167 {
5169 }
5170 }
5171 PlayEffect("revive");
5172 PlaySound("chime_angel");
5173 }
5174 else
5175 {
5176 Effect.Get("blood").Play((parent is Chara) ? (parent as Chara).pos : pos).SetParticleColor(EClass.Colors.matColors[base.material.alias].main)
5177 .Emit(50);
5178 AddBlood(AI_Slaughter.slaughtering ? 12 : (2 + EClass.rnd(2)));
5179 PlaySound(base.material.GetSoundDead(source));
5180 }
5183 ClearFOV();
5184 }
5185 string text = "";
5186 "dead_in".langGame(EClass._zone.Name);
5187 string text2 = ((origin == null) ? "" : origin.GetName(NameStyle.Full));
5188 if (LangGame.Has("dead_" + attackSource))
5189 {
5190 text = "dead_" + attackSource;
5191 }
5192 else
5193 {
5194 if (e != Element.Void && e != null)
5195 {
5196 text = "dead_" + e.source.alias;
5197 }
5198 if (text == "" || !LangGame.Has(text))
5199 {
5200 text = "dead";
5201 }
5202 }
5203 if (IsPC)
5204 {
5205 EClass._zone.isDeathLocation = true;
5206 string s = ((origin == null) ? text : "dead_by");
5208 if (attackSource == AttackSource.Wrath)
5209 {
5211 }
5212 EClass.player.deathMsg = GameLang.Parse(s.langGame(), thirdPerson: true, EClass.pc.NameBraced, "dead_in".langGame(EClass._zone.Name), text2);
5214 if (EClass._zone.instance is ZoneInstanceRandomQuest zoneInstanceRandomQuest)
5215 {
5216 zoneInstanceRandomQuest.status = ZoneInstance.Status.Fail;
5217 }
5218 AI_PlayMusic.keepPlaying = false;
5219 }
5220 if (isInActiveZone)
5221 {
5222 if (attackSource == AttackSource.DeathSentense)
5223 {
5224 Msg.Say("goto_heaven", this);
5225 }
5226 else
5227 {
5228 if (originalTarget != null || origin == null || !origin.isSynced || (attackSource != AttackSource.Melee && attackSource != AttackSource.Range))
5229 {
5230 Msg.Say(text, this, "", text2);
5231 }
5232 string text3 = TalkTopic("dead");
5233 if (!text3.IsEmpty())
5234 {
5235 text3 = text3.StripBrackets();
5236 }
5237 bool flag = base.rarity >= Rarity.Legendary && !IsPCFaction;
5238 if (!IsPC && flag)
5239 {
5240 MakeGrave(text3);
5241 }
5242 Msg.SetColor();
5243 SpawnLoot(origin);
5244 }
5245 if (IsPC)
5246 {
5248 }
5249 }
5250 if (IsPCFaction)
5251 {
5252 if (homeBranch != null)
5253 {
5254 homeBranch.Log(text, this, "");
5255 }
5256 WidgetPopText.Say("popDead".lang(base.Name), FontColor.Bad);
5257 if (!IsPC)
5258 {
5259 if (EClass.player.stats.allyDeath == 0)
5260 {
5261 Tutorial.Reserve("death_pet");
5262 }
5264 }
5265 }
5266 if (id == "mandrake" || HasElement(488))
5267 {
5268 Say("a_scream", this);
5269 ActEffect.ProcAt(EffectId.Scream, base.LV * 3 + 200, BlessedState.Normal, this, this, pos, isNeg: true);
5270 }
5271 daysStarved = 0;
5272 isDead = true;
5274 enemy = null;
5275 _cooldowns = null;
5276 base.isSale = false;
5277 SetInt(70);
5278 EClass._map.props.sales.Remove(this);
5279 Cure(CureType.Death);
5280 SetAI(new NoGoal());
5282 if (isInActiveZone && EClass._zone.HasLaw && IsHuman && OriginalHostility >= Hostility.Neutral)
5283 {
5284 pos.TalkWitnesses(origin?.Chara, "witness", 3, WitnessType.crime, (Chara c) => !c.IsPCParty && !c.IsUnique);
5285 }
5286 if (IsPC)
5287 {
5288 EClass.player.returnInfo = null;
5289 EClass.player.uidLastTravelZone = 0;
5290 foreach (Chara chara2 in EClass._map.charas)
5291 {
5292 if (chara2.IsHostile())
5293 {
5294 chara2.hostility = chara2.OriginalHostility;
5295 }
5296 if (chara2.enemy == EClass.pc)
5297 {
5298 chara2.enemy = null;
5299 }
5300 }
5301 if (EClass.pc.things.Find("letter_will") != null && EClass.rnd(10) == 0)
5302 {
5303 EClass.player.preventDeathPenalty = true;
5304 }
5305 }
5306 else
5307 {
5308 bool flag2 = currentZone.IsActiveZone && IsLocalChara && !currentZone.IsPCFaction;
5309 if (currentZone is Zone_LittleGarden && id == "littleOne")
5310 {
5311 flag2 = false;
5312 }
5313 if (flag2)
5314 {
5315 EClass._map.deadCharas.Add(this);
5316 }
5317 currentZone.RemoveCard(this);
5318 }
5319 if ((origin != null && origin.IsPCParty) || IsPCFaction)
5320 {
5321 int a = -10;
5322 if (IsPCFaction && !IsPCParty && (origin == null || !origin.IsPCParty))
5323 {
5324 a = -5;
5325 }
5326 ModAffinity(EClass.pc, a, show: false);
5327 string text4 = id;
5328 if (!(text4 == "quru"))
5329 {
5330 if (text4 == "corgon")
5331 {
5332 EClass.game.cards.globalCharas.Find("quru")?.ModAffinity(EClass.pc, -20, show: false);
5333 }
5334 }
5335 else
5336 {
5337 EClass.game.cards.globalCharas.Find("corgon")?.ModAffinity(EClass.pc, -20, show: false);
5338 }
5339 }
5340 if (origin != null)
5341 {
5342 if (origin.IsPCParty || origin.IsPCPartyMinion)
5343 {
5344 int num = 0;
5345 if (OriginalHostility >= Hostility.Friend && IsHuman && !base.IsPCFactionOrMinion)
5346 {
5347 num = -5;
5348 }
5349 else if (race.id == "cat" && OriginalHostility >= Hostility.Neutral)
5350 {
5351 EClass.pc.Say("killcat");
5352 num = -1;
5353 }
5354 if (EClass.pc.party.HasElement(1563) && num < 0)
5355 {
5356 num = num * 30 / 100;
5357 }
5358 if (num != 0)
5359 {
5360 EClass.player.ModKarma(num);
5361 }
5362 }
5363 if (origin == EClass.pc)
5364 {
5365 EClass.pc.faith.Revelation("kill", 10);
5366 }
5367 else if (origin.IsPCFaction)
5368 {
5369 origin.Chara.ModAffinity(EClass.pc, 1, show: false);
5370 origin.Chara.ShowEmo(Emo.love);
5371 }
5372 }
5373 if (base.sourceBacker != null && origin != null && origin.IsPCParty)
5374 {
5375 EClass.player.doneBackers.Add(base.sourceBacker.id);
5376 }
5377 if (base.IsPCFactionOrMinion)
5378 {
5380 {
5381 Msg.Say("abort_allyDead");
5382 }
5383 }
5385 {
5386 Msg.Say("abort_enemyDead");
5387 }
5388 if (IsPCParty && !IsPC)
5389 {
5391 base.c_wasInPcParty = true;
5392 EClass.pc.Say("allyDead");
5393 }
5394 switch (id)
5395 {
5396 case "littleOne":
5397 if (attackSource != AttackSource.DeathSentense && !IsPCFaction)
5398 {
5399 EClass.player.flags.little_killed = true;
5401 }
5402 break;
5403 case "big_daddy":
5404 if (!IsPCFaction)
5405 {
5406 Chara t2 = CharaGen.Create("littleOne");
5407 EClass._zone.AddCard(t2, pos.Copy());
5408 Msg.Say("little_pop");
5409 }
5410 break;
5411 case "shark_sister":
5412 if (!IsPCFaction)
5413 {
5414 Chara t = CharaGen.Create("sister_shark");
5415 EClass._zone.AddCard(t, pos.Copy());
5416 Msg.Say("shark_pop");
5417 }
5418 break;
5419 }
5420 if (attackSource == AttackSource.Finish && origin != null && origin.Evalue(665) > 0)
5421 {
5422 Chara chara = CharaGen.CreateFromFilter("c_plant", base.LV);
5423 EClass._zone.AddCard(chara, pos.Copy());
5424 if (chara.LV < base.LV)
5425 {
5426 chara.SetLv(base.LV);
5427 }
5428 chara.MakeMinion((origin.IsPCParty || origin.IsPCPartyMinion) ? EClass.pc : origin.Chara, MinionType.Friend);
5429 Msg.Say("plant_pop", this, chara);
5430 }
5432 }
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:430
Chara Find(string id)
Definition: CardManager.cs:20
GlobalCharaList globalCharas
Definition: CardManager.cs:46
void RefreshSprite()
virtual void RefreshStateIcon()
virtual string GetName(NameStyle style, int num=-1)
Definition: Card.cs:2577
void AddBlood(int a=1, int id=-1)
Definition: Card.cs:5764
virtual bool IsPCParty
Definition: Card.cs:2111
Card SetLv(int a)
Definition: Card.cs:2858
ICardParent parent
Definition: Card.cs:53
virtual bool IsPCPartyMinion
Definition: Card.cs:2115
void ClearFOV()
Definition: Card.cs:6352
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:5973
virtual bool IsPCFaction
Definition: Card.cs:2231
void SpawnLoot(Card origin)
Definition: Card.cs:4971
int LV
Definition: Card.cs:372
virtual bool isSynced
Definition: Card.cs:2049
static Chara CreateFromFilter(string id, int lv=-1, int levelRange=-1)
Definition: CharaGen.cs:22
int combatCount
Definition: Chara.cs:114
bool IsHuman
Definition: Chara.cs:877
int daysStarved
Definition: Chara.cs:327
void MakeMinion(Chara _master, MinionType type=MinionType.Default)
Definition: Chara.cs:2286
string NameBraced
Definition: Chara.cs:512
void ClearTempElements()
Definition: Chara.cs:9947
string TalkTopic(string topic="calm")
Definition: Chara.cs:6725
void TryDropBossLoot()
Definition: Chara.cs:5434
bool IsLocalChara
Definition: Chara.cs:839
Chara enemy
Definition: Chara.cs:86
bool IsInActiveZone
Definition: Chara.cs:836
void TryDropCarryOnly()
Definition: Chara.cs:4485
void MakeGrave(string lastword)
Definition: Chara.cs:5049
UD_String_MatData matColors
static ColorProfile Colors
Definition: EClass.cs:38
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:125
ConfigAutoCombat autoCombat
Definition: Game.cs:93
CardManager cards
Definition: Game.cs:155
static bool Has(string id)
Definition: LangGame.cs:46
List< Chara > deadCharas
Definition: Map.cs:46
static ThirstPersonInfo thirdPerson1
Definition: Msg.cs:6
void RemoveMember(Chara c)
Definition: Party.cs:101
bool HasElement(int ele)
Definition: Party.cs:180
int allyDeath
Definition: Player.cs:108
void ModKarma(int a)
Definition: Player.cs:2444
Stats stats
Definition: Player.cs:972
int little_dead
Definition: Player.cs:885
HashSet< int > doneBackers
Definition: Player.cs:1029
bool TryAbortAutoCombat(bool immediate=true)
Definition: Player.cs:2338
string deathMsg
Definition: Player.cs:1141
SoundSource PlaySound(string id, bool synced=true, float v=1f, bool spatial=true)
Definition: Point.cs:1237
void TalkWitnesses(Chara criminal, string idTalk, int radius=4, WitnessType type=WitnessType.everyone, Func< Chara, bool > talkIf=null, int chance=3)
Definition: Point.cs:803
Effect PlayEffect(string id)
Definition: Point.cs:1232
List< Card > sales
Definition: PropsManager.cs:14
static Religion recentWrath
Definition: Religion.cs:22
void Revelation(string idTalk, int chance=100)
Definition: Religion.cs:145
string NameShort
Definition: Religion.cs:34
Thing Find(int uid)
void Set(string n)
static void Reserve(string idStep, Action onBeforePlay=null)
Definition: Tutorial.cs:55
static void Say(string text, FontColor fontColor=FontColor.Default, Sprite sprite=null)
void OnCharaDie(Chara c)
virtual bool HasLaw
Definition: Zone.cs:226
void RemoveCard(Card t)
Definition: Zone.cs:1983
void ResetHostility()
Definition: Zone.cs:2644
ZoneInstance instance
Definition: Zone.cs:52

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

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

◆ DiminishTempElements()

void Chara.DiminishTempElements ( int  a = 1)
inline

Definition at line 9902 of file Chara.cs.

9903 {
9904 if (tempElements == null)
9905 {
9906 return;
9907 }
9908 foreach (Element item in tempElements.dict.Values.ToList())
9909 {
9910 if (item.vBase > 0)
9911 {
9912 ModTempElement(item.id, -Mathf.Min(item.vBase * 5 / 100 + 1, item.vBase), naturalDecay: true);
9913 }
9914 }
9915 }

References ElementContainer.dict, and item.

◆ DoAI()

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

Definition at line 6021 of file Chara.cs.

6022 {
6023 SetAI(new DynamicAIAct("", delegate
6024 {
6025 onPerform();
6026 return true;
6027 })
6028 {
6029 wait = wait
6030 });
6031 }

◆ DoHostileAction()

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

Definition at line 6121 of file Chara.cs.

6122 {
6123 if (_tg == null || !_tg.isChara)
6124 {
6125 return;
6126 }
6127 Chara chara = _tg.Chara;
6128 if (chara.IsPC)
6129 {
6130 EClass.pc.combatCount = 10;
6131 }
6132 if (!chara.IsAliveInCurrentZone || !IsAliveInCurrentZone || chara == this)
6133 {
6134 return;
6135 }
6136 if ((IsPCFaction || IsPCFactionMinion) && (chara.IsPCFaction || chara.IsPCFactionMinion))
6137 {
6138 chara.Say("frown", this, chara);
6139 }
6140 else
6141 {
6142 if (EClass._zone.IsRegion)
6143 {
6144 return;
6145 }
6146 if (IsPC)
6147 {
6148 if (chara.IsFriendOrAbove() && !immediate)
6149 {
6150 chara.Say("frown", this, chara);
6151 chara.ShowEmo(Emo.sad);
6152 chara.hostility = Hostility.Neutral;
6153 return;
6154 }
6155 if (!chara.IsPCFaction && chara.hostility >= Hostility.Neutral && !EClass._zone.IsPCFaction)
6156 {
6157 bool flag = chara.id == "fanatic";
6158 if (EClass.rnd(4) == 0 || flag)
6159 {
6160 chara.Say("callHelp", chara);
6161 chara.CallHelp(this, flag);
6162 }
6163 }
6164 if (chara.hostility <= Hostility.Enemy)
6165 {
6166 foreach (Chara member in EClass.pc.party.members)
6167 {
6168 if (member != EClass.pc && member.enemy == null && member.CanSee(chara))
6169 {
6170 member.SetEnemy(chara);
6171 }
6172 }
6173 }
6174 }
6175 else if (chara.IsPC && hostility <= Hostility.Enemy)
6176 {
6177 foreach (Chara member2 in EClass.pc.party.members)
6178 {
6179 if (member2 != EClass.pc && member2.enemy == null && member2.CanSee(this))
6180 {
6181 member2.SetEnemy(this);
6182 }
6183 }
6184 }
6185 if (chara.calmCheckTurn <= 0 || IsPC)
6186 {
6187 chara.calmCheckTurn = (IsPC ? (20 + EClass.rnd(30)) : (10 + EClass.rnd(10)));
6188 }
6189 if (hostility != Hostility.Enemy || chara.hostility != Hostility.Enemy)
6190 {
6191 GoHostile(chara);
6192 chara.GoHostile(this);
6193 if (base.isHidden && !chara.CanSee(this) && !chara.IsDisabled && !chara.IsPCParty && !chara.IsPCPartyMinion && EClass.rnd(10 + Dist(chara) * 10) == 0)
6194 {
6195 Thing t = ThingGen.Create("49");
6196 ActThrow.Throw(chara, pos, t);
6197 Act.TC = chara;
6198 }
6199 }
6200 }
6201 }
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:559
override bool IsPCPartyMinion
Definition: Chara.cs:637
int calmCheckTurn
Definition: Chara.cs:116
bool CanSee(Card c)
Definition: Chara.cs:1200
override bool IsPCFactionMinion
Definition: Chara.cs:653
bool IsFriendOrAbove()
Definition: Chara.cs:6386
Chara SetEnemy(Chara c=null)
Definition: Chara.cs:6072
void CallHelp(Chara tg, bool fanatic=false)
Definition: Chara.cs:6203
Hostility hostility
Definition: Chara.cs:289
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53

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

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

◆ Drink()

void Chara.Drink ( Card  t)
inline

Definition at line 4944 of file Chara.cs.

4945 {
4946 Say("drink", this, t.Duplicate(1));
4947 Say("quaff");
4948 PlaySound("drink");
4949 hunger.Mod(-2);
4950 t.ModNum(-1);
4951 t.trait.OnDrink(this);
4952 _ = IsPC;
4953 }
Thing Duplicate(int num)
Definition: Card.cs:3342
void ModNum(int a, bool notify=true)
Definition: Card.cs:3413
Stats hunger
Definition: Chara.cs:1124
virtual void OnDrink(Chara c)
Definition: Trait.cs:987

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

4498 {
4499 if (held == null)
4500 {
4501 return null;
4502 }
4503 if (IsPC)
4504 {
4505 WidgetHotbar.dirtyCurrentItem = true;
4507 }
4508 Card card = EClass._zone.AddCard(held, dropPos ?? pos);
4509 card.OnLand();
4510 if (card.trait.CanOnlyCarry)
4511 {
4512 card.SetPlaceState(PlaceState.installed);
4513 }
4514 return card;
4515 }
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 4517 of file Chara.cs.

4518 {
4519 if (t.c_isImportant)
4520 {
4521 Msg.Say("markedImportant");
4522 return;
4523 }
4524 if (!t.trait.CanBeDropped)
4525 {
4526 Msg.Say("cantDrop", t);
4527 return;
4528 }
4529 if (t.trait is TraitAbility)
4530 {
4531 SE.Trash();
4532 t.Destroy();
4533 return;
4534 }
4535 Msg.Say("dropItem", t.Name);
4536 t.ignoreAutoPick = true;
4537 PlaySound("drop");
4538 EClass._zone.AddCard(t, pos);
4539 if (t.trait.CanOnlyCarry)
4540 {
4541 t.Install();
4542 }
4543 }
Card Install()
Definition: Card.cs:3639
virtual bool CanBeDropped
Definition: Trait.cs:300

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

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

◆ Duplicate()

Chara Chara.Duplicate ( )
inline

Definition at line 1740 of file Chara.cs.

1741 {
1742 Chara chara = CharaGen.Create(id);
1743 chara.mana.value = mana.value;
1744 chara.stamina.value = stamina.value;
1745 foreach (KeyValuePair<int, Element> item in elements.dict)
1746 {
1747 Element orCreateElement = chara.elements.GetOrCreateElement(item.Key);
1748 orCreateElement.vBase = item.Value.ValueWithoutLink - orCreateElement.vSource;
1749 }
1750 chara.SetFaith(faith);
1751 chara.bio = IO.DeepCopy(bio);
1752 chara.LV = base.LV;
1753 chara.c_daysWithGod = base.c_daysWithGod;
1754 chara.RefreshFaithElement();
1755 chara.hp = (int)Mathf.Clamp((float)chara.MaxHP * ((float)base.hp / (float)MaxHP) * 0.99f, 0f, chara.MaxHP);
1756 chara.isCopy = true;
1757 if (HaveFur())
1758 {
1759 chara.c_fur = -1;
1760 }
1761 return chara;
1762 }
bool HaveFur()
Definition: Card.cs:7611
Stats mana
Definition: Chara.cs:1136
void RefreshFaithElement()
Definition: Chara.cs:9782
void SetFaith(string id)
Definition: Chara.cs:1688
Element GetOrCreateElement(Element ele)
int vSource
Definition: ELEMENT.cs:262
Definition: IO.cs:11
virtual int value
Definition: Stats.cs:56

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

Referenced by ActEffect.Proc().

◆ EnhanceTempElement()

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

Definition at line 9897 of file Chara.cs.

9898 {
9899 ModTempElement(ele, onlyRenew ? (p / 20) : (p / 100 + EClass.rnd(p / 100 + 1)), naturalDecay: false, onlyRenew);
9900 }

References EClass.rnd().

◆ EnhanceTempElements()

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

Definition at line 9888 of file Chara.cs.

9889 {
9890 int[] array = (body ? Element.List_Body : Element.List_Mind);
9891 foreach (int ele in array)
9892 {
9893 EnhanceTempElement(ele, p, onlyRenew);
9894 }
9895 }
void EnhanceTempElement(int ele, int p, bool onlyRenew=false)
Definition: Chara.cs:9897

References Element.List_Mind.

◆ EQ_CAT()

void Chara.EQ_CAT ( string  s)
inline

Definition at line 4921 of file Chara.cs.

4922 {
4923 int slot = EClass.sources.categories.map[s].slot;
4924 BodySlot bodySlot = ((slot == 0) ? null : body.GetSlot(slot));
4925 if ((slot == 0 || bodySlot != null) && (slot != 37 || !HasElement(1209)))
4926 {
4927 SetEQQuality();
4928 Thing thing = ThingGen.CreateFromCategory(s, base.LV);
4929 AddThing(thing);
4930 if (bodySlot != null && !body.Equip(thing, bodySlot))
4931 {
4932 thing.Destroy();
4933 }
4934 }
4935 }
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:3057
bool Equip(Thing thing, BodySlot slot=null, bool msg=true)
Definition: CharaBody.cs:182
BodySlot GetSlot(Thing t, bool onlyEmpty=false, bool secondSlot=false)
Definition: CharaBody.cs:347
void SetEQQuality()
Definition: Chara.cs:4868
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 4901 of file Chara.cs.

4902 {
4903 SetEQQuality();
4904 if (r != Rarity.Random)
4905 {
4906 CardBlueprint.current.rarity = r;
4907 }
4908 Thing thing = ThingGen.Create(s, mat, base.LV);
4909 if (body.GetSlot(thing, onlyEmpty: true) == null)
4910 {
4911 return thing;
4912 }
4913 AddThing(thing);
4914 if (!body.Equip(thing))
4915 {
4916 thing.Destroy();
4917 }
4918 return thing;
4919 }

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

4938 {
4939 SetEQQuality();
4940 Thing t = ThingGen.Create(s, -1, base.LV).SetNum(num);
4941 AddThing(t);
4942 }
Thing SetNum(int a)
Definition: Card.cs:3393

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

◆ EvalueRiding()

int Chara.EvalueRiding ( )
inline

Definition at line 5932 of file Chara.cs.

5933 {
5934 if (ride != null && ride.HasCondition<ConTransmuteBroom>() && HasElement(1417))
5935 {
5936 return 25 + Evalue(226) * 125 / 100;
5937 }
5938 return Evalue(226);
5939 }

References HasCondition().

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

◆ FallFromZone()

void Chara.FallFromZone ( )
inline

Definition at line 3440 of file Chara.cs.

3441 {
3442 Msg.Say("skyFall", EClass.pc, EClass._zone.Name);
3443 Zone zone = (EClass._zone.isExternalZone ? null : EClass._zone.GetTopZone().FindZone(EClass._zone.lv - 1));
3444 zone = zone ?? EClass.world.region;
3446 {
3447 state = ZoneTransition.EnterState.Fall,
3448 x = pos.x,
3449 z = pos.z
3450 });
3451 }
void MoveZone(string alias)
Definition: Chara.cs:3265
int lv
Definition: Spatial.cs:142
Zone FindZone(int lv)
Definition: Spatial.cs:716
Region region
Definition: World.cs:23
Definition: Zone.cs:12
Zone GetTopZone()
Definition: Zone.cs:1904

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

7521 {
7522 TraitToolRange ranged = weapon.trait as TraitToolRange;
7523 Thing thing = (IsPC ? EClass.pc.things.Find<TraitQuiver>() : null);
7524 if (thing != null)
7525 {
7526 Thing thing2 = thing.things.Find((Thing t) => ranged.IsAmmo(t));
7527 if (thing2 != null)
7528 {
7529 return thing2;
7530 }
7531 }
7532 return things.Find((Thing t) => ranged.IsAmmo(t));
7533 }
bool IsAmmo
Definition: Card.cs:2209
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 7074 of file Chara.cs.

7075 {
7076 foreach (Card item in EClass._map.props.installed.all)
7077 {
7078 if (item.trait is TraitBed traitBed && traitBed.IsHolder(this))
7079 {
7080 return traitBed;
7081 }
7082 }
7083 return null;
7084 }

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

7286 {
7287 Thing result = null;
7288 int num = -1;
7289 if (IsPC)
7290 {
7291 return null;
7292 }
7293 foreach (Thing item in things.List((Thing t) => CanEat(t, shouldEat: true) && !t.c_isImportant, onlyAccessible: true))
7294 {
7295 int num2 = CountNumEaten(item);
7296 int num3 = 100 - num2;
7297 if (num3 > num)
7298 {
7299 result = item;
7300 num = num3;
7301 }
7302 }
7303 return result;
7304 }
bool CanEat(Thing t, bool shouldEat=false)
Definition: Chara.cs:7331
int CountNumEaten(Thing food)
Definition: Chara.cs:9753
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 2332 of file Chara.cs.

2333 {
2334 if (IsMinion)
2335 {
2336 master = EClass._map.FindChara(base.c_uidMaster);
2337 }
2338 return master;
2339 }
Chara master
Definition: Chara.cs:88
Chara FindChara(string id)
Definition: Map.cs:2568

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

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

◆ FindNearestNewEnemy()

bool Chara.FindNearestNewEnemy ( )
inline

Definition at line 6283 of file Chara.cs.

6284 {
6285 for (int i = 0; i < EClass._map.charas.Count; i++)
6286 {
6287 Chara chara = EClass._map.charas[i];
6288 if (chara != this && chara != enemy && IsHostile(chara) && Dist(chara) <= 1 && CanInteractTo(chara.pos))
6289 {
6290 DoHostileAction(chara);
6291 enemy = chara;
6292 return true;
6293 }
6294 }
6295 return false;
6296 }
void DoHostileAction(Card _tg, bool immediate=false)
Definition: Chara.cs:6121

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

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

◆ FindNewEnemy()

bool Chara.FindNewEnemy ( )
inline

Definition at line 6214 of file Chara.cs.

6215 {
6216 if (EClass._zone.isPeace && base.IsPCFactionOrMinion && !IsPC)
6217 {
6218 return false;
6219 }
6220 if (enemy != null && !enemy.IsAliveInCurrentZone)
6221 {
6222 enemy = null;
6223 }
6224 if (enemy != null)
6225 {
6226 return false;
6227 }
6228 if (IsPCParty && EClass.pc.isHidden && base.isHidden)
6229 {
6230 return false;
6231 }
6232 bool flag = enemy != null || ai is GoalCombat;
6233 int num = (base.PER + Evalue(210) * 2) * ((!flag) ? 1 : 2);
6234 bool flag2 = IsPCParty && !IsPC && EClass.game.config.tactics.dontWander;
6235 bool flag3 = !IsPCParty;
6236 Chara chara = null;
6237 int num2 = 9999;
6238 for (int i = 0; i < EClass._map.charas.Count; i++)
6239 {
6240 Chara chara2 = EClass._map.charas[i];
6241 if (chara2 == this || !IsHostile(chara2) || !CanSee(chara2))
6242 {
6243 continue;
6244 }
6245 int num3 = Dist(chara2);
6246 int num4 = GetSightRadius() + (flag ? 1 : 0);
6247 if (num3 > num4)
6248 {
6249 continue;
6250 }
6251 if (flag3 && EClass.rnd(chara2.Evalue(152) + 5) * (100 + num3 * num3 * 10) / 100 > EClass.rnd(num))
6252 {
6253 if (this == pos.FirstChara)
6254 {
6255 chara2.ModExp(152, Mathf.Clamp((num - chara2.Evalue(152)) / 2, 1, Mathf.Max(30 - stealthSeen * 2, 1)));
6256 }
6257 stealthSeen++;
6258 }
6259 else if (CanSeeLos(chara2) && (!flag2 || EClass.pc.isBlind || EClass.pc.CanSeeLos(chara2)) && (!IsPCFaction || EClass.pc.ai.ShouldAllyAttack(chara2)))
6260 {
6261 if (!IsPCParty)
6262 {
6263 DoHostileAction(chara2);
6264 enemy = chara2;
6265 return true;
6266 }
6267 if (num3 < num2)
6268 {
6269 num2 = num3;
6270 chara = chara2;
6271 }
6272 }
6273 }
6274 if (chara != null)
6275 {
6276 DoHostileAction(chara);
6277 enemy = chara;
6278 return true;
6279 }
6280 return false;
6281 }
virtual bool ShouldAllyAttack(Chara tg)
Definition: AIAct.cs:134
int stealthSeen
Definition: Chara.cs:186
bool isPeace
Definition: Spatial.cs:406

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

Referenced by GoalCombat.Run().

◆ FindRoom()

Room Chara.FindRoom ( )
inline

Definition at line 7635 of file Chara.cs.

7636 {
7637 return FindBed()?.owner.pos.cell.room;
7638 }
TraitBed FindBed()
Definition: Chara.cs:7074

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

9669 {
9670 Element orCreateElement = elements.GetOrCreateElement(ele);
9671 if (orCreateElement.ValueWithoutLink == 0)
9672 {
9673 elements.ModBase(orCreateElement.id, 1);
9674 }
9675 if (orCreateElement is Spell)
9676 {
9677 int num = EClass.curve(Evalue(307), 50, 20) + (HasElement(307) ? 20 : 0);
9678 int num2 = origin?.Evalue(765) ?? 0;
9679 num = num * (100 - num2) / 100;
9680 int a = mtp * orCreateElement.source.charge * (100 + num) / 100 / 100;
9681 a = Mathf.Max(1, EClass.rndHalf(a));
9682 if (orCreateElement.source.charge == 1)
9683 {
9684 a = 1;
9685 }
9686 orCreateElement.vPotential += a;
9687 }
9688 Say("spell_gain", this, orCreateElement.Name);
9689 LayerAbility.SetDirty(orCreateElement);
9690 }
Element ModBase(int ele, int v)
virtual string Name
Definition: ELEMENT.cs:304
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(), and TraitBaseSpellbook.OnRead().

◆ GetActionText()

string Chara.GetActionText ( )
inline

Definition at line 7018 of file Chara.cs.

7019 {
7020 string result = "?????";
7021 if (ai != null)
7022 {
7023 result = ai.GetCurrentActionText();
7024 }
7025 return result;
7026 }
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 7570 of file Chara.cs.

7571 {
7572 if (body.GetWeight(armorOnly: true) <= 30000)
7573 {
7574 return 120;
7575 }
7576 return 122;
7577 }
int GetWeight(bool armorOnly=false)
Definition: CharaBody.cs:390

References CharaBody.GetWeight().

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

◆ GetBestRangedWeapon()

Thing Chara.GetBestRangedWeapon ( )
inline

Definition at line 7535 of file Chara.cs.

7536 {
7537 Thing result = null;
7538 int num = 0;
7539 foreach (Thing thing in things)
7540 {
7541 if (thing.IsRangedWeapon && CanEquipRanged(thing) && thing.GetEquipValue() > num)
7542 {
7543 num = thing.GetEquipValue();
7544 result = thing;
7545 }
7546 }
7547 return result;
7548 }
int GetEquipValue()
Definition: Card.cs:6939
bool IsRangedWeapon
Definition: Card.cs:2205
bool CanEquipRanged(Thing t)
Definition: Chara.cs:7469

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

◆ GetBuffStats() [1/2]

Element Chara.GetBuffStats ( int  ele)
inline

Definition at line 9071 of file Chara.cs.

9072 {
9073 for (int i = 0; i < conditions.Count; i++)
9074 {
9075 if (conditions[i] is ConBuffStats conBuffStats && conBuffStats.refVal == ele)
9076 {
9077 return conBuffStats.elements.GetElement(ele);
9078 }
9079 }
9080 return null;
9081 }

References BaseCondition.refVal.

◆ GetBuffStats() [2/2]

Element Chara.GetBuffStats ( string  alias)
inline

Definition at line 9066 of file Chara.cs.

9067 {
9068 return GetBuffStats(EClass.sources.elements.alias[alias].id);
9069 }
Element GetBuffStats(string alias)
Definition: Chara.cs:9066

References SourceManager.elements, and EClass.sources.

Referenced by GoalCombat.TryUseAbility().

◆ GetBurden()

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

Definition at line 1764 of file Chara.cs.

1765 {
1766 int num2 = (base.ChildrenWeight + ((t != null) ? ((num == -1) ? t.ChildrenAndSelfWeight : (t.SelfWeight * num)) : 0)) * 100 / WeightLimit;
1767 if (num2 < 0)
1768 {
1769 num2 = 1000;
1770 }
1772 {
1773 num2 = 0;
1774 }
1775 int num3 = ((num2 >= 100) ? ((num2 - 100) / 10 + 1) : 0);
1776 if (num3 > 9)
1777 {
1778 num3 = 9;
1779 }
1780 return num3;
1781 }

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

◆ GetCondition< T >()

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

Definition at line 9096 of file Chara.cs.

9096 : Condition
9097 {
9098 for (int i = 0; i < conditions.Count; i++)
9099 {
9100 if (conditions[i] is T)
9101 {
9102 return conditions[i] as T;
9103 }
9104 }
9105 return null;
9106 }

◆ GetCooldown()

int Chara.GetCooldown ( int  idEle)
inline

Definition at line 8364 of file Chara.cs.

8365 {
8366 if (_cooldowns != null)
8367 {
8368 for (int i = 0; i < _cooldowns.Count; i++)
8369 {
8370 if (_cooldowns[i] / 1000 == idEle)
8371 {
8372 return _cooldowns[i] % 1000;
8373 }
8374 }
8375 }
8376 return 0;
8377 }

Referenced by NotificationCooldown.OnRefresh().

◆ GetCurrentDir()

int Chara.GetCurrentDir ( )
inline

Definition at line 3560 of file Chara.cs.

3561 {
3562 Debug.Log(angle);
3563 if (!renderer.hasActor)
3564 {
3565 if (angle == 0f || angle == 45f || angle == 90f)
3566 {
3567 return 2;
3568 }
3569 if (angle == -135f || angle == 180f || angle == -90f)
3570 {
3571 return 1;
3572 }
3573 if (angle == 135f)
3574 {
3575 return 0;
3576 }
3577 return 3;
3578 }
3579 return renderer.actor.currentDir;
3580 }
virtual int currentDir
Definition: CardActor.cs:41
float angle
Definition: Card.cs:69

References Debug.

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

◆ GetDestination()

Point Chara.GetDestination ( )
inline

Definition at line 6993 of file Chara.cs.

6994 {
6995 return (ai.IsRunning ? ai.GetDestination() : pos).Copy();
6996 }
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 4570 of file Chara.cs.

4571 {
4572 if (elements.Value(122) > elements.Value(120))
4573 {
4574 return elements.GetElement(122);
4575 }
4576 return elements.GetElement(120);
4577 }
int Value(int ele)

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

◆ GetFavAttackStyle()

AttackStyle Chara.GetFavAttackStyle ( )
inline

Definition at line 4545 of file Chara.cs.

4546 {
4547 int num = Evalue(131);
4548 int num2 = Evalue(130);
4549 int num3 = Evalue(123);
4550 if (num > num2 && num > num3)
4551 {
4552 return AttackStyle.TwoWield;
4553 }
4554 if (num2 > num && num2 > num3)
4555 {
4556 return AttackStyle.TwoHand;
4557 }
4558 if (num3 > num && num3 > num2)
4559 {
4560 return AttackStyle.Shield;
4561 }
4562 return AttackStyle.Default;
4563 }

Referenced by WindowChara.RefreshNote().

◆ GetFavCat()

SourceCategory.Row Chara.GetFavCat ( )
inline

Definition at line 7753 of file Chara.cs.

7754 {
7755 SourceCategory.Row r = null;
7756 if (_listFavCat.Count == 0)
7757 {
7758 foreach (SourceCategory.Row row in EClass.sources.categories.rows)
7759 {
7760 if (row.gift > 0)
7761 {
7762 _listFavCat.Add(row);
7763 }
7764 }
7765 }
7766 Rand.UseSeed(base.uid + EClass.game.seed, delegate
7767 {
7768 r = _listFavCat.RandomItem();
7769 });
7770 return r;
7771 }
static List< SourceCategory.Row > _listFavCat
Definition: Chara.cs:192
int seed
Definition: Game.cs:197
Definition: Rand.cs:4
static void UseSeed(int seed, Action action)
Definition: Rand.cs:22

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

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

◆ GetFavFood()

SourceThing.Row Chara.GetFavFood ( )
inline

Definition at line 7733 of file Chara.cs.

7734 {
7735 if (_listFavFood.Count == 0)
7736 {
7737 foreach (SourceThing.Row row in EClass.sources.things.rows)
7738 {
7739 if (row._origin == "dish" && row.value != 0 && row.chance != 0)
7740 {
7741 _listFavFood.Add(row);
7742 }
7743 }
7744 }
7745 SourceThing.Row r = null;
7746 Rand.UseSeed(base.uid + EClass.game.seed, delegate
7747 {
7748 r = _listFavFood.RandomItem();
7749 });
7750 return r;
7751 }
static List< SourceThing.Row > _listFavFood
Definition: Chara.cs:190
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 4565 of file Chara.cs.

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

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

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

8431 {
8432 if (IsPC)
8433 {
8434 return null;
8435 }
8436 switch (TimeTable.GetSpan(idTimeTable, hour))
8437 {
8438 case TimeTable.Span.Sleep:
8440 {
8441 return new GoalSleep();
8442 }
8443 break;
8444 case TimeTable.Span.Eat:
8445 return new GoalIdle();
8446 case TimeTable.Span.Work:
8447 if (IsGuest())
8448 {
8449 return new GoalIdle();
8450 }
8451 return GetGoalWork();
8452 case TimeTable.Span.Free:
8453 if (IsGuest())
8454 {
8455 return new GoalIdle();
8456 }
8457 return GetGoalHobby();
8458 }
8459 return null;
8460 }
Goal GetGoalWork()
Definition: Chara.cs:8462
Goal GetGoalHobby()
Definition: Chara.cs:8475
string idTimeTable
Definition: Chara.cs:466
static Span GetSpan(string id, int hour)
Definition: TimeTable.cs:45
bool isSimulating
Definition: Zone.cs:72

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

◆ GetGoalHobby()

Goal Chara.GetGoalHobby ( )
inline

Definition at line 8475 of file Chara.cs.

8476 {
8477 if (IsPrisoner)
8478 {
8479 return new GoalIdle();
8480 }
8481 if (memberType == FactionMemberType.Livestock)
8482 {
8483 return new GoalGraze();
8484 }
8485 return new GoalHobby();
8486 }
FactionMemberType
bool IsPrisoner
Definition: Chara.cs:1024

Referenced by Zone.Simulate().

◆ GetGoalWork()

Goal Chara.GetGoalWork ( )
inline

Definition at line 8462 of file Chara.cs.

8463 {
8464 if (IsPrisoner)
8465 {
8466 return new GoalIdle();
8467 }
8468 if (memberType == FactionMemberType.Livestock)
8469 {
8470 return new GoalGraze();
8471 }
8472 return new GoalWork();
8473 }

Referenced by Zone.Simulate().

◆ GetHappiness()

int Chara.GetHappiness ( )
inline

Definition at line 7003 of file Chara.cs.

7004 {
7005 int num = 50;
7006 if (FindBed() != null)
7007 {
7008 num += 50;
7009 }
7010 return num;
7011 }

◆ GetHireCost()

int Chara.GetHireCost ( )
inline

Definition at line 6998 of file Chara.cs.

6999 {
7000 return base.LV / 2 + 4;
7001 }

Referenced by CalcGold.Hire().

◆ GetHoverText()

override string Chara.GetHoverText ( )
inlinevirtual

Reimplemented from Card.

Definition at line 6532 of file Chara.cs.

6533 {
6534 string text = base.Name;
6535 if (IsFriendOrAbove())
6536 {
6537 text = text.TagColor(EClass.Colors.colorFriend);
6538 }
6539 else if (IsHostile())
6540 {
6541 text = text.TagColor(EClass.Colors.colorHostile);
6542 }
6543 int num = 2;
6544 int lV = EClass.pc.LV;
6545 if (base.LV >= lV * 5)
6546 {
6547 num = 0;
6548 }
6549 else if (base.LV >= lV * 2)
6550 {
6551 num = 1;
6552 }
6553 else if (base.LV <= lV / 4)
6554 {
6555 num = 4;
6556 }
6557 else if (base.LV <= lV / 2)
6558 {
6559 num = 3;
6560 }
6561 string text2 = Lang.GetList("lvComparison")[num];
6562 text2 = (" (" + text2 + ") ").TagSize(14).TagColor(EClass.Colors.gradientLVComparison.Evaluate(0.25f * (float)num));
6563 string s = (IsFriendOrAbove() ? "HostilityAlly" : (IsNeutral() ? "HostilityNeutral" : "HostilityEnemy"));
6564 s = (" (" + s.lang() + ") ").TagSize(14);
6565 s = "";
6566 if (memberType == FactionMemberType.Guest)
6567 {
6568 s += (" (" + "guest".lang() + ") ").TagSize(14);
6569 }
6570 else if (memberType == FactionMemberType.Livestock)
6571 {
6572 s += (" (" + "livestock".lang() + ") ").TagSize(14);
6573 }
6574 if (!EClass.pc.IsMoving)
6575 {
6576 if (EClass.pc.HasHigherGround(this))
6577 {
6578 text2 += "lowerGround".lang();
6579 }
6580 else if (HasHigherGround(EClass.pc))
6581 {
6582 text2 += "higherGround".lang();
6583 }
6584 }
6585 if (Evalue(1232) > 0)
6586 {
6587 text2 = "milkBaby".lang().TagSize(14) + text2;
6588 }
6589 if (Guild.Fighter.ShowBounty(this) && Guild.Fighter.HasBounty(this))
6590 {
6591 text2 = "hasBounty".lang().TagSize(14) + text2;
6592 }
6593 if (EClass.pc.HasElement(481))
6594 {
6595 text2 += ("(" + faith.Name + ")").TagSize(14);
6596 }
6597 return text + text2 + s;
6598 }
bool HasHigherGround(Card c)
Definition: Chara.cs:1172
override bool IsMoving
Definition: Chara.cs:606
bool IsNeutral()
Definition: Chara.cs:6337
Color colorHostile
Color colorFriend
Gradient gradientLVComparison
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.colorFriend, ColorProfile.colorHostile, EClass.Colors, Guild.Fighter, Lang.GetList(), ColorProfile.gradientLVComparison, GuildFighter.HasBounty(), Card.HasElement(), HasHigherGround(), IsMoving, Card.LV, EClass.pc, and GuildFighter.ShowBounty().

Referenced by WidgetMouseover.Refresh().

◆ GetHoverText2()

override string Chara.GetHoverText2 ( )
inlinevirtual

Reimplemented from Card.

Definition at line 6600 of file Chara.cs.

6601 {
6602 string text = "";
6603 if (knowFav)
6604 {
6605 text += Environment.NewLine;
6606 text = text + "<size=14>" + "favgift".lang(GetFavCat().GetName().ToLower(), GetFavFood().GetName()) + "</size>";
6607 }
6608 string text2 = "";
6610 {
6611 text2 += Environment.NewLine;
6612 text2 = text2 + "Lv:" + base.LV + " HP:" + base.hp + "/" + MaxHP + " MP:" + mana.value + "/" + mana.max + " DV:" + DV + " PV:" + PV + " Hunger:" + hunger.value;
6613 text2 += Environment.NewLine;
6614 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");
6615 text2 += Environment.NewLine;
6616 text2 = text2 + base.uid + IsMinion + "/" + base.c_uidMaster + "/" + master;
6617 text2 = text2 + " dir:" + base.dir + " skin:" + base.idSkin;
6618 }
6620 {
6621 text2 += Environment.NewLine;
6622 text2 += "<size=14>";
6623 foreach (Hobby item in ListWorks())
6624 {
6625 text2 = text2 + item.Name + ", ";
6626 }
6627 foreach (Hobby item2 in ListHobbies())
6628 {
6629 text2 = text2 + item2.Name + ", ";
6630 }
6631 text2 = text2.TrimEnd(", ".ToCharArray()) + "</size>";
6632 }
6633 string text3 = "";
6634 IEnumerable<BaseStats> enumerable = conditions.Concat((!IsPCFaction) ? new BaseStats[0] : new BaseStats[2] { hunger, stamina });
6635 if (enumerable.Count() > 0)
6636 {
6637 text3 += Environment.NewLine;
6638 text3 += "<size=14>";
6639 int num = 0;
6640 foreach (BaseStats item3 in enumerable)
6641 {
6642 string text4 = item3.GetPhaseStr();
6643 if (text4.IsEmpty() || text4 == "#")
6644 {
6645 continue;
6646 }
6647 Color c = Color.white;
6648 switch (item3.source.group)
6649 {
6650 case "Bad":
6651 case "Debuff":
6652 case "Disease":
6654 break;
6655 case "Buff":
6657 break;
6658 }
6660 {
6661 text4 = text4 + "(" + item3.GetValue() + ")";
6662 if (resistCon != null && resistCon.ContainsKey(item3.id))
6663 {
6664 text4 = text4 + "{" + resistCon[item3.id] + "}";
6665 }
6666 }
6667 num++;
6668 text3 = text3 + text4.TagColor(c) + ", ";
6669 }
6670 if (num == 0)
6671 {
6672 text3 = "";
6673 }
6674 else
6675 {
6676 text = "";
6677 text3 = text3.TrimEnd(", ".ToCharArray()) + "</size>";
6678 }
6679 }
6681 {
6682 text3 += Environment.NewLine;
6683 foreach (ActList.Item item4 in ability.list.items)
6684 {
6685 text3 = text3 + item4.act.Name + ", ";
6686 }
6687 text3 = text3.TrimEnd(", ".ToCharArray());
6688 }
6689 return text + text2 + text3;
6690 }
override string ToString()
Definition: AIAct.cs:124
virtual string GetPhaseStr()
Definition: BaseStats.cs:47
virtual int GetValue()
Definition: BaseStats.cs:52
int idSkin
Definition: Card.cs:348
SourceCategory.Row GetFavCat()
Definition: Chara.cs:7753
bool knowFav
Definition: Chara.cs:411
override string GetName(NameStyle style, int num=-1)
Definition: Chara.cs:1339
override int DV
Definition: Chara.cs:727
List< Hobby > ListHobbies(bool useMemberType=true)
Definition: Chara.cs:8618
override int PV
Definition: Chara.cs:756
SourceThing.Row GetFavFood()
Definition: Chara.cs:7733
List< Hobby > ListWorks(bool useMemberType=true)
Definition: Chara.cs:8591
Color colorDebuff
bool showExtra
Definition: CoreDebug.cs:168
Definition: Hobby.cs:5
SourceTactics tactics

References Color, ColorProfile.colorBuff, ColorProfile.colorDebuff, EClass.Colors, EClass.debug, BaseStats.GetPhaseStr(), BaseStats.GetValue(), held, BaseStats.id, SourceJob.Row.id, Card.idSkin, 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 7835 of file Chara.cs.

7836 {
7837 if (id == "olderyoungersister")
7838 {
7839 if (base.idSkin != 2)
7840 {
7841 return "UN_olderyoungersister";
7842 }
7843 return "UN_olderyoungersister_alt";
7844 }
7845 if (Portrait.allIds.Contains("UN_" + id + ".png"))
7846 {
7847 return "UN_" + id;
7848 }
7849 return base.c_idPortrait;
7850 }
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 7821 of file Chara.cs.

7822 {
7823 string text = race.id;
7824 if ((text == "mifu" || text == "nefu") && EClass.rnd(2) == 0)
7825 {
7826 return "foxfolk";
7827 }
7828 if (trait is TraitGuard)
7829 {
7830 return "guard";
7831 }
7832 return "";
7833 }

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

6787 {
6788 return GetSprite();
6789 }
override Sprite GetSprite(int dir=0)
Definition: Chara.cs:6456

◆ GetName()

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

Reimplemented from Card.

Definition at line 1339 of file Chara.cs.

1340 {
1341 if (base.isBackerContent && EClass.core.config.backer.Show(base.c_idBacker))
1342 {
1343 if (id == "follower" && !IsGlobal)
1344 {
1345 return "_follower".lang(EClass.sources.backers.map[base.c_idBacker].Name, faith.Name);
1346 }
1347 return EClass.sources.backers.map[base.c_idBacker].Name;
1348 }
1349 string text = base.c_altName ?? source.GetName(this);
1350 text = text.Replace("#ele5", MainElement.source.GetAltname(3)).Replace("#ele4", MainElement.source.GetAltname(2)).Replace("#ele3", MainElement.source.GetAltname(1))
1351 .Replace("#ele2", MainElement.source.GetAltname(0))
1352 .Replace("#ele", MainElement.source.GetName().ToLower());
1353 if (base.c_bossType == BossType.Evolved)
1354 {
1355 text = "_evolved".lang(text.ToTitleCase(wholeText: true));
1356 }
1357 trait.SetName(ref text);
1358 if (text.Length > 0 && char.IsLower(text[0]))
1359 {
1360 if (base.rarity >= Rarity.Legendary)
1361 {
1362 text = text.ToTitleCase();
1363 }
1364 else if (num != 0)
1365 {
1366 text = text.AddArticle();
1367 }
1368 }
1369 if (style == NameStyle.Simple)
1370 {
1371 return text;
1372 }
1373 int num2 = ((base.rarity == Rarity.Mythical) ? 3 : ((base.rarity >= Rarity.Legendary) ? 2 : ((!_alias.IsEmpty()) ? 1 : (-1))));
1374 if (trait is TraitAdventurer)
1375 {
1376 num2 = 1;
1377 }
1378 text = (Aka.IsEmpty() ? text.Bracket(num2) : (num2 switch
1379 {
1380 -1 => "_aka",
1381 1 => "_aka3",
1382 _ => "_aka2",
1383 }).lang((num2 == -1) ? Aka : Aka.ToTitleCase(wholeText: true), text.Bracket(num2)));
1384 string text2 = (base.isSale ? "forSale".lang(Lang._currency(GetPrice(CurrencyType.Money, sell: true, PriceType.PlayerShop), "money")) : "");
1385 return text + text2;
1386 }
BossType
Definition: BossType.cs:2
string Aka
Definition: Chara.cs:214
string _alias
Definition: Chara.cs:217
BackerContentConfig backer
Definition: CoreConfig.cs:608
string Name
Definition: Religion.cs:30
SourceBacker backers
virtual void SetName(ref string s)
Definition: Trait.cs:696

References _alias, Lang._currency(), Aka, CoreConfig.backer, SourceManager.backers, Core.config, EClass.core, faith, Card.GetPrice(), IsGlobal, MainElement, 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 7773 of file Chara.cs.

7774 {
7775 using (List<Chara>.Enumerator enumerator = pos.ListCharasInRadius(this, 3, (Chara c) => c != this && c.race.id == "cat").GetEnumerator())
7776 {
7777 if (enumerator.MoveNext())
7778 {
7779 return enumerator.Current;
7780 }
7781 }
7782 return null;
7783 }
List< Chara > ListCharasInRadius(Chara cc, int dist, Func< Chara, bool > func, bool onlyVisible=true)
Definition: Point.cs:1204

References race.

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

◆ GetPietyValue()

int Chara.GetPietyValue ( )
inline

Definition at line 9773 of file Chara.cs.

9774 {
9775 if (base._IsPC)
9776 {
9777 return 10 + (int)(Mathf.Sqrt(base.c_daysWithGod) * 2f + (float)Evalue(85)) / 2;
9778 }
9779 return 10 + (int)(Mathf.Sqrt(base.LV) * 5f + (float)Evalue(306)) / 2;
9780 }

◆ GetRevived()

void Chara.GetRevived ( )
inline

Definition at line 4960 of file Chara.cs.

4961 {
4962 Revive(EClass.pc.pos.GetNearestPoint(allowBlock: false, allowChara: false), msg: true);
4963 if (!IsPCFaction)
4964 {
4965 return;
4966 }
4968 {
4969 if (homeZone != null && EClass._zone != homeZone)
4970 {
4971 Msg.Say("returnHome", this, homeZone.Name);
4973 }
4974 }
4975 else if (!EClass._zone.IsPCFaction || homeBranch != EClass.Branch || base.c_wasInPcParty)
4976 {
4977 EClass.pc.party.AddMemeber(this, showMsg: true);
4978 }
4979 }
static FactionBranch Branch
Definition: EClass.cs:22
void AddMemeber(Chara c, bool showMsg=false)
Definition: Party.cs:56
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false, int minRadius=0)
Definition: Point.cs:607
virtual bool CanJoinParty
Definition: TraitChara.cs:47
virtual bool CanJoinPartyResident
Definition: TraitChara.cs:50

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

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

◆ GetRoomWork()

BaseArea Chara.GetRoomWork ( )
inline

Definition at line 8569 of file Chara.cs.

8570 {
8571 BaseArea result = null;
8572 foreach (Hobby item in ListWorks())
8573 {
8574 AIWork aI = item.GetAI(this);
8575 if (aI.SetDestination())
8576 {
8577 if (aI.destArea != null)
8578 {
8579 result = aI.destArea;
8580 }
8581 else if (aI.destThing != null)
8582 {
8583 result = aI.destThing.pos.cell.room;
8584 }
8585 break;
8586 }
8587 }
8588 return result;
8589 }
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 6456 of file Chara.cs.

6457 {
6458 if (IsPCC)
6459 {
6460 PCC pCC = PCC.Get(pccData);
6461 pCC.Build();
6462 return pCC.variation.idle[0, 0];
6463 }
6464 if (spriteReplacer != null)
6465 {
6466 return spriteReplacer.data.GetSprite();
6467 }
6468 return sourceCard.GetSprite(0, (sourceCard._tiles.Length > 1) ? ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % sourceCard._tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0))) : 0);
6469 }
SpriteReplacer spriteReplacer
Definition: Chara.cs:152
override CardRow sourceCard
Definition: Chara.cs:448
int[] _tiles
Definition: RenderRow.cs:12
Sprite GetSprite(int dir=0, int skin=0, bool snow=false)
Definition: RenderRow.cs:261
Sprite GetSprite(bool snow=false)
Definition: SpriteData.cs:67
SpriteData data

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

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

◆ GetSubPassData()

override SubPassData Chara.GetSubPassData ( )
inlinevirtual

Reimplemented from Card.

Definition at line 6480 of file Chara.cs.

6481 {
6482 if (IsPCC)
6483 {
6485 {
6487 }
6488 }
6489 else if (conSleep != null && host == null && pos.Equals(EClass.pc.pos) && IsHuman && (GetBool(123) || affinity.CanSleepBeside()))
6490 {
6491 return EClass.setting.pass.subDead;
6492 }
6493 return SubPassData.Default;
6494 }
bool CanSleepBeside()
Definition: Affinity.cs:77
bool GetBool(int id)
Definition: BaseCard.cs:15
ConSleep conSleep
Definition: Chara.cs:102
override bool IsDeadOrSleeping
Definition: Chara.cs:571
Affinity affinity
Definition: Chara.cs:312
PassSetting pass
Definition: GameSetting.cs:303
bool altHeldPos
Definition: Player.cs:1109
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 7013 of file Chara.cs.

7014 {
7015 return GetHappiness().ToString() ?? "";
7016 }
int GetHappiness()
Definition: Chara.cs:7003

◆ GetTextHobby()

string Chara.GetTextHobby ( bool  simple = false)
inline

Definition at line 8707 of file Chara.cs.

8708 {
8709 string text = (simple ? "" : ("hobby".lang() + ":"));
8710 foreach (Hobby item in ListHobbies())
8711 {
8712 text = text + " " + item.Name.TagColor((item.GetEfficiency(this) > 0) ? FontColor.Good : FontColor.Warning) + ",";
8713 }
8714 return text.TrimEnd(',');
8715 }

References item.

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

◆ GetTextWork()

string Chara.GetTextWork ( bool  simple = false)
inline

Definition at line 8717 of file Chara.cs.

8718 {
8719 string text = (simple ? "" : ("work".lang() + ":"));
8720 foreach (Hobby item in ListWorks())
8721 {
8722 text = text + " " + item.Name.TagColor((item.GetEfficiency(this) > 0) ? FontColor.Good : FontColor.Warning) + ",";
8723 }
8724 return text.TrimEnd(',');
8725 }

References item.

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

◆ GetTopicText()

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

Definition at line 6692 of file Chara.cs.

6693 {
6694 string key = source.idText.IsEmpty(id);
6695 if (id == "littleOne" && EClass._zone is Zone_LittleGarden)
6696 {
6697 key = "littleOne2";
6698 }
6699 SourceCharaText.Row row = EClass.sources.charaText.map.TryGetValue(key);
6700 if (row == null)
6701 {
6702 return null;
6703 }
6704 string text = row.GetText(topic, returnNull: true);
6705 if (text.IsEmpty())
6706 {
6707 return null;
6708 }
6709 if (text.StartsWith("@"))
6710 {
6711 row = EClass.sources.charaText.map.TryGetValue(text.Replace("@", ""));
6712 if (row == null)
6713 {
6714 return null;
6715 }
6716 text = row.GetText(topic, returnNull: true);
6717 if (text.IsEmpty())
6718 {
6719 return null;
6720 }
6721 }
6722 return text.Split(Environment.NewLine.ToCharArray()).RandomItem();
6723 }
SourceCharaText charaText

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

◆ GetTotalFeat()

int Chara.GetTotalFeat ( )
inline

Definition at line 7795 of file Chara.cs.

7796 {
7797 int num = 0;
7798 if (base.c_upgrades != null)
7799 {
7800 num += base.c_upgrades.spent;
7801 }
7802 if (base.c_genes != null)
7803 {
7804 num += base.c_genes.GetTotalCost();
7805 }
7806 return num + base.feat;
7807 }

◆ GetWork()

Hobby Chara.GetWork ( string  id)
inline

Definition at line 8638 of file Chara.cs.

8639 {
8640 foreach (Hobby item in ListWorks())
8641 {
8642 if (item.source.alias == id)
8643 {
8644 return item;
8645 }
8646 }
8647 foreach (Hobby item2 in ListHobbies())
8648 {
8649 if (item2.source.alias == id)
8650 {
8651 return item2;
8652 }
8653 }
8654 return null;
8655 }
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 8790 of file Chara.cs.

8791 {
8792 if (_workSummary == null)
8793 {
8794 _workSummary = new WorkSummary();
8795 }
8796 return _workSummary;
8797 }
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 7934 of file Chara.cs.

7935 {
7936 if (c.IsHostile() || c.IsDeadOrSleeping)
7937 {
7938 Msg.Say("affinityNone", c, this);
7939 return;
7940 }
7941 if (!t.isCopy && t.IsCursed && t.IsEquipmentOrRanged && !t.IsAmmo && c.HasElement(1414))
7942 {
7943 bool num = t.blessedState == BlessedState.Doomed;
7944 int num2 = 200 + t.LV * 3;
7945 if (t.rarity == Rarity.Legendary)
7946 {
7947 num2 *= 3;
7948 }
7949 if (t.rarity >= Rarity.Mythical)
7950 {
7951 num2 *= 5;
7952 }
7953 if (num)
7954 {
7955 num2 *= 2;
7956 }
7957 EClass.pc.PlayEffect("identify");
7958 EClass.pc.PlaySound("identify");
7959 c.PlayEffect("mutation");
7960 c.Say("draw_curse", c, t);
7961 t.Destroy();
7962 List<Element> list = new List<Element>();
7963 foreach (Element value in EClass.pc.elements.dict.Values)
7964 {
7965 if (value is Spell)
7966 {
7967 list.Add(value);
7968 }
7969 }
7970 if (list.Count == 0)
7971 {
7973 return;
7974 }
7975 Element element = list.RandomItem();
7976 EClass.pc.ModExp(element.id, num2);
7977 EClass.pc.Say("draw_curse2", EClass.pc, element.Name);
7978 c.AddExp(Mathf.Min(num2 / 3, c.ExpToNext));
7979 return;
7980 }
7981 if ((t.id == "lovepotion" || t.id == "dreambug") && !Application.isEditor)
7982 {
7983 GiveLovePotion(c, t);
7984 return;
7985 }
7986 if (t.trait is TraitErohon && c.id == t.c_idRefName)
7987 {
7988 c.OnGiveErohon(t);
7989 return;
7990 }
7991 if (t.trait is TraitTicketMassage)
7992 {
7993 t.ModNum(-1);
7994 c.Talk("ticket");
7995 switch (t.id)
7996 {
7997 case "ticket_massage":
7998 c.ModAffinity(EClass.pc, 10);
8000 {
8001 target = c
8002 });
8003 break;
8004 case "ticket_armpillow":
8005 c.ModAffinity(EClass.pc, 20);
8006 EClass.pc.AddCondition<ConSleep>(300, force: true);
8007 c.SetAI(new AI_ArmPillow
8008 {
8009 target = EClass.pc
8010 });
8011 break;
8012 case "ticket_champagne":
8013 c.ModAffinity(EClass.pc, 10);
8015 break;
8016 }
8017 return;
8018 }
8019 if (t.id == "flyer")
8020 {
8021 stamina.Mod(-1);
8022 if (c.things.Find((Thing a) => a.id == "flyer") != null)
8023 {
8024 c.Talk("flyer_miss");
8025 DoHostileAction(c);
8026 return;
8027 }
8028 if (EClass.rnd(20) != 0 && c.CHA > EClass.rnd(base.CHA + Evalue(291) * 3 + 10))
8029 {
8030 Msg.Say("affinityNone", c, this);
8031 t.Destroy();
8032 elements.ModExp(291, 10f);
8033 return;
8034 }
8035 elements.ModExp(291, 50f);
8036 }
8037 if (t.id == "statue_weird")
8038 {
8039 EClass.pc.Say("statue_sell");
8040 }
8041 t.isGifted = true;
8042 c.nextUse = c.affinity.OnGift(t);
8043 if (!t.isDestroyed)
8044 {
8045 EClass.game.quests.list.ForeachReverse(delegate(Quest q)
8046 {
8047 q.OnGiveItem(c, t);
8048 });
8049 if (c.TryEquip(t))
8050 {
8051 c.nextUse = null;
8052 }
8053 }
8054 }
Thing OnGift(Thing t)
Definition: Affinity.cs:129
int ExpToNext
Definition: Card.cs:1970
bool isCopy
Definition: Card.cs:864
bool IsCursed
Definition: Card.cs:2217
int CHA
Definition: Card.cs:2309
bool IsEquipmentOrRanged
Definition: Card.cs:2180
void SayNothingHappans()
Definition: Card.cs:6581
string c_idRefName
Definition: Card.cs:1615
void AddExp(int a)
Definition: Card.cs:2903
void GiveLovePotion(Chara c, Thing t)
Definition: Chara.cs:8067
bool TryEquip(Thing t, bool useFav=false)
Definition: Chara.cs:7430
void OnGiveErohon(Thing t)
Definition: Chara.cs:8056
QuestManager quests
Definition: Game.cs:179
List< Quest > list
Definition: QuestManager.cs:11
Definition: Quest.cs:7
virtual void OnGiveItem(Chara c, Thing t)
Definition: Quest.cs:531

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

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

◆ GiveLovePotion()

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

Definition at line 8067 of file Chara.cs.

8068 {
8069 c.Say("give_love", c, t);
8070 c.PlaySound(t.material.GetSoundDead());
8071 c.ShowEmo(Emo.angry);
8072 c.ModAffinity(EClass.pc, -20, show: false);
8073 c.Talk("pervert");
8074 t.Destroy();
8075 }

References Card.Destroy(), Card.material, ModAffinity(), EClass.pc, Card.PlaySound(), Card.Say(), Card.ShowEmo(), and Card.Talk().

Referenced by InvOwner.Transaction.Process().

◆ GoHostile()

void Chara.GoHostile ( Card  _tg)
inlineprivate

Definition at line 6097 of file Chara.cs.

6098 {
6099 if (enemy == null && !IsPC)
6100 {
6101 if (GetInt(106) == 0)
6102 {
6103 TalkTopic("aggro");
6104 }
6105 if (OriginalHostility != Hostility.Enemy)
6106 {
6107 ShowEmo(Emo.angry);
6108 }
6109 SetEnemy(_tg.Chara);
6110 }
6112 {
6113 if (hostility >= Hostility.Neutral)
6114 {
6115 Say("angry", this);
6116 }
6117 hostility = Hostility.Enemy;
6118 }
6119 }
int GetInt(int id, int? defaultInt=null)
Definition: BaseCard.cs:25
virtual bool IsPCFactionMinion
Definition: Card.cs:2117

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

Referenced by CallHelp(), and DoHostileAction().

◆ HasAccess() [1/2]

bool Chara.HasAccess ( Card  c)
inline

Definition at line 1262 of file Chara.cs.

1263 {
1264 return HasAccess(c.pos);
1265 }
bool HasAccess(Card c)
Definition: Chara.cs:1262

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

1268 {
1269 if (!EClass._zone.IsPCFaction || p.cell.room == null || IsPC)
1270 {
1271 return true;
1272 }
1273 return p.cell.room.data.accessType switch
1274 {
1275 BaseArea.AccessType.Resident => memberType == FactionMemberType.Default,
1276 BaseArea.AccessType.Private => false,
1277 _ => true,
1278 };
1279 }

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

◆ HasCondition()

◆ HasCondition< T >()

override bool Chara.HasCondition< T > ( )
inlinevirtual

Reimplemented from Card.

Definition at line 9042 of file Chara.cs.

9043 {
9044 for (int i = 0; i < conditions.Count; i++)
9045 {
9046 if (conditions[i] is T)
9047 {
9048 return true;
9049 }
9050 }
9051 return false;
9052 }

◆ HasCooldown()

bool Chara.HasCooldown ( int  idEle)
inline

Definition at line 8359 of file Chara.cs.

8360 {
8361 return GetCooldown(idEle) != 0;
8362 }
int GetCooldown(int idEle)
Definition: Chara.cs:8364

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

◆ HasHigherGround()

bool Chara.HasHigherGround ( Card  c)
inline

Definition at line 1172 of file Chara.cs.

1173 {
1174 if (c == null)
1175 {
1176 return false;
1177 }
1178 float num = renderer.position.y - pos.Position(0).y + (_isLevitating ? 0.4f : 0f);
1179 float num2 = c.renderer.position.y - c.pos.Position(0).y + ((c.isChara && c.Chara._isLevitating) ? 0.4f : 0f);
1180 return num > num2 + 0.1f;
1181 }
bool _isLevitating
Definition: Chara.cs:134
ref Vector3 Position(int height)
Definition: Point.cs:536

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

8489 {
8490 int num = EClass.sources.hobbies.alias.TryGetValue(alias)?.id ?? 0;
8491 listHobby.Clear();
8492 if (_works == null || _hobbies == null)
8493 {
8494 RerollHobby();
8495 }
8496 foreach (int work in _works)
8497 {
8498 if (work == num)
8499 {
8500 return true;
8501 }
8502 }
8503 foreach (int hobby in _hobbies)
8504 {
8505 if (hobby == num)
8506 {
8507 return true;
8508 }
8509 }
8510 return false;
8511 }
static List< Hobby > listHobby
Definition: Chara.cs:13
void RerollHobby(bool extraSlotChance=true)
Definition: Chara.cs:8751
SourceHobby hobbies

References SourceManager.hobbies, and EClass.sources.

Referenced by AI_Idle.Run().

◆ HasMinion()

bool Chara.HasMinion ( string  id)
inline

Definition at line 2297 of file Chara.cs.

2298 {
2299 foreach (Chara chara in EClass._map.charas)
2300 {
2301 if (chara.c_uidMaster == base.uid)
2302 {
2303 return true;
2304 }
2305 }
2306 return false;
2307 }

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

Referenced by ActEffect.ProcAt().

◆ HealAll()

void Chara.HealAll ( )
inline

Definition at line 1699 of file Chara.cs.

1700 {
1701 Cure(CureType.HealComplete);
1702 base.hp = MaxHP;
1703 mana.value = mana.max;
1704 stamina.value = stamina.max;
1705 Refresh();
1706 }
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 4368 of file Chara.cs.

4369 {
4370 if (held == t || t.isDestroyed || t.Num <= 0)
4371 {
4372 return;
4373 }
4374 if (IsPC && t.isNPCProperty)
4375 {
4376 t.isNPCProperty = false;
4378 pos.TryWitnessCrime(this);
4379 }
4380 PickHeld();
4381 if (t.isChara)
4382 {
4384 {
4385 t.ShowEmo(Emo.love);
4386 }
4387 EClass.player.altHeldPos = t.renderer.data.ForceAltHeldPosition || EClass.rnd(2) == 0;
4388 }
4389 else
4390 {
4391 if (num == -1 || num > t.Num)
4392 {
4393 num = t.Num;
4394 }
4395 if (num < t.Num)
4396 {
4397 t = t.Split(num);
4398 }
4399 }
4400 if (t.GetRootCard() != this)
4401 {
4402 t = Pick(t.Thing, msg: false, tryStack: false);
4403 if (t.GetRootCard() != this)
4404 {
4405 return;
4406 }
4407 }
4408 held = t;
4409 if (held.GetLightRadius() > 0)
4410 {
4412 }
4413 if (IsPC)
4414 {
4416 WidgetHotbar.dirtyCurrentItem = true;
4417 }
4418 }
Thing Split(int a)
Definition: Card.cs:3382
bool isNPCProperty
Definition: Card.cs:540
void RecalculateFOV()
Definition: Card.cs:6151
virtual bool IsAliveInCurrentZone
Definition: Card.cs:2089
int GetLightRadius()
Definition: Card.cs:6193
void PickHeld(bool msg=false)
Definition: Chara.cs:4420
bool TryWitnessCrime(Chara criminal, Chara target=null, int radius=4, Func< Chara, bool > funcWitness=null)
Definition: Point.cs:861

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

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

◆ InitStats()

void Chara.InitStats ( bool  onDeserialize = false)
inline

Definition at line 8874 of file Chara.cs.

8875 {
8876 if (!onDeserialize)
8877 {
8878 _cints[10] = 20;
8879 _cints[11] = 70;
8880 _cints[13] = 70;
8881 _cints[14] = 70;
8882 _cints[15] = 70;
8883 _cints[17] = 0;
8884 _cints[18] = 0;
8885 }
8886 foreach (Condition condition in conditions)
8887 {
8888 condition.SetOwner(this, onDeserialize);
8889 }
8890 }
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 7306 of file Chara.cs.

7307 {
7308 if (t == null)
7309 {
7310 t = FindBestFoodToEat();
7311 }
7312 if (t == null)
7313 {
7314 t = things.Find((Thing a) => CanEat(a, shouldEat: true) && !a.c_isImportant);
7315 }
7316 if (t == null)
7317 {
7318 t = things.Find((Thing a) => CanEat(a) && !a.c_isImportant);
7319 }
7320 if (t != null)
7321 {
7322 Say("eat_start", this, t.Duplicate(1));
7323 if (sound)
7324 {
7325 PlaySound("eat");
7326 }
7327 FoodEffect.Proc(this, t);
7328 }
7329 }
Thing FindBestFoodToEat()
Definition: Chara.cs:7285
static void Proc(Chara c, Thing food, bool consume=true)
Definition: FoodEffect.cs:11

References Card.c_isImportant, and FoodEffect.Proc().

Referenced by InvOwner.OnClick(), ActEffect.Proc(), AI_Idle.Run(), and Tick().

◆ IsBranchMember()

bool Chara.IsBranchMember ( )
inline

Definition at line 6347 of file Chara.cs.

6348 {
6349 if (faction == EClass.Home)
6350 {
6351 return homeZone == EClass.game.activeZone;
6352 }
6353 return false;
6354 }
Faction faction
Definition: Chara.cs:425
Zone activeZone
Definition: Game.cs:248

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

◆ IsCriticallyWounded()

bool Chara.IsCriticallyWounded ( bool  includeRide = false)
inline

Definition at line 1159 of file Chara.cs.

1160 {
1161 if (host == null || includeRide)
1162 {
1163 if (Evalue(1421) <= 0)
1164 {
1165 return base.hp < MaxHP / 5;
1166 }
1167 return base.hp + mana.value < (MaxHP + mana.max) / 5;
1168 }
1169 return false;
1170 }

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

2442 {
2443 if (!currentZone.IsRegion && p.IsValid)
2444 {
2445 CellDetail detail = p.detail;
2446 if (detail != null && detail.charas.Count > 0)
2447 {
2448 foreach (Chara chara in p.detail.charas)
2449 {
2450 if (chara.IsHostile(this) || chara.IsHostile() || !chara.trait.CanBePushed)
2451 {
2452 if (cancelAI && EClass.pc.ai is GoalManualMove)
2453 {
2454 EClass.pc.ai.Cancel();
2455 }
2456 return true;
2457 }
2458 }
2459 }
2460 }
2461 return false;
2462 }
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, EClass.pc, and trait.

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

◆ IsEscorted()

bool Chara.IsEscorted ( )
inline

Definition at line 2341 of file Chara.cs.

2342 {
2343 if (!IsPCPartyMinion)
2344 {
2345 return false;
2346 }
2347 foreach (Quest item in EClass.game.quests.list)
2348 {
2349 if (item is QuestEscort questEscort && questEscort.uidChara == base.uid)
2350 {
2351 return true;
2352 }
2353 }
2354 return false;
2355 }
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 6391 of file Chara.cs.

6392 {
6393 if (base.IsPCFactionOrMinion || IsFriendOrAbove())
6394 {
6396 {
6397 return true;
6398 }
6399 }
6400 else if (IsHostile() && c.IsHostile())
6401 {
6402 return true;
6403 }
6404 return false;
6405 }

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

◆ IsGuest()

◆ IsHomeMember()

◆ IsHostile() [1/2]

◆ IsHostile() [2/2]

bool Chara.IsHostile ( Chara  c)
inline

Definition at line 6303 of file Chara.cs.

6304 {
6305 if (c == null)
6306 {
6307 return false;
6308 }
6309 if (base.IsPCFactionOrMinion)
6310 {
6311 if ((c == EClass.pc.enemy && !c.IsPCFactionOrMinion) || c.hostility <= Hostility.Enemy)
6312 {
6313 return true;
6314 }
6315 }
6316 else
6317 {
6319 {
6320 return true;
6321 }
6322 if (OriginalHostility >= Hostility.Friend)
6323 {
6324 if (c.hostility <= Hostility.Enemy && c.OriginalHostility == Hostility.Enemy)
6325 {
6326 return true;
6327 }
6328 }
6329 else if (OriginalHostility <= Hostility.Enemy && (c.IsPCFactionOrMinion || (c.OriginalHostility != Hostility.Enemy && c.hostility >= Hostility.Friend)))
6330 {
6331 return true;
6332 }
6333 }
6334 return false;
6335 }
bool IsCriminal
Definition: Player.cs:1293

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

◆ IsInHomeZone()

bool Chara.IsInHomeZone ( )
inline

Definition at line 6361 of file Chara.cs.

6362 {
6363 return EClass.game.activeZone == currentZone;
6364 }

Referenced by BaseListPeople.IsDisabled().

◆ IsInSpot< T >()

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

Definition at line 6366 of file Chara.cs.

6366 : TraitSpot
6367 {
6368 foreach (T item in EClass._map.props.installed.traits.List<T>())
6369 {
6370 foreach (Point item2 in item.ListPoints())
6371 {
6372 if (pos.Equals(item2))
6373 {
6374 return true;
6375 }
6376 }
6377 }
6378 return false;
6379 }
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 6337 of file Chara.cs.

6338 {
6339 return hostility == Hostility.Neutral;
6340 }

Referenced by ActPlan._Update().

◆ IsNeutralOrAbove()

bool Chara.IsNeutralOrAbove ( )
inline

◆ IsValidGiftWeight()

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

Definition at line 7878 of file Chara.cs.

7879 {
7880 int num2 = ((!HasElement(1411)) ? 1 : 3);
7881 if (GetBurden(t, num) >= num2)
7882 {
7883 return false;
7884 }
7885 return true;
7886 }
int GetBurden(Card t=null, int num=-1)
Definition: Chara.cs:1764

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

◆ Kick() [1/2]

void Chara.Kick ( Chara  t,
bool  ignoreSelf = false,
bool  karmaLoss = true,
bool  show = true,
bool  checkWall = true 
)
inline

Definition at line 5565 of file Chara.cs.

5566 {
5568 {
5569 return;
5570 }
5571 if (t.IsPC)
5572 {
5574 }
5575 if (t.host != null)
5576 {
5577 return;
5578 }
5579 if (t == this)
5580 {
5581 if (!ignoreSelf)
5582 {
5583 Debug.Log(t.pos.GetNearestPoint());
5584 if (TryMove(t.pos.GetNearestPoint()) != MoveResult.Success)
5585 {
5587 }
5588 }
5589 return;
5590 }
5591 if (show)
5592 {
5593 Say("kick", this, t);
5594 }
5595 PlaySound("kick");
5596 if ((t.conSuspend == null || t.conSuspend.uidMachine != 0) && t.trait.CanBePushed && (!t.IsHostile() || EClass.rnd(2) == 0) && !t.noMove && !t.isRestrained)
5597 {
5598 t.MoveByForce(t.pos.GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: true, ignoreCenter: true), this, checkWall && !t.pos.IsBlocked);
5599 }
5600 if (t.conSleep != null)
5601 {
5602 t.conSleep.Kill();
5603 }
5604 if (IsPC && t.IsFriendOrAbove() && !t.IsPCFactionOrMinion && karmaLoss)
5605 {
5607 }
5608 t.PlayEffect("kick");
5609 }
void ClearPlans()
Definition: AM_Adv.cs:426
static AM_Adv Adv
Definition: ActionMode.cs:15
void MoveImmediate(Point p, bool focus=true, bool cancelAI=true)
Definition: Card.cs:5638
ConSuspend conSuspend
Definition: Chara.cs:104
MoveResult TryMove(Point newPoint, bool allowDestroyPath=true)
Definition: Chara.cs:2665
int uidMachine
Definition: ConSuspend.cs:6

References ActionMode.Adv, TraitChara.CanBePushed, AM_Adv.ClearPlans(), conSleep, conSuspend, Debug, Point.GetNearestPoint(), host, Point.IsBlocked, IsFriendOrAbove(), IsHostile(), IsPC, Card.IsPCFactionOrMinion, Card.isRestrained, Condition.Kill(), Player.ModKarma(), MoveByForce(), Card.MoveImmediate(), Card.noMove, Card.PlayEffect(), EClass.player, Card.pos, EClass.rnd(), trait, and ConSuspend.uidMachine.

◆ Kick() [2/2]

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

Definition at line 5557 of file Chara.cs.

5558 {
5559 foreach (Chara item in p.ListCharas())
5560 {
5561 Kick(item, ignoreSelf, karmaLoss: true, show: true, checkWall);
5562 }
5563 }
List< Chara > ListCharas()
Definition: Point.cs:1155

References item, and Kick.

Referenced by Recipe.Build(), RecipeCard.Build(), Map.MineFloor(), TaskBuild.OnProgressComplete(), TraitGeneMachine.OnUse(), ActKick.Perform(), AI_Bladder.Run(), AI_Trolley.Run(), and ActThrow.Throw().

◆ ListAvailabeFeats()

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

Definition at line 9469 of file Chara.cs.

9470 {
9471 List<Element> list = new List<Element>();
9472 foreach (SourceElement.Row item in EClass.sources.elements.rows.Where((SourceElement.Row a) => a.group == "FEAT" && a.cost[0] != -1 && !a.categorySub.IsEmpty()))
9473 {
9475 int num = ((feat.ValueWithoutLink <= 0) ? 1 : (feat.ValueWithoutLink + 1));
9476 if (num <= feat.source.max && !feat.HasTag("class") && !feat.HasTag("hidden") && !feat.HasTag("innate") && (!pet || !feat.HasTag("noPet")) && (showAll || feat.IsPurchaseFeatReqMet(elements)))
9477 {
9478 list.Add(Element.Create(feat.id, num) as Feat);
9479 }
9480 }
9481 return list;
9482 }
int feat
Definition: Card.cs:360
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1100
Definition: FEAT.cs:274

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

8619 {
8620 listHobby.Clear();
8621 if (!useMemberType || memberType != FactionMemberType.Livestock)
8622 {
8623 if (_hobbies == null)
8624 {
8625 RerollHobby();
8626 }
8627 foreach (int hobby in _hobbies)
8628 {
8629 listHobby.Add(new Hobby
8630 {
8631 id = hobby
8632 });
8633 }
8634 }
8635 return listHobby;
8636 }

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

8592 {
8593 listHobby.Clear();
8594 if (useMemberType && memberType == FactionMemberType.Livestock)
8595 {
8596 listHobby.Add(new Hobby
8597 {
8598 id = 45
8599 });
8600 }
8601 else
8602 {
8603 if (_works == null)
8604 {
8605 RerollHobby();
8606 }
8607 foreach (int work in _works)
8608 {
8609 listHobby.Add(new Hobby
8610 {
8611 id = work
8612 });
8613 }
8614 }
8615 return listHobby;
8616 }

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

3480 {
3481 angle = Util.GetAngle(p.x - pos.x, p.z - pos.z);
3482 if (EClass._zone.IsRegion)
3483 {
3484 if (angle > 100f && angle < 170f)
3485 {
3486 base.dir = 2;
3487 }
3488 else if (angle > 170f && angle < 190f)
3489 {
3490 base.dir = 0;
3491 }
3492 else if (angle > 190f || (angle < -10f && angle > -100f))
3493 {
3494 base.dir = 3;
3495 }
3496 else
3497 {
3498 base.dir = 1;
3499 }
3500 angle -= 45f;
3501 }
3502 else if (angle > 170f && angle < 235f)
3503 {
3504 base.dir = 0;
3505 }
3506 else if (angle > 80f && angle < 145f)
3507 {
3508 base.dir = 1;
3509 }
3510 else if (angle > -100f && angle < -35f)
3511 {
3512 base.dir = 3;
3513 }
3514 else if (angle > -10f && angle < 55f)
3515 {
3516 base.dir = 2;
3517 }
3519 }

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

◆ MakeAlly()

void Chara.MakeAlly ( bool  msg = true)
inline

Definition at line 2232 of file Chara.cs.

2233 {
2234 if (IsLocalChara && !base.IsUnique)
2235 {
2236 Debug.Log("Creating Replacement NPC for:" + this);
2238 }
2239 _MakeAlly();
2240 if (msg)
2241 {
2242 EClass.pc.Say("hire", this);
2243 EClass.Sound.Play("good");
2244 }
2245 EClass.pc.party.AddMemeber(this);
2246 if (EClass._zone.IsTown)
2247 {
2249 }
2250 }
Chara CreateReplacement()
Definition: Chara.cs:7712
void _MakeAlly()
Definition: Chara.cs:2252
virtual bool IsTown
Definition: Zone.cs:220
void RefreshListCitizen()
Definition: Zone.cs:3446

References _MakeAlly(), EClass._map, EClass._zone, Party.AddMemeber(), CreateReplacement(), Map.deadCharas, Debug, IsLocalChara, Zone.IsTown, party, EClass.pc, Zone.RefreshListCitizen(), Card.Say(), and EClass.Sound.

Referenced by DramaOutcome.fiama_pet(), AI_Fuck.Finish(), DramaOutcome.melilith_friend(), DramaOutcome.nasu_join(), TraitDiary.OnRead(), TraitGiftNewYear.OnUse(), DramaOutcome.poppy_found(), ActRide.Ride(), DramaOutcome.sister_friend(), ActThrow.Throw(), and Religion.TryGetGift().

◆ MakeBraineCell()

Thing Chara.MakeBraineCell ( )
inline

Definition at line 7857 of file Chara.cs.

7858 {
7859 return DNA.GenerateGene(this, DNA.Type.Brain);
7860 }
Definition: DNA.cs:8
Type
Definition: DNA.cs:10
static Thing GenerateGene(Chara c, Type? type=null)
Definition: DNA.cs:104

References DNA.GenerateGene().

Referenced by CoreDebug.UpdateInput().

◆ MakeGene()

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

Definition at line 7852 of file Chara.cs.

7853 {
7854 return DNA.GenerateGene(this, type);
7855 }

References DNA.GenerateGene().

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

◆ MakeGrave()

void Chara.MakeGrave ( string  lastword)
inline

Definition at line 5049 of file Chara.cs.

5050 {
5051 if (!EClass._zone.IsRegion)
5052 {
5053 List<string> list = new List<string> { "930", "931", "947", "948", "949", "950", "951", "952" };
5054 if (IsPC && EClass.rnd(2) == 0 && EClass.pc.things.Find("letter_will") != null)
5055 {
5056 list = new List<string> { "944", "946", "backerGrave", "backerGrave2" };
5057 }
5058 Thing thing = ThingGen.Create(list.RandomItem());
5059 thing.MakeRefFrom(this);
5060 if (!lastword.IsEmpty())
5061 {
5062 thing.c_note = lastword;
5063 }
5064 thing.isModified = true;
5065 EClass._zone.AddCard(thing, pos).Install();
5066 }
5067 }
Card MakeRefFrom(string id)
Definition: Card.cs:5544

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

2287 {
2288 ReleaseMinion();
2289 Hostility hostility2 = (base.c_originalHostility = (_master.IsPCFaction ? Hostility.Ally : _master.hostility));
2290 this.hostility = hostility2;
2291 base.c_uidMaster = _master.uid;
2292 base.c_minionType = type;
2293 master = _master;
2294 Refresh();
2295 }
int uid
Definition: Card.cs:120

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

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

◆ MakePartyMemeber()

void Chara.MakePartyMemeber ( )
inline

Definition at line 2226 of file Chara.cs.

2227 {
2228 _MakeAlly();
2229 EClass.pc.party.AddMemeber(this);
2230 }

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

◆ ModAffinity()

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

Definition at line 7640 of file Chara.cs.

7641 {
7642 if (c == this)
7643 {
7644 return;
7645 }
7646 if (IsPC)
7647 {
7648 c.ModAffinity(EClass.pc, a, show);
7649 return;
7650 }
7651 int num = StatsHygiene.GetAffinityMod(EClass.pc.hygiene.GetPhase()) + (HasElement(417) ? 30 : 0) + (EClass.pc.HasCondition<ConSmoking>() ? (-30) : 0);
7652 if (IsPCFaction && homeBranch != null)
7653 {
7654 num += (int)Mathf.Sqrt(homeBranch.Evalue(2117)) * 5;
7655 }
7656 bool flag = a > 0;
7657 if (flag)
7658 {
7659 a = a * num / 100;
7660 if (affinity.GetLunchChance() > EClass.rnd(100) && GetInt(71) >= 0 && GetInt(71) < EClass.world.date.GetRaw())
7661 {
7662 SetInt(71, -1);
7663 }
7664 }
7665 if (show)
7666 {
7667 if (a == 0)
7668 {
7669 if (!showOnlyEmo)
7670 {
7671 Say("affinityNone", this, c);
7672 }
7673 }
7674 else
7675 {
7676 ShowEmo((!flag) ? Emo.angry : Emo.love);
7677 c.ShowEmo(flag ? Emo.love : Emo.sad);
7678 if (!showOnlyEmo)
7679 {
7680 Say(flag ? "affinityPlus" : "affinityMinus", this, c);
7681 }
7682 }
7683 }
7684 if (c.IsPC)
7685 {
7686 a = affinity.Mod(a);
7687 }
7688 }
int Mod(int a)
Definition: Affinity.cs:188
int GetLunchChance()
Definition: Affinity.cs:86
Stats hygiene
Definition: Chara.cs:1134
int GetRaw(int offsetHours=0)
Definition: Date.cs:322
int Evalue(int ele)
static int GetAffinityMod(int phase)
Definition: StatsHygiene.cs:19

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

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

◆ ModCorruption()

void Chara.ModCorruption ( int  a)
inline

Definition at line 9426 of file Chara.cs.

9427 {
9428 if (a > 0)
9429 {
9430 if (ResistLv(962) > 0 && EClass.rnd(ResistLv(962) + 1) != 0)
9431 {
9432 return;
9433 }
9434 int num = Evalue(412);
9435 if (num != 0)
9436 {
9437 float num2 = (float)a * 100f / (float)Mathf.Max(100 + num * 2, 10);
9438 a = (int)num2 + ((EClass.rndf(1f) < num2 % 1f) ? 1 : 0);
9439 }
9440 }
9441 if (a == 0)
9442 {
9443 return;
9444 }
9445 int num3 = (corruption + a) / 100 - corruption / 100;
9446 for (int i = 0; i < Mathf.Abs(num3); i++)
9447 {
9448 if (!MutateRandom((num3 > 0) ? 1 : (-1), 100, ether: true))
9449 {
9450 break;
9451 }
9452 }
9453 corruption += a;
9454 int num4 = 0;
9455 foreach (Element value in elements.dict.Values)
9456 {
9457 if (value.source.category == "ether")
9458 {
9459 num4 += value.Value;
9460 }
9461 }
9462 if (num4 > 0 && IsPC)
9463 {
9464 Tutorial.Reserve("ether");
9465 }
9466 corruption = num4 * 100 + corruption % 100;
9467 }
bool MutateRandom(int vec=0, int tries=100, bool ether=false, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:9572
int corruption
Definition: Chara.cs:375
static float rndf(float a)
Definition: EClass.cs:92

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

9384 {
9385 if (!HasElement(450))
9386 {
9387 int height = bio.height;
9388 height = height * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
9389 if (height < 1)
9390 {
9391 height = 1;
9392 }
9393 if (height != bio.height)
9394 {
9395 bio.height = height;
9396 Say((a > 0) ? "height_gain" : "height_lose", this);
9397 }
9398 }
9399 }
int height
Definition: Biography.cs:53

◆ ModTempElement()

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

Definition at line 9825 of file Chara.cs.

9826 {
9827 if (a < 0 && !naturalDecay && HasElement(EClass.sources.elements.alias["sustain_" + EClass.sources.elements.map[ele].alias]?.id ?? 0))
9828 {
9829 return;
9830 }
9831 bool flag = HasElement(1215);
9832 if (tempElements == null)
9833 {
9835 tempElements.SetParent(this);
9836 }
9837 if (a > 0 && flag)
9838 {
9839 a = a * 150 / 100;
9840 }
9841 int num = elements.ValueWithoutLink(ele);
9842 int num2 = Mathf.Abs(num) + 100;
9843 int num3 = num2 / (flag ? 2 : 4);
9844 int num4 = -num - 100;
9845 int num5 = tempElements.Base(ele);
9846 int num6 = num5 + a;
9847 if (onlyRenew)
9848 {
9849 num3 = Mathf.Min(a, num3);
9850 num4 = Mathf.Max(a, -num2 / 3);
9851 }
9852 if (a > 0 && num6 > num3)
9853 {
9854 a = ((num3 > num5) ? (num3 - num5) : 0);
9855 }
9856 if (a < 0 && num6 < num4)
9857 {
9858 a = ((num4 < num5) ? (num4 - num5) : 0);
9859 }
9860 Element element = tempElements.ModBase(ele, a);
9861 if (element.vBase == 0)
9862 {
9863 tempElements.Remove(element.id);
9864 if (tempElements.dict.Count == 0)
9865 {
9866 tempElements = null;
9867 }
9868 }
9869 }
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 9401 of file Chara.cs.

9402 {
9403 if (HasElement(450) || a == 0)
9404 {
9405 return;
9406 }
9407 int weight = bio.weight;
9408 int height = bio.height;
9409 int num = height * height * 18 / 25000;
9410 int num2 = height * height * 24 / 10000;
9411 if (ignoreLimit || (weight > num && weight < num2))
9412 {
9413 weight = weight * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
9414 if (weight < 1)
9415 {
9416 weight = 1;
9417 }
9418 if (weight != bio.weight)
9419 {
9420 bio.weight = weight;
9421 Say((a > 0) ? "weight_gain" : "weight_lose", this);
9422 }
9423 }
9424 }
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 2555 of file Chara.cs.

2556 {
2557 if (!newPoint.sourceBlock.tileType.IsBlockPass && (!checkWall || (Dist(newPoint) <= 1 && CanMoveTo(newPoint, allowDestroyPath: false))) && _Move(newPoint, MoveType.Force) == MoveResult.Success && ai.Current.CancelWhenMoved)
2558 {
2559 ai.Current.TryCancel(c);
2560 }
2561 }
bool TryCancel(Card c)
Definition: AIAct.cs:266
virtual bool CancelWhenMoved
Definition: AIAct.cs:96
override MoveResult _Move(Point newPoint, MoveType type=MoveType.Walk)
Definition: Chara.cs:2689

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

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

◆ MoveHome() [1/2]

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

Definition at line 3390 of file Chara.cs.

3391 {
3392 MoveHome(EClass.game.world.FindZone(id), x, z);
3393 }
void MoveHome(string id, int x=-1, int z=-1)
Definition: Chara.cs:3390
new World world
Definition: Game.cs:173

References Spatial.FindZone(), EClass.game, and Game.world.

Referenced by OnBanish(), Zone_Nymelle.OnBeforeSimulate(), QuestVernis.OnChangePhase(), QuestDialog.OnDropReward(), and DramaOutcome.QuestExploration_AfterComplete().

◆ MoveHome() [2/2]

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

Definition at line 3395 of file Chara.cs.

3396 {
3397 if (isDead)
3398 {
3399 Revive();
3400 }
3401 else
3402 {
3403 Cure(CureType.Death);
3404 }
3405 CureCondition<ConSuspend>();
3406 if (IsPCParty)
3407 {
3409 }
3410 FactionBranch factionBranch = homeBranch;
3411 if (x == -1)
3412 {
3413 x = 50;
3414 }
3415 if (z == -1)
3416 {
3417 z = 50;
3418 }
3419 Point point = new Point(x, z);
3420 if (zone.IsActiveZone)
3421 {
3422 point = point.GetNearestPoint(allowBlock: false, allowChara: false);
3423 }
3424 zone.AddCard(this, point);
3425 SetHomeZone(zone);
3426 global.transition = new ZoneTransition
3427 {
3428 state = ZoneTransition.EnterState.Dead,
3429 x = point.x,
3430 z = point.z
3431 };
3432 orgPos = new Point(x, z);
3433 if (factionBranch != null)
3434 {
3436 factionBranch.policies.Validate();
3437 }
3438 }
void RefreshWorkElements(ElementContainer parent=null)
Definition: Chara.cs:8657
Chara SetHomeZone(Zone zone)
Definition: Chara.cs:1409
PolicyManager policies
bool IsActiveZone
Definition: Zone.cs:490

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

2538 {
2539 List<Point> list = new List<Point>();
2540 pos.ForeachNeighbor(delegate(Point p)
2541 {
2542 list.Add(p.Copy());
2543 });
2544 list.Shuffle();
2545 foreach (Point item in list)
2546 {
2547 if (!item.Equals(pos) && !item.HasChara && TryMove(item) == MoveResult.Success)
2548 {
2549 return true;
2550 }
2551 }
2552 return false;
2553 }
void ForeachNeighbor(Action< Point > action, bool diagonal=true)
Definition: Point.cs:1381

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

Referenced by AI_Idle.Run().

◆ MoveRandom()

bool Chara.MoveRandom ( )
inline

Definition at line 2523 of file Chara.cs.

2524 {
2525 Point randomNeighbor = pos.GetRandomNeighbor();
2526 if (!randomNeighbor.Equals(pos) && !randomNeighbor.HasChara && HasAccess(randomNeighbor))
2527 {
2528 if ((race.tag.Contains("water") || source.tag.Contains("water")) && pos.cell.IsTopWaterAndNoSnow && !randomNeighbor.IsDeepWater)
2529 {
2530 return false;
2531 }
2532 return TryMove(randomNeighbor) == MoveResult.Success;
2533 }
2534 return false;
2535 }
bool IsTopWaterAndNoSnow
Definition: Cell.cs:712
bool IsDeepWater
Definition: Point.cs:264

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

3279 {
3280 if (z == currentZone)
3281 {
3282 return;
3283 }
3284 if (HasCondition<ConInvulnerable>())
3285 {
3286 RemoveCondition<ConInvulnerable>();
3287 }
3288 if (IsPC)
3289 {
3290 EClass.player.nextZone = z;
3292 {
3295 {
3296 if (EClass.player.returnInfo != null)
3297 {
3298 EClass.player.returnInfo.turns += 5;
3299 }
3301 {
3302 EClass.game.Save(isAutoSave: true);
3303 }
3304 }
3305 EClass.player.deathZoneMove = false;
3306 }
3308 if (currentZone.instance != null)
3309 {
3311 z = EClass.game.spatials.Find(instance.uidZone) ?? EClass.pc.homeZone;
3312 transition = new ZoneTransition
3313 {
3314 state = instance.ReturnState,
3315 x = instance.x,
3316 z = instance.z
3317 };
3318 instance.OnLeaveZone();
3319 Debug.Log(z);
3320 }
3321 EInput.Consume(consumeAxis: true);
3322 EClass.player.uidLastZone = currentZone.uid;
3324 {
3326 {
3327 Msg.Say("enterZone", z.Name);
3328 }
3329 else
3330 {
3331 if (z.IsRegion)
3332 {
3333 Msg.Say("leaveZone", currentZone.Name);
3334 }
3335 else if (z.id != currentZone.id)
3336 {
3337 Msg.Say("enterZone", z.Name);
3338 }
3339 EClass.player.lastZonePos = pos.Copy();
3340 }
3341 EClass.player.lastTransition = transition;
3342 }
3343 foreach (Chara item in EClass._map.charas.Where((Chara c) => c.IsPCPartyMinion && c.master != EClass.pc).ToList())
3344 {
3346 }
3347 EClass.player.listSummon = EClass._map.charas.Where((Chara c) => c.c_uidMaster != 0 && c.FindMaster() == EClass.pc && c.c_minionType == MinionType.Default).ToList();
3348 foreach (Chara item2 in EClass.player.listSummon)
3349 {
3350 EClass._zone.RemoveCard(item2);
3351 }
3352 }
3353 if (party != null && party.leader == this)
3354 {
3355 foreach (Chara member in party.members)
3356 {
3357 if (member != this && !member.isDead && member.parent is Zone)
3358 {
3359 member.MoveZone(z);
3360 }
3361 }
3362 }
3363 if (global == null)
3364 {
3365 Debug.Log(base.Name);
3366 return;
3367 }
3368 transition.uidLastZone = currentZone?.uid ?? 0;
3369 global.transition = transition;
3370 if (z.IsActiveZone)
3371 {
3372 Point spawnPos = z.GetSpawnPos(this);
3373 global.transition = null;
3374 if (IsPC)
3375 {
3376 EClass.player.lastTransition = null;
3377 }
3378 z.AddCard(this, spawnPos);
3379 if (IsBranchMember())
3380 {
3382 }
3383 }
3384 else
3385 {
3386 z.AddCard(this);
3387 }
3388 }
MinionType c_minionType
Definition: Card.cs:962
bool IsBranchMember()
Definition: Chara.cs:6347
GlobalData global
Definition: Chara.cs:76
Chara FindMaster()
Definition: Chara.cs:2332
bool ignoreAutoSave
Definition: CoreDebug.cs:126
bool Save(bool isAutoSave=false, bool silent=false)
Definition: Game.cs:1020
RoomManager rooms
Definition: Map.cs:31
Chara leader
Definition: Party.cs:30
bool deathZoneMove
Definition: Player.cs:1125
List< Chara > listSummon
Definition: Player.cs:1177
ReturnInfo returnInfo
Definition: Player.cs:825
bool simulatingZone
Definition: Player.cs:1135
void AssignCharas()
Definition: RoomManager.cs:39
int uid
Definition: Spatial.cs:70
string id
Definition: Spatial.cs:13
virtual ZoneTransition.EnterState ReturnState
Definition: ZoneInstance.cs:26
virtual void OnLeaveZone()
Definition: ZoneInstance.cs:36
virtual bool WillAutoSave
Definition: Zone.cs:258
Point GetSpawnPos(Chara c, ZoneTransition.EnterState destState=ZoneTransition.EnterState.Auto)
Definition: Zone.cs:1321

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

◆ MoveZone() [3/3]

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

Definition at line 3270 of file Chara.cs.

3271 {
3273 {
3274 state = state
3275 });
3276 }

◆ MutateRandom()

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

Definition at line 9572 of file Chara.cs.

9573 {
9574 if (!ether && vec >= 0 && HasElement(406) && EClass.rnd(5) != 0)
9575 {
9576 Say("resistMutation", this);
9577 return false;
9578 }
9579 IEnumerable<SourceElement.Row> ie = EClass.sources.elements.rows.Where((SourceElement.Row a) => a.category == (ether ? "ether" : "mutation") && !a.tag.Contains("noRandomMutation"));
9580 for (int i = 0; i < tries; i++)
9581 {
9582 SourceElement.Row row = ie.RandomItem();
9583 if (i == 0 && vec < 0 && ether && base.c_corruptionHistory != null && base.c_corruptionHistory.Count > 0)
9584 {
9585 row = EClass.sources.elements.map[base.c_corruptionHistory.LastItem()];
9586 base.c_corruptionHistory.RemoveAt(base.c_corruptionHistory.Count - 1);
9587 if (base.c_corruptionHistory.Count == 0)
9588 {
9589 base.c_corruptionHistory = null;
9590 }
9591 }
9592 Element element = elements.GetElement(row.id);
9593 int num = 1;
9594 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))
9595 {
9596 continue;
9597 }
9598 if (element == null && !row.aliasParent.IsEmpty() && elements.Has(row.aliasParent))
9599 {
9600 row = EClass.sources.elements.alias[row.aliasParent];
9601 element = elements.GetElement(row.id);
9602 }
9603 bool flag = row.tag.Contains("neg");
9604 if (vec > 0)
9605 {
9606 if ((state >= BlessedState.Blessed && flag) || (state <= BlessedState.Cursed && !flag))
9607 {
9608 continue;
9609 }
9610 }
9611 else if (vec < 0 && ((state >= BlessedState.Blessed && !flag) || (state <= BlessedState.Cursed && flag)))
9612 {
9613 continue;
9614 }
9615 bool flag2 = true;
9616 if (element != null)
9617 {
9618 num = element.Value + ((vec != 0) ? vec : ((EClass.rnd(2) == 0) ? 1 : (-1)));
9619 if (num > element.source.max)
9620 {
9621 num = element.source.max - 1;
9622 }
9623 flag = (flag && num > element.Value) || (!flag && num < element.Value);
9624 flag2 = num > element.Value;
9625 if (vec > 0 && !flag2)
9626 {
9627 continue;
9628 }
9629 }
9630 Say(flag2 ? "mutation_gain" : "mutation_loose", this);
9631 SetFeat(row.id, num);
9632 if (flag2 && ether)
9633 {
9634 if (base.c_corruptionHistory == null)
9635 {
9636 base.c_corruptionHistory = new List<int>();
9637 }
9638 base.c_corruptionHistory.Add(row.id);
9639 if (IsPCFaction)
9640 {
9641 Element element2 = elements.GetElement(row.id);
9642 WidgetPopText.Say("popEther".lang(element2.Name, base.Name));
9643 }
9645 {
9646 EClass.player.flags.gotEtherDisease = true;
9647 Thing thing = ThingGen.Create("parchment");
9648 thing.SetStr(53, "letter_ether");
9649 Thing thing2 = ThingGen.Create("1165");
9650 thing2.SetBlessedState(BlessedState.Normal);
9651 Thing p = ThingGen.CreateParcel(null, thing2, thing);
9653 }
9654 }
9655 if (EClass.core.IsGameStarted && pos != null)
9656 {
9657 PlaySound(ether ? "mutation_ether" : "mutation");
9658 PlayEffect("mutation");
9660 Say(row.GetText(flag ? "textDec" : "textInc", returnNull: true) ?? row.alias, this);
9661 }
9662 return true;
9663 }
9664 Say("nothingHappens");
9665 return false;
9666 }
void SetStr(int id, string value=null)
Definition: BaseCard.cs:63
virtual void SetBlessedState(BlessedState s)
Definition: Card.cs:3793
bool IsGameStarted
Definition: Core.cs:84
bool Has(int ele)
Color MutateBad
Definition: MsgColors.cs:21
Color MutateGood
Definition: MsgColors.cs:19
bool gotEtherDisease
Definition: Player.cs:458
static Thing CreateParcel(string idLang=null, params Thing[] things)
Definition: ThingGen.cs:42
void SendPackage(Thing p)
Definition: World.cs:68

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

◆ OnAdvanceDay()

void Chara.OnAdvanceDay ( )
inline

Definition at line 9718 of file Chara.cs.

9719 {
9720 if (_historyFood != null)
9721 {
9722 while (_historyFood.Count > 5)
9723 {
9724 _historyFood.RemoveAt(_historyFood.Count - 1);
9725 }
9726 if (_historyFood[0].Count > 0)
9727 {
9728 _historyFood.Insert(0, new List<string>());
9729 }
9730 }
9731 }

Referenced by GameDate.AdvanceDay().

◆ OnBanish()

void Chara.OnBanish ( )
inline

Definition at line 1423 of file Chara.cs.

1424 {
1425 if (!IsGlobal)
1426 {
1427 return;
1428 }
1429 memberType = FactionMemberType.Default;
1430 foreach (Thing item in things.List((Thing a) => a.HasTag(CTAG.godArtifact)).ToList())
1431 {
1433 }
1434 UniqueData uniqueData = base.c_uniqueData;
1435 if (uniqueData != null)
1436 {
1437 Debug.Log(uniqueData.uidZone + "/" + EClass.game.spatials.map.ContainsKey(uniqueData.uidZone) + "/" + uniqueData.x + "/" + uniqueData.y);
1438 }
1439 if (uniqueData != null && EClass.game.spatials.map.ContainsKey(uniqueData.uidZone))
1440 {
1441 MoveHome(EClass.game.spatials.map[uniqueData.uidZone] as Zone, uniqueData.x, uniqueData.y);
1442 return;
1443 }
1444 Zone z = EClass.game.spatials.Find("somewhere");
1445 if (trait is TraitAdventurer)
1446 {
1447 z = EClass.world.region.ListTowns().RandomItem();
1448 SetHomeZone(z);
1449 }
1450 MoveZone(z, ZoneTransition.EnterState.RandomVisit);
1451 }
void PickOrDrop(Point p, string idThing, int idMat=-1, int num=1, bool msg=true)
Definition: Chara.cs:4184
List< Zone > ListTowns()
Definition: Region.cs:268
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 1490 of file Chara.cs.

1491 {
1492 if (source.job == "*r")
1493 {
1494 base.c_idJob = EClass.sources.jobs.rows.Where((SourceJob.Row j) => j.playable < 4).RandomItem().id;
1495 }
1496 if (bp.idJob != null)
1497 {
1498 base.c_idJob = bp.idJob;
1499 }
1500 if (bp.idRace != null)
1501 {
1502 base.c_idRace = bp.idRace;
1503 }
1504 }
CardBlueprint bp
Definition: Card.cs:75
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 1506 of file Chara.cs.

1507 {
1508 if (source.tag.Contains("boss"))
1509 {
1510 bossText = true;
1511 }
1512 int num = ((bp.lv != -999) ? bp.lv : base.LV);
1513 if (trait.AdvType == TraitChara.Adv_Type.Adv || trait.AdvType == TraitChara.Adv_Type.Adv_Fairy)
1514 {
1515 if (ListAdvRace.Count == 0)
1516 {
1517 ListAdvRace = EClass.sources.races.rows.Where((SourceRace.Row a) => a.playable <= 1 && a.id != "fairy").ToList();
1518 ListAdvJob = EClass.sources.jobs.rows.Where((SourceJob.Row a) => a.playable <= 4).ToList();
1519 }
1520 if (trait.AdvType == TraitChara.Adv_Type.Adv)
1521 {
1522 base.c_idRace = ListAdvRace.RandomItem().id;
1523 }
1524 base.c_idJob = ListAdvJob.RandomItem().id;
1525 _race = null;
1526 _job = null;
1527 num = 10 + EClass.rnd(40);
1528 ChangeMaterial(race.material, ignoreFixedMaterial: true);
1529 }
1530 bio = new Biography();
1531 bio.Generate(this);
1532 if (source.idActor.Length != 0 && source.idActor[0] == "pcc" && pccData == null)
1533 {
1534 pccData = PCCData.Create(IDPCCBodySet);
1535 if (source.idActor.Length > 2)
1536 {
1537 pccData.SetPart("body", IDPCCBodySet, source.idActor[2]);
1538 }
1539 else
1540 {
1541 pccData.Randomize(IDPCCBodySet);
1542 }
1543 }
1544 if (source.mainElement.Length != 0)
1545 {
1546 int _genLv = Mathf.Min(genLv, 100);
1547 List<Tuple<string, int, int>> list = new List<Tuple<string, int, int>>();
1548 string[] mainElement = source.mainElement;
1549 for (int i = 0; i < mainElement.Length; i++)
1550 {
1551 string[] array = mainElement[i].Split('/');
1552 SourceElement.Row row = EClass.sources.elements.alias["ele" + array[0]];
1553 int num2 = source.LV * row.eleP / 100;
1554 if (list.Count == 0 || num2 < _genLv || array[0] == bp.idEle)
1555 {
1556 list.Add(new Tuple<string, int, int>(array[0], (array.Length > 1) ? int.Parse(array[1]) : 0, num2));
1557 }
1558 }
1559 Tuple<string, int, int> tuple = list.RandomItemWeighted((Tuple<string, int, int> a) => 10000 / (100 + (_genLv - a.Item3) * 25));
1560 if (!bp.idEle.IsEmpty())
1561 {
1562 tuple = list.Where((Tuple<string, int, int> a) => a.Item1 == bp.idEle || "ele" + a.Item1 == bp.idEle).FirstOrDefault() ?? tuple;
1563 }
1564 SetMainElement(tuple.Item1, (tuple.Item2 == 0) ? 10 : tuple.Item2, elemental: true);
1565 if (list.Count >= 2)
1566 {
1567 num = tuple.Item3 + base.LV - source.LV;
1568 }
1569 }
1570 if (source.name == "*r")
1571 {
1572 base.c_altName = NameGen.getRandomName();
1573 }
1574 if (source.GetText("aka") == "*r" || trait.UseRandomAlias)
1575 {
1576 _alias = AliasGen.GetRandomAlias();
1577 }
1578 happiness = EClass.rnd(100);
1579 contribution = EClass.rnd(100);
1580 RerollHobby();
1581 _idTimeTable = ((EClass.rnd(5) == 0) ? 1 : 0);
1582 ApplyRace();
1583 ApplyJob();
1584 if (num != source.LV)
1585 {
1586 SetLv(num);
1587 }
1588 if (base.LV > 5 && race.id == "mutant")
1589 {
1590 for (int j = 0; j < Mathf.Min(1 + base.LV / 5, 22); j++)
1591 {
1592 SetFeat(1644, j + 1);
1593 }
1594 }
1595 InitStats();
1596 body.SetOwner(this);
1598 if (race.EQ.Length != 0 || !source.equip.IsEmpty())
1599 {
1600 TryRestock(onCreate: true);
1601 }
1602 switch (id)
1603 {
1604 case "golem_wood":
1605 ChangeMaterial("pine");
1606 break;
1607 case "golem_steel":
1608 ChangeMaterial("steel");
1609 break;
1610 case "golem_gold":
1611 ChangeMaterial("gold");
1612 break;
1613 case "dodo":
1614 base.idSkin = EClass.rnd(4);
1615 break;
1616 case "putty_snow":
1617 if (EClass.rnd(100) == 0 || EClass.debug.enable)
1618 {
1619 base.idSkin = EClass.rnd(4);
1620 }
1621 break;
1622 case "snail":
1623 base.idSkin = 5;
1624 break;
1625 case "olderyoungersister":
1626 base.idSkin = 1;
1627 break;
1628 case "sister_undead":
1629 case "dog":
1630 case "cat":
1631 base.idSkin = EClass.rnd(sourceCard.tiles.Length);
1632 if (id == "sister_undead" && EClass.rnd(10) == 0)
1633 {
1635 if (row2 != null && (!EClass.player.doneBackers.Contains(row2.id) || EClass.core.config.test.ignoreBackerDestoryFlag))
1636 {
1637 ApplyBacker(row2.id);
1638 }
1639 }
1640 break;
1641 case "baby":
1642 case "ika":
1643 SetFeat(1232, 3);
1644 break;
1645 }
1646 if (HasTag(CTAG.random_color))
1647 {
1648 DyeRandom();
1649 }
1650 SetAI(new NoGoal());
1651 if (!source.faith.IsEmpty())
1652 {
1653 SetFaith(source.faith);
1654 }
1655 else if (EClass.game.activeZone != null && EClass.game.activeZone.id == "foxtown")
1656 {
1658 }
1659 else if (EClass.game.activeZone != null && EClass.game.activeZone.id == "foxtown_nefu")
1660 {
1662 }
1663 else
1664 {
1665 SetFaith(EClass.game.religions.GetRandomReligion(onlyJoinable: true, EClass.rnd(10) == 0));
1666 }
1667 _affinity = 0;
1668 interest = 100;
1671 Refresh();
1672 stamina.value = stamina.max;
1673 mana.value = mana.max;
1674 isCreated = true;
1675 }
static int indexSister
void Generate(Chara c)
Definition: Biography.cs:319
void ClampInitialSkill()
Definition: Card.cs:2895
void DyeRandom()
Definition: Card.cs:5790
void ApplyBacker(int bid)
Definition: Card.cs:6762
void SetOwner(Chara chara, bool deserialized=false)
Definition: CharaBody.cs:18
string IDPCCBodySet
Definition: Chara.cs:489
int _affinity
Definition: Chara.cs:301
void SetMainElement(string id, int v=0, bool elemental=false)
Definition: Chara.cs:2031
int happiness
Definition: Chara.cs:108
int contribution
Definition: Chara.cs:18
void CalculateMaxStamina()
Definition: Chara.cs:1963
bool isCreated
Definition: Chara.cs:136
int _idTimeTable
Definition: Chara.cs:339
void TryRestock(bool onCreate)
Definition: Chara.cs:4579
static List< SourceRace.Row > ListAdvRace
Definition: Chara.cs:164
void InitStats(bool onDeserialize=false)
Definition: Chara.cs:8874
bool bossText
Definition: Chara.cs:144
static List< SourceJob.Row > ListAdvJob
Definition: Chara.cs:166
bool ignoreBackerDestoryFlag
Definition: CoreConfig.cs:557
bool enable
Definition: CoreDebug.cs:286
ReligionTrickery Trickery
Religion GetRandomReligion(bool onlyJoinable=true, bool includeMinor=false)
int[] tiles
Definition: RenderRow.cs:10
List< Row > listSister
Definition: SourceBacker.cs:79
SourceRace races
virtual Adv_Type AdvType
Definition: TraitChara.cs:99
virtual bool UseRandomAlias
Definition: TraitChara.cs:127

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

◆ OnDeserialized()

override void Chara.OnDeserialized ( )
inlineprotectedvirtual

Reimplemented from Card.

Definition at line 1309 of file Chara.cs.

1310 {
1311 isCreated = true;
1312 _cbits1.Bits = (uint)_cints[0];
1313 InitStats(onDeserialize: true);
1314 body.SetOwner(this, deserialized: true);
1315 elements.ApplyElementMap(base.uid, SourceValueType.Chara, job.elementMap, base.DefaultLV);
1316 elements.ApplyElementMap(base.uid, SourceValueType.Chara, race.elementMap, base.DefaultLV);
1317 if (global != null && global.goal != null)
1318 {
1319 global.goal.SetOwner(this);
1320 }
1321 if (IsPCC)
1322 {
1323 pccData.state = (base.isCensored ? PCCState.Naked : PCCState.Normal);
1324 }
1325 if (tempElements != null)
1326 {
1327 tempElements.SetParent(this);
1328 }
1329 UpdateAngle();
1331 Refresh();
1332 if (source.tag.Contains("boss"))
1333 {
1334 bossText = true;
1335 }
1336 sharedCheckTurn = EClass.rnd(200);
1337 }
int sharedCheckTurn
Definition: Chara.cs:118
void UpdateAngle()
Definition: Chara.cs:3521
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 8056 of file Chara.cs.

8057 {
8058 Say("give_erohon", this);
8059 AddCondition<ConParalyze>(50, force: true);
8060 AddCondition<ConConfuse>(50, force: true);
8061 AddCondition<ConFear>(1000, force: true);
8062 ModAffinity(EClass.pc, 100);
8063 t.Destroy();
8064 Talk("pervert");
8065 }

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

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

◆ OnInsulted()

void Chara.OnInsulted ( )
inline

Definition at line 7862 of file Chara.cs.

7863 {
7864 if (!isDead)
7865 {
7866 if (HasElement(1231))
7867 {
7868 Talk("insulted");
7869 AddCondition<ConEuphoric>(100 * Evalue(1231));
7870 }
7871 else if (EClass.rnd(20) == 0)
7872 {
7873 SetFeat(1231, 1, msg: true);
7874 }
7875 }
7876 }

References EClass.rnd().

Referenced by DramaManager.ParseLine(), and AI_Idle.Run().

◆ OnSerializing()

override void Chara.OnSerializing ( )
inlineprotectedvirtual

Reimplemented from Card.

Definition at line 1294 of file Chara.cs.

1295 {
1296 if (enemy != null)
1297 {
1298 SetInt(55, enemy.uid);
1299 }
1300 _cints[0] = (int)_cbits1.Bits;
1301 List<BodySlot> slots = body.slots;
1302 rawSlots = new int[slots.Count];
1303 for (int i = 0; i < slots.Count; i++)
1304 {
1305 rawSlots[i] = slots[i].elementId;
1306 }
1307 }
List< BodySlot > slots
Definition: CharaBody.cs:8
int[] rawSlots
Definition: Chara.cs:73
BitArray32 _cbits1
Definition: Chara.cs:84
uint Bits
Definition: BitArray32.cs:6

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

◆ OnSleep() [1/2]

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

Definition at line 9357 of file Chara.cs.

9358 {
9359 if (days < 1)
9360 {
9361 days = 1;
9362 }
9363 int num = power * days;
9364 if (stamina.value < 0)
9365 {
9366 stamina.Set(1);
9367 }
9368 HealHP(num);
9369 stamina.Mod(10 + 25 * num / 100 * (100 + elements.GetFeatRef(1642)) / 100);
9370 mana.Mod(num);
9371 if (IsPCFaction)
9372 {
9373 hunger.Mod(20);
9374 }
9375 sleepiness.Set(0);
9376 if (!IsMinion)
9377 {
9378 interest = 100;
9379 }
9380 Cure(CureType.Sleep, power);
9381 }
virtual void HealHP(int a, HealSource origin=HealSource.None)
Definition: Card.cs:3901
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 9342 of file Chara.cs.

9343 {
9344 TraitPillow traitPillow = pos.FindThing<TraitPillow>();
9345 int num = bed?.Power ?? 20;
9346 if (traitPillow != null)
9347 {
9348 num += traitPillow.owner.Power / 2;
9349 }
9350 if (bed != null)
9351 {
9352 num += bed.Evalue(750) * 5;
9353 }
9354 OnSleep(num, days);
9355 }
void OnSleep(Thing bed=null, int days=1)
Definition: Chara.cs:9342
Thing FindThing(Func< Thing, bool > func)
Definition: Point.cs:1124

References bed.

Referenced by LayerSleep.Advance().

◆ ParseBodySlot()

int Chara.ParseBodySlot ( string  s)
inlineprivate

Definition at line 2130 of file Chara.cs.

2131 {
2132 return s switch
2133 {
2134 "é ­" => 30,
2135 "首" => 31,
2136 "体" => 32,
2137 "背" => 33,
2138 "手" => 35,
2139 "指" => 36,
2140 "è…•" => 34,
2141 "è…°" => 37,
2142 "è¶³" => 39,
2143 _ => -1,
2144 };
2145 }

Referenced by ApplyRace(), and ResetBody().

◆ PerformWork()

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

Definition at line 8832 of file Chara.cs.

8833 {
8834 Hobby hobby = new Hobby();
8835 hobby.id = session.id;
8836 WorkSummary workSummary = _workSummary;
8837 hobby.GetAI(this).OnPerformWork(IsRealTime);
8838 if (!isHobby)
8839 {
8840 workSummary.progress += EClass.rnd(5) + 5;
8841 }
8842 int num = PerformWork(hobby, 0, isHobby);
8843 int num2 = PerformWork(hobby, 1, isHobby);
8844 int num3 = PerformWork(hobby, 2, isHobby);
8845 int num4 = PerformWork(hobby, 3, isHobby);
8846 workSummary.money += num;
8847 workSummary.food += num2;
8848 workSummary.knowledge += num3;
8849 workSummary.material += num4;
8850 int PerformWork(Hobby work, int idx, bool isHobby)
8851 {
8852 if (idx >= work.source.resources.Length)
8853 {
8854 return 0;
8855 }
8856 int num5 = work.source.resources[idx];
8857 int num6 = num5;
8858 num5 = Rand.Range(num5 * (100 - work.source.resources[idx]) / 100, num5);
8859 num5 = num5 * (isHobby ? 50 : 100) * session.efficiency / 10000;
8860 if (num6 > 0 && num5 <= 0)
8861 {
8862 num5 = 1;
8863 }
8864 return num5;
8865 }
8866 }
virtual void OnPerformWork(bool realtime)
Definition: AIWork.cs:150
void PerformWork(WorkSession session, bool isHobby=false, bool IsRealTime=false)
Definition: Chara.cs:8832
AIWork GetAI(Chara c)
Definition: Hobby.cs:12
static int Range(int min, int max)
Definition: Rand.cs:42
int efficiency
Definition: WorkSession.cs:28

References WorkSession.efficiency, Hobby.GetAI(), WorkSession.id, if(), AIWork.OnPerformWork(), Rand.Range(), EClass.rnd(), and Hobby.source.

◆ Pick()

Thing Chara.Pick ( Thing  t,
bool  msg = true,
bool  tryStack = true 
)
inline

Definition at line 4204 of file Chara.cs.

4205 {
4206 if (t.trait is TraitCard && t.isNew && EClass.game.config.autoCollectCard && !t.c_idRefCard.IsEmpty())
4207 {
4209 return t;
4210 }
4211 if (t.parent == this)
4212 {
4213 return t;
4214 }
4215 t = TryPoisonPotion(t);
4216 ThingContainer.DestData dest = things.GetDest(t, tryStack);
4217 if (!dest.IsValid)
4218 {
4219 if (t.parent != EClass._zone)
4220 {
4221 if (IsPC)
4222 {
4223 Say("backpack_full_drop", t);
4224 SE.Drop();
4225 }
4226 return EClass._zone.AddCard(t, pos).Thing;
4227 }
4228 if (IsPC)
4229 {
4230 Say("backpack_full", t);
4231 }
4232 return t;
4233 }
4234 if (dest.stack != null)
4235 {
4236 if (msg)
4237 {
4238 PlaySound("pick_thing");
4239 Say("pick_thing", this, t);
4240 }
4241 t.TryStackTo(dest.stack);
4242 return dest.stack;
4243 }
4244 TryAbsorbRod(t);
4245 if (msg)
4246 {
4247 PlaySound("pick_thing");
4248 Say("pick_thing", this, t);
4249 }
4251 return dest.container.AddThing(t, tryStack);
4252 }
bool isNew
Definition: Card.cs:468
bool TryStackTo(Thing to)
Definition: Card.cs:3295
string c_idRefCard
Definition: Card.cs:1711
void TryReservePickupTutorial(Thing t)
Definition: Chara.cs:4298
Thing TryPoisonPotion(Thing t)
Definition: Chara.cs:4254
void TryAbsorbRod(Thing t)
Definition: Chara.cs:4268
static void Collect(Thing t)
bool autoCollectCard
Definition: Game.cs:51
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(), GrowSystem.PopHarvest(), ActEffect.Proc(), InvOwner.Transaction.Process(), Map.PutAway(), InvOwner.PutBack(), CoreDebug.Reset_LoytelDebt(), AI_Equip.Run(), AI_Idle.Run(), AI_OpenGambleChest.Run(), AI_Shear.Run(), AI_Steal.Run(), AI_UseCrafter.Run(), TaskCullLife.Run(), GameDate.ShipGoods(), ActThrow.Throw(), Recipe.TryGetFirstTimeBonus(), ActRanged.TryReload(), Map.TryShatter(), UIDragGridIngredients.Update(), and CoreDebug.UpdateInput().

◆ PickHeld()

void Chara.PickHeld ( bool  msg = false)
inline

Definition at line 4420 of file Chara.cs.

4421 {
4422 if (held == null)
4423 {
4424 return;
4425 }
4426 Card card = held;
4427 if (IsPC && held.invY == 1)
4428 {
4429 WidgetHotbar.dirtyCurrentItem = true;
4431 held = null;
4432 return;
4433 }
4434 if (held.isChara)
4435 {
4436 DropHeld();
4437 return;
4438 }
4440 {
4441 Say("canOnlyCarry", held);
4442 DropHeld();
4443 return;
4444 }
4445 bool flag = held != things.TryStack(held.Thing);
4446 if (!flag && things.IsOverflowing())
4447 {
4448 if (IsPC)
4449 {
4450 Say("backpack_full_drop", held);
4451 SE.Drop();
4452 }
4453 DropHeld();
4454 return;
4455 }
4456 if (msg)
4457 {
4458 PlaySound("pick_thing");
4459 Say("pick_held", this, card);
4460 if (IsPC && card.id == "statue_weird")
4461 {
4462 Say("statue_pick");
4463 }
4464 }
4465 if (IsPC)
4466 {
4467 WidgetHotbar.dirtyCurrentItem = true;
4468 if (!flag)
4469 {
4471 if (held.GetRootCard() != EClass.pc)
4472 {
4473 Pick(held.Thing, msg: false);
4474 }
4475 }
4476 }
4477 held = null;
4478 }
int invY
Definition: Card.cs:1917
bool IsHotItem
Definition: Card.cs:117
Card DropHeld(Point dropPos=null)
Definition: Chara.cs:4497
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 4184 of file Chara.cs.

4185 {
4186 if (num != 0)
4187 {
4188 PickOrDrop(p, ThingGen.Create(idThing, idMat).SetNum(num), msg);
4189 }
4190 }

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

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

◆ PickOrDrop() [2/2]

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

Definition at line 4192 of file Chara.cs.

4193 {
4194 if (things.GetDest(t).IsValid)
4195 {
4196 Pick(t, msg);
4197 }
4198 else
4199 {
4200 EClass._zone.AddCard(t, p);
4201 }
4202 }

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

◆ Refresh()

void Chara.Refresh ( bool  calledRecursive = false)
inline

Definition at line 1708 of file Chara.cs.

1709 {
1710 if (source == null)
1711 {
1712 Debug.LogError("source is null");
1713 SetSource();
1714 }
1715 if (ride != null && ride.source != null)
1716 {
1717 ride.Refresh(calledRecursive: true);
1718 }
1719 hasTelepathy = false;
1720 isWet = false;
1721 _isLevitating = HasElement(401) || (ride != null && ride._isLevitating);
1723 base.isHidden = HasElement(415);
1724 foreach (Condition condition in conditions)
1725 {
1726 condition.OnRefresh();
1727 }
1728 if (isWet)
1729 {
1730 base.isHidden = false;
1731 }
1733 SetDirtySpeed();
1734 if (host != null && !calledRecursive && host.source != null)
1735 {
1736 host.Refresh(calledRecursive: true);
1737 }
1738 }
virtual void OnRefresh()
void Refresh(bool calledRecursive=false)
Definition: Chara.cs:1708
bool isWet
Definition: Chara.cs:142
override void SetSource()
Definition: Chara.cs:2019
bool IsUndead
Definition: Chara.cs:889
bool IsHorror
Definition: Chara.cs:913
bool IsMachine
Definition: Chara.cs:901

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

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

◆ RefreshFaithElement()

void Chara.RefreshFaithElement ( )
inline

Definition at line 9782 of file Chara.cs.

9783 {
9784 if (faithElements != null)
9785 {
9787 }
9789 if (idFaith == "eyth" && !HasElement(1228))
9790 {
9791 return;
9792 }
9793 SourceReligion.Row row = EClass.sources.religions.map.TryGetValue(idFaith);
9794 if (row == null)
9795 {
9796 return;
9797 }
9799 if (!HasCondition<ConExcommunication>())
9800 {
9801 SourceElement.Row row2 = EClass.sources.elements.alias.TryGetValue("featGod_" + row.id + "1");
9802 if (row2 != null)
9803 {
9804 faithElements.SetBase(row2.id, 1);
9805 }
9806 int[] array = row.elements;
9807 int num = GetPietyValue() * (120 + Evalue(1407) * 15) / 100;
9808 for (int i = 0; i < array.Length; i += 2)
9809 {
9810 int num2 = array[i + 1] * num / 50;
9811 if (array[i] == 79)
9812 {
9813 num2 = EClass.curve(num2, array[i + 1] * 2, 10, 50);
9814 }
9815 if (num2 >= 20 && array[i] >= 950 && array[i] < 970)
9816 {
9817 num2 = 20;
9818 }
9819 faithElements.SetBase(array[i], Mathf.Max(num2, 1));
9820 }
9821 }
9823 }
string idFaith
Definition: Chara.cs:229
ElementContainer faithElements
Definition: Chara.cs:38
int GetPietyValue()
Definition: Chara.cs:9773
Element SetBase(string alias, int v, int potential=0)
SourceReligion religions

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

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

◆ RefreshSpeed()

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

Definition at line 1824 of file Chara.cs.

1825 {
1826 if (ride != null && !ride.IsDeadOrSleeping)
1827 {
1829 _Speed = ride._Speed;
1830 info?.AddText("rideSpeed".lang(_Speed.ToString() ?? ""));
1831 }
1832 else if (host != null)
1833 {
1834 if (host.ride == this)
1835 {
1836 _Speed = Evalue(79);
1837 _Speed = _Speed * 100 / Mathf.Clamp(100 + _Speed * ((!race.tag.Contains("noRide")) ? 1 : 5) - base.STR - host.EvalueRiding() * 2 - (race.tag.Contains("ride") ? 50 : 0), 100, 1000);
1838 }
1839 else
1840 {
1841 _Speed = (Evalue(79) + host.Evalue(79)) / 2;
1842 }
1843 }
1844 else
1845 {
1846 _Speed = Evalue(79) + Evalue(407) / 2;
1847 }
1848 if (body.GetSlot(37, onlyEmpty: false)?.thing != null && HasElement(1209) && !HasElement(419))
1849 {
1850 _Speed -= 25;
1851 info?.AddText(-25, EClass.sources.elements.map[1209].GetName());
1852 }
1853 if (parasite != null)
1854 {
1855 int speed = _Speed;
1856 _Speed = _Speed * 100 / Mathf.Clamp(120 + parasite.LV * 2 - base.STR - Evalue(227) * 2, 100, 1000);
1857 info?.AddText(_Speed - speed, "parasiteSpeed".lang());
1858 }
1859 if (_Speed < elements.ValueWithoutLink(79) / 3)
1860 {
1862 info?.AddText("minSpeed".lang((elements.ValueWithoutLink(79) / 3).ToString() ?? ""));
1863 }
1864 int num = 100;
1865 if (EClass._zone.map != null && EClass._zone.IsUnderwater)
1866 {
1867 int num2 = Evalue(200);
1868 num = 50 + Mathf.Clamp((int)Mathf.Sqrt(num2) * 5 - EClass._zone.DangerLv / 50, 0, 50) + Mathf.Clamp((int)Mathf.Sqrt(num2), 0, 25);
1869 if (info != null && num != 100)
1870 {
1871 info.AddFix(num - 100, EClass.sources.elements.map[200].GetName().ToTitleCase());
1872 }
1873 }
1874 if (IsPCFaction)
1875 {
1876 switch (burden.GetPhase())
1877 {
1878 case 1:
1879 num -= 10;
1880 info?.AddFix(-10, burden.GetPhaseStr());
1881 break;
1882 case 2:
1883 num -= 20;
1884 info?.AddFix(-20, burden.GetPhaseStr());
1885 break;
1886 case 3:
1887 num -= 30;
1888 info?.AddFix(-30, burden.GetPhaseStr());
1889 break;
1890 case 4:
1891 num -= (IsPC ? 50 : 100);
1892 info?.AddFix(IsPC ? (-50) : (-100), burden.GetPhaseStr());
1893 break;
1894 }
1895 if (IsPC)
1896 {
1897 switch (stamina.GetPhase())
1898 {
1899 case 1:
1900 num -= 10;
1901 info?.AddFix(-10, stamina.GetPhaseStr());
1902 break;
1903 case 0:
1904 num -= 20;
1905 info?.AddFix(-20, stamina.GetPhaseStr());
1906 break;
1907 }
1908 switch (sleepiness.GetPhase())
1909 {
1910 case 2:
1911 num -= 10;
1912 info?.AddFix(-10, sleepiness.GetPhaseStr());
1913 break;
1914 case 3:
1915 num -= 20;
1916 info?.AddFix(-20, sleepiness.GetPhaseStr());
1917 break;
1918 }
1919 switch (hunger.GetPhase())
1920 {
1921 case 3:
1922 case 4:
1923 num -= 10;
1924 info?.AddFix(-10, hunger.GetPhaseStr());
1925 break;
1926 case 5:
1927 num -= 30;
1928 info?.AddFix(-30, hunger.GetPhaseStr());
1929 break;
1930 }
1931 num += EClass.player.lastEmptyAlly * Evalue(1646);
1932 info?.AddFix(EClass.player.lastEmptyAlly * Evalue(1646), EClass.sources.elements.map[1646].GetName());
1933 }
1935 {
1936 num += EClass.player.lastEmptyAlly * 10 - 10;
1937 info?.AddFix(EClass.player.lastEmptyAlly * 10 - 10, "exceedParty".lang());
1938 }
1939 }
1940 else if (base.LV >= 1000 && !EClass.game.principal.disableVoidBlessing && !base.IsPCFactionOrMinion)
1941 {
1942 num += EClass.curve((base.LV - 900) / 100 * 10, 500, 100);
1943 info?.AddFix(EClass.curve((base.LV - 900) / 100 * 10, 500, 100), "enemySpeedBuff".lang());
1944 }
1945 if (HasCondition<ConGravity>())
1946 {
1947 num -= 30;
1948 info?.AddFix(-30, GetCondition<ConGravity>().Name);
1949 }
1950 if (_Speed < 10)
1951 {
1952 _Speed = 10;
1953 }
1954 _Speed = _Speed * num / 100;
1955 if (_Speed < 10)
1956 {
1957 _Speed = 10;
1958 info?.AddText("minSpeed".lang(10.ToString() ?? ""));
1959 }
1960 dirtySpeed = false;
1961 }
Thing thing
Definition: BodySlot.cs:8
int _Speed
Definition: Chara.cs:170
override string ToString()
Definition: Chara.cs:1154
void RefreshSpeed(Element.BonusInfo info=null)
Definition: Chara.cs:1824
bool dirtySpeed
Definition: Chara.cs:168
void AddText(string text, FontColor col=FontColor.Warning)
Definition: ELEMENT.cs:111
void AddFix(int v, string text)
Definition: ELEMENT.cs:132
bool disableVoidBlessing
GamePrincipal principal
Definition: Game.cs:221
int lastEmptyAlly
Definition: Player.cs:1149
virtual bool IsUnderwater
Definition: Zone.cs:264

References _Speed, EClass._zone, body, burden, EClass.curve(), Zone.DangerLv, dirtySpeed, GamePrincipal.disableVoidBlessing, Card.elements, SourceManager.elements, Card.Evalue(), EvalueRiding(), EClass.game, Stats.GetPhase(), BaseStats.GetPhaseStr(), CharaBody.GetSlot(), Card.HasElement(), host, hunger, IsDeadOrSleeping, 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 ConGravity.OnRefresh(), Player.RefreshEmptyAlly(), RefreshSpeed(), and Element.BonusInfo.WriteNote().

◆ RefreshWorkElements()

void Chara.RefreshWorkElements ( ElementContainer  parent = null)
inline

Definition at line 8657 of file Chara.cs.

8658 {
8659 if (workElements != null)
8660 {
8662 }
8663 workElements = null;
8664 if (IsPCParty || homeBranch == null || homeBranch.owner == null)
8665 {
8666 return;
8667 }
8668 foreach (Hobby item in ListHobbies())
8669 {
8670 TryAdd(item);
8671 }
8672 foreach (Hobby item2 in ListWorks())
8673 {
8674 TryAdd(item2);
8675 }
8676 if (workElements != null)
8677 {
8679 }
8680 void TryAdd(Hobby h)
8681 {
8682 if (!h.source.elements.IsEmpty())
8683 {
8684 if (workElements == null)
8685 {
8687 }
8688 for (int i = 0; i < h.source.elements.Length; i += 2)
8689 {
8690 int num = h.source.elements[i];
8691 int num2 = h.source.elements[i + 1];
8692 int num3 = 100;
8693 if (num != 2115 && num != 2207)
8694 {
8695 num3 = h.GetEfficiency(this) * homeBranch.efficiency / 100;
8696 if (num3 <= 0)
8697 {
8698 continue;
8699 }
8700 }
8701 workElements.ModBase(num, (num2 < 0) ? (num2 / 10) : Mathf.Max(1, h.source.elements[i + 1] * num3 / 1000));
8702 }
8703 }
8704 }
8705 }
ElementContainer workElements
Definition: Chara.cs:40
int GetEfficiency(Chara c)
Definition: Hobby.cs:31

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

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

◆ ReleaseMinion()

void Chara.ReleaseMinion ( )
inline

Definition at line 2309 of file Chara.cs.

2310 {
2311 base.c_uidMaster = 0;
2312 master = null;
2313 enemy = null;
2314 foreach (Chara chara in EClass._map.charas)
2315 {
2316 if (chara.enemy == this)
2317 {
2318 chara.SetEnemy();
2319 chara.ai.Cancel();
2320 }
2321 }
2322 ai.Cancel();
2323 Refresh();
2324 }

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

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

◆ RemoveAllStances()

void Chara.RemoveAllStances ( )
inline

Definition at line 9247 of file Chara.cs.

9248 {
9249 for (int num = conditions.Count - 1; num >= 0; num--)
9250 {
9251 Condition condition = conditions[num];
9252 if (condition.Type == ConditionType.Stance)
9253 {
9254 condition.Kill();
9255 }
9256 }
9257 }

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

◆ RemoveCondition< T >()

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

Definition at line 9108 of file Chara.cs.

9108 : Condition
9109 {
9110 for (int num = conditions.Count - 1; num >= 0; num--)
9111 {
9112 if (conditions[num] is T)
9113 {
9114 conditions[num].Kill();
9115 break;
9116 }
9117 }
9118 }

References Condition.Kill().

◆ RemoveGlobal()

void Chara.RemoveGlobal ( )
inline

Definition at line 1481 of file Chara.cs.

1482 {
1483 if (IsGlobal && !(trait is TraitUniqueChara) && !base.IsUnique && !EClass.game.cards.listAdv.Contains(this))
1484 {
1485 global = null;
1487 }
1488 }
List< Chara > listAdv
Definition: CardManager.cs:64

References Game.cards, EClass.game, global, CardManager.globalCharas, IsGlobal, CardManager.listAdv, CardManager.GlobalCharaList.Remove(), and trait.

Referenced by FactionBranch.RemoveMemeber().

◆ RemoveLastBodyPart()

void Chara.RemoveLastBodyPart ( bool  msg = false)
inline

Definition at line 2158 of file Chara.cs.

2159 {
2160 if (body.slots.Count != 0)
2161 {
2162 BodySlot bodySlot = body.slots.LastItem();
2163 body.RemoveBodyPartAt(body.slots.Count - 1);
2164 if (msg)
2165 {
2166 Say("lose_bodyparts", this, Element.Get(bodySlot.elementId).GetName().ToLower());
2167 PlaySound("offering");
2168 }
2169 }
2170 }
int elementId
Definition: BodySlot.cs:6
void RemoveBodyPartAt(int idx)
Definition: CharaBody.cs:322

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

8078 {
8079 if (HasCondition<StanceTaunt>() || base.isRestrained || attacker == this)
8080 {
8081 return false;
8082 }
8083 if (host != null && host.isRestrained)
8084 {
8085 return false;
8086 }
8087 if (base.IsPCFactionOrMinion && attacker.IsPCFactionOrMinion)
8088 {
8089 return false;
8090 }
8091 bool flag = false;
8092 foreach (Chara chara in EClass._map.charas)
8093 {
8094 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))
8095 {
8096 continue;
8097 }
8098 bool flag2 = chara.HasElement(1225);
8099 if ((!flag2 && (flag || EClass.rnd(2) == 0 || !chara.HasCondition<StanceTaunt>())) || chara.HasCooldown(1225))
8100 {
8101 continue;
8102 }
8103 int num = Mathf.Max(chara.Evalue(1649), (!chara.IsPC) ? ((!flag2) ? 1 : 3) : 0);
8104 int num2 = Dist(chara);
8105 if (num2 > 25)
8106 {
8107 continue;
8108 }
8109 if (num2 > num || !chara.CanSeeLos(pos, num2))
8110 {
8111 if (!flag2)
8112 {
8113 continue;
8114 }
8115 Point nearestPoint = pos.GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: true, ignoreCenter: true);
8116 if (!nearestPoint.IsValid)
8117 {
8118 continue;
8119 }
8120 chara.Teleport(nearestPoint);
8121 chara.AddCooldown(1225, 10);
8122 num2 = Dist(chara);
8123 Say("intercept_loyal", chara, this);
8124 chara.SetEnemy(attacker);
8125 attacker.SetEnemy(chara);
8126 if (num2 > num || !chara.CanSeeLos(pos, num2))
8127 {
8128 continue;
8129 }
8130 }
8131 if (!flag && !HasElement(1225))
8132 {
8133 Say("intercept", chara, this);
8134 if (EClass.rnd(10) == 0)
8135 {
8136 chara.Talk("intercept", base.NameSimple);
8137 }
8138 if (attacker.enemy == this)
8139 {
8140 attacker.SetEnemy(chara);
8141 }
8142 action(chara);
8143 flag = true;
8144 }
8145 }
8146 return flag;
8147 }
void Teleport(Point point, bool silent=false, bool force=false)
Definition: Card.cs:5664
void AddCooldown(int idEle, int turns=0)
Definition: Chara.cs:8341
bool HasCooldown(int idEle)
Definition: Chara.cs:8359

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

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

◆ RerollHobby()

void Chara.RerollHobby ( bool  extraSlotChance = true)
inline

Definition at line 8751 of file Chara.cs.

8752 {
8753 if (_hobbies != null && _works != null)
8754 {
8755 _hobbies.Clear();
8756 _works.Clear();
8757 }
8758 else
8759 {
8760 _hobbies = new List<int>();
8761 _works = new List<int>();
8762 }
8763 if (source.hobbies.IsEmpty())
8764 {
8765 AddHobby(EClass.sources.hobbies.listHobbies.RandomItem().id);
8766 }
8767 else
8768 {
8769 string[] hobbies = source.hobbies;
8770 foreach (string key in hobbies)
8771 {
8772 AddHobby(EClass.sources.hobbies.alias[key].id);
8773 }
8774 }
8775 if (source.works.IsEmpty())
8776 {
8777 AddWork(EClass.sources.hobbies.listWorks.RandomItem().id);
8778 }
8779 else
8780 {
8781 string[] hobbies = source.works;
8782 foreach (string key2 in hobbies)
8783 {
8784 AddWork(EClass.sources.hobbies.alias[key2].id);
8785 }
8786 }
8788 }
WorkSummary GetWorkSummary()
Definition: Chara.cs:8790
void AddWork(int id)
Definition: Chara.cs:8739
void AddHobby(int id)
Definition: Chara.cs:8727
List< Row > listWorks
Definition: SourceHobby.cs:64
List< Row > listHobbies
Definition: SourceHobby.cs:61
void Reset()
Definition: WorkSummary.cs:78

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

Referenced by OnCreate().

◆ ResetBody()

void Chara.ResetBody ( )
inline

Definition at line 2172 of file Chara.cs.

2173 {
2174 for (int num = body.slots.Count - 1; num >= 0; num--)
2175 {
2176 BodySlot bodySlot = body.slots[num];
2177 if (bodySlot.elementId == 45 || bodySlot.elementId == 40)
2178 {
2179 return;
2180 }
2181 body.RemoveBodyPart(num);
2182 }
2183 string[] array = race.figure.Split('|');
2184 foreach (string s in array)
2185 {
2186 int num2 = ParseBodySlot(s);
2187 if (num2 != -1)
2188 {
2189 body.AddBodyPart(num2);
2190 }
2191 }
2193 }

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

◆ ResetUpgrade()

void Chara.ResetUpgrade ( )
inline

Definition at line 8243 of file Chara.cs.

8244 {
8245 _ = base.c_upgrades;
8246 }

Referenced by CoreDebug.ResetPetUpgrades().

◆ ResistCon()

void Chara.ResistCon ( Condition  con)
inline

Definition at line 9304 of file Chara.cs.

9305 {
9306 if (con.power > 0 && resistCon != null)
9307 {
9308 int a = ClassExtension.TryGetValue<int, int>((IDictionary<int, int>)resistCon, con.id, 0);
9309 if (1000 < EClass.rnd(a))
9310 {
9311 con.power = 0;
9312 }
9313 else if (500 < EClass.rnd(a))
9314 {
9315 con.power /= 5;
9316 }
9317 else if (200 < EClass.rnd(a))
9318 {
9319 con.power /= 3;
9320 }
9321 else if (100 < EClass.rnd(a))
9322 {
9323 con.power /= 2;
9324 }
9325 }
9326 }

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

◆ RestockEquip()

void Chara.RestockEquip ( bool  onCreate)
inline

Definition at line 4589 of file Chara.cs.

4590 {
4591 string equip = source.equip;
4592 if (equip.IsEmpty())
4593 {
4594 equip = job.equip;
4595 }
4596 if (equip == "none")
4597 {
4598 return;
4599 }
4600 switch (id)
4601 {
4602 case "kettle":
4603 case "quru":
4604 case "loytel":
4605 case "shojo":
4606 EQ_ID("staff_long", 1);
4607 EQ_CAT("head");
4608 EQ_CAT("torso");
4609 EQ_CAT("arm");
4610 return;
4611 case "adv_yukiimo":
4612 if (onCreate)
4613 {
4614 EQ_ID("tail_snowleopard");
4615 }
4616 break;
4617 case "adv_kiria":
4618 if (onCreate)
4619 {
4620 EQ_ID("sword_zephir");
4621 }
4622 break;
4623 case "adv_mesherada":
4624 if (onCreate)
4625 {
4626 EQ_ID("dagger_hathaway");
4627 }
4628 break;
4629 case "adv_verna":
4630 if (onCreate)
4631 {
4632 EQ_ID("staff_long", -1, Rarity.Legendary);
4633 }
4634 if (onCreate)
4635 {
4636 EQ_ID("cloak_wing", -1, Rarity.Mythical);
4637 }
4638 break;
4639 case "big_sister":
4640 if (onCreate)
4641 {
4642 EQ_ID("sword_muramasa");
4643 }
4644 break;
4645 case "adv_gaki":
4646 if (onCreate)
4647 {
4648 EQ_ID("dagger_gaki");
4649 }
4650 if (onCreate)
4651 {
4652 EQ_ID("dagger_ninto");
4653 }
4654 break;
4655 case "adv_ivory":
4656 EQ_ID("dagger", -1, Rarity.Legendary);
4657 AddThing("60");
4658 break;
4659 case "adv_wini":
4660 if (onCreate)
4661 {
4662 EQ_ID("staff_Cat", -1, Rarity.Mythical);
4663 }
4665 if (onCreate)
4666 {
4667 AddThing("1071");
4668 }
4669 break;
4670 case "lomias":
4671 if (onCreate)
4672 {
4673 AddThing("bow_vindale");
4674 }
4675 break;
4676 case "larnneire":
4677 if (onCreate)
4678 {
4679 EQ_ID("EtherDagger2");
4680 }
4681 break;
4682 case "ungaga_pap":
4683 if (onCreate)
4684 {
4685 EQ_ID("axe_destruction");
4686 }
4687 break;
4688 case "lurie_boss":
4689 if (onCreate)
4690 {
4691 EQ_ID("ribbon_duponne");
4692 }
4693 break;
4694 case "seeker":
4695 if (onCreate)
4696 {
4697 EQ_ID("helm_seeker");
4698 }
4699 EQ_ID("robe_pope");
4700 EQ_ID("sword_katana");
4701 EQ_ID("staff");
4702 EQ_ID("sword_katana");
4703 if (onCreate)
4704 {
4705 EQ_ID("boots_seven");
4706 }
4707 if (onCreate)
4708 {
4709 for (int i = 0; i < 20; i++)
4710 {
4712 }
4713 EQ_Item("panty");
4714 AddThing("plat").SetNum(6);
4715 }
4716 break;
4717 case "ephrond":
4718 if (onCreate)
4719 {
4720 AddThing("guitar_efrond");
4721 }
4722 break;
4723 case "ashland":
4724 if (onCreate)
4725 {
4726 AddThing("guitar_ash");
4727 }
4728 break;
4729 case "swordkeeper":
4730 if (onCreate)
4731 {
4732 EQ_ID("EtherDagger");
4733 }
4734 break;
4735 }
4736 switch (equip)
4737 {
4738 case "archer":
4739 if (onCreate || !TryEquipRanged())
4740 {
4741 EQ_CAT((EClass.rnd(4) == 0) ? "crossbow" : "bow");
4742 }
4743 break;
4744 case "inquisitor":
4745 case "gunner":
4746 if (onCreate || !TryEquipRanged())
4747 {
4748 EQ_CAT("gun");
4749 }
4750 break;
4751 }
4752 int num = ((base.rarity >= Rarity.Mythical) ? (base.LV * 3) : ((base.rarity >= Rarity.Legendary) ? (base.LV * 2) : base.LV));
4753 if (trait is TraitAdventurer)
4754 {
4755 num *= 3;
4756 }
4757 if (race.id == "asura")
4758 {
4759 for (int j = 0; j < 4; j++)
4760 {
4761 EQ_CAT(job.weapon.RandomItem());
4762 }
4763 }
4764 for (int k = 0; k < ((!(race.id == "mutant")) ? 1 : (2 + base.LV / 30)); k++)
4765 {
4766 if (source.ContainsTag("boxer"))
4767 {
4768 EQ_CAT("martial");
4769 }
4770 else if (!job.weapon.IsEmpty())
4771 {
4772 if (race.id == "mutant" || (body.slotMainHand != null && body.slotMainHand.thing == null))
4773 {
4774 EQ_CAT(job.weapon.RandomItem());
4775 }
4776 if (race.id == "mutant" || (Evalue(131) > 0 && EClass.rnd(2) == 0))
4777 {
4778 EQ_CAT(job.weapon.RandomItem());
4779 }
4780 }
4781 EQ_CAT("torso");
4782 if (EClass.rnd(num) > 5)
4783 {
4784 EQ_CAT("arm");
4785 }
4786 if (EClass.rnd(num) > 10)
4787 {
4788 EQ_CAT("head");
4789 }
4790 if (EClass.rnd(num) > 15)
4791 {
4792 EQ_CAT("back");
4793 }
4794 if (EClass.rnd(num) > 20)
4795 {
4796 EQ_CAT("ring");
4797 }
4798 if (EClass.rnd(num) > 25)
4799 {
4800 EQ_CAT("amulet");
4801 }
4802 if (EClass.rnd(num) > 30)
4803 {
4804 EQ_CAT("foot");
4805 }
4806 if (EClass.rnd(num) > 35)
4807 {
4808 EQ_CAT("waist");
4809 }
4810 if (EClass.rnd(num) > 40)
4811 {
4812 EQ_CAT("ring");
4813 }
4814 }
4815 if (trait is TraitBard)
4816 {
4817 AddThing(ThingGen.Create("lute"));
4818 if (EClass.debug.enable || EClass.rnd(100) == 0)
4819 {
4820 EQ_ID("shield_lute");
4821 }
4822 }
4823 if (HasTag(CTAG.shield))
4824 {
4825 EQ_CAT("shield");
4826 }
4827 }
Card AddCard(Card c)
Definition: Card.cs:3043
BodySlot slotMainHand
Definition: CharaBody.cs:10
void EQ_Item(string s, int num=1)
Definition: Chara.cs:4937
Thing EQ_ID(string s, int mat=-1, Rarity r=Rarity.Random)
Definition: Chara.cs:4901
bool TryEquipRanged()
Definition: Chara.cs:7550
void EQ_CAT(string s)
Definition: Chara.cs:4921
static Thing CreateSpellbook(string alias, int num=1)
Definition: ThingGen.cs:151

References RenderRow.ContainsTag(), ThingGen.Create(), ThingGen.CreateFromCategory(), ThingGen.CreateSpellbook(), EClass.debug, CoreDebug.enable, SourceChara.Row.equip, SourceJob.Row.equip, SourceRace.Row.id, EClass.rnd(), CharaBody.slotMainHand, BodySlot.thing, and SourceJob.Row.weapon.

Referenced by CoreDebug.QuickStart().

◆ RestockInventory()

void Chara.RestockInventory ( bool  onCreate)
inline

Definition at line 4829 of file Chara.cs.

4830 {
4831 switch (id)
4832 {
4833 case "lomias":
4834 if (ShouldRestock("_meat"))
4835 {
4836 AddCard(ThingGen.Create("_meat").MakeRefFrom("begger"));
4837 }
4838 break;
4839 case "fiama":
4840 Restock("book_story", 1);
4841 break;
4842 case "rock_thrower":
4843 Restock("stone", 10 + EClass.rnd(10));
4844 break;
4845 case "giant":
4846 Restock("rock", 2 + EClass.rnd(10));
4847 break;
4848 case "farris":
4849 Restock("lute", 1);
4850 Restock("book_story_home", 1);
4851 break;
4852 case "begger":
4853 break;
4854 }
4855 void Restock(string id, int num)
4856 {
4857 if (ShouldRestock(id))
4858 {
4859 AddCard(ThingGen.Create(id).SetNum(num));
4860 }
4861 }
4862 bool ShouldRestock(string id)
4863 {
4864 return things.Find(id) == null;
4865 }
4866 }

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

◆ Revive()

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

Definition at line 4981 of file Chara.cs.

4982 {
4983 if (!isDead)
4984 {
4985 return;
4986 }
4987 isDead = false;
4988 base.hp = MaxHP / 3;
4989 mana.value = 0;
4990 stamina.value = 0;
4991 if (hunger.value > 30)
4992 {
4993 hunger.value = 30;
4994 }
4995 sleepiness.value = 0;
4997 RemoveCondition<StanceTaunt>();
4998 if (IsPC)
4999 {
5001 {
5002 Msg.Say("noDeathPenalty2", this);
5003 }
5005 {
5006 Msg.Say("noDeathPenalty", this);
5007 }
5008 else
5009 {
5011 }
5012 List<Thing> dropList = new List<Thing>();
5013 EClass.pc.things.Foreach(delegate(Thing t)
5014 {
5016 {
5017 t.ignoreAutoPick = true;
5018 dropList.Add(t);
5019 }
5020 }, onlyAccessible: false);
5021 foreach (Thing item in dropList)
5022 {
5024 Msg.Say("backpack_full_drop", item);
5025 }
5026 EClass.player.preventDeathPenalty = false;
5027 }
5028 if (IsPCFaction && homeBranch != null)
5029 {
5030 homeBranch.Log("bRevive", this);
5031 }
5032 if (p != null)
5033 {
5034 if (!p.IsInBounds)
5035 {
5037 }
5038 EClass._zone.AddCard(this, p);
5039 if (msg)
5040 {
5041 SE.Play("revive");
5042 Msg.Say("revive", this);
5043 PlayEffect("revive");
5044 }
5045 SetCensored(enable: false);
5046 }
5047 }
void SetCensored(bool enable)
Definition: Card.cs:7455
Card parentCard
Definition: Card.cs:101
void ApplyDeathPenalty()
Definition: Chara.cs:5069
bool disableDeathPenaltyProtection
Point GetCenterPos()
Definition: MapBounds.cs:52
int days
Definition: Player.cs:75
bool preventDeathPenalty
Definition: Player.cs:1123
void Foreach(Action< Thing > action, bool onlyAccessible=true)
override int SelfWeight
Definition: Thing.cs:82

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

3461 {
3462 if (renderer.hasActor)
3463 {
3464 base.dir = (base.dir + ((!reverse) ? 1 : (-1))).Clamp(0, 3, loop: true);
3465 }
3466 else
3467 {
3468 base.dir = ((base.dir == 0) ? 1 : 0);
3469 }
3470 UpdateAngle();
3472 }

Referenced by AI_Dance.Run().

◆ ScaleByPrincipal()

Chara Chara.ScaleByPrincipal ( )
inline

◆ SetAI()

AIAct Chara.SetAI ( AIAct  g)
inline

Definition at line 8527 of file Chara.cs.

8528 {
8529 if (IsPC)
8530 {
8532 }
8533 if (ai.IsRunning)
8534 {
8535 if (ai == g && ai.IsNoGoal)
8536 {
8537 return g;
8538 }
8539 ai.Cancel();
8540 if (ai == g)
8541 {
8542 Debug.Log("goal is g:" + ai?.ToString() + "/" + this);
8543 return g;
8544 }
8545 }
8546 if (HasCondition<ConWait>())
8547 {
8548 RemoveCondition<ConWait>();
8549 }
8550 ai = g;
8551 ai.SetOwner(this);
8552 if (IsPC)
8553 {
8555 }
8556 return g;
8557 }
virtual bool IsNoGoal
Definition: AIAct.cs:74
void SetOwner(Chara c)
Definition: AIAct.cs:179
QueueManager queues
Definition: Player.cs:1165
void OnSetGoal(AIAct newGoal)
Definition: QueueManager.cs:23

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

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

◆ SetAIAggro()

void Chara.SetAIAggro ( )
inline

Definition at line 8517 of file Chara.cs.

8518 {
8519 SetAI(new GoalCombat());
8520 }

Referenced by ZoneEventQuest.AggroEnemy().

◆ SetAIIdle()

void Chara.SetAIIdle ( )
inline

Definition at line 8513 of file Chara.cs.

8514 {
8515 }

◆ SetAIImmediate()

void Chara.SetAIImmediate ( AIAct  g)
inline

◆ SetDir()

override void Chara.SetDir ( int  d)
inlinevirtual

Reimplemented from Card.

Definition at line 3453 of file Chara.cs.

3454 {
3455 base.dir = d;
3456 UpdateAngle();
3458 }

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

◆ SetDirtySpeed()

void Chara.SetDirtySpeed ( )
inline

Definition at line 1815 of file Chara.cs.

1816 {
1817 dirtySpeed = true;
1818 if (host != null)
1819 {
1821 }
1822 }

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

6073 {
6074 enemy = c;
6075 if (c == null)
6076 {
6077 if (ai is GoalCombat)
6078 {
6079 ai.Cancel();
6080 }
6081 }
6082 else
6083 {
6084 calmCheckTurn = 10 + EClass.rnd(30);
6085 }
6086 return c;
6087 }

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

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

◆ SetEQQuality()

void Chara.SetEQQuality ( )
inlineprivate

Definition at line 4868 of file Chara.cs.

4869 {
4871 Rarity rarity = Rarity.Normal;
4872 int num = ((base.LV >= 1000) ? 7 : ((base.LV >= 500) ? 5 : ((base.LV >= 250) ? 3 : ((base.LV >= 100) ? 2 : ((base.LV >= 50) ? 1 : 0)))));
4873 Rarity rarity2 = base.rarity;
4874 if (id == "big_sister")
4875 {
4876 num = (isOnCreate ? 8 : 4);
4877 }
4878 if (!isOnCreate && EClass.rnd(10) != 0)
4879 {
4880 num /= 2;
4881 }
4882 if (rarity2 == Rarity.Superior && EClass.rnd(10) <= num)
4883 {
4884 rarity = Rarity.Superior;
4885 }
4886 else if (rarity2 == Rarity.Legendary)
4887 {
4888 rarity = ((EClass.rnd(10) <= num) ? Rarity.Legendary : ((EClass.rnd(5) <= num) ? Rarity.Superior : Rarity.Normal));
4889 }
4890 else if (rarity2 >= Rarity.Mythical)
4891 {
4892 rarity = ((EClass.rnd(30) <= num) ? Rarity.Mythical : ((EClass.rnd(10) > num) ? Rarity.Superior : Rarity.Legendary));
4893 }
4894 if (rarity == Rarity.Normal && EClass.rnd(1000) == 0)
4895 {
4896 rarity = Rarity.Legendary;
4897 }
4898 CardBlueprint.current.rarity = rarity;
4899 }
static void Set(CardBlueprint _bp)
static CardBlueprint CharaGenEQ
static bool isOnCreate
Definition: Chara.cs:182

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

◆ SetFaction()

Chara Chara.SetFaction ( Faction  f)
inline

Definition at line 1401 of file Chara.cs.

1402 {
1403 _faction = null;
1404 faction = f;
1406 return this;
1407 }
Faction _faction
Definition: Chara.cs:154
Hostility GetHostility()
Definition: FACTION.cs:255

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

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

◆ SetFaith() [1/2]

void Chara.SetFaith ( Religion  r)
inline

Definition at line 1693 of file Chara.cs.

1694 {
1695 faith = r;
1697 }

References faith, and RefreshFaithElement().

◆ SetFaith() [2/2]

void Chara.SetFaith ( string  id)
inline

Definition at line 1688 of file Chara.cs.

1689 {
1691 }
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 9484 of file Chara.cs.

9485 {
9486 Feat feat = elements.GetElement(id) as Feat;
9487 int num = 0;
9488 if (feat != null && feat.Value > 0)
9489 {
9490 if (value == feat.Value)
9491 {
9492 return;
9493 }
9494 num = feat.Value;
9495 feat.Apply(-feat.Value, elements);
9496 }
9497 if (value > 0)
9498 {
9499 feat = elements.SetBase(id, value - (feat?.vSource ?? 0)) as Feat;
9500 feat.Apply(feat.Value, elements);
9501 }
9502 else
9503 {
9504 elements.Remove(id);
9505 }
9507 {
9508 Refresh();
9510 }
9511 if (!msg)
9512 {
9513 return;
9514 }
9515 if (feat.source.textInc.IsEmpty())
9516 {
9517 PlaySound("ding_skill");
9519 Say("gainFeat", this, feat.FullName);
9520 }
9521 else
9522 {
9523 bool flag = value < num;
9524 if (feat.source.tag.Contains("neg"))
9525 {
9526 flag = !flag;
9527 }
9528 PlaySound("mutation");
9530 Say((value > num) ? feat.source.GetText("textInc") : feat.source.GetText("textDec"), this, feat.FullName);
9531 }
9533 }
Color Negative
Definition: MsgColors.cs:15
Color Ding
Definition: MsgColors.cs:11

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

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

◆ SetGlobal() [1/2]

Chara Chara.SetGlobal ( )
inline

Definition at line 1468 of file Chara.cs.

1469 {
1470 if (!IsGlobal)
1471 {
1473 global = new GlobalData();
1474 base.isSubsetCard = false;
1475 enemy = null;
1476 base.c_uidMaster = 0;
1477 }
1478 return this;
1479 }

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

1454 {
1455 SetGlobal();
1456 homeZone = _home;
1457 _home.AddCard(this, x, z);
1458 global.transition = new ZoneTransition
1459 {
1460 state = ZoneTransition.EnterState.Exact,
1461 x = x,
1462 z = z
1463 };
1464 orgPos = new Point(x, z);
1465 return this;
1466 }

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

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

◆ SetHomeZone()

Chara Chara.SetHomeZone ( Zone  zone)
inline

Definition at line 1409 of file Chara.cs.

1410 {
1411 homeZone = zone;
1412 SetGlobal();
1413 return this;
1414 }

References homeZone, and SetGlobal().

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

◆ SetHostility()

Chara Chara.SetHostility ( Hostility  h)
inline

Definition at line 1416 of file Chara.cs.

1417 {
1418 Hostility hostility2 = (base.c_originalHostility = h);
1419 this.hostility = hostility2;
1420 return this;
1421 }

Referenced by Zone_Specwing.OnActivate().

◆ SetMainElement() [1/2]

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

Definition at line 2040 of file Chara.cs.

2041 {
2042 if (base.c_idMainElement != 0)
2043 {
2044 SetElements(base.c_idMainElement, remove: true);
2045 base.c_idMainElement = 0;
2046 }
2047 if (id != 0)
2048 {
2049 _ = EClass.sources.elements.map[id];
2050 SetElements(id, remove: false);
2051 base.c_idMainElement = id;
2052 if (elemental)
2053 {
2054 base.isElemental = true;
2055 _colorInt = 0;
2056 Color colorSprite = EClass.setting.elements[MainElement.source.alias].colorSprite;
2057 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);
2058 }
2059 _ability = null;
2060 }
2061 void SetElements(int idEle, bool remove)
2062 {
2063 elements.SetBase(idEle, (!remove) ? ((v == 0) ? 10 : v) : 0);
2064 elements.ModBase(EClass.sources.elements.alias[EClass.sources.elements.map[idEle].aliasRef].id, remove ? (-20) : 20);
2065 switch (idEle)
2066 {
2067 case 910:
2068 elements.ModBase(951, remove ? 10 : (-10));
2069 break;
2070 case 911:
2071 elements.ModBase(950, remove ? 10 : (-10));
2072 break;
2073 case 912:
2074 elements.ModBase(953, remove ? 10 : (-10));
2075 break;
2076 case 913:
2077 elements.ModBase(952, remove ? 10 : (-10));
2078 break;
2079 case 916:
2080 elements.ModBase(960, remove ? 10 : (-10));
2081 break;
2082 case 919:
2083 elements.ModBase(956, remove ? 10 : (-10));
2084 break;
2085 case 925:
2086 elements.ModBase(962, remove ? 10 : (-10));
2087 break;
2088 case 922:
2089 elements.ModBase(965, remove ? 10 : (-10));
2090 break;
2091 case 921:
2092 elements.ModBase(971, remove ? 10 : (-10));
2093 break;
2094 case 926:
2095 elements.ModBase(961, remove ? 10 : (-10));
2096 break;
2097 case 914:
2098 case 915:
2099 case 917:
2100 case 918:
2101 case 920:
2102 case 923:
2103 case 924:
2104 break;
2105 }
2106 }
2107 }
int _colorInt
Definition: Card.cs:65
CharaAbility _ability
Definition: Chara.cs:96
UD_String_ElementRef elements
Definition: GameSetting.cs:315

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

◆ SetMainElement() [2/2]

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

Definition at line 2031 of file Chara.cs.

2032 {
2033 if (!id.StartsWith("ele"))
2034 {
2035 id = "ele" + id;
2036 }
2037 SetMainElement(EClass.sources.elements.alias[id].id, v, elemental);
2038 }

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

9536 {
9537 SourceElement.Row row = EClass.sources.elements.map[idEle];
9539 Element element = elements.GetElement(idEle);
9540 Element element2 = elements.GetElement(row2.id);
9541 int num = element?.Value ?? 0;
9542 if (a < 0)
9543 {
9544 a = 0;
9545 }
9546 if (a > row.max)
9547 {
9548 a = row.max;
9549 }
9550 bool flag = (row.tag.Contains("neg") ? (a > num) : (a < num));
9551 if (a == 0 && (element == null || element.Value == 0))
9552 {
9554 return;
9555 }
9556 if (element != null && element.Value == a)
9557 {
9559 return;
9560 }
9561 if (element2 != null && element2.Value > 0)
9562 {
9563 SetFeat(element2.id, 0);
9564 }
9565 SetFeat(idEle, a);
9566 PlaySound("mutation");
9567 PlayEffect("mutation");
9569 Say(row.GetText(flag ? "textDec" : "textInc", returnNull: true) ?? row.alias, this);
9570 }

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

8523 {
8524 return SetAI(_NoGoalPC);
8525 }
static NoGoal _NoGoalPC
Definition: Chara.cs:194

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

◆ SetPCCState()

void Chara.SetPCCState ( PCCState  state)
inline

Definition at line 6448 of file Chara.cs.

6449 {
6450 if (IsPCC)
6451 {
6452 PCC.Get(pccData).Build(state);
6453 }
6454 }

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

6497 {
6498 p.mat = base.material;
6499 p.matColor = base.colorInt;
6500 if (!renderer.usePass)
6501 {
6502 return;
6503 }
6504 if (renderer.replacer != null)
6505 {
6506 p.tile = renderer.replacer.tile * ((!flipX) ? 1 : (-1));
6507 }
6508 else if (source._tiles_snow.Length != 0 && EClass._zone.IsSnowCovered)
6509 {
6510 if (source._tiles_snow.Length > 1)
6511 {
6512 int num = ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % source._tiles_snow.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6513 p.tile = source._tiles_snow[(num < source._tiles_snow.Length) ? num : 0] * ((!flipX) ? 1 : (-1));
6514 }
6515 else
6516 {
6517 p.tile = source._tiles_snow[0] * ((!flipX) ? 1 : (-1));
6518 }
6519 }
6520 else if (sourceCard._tiles.Length > 1)
6521 {
6522 int num2 = ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % sourceCard._tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6523 p.tile = sourceCard._tiles[(num2 >= 0 && num2 < sourceCard._tiles.Length) ? num2 : 0] * ((!flipX) ? 1 : (-1));
6524 }
6525 else
6526 {
6527 p.tile = sourceCard._tiles[0] * ((!flipX) ? 1 : (-1));
6528 }
6529 p.dir = base.dir;
6530 }
override bool flipX
Definition: Chara.cs:545
virtual bool IsSnowCovered
Definition: Spatial.cs:533

References RenderRow._tiles, SourceChara.Row._tiles_snow, EClass._zone, Spatial.IsSnowCovered, 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 7038 of file Chara.cs.

7039 {
7040 switch (m)
7041 {
7042 case UIList.SortMode.ByJob:
7043 sortVal = job._index * 10000 + sourceCard._index;
7044 break;
7045 case UIList.SortMode.ByRace:
7046 sortVal = race._index * 10000 * ((!IsHuman) ? 1 : (-1)) + sourceCard._index;
7047 break;
7048 case UIList.SortMode.ByFeat:
7049 sortVal = -GetTotalFeat();
7050 break;
7051 default:
7052 sortVal = sourceCard._index * ((!IsHuman) ? 1 : (-1));
7053 break;
7054 case UIList.SortMode.ByWorkk:
7055 break;
7056 }
7057 }
int sortVal
Definition: Card.cs:99
int GetTotalFeat()
Definition: Chara.cs:7795
Definition: UIList.cs:9
SortMode
Definition: UIList.cs:27

References SourceData< T, T2 >.BaseRow._index.

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

◆ SetSource()

override void Chara.SetSource ( )
inlinevirtual

Reimplemented from Card.

Definition at line 2019 of file Chara.cs.

2020 {
2021 source = EClass.sources.charas.map.TryGetValue(id);
2022 if (source == null)
2023 {
2024 Debug.LogWarning("Chara " + id + " not found");
2025 id = "chicken";
2026 source = EClass.sources.charas.map[id];
2027 }
2028 path.walker = this;
2029 }
SourceChara charas

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

Referenced by Refresh().

◆ SetSummon()

void Chara.SetSummon ( int  duration)
inline

Definition at line 2326 of file Chara.cs.

2327 {
2328 base.c_summonDuration = duration;
2329 base.isSummon = true;
2330 }

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

7349 {
7350 if (t.IsRangedWeapon && t.category.slot == 0)
7351 {
7352 if (!CanEquipRanged(t))
7353 {
7354 return false;
7355 }
7356 int num = 0;
7357 foreach (Thing thing in things)
7358 {
7359 if (thing.IsRangedWeapon)
7360 {
7361 if (thing.category.slot != 0 && thing.isEquipped)
7362 {
7363 return false;
7364 }
7365 if (CanEquipRanged(thing) && thing.GetEquipValue() > num)
7366 {
7367 num = thing.GetEquipValue();
7368 }
7369 }
7370 }
7371 if (t.GetEquipValue() > num)
7372 {
7373 return true;
7374 }
7375 return false;
7376 }
7377 BodySlot bodySlot = body.GetSlot(t);
7378 if (bodySlot == null)
7379 {
7380 return false;
7381 }
7382 if (useFav)
7383 {
7384 switch (GetFavAttackStyle())
7385 {
7386 case AttackStyle.Default:
7387 case AttackStyle.TwoHand:
7388 if (t.IsMeleeWeapon)
7389 {
7390 bodySlot = body.slotMainHand;
7391 }
7392 else if (bodySlot.elementId == 35)
7393 {
7394 return false;
7395 }
7396 break;
7397 case AttackStyle.Shield:
7398 if (t.IsMeleeWeapon)
7399 {
7400 bodySlot = body.slotMainHand;
7401 }
7402 else if (bodySlot.elementId == 35 && t.IsMeleeWeapon)
7403 {
7404 return false;
7405 }
7406 break;
7407 case AttackStyle.TwoWield:
7408 if (bodySlot.elementId == 35 && !t.IsMeleeWeapon)
7409 {
7410 return false;
7411 }
7412 break;
7413 }
7414 }
7415 if (!body.IsEquippable(t, bodySlot, text: false))
7416 {
7417 return false;
7418 }
7419 if (bodySlot.thing != null && (bodySlot.thing.blessedState <= BlessedState.Cursed || bodySlot.thing.GetEquipValue() >= t.GetEquipValue()))
7420 {
7421 return false;
7422 }
7423 if (t.HasTag(CTAG.gift))
7424 {
7425 return false;
7426 }
7427 return true;
7428 }
bool IsMeleeWeapon
Definition: Card.cs:2203
BlessedState blessedState
Definition: Card.cs:264
bool IsEquippable(Thing thing, BodySlot slot, bool text=true)
Definition: CharaBody.cs:106
AttackStyle GetFavAttackStyle()
Definition: Chara.cs:4545

References Card.blessedState, Card.category, BodySlot.elementId, Card.GetEquipValue(), CharaBody.GetSlot(), Card.HasTag(), CharaBody.IsEquippable(), Thing.isEquipped, Card.IsMeleeWeapon, Card.IsRangedWeapon, CharaBody.slotMainHand, and BodySlot.thing.

◆ ShouldThrowAway()

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

Definition at line 8149 of file Chara.cs.

8150 {
8151 if (IsPCFaction)
8152 {
8153 if (t.IsFood && t.category.id != "fish" && !t.IsDecayed)
8154 {
8155 return false;
8156 }
8157 if (t.trait.GetHealAction(this) != null)
8158 {
8159 return false;
8160 }
8161 if (t.IsThrownWeapon || t.IsRangedWeapon || t.IsAmmo)
8162 {
8163 return false;
8164 }
8165 if (t.trait is TraitBlanket || t.trait is TraitItemProc || t.trait is TraitBookSkill)
8166 {
8167 return false;
8168 }
8169 }
8170 if (t.isEquipped || t.rarity >= Rarity.Legendary || !t.trait.CanBeDestroyed)
8171 {
8172 return false;
8173 }
8174 if (t.trait is TraitCurrency || t.trait is TraitTool)
8175 {
8176 return false;
8177 }
8178 switch (type)
8179 {
8180 case ClearInventoryType.SellAtTown:
8181 if (!t.isGifted && !t.isNPCProperty)
8182 {
8183 return false;
8184 }
8185 break;
8186 case ClearInventoryType.Purge:
8187 switch (t.category.id)
8188 {
8189 case "fish":
8190 if (EClass.rnd(3) == 0)
8191 {
8192 return true;
8193 }
8194 break;
8195 case "junk":
8196 case "garbage":
8197 if (EClass.rnd(3) != 0)
8198 {
8199 return true;
8200 }
8201 break;
8202 }
8203 if (t.id == "flyer")
8204 {
8205 return true;
8206 }
8207 if (!t.IsDecayed && EClass.rnd(3) == 0)
8208 {
8209 return false;
8210 }
8211 if (!things.IsFull() && t.IsRangedWeapon)
8212 {
8213 return false;
8214 }
8215 break;
8216 }
8217 return true;
8218 }
bool IsThrownWeapon
Definition: Card.cs:2207
bool IsFood
Definition: Card.cs:2137
bool isGifted
Definition: Card.cs:768
virtual Action GetHealAction(Chara c)
Definition: Trait.cs:598

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

◆ ShowDialog() [1/2]

void Chara.ShowDialog ( )
inline

Definition at line 6796 of file Chara.cs.

6797 {
6798 Zone_Nymelle zone_Nymelle = EClass._zone as Zone_Nymelle;
6799 if (conSuspend != null && IsPCParty)
6800 {
6801 RemoveCondition<ConSuspend>();
6802 }
6803 if (LayerDrama.forceJump == null)
6804 {
6805 if (IsDeadOrSleeping)
6806 {
6807 ShowDialog("_chara", "sleep");
6808 return;
6809 }
6810 if (EClass.pc.isHidden && !CanSee(EClass.pc))
6811 {
6812 ShowDialog("_chara", "invisible");
6813 return;
6814 }
6816 {
6818 ShowDialog("_chara", "give_card");
6819 Thing thing = ThingGen.Create("figure");
6820 thing.MakeFigureFrom(id);
6821 EClass.player.DropReward(thing);
6822 thing = ThingGen.Create("figure3");
6823 thing.MakeFigureFrom(id);
6824 EClass.player.DropReward(thing);
6825 return;
6826 }
6827 if (GetInt(71) == -2)
6828 {
6829 ShowDialog("_chara", "give_lunch");
6830 Thing t = CraftUtil.MakeLoveLunch(this);
6832 SetInt(71, EClass.world.date.GetRaw() + 43200);
6833 return;
6834 }
6835 if (base.isRestrained)
6836 {
6837 ShowDialog("_chara", "strain");
6838 return;
6839 }
6840 if (IsEscorted())
6841 {
6842 ShowDialog("_chara", "escort");
6843 return;
6844 }
6845 if (EClass._zone is Zone_Music)
6846 {
6847 ShowDialog("_chara", "party");
6848 return;
6849 }
6850 if (EClass.game.quests.OnShowDialog(this))
6851 {
6852 return;
6853 }
6854 switch (id)
6855 {
6856 case "loytel":
6857 {
6859 {
6860 EClass.game.quests.Get("pre_debt_runaway").Complete();
6861 EClass.player.flags.loytelEscaped = false;
6862 EClass.game.quests.Add("debt", "loytel");
6863 ShowDialog("loytel", "loytelEscaped");
6864 return;
6865 }
6866 QuestDebt questDebt = EClass.game.quests.Get<QuestDebt>();
6867 if (questDebt != null && questDebt.paid)
6868 {
6869 questDebt.stage++;
6870 if (questDebt.stage > 7)
6871 {
6872 questDebt.stage = 7;
6873 }
6874 ShowDialog("loytel", "debt" + questDebt.stage);
6875 return;
6876 }
6877 break;
6878 }
6879 case "farris":
6880 if (EClass._zone.id == "startVillage" || EClass._zone.id == "startVillage3" || EClass.game.IsSurvival)
6881 {
6882 ShowDialog("farris");
6883 return;
6884 }
6885 switch (EClass.game.quests.GetPhase<QuestExploration>())
6886 {
6887 case -1:
6888 ShowDialog("farris", "nymelle_noQuest");
6889 break;
6890 case 0:
6891 ShowDialog("farris", "nymelle_first");
6892 break;
6893 case 1:
6894 ShowDialog("farris", "home_first");
6895 break;
6896 default:
6897 ShowDialog("farris");
6898 break;
6899 }
6900 return;
6901 case "ashland":
6902 ShowDialog("ashland");
6903 return;
6904 case "fiama":
6905 if (zone_Nymelle != null && zone_Nymelle.IsCrystalLv && EClass.game.quests.GetPhase<QuestExploration>() == 3)
6906 {
6907 SoundManager.ForceBGM();
6908 LayerDrama.ActivateMain("mono", "nymelle_crystal");
6909 }
6911 {
6913 {
6914 EClass.player.flags.fiamaFirstDream = true;
6915 ShowDialog("fiama", "firstDream");
6916 }
6918 {
6919 ShowDialog("fiama", "giveStoryBook").SetOnKill(delegate
6920 {
6921 EClass.player.flags.fiamaStoryBookGiven = true;
6922 EClass.player.DropReward(ThingGen.Create("book_story"));
6923 });
6924 }
6925 else
6926 {
6927 ShowDialog("fiama");
6928 }
6929 }
6930 else
6931 {
6932 ShowDialog("fiama");
6933 }
6934 return;
6935 case "big_sister":
6937 {
6938 ShowDialog("big_sister", "little_saved");
6939 EClass.player.flags.little_saved = false;
6940 return;
6941 }
6943 {
6944 ShowDialog("big_sister", "little_dead");
6945 EClass.player.flags.little_killed = false;
6946 return;
6947 }
6948 break;
6949 }
6950 if (trait is TraitGuildDoorman)
6951 {
6952 string tag = ((trait is TraitDoorman_Fighter) ? "fighter" : ((trait is TraitDoorman_Mage) ? "mage" : "thief"));
6953 ShowDialog("guild_doorman", "main", tag);
6954 return;
6955 }
6956 if (trait is TraitGuildClerk)
6957 {
6958 string tag2 = ((trait is TraitClerk_Fighter) ? "fighter" : ((trait is TraitClerk_Mage) ? "mage" : "thief"));
6959 ShowDialog("guild_clerk", "main", tag2);
6960 return;
6961 }
6962 }
6963 bool flag = true;
6964 if (id == "parttimer_jure" && (!EClass._zone.IsFestival || !(EClass._zone is Zone_Noyel) || EClass.pc.faith == EClass.game.religions.Healing))
6965 {
6966 flag = false;
6967 }
6968 if (flag && File.Exists(CorePath.DramaData + id + ".xlsx"))
6969 {
6970 ShowDialog(id);
6971 }
6972 else
6973 {
6974 ShowDialog("_chara");
6975 }
6976 }
bool CanGiveCard()
Definition: Affinity.cs:63
void MakeFigureFrom(string id)
Definition: Card.cs:5539
void ShowDialog()
Definition: Chara.cs:6796
bool DroppedCard(string id)
Definition: CodexManager.cs:46
void MarkCardDrop(string id)
Definition: CodexManager.cs:41
static string DramaData
Definition: CorePath.cs:178
static Thing MakeLoveLunch(Chara c)
Definition: CraftUtil.cs:122
bool IsSurvival
Definition: Game.cs:272
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:470
int storyFiama
Definition: Player.cs:602
bool little_saved
Definition: Player.cs:434
bool fiamaStoryBookGiven
Definition: Player.cs:290
bool fiamaFirstDream
Definition: Player.cs:302
bool little_killed
Definition: Player.cs:446
CodexManager codex
Definition: Player.cs:1071
bool EnableDreamStory
Definition: Player.cs:1224
Thing DropReward(Thing t, bool silent=false)
Definition: Player.cs:2475
bool paid
Definition: QuestDebt.cs:10
int stage
Definition: QuestDebt.cs:13
bool OnShowDialog(Chara c)
Quest Add(string id, string idGlobalChara=null)
Definition: QuestManager.cs:29
Quest Get(string id)
void Complete()
Definition: Quest.cs:468
ReligionHealing Healing
bool IsCrystalLv
Definition: Zone_Nymelle.cs:25
virtual bool IsFestival
Definition: Zone.cs:206

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

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

◆ ShowDialog() [2/2]

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

Definition at line 6978 of file Chara.cs.

6979 {
6980 return _ShowDialog(book, null, step, tag);
6981 }
LayerDrama _ShowDialog(string book, string sheet, string step="main", string tag="")
Definition: Chara.cs:6983

References book.

◆ Sleep()

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

Definition at line 9328 of file Chara.cs.

9329 {
9330 RemoveCondition<ConAwakening>();
9331 AddCondition(Condition.Create(100, delegate(ConSleep con)
9332 {
9333 con.pcSleep = 15;
9334 con.pcBed = bed;
9335 con.pcPillow = pillow;
9336 con.pickup = pickup;
9337 con.posBed = posBed;
9338 con.posPillow = posPillow;
9339 }), force: true);
9340 }

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

7786 {
7787 Say("abCatSniff", this, c);
7788 AddCondition<ConHOT>(EClass.curve(50 + c.CHA * 5, 400, 100));
7789 c.ShowEmo(Emo.angry);
7790 ShowEmo(Emo.love);
7791 Talk("sniff");
7792 c.Talk(new string[4] { "labor", "disgust", "scold", "callGuards" }.RandomItem());
7793 }

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

4481 {
4482 return held.Split(a);
4483 }

References Card.Split().

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

◆ Stumble()

void Chara.Stumble ( int  mtp = 100)
inline

Definition at line 1798 of file Chara.cs.

1799 {
1800 bool flag = EClass._map.FindThing((Thing t) => t.IsInstalled && t.pos.Equals(EClass.pc.pos) && t.trait is TraitStairsUp) != null;
1801 Say(flag ? "dmgBurdenStairs" : "dmgBurdenFallDown", this);
1802 int num = MaxHP;
1803 if (Evalue(1421) > 0)
1804 {
1805 num = mana.max;
1806 }
1807 int num2 = (num * (base.ChildrenWeight * 100 / WeightLimit) / (flag ? 100 : 200) + 1) * mtp / 100;
1808 if (base.hp <= 0)
1809 {
1810 num2 *= 2;
1811 }
1812 DamageHP(num2, flag ? AttackSource.BurdenStairs : AttackSource.BurdenFallDown);
1813 }
Thing FindThing(Func< Thing, bool > func)
Definition: Map.cs:2592

References EClass._map, Card.DamageHP(), Point.Equals(), Card.Evalue(), Map.FindThing(), Card.IsInstalled, mana, Stats.max, MaxHP, EClass.pc, Card.pos, Card.Say(), Card.trait, and WeightLimit.

Referenced by TraitTrap.OnActivateTrap(), and Scene.OnUpdate().

◆ SyncRide() [1/2]

void Chara.SyncRide ( )
inline

Definition at line 3826 of file Chara.cs.

3827 {
3828 if (host != null)
3829 {
3830 host.SyncRide();
3831 }
3832 if (ride != null)
3833 {
3834 SyncRide(ride);
3835 }
3836 if (parasite != null)
3837 {
3839 }
3840 }

References SyncRide().

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

◆ SyncRide() [2/2]

void Chara.SyncRide ( Chara  c)
inline

Definition at line 3842 of file Chara.cs.

3843 {
3844 if (!c.pos.Equals(pos))
3845 {
3846 if (!pos.IsValid)
3847 {
3848 Debug.LogError("exception: pos is not valid:" + pos?.ToString() + "/" + this);
3849 pos = new Point();
3850 }
3851 EClass._map.MoveCard(pos, c);
3852 }
3853 }

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

◆ TalkTopic()

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

Definition at line 6725 of file Chara.cs.

6726 {
6727 if (host == null && !IsInActiveZone)
6728 {
6729 return null;
6730 }
6731 if (!isSynced && (host == null || !host.isSynced) && topic != "dead")
6732 {
6733 return null;
6734 }
6735 if (IsPCParty)
6736 {
6737 int num = EClass.pc.party.members.Count - 1;
6738 switch (topic)
6739 {
6740 case "calm":
6741 if (EClass.rnd(num * 5) != 0)
6742 {
6743 return null;
6744 }
6745 break;
6746 case "aggro":
6747 if (EClass.rnd(num * 10) != 0)
6748 {
6749 return null;
6750 }
6751 break;
6752 case "kill":
6753 if (EClass.rnd(num * 3) != 0)
6754 {
6755 return null;
6756 }
6757 break;
6758 case "fov":
6759 return null;
6760 }
6761 }
6762 string topicText = GetTopicText(topic);
6763 if (topicText.IsEmpty())
6764 {
6765 return null;
6766 }
6767 string text = "_bracketTalk".lang();
6768 bool flag = topicText.StartsWith("*");
6769 bool flag2 = topicText.StartsWith("(");
6770 bool flag3 = topicText.StartsWith(text) || (topicText.Length > 0 && topicText[0] == text[0]) || topicText[0] == '“';
6771 topicText = ApplyTone(topicText);
6772 topicText = topicText.Replace("~", "*");
6773 Msg.SetColor(flag2 ? Msg.colors.Thinking : (flag3 ? Msg.colors.Talk : Msg.colors.Ono));
6774 Msg.Say(topicText.Replace("&", ""));
6775 if (topic == "dead")
6776 {
6777 EClass.ui.popGame.PopText(ApplyNewLine(topicText.StripBrackets()), null, "PopTextDead", default(Color), pos.Position() + EClass.setting.render.tc.textPosDead);
6778 }
6779 else if (flag || flag3 || flag2)
6780 {
6781 (host ?? this).renderer.Say(ApplyNewLine(topicText.StripBrackets()), default(Color), IsPCParty ? 0.6f : 0f);
6782 }
6783 return topicText;
6784 }
void Say(string text, Color c=default(Color), float duration=0f)
string ApplyNewLine(string text)
Definition: Card.cs:6553
string ApplyTone(string text, bool stripPun=false)
Definition: Card.cs:6632
string GetTopicText(string topic="calm")
Definition: Chara.cs:6692
static UI ui
Definition: EClass.cs:16
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_Idle.Run().

◆ Tick()

override void Chara.Tick ( )
inlinevirtual

Reimplemented from Card.

Definition at line 3855 of file Chara.cs.

3856 {
3857 SyncRide();
3858 combatCount--;
3859 ignoreSPAbsorb = false;
3860 if (IsPC)
3861 {
3862 if (hasMovedThisTurn)
3863 {
3864 pos.Things.ForeachReverse(delegate(Thing t)
3865 {
3867 {
3868 AI_Goto aI_Goto = ai.Current as AI_Goto;
3869 if ((aI_Goto == null && !(ai is GoalManualMove)) || (aI_Goto != null && !aI_Goto.dest.Equals(pos)))
3870 {
3871 return;
3872 }
3873 }
3874 t.trait.OnStepped(this);
3875 });
3876 if (isDead)
3877 {
3878 return;
3879 }
3880 hasMovedThisTurn = false;
3882 {
3883 EClass.player.haltMove = false;
3884 ActionMode.Adv.TryCancelInteraction(sound: false);
3885 EInput.Consume(1);
3886 return;
3887 }
3888 if (EClass._zone.IsRegion)
3889 {
3891 {
3892 foreach (Chara member in EClass.pc.party.members)
3893 {
3894 if (member.hunger.value > 65)
3895 {
3896 member.InstantEat(null, sound: false);
3897 }
3898 }
3899 }
3900 Chara chara = null;
3902 if (cell2 != null && (cell2.zone == null || (cell2.zone is Zone_Field && !cell2.zone.IsPCFaction)))
3903 {
3904 foreach (Chara chara2 in EClass._map.charas)
3905 {
3906 if (!chara2.IsPCFactionOrMinion && !chara2.IsGlobal && chara2.pos.Equals(EClass.pc.pos))
3907 {
3908 chara = chara2;
3909 break;
3910 }
3911 }
3912 }
3913 if (chara != null)
3914 {
3916 {
3917 EClass.player.safeTravel = 5 + EClass.rnd(5);
3918 }
3919 EClass._zone.RemoveCard(chara);
3920 Msg.Say("encounter");
3921 EClass.player.EnterLocalZone(encounter: true, chara);
3922 }
3923 else if (EClass.player.safeTravel <= 0)
3924 {
3925 if (cell2 != null && cell2.zone == null && !EClass.debug.ignoreEncounter)
3926 {
3928 if (!tileInfo.shore)
3929 {
3930 bool num = EClass.pc.HasCondition<ConWardMonster>();
3931 bool flag = EClass.pc.HasCondition<ConDrawMonster>();
3932 bool flag2 = EClass.game.quests.Get<QuestEscort>() != null;
3933 int num2 = (tileInfo.isRoad ? 22 : 12);
3934 if (flag2)
3935 {
3936 num2 = (tileInfo.isRoad ? 16 : 10);
3937 }
3938 if (num)
3939 {
3940 num2 *= (flag2 ? 2 : 20);
3941 }
3942 if (flag)
3943 {
3944 num2 /= 2;
3945 }
3946 if (EClass.rnd(num2) == 0)
3947 {
3948 Msg.Say("encounter");
3949 if (!flag)
3950 {
3951 EClass.player.safeTravel = 5 + EClass.rnd(5);
3952 }
3953 EClass.player.EnterLocalZone(encounter: true);
3954 }
3955 }
3956 }
3957 }
3958 else
3959 {
3961 }
3962 }
3963 }
3964 EClass.player.pickupDelay = 0f;
3965 if (EClass.player.returnInfo != null)
3966 {
3968 if (EClass.player.returnInfo.turns <= 0)
3969 {
3971 {
3972 EClass.player.returnInfo = null;
3974 }
3975 else
3976 {
3978 {
3979 int uidDest = EClass.player.returnInfo.uidDest;
3980 Zone zone = null;
3981 if (uidDest != 0)
3982 {
3983 zone = EClass.game.spatials.map.TryGetValue(uidDest) as Zone;
3984 }
3985 if (zone == null || zone.destryoed)
3986 {
3987 zone = EClass.world.region;
3988 }
3990 {
3991 Msg.Say("returnFail");
3992 }
3993 else
3994 {
3995 Msg.Say("returnComplete");
3996 EClass.player.uidLastTravelZone = 0;
3998 EClass.player.lastZonePos = null;
3999 }
4000 EClass.player.returnInfo = null;
4001 return;
4002 }
4003 EClass.player.returnInfo = null;
4004 Msg.Say("returnOverweight");
4005 }
4006 }
4007 }
4008 if ((HasNoGoal || !ai.IsRunning) && !WillConsumeTurn())
4009 {
4011 return;
4012 }
4015 {
4016 RecipeUpdater.dirty = true;
4017 }
4019 }
4020 else
4021 {
4022 actTime = EClass.player.baseActTime * Mathf.Max(0.1f, (float)EClass.pc.Speed / (float)Speed);
4023 hasMovedThisTurn = false;
4024 }
4027 {
4028 return;
4029 }
4031 if (host != null && !consumeTurn)
4032 {
4033 if (host.ride == this && ((host.hasMovedThisTurn && IsInCombat) || (enemy != null && turn % 3 != 0)))
4034 {
4035 consumeTurn = true;
4036 }
4037 if (host.parasite == this && enemy != null && EClass.rnd(10) > EClass.rnd(host.Evalue(227) + 10))
4038 {
4039 if (Dist(enemy) < 3 && EClass.rnd(2) == 0)
4040 {
4041 Say("parasite_fail", this, host);
4042 if (EClass.rnd(2) == 0 && GetInt(106) == 0)
4043 {
4044 Talk("parasite_fail");
4045 }
4046 }
4047 consumeTurn = true;
4048 }
4049 }
4050 if (consumeTurn)
4051 {
4052 if (IsPC)
4053 {
4055 }
4056 }
4057 else
4058 {
4059 if (base.isRestrained)
4060 {
4061 TryUnrestrain();
4062 }
4063 if (enemy != null)
4064 {
4066 {
4067 enemy = null;
4068 }
4069 else if (!IsPC && (ai.CancelOnAggro || !ai.IsRunning))
4070 {
4071 SetAIAggro();
4072 }
4073 }
4074 if (HasNoGoal || !ai.IsRunning)
4075 {
4076 ChooseNewGoal();
4077 }
4078 ai.Tick();
4079 }
4080 Cell cell = base.Cell;
4082 {
4083 AddCondition<ConWet>(50);
4084 if (pos.IsHotSpring)
4085 {
4086 hygiene.Mod(2);
4087 }
4088 }
4089 if (IsPC && !EClass._zone.IsRegion && cell.CanSuffocate() && !EClass.debug.godMode)
4090 {
4091 AddCondition<ConSuffocation>(800 / (100 + EvalueMax(200, -5) * 10), force: true);
4092 }
4093 CellEffect e;
4094 if (cell.effect != null)
4095 {
4096 e = cell.effect;
4097 switch (e.id)
4098 {
4099 case 1:
4100 case 2:
4101 case 4:
4102 if (IsLevitating)
4103 {
4104 Say("levitating");
4105 break;
4106 }
4107 AddCondition<ConWet>(50);
4108 ProcEffect();
4109 break;
4110 case 3:
4111 PlaySound("fire_step");
4112 AddCondition<ConBurning>(30);
4113 break;
4114 case 5:
4115 if (!isWet)
4116 {
4117 PlaySound("bubble");
4118 AddCondition<ConWet>(30);
4119 ProcEffect();
4120 }
4121 break;
4122 case 6:
4123 if (hasMovedThisTurn)
4124 {
4125 Say("abMistOfDarkness_step", this);
4126 }
4127 break;
4128 }
4129 }
4130 if (IsPC)
4131 {
4132 if (EClass.player.currentHotItem.Thing != null)
4133 {
4135 }
4137 }
4138 void ClearEffect()
4139 {
4140 EClass._map.SetLiquid(cell.x, cell.z, 0, 0);
4141 }
4142 void ProcEffect()
4143 {
4144 if (e.idEffect != 0)
4145 {
4146 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
4147 {
4148 aliasEle = EClass.sources.elements.map[e.idEle].alias,
4149 n1 = e.n1
4150 });
4151 ClearEffect();
4152 }
4153 }
4154 }
virtual bool CancelOnAggro
Definition: AIAct.cs:80
bool TryCancelInteraction(bool sound=true)
Definition: AM_Adv.cs:1069
void SetTurbo(int mtp=-1)
Definition: AM_Adv.cs:1040
virtual void OnEndPlayerTurn()
int turn
Definition: Card.cs:63
void TryUnrestrain(bool force=false, Chara c=null)
Definition: Card.cs:6866
bool isHostileAct
Definition: CellEffect.cs:74
EffectId idEffect
Definition: CellEffect.cs:38
bool isCursed
Definition: CellEffect.cs:98
bool isBlessed
Definition: CellEffect.cs:86
CellEffect effect
Definition: Cell.cs:94
byte z
Definition: Cell.cs:58
byte x
Definition: Cell.cs:56
void InstantEat(Thing t=null, bool sound=true)
Definition: Chara.cs:7306
int Speed
Definition: Chara.cs:1069
static bool consumeTurn
Definition: Chara.cs:178
void SetAIAggro()
Definition: Chara.cs:8517
bool ignoreSPAbsorb
Definition: Chara.cs:146
void ChooseNewGoal()
Definition: Chara.cs:8398
bool WillConsumeTurn()
Definition: Chara.cs:3598
bool ignoreEncounter
Definition: CoreDebug.cs:201
bool shore
Definition: EloMap.cs:50
TileInfo GetTileInfo(int gx, int gy)
Definition: EloMap.cs:286
ConfigPreference preference
Definition: Game.cs:96
virtual Thing Thing
Definition: HotItem.cs:38
void SetLiquid(int x, int z, CellEffect effect=null)
Definition: Map.cs:1477
static string SayNothingHappen()
Definition: Msg.cs:96
int turns
Definition: Player.cs:84
bool haltMove
Definition: Player.cs:1127
float baseActTime
Definition: Player.cs:1155
void EnterLocalZone(bool encounter=false, Chara mob=null)
Definition: Player.cs:1885
HotItem currentHotItem
Definition: Player.cs:1056
int safeTravel
Definition: Player.cs:879
int eloY
Definition: Point.cs:81
int eloX
Definition: Point.cs:79
bool IsHotSpring
Definition: Point.cs:363
bool destryoed
Definition: Spatial.cs:45
virtual void OnTickHeld()
Definition: Trait.cs:1045
virtual bool IgnoreOnSteppedWhenMoving
Definition: Trait.cs:370
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 3610 of file Chara.cs.

3611 {
3612 if (_cooldowns != null)
3613 {
3614 TickCooldown();
3615 }
3616 turn++;
3617 consumeTurn = false;
3618 preventRegen = false;
3619 emoIcon = Emo2.none;
3620 if (base.isSummon)
3621 {
3622 base.c_summonDuration--;
3623 if (base.c_summonDuration <= 0)
3624 {
3625 Die();
3626 return;
3627 }
3628 }
3630 {
3631 AddCondition<ConWet>(20);
3632 }
3633 switch (turn % 50)
3634 {
3635 case 0:
3636 happiness = (hunger.value + stamina.value + depression.value + bladder.value + hygiene.value) / 5;
3637 break;
3638 case 1:
3639 if (!IsPC || !EClass.debug.godMode)
3640 {
3641 if (EClass.rnd(2) == 0 && !HasCondition<ConAwakening>())
3642 {
3643 sleepiness.Mod(1);
3644 }
3645 if (EClass.rnd(3) == 0)
3646 {
3647 hunger.Mod(1);
3648 }
3649 if (IsPC && (sleepiness.GetPhase() != 0 || stamina.GetPhase() <= 1))
3650 {
3651 Tutorial.Play("sleep");
3652 }
3653 }
3654 break;
3655 case 2:
3656 if (parasite != null)
3657 {
3658 ModExp(227, (EClass._zone.IsRegion ? 5 : 40) * 100 / Mathf.Max(100, 100 + (elements.Base(227) - parasite.LV) * 25));
3659 }
3660 if (ride != null)
3661 {
3662 ModExp(226, (EClass._zone.IsRegion ? 5 : 40) * 100 / Mathf.Max(100, 100 + (elements.Base(226) - ride.LV) * 25));
3663 }
3664 break;
3665 case 3:
3666 {
3667 int phase = hygiene.GetPhase();
3668 int num = 0;
3669 num = ((!IsPC) ? ((phase > 3) ? 50 : 0) : ((phase > 3) ? 50 : 0));
3670 if (num > EClass.rnd(100))
3671 {
3672 hygiene.Mod(-1);
3673 }
3674 break;
3675 }
3676 }
3677 if (turn % 200 == 0)
3678 {
3680 }
3681 if (IsPCParty)
3682 {
3683 if (dirtyWeight)
3684 {
3685 CalcBurden();
3686 }
3687 int phase2 = burden.GetPhase();
3688 int phase3 = hunger.GetPhase();
3689 if (phase3 >= 4)
3690 {
3691 preventRegen = true;
3692 }
3693 if (EClass.rnd(EClass._zone.IsRegion ? 100 : 30) == 0 && phase2 >= 3)
3694 {
3695 Say("dmgBurden", this);
3696 DamageHP(MaxHP * (base.ChildrenWeight * 100 / WeightLimit) / 1000 + 1, AttackSource.Burden);
3697 if (isDead)
3698 {
3699 return;
3700 }
3701 }
3702 if (EClass.rnd(12) == 0)
3703 {
3704 if (IsPC)
3705 {
3706 if (phase2 > 0)
3707 {
3708 ModExp(207, 1 + phase2 * phase2);
3709 }
3710 }
3711 else
3712 {
3713 ModExp(207, 4);
3714 }
3715 }
3716 if (IsPC)
3717 {
3718 if (phase3 >= 5)
3719 {
3720 if (!(ai is AI_Eat) && EClass.rnd(5) == 0)
3721 {
3722 DamageHP(1 + EClass.rnd(2) + MaxHP / 50, AttackSource.Hunger);
3723 }
3724 if (!isDead && EClass.rnd(3) == 0)
3725 {
3726 stamina.Mod(-1);
3727 }
3728 }
3729 if (isDead)
3730 {
3731 return;
3732 }
3733 phase3 = stamina.GetPhase();
3734 if (phase3 <= 0)
3735 {
3736 preventRegen = true;
3737 }
3739 {
3740 if (EClass.rnd(100) == 0 && !isConfused)
3741 {
3742 Msg.Say("rain_confuse");
3743 AddCondition<ConConfuse>(500);
3744 }
3745 if (EClass.rnd(300) == 0 && !isBlind)
3746 {
3747 Msg.Say("rain_confuse");
3748 AddCondition<ConBlind>(200);
3749 }
3750 }
3751 if (turn % (200000 / Mathf.Max(100 + Evalue(409) * 10, 50)) == 0)
3752 {
3753 ModCorruption(1);
3754 }
3755 }
3756 }
3757 if (!IsPC)
3758 {
3759 int num2 = Evalue(409);
3760 if (num2 > 0 && turn % (200000 / Mathf.Max(100 + num2 * 10, 50)) == 0)
3761 {
3762 ModCorruption(1);
3763 }
3764 }
3765 for (int num3 = conditions.Count - 1; num3 >= 0; num3--)
3766 {
3767 if (num3 < conditions.Count)
3768 {
3769 Condition condition = conditions[num3];
3770 if (!condition.TimeBased)
3771 {
3772 condition.Tick();
3773 }
3774 if (!condition.IsKilled)
3775 {
3776 if (condition.ConsumeTurn)
3777 {
3778 consumeTurn = true;
3779 }
3780 if (condition.PreventRegen)
3781 {
3782 preventRegen = true;
3783 }
3784 if (condition.EmoIcon != 0 && condition.EmoIcon > emoIcon)
3785 {
3786 emoIcon = condition.EmoIcon;
3787 }
3788 }
3789 if (isDead)
3790 {
3791 return;
3792 }
3793 }
3794 }
3795 if (id == "tsunami")
3796 {
3797 if (elements.Base(79) < 30)
3798 {
3799 Die();
3800 return;
3801 }
3802 if (IsInCombat)
3803 {
3804 elements.SetTo(79, elements.Base(79) * 3 / 4);
3805 }
3806 }
3807 if (!preventRegen)
3808 {
3809 if (EClass.rnd(25) == 0 && base.hp < MaxHP)
3810 {
3811 HealHP(EClass.rnd(Evalue(300) / 3 + 1) + 1);
3812 elements.ModExp(300, 8f);
3813 }
3814 if (EClass.rnd(8) == 0 && mana.value < mana.max)
3815 {
3816 mana.Mod(EClass.rnd(Evalue(301) / 2 + 1) + 1);
3817 elements.ModExp(301, 8f);
3818 }
3819 if (EClass.rnd(20) == 0 && !IsPC && stamina.value < stamina.max)
3820 {
3821 stamina.Mod(EClass.rnd(5) + 1);
3822 }
3823 }
3824 }
Emo2
Definition: Emo2.cs:2
Definition: AI_Eat.cs:5
virtual bool PreventRegen
virtual bool TimeBased
virtual Emo2 EmoIcon
Definition: BaseStats.cs:17
bool dirtyWeight
Definition: Card.cs:83
bool HasRoof
Definition: Cell.cs:648
void TickCooldown()
Definition: Chara.cs:8379
void DiminishTempElements(int a=1)
Definition: Chara.cs:9902
Emo2 emoIcon
Definition: Chara.cs:106
override void Die(Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None, Chara originalTarget=null)
Definition: Chara.cs:5132
void ModCorruption(int a)
Definition: Chara.cs:9426
bool isBlind
Definition: Chara.cs:130
static bool preventRegen
Definition: Chara.cs:180
void CalcBurden()
Definition: Chara.cs:1783
virtual bool IsKilled
Definition: Condition.cs:7
override void Tick()
Definition: Condition.cs:70
void SetTo(int id, int v)
bool IsIndoor
Definition: Map.cs:131
static void Play(string idStep)
Definition: Tutorial.cs:7
bool IsRaining
Definition: Weather.cs:117

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

Referenced by _Move().

◆ TickCooldown()

void Chara.TickCooldown ( )
inline

Definition at line 8379 of file Chara.cs.

8380 {
8381 for (int num = _cooldowns.Count - 1; num >= 0; num--)
8382 {
8383 if (_cooldowns[num] % 1000 == 1)
8384 {
8385 _cooldowns.RemoveAt(num);
8386 }
8387 else
8388 {
8389 _cooldowns[num]--;
8390 }
8391 }
8392 if (_cooldowns.Count == 0)
8393 {
8394 _cooldowns = null;
8395 }
8396 }

◆ TickWork()

void Chara.TickWork ( VirtualDate  date)
inline

Definition at line 8799 of file Chara.cs.

8800 {
8802 if (span != TimeTable.Span.Work && span != 0)
8803 {
8804 return;
8805 }
8806 WorkSummary workSummary = GetWorkSummary();
8807 if (span == TimeTable.Span.Work)
8808 {
8809 if (workSummary.work != null)
8810 {
8811 PerformWork(workSummary.work, isHobby: false, date.IsRealTime);
8812 }
8813 }
8814 else if (workSummary.hobbies.Count > 0)
8815 {
8816 PerformWork(workSummary.hobbies.RandomItem(), isHobby: true, date.IsRealTime);
8817 }
8818 }
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 1154 of file Chara.cs.

1155 {
1156 return base.Name + "(" + ai?.ToString() + ")" + pos?.ToString() + "/" + base.ExistsOnMap + "/" + isDead;
1157 }
override string ToString()
Definition: Point.cs:512

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

4269 {
4270 if (!IsPC || !(t.trait is TraitRod) || t.c_charges <= 0 || !HasElement(1564))
4271 {
4272 return;
4273 }
4274 Say("absorbRod", this, t);
4275 TraitRod rod = t.trait as TraitRod;
4276 bool flag = false;
4277 if (rod.source != null)
4278 {
4279 using IEnumerator<SourceElement.Row> enumerator = EClass.sources.elements.rows.Where((SourceElement.Row a) => a.id == rod.source.id).GetEnumerator();
4280 if (enumerator.MoveNext())
4281 {
4282 SourceElement.Row current = enumerator.Current;
4283 if (IsPC)
4284 {
4285 GainAbility(current.id, t.c_charges * 100, t);
4286 flag = true;
4287 }
4288 }
4289 }
4290 if (!flag)
4291 {
4292 mana.Mod(-50 * t.c_charges);
4293 }
4294 t.c_charges = 0;
4296 }
int c_charges
Definition: Card.cs:1243
void GainAbility(int ele, int mtp=100, Thing origin=null)
Definition: Chara.cs:9668

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

7087 {
7088 if (!IsPCFaction && !IsGuest())
7089 {
7090 return null;
7091 }
7092 foreach (Card item in EClass._map.props.installed.all)
7093 {
7094 if (item.trait is TraitBed traitBed && traitBed.CanAssign(this))
7095 {
7096 traitBed.AddHolder(this);
7097 Msg.Say("claimBed", this);
7098 return traitBed;
7099 }
7100 }
7101 return null;
7102 }
bool CanAssign(Chara c)
Definition: TraitBed.cs:160

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

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

◆ TryDropBossLoot()

void Chara.TryDropBossLoot ( )
inline

Definition at line 5434 of file Chara.cs.

5435 {
5437 {
5438 return;
5439 }
5440 int num = 0;
5441 bool flag = false;
5442 bool flag2 = false;
5443 Point point = pos.GetNearestPoint(allowBlock: true, allowChara: false, allowInstalled: false, ignoreCenter: true) ?? pos;
5444 TreasureType type = TreasureType.BossQuest;
5445 if (EClass._zone.Boss == this)
5446 {
5447 type = TreasureType.BossNefia;
5448 num = 2 + EClass.rnd(2);
5449 flag = (flag2 = true);
5450 EClass._zone.Boss = null;
5451 Msg.Say("boss_win", EClass._zone.Name);
5453 {
5454 Msg.Say("boss_win_void", EClass._zone.Name);
5455 EClass.player.flags.KilledBossInVoid = true;
5456 }
5457 if (EClass._zone.IsNefia)
5458 {
5461 EClass.Sound.StopBGM(2f);
5462 SE.Play("Jingle/fanfare2");
5463 EClass._zone.SetBGM(114);
5464 }
5467 }
5468 switch (id)
5469 {
5470 case "vernis_boss":
5471 num = 5;
5472 flag = (flag2 = true);
5473 EClass.Sound.StopBGM(3f);
5474 EClass._zone.SetBGM(1, refresh: false);
5475 if (EClass.game.quests.GetPhase<QuestVernis>() == 8)
5476 {
5477 EClass.game.quests.Get<QuestVernis>().UpdateOnTalk();
5478 }
5479 break;
5480 case "lurie_boss":
5481 if (!(EClass._zone is Zone_Exile))
5482 {
5483 num = 5;
5484 flag = (flag2 = true);
5485 EClass.Sound.StopBGM(3f);
5486 EClass._zone.SetBGM(1, refresh: false);
5488 {
5489 EClass.game.quests.Get<QuestNegotiationDarkness>().ChangePhase(4);
5490 EClass.player.flags.killedDuponne = true;
5491 }
5492 }
5493 break;
5494 case "melilith_boss":
5495 num = 5;
5496 flag = (flag2 = true);
5497 EClass.Sound.StopBGM(3f);
5498 EClass._zone.SetBGM(1, refresh: false);
5499 break;
5500 case "fairy_raina":
5501 case "fairy_poina":
5502 {
5503 bool num2 = EClass._map.FindChara((id == "fairy_raina") ? "fairy_poina" : "fairy_raina") == null;
5504 QuestNasu questNasu = EClass.game.quests.Get<QuestNasu>();
5505 if (num2 && questNasu != null && questNasu.phase == 1)
5506 {
5507 num = 5;
5508 flag = (flag2 = true);
5509 EClass.Sound.StopBGM(3f);
5510 EClass._zone.SetBGM(1, refresh: false);
5511 EClass.player.DropReward(ThingGen.Create("backpack_holding"));
5512 questNasu.NextPhase();
5513 }
5514 break;
5515 }
5516 case "isygarad":
5517 {
5518 num = 5;
5519 flag = (flag2 = true);
5520 QuestExploration questExploration = EClass.game.quests.Get<QuestExploration>();
5521 if (questExploration != null)
5522 {
5523 SE.Play("kill_boss");
5524 questExploration.ChangePhase(3);
5525 EClass.Sound.StopBGM(3f);
5526 EClass._zone.SetBGM(1, refresh: false);
5527 }
5528 break;
5529 }
5530 case "swordkeeper":
5531 num = 10;
5532 flag = true;
5533 SE.Play("kill_boss");
5534 SoundManager.ForceBGM();
5535 LayerDrama.Activate("_event", "event", "swordkeeper_defeat");
5536 break;
5537 }
5538 if (flag)
5539 {
5540 SE.Play("kill_boss");
5541 }
5542 if (num != 0)
5543 {
5544 EClass.player.willAutoSave = true;
5545 Thing thing = ThingGen.CreateTreasure("chest_boss", base.LV, type);
5546 point.SetBlock();
5547 point.SetObj();
5548 EClass._zone.AddCard(thing, point).Install();
5549 ThingGen.TryLickChest(thing);
5550 }
5551 if (flag2)
5552 {
5554 }
5555 }
TreasureType
Definition: TreasureType.cs:2
bool KilledBossInVoid
Definition: Player.cs:410
long nefiaBeaten
Definition: Player.cs:127
void ModFame(int a)
Definition: Player.cs:2033
void SetObj(int id=0, int value=1, int dir=0)
Definition: Point.cs:912
void SetBlock(int idMat=0, int idBlock=0)
Definition: Point.cs:902
int phase
Definition: Quest.cs:40
void NextPhase()
Definition: Quest.cs:567
void ChangePhase(int a)
Definition: Quest.cs:572
bool isConquered
Definition: Spatial.cs:382
static void TryLickChest(Thing chest)
Definition: ThingGen.cs:397
static Thing CreateTreasure(string id, int lv, TreasureType type=TreasureType.Map)
Definition: ThingGen.cs:244
static Thing CreateScroll(int ele, int num=1)
Definition: ThingGen.cs:182
void SetBGM(List< int > ids, bool refresh=true)
Definition: Zone.cs:2867
virtual bool IsNefia
Definition: Zone.cs:280
Chara Boss
Definition: Zone.cs:83

References EClass._map, EClass._zone, LayerDrama.Activate(), Zone.AddCard(), Zone.Boss, Quest.ChangePhase(), ThingGen.Create(), ThingGen.CreateScroll(), ThingGen.CreateTreasure(), Zone.DangerLv, EClass.debug, Player.DropReward(), CoreDebug.enable, Map.FindChara(), Player.flags, EClass.game, QuestManager.Get(), Point.GetNearestPoint(), Zone.GetTopZone(), Card.Install(), Spatial.isConquered, Zone.IsNefia, Player.Flags.KilledBossInVoid, 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 4485 of file Chara.cs.

4486 {
4487 if (held != null && held.trait.CanOnlyCarry)
4488 {
4489 DropHeld();
4490 }
4491 foreach (Thing item in things.List((Thing t) => t.trait.CanOnlyCarry))
4492 {
4493 DropThing(item);
4494 }
4495 }
void DropThing(Thing t, int num=-1)
Definition: Chara.cs:4517

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

◆ TryEquip()

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

Definition at line 7430 of file Chara.cs.

7431 {
7432 if (!ShouldEquip(t, useFav))
7433 {
7434 return false;
7435 }
7436 if (t.category.slot == 0)
7437 {
7438 return false;
7439 }
7440 if (useFav)
7441 {
7442 BodySlot slot = body.GetSlot(t);
7443 switch (GetFavAttackStyle())
7444 {
7445 case AttackStyle.Default:
7446 case AttackStyle.TwoHand:
7447 if (t.IsMeleeWeapon)
7448 {
7449 slot = body.slotMainHand;
7450 }
7451 break;
7452 case AttackStyle.Shield:
7453 if (t.IsMeleeWeapon)
7454 {
7455 slot = body.slotMainHand;
7456 }
7457 break;
7458 }
7459 body.Equip(t, slot);
7460 }
7461 else
7462 {
7463 body.Equip(t);
7464 }
7465 Say("equip", this, t);
7466 return true;
7467 }
bool ShouldEquip(Thing t, bool useFav=false)
Definition: Chara.cs:7348

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

7551 {
7552 if (IsPC)
7553 {
7555 if (thing?.trait is TraitToolRange && CanEquipRanged(thing))
7556 {
7557 ranged = thing;
7558 return true;
7559 }
7560 return false;
7561 }
7562 if (ranged != null && ranged.parent == this)
7563 {
7564 return true;
7565 }
7567 return ranged != null;
7568 }
Thing GetBestRangedWeapon()
Definition: Chara.cs:7535

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

7475 {
7476 Thing dest = null;
7477 if (IsPC)
7478 {
7480 {
7481 return FindThrowable(hotbar: true);
7482 }
7483 return null;
7484 }
7485 things.Foreach(delegate(Thing t)
7486 {
7487 if (t.HasTag(CTAG.throwWeapon) || (!base.IsPCFactionOrMinion && t.HasTag(CTAG.throwWeaponEnemy)))
7488 {
7489 dest = t;
7490 }
7491 });
7492 return dest;
7493 Thing FindThrowable(bool hotbar)
7494 {
7495 things.Foreach(delegate(Thing t)
7496 {
7497 if (dest == null)
7498 {
7499 if (t.IsHotItem)
7500 {
7501 if (!hotbar)
7502 {
7503 return;
7504 }
7505 }
7506 else if (hotbar)
7507 {
7508 return;
7509 }
7510 if (t.HasTag(CTAG.throwWeapon))
7511 {
7512 dest = t;
7513 }
7514 }
7515 });
7516 return dest;
7517 }
7518 }

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

4347 {
4348 if (held == t)
4349 {
4350 return true;
4351 }
4352 if (t.isDestroyed || t.Num <= 0)
4353 {
4354 return false;
4355 }
4356 if (!CanPick(t))
4357 {
4358 if (t.parent == null)
4359 {
4360 EClass._zone.AddCard(t, pos);
4361 }
4362 return false;
4363 }
4364 HoldCard(t, num);
4365 return true;
4366 }
bool CanPick(Card c)
Definition: Chara.cs:4166
void HoldCard(Card t, int num=-1)
Definition: Chara.cs:4368

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

7691 {
7692 int num = Evalue(289);
7693 if (num == 0)
7694 {
7695 return false;
7696 }
7697 int lV = t.LV;
7698 if (EClass.rnd(num * num + 5) > EClass.rnd(lV * lV) * 20)
7699 {
7700 t.Identify(show, (num >= 20) ? IDTSource.SkillHigh : IDTSource.Skill);
7701 int num2 = 50;
7702 if (lV > num)
7703 {
7704 num2 += (lV - num) * 10;
7705 }
7706 elements.ModExp(289, Mathf.Min(num2, 1000));
7707 return true;
7708 }
7709 return false;
7710 }
IDTSource
Definition: IDTSource.cs:2
Thing Identify(bool show=true, IDTSource idtSource=IDTSource.Identify)
Definition: Thing.cs:2048

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

Referenced by Player.OnAdvanceHour().

◆ TryMove()

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

Definition at line 2665 of file Chara.cs.

2666 {
2667 foreach (Condition condition in conditions)
2668 {
2669 if (!condition.TryMove(newPoint))
2670 {
2671 return MoveResult.Fail;
2672 }
2673 }
2674 if (base.isRestrained)
2675 {
2676 if (!IsPC)
2677 {
2678 return MoveResult.Fail;
2679 }
2680 base.isRestrained = false;
2681 }
2682 if (!CanMoveTo(newPoint, allowDestroyPath))
2683 {
2684 return MoveResult.Fail;
2685 }
2686 return _Move(newPoint);
2687 }
virtual bool TryMove(Point p)

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

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

◆ TryMoveFrom()

MoveResult Chara.TryMoveFrom ( Point  p)
inline

Definition at line 2625 of file Chara.cs.

2626 {
2628 {
2629 return MoveResult.Fail;
2630 }
2631 Point point = p.Copy();
2632 int num = p.x - pos.x;
2633 int num2 = p.z - pos.z;
2634 if (num > 1)
2635 {
2636 num = 1;
2637 }
2638 else if (num < -1)
2639 {
2640 num = -1;
2641 }
2642 if (num2 > 1)
2643 {
2644 num2 = 1;
2645 }
2646 else if (num2 < -1)
2647 {
2648 num2 = -1;
2649 }
2650 if (num == 0 && num2 == 0)
2651 {
2652 num = EClass.rnd(3) - 1;
2653 num2 = EClass.rnd(3) - 1;
2654 }
2655 point.Set(pos);
2656 point.x -= num;
2657 point.z -= num2;
2658 if (point.IsValid && !point.HasChara)
2659 {
2660 return TryMove(point, allowDestroyPath: false);
2661 }
2662 return MoveResult.Fail;
2663 }
bool TooHeavyToMove()
Definition: Player.cs:2486

References Point.Copy(), Point.HasChara, IsPC, Point.IsValid, EClass.player, Card.pos, EClass.rnd(), Point.Set(), Player.TooHeavyToMove(), TryMove(), Point.x, and Point.z.

Referenced by ActMelee.Attack(), GoalCombat.Run(), ConFear.Tick(), and GoalCombat.TryMove().

◆ TryMoveTowards()

MoveResult Chara.TryMoveTowards ( Point  p)
inline

Definition at line 2563 of file Chara.cs.

2564 {
2565 if (p.Equals(pos))
2566 {
2567 return MoveResult.Success;
2568 }
2570 {
2571 return MoveResult.Fail;
2572 }
2573 bool flag = true;
2574 Point point = null;
2575 _sharedPos.Set(p);
2576 if (CanDestroyPath())
2577 {
2579 {
2580 return MoveResult.Success;
2581 }
2582 Debug.Log(CanMoveTo(pos));
2584 }
2585 int num = pos.Distance(p);
2586 PathProgress pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Default, num + 4, 1);
2587 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 4)
2588 {
2589 PathFinderNode pathFinderNode = pathProgress.nodes[pathProgress.nodes.Count - 1];
2590 if (TryMove(new Point(pathFinderNode.X, pathFinderNode.Z)) == MoveResult.Success)
2591 {
2592 return MoveResult.Success;
2593 }
2594 }
2595 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Combat, num + 4, 1);
2596 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 4)
2597 {
2598 PathFinderNode pathFinderNode2 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2599 if (TryMove(new Point(pathFinderNode2.X, pathFinderNode2.Z)) == MoveResult.Success)
2600 {
2601 return MoveResult.Success;
2602 }
2603 }
2604 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Default, num + 25, 2);
2605 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 25)
2606 {
2607 PathFinderNode pathFinderNode3 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2608 if (TryMove(new Point(pathFinderNode3.X, pathFinderNode3.Z)) == MoveResult.Success)
2609 {
2610 return MoveResult.Success;
2611 }
2612 }
2613 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Combat, num + 25, 2);
2614 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 25)
2615 {
2616 PathFinderNode pathFinderNode4 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2617 if (TryMove(new Point(pathFinderNode4.X, pathFinderNode4.Z)) == MoveResult.Success)
2618 {
2619 return MoveResult.Success;
2620 }
2621 }
2622 return MoveResult.Fail;
2623 }
static Point _sharedPos
Definition: Chara.cs:172
void RequestPathImmediate(PathProgress progress)
Definition: PathManager.cs:41
List< PathFinderNode > nodes
Definition: PathProgress.cs:16
Point GetPointTowards(Point dest)
Definition: Point.cs:789

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

9260 {
9261 if (TC == null || TC.HasCondition<ConInvulnerable>() || TC.Evalue(1421) > 0 || !TC.ExistsOnMap)
9262 {
9263 return false;
9264 }
9265 if (TC.hp > TC.MaxHP * Mathf.Min(5 + (int)Mathf.Sqrt(power), harvest ? 35 : 25) / 100)
9266 {
9267 return false;
9268 }
9269 if (TC.HasElement(427))
9270 {
9271 return false;
9272 }
9273 if (TC.IsPC && EClass.player.invlunerable)
9274 {
9275 return false;
9276 }
9277 PlaySound("hit_finish");
9278 Say("finish");
9279 Say("finish2", this, TC);
9280 TC.DamageHP(TC.MaxHP, AttackSource.Finish, this);
9281 return false;
9282 }
@ harvest
bool invlunerable
Definition: Player.cs:1129
Definition: TC.cs:4

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

Referenced by ActEffect.Proc().

◆ TryNullifyCurse()

bool Chara.TryNullifyCurse ( )
inline

Definition at line 9692 of file Chara.cs.

9693 {
9694 if (IsPCParty)
9695 {
9696 foreach (Chara member in EClass.pc.party.members)
9697 {
9698 if (member.HasElement(1641) && EClass.rnd(3) != 0)
9699 {
9700 Msg.Say("curse_nullify", member);
9701 return true;
9702 }
9703 }
9704 }
9705 else if (HasElement(1641) && EClass.rnd(3) != 0)
9706 {
9707 Say("curse_nullify", this);
9708 return true;
9709 }
9710 if (GetCondition<ConHolyVeil>() != null && EClass.rnd(5) != 0)
9711 {
9712 Say("curse_nullify", this);
9713 return true;
9714 }
9715 return false;
9716 }

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

◆ TryPickGroundItem()

void Chara.TryPickGroundItem ( )
inline

Definition at line 4322 of file Chara.cs.

4323 {
4324 foreach (Card item in pos.ListCards())
4325 {
4326 if ((IsPC || !(EClass.pc.ai is AI_UseCrafter aI_UseCrafter) || !aI_UseCrafter.ings.Contains(item)) && item.isThing && item.placeState == PlaceState.roaming && CanPick(item))
4327 {
4328 Thing thing = Pick(item.Thing);
4329 if (thing != null && !IsPC)
4330 {
4331 thing.isNPCProperty = true;
4332 }
4333 break;
4334 }
4335 }
4336 }

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

Referenced by AI_Fish.Run().

◆ TryPoisonPotion()

Thing Chara.TryPoisonPotion ( Thing  t)
inline

Definition at line 4254 of file Chara.cs.

4255 {
4256 if (t.trait is TraitPotion && t.id != "1165" && !t.source.tag.Contains("neg") && EClass.rnd(2) == 0 && HasElement(1565))
4257 {
4258 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)
4259 .id;
4260 Say("poisonDrip", this);
4261 int num = t.Num;
4262 t.Destroy();
4263 t = ThingGen.Create(text).SetNum(num);
4264 }
4265 return t;
4266 }
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 3162 of file Chara.cs.

3163 {
3164 List<Chara> list = point.ListCharas();
3165 if (list.Count == 0)
3166 {
3167 return;
3168 }
3169 list.Copy().ForeachReverse(delegate(Chara c)
3170 {
3171 if (!c.ai.IsMoveAI && !c.IsPC && c.trait.CanBePushed && c != this && !c.noMove && (!EClass._zone.IsRegion || c.IsPCFactionOrMinion))
3172 {
3173 List<Point> list2 = new List<Point>();
3174 for (int i = point.x - 1; i <= point.x + 1; i++)
3175 {
3176 for (int j = point.z - 1; j <= point.z + 1; j++)
3177 {
3178 if (i != point.x || j != point.z)
3179 {
3180 Point point2 = new Point(i, j);
3181 if (point2.IsValid && !point2.HasChara && !point2.IsBlocked && !point2.cell.hasDoor && !point2.IsBlockByHeight(point))
3182 {
3183 list2.Add(point2);
3184 }
3185 }
3186 }
3187 }
3188 if (list2.Count > 0)
3189 {
3190 if (list2.Count > 1)
3191 {
3192 list2.ForeachReverse(delegate(Point p)
3193 {
3194 if (p.Equals(new Point(point.x + point.x - pos.x, point.z + point.z - pos.z)))
3195 {
3196 list2.Remove(p);
3197 }
3198 });
3199 }
3200 Point newPoint = list2.RandomItem();
3201 if (IsPC)
3202 {
3203 Say("displace", this, c);
3204 PlaySound("push");
3205 }
3206 else if (c.isSynced)
3207 {
3208 c.PlayEffect("push");
3209 }
3210 c.MoveByForce(newPoint, this, checkWall: true);
3211 if (!c.IsPC && c.trait is TraitRogue && EClass.rnd(3) == 0 && GetCurrency() > 20 && !HasElement(426))
3212 {
3213 int num = EClass.rndHalf(10 + Mathf.Min(GetCurrency() / 100, 1000));
3214 c.Talk("pushed");
3215 Say("pushed_money", this, c);
3216 ModCurrency(-num);
3217 c.ModCurrency(num);
3218 c.PlaySound("steal_money");
3219 }
3220 else if (IsPC && !c.IsPCParty && !c.IsUnique && c.IsHumanSpeak && EClass.rnd(5) == 0)
3221 {
3222 c.Talk("pushed");
3223 }
3224 }
3225 }
3226 });
3227 }
bool IsMoveAI
Definition: AIAct.cs:55
bool IsHumanSpeak
Definition: Chara.cs:1001

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

4339 {
4340 if (!EClass._zone.TryAddThingInSharedContainer(t, containers) && dropIfFail)
4341 {
4342 EClass._zone.AddCard(t, pos);
4343 }
4344 }
bool TryAddThingInSharedContainer(Thing t, List< Thing > containers=null, bool add=true, bool msg=false, Chara chara=null, bool sharedOnly=true)
Definition: Zone.cs:2086

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

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

7105 {
7106 if (GetInt(113) != 0)
7107 {
7108 return;
7109 }
7110 _ListItems.Clear();
7111 Thing bestRangedWeapon = GetBestRangedWeapon();
7112 foreach (Thing thing in things)
7113 {
7114 if (!thing.IsAmmo)
7115 {
7116 if (thing.category.slot != 0 && !thing.isEquipped && !thing.HasTag(CTAG.gift))
7117 {
7118 _ListItems.Add(thing);
7119 }
7120 else if (thing.IsRangedWeapon && thing.category.slot == 0 && bestRangedWeapon != thing)
7121 {
7122 _ListItems.Add(thing);
7123 }
7124 }
7125 }
7126 if (_ListItems.Count == 0)
7127 {
7128 return;
7129 }
7130 List<Thing> containers2 = containers.ToList();
7131 foreach (Thing listItem in _ListItems)
7132 {
7133 EClass._zone.TryAddThingInSharedContainer(listItem, containers2, add: true, msg: true, this);
7134 }
7135 }
void Add(Act a, string s="")
Definition: ActPlan.cs:11
static List< Thing > _ListItems
Definition: Chara.cs:188

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

Referenced by AI_Idle.Run().

◆ TryReservePickupTutorial()

void Chara.TryReservePickupTutorial ( Thing  t)
inline

Definition at line 4298 of file Chara.cs.

4299 {
4300 if (t.id == "axe")
4301 {
4302 Tutorial.Reserve("tool");
4303 }
4304 if (t.category.id == "mushroom")
4305 {
4306 Tutorial.Reserve("food");
4307 }
4308 if (t.category.id == "herb")
4309 {
4310 Tutorial.Reserve("herb");
4311 }
4312 if (t.id == "pasture")
4313 {
4314 Tutorial.Reserve("pasture");
4315 }
4316 if (t.id == "log")
4317 {
4318 Tutorial.Reserve("process");
4319 }
4320 }

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

◆ TryRestock()

void Chara.TryRestock ( bool  onCreate)
inline

Definition at line 4579 of file Chara.cs.

4580 {
4581 isOnCreate = onCreate;
4582 if (onCreate || (!IsPCFaction && (base.IsUnique || trait is TraitAdventurer || trait is TraitGuard)))
4583 {
4584 RestockEquip((!EClass.core.IsGameStarted || !(EClass._zone is Zone_Music)) && onCreate);
4585 }
4586 RestockInventory(onCreate);
4587 }
void RestockInventory(bool onCreate)
Definition: Chara.cs:4829
void RestockEquip(bool onCreate)
Definition: Chara.cs:4589

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

6090 {
6091 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))
6092 {
6093 SetEnemy(c);
6094 }
6095 }

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

7143 {
7145 }
void TryTakeSharedItems(bool msg=true)
Definition: Chara.cs:7142

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

7148 {
7149 if (base.isSummon || (memberType == FactionMemberType.Livestock && homeBranch != null && !homeBranch.policies.IsActive(2715)))
7150 {
7151 return;
7152 }
7153 int num = 2;
7154 int num2 = 2;
7155 bool flag = GetInt(113) == 0;
7156 int num3 = 2;
7157 int num4 = 2;
7158 int num5 = 2;
7160 {
7161 num4 = 0;
7162 num5 = 0;
7163 }
7164 foreach (Thing thing3 in things)
7165 {
7166 if (CanEat(thing3, shouldEat))
7167 {
7168 num -= thing3.Num;
7169 }
7170 if (thing3.trait.GetHealAction(this) != null)
7171 {
7172 num2 -= thing3.Num;
7173 }
7174 if (thing3.id == "polish_powder")
7175 {
7176 num3 -= thing3.Num;
7177 }
7178 if (thing3.trait is TraitBlanketColdproof)
7179 {
7180 num4 -= thing3.Num;
7181 }
7182 if (thing3.trait is TraitBlanketFireproof)
7183 {
7184 num5 -= thing3.Num;
7185 }
7186 }
7187 _ListItems.Clear();
7188 foreach (Thing container in containers)
7189 {
7190 if (!container.IsSharedContainer)
7191 {
7192 continue;
7193 }
7194 foreach (Thing thing4 in container.things)
7195 {
7196 if (!thing4.c_isImportant && thing4.IsIdentified)
7197 {
7198 if (num3 > 0 && thing4.id == "polish_powder")
7199 {
7200 _ListItems.Add(thing4);
7201 num3 -= thing4.Num;
7202 }
7203 else if (num4 > 0 && !HasElement(1236) && thing4.trait is TraitBlanketColdproof)
7204 {
7205 _ListItems.Add(thing4);
7206 num4 -= thing4.Num;
7207 }
7208 else if (num5 > 0 && thing4.trait is TraitBlanketFireproof)
7209 {
7210 _ListItems.Add(thing4);
7211 num5 -= thing4.Num;
7212 }
7213 else if (num > 0 && CanEat(thing4, shouldEat) && !thing4.c_isImportant)
7214 {
7215 _ListItems.Add(thing4);
7216 num -= thing4.Num;
7217 }
7218 else if (num2 > 0 && thing4.trait.GetHealAction(this) != null)
7219 {
7220 _ListItems.Add(thing4);
7221 num2 -= thing4.Num;
7222 }
7223 else if (flag && thing4.IsEquipmentOrRanged && !thing4.HasTag(CTAG.gift) && ShouldEquip(thing4, useFav: true))
7224 {
7225 _ListItems.Add(thing4);
7226 }
7227 }
7228 }
7229 }
7230 if (_ListItems.Count == 0)
7231 {
7232 return;
7233 }
7234 _ListItems.ForeachReverse(delegate(Thing t)
7235 {
7236 if (t.IsEquipmentOrRanged)
7237 {
7238 bool flag3 = false;
7239 int slot = t.category.slot;
7240 int equipValue = t.GetEquipValue();
7241 foreach (Thing listItem in _ListItems)
7242 {
7243 if (listItem.category.slot == slot && listItem.GetEquipValue() > equipValue)
7244 {
7245 flag3 = true;
7246 break;
7247 }
7248 }
7249 if (flag3)
7250 {
7251 _ListItems.Remove(t);
7252 }
7253 }
7254 });
7255 bool flag2 = false;
7256 foreach (Thing listItem2 in _ListItems)
7257 {
7258 Thing thing = listItem2;
7259 if (things.IsFull(thing))
7260 {
7261 break;
7262 }
7263 Thing thing2 = listItem2.parent as Thing;
7264 if (thing.Num > 2)
7265 {
7266 thing = thing.Split(2);
7267 }
7268 if (msg)
7269 {
7270 Say("takeSharedItem", this, thing, thing2.GetName(NameStyle.Full));
7271 }
7272 AddCard(thing);
7273 if (ShouldEquip(thing, useFav: true) && thing.category.slot != 0)
7274 {
7275 TryEquip(thing, useFav: true);
7276 flag2 = true;
7277 }
7278 }
7279 if (flag2 && flag)
7280 {
7281 TryPutSharedItems(containers);
7282 }
7283 }
bool IsIdentified
Definition: Card.cs:2339
bool HasItemProtection
bool IsActive(int id, int days=-1)
override string GetName(NameStyle style, int _num=-1)
Definition: Thing.cs:527
bool IsSharedContainer
Definition: Thing.cs:112

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

◆ TryUpgrade()

void Chara.TryUpgrade ( bool  msg = true)
inline

Definition at line 8248 of file Chara.cs.

8249 {
8250 if (!EClass.debug.enable || IsPC || !IsGlobal || !IsPCFaction)
8251 {
8252 return;
8253 }
8254 for (int i = 0; i < 100; i++)
8255 {
8256 if (base.feat == 0)
8257 {
8258 break;
8259 }
8260 if (base.c_upgrades == null)
8261 {
8262 base.c_upgrades = new CharaUpgrade();
8263 }
8264 if (base.c_upgrades.halt)
8265 {
8266 break;
8267 }
8268 Rand.SetSeed(base.uid + base.c_upgrades.count);
8269 int num = EClass.rnd(100);
8270 int num2 = 0;
8271 int num3 = 1;
8272 int num4 = 0;
8273 bool flag = false;
8274 IEnumerable<SourceElement.Row> ie = EClass.sources.elements.rows.Where((SourceElement.Row a) => !elements.Has(a) && a.category == "skill" && !a.tag.Contains("noPet"));
8275 List<Element> list = ListAvailabeFeats(pet: true);
8276 if (num >= 90 && list.Count > 0)
8277 {
8278 Element element = list.RandomItem();
8279 num2 = element.id;
8280 num4 = element.CostLearn;
8281 }
8282 else if (num >= 60 && ie.Any())
8283 {
8284 num2 = ie.RandomItem().id;
8285 num4 = 3;
8286 }
8287 else
8288 {
8289 num2 = Element.List_MainAttributesMajor.RandomItem();
8290 num4 = 1;
8291 num3 = 2;
8292 flag = true;
8293 }
8294 Rand.SetSeed();
8295 if (num4 > base.feat)
8296 {
8297 break;
8298 }
8299 base.feat -= num4;
8300 base.c_upgrades.count++;
8301 base.c_upgrades.spent += num4;
8302 bool flag2 = false;
8303 if (flag)
8304 {
8305 foreach (CharaUpgrade.Item item in base.c_upgrades.items)
8306 {
8307 if (item.idEle == num2)
8308 {
8309 item.value += num3;
8310 item.cost += num4;
8311 flag2 = true;
8312 break;
8313 }
8314 }
8315 }
8316 if (!flag2)
8317 {
8318 base.c_upgrades.items.Add(new CharaUpgrade.Item
8319 {
8320 idEle = num2,
8321 value = num3,
8322 cost = num4
8323 });
8324 }
8325 SourceElement.Row row = EClass.sources.elements.map[num2];
8326 if (row.category == "feat")
8327 {
8328 SetFeat(num2, elements.ValueWithoutLink(num2) + 1, msg: true);
8329 }
8330 else if (elements.ValueWithoutLink(row.id) == 0)
8331 {
8332 elements.Learn(row.id);
8333 }
8334 else
8335 {
8336 elements.ModBase(num2, num3);
8337 }
8338 }
8339 }
List< Element > ListAvailabeFeats(bool pet=false, bool showAll=false)
Definition: Chara.cs:9469
void Learn(int ele, int v=1)
virtual int CostLearn
Definition: ELEMENT.cs:314
static int[] List_MainAttributesMajor
Definition: ELEMENT.cs:242
static void SetSeed(int a=-1)
Definition: Rand.cs:37

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

Referenced by Card.LevelUp(), and WindowCharaMini.Refresh().

◆ TryUse()

bool Chara.TryUse ( Thing  t)
inline

Definition at line 7579 of file Chara.cs.

7580 {
7581 if (t.id == "338")
7582 {
7583 Thing thing = things.Find((Thing a) => a.IsEquipmentOrRanged && !a.isAcidproof);
7584 if (thing != null)
7585 {
7586 Say("dip", this, thing, t.GetName(NameStyle.Full, 1));
7587 SE.Change();
7588 t.trait.OnBlend(thing, this);
7589 return true;
7590 }
7591 return false;
7592 }
7593 if (t.IsNegativeGift || t.source.HasTag(CTAG.ignoreUse))
7594 {
7595 return false;
7596 }
7597 if (t.id == "cigar")
7598 {
7599 (t.trait as TraitItemProc).OnUse(this);
7600 return true;
7601 }
7602 if (t.trait.CanEat(this) && hunger.GetPhase() > ((IsPCFaction || IsPCFactionMinion) ? 2 : 0))
7603 {
7605 {
7606 target = t
7607 });
7608 return true;
7609 }
7610 if (t.trait.CanDrink(this))
7611 {
7612 Drink(t);
7613 return true;
7614 }
7615 if (t.trait.CanRead(this))
7616 {
7618 {
7619 target = t
7620 });
7621 return true;
7622 }
7623 if (base.hp < MaxHP * 90 / 100)
7624 {
7625 Action healAction = t.trait.GetHealAction(this);
7626 if (healAction != null)
7627 {
7628 healAction();
7629 return true;
7630 }
7631 }
7632 return false;
7633 }
bool isAcidproof
Definition: Card.cs:672
void SetAIImmediate(AIAct g)
Definition: Chara.cs:8559
virtual bool CanRead(Chara c)
Definition: Trait.cs:964
virtual bool CanDrink(Chara c)
Definition: Trait.cs:982
virtual void OnBlend(Thing t, Chara c)
Definition: Trait.cs:608

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

8821 {
8822 if (EClass.world.date.IsExpired(GetInt(51)))
8823 {
8824 Expedition expedition = Expedition.Create(this, sourceWork.expedition.ToEnum<ExpeditionType>());
8825 SetInt(51, EClass.world.date.GetRaw() + 60 * (expedition.hours + 24));
8826 homeBranch.expeditions.Add(expedition);
8827 return true;
8828 }
8829 return false;
8830 }
ExpeditionType
void Add(Expedition ex)
static Expedition Create(Chara c, ExpeditionType type)
Definition: Expedition.cs:112
int hours
Definition: Expedition.cs:6
ExpeditionManager expeditions
string expedition
Definition: SourceHobby.cs:29

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

◆ UpdateAngle()

void Chara.UpdateAngle ( )
inline

Definition at line 3521 of file Chara.cs.

3522 {
3523 if (IsPCC)
3524 {
3525 if (base.dir == 0)
3526 {
3527 angle = 225f;
3528 }
3529 else if (base.dir == 1)
3530 {
3531 angle = 135f;
3532 }
3533 else if (base.dir == 2)
3534 {
3535 angle = 45f;
3536 }
3537 else if (base.dir == 3)
3538 {
3539 angle = -45f;
3540 }
3541 }
3542 else if (base.dir == 0)
3543 {
3544 angle = 165f;
3545 }
3546 else if (base.dir == 1)
3547 {
3548 angle = 300f;
3549 }
3550 else if (base.dir == 2)
3551 {
3552 angle = 0f;
3553 }
3554 else if (base.dir == 3)
3555 {
3556 angle = 120f;
3557 }
3558 }

Referenced by OnDeserialized().

◆ UpdateSight()

void Chara.UpdateSight ( )
inline

Definition at line 3582 of file Chara.cs.

3583 {
3584 int num = 4;
3585 for (int i = -num; i < num + 1; i++)
3586 {
3587 for (int j = -num; j < num + 1; j++)
3588 {
3589 shared.Set(pos.x + i, pos.z + j);
3590 if (shared.IsValid && !shared.cell.isSeen && i >= -1 && i <= 1 && j >= -1)
3591 {
3592 _ = 1;
3593 }
3594 }
3595 }
3596 }
bool isSeen
Definition: Cell.cs:282
static Point shared
Definition: Chara.cs:11

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

◆ UseAbility() [1/2]

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

Definition at line 5616 of file Chara.cs.

5617 {
5618 if (HasCooldown(a.id))
5619 {
5620 return false;
5621 }
5622 if (a.source.proc.TryGet(0) == "Heal" && HasElement(1422) && !IsPC)
5623 {
5624 List<int> list = new List<int> { 8400, 8401, 8402, 8403, 8404, 8405 };
5625 int num = list.IndexOf(a.id);
5626 if (num != -1)
5627 {
5628 int num2 = list.TryGet(num + Evalue(1422));
5629 a = elements.GetElement(num2)?.act ?? ACT.Create(num2);
5630 }
5631 }
5632 int num3 = 1;
5633 Act.Cost cost = a.GetCost(this);
5634 a.GetPower(this);
5635 int i = 1;
5636 int num4 = 0;
5637 bool flag = a.IsTargetHostileParty();
5638 if (IsPC && HasCondition<StanceManaCost>())
5639 {
5640 num4 = Evalue(1657);
5641 }
5642 _pts.Clear();
5643 if (a.TargetType.ForceParty)
5644 {
5645 pt = true;
5646 }
5647 if (pt)
5648 {
5649 i = 0;
5650 if (flag)
5651 {
5652 ForeachEnemy(delegate
5653 {
5654 i++;
5655 });
5656 }
5657 else
5658 {
5659 ForeachParty(delegate
5660 {
5661 i++;
5662 });
5663 }
5664 }
5665 if (a is Spell && IsPC && a.vPotential < i)
5666 {
5667 i = 1;
5668 _pts.Clear();
5669 _pts.Add(this);
5670 pt = false;
5671 }
5672 int num5 = 100;
5673 if (!a.TargetType.ForceParty && i > 1)
5674 {
5675 num5 = (IsPC ? (i * 100) : (50 + i * 50));
5676 }
5677 int num6 = cost.cost * num5 / 100;
5678 if (cost.type == Act.CostType.MP && Evalue(483) > 0)
5679 {
5680 num6 = num6 * 100 / (100 + (int)Mathf.Sqrt(Evalue(483) * 10) * 3);
5681 }
5682 if (i == 0)
5683 {
5684 if (IsPC)
5685 {
5687 }
5688 return false;
5689 }
5690 if (!IsPC && cost.type == Act.CostType.MP && mana.value < 0 && (EClass.rnd(4) != 0 || IsPCFaction || (base.IsPowerful && mana.value < -20)))
5691 {
5692 return false;
5693 }
5694 if (IsPC)
5695 {
5696 if (!Dialog.warned && cost.type == Act.CostType.MP && cost.cost > 0 && mana.value < num6 && !EClass.debug.godMode)
5697 {
5698 ActPlan.warning = true;
5699 Dialog.TryWarnMana(delegate
5700 {
5701 if (UseAbility(a, tc, pos, pt))
5702 {
5704 }
5705 });
5706 return false;
5707 }
5708 EClass.ui.CloseLayers();
5709 }
5710 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))
5711 {
5712 Say("shakeHead", this);
5713 return true;
5714 }
5715 if (tc != null && tc != this)
5716 {
5717 LookAt(tc.pos);
5718 }
5719 if (pos != null && !base.pos.Equals(pos))
5720 {
5721 LookAt(pos);
5722 }
5723 if (a.CanRapidFire && HasElement(1648))
5724 {
5725 num3 = 1 + Evalue(1648);
5726 }
5727 if (IsPC && cost.cost > 0 && a.Value == 0)
5728 {
5730 return false;
5731 }
5732 if (a is Spell)
5733 {
5734 string s = (isConfused ? "_cast_confuse" : (HasCondition<ConDim>() ? "_cast_dim" : ""));
5735 if (!a.source.tag.Contains("useHand"))
5736 {
5737 Say(race.castStyle.IsEmpty("cast"), this, a.source.GetName().ToLower(), s.lang());
5738 }
5739 if (IsPC)
5740 {
5741 _ = (i + 1) / 2;
5742 if (a.vPotential < i)
5743 {
5744 Msg.Say("noSpellStock");
5745 EInput.Consume();
5746 return false;
5747 }
5748 if (num4 > 0 && a.vPotential >= i * 2)
5749 {
5750 a.vPotential -= i * 2;
5751 num6 = num6 * (100 - num4 * 20) / 100;
5752 }
5753 else
5754 {
5755 a.vPotential -= i;
5756 }
5758 }
5759 }
5760 else if (a.source.langAct.Length != 0 && tc != null)
5761 {
5762 string text = a.source.langAct[0];
5763 string text2 = ((a.source.langAct.Length >= 2) ? a.source.langAct[1] : "");
5764 if (text == "spell_hand")
5765 {
5766 string[] list2 = Lang.GetList("attack" + race.meleeStyle.IsEmpty("Touch"));
5767 string @ref = text2.lang(list2[4]);
5768 Say(tc.IsPCParty ? "cast_hand_ally" : "cast_hand", this, tc, @ref, tc.IsPCParty ? list2[1] : list2[2]);
5769 }
5770 else
5771 {
5772 Say(text, this, tc, text2.IsEmpty() ? "" : text2.lang());
5773 }
5774 if (a.source.id == 6630)
5775 {
5776 Talk("insult_" + (base.IsMale ? "m" : "f"));
5777 }
5778 }
5779 switch (cost.type)
5780 {
5781 case Act.CostType.MP:
5782 if (Evalue(1421) >= 2 && base.hp <= MaxHP / (9 - Evalue(1421) * 2))
5783 {
5784 num6 /= 2;
5785 }
5786 PlayEffect("cast");
5787 mana.Mod(-num6);
5788 if (isDead)
5789 {
5790 return true;
5791 }
5792 elements.ModExp(304, Mathf.Clamp(num6 * 2, 1, 200));
5793 break;
5794 case Act.CostType.SP:
5795 stamina.Mod(-num6);
5796 ignoreSPAbsorb = true;
5797 break;
5798 }
5799 if (a is Spell && GetCondition<ConSilence>() != null)
5800 {
5801 Say("cast_silence", this);
5802 return true;
5803 }
5804 if (isDead)
5805 {
5806 return true;
5807 }
5808 int spellExp = elements.GetSpellExp(this, a, num5);
5809 if (EClass.rnd(100) >= CalcCastingChance(a, i) && !EClass.debug.godMode)
5810 {
5811 Say("fizzle", this);
5812 PlayEffect("fizzle");
5813 PlaySound("fizzle");
5814 if (cost.cost > 0 && a.source.lvFactor > 0)
5815 {
5816 ModExp(a.id, spellExp / 5);
5817 }
5818 RemoveCondition<ConInvisibility>();
5819 return true;
5820 }
5821 bool flag2 = true;
5822 if (HasTalk("phrase_" + a.source.alias))
5823 {
5824 EClass.player.forceTalk = true;
5825 Talk("phrase_" + a.source.alias);
5826 }
5827 if (pt)
5828 {
5829 Act.forcePt = true;
5830 if (flag)
5831 {
5832 ForeachEnemy(delegate(Chara c)
5833 {
5834 a.Perform(this, c, c.pos);
5835 });
5836 }
5837 else
5838 {
5839 ForeachParty(delegate(Chara c)
5840 {
5841 a.Perform(this, c, c.pos);
5842 });
5843 }
5844 Act.forcePt = false;
5845 }
5846 else
5847 {
5848 for (int j = 0; j < num3; j++)
5849 {
5850 if (a.TargetType != TargetType.SelfParty && tc != null && !tc.IsAliveInCurrentZone)
5851 {
5852 break;
5853 }
5854 ActEffect.RapidCount = j;
5855 ActEffect.RapidDelay = a.RapidDelay;
5856 flag2 = a.Perform(this, tc, pos);
5857 }
5858 }
5859 if (flag2 && !isDead)
5860 {
5861 if (cost.cost > 0 && a.source.lvFactor > 0)
5862 {
5863 ModExp(a.id, spellExp);
5864 }
5865 if (a.source.alias.StartsWith("sword_"))
5866 {
5867 ModExp(101, 50);
5868 }
5869 }
5870 ActEffect.RapidCount = 0;
5871 if (a.source.cooldown > 0 && (!IsPC || !a.source.tag.Contains("CD_npc")))
5872 {
5873 AddCooldown(a.id, a.source.cooldown);
5874 }
5875 if (flag2 && !a.source.tag.Contains("keepInvisi") && EClass.rnd(2) == 0)
5876 {
5877 RemoveCondition<ConInvisibility>();
5878 }
5879 return flag2;
5880 void ForeachEnemy(Action<Chara> action)
5881 {
5882 if (_pts.Count == 0)
5883 {
5884 for (int num10 = EClass._map.charas.Count - 1; num10 >= 0; num10--)
5885 {
5886 Chara chara3 = EClass._map.charas[num10];
5887 if (chara3 != this && CanSeeLos(chara3) && chara3.IsHostile(this))
5888 {
5889 _pts.Add(chara3);
5890 }
5891 }
5892 }
5893 for (int num11 = _pts.Count - 1; num11 >= 0; num11--)
5894 {
5895 action(_pts[num11]);
5896 }
5897 }
5898 void ForeachParty(Action<Chara> action)
5899 {
5900 if (_pts.Count == 0)
5901 {
5902 if (IsPCParty)
5903 {
5904 for (int num7 = EClass.pc.party.members.Count - 1; num7 >= 0; num7--)
5905 {
5906 Chara chara = EClass.pc.party.members[num7];
5907 if (chara == this || chara.host != null || CanSeeLos(chara))
5908 {
5909 _pts.Add(chara);
5910 }
5911 }
5912 }
5913 else
5914 {
5915 for (int num8 = EClass._map.charas.Count - 1; num8 >= 0; num8--)
5916 {
5917 Chara chara2 = EClass._map.charas[num8];
5918 if ((chara2 == this || (chara2.IsFriendOrAbove(this) && CanSeeLos(chara2))) && (chara2 == tc || _pts.Count < 3 || EClass.rnd(_pts.Count * _pts.Count) > 6))
5919 {
5920 _pts.Add(chara2);
5921 }
5922 }
5923 }
5924 }
5925 for (int num9 = _pts.Count - 1; num9 >= 0; num9--)
5926 {
5927 action(_pts[num9]);
5928 }
5929 }
5930 }
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:142
virtual float RapidDelay
Definition: ACT.cs:175
bool IsTargetHostileParty()
Definition: ACT.cs:241
virtual bool CanRapidFire
Definition: ACT.cs:173
bool HasTalk(string idTopic)
Definition: Card.cs:6484
bool UseAbility(string idAct, Card tc=null, Point pos=null, bool pt=false)
Definition: Chara.cs:5611
static List< Chara > _pts
Definition: Chara.cs:184
int CalcCastingChance(Element e, int num=1)
Definition: Chara.cs:5941
Definition: Dialog.cs:7
static bool warned
Definition: Dialog.cs:49
static void TryWarnMana(Action action)
Definition: Dialog.cs:391
int GetSpellExp(Chara c, Element e, int costMod=100)
int vPotential
Definition: ELEMENT.cs:256
virtual int GetPower(Card c)
Definition: ELEMENT.cs:1071
virtual Act.Cost GetCost(Chara c)
Definition: ELEMENT.cs:1024
Act act
Definition: ELEMENT.cs:394
static TargetTypeSelfParty SelfParty
Definition: TargetType.cs:9
virtual bool ForceParty
Definition: TargetType.cs:41
Definition: ACT.cs:71
CostType type
Definition: ACT.cs:74
int cost
Definition: ACT.cs:72

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

◆ UseAbility() [2/2]

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

◆ ValidateWorks()

void Chara.ValidateWorks ( )
inline

Definition at line 8868 of file Chara.cs.

8869 {
8870 _goalWork.FindWork(this, setAI: false);
8872 }
static GoalHobby _goalHobby
Definition: Chara.cs:206
static GoalWork _goalWork
Definition: Chara.cs:204
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 5096 of file Chara.cs.

5097 {
5098 base.c_vomit++;
5099 Say("vomit", this);
5100 PlaySound("vomit");
5101 if (!EClass._zone.IsRegion)
5102 {
5103 Thing thing = ThingGen.Create("731");
5105 {
5106 thing.MakeRefFrom(this);
5107 }
5108 EClass._zone.AddCard(thing, pos);
5109 }
5110 if (HasCondition<ConAnorexia>())
5111 {
5112 ModExp(70, -50);
5113 ModExp(71, -75);
5114 ModExp(77, -100);
5115 }
5116 else if (base.c_vomit > 10)
5117 {
5118 AddCondition<ConAnorexia>();
5119 }
5120 AddCondition<ConDim>();
5121 if (HasCondition<ConAnorexia>())
5122 {
5123 ModWeight(-1 * (1 + EClass.rnd(5)));
5124 }
5125 if (hunger.GetPhase() >= 4)
5126 {
5127 DamageHP(9999, AttackSource.Hunger);
5128 }
5129 hunger.Mod(30);
5130 }
void ModWeight(int a, bool ignoreLimit=false)
Definition: Chara.cs:9401

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

3599 {
3600 for (int num = conditions.Count - 1; num >= 0; num--)
3601 {
3602 if (conditions[num].ConsumeTurn)
3603 {
3604 return true;
3605 }
3606 }
3607 return false;
3608 }

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

7029 {
7030 n.Clear();
7031 UIItem uIItem = n.AddHeaderCard(base.Name.ToTitleCase());
7032 SetImage(uIItem.image2);
7033 uIItem.text2.SetText(race.GetText().ToTitleCase(wholeText: true) + " " + job.GetText().ToTitleCase(wholeText: true));
7034 n.AddText("");
7035 n.Build();
7036 }
void SetImage(Image image, int dir, int idSkin=0)
Definition: Card.cs:5890
Definition: UIItem.cs:5
Image image2
Definition: UIItem.cs:16
UIText text2
Definition: UIItem.cs:8
UIItem AddHeaderCard(string text, Sprite sprite=null)
Definition: UINote.cs:84
void Clear()
Definition: UINote.cs:35
UIItem AddText(string text, FontColor color=FontColor.DontChange)
Definition: UINote.cs:113
void Build()
Definition: UINote.cs:49
void SetText(string s)
Definition: UIText.cs:159

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

Member Data Documentation

◆ _ability

CharaAbility Chara._ability

Definition at line 96 of file Chara.cs.

Referenced by SetMainElement().

◆ _baseWorkElements

ElementContainer Chara._baseWorkElements

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

Referenced by SetFaction().

◆ _goalHobby

GoalHobby Chara._goalHobby = new GoalHobby()
staticprivate

Definition at line 206 of file Chara.cs.

◆ _goalWork

GoalWork Chara._goalWork = new GoalWork()
staticprivate

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

Referenced by HasHigherGround(), and Refresh().

◆ _job

SourceJob.Row Chara._job

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

◆ _listFavFood

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

Definition at line 190 of file Chara.cs.

◆ _ListItems

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

Definition at line 188 of file Chara.cs.

◆ _NoGoalPC

NoGoal Chara._NoGoalPC = new NoGoal()
static

Definition at line 194 of file Chara.cs.

◆ _NoGoalRepeat

NoGoal Chara._NoGoalRepeat = new NoGoal()
static

Definition at line 196 of file Chara.cs.

Referenced by ActPlan.Item.Perform().

◆ _pts

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

Definition at line 184 of file Chara.cs.

◆ _race

SourceRace.Row Chara._race

Definition at line 158 of file Chara.cs.

Referenced by ChangeRace(), and OnCreate().

◆ _sharedPos

Point Chara._sharedPos = new Point()
staticprivate

Definition at line 172 of file Chara.cs.

Referenced by TryMoveTowards().

◆ _Speed

int Chara._Speed
private

Definition at line 170 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 162 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 176 of file Chara.cs.

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

◆ ai

◆ body

◆ bossText

bool Chara.bossText

Definition at line 144 of file Chara.cs.

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

◆ calmCheckTurn

int Chara.calmCheckTurn

Definition at line 116 of file Chara.cs.

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

◆ canSeeInvisible

bool Chara.canSeeInvisible

Definition at line 138 of file Chara.cs.

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

◆ combatCount

int Chara.combatCount

Definition at line 114 of file Chara.cs.

◆ conditions

◆ conSleep

◆ consumeTurn

bool Chara.consumeTurn
static

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

Referenced by RefreshSpeed(), and SetDirtySpeed().

◆ emoIcon

Emo2 Chara.emoIcon

Definition at line 106 of file Chara.cs.

Referenced by TCOrbitChara.RefreshAll(), and BaseCondition.SetOwner().

◆ enemy

◆ faithElements

◆ global

◆ goalList

GoalList Chara.goalList = new GoalList()

Definition at line 198 of file Chara.cs.

◆ happiness

int Chara.happiness

Definition at line 108 of file Chara.cs.

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

◆ hasMovedThisTurn

bool Chara.hasMovedThisTurn
private

Definition at line 174 of file Chara.cs.

Referenced by _Move().

◆ hasTelepathy

bool Chara.hasTelepathy

◆ held

◆ host

◆ idleActTimer

int Chara.idleActTimer

Definition at line 112 of file Chara.cs.

Referenced by AI_Idle.Run().

◆ idleTimer

float Chara.idleTimer

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

◆ isBerserk

bool Chara.isBerserk

◆ isBlind

◆ isConfused

◆ isCreated

bool Chara.isCreated

Definition at line 136 of file Chara.cs.

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

◆ isDrunk

bool Chara.isDrunk

Definition at line 124 of file Chara.cs.

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

◆ isFainted

bool Chara.isFainted

Definition at line 128 of file Chara.cs.

◆ isOnCreate

bool Chara.isOnCreate
static

Definition at line 182 of file Chara.cs.

◆ isParalyzed

bool Chara.isParalyzed

Definition at line 132 of file Chara.cs.

Referenced by Point.ListWitnesses().

◆ isWet

bool Chara.isWet

◆ lastPos

Point Chara.lastPos = new Point()

Definition at line 90 of file Chara.cs.

Referenced by _Move().

◆ ListAdvJob

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

Definition at line 166 of file Chara.cs.

Referenced by OnCreate().

◆ ListAdvRace

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

Definition at line 164 of file Chara.cs.

Referenced by OnCreate().

◆ listHobby

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

Definition at line 13 of file Chara.cs.

◆ master

Chara Chara.master

Definition at line 88 of file Chara.cs.

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

◆ memberType

◆ nextUse

Thing Chara.nextUse

Definition at line 100 of file Chara.cs.

Referenced by AI_Idle.Run().

◆ orgPos

◆ parasite

◆ party

◆ path

PathProgress Chara.path = new PathProgress()

Definition at line 92 of file Chara.cs.

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

◆ pccData

◆ preventRegen

bool Chara.preventRegen
static

Definition at line 180 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 212 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 118 of file Chara.cs.

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

◆ source

◆ spriteReplacer

SpriteReplacer Chara.spriteReplacer

Definition at line 152 of file Chara.cs.

Referenced by LayerEditSkin.RefreshImage().

◆ stealthSeen

int Chara.stealthSeen

Definition at line 186 of file Chara.cs.

◆ tempElements

◆ turnLastSeen

int Chara.turnLastSeen = -100

Definition at line 110 of file Chara.cs.

Referenced by AI_Idle.Run().

◆ visibleWithTelepathy

bool Chara.visibleWithTelepathy

◆ wasInWater

bool Chara.wasInWater

Definition at line 148 of file Chara.cs.

◆ workElements

ElementContainer Chara.workElements

Definition at line 40 of file Chara.cs.

Property Documentation

◆ _affinity

int Chara._affinity
getset

Definition at line 300 of file Chara.cs.

301 {
302 get
303 {
304 return _cints[5];
305 }
306 set
307 {
308 _cints[5] = value;
309 }
310 }

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

◆ _alias

string Chara._alias
getset

Definition at line 216 of file Chara.cs.

217 {
218 get
219 {
220 return _strs[0];
221 }
222 set
223 {
224 _strs[0] = value;
225 }
226 }
string[] _strs
Definition: Chara.cs:79

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

◆ _idTimeTable

int Chara._idTimeTable
getset

Definition at line 338 of file Chara.cs.

339 {
340 get
341 {
342 return _cints[9];
343 }
344 set
345 {
346 _cints[9] = value;
347 }
348 }

Referenced by OnCreate().

◆ _maxStamina

int Chara._maxStamina
getset

Definition at line 362 of file Chara.cs.

363 {
364 get
365 {
366 return _cints[20];
367 }
368 set
369 {
370 _cints[20] = value;
371 }
372 }

Referenced by CalculateMaxStamina().

◆ ability

◆ actorPrefab

override string Chara.actorPrefab
get

Definition at line 516 of file Chara.cs.

517 {
518 get
519 {
520 if (IsPCC)
521 {
522 return "CharaActorPCC";
523 }
524 return "CharaActor";
525 }
526 }

◆ affinity

◆ Aka

◆ AliasMaterialOnCreate

override string Chara.AliasMaterialOnCreate
get

Definition at line 556 of file Chara.cs.

◆ baseWorkElements

ElementContainer Chara.baseWorkElements
get

Definition at line 1092 of file Chara.cs.

1093 {
1094 get
1095 {
1096 if (_baseWorkElements == null)
1097 {
1099 foreach (Hobby item in ListHobbies())
1100 {
1101 Build(item);
1102 }
1103 foreach (Hobby item2 in ListWorks())
1104 {
1105 Build(item2);
1106 }
1107 }
1108 return _baseWorkElements;
1109 void Build(Hobby h)
1110 {
1111 if (!h.source.elements.IsEmpty())
1112 {
1113 for (int i = 0; i < h.source.elements.Length; i += 2)
1114 {
1115 int ele = h.source.elements[i];
1116 int v = h.source.elements[i + 1];
1117 _baseWorkElements.ModBase(ele, v);
1118 }
1119 }
1120 }
1121 }
1122 }
ElementContainer _baseWorkElements
Definition: Chara.cs:202

◆ bladder

Stats Chara.bladder
get

Definition at line 1132 of file Chara.cs.

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

◆ burden

◆ CanGainConResist

bool Chara.CanGainConResist
get

Definition at line 1142 of file Chara.cs.

1143 {
1144 get
1145 {
1146 if (base.rarity >= Rarity.Legendary)
1147 {
1148 return !IsPCFaction;
1149 }
1150 return false;
1151 }
1152 }

◆ CanOpenDoor

bool Chara.CanOpenDoor
get

Definition at line 816 of file Chara.cs.

817 {
818 get
819 {
820 if (base.INT < 5)
821 {
822 if (IsPCFaction)
823 {
824 return memberType == FactionMemberType.Default;
825 }
826 return false;
827 }
828 return true;
829 }
830 }

◆ CanWitness

bool Chara.CanWitness
get

Definition at line 988 of file Chara.cs.

989 {
990 get
991 {
992 if (!IsHuman && !IsFairy && !IsGod)
993 {
994 return race.id == "mutant";
995 }
996 return true;
997 }
998 }
bool IsFairy
Definition: Chara.cs:937
bool IsGod
Definition: Chara.cs:949

Referenced by Point.ListWitnesses().

◆ corruption

int Chara.corruption
getset

Definition at line 374 of file Chara.cs.

375 {
376 get
377 {
378 return _cints[21];
379 }
380 set
381 {
382 _cints[21] = value;
383 }
384 }

Referenced by ActEffect.Proc().

◆ CurrentGeneSlot

int Chara.CurrentGeneSlot
get

Definition at line 1056 of file Chara.cs.

1057 {
1058 get
1059 {
1060 if (base.c_genes != null)
1061 {
1062 return base.c_genes.GetGeneSlot(this);
1063 }
1064 return 0;
1065 }
1066 }

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

◆ CurrentSpan

TimeTable.Span Chara.CurrentSpan
get

Definition at line 834 of file Chara.cs.

Referenced by ConSleep.Tick().

◆ currentZone

Zone Chara.currentZone
getset

Definition at line 252 of file Chara.cs.

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

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

◆ daysStarved

int Chara.daysStarved
getset

Definition at line 326 of file Chara.cs.

327 {
328 get
329 {
330 return _cints[7];
331 }
332 set
333 {
334 _cints[7] = value;
335 }
336 }

◆ depression

Stats Chara.depression
get

Definition at line 1130 of file Chara.cs.

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

◆ DestDist

int Chara.DestDist
get

Definition at line 984 of file Chara.cs.

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

◆ DV

override int Chara.DV
get

Definition at line 726 of file Chara.cs.

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

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

◆ faction

Faction Chara.faction
getset

Definition at line 424 of file Chara.cs.

425 {
426 get
427 {
428 return _faction ?? (_faction = EClass.game.factions.dictAll.TryGetValue(idFaction));
429 }
430 set
431 {
432 idFaction = value?.uid;
433 }
434 }
string idFaction
Definition: Chara.cs:241
Dictionary< string, Faction > dictAll
FactionManager factions
Definition: Game.cs:161

Referenced by WidgetMenuPanel._OnChangeMode(), Element._WriteNote(), FactionBranch.AddMemeber(), PolicyManager.AddPolicy(), GameDate.AdvanceDay(), GameDate.AdvanceMonth(), QuestDialog.CanStartQuest(), Zone.ClaimZone(), Map.CountChara(), Faction.CountMembers(), FactionBranch.DailyOutcome(), CharaBody.Equip(), FactionBranch.Evalue(), GoalSiege.GetDestCard(), RankedZone.GetFactionName(), RankedZoneManager.GetIncome(), FortuneRollData.GetPrizeList(), AttackProcess.GetWeaponEnc(), Element.IsFactionElement(), Religion.JoinFaith(), Religion.LeaveFaith(), Map.ListChara(), ElementContainer.ListElements(), FactionBranch.OnClaimZone(), ListPeopleRevive.OnList(), Game.OnLoad(), TraitBookSkill.OnRead(), TraitDeed.OnRead(), TraitDeedRelocate.OnRead(), ContentHomeReport.OnSwitchContent(), FactionBranch.OnUnclaimZone(), ActRanged.Perform(), AttackProcess.Perform(), Card.PurgeDuplicateArtifact(), 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 544 of file Chara.cs.

545 {
546 get
547 {
548 if (base.dir != 1)
549 {
550 return base.dir == 2;
551 }
552 return true;
553 }
554 }

Referenced by CharaActor.RefreshSprite().

◆ goalListType

GoalListType Chara.goalListType
getset

Definition at line 276 of file Chara.cs.

277 {
278 get
279 {
280 return _cints[3].ToEnum<GoalListType>();
281 }
282 set
283 {
284 _cints[3] = (int)value;
285 }
286 }
GoalListType
Definition: GoalListType.cs:2

◆ HasHost

override bool Chara.HasHost
get

Definition at line 686 of file Chara.cs.

Referenced by ActEffect.Proc().

◆ HasNoGoal

◆ homeBranch

◆ homeZone

◆ hostility

◆ hunger

◆ hygiene

Stats Chara.hygiene
get

Definition at line 1134 of file Chara.cs.

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

◆ idFaction

string Chara.idFaction
getset

Definition at line 240 of file Chara.cs.

241 {
242 get
243 {
244 return _strs[2];
245 }
246 set
247 {
248 _strs[2] = value;
249 }
250 }

◆ idFaith

string Chara.idFaith
getset

Definition at line 228 of file Chara.cs.

229 {
230 get
231 {
232 return _strs[1];
233 }
234 set
235 {
236 _strs[1] = value;
237 }
238 }

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

◆ IDPCCBodySet

string Chara.IDPCCBodySet
get

Definition at line 488 of file Chara.cs.

489 {
490 get
491 {
492 if (source.idActor.Length <= 1)
493 {
494 return "female";
495 }
496 return source.idActor[1];
497 }
498 }

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

◆ idTimeTable

string Chara.idTimeTable
get

Definition at line 466 of file Chara.cs.

Referenced by LayerQuestBoard.RefreshHire().

◆ interest

int Chara.interest
getset

Definition at line 314 of file Chara.cs.

315 {
316 get
317 {
318 return _cints[6];
319 }
320 set
321 {
322 _cints[6] = value;
323 }
324 }

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

◆ IsAdventurer

bool Chara.IsAdventurer
get

Definition at line 1026 of file Chara.cs.

1027 {
1028 get
1029 {
1030 if (global != null && faction != EClass.pc.faction)
1031 {
1032 return IsPCC;
1033 }
1034 return false;
1035 }
1036 }

◆ isAlawysVisible

bool Chara.isAlawysVisible
getset

Definition at line 398 of file Chara.cs.

399 {
400 get
401 {
402 return _cbits1[1];
403 }
404 set
405 {
406 _cbits1[1] = value;
407 }
408 }

◆ IsAliveInCurrentZone

◆ IsAnimal

bool Chara.IsAnimal
get

Definition at line 864 of file Chara.cs.

865 {
866 get
867 {
868 if (!race.IsAnimal)
869 {
870 return HasTag(CTAG.animal);
871 }
872 return true;
873 }
874 }

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

◆ isChara

override bool Chara.isChara
get

Definition at line 684 of file Chara.cs.

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

◆ isDead

◆ IsDeadOrSleeping

override bool Chara.IsDeadOrSleeping
get

Definition at line 570 of file Chara.cs.

571 {
572 get
573 {
574 if (!isDead && conSleep == null && conSuspend == null)
575 {
576 return isFainted;
577 }
578 return true;
579 }
580 }
bool isFainted
Definition: Chara.cs:128

Referenced by CharaRenderer.Draw(), CharaRenderer.DrawHat(), BaseTileMap.DrawTile(), TileMapElona.DrawTile(), GiveGift(), Player.OnAdvanceHour(), CharaActorPCC.OnRender(), RefreshSpeed(), AI_Fuck.Run(), StanceSongSleep.Tick(), and CharaRenderer.UpdatePosition().

◆ IsDisabled

override bool Chara.IsDisabled
get

◆ IsDragon

bool Chara.IsDragon
get

Definition at line 960 of file Chara.cs.

961 {
962 get
963 {
964 if (!race.IsDragon)
965 {
966 return HasTag(CTAG.dragon);
967 }
968 return true;
969 }
970 }

◆ IsEyth

bool Chara.IsEyth
get

Definition at line 1038 of file Chara.cs.

Referenced by TraitAltar.OnOffer().

◆ IsFairy

bool Chara.IsFairy
get

Definition at line 936 of file Chara.cs.

937 {
938 get
939 {
940 if (!race.IsFairy)
941 {
942 return HasTag(CTAG.fairy);
943 }
944 return true;
945 }
946 }

Referenced by Faction.IsWearingPanty().

◆ IsFish

bool Chara.IsFish
get

Definition at line 924 of file Chara.cs.

925 {
926 get
927 {
928 if (!race.IsFish)
929 {
930 return HasTag(CTAG.fish);
931 }
932 return true;
933 }
934 }

◆ IsGlobal

◆ IsGod

bool Chara.IsGod
get

Definition at line 948 of file Chara.cs.

949 {
950 get
951 {
952 if (!race.IsGod)
953 {
954 return HasTag(CTAG.god);
955 }
956 return true;
957 }
958 }

◆ IsHorror

bool Chara.IsHorror
get

Definition at line 912 of file Chara.cs.

913 {
914 get
915 {
916 if (!race.IsHorror)
917 {
918 return HasTag(CTAG.horror);
919 }
920 return true;
921 }
922 }

Referenced by Refresh().

◆ IsHuman

bool Chara.IsHuman
get

Definition at line 876 of file Chara.cs.

877 {
878 get
879 {
880 if (!race.IsHuman)
881 {
882 return HasTag(CTAG.human);
883 }
884 return true;
885 }
886 }

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

1001 {
1002 get
1003 {
1004 if (!IsHuman)
1005 {
1006 return race.tag.Contains("humanSpeak");
1007 }
1008 return true;
1009 }
1010 }

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

◆ IsIdle

bool Chara.IsIdle
get

Definition at line 850 of file Chara.cs.

851 {
852 get
853 {
854 if (!IsDeadOrSleeping)
855 {
856 return ai.Current.IsIdle;
857 }
858 return false;
859 }
860 }
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 594 of file Chara.cs.

595 {
596 get
597 {
598 if (ride != null)
599 {
600 return ride._isLevitating;
601 }
602 return _isLevitating;
603 }
604 }

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

◆ IsLocalChara

bool Chara.IsLocalChara
get

Definition at line 838 of file Chara.cs.

839 {
840 get
841 {
842 if (!IsGlobal && !base.isSubsetCard)
843 {
844 return homeZone == EClass._zone;
845 }
846 return false;
847 }
848 }

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

◆ IsMachine

bool Chara.IsMachine
get

Definition at line 900 of file Chara.cs.

901 {
902 get
903 {
904 if (!race.IsMachine)
905 {
906 return HasTag(CTAG.machine);
907 }
908 return true;
909 }
910 }

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

◆ IsMaid

bool Chara.IsMaid
get

Definition at line 1012 of file Chara.cs.

1013 {
1014 get
1015 {
1016 if (EClass.Branch != null)
1017 {
1018 return EClass.Branch.uidMaid == base.uid;
1019 }
1020 return false;
1021 }
1022 }

Referenced by FactionBranch.GetMaid().

◆ IsMinion

override bool Chara.IsMinion
get

Definition at line 624 of file Chara.cs.

625 {
626 get
627 {
628 if (master == null)
629 {
630 return base.c_uidMaster != 0;
631 }
632 return true;
633 }
634 }

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

◆ IsMofuable

bool Chara.IsMofuable
get

Definition at line 1080 of file Chara.cs.

1081 {
1082 get
1083 {
1084 if (!race.tag.Contains("mofu"))
1085 {
1086 return HasElement(419);
1087 }
1088 return true;
1089 }
1090 }

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

◆ IsMoving

override bool Chara.IsMoving
get

Definition at line 606 of file Chara.cs.

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

◆ IsMultisize

◆ IsPC

override bool Chara.IsPC
get

Definition at line 610 of file Chara.cs.

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

◆ IsPCC

◆ IsPCFaction

override bool Chara.IsPCFaction
get

Definition at line 668 of file Chara.cs.

669 {
670 get
671 {
672 if (EClass.pc != null)
673 {
674 return faction == EClass.pc.faction;
675 }
676 return false;
677 }
678 }

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

◆ IsPCFactionMinion

override bool Chara.IsPCFactionMinion
get

Definition at line 652 of file Chara.cs.

653 {
654 get
655 {
656 if (master != null)
657 {
658 if (!master.IsPCFaction)
659 {
661 }
662 return true;
663 }
664 return false;
665 }
666 }

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

◆ IsPCParty

override bool Chara.IsPCParty
get

Definition at line 612 of file Chara.cs.

613 {
614 get
615 {
616 if (party != null)
617 {
618 return party.leader == EClass.pc;
619 }
620 return false;
621 }
622 }

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

◆ IsPCPartyMinion

override bool Chara.IsPCPartyMinion
get

Definition at line 636 of file Chara.cs.

637 {
638 get
639 {
640 if (master != null)
641 {
642 if (!master.IsPCParty)
643 {
644 return master.IsPCPartyMinion;
645 }
646 return true;
647 }
648 return false;
649 }
650 }

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

◆ IsPlant

bool Chara.IsPlant
get

Definition at line 972 of file Chara.cs.

973 {
974 get
975 {
976 if (!race.IsPlant)
977 {
978 return HasTag(CTAG.plant);
979 }
980 return true;
981 }
982 }

Referenced by GoalCombat.Run().

◆ IsPrisoner

bool Chara.IsPrisoner
get

Definition at line 1024 of file Chara.cs.

◆ isSynced

override bool Chara.isSynced
get

Definition at line 688 of file Chara.cs.

689 {
690 get
691 {
692 if (renderer == null || !renderer.isSynced)
693 {
694 if (host != null)
695 {
696 return host.isSynced;
697 }
698 return false;
699 }
700 return true;
701 }
702 }

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

◆ isThing

override bool Chara.isThing
get

Definition at line 682 of file Chara.cs.

◆ IsUndead

bool Chara.IsUndead
get

Definition at line 888 of file Chara.cs.

889 {
890 get
891 {
892 if (!race.IsUndead)
893 {
894 return HasTag(CTAG.undead);
895 }
896 return true;
897 }
898 }

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

◆ IsWealthy

bool Chara.IsWealthy
get

Definition at line 1040 of file Chara.cs.

1041 {
1042 get
1043 {
1044 if (!source.works.Contains("Rich"))
1045 {
1046 return source.hobbies.Contains("Rich");
1047 }
1048 return true;
1049 }
1050 }

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

◆ job

◆ knowFav

bool Chara.knowFav
getset

Definition at line 410 of file Chara.cs.

411 {
412 get
413 {
414 return _cbits1[3];
415 }
416 set
417 {
418 _cbits1[3] = value;
419 }
420 }

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

◆ MainElement

Element Chara.MainElement
get

Definition at line 714 of file Chara.cs.

715 {
716 get
717 {
718 if (base.c_idMainElement == 0)
719 {
720 return Element.Void;
721 }
722 return elements.GetElement(base.c_idMainElement);
723 }
724 }

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

◆ mana

◆ MaxGeneSlot

int Chara.MaxGeneSlot
get

◆ MaxHP

◆ MaxSummon

int Chara.MaxSummon
get

◆ NameBraced

string Chara.NameBraced
get

◆ NameTitled

string Chara.NameTitled
get

Definition at line 514 of file Chara.cs.

◆ OriginalHostility

Hostility Chara.OriginalHostility
get

Definition at line 468 of file Chara.cs.

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

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

◆ Pref

override SourcePref Chara.Pref
get

Definition at line 784 of file Chara.cs.

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

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

◆ PrefIndex

override int Chara.PrefIndex
get

Definition at line 528 of file Chara.cs.

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

◆ PV

override int Chara.PV
get

Definition at line 755 of file Chara.cs.

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

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

◆ race

◆ SAN

◆ SelfWeight

override int Chara.SelfWeight
get

Definition at line 710 of file Chara.cs.

◆ sleepiness

Stats Chara.sleepiness
get

◆ sourceCard

override CardRow Chara.sourceCard
get

◆ sourceRenderCard

override CardRow Chara.sourceRenderCard
get

Definition at line 450 of file Chara.cs.

451 {
452 get
453 {
454 if (pccData != null && !(source.renderData is RenderDataPcc))
455 {
457 }
458 return source;
459 }
460 }
static Row rowDefaultPCC
Definition: SourceChara.cs:138

◆ Speed

int Chara.Speed
get

Definition at line 1068 of file Chara.cs.

1069 {
1070 get
1071 {
1072 if (dirtySpeed)
1073 {
1074 RefreshSpeed();
1075 }
1076 return _Speed;
1077 }
1078 }

Referenced by GameUpdater.ConditionUpdater.FixedUpdate().

◆ stamina

◆ tactics

Tactics Chara.tactics
get

Definition at line 832 of file Chara.cs.

◆ trait

◆ uidEditor

int Chara.uidEditor
getset

Definition at line 350 of file Chara.cs.

351 {
352 get
353 {
354 return _cints[10];
355 }
356 set
357 {
358 _cints[10] = value;
359 }
360 }

Referenced by SerializedCards.Add().

◆ WeightLimit

override int Chara.WeightLimit
get

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