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

Public Member Functions

override string ToString ()
 
bool IsCriticallyWounded (bool includeRide=false)
 
bool HasHigherGround (Card c)
 
bool CanSeeSimple (Point p)
 
bool CanSee (Card c)
 
bool CanSeeLos (Card c, int dist=-1)
 
bool CanSeeLos (Point p, int dist=-1)
 
bool HasAccess (Card c)
 
bool HasAccess (Point p)
 
bool CanSleep ()
 
override string GetName (NameStyle style, int num=-1)
 
override void ChangeRarity (Rarity r)
 
Chara SetFaction (Faction f)
 
Chara SetHomeZone (Zone zone)
 
Chara SetHostility (Hostility h)
 
void OnBanish ()
 
Chara SetGlobal (Zone _home, int x, int z)
 
Chara SetGlobal ()
 
void RemoveGlobal ()
 
override void OnBeforeCreate ()
 
override void OnCreate (int genLv)
 
Chara ScaleByPrincipal ()
 
void SetFaith (string id)
 
void SetFaith (Religion r)
 
void HealAll ()
 
void Refresh (bool calledRecursive=false)
 
bool CanDuplicate ()
 
Chara Duplicate ()
 
int GetBurden (Card t=null, int num=-1)
 
void CalcBurden ()
 
void Stumble (int mtp=100)
 
void SetDirtySpeed ()
 
void RefreshSpeed (Element.BonusInfo info=null)
 
void CalculateMaxStamina ()
 
override void ApplyEditorTags (EditorTag tag)
 
override void SetSource ()
 
void SetMainElement (string id, int v=0, bool elemental=false)
 
void SetMainElement (int id, int v=0, bool elemental=false)
 
void ApplyJob (bool remove=false)
 
void ChangeJob (string idNew)
 
void AddRandomBodyPart (bool msg=false)
 
void RemoveLastBodyPart (bool msg=false)
 
void ResetBody ()
 
void ApplyRace (bool remove=false)
 
void ChangeRace (string idNew)
 
void MakePartyMemeber ()
 
void MakeAlly (bool msg=true)
 
void _MakeAlly ()
 
bool CanBeTempAlly (Chara c)
 
void Banish (Chara owner)
 
void MakeMinion (Chara _master, MinionType type=MinionType.Default)
 
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 SaiyanRevive ()
 
void MakeGrave (string lastword)
 
void ApplyDeathPenalty ()
 
void Vomit ()
 
override void Die (Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None, Chara originalTarget=null)
 
void TryDropBossLoot ()
 
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)
 
bool CanBloom ()
 
void AddCooldown (int idEle, int turns=0)
 
void SetCooldown (int idEle, int turns=0)
 
bool HasCooldown (int idEle)
 
int GetCooldown (int idEle)
 
void TickCooldown ()
 
void ChooseNewGoal ()
 
Goal GetGoalFromTimeTable (int hour)
 
Goal GetGoalWork ()
 
Goal GetGoalHobby ()
 
bool HasHobbyOrWork (string alias)
 
void SetAIIdle ()
 
void SetAIAggro ()
 
AIAct SetNoGoal ()
 
AIAct SetAI (AIAct g)
 
void SetAIImmediate (AIAct g)
 
BaseArea GetRoomWork ()
 
List< HobbyListWorks (bool useMemberType=true)
 
List< HobbyListHobbies (bool useMemberType=true)
 
Hobby GetWork (string id)
 
void RefreshWorkElements (ElementContainer parent=null)
 
string GetTextHobby (bool simple=false)
 
string GetTextWork (bool simple=false)
 
void AddHobby (int id)
 
void AddWork (int id)
 
void RerollHobby (bool extraSlotChance=true)
 
WorkSummary GetWorkSummary ()
 
void TickWork (VirtualDate date)
 
bool TryWorkOutside (SourceHobby.Row sourceWork)
 
void PerformWork (WorkSession session, bool isHobby=false, bool IsRealTime=false)
 
void ValidateWorks ()
 
void InitStats (bool onDeserialize=false)
 
Condition AddCondition< T > (int p=100, bool force=false)
 
Condition AddCondition (string id, int p=100, bool force=false)
 
Condition AddCondition (Condition c, bool force=false)
 
override bool HasCondition< T > ()
 
bool HasCondition (string alias)
 
Element GetBuffStats (string alias)
 
Element GetBuffStats (int ele)
 
int CountDebuff ()
 
void CureCondition< T > (int v=99999)
 
GetCondition< T > ()
 
void RemoveCondition< T > ()
 
void CureHost (CureType type, int p=100, BlessedState state=BlessedState.Normal)
 
void Cure (CureType type, int p=100, BlessedState state=BlessedState.Normal)
 
void RemoveAllStances ()
 
bool TryNeckHunt (Chara TC, int power, bool harvest=false)
 
void AddResistCon (Condition con)
 
void ResistCon (Condition con)
 
void Sleep (Thing bed=null, Thing pillow=null, bool pickup=false, ItemPosition posBed=null, ItemPosition posPillow=null)
 
void OnSleep (Thing bed=null, int days=1)
 
void OnSleep (int power, int days=1, bool isSunLit=false)
 
void ModHeight (int a)
 
void ModWeight (int a, bool ignoreLimit=false)
 
void ModCorruption (int a)
 
List< ElementListAvailabeFeats (bool pet=false, bool showAll=false)
 
void SetFeat (int id, int value=1, bool msg=false)
 
void SetMutation (int idEle, int a=0)
 
bool MutateRandom (int vec=0, int tries=100, bool ether=false, BlessedState state=BlessedState.Normal)
 
void GainAbility (int ele, int mtp=100, Thing origin=null)
 
bool TryNullifyCurse ()
 
void OnAdvanceDay ()
 
void AddFoodHistory (Thing food)
 
int CountNumEaten (Thing food)
 
int GetPietyValue ()
 
void RefreshFaithElement ()
 
void ModTempElement (int ele, int a, bool naturalDecay=false, bool onlyRenew=false)
 
void DamageTempElements (int p, bool body, bool mind, bool onlyRenew=false)
 
void DamageTempElement (int ele, int p, bool onlyRenew=false)
 
void EnhanceTempElements (int p, bool body, bool mind, bool onlyRenew=false)
 
void EnhanceTempElement (int ele, int p, bool onlyRenew=false)
 
void DiminishTempElements (int a=1)
 
void CureTempElements (int p, bool body, bool mind)
 
void ClearTempElements ()
 
- Public Member Functions inherited from Card
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 PurgeEythArtifact ()
 
void RemoveThings ()
 
void RemoveThing (Thing thing)
 
bool ShouldTrySetDirtyInventory ()
 
virtual bool CanStackTo (Thing to)
 
bool TryStackTo (Thing to)
 
ICardParent GetRoot ()
 
Card GetRootCard ()
 
bool IsStackable (Thing tg)
 
Thing Duplicate (int num)
 
Thing Split (int a)
 
Thing SetNum (int a)
 
Thing SetNoSell ()
 
void ModNum (int a, bool notify=true)
 
void AddSocket ()
 
void ApplySocket (Thing t)
 
void ApplySocket (int id, int lv, Card mod=null)
 
void EjectSockets ()
 
SocketData AddRune (Card rune)
 
SocketData AddRune (int idEle, int v, bool free)
 
SocketData GetRuneEnc (int idEle)
 
int CountRune (bool countFree=true)
 
int MaxRune ()
 
bool CanAddRune (TraitMod mod)
 
bool HasRune ()
 
void OnChildNumChange (Card c)
 
Card Install ()
 
void SetPlaceState (PlaceState newState, bool byPlayer=false)
 
int GetTotalQuality (bool applyBonus=true)
 
void ModEncLv (int a)
 
void SetEncLv (int a)
 
void SetTier (int a, bool setTraits=true)
 
virtual void SetBlessedState (BlessedState s)
 
virtual void ChangeRarity (Rarity q)
 
bool TryPay (int a, string id="money")
 
void SetCharge (int a)
 
void ModCharge (int a, bool destroy=false)
 
void ModCurrency (int a, string id="money")
 
int GetCurrency (string id="money")
 
virtual void HealHPHost (int a, HealSource origin=HealSource.None)
 
virtual void HealHP (int a, HealSource origin=HealSource.None)
 
virtual int GetArmorSkill ()
 
virtual long ApplyProtection (long dmg, int mod=100)
 
void DamageHP (long dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
 
void DamageHP (long dmg, int ele, int eleP=100, AttackSource attackSource=AttackSource.None, Card origin=null, bool showEffect=true, Thing weapon=null, Chara originalTarget=null)
 
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 GetHearingRadius ()
 
int GetSightRadius ()
 
int GetLightRadius ()
 
void CalculateFOV ()
 
void SetRandomLightColors ()
 
Fov CreateFov ()
 
void ClearFOV ()
 
virtual void OnSimulateHour (VirtualDate date)
 
void DecayNatural (int hour=1)
 
void CheckJustCooked ()
 
void Decay (int a=10)
 
bool HasTalk (string idTopic)
 
void Talk (string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
 
void TalkRaw (string text, string ref1=null, string ref2=null, bool forceSync=false)
 
string 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
 
bool isWeakToSunlight
 
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
 
const int DamageLimit = 99999999
 
- Static Public Attributes inherited from EClass
static Core core
 

Protected Member Functions

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

Properties

string Aka [get]
 
string _alias [get, set]
 
string idFaith [get, set]
 
string idFaction [get, set]
 
Zone currentZone [get, set]
 
Zone homeZone [get, set]
 
GoalListType goalListType [get, set]
 
Hostility hostility [get, set]
 
int _affinity [get, set]
 
Affinity affinity [get]
 
int interest [get, set]
 
int daysStarved [get, set]
 
int _idTimeTable [get, set]
 
int uidEditor [get, set]
 
int _maxStamina [get, set]
 
int corruption [get, set]
 
bool isDead [get, set]
 
bool isAlawysVisible [get, set]
 
bool knowFav [get, set]
 
CharaAbility ability [get]
 
Faction faction [get, set]
 
Religion faith [get, set]
 
override CardRow sourceCard [get]
 
override CardRow sourceRenderCard [get]
 
SourceRace.Row race [get]
 
SourceJob.Row job [get]
 
string idTimeTable [get]
 
Hostility OriginalHostility [get]
 
string IDPCCBodySet [get]
 
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]
 
bool IsCat [get]
 
int DestDist [get]
 
bool HasNoGoal [get]
 
bool CanWitness [get]
 
bool IsHumanSpeak [get]
 
bool IsMaid [get]
 
bool IsPrisoner [get]
 
bool IsAdventurer [get]
 
bool IsEyth [get]
 
bool IsWealthy [get]
 
FactionBranch homeBranch [get]
 
int MaxGeneSlot [get]
 
int CurrentGeneSlot [get]
 
int Speed [get]
 
bool IsMofuable [get]
 
ElementContainer baseWorkElements [get]
 
Stats hunger [get]
 
Stats burden [get]
 
Stats stamina [get]
 
Stats depression [get]
 
Stats bladder [get]
 
Stats hygiene [get]
 
Stats mana [get]
 
Stats sleepiness [get]
 
Stats SAN [get]
 
bool CanGainConResist [get]
 
- Properties inherited from Card
Card parentCard [get]
 
Thing parentThing [get]
 
int colorInt [get]
 
bool IsHotItem [get]
 
int uid [get, set]
 
int idMaterial [get, set]
 
int dir [get, set]
 
int Num [get, set]
 
int _x [get, set]
 
int _z [get, set]
 
int genLv [get, set]
 
int refVal [get, set]
 
int decay [get, set]
 
int altitude [get, set]
 
int hp [get, set]
 
float fx [get, set]
 
float fy [get, set]
 
BlessedState blessedState [get, set]
 
PlaceState _placeState [get, set]
 
int rarityLv [get, set]
 
Rarity rarity [get, set]
 
int encLV [get, set]
 
int posInvX [get, set]
 
int posInvY [get, set]
 
int idSkin [get, set]
 
int feat [get, set]
 
int LV [get, set]
 
int exp [get, set]
 
int tier [get, set]
 
int version [get, set]
 
bool isCensored [get, set]
 
bool isDeconstructing [get, set]
 
bool isDyed [get, set]
 
bool isModified [get, set]
 
bool isNew [get, set]
 
bool isPlayerCreation [get, set]
 
bool ignoreAutoPick [get, set]
 
bool freePos [get, set]
 
bool isHidden [get, set]
 
bool isOn [get, set]
 
bool isNPCProperty [get, set]
 
bool isRestrained [get, set]
 
bool isRoofItem [get, set]
 
bool isMasked [get, set]
 
bool disableAutoToggle [get, set]
 
bool isImported [get, set]
 
bool autoRefuel [get, set]
 
bool ignoreStackHeight [get, set]
 
bool isFloating [get, set]
 
bool isWeightChanged [get, set]
 
bool isFireproof [get, set]
 
bool isAcidproof [get, set]
 
bool isReplica [get, set]
 
bool isSummon [get, set]
 
bool isElemental [get, set]
 
bool isBroken [get, set]
 
bool isSubsetCard [get, set]
 
bool noSnow [get, set]
 
bool noMove [get, set]
 
bool isGifted [get, set]
 
bool isCrafted [get, set]
 
bool isLostProperty [get, set]
 
bool noShadow [get, set]
 
bool noSell [get, set]
 
bool isLeashed [get, set]
 
bool isStolen [get, set]
 
bool isSale [get, set]
 
bool isCopy [get, set]
 
bool isRestocking [get, set]
 
bool hasSpawned [get, set]
 
bool isScaled [get, set]
 
bool 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]
 
Thing c_bloodData [get, set]
 
byte[] c_textureData [get, set]
 
SourceMaterial.Row DyeMat [get]
 
int invX [get, set]
 
int invY [get, set]
 
CardRow refCard [get]
 
CardRow refCard2 [get]
 
int ExpToNext [get]
 
int DefaultLV [get]
 
int ChildrenWeight [get]
 
int ChildrenAndSelfWeight [get]
 
int ChildrenAndSelfWeightSingle [get]
 
virtual int SelfWeight [get]
 
virtual int WeightLimit [get]
 
SourceCategory.Row category [get]
 
SourceMaterial.Row material [get]
 
virtual string AliasMaterialOnCreate [get]
 
Cell Cell [get]
 
virtual Thing Thing [get]
 
virtual Chara Chara [get]
 
virtual bool isThing [get]
 
virtual bool isChara [get]
 
bool ExistsOnMap [get]
 
virtual bool isSynced [get]
 
bool IsContainer [get]
 
bool IsUnique [get]
 
bool IsPowerful [get]
 
bool IsImportant [get]
 
virtual SourcePref Pref [get]
 
virtual bool IsDeadOrSleeping [get]
 
virtual bool IsDisabled [get]
 
virtual bool IsMoving [get]
 
virtual bool flipX [get]
 
virtual bool IsAliveInCurrentZone [get]
 
virtual string actorPrefab [get]
 
virtual CardRow sourceCard [get]
 
virtual CardRow sourceRenderCard [get]
 
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
 
long _Speed
 
bool hasMovedThisTurn
 

Static Private Attributes

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

Additional Inherited Members

- Public Types inherited from Card
enum  MoveResult { Fail , Success , Door }
 
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 6568 of file Chara.cs.

6569 {
6570 CardRenderer cardRenderer = renderer;
6571 CharaRenderer charaRenderer = new CharaRenderer();
6572 if (source.skinAntiSpider != 0 && EClass.core.config.game.antiSpider)
6573 {
6574 base.idSkin = source.skinAntiSpider;
6575 }
6576 if (host != null)
6577 {
6578 charaRenderer.pccData = PCCData.Create("ride");
6579 string idPart = base.c_idRidePCC.IsEmpty(EClass.core.pccs.sets["ride"].map["body"].map.Keys.First());
6580 charaRenderer.pccData.SetPart("body", "ride", idPart);
6581 charaRenderer.pccData.ride = EClass.core.pccs.GetRideData(idPart);
6582 }
6583 else
6584 {
6585 foreach (Condition condition in conditions)
6586 {
6587 RendererReplacer rendererReplacer = condition.GetRendererReplacer();
6588 if (rendererReplacer != null)
6589 {
6590 charaRenderer.replacer = rendererReplacer;
6591 charaRenderer.data = rendererReplacer.data;
6592 break;
6593 }
6594 }
6595 if (charaRenderer.replacer == null)
6596 {
6597 charaRenderer.pccData = pccData;
6598 }
6599 }
6600 renderer = charaRenderer;
6601 renderer.SetOwner(this);
6602 if (cardRenderer != null)
6603 {
6604 renderer.SetFirst(first: false, cardRenderer.position);
6605 }
6606 return charaRenderer;
6607 }
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:61
PCCData pccData
Chara host
Definition: Chara.cs:33
List< Condition > conditions
Definition: Chara.cs:211
SourceChara.Row source
Definition: Chara.cs:158
PCCData pccData
Definition: Chara.cs:67
new GameConfig game
Definition: CoreConfig.cs:609
PCCManager pccs
Definition: Core.cs:41
CoreConfig config
Definition: Core.cs:70
Definition: EClass.cs:6
static Core core
Definition: EClass.cs:7

References CoreConfig.GameConfig.antiSpider, Core.config, EClass.core, RendererReplacer.data, CoreConfig.game, BaseCondition.GetRendererReplacer(), CharaRenderer.pccData, 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 2288 of file Chara.cs.

2289 {
2290 if (EClass.pc.homeBranch != null)
2291 {
2293 }
2294 else
2295 {
2296 SetGlobal();
2298 }
2299 Hostility hostility2 = (base.c_originalHostility = Hostility.Ally);
2300 this.hostility = hostility2;
2301 orgPos = null;
2302 base.c_summonDuration = 0;
2303 base.isSummon = false;
2304 ReleaseMinion();
2305 SetInt(32);
2306 Refresh();
2307 }
Hostility
Definition: Hostility.cs:2
list. Refresh()
void SetInt(int id, int value=0)
Definition: BaseCard.cs:39
void ReleaseMinion()
Definition: Chara.cs:2354
Chara SetFaction(Faction f)
Definition: Chara.cs:1419
Point orgPos
Definition: Chara.cs:21
FactionBranch homeBranch
Definition: Chara.cs:1066
Chara SetGlobal()
Definition: Chara.cs:1486
static Faction Home
Definition: EClass.cs:27
static Chara pc
Definition: EClass.cs:15
void AddMemeber(Chara c)

References FactionBranch.AddMemeber(), EClass.Home, homeBranch, orgPos, EClass.pc, Refresh(), 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 2734 of file Chara.cs.

2735 {
2736 if (isDead)
2737 {
2738 return MoveResult.Fail;
2739 }
2740 if (IsPC)
2741 {
2742 float num = EClass.setting.defaultActPace;
2743 switch (burden.GetPhase())
2744 {
2745 case 3:
2746 num *= 1.5f;
2747 break;
2748 case 4:
2749 num *= 2f;
2750 break;
2751 }
2753 {
2754 int num2 = 30;
2755 if (!EClass.pc.HasElement(408))
2756 {
2758 {
2759 case Weather.Condition.Rain:
2760 num2 += 5;
2761 break;
2762 case Weather.Condition.RainHeavy:
2763 num2 += 10;
2764 num *= 1.5f;
2765 break;
2766 case Weather.Condition.Snow:
2767 num2 += 10;
2768 break;
2769 case Weather.Condition.SnowHeavy:
2770 num2 += 15;
2771 num *= 1.5f;
2772 break;
2773 }
2774 }
2775 if (newPoint.matFloor.id == 48)
2776 {
2777 num2 += 20;
2778 num *= 1.8f;
2779 }
2780 num2 = num2 * 100 / (100 + EvalueMax(240, -20) + EvalueMax(407, -5) * 5);
2781 EClass.world.date.AdvanceMin(num2 * 6);
2782 EClass.player.lastZonePos = null;
2784 int num3 = base.hp;
2785 for (int i = 0; i < num2 * 4; i++)
2786 {
2787 EClass.pc.party.members.ForeachReverse(delegate(Chara m)
2788 {
2789 if (!m.isDead)
2790 {
2791 m.TickConditions();
2792 }
2793 });
2794 if (base.hp < MaxHP / 5 && base.hp < num3 && !EClass.player.regionMoveWarned)
2795 {
2796 EClass.player.regionMoveWarned = true;
2797 Msg.Say("regionAbortMove");
2798 EInput.Consume(consumeAxis: true);
2799 SetAI(new NoGoal());
2800 return MoveResult.Fail;
2801 }
2802 }
2803 if (newPoint.cell.CanSuffocate())
2804 {
2805 AddCondition<ConSuffocation>((EClass.pc.Evalue(200) != 0) ? (2000 / (100 + EvalueMax(200, -5) * 10)) : 30, force: true);
2806 int num4 = GetCondition<ConSuffocation>()?.GetPhase() ?? 0;
2807 if (num4 >= 2)
2808 {
2809 DamageHP(EClass.rndHalf(10 + MaxHP / 5), AttackSource.Condition);
2810 }
2811 if (!isDead && !HasElement(429))
2812 {
2813 ModExp(200, 1 + num4 * 12);
2814 }
2815 }
2816 EClass.player.regionMoveWarned = false;
2817 if (isDead)
2818 {
2819 return MoveResult.Fail;
2820 }
2821 }
2822 if (num > EClass.setting.defaultActPace * 3f)
2823 {
2824 num = EClass.setting.defaultActPace * 3f;
2825 }
2826 actTime = num;
2827 }
2828 if (IsPCFaction && EClass.rnd(5) == 0 && newPoint.cell.CanSuffocate())
2829 {
2830 ModExp(200, EClass._zone.IsRegion ? 50 : 5);
2831 if (ride != null)
2832 {
2833 ride.ModExp(200, EClass._zone.IsRegion ? 50 : 5);
2834 }
2835 if (parasite != null)
2836 {
2837 parasite.ModExp(200, EClass._zone.IsRegion ? 50 : 5);
2838 }
2839 }
2840 Chara chara = ((ride == null) ? this : ride);
2841 if (!EClass._zone.IsRegion || chara.IsPC)
2842 {
2843 bool flag = (chara.isConfused && EClass.rnd(2) == 0) || (chara.isDrunk && EClass.rnd(IsIdle ? 2 : 8) == 0 && !chara.HasElement(1215));
2844 if (host != null && host.ride == this && ((host.isConfused && EClass.rnd(2) == 0) || (host.isDrunk && EClass.rnd(IsIdle ? 2 : 8) == 0 && !host.HasElement(1215))))
2845 {
2846 flag = true;
2847 }
2848 if (flag && newPoint.Distance(pos) <= 1)
2849 {
2850 Point randomNeighbor = pos.GetRandomNeighbor();
2851 if (CanMoveTo(randomNeighbor, allowDestroyPath: false))
2852 {
2853 newPoint = randomNeighbor;
2854 if (isDrunk)
2855 {
2856 Talk("drunk");
2857 }
2858 }
2859 }
2860 }
2861 if (newPoint.x != pos.x || newPoint.z != pos.z)
2862 {
2863 LookAt(newPoint);
2864 }
2865 CellEffect effect = base.Cell.effect;
2866 if (effect != null && effect.id == 7)
2867 {
2868 CellEffect effect2 = base.Cell.effect;
2869 if (race.height < 500 && !race.tag.Contains("webfree") && EClass.rnd(effect2.power + 25) > EClass.rnd(base.STR + base.DEX + 1))
2870 {
2871 Say("abWeb_caught", this);
2872 PlaySound("web");
2873 effect2.power = effect2.power * 3 / 4;
2874 renderer.PlayAnime(AnimeID.Shiver);
2875 return MoveResult.Fail;
2876 }
2877 Say("abWeb_pass", this);
2878 EClass._map.SetEffect(base.Cell.x, base.Cell.z);
2879 }
2880 if (IsPC)
2881 {
2882 if (EClass._zone.IsRegion)
2883 {
2885 }
2886 else if ((newPoint.x > pos.x && newPoint.z > pos.z) || (newPoint.x < pos.x && newPoint.z < pos.z))
2887 {
2889 }
2890 }
2891 if (newPoint.cell.hasDoor)
2892 {
2893 foreach (Thing thing in pos.Things)
2894 {
2895 if (thing.trait is TraitDoor traitDoor && traitDoor.owner.c_lockLv > 0)
2896 {
2897 if (base.INT < 10)
2898 {
2899 return MoveResult.Fail;
2900 }
2901 traitDoor.TryOpenLock(this);
2902 return MoveResult.Door;
2903 }
2904 }
2905 }
2906 Cell cell = newPoint.cell;
2907 Cell cell2 = pos.cell;
2908 bool flag2 = cell.HasLiquid && !IsLevitating;
2909 bool hasBridge = cell.HasBridge;
2910 bool hasRamp = cell.HasRamp;
2911 bool flag3 = EClass._zone.IsSnowCovered && !cell.HasRoof && !cell.isClearSnow;
2912 TileRow tileRow = (hasRamp ? ((TileRow)cell.sourceBlock) : ((TileRow)(hasBridge ? cell.sourceBridge : cell.sourceFloor)));
2913 SourceMaterial.Row row = (hasRamp ? cell.matBlock : (hasBridge ? cell.matBridge : cell.matFloor));
2914 bool flag4 = cell.IsTopWater && !cell.isFloating;
2915 if (!EClass._zone.IsRegion)
2916 {
2917 if (cell.hasDoorBoat)
2918 {
2919 tileRow = FLOOR.sourceWood;
2920 row = MATERIAL.sourceOak;
2921 flag4 = false;
2922 }
2923 else if (flag3 && !tileRow.ignoreSnow)
2924 {
2925 if (tileRow.tileType.IsWater)
2926 {
2927 tileRow = FLOOR.sourceIce;
2928 row = MATERIAL.sourceIce;
2929 }
2930 else
2931 {
2932 tileRow = FLOOR.sourceSnow;
2933 row = MATERIAL.sourceSnow;
2934 }
2935 flag4 = false;
2936 }
2937 }
2938 if ((pos.sourceFloor.isBeach || cell2.IsSnowTile) && !pos.HasObj)
2939 {
2940 EClass._map.SetFoormark(pos, 1, (int)Util.GetAngle(pos.x - newPoint.x, pos.z - newPoint.z), cell2.IsSnowTile ? 312 : 304);
2941 }
2942 if (isSynced)
2943 {
2944 string text = ((flag2 || flag4) ? "water" : tileRow.soundFoot.IsEmpty(row.soundFoot.IsEmpty("default")));
2945 if (cell.obj != 0 && cell.sourceObj.tileType.IsPlayFootSound && !cell.matObj.soundFoot.IsEmpty())
2946 {
2947 text = cell.matObj.soundFoot;
2948 }
2949 if (IsPC)
2950 {
2951 foreach (Thing thing2 in newPoint.Things)
2952 {
2953 if (thing2.IsInstalled && (thing2.trait.IsChangeFloorHeight || thing2.Pref.Surface))
2954 {
2955 text = thing2.material.soundFoot;
2956 }
2957 }
2958 }
2959 if (!text.IsEmpty())
2960 {
2961 SoundManager.altLastData = IsPC;
2962 PlaySound("Footstep/" + text, IsPC ? 1f : 0.9f);
2963 }
2964 if (!flag4)
2965 {
2967 PCOrbit pcOrbit = EClass.screen.pcOrbit;
2968 bool flag5 = scene.actionMode.gameSpeed > 1f;
2969 scene.psFoot.transform.position = renderer.position + pcOrbit.footPos;
2970 scene.psFoot.startColor = row.matColor;
2971 scene.psFoot.Emit(pcOrbit.emitFoot * ((!flag5) ? 1 : 2));
2972 if (flag5 && IsPC)
2973 {
2974 scene.psSmoke.transform.position = renderer.position + pcOrbit.smokePos;
2975 scene.psSmoke.Emit(pcOrbit.emitSmoke);
2976 }
2977 }
2978 if (flag2 || flag4)
2979 {
2980 Effect.Get("ripple").Play(0.4f * actTime * EClass.scene.actionMode.gameSpeed, newPoint);
2981 }
2982 }
2983 lastPos.Set(pos);
2984 if (type != MoveType.Force)
2985 {
2986 if (newPoint.HasChara && ai.Current.PushChara)
2987 {
2988 TryPush(newPoint);
2989 }
2990 if (newPoint.HasChara && newPoint.Charas.Count == 1)
2991 {
2992 Chara chara2 = newPoint.Charas[0];
2993 if (CanReplace(chara2))
2994 {
2995 chara2.MoveByForce(lastPos, this);
2996 if (chara.IsPC)
2997 {
2998 Say("replace_pc", chara, chara2);
2999 }
3000 }
3001 }
3002 }
3003 if (cell.hasDoor)
3004 {
3005 foreach (Thing thing3 in newPoint.Things)
3006 {
3007 if (thing3.trait is TraitDoor traitDoor2)
3008 {
3009 traitDoor2.TryOpen(this);
3010 }
3011 }
3012 }
3013 EClass._zone.map.MoveCard(newPoint, this);
3014 SyncRide();
3016 {
3017 foreach (Chara member in EClass.pc.party.members)
3018 {
3019 if (member.isLeashed && !member.IsPC && member.host == null && !member.IsDisabled && !member.HasCondition<ConEntangle>() && !member.IsInCombat && member.Dist(EClass.pc) > 1)
3020 {
3021 member.TryMoveTowards(EClass.pc.pos);
3022 }
3023 }
3024 }
3026 {
3028 }
3029 if (IsPC)
3030 {
3031 PlaySound("Footstep/Extra/pcfootstep");
3032 if (pos.HasThing)
3033 {
3034 foreach (Card item in pos.ListCards())
3035 {
3036 if (!item.isThing || item.placeState != 0 || item.ignoreAutoPick)
3037 {
3038 continue;
3039 }
3041 {
3043 ContainerFlag containerFlag = item.category.GetRoot().id.ToEnum<ContainerFlag>();
3044 if (containerFlag == ContainerFlag.none)
3045 {
3046 containerFlag = ContainerFlag.other;
3047 }
3048 if ((dataPick.noRotten && item.IsDecayed) || (dataPick.onlyRottable && item.trait.Decay == 0))
3049 {
3050 continue;
3051 }
3052 if (dataPick.userFilter)
3053 {
3054 switch (dataPick.IsFilterPass(item.GetName(NameStyle.Full, 1)))
3055 {
3056 case Window.SaveData.FilterResult.PassWithoutFurtherTest:
3057 Pick(item.Thing);
3058 continue;
3059 case Window.SaveData.FilterResult.Block:
3060 continue;
3061 }
3062 }
3063 if (dataPick.advDistribution)
3064 {
3065 foreach (int cat in dataPick.cats)
3066 {
3067 if (item.category.uid == cat)
3068 {
3069 Pick(item.Thing);
3070 }
3071 }
3072 }
3073 else if (!dataPick.flag.HasFlag(containerFlag))
3074 {
3075 Pick(item.Thing);
3076 }
3077 }
3078 else
3079 {
3080 Pick(item.Thing);
3081 }
3082 }
3083 }
3084 if (EClass._zone.IsRegion)
3085 {
3087 if (cell3?.zone != null && !cell3.zone.HiddenInRegionMap && (!(cell3.zone is Zone_Field) || cell3.zone.children.Count > 0 || cell3.zone.IsPCFaction))
3088 {
3089 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() ?? "");
3090 }
3091 if (pos.matFloor.alias == "snow" && EClass.rnd(3) == 0)
3092 {
3094 Msg.Say(Lang.GetList("walk_snow").RandomItem());
3095 }
3096 else if (EClass.world.weather.CurrentCondition == Weather.Condition.RainHeavy && EClass.rnd(3) == 0)
3097 {
3099 Msg.Say(Lang.GetList("walk_storm").RandomItem());
3100 }
3101 }
3103 }
3104 if (IsPCC)
3105 {
3106 int num5 = Mathf.Abs(cell2.topHeight - cell.topHeight);
3107 if ((num5 >= 3 && lastPos.sourceBlock.tileType.slopeHeight == 0 && newPoint.sourceBlock.tileType.slopeHeight == 0) || cell2.hasDoorBoat || cell.hasDoorBoat)
3108 {
3109 renderer.PlayAnime((cell2.topHeight >= cell.topHeight) ? AnimeID.JumpDown : ((num5 >= 6) ? AnimeID.Jump : AnimeID.JumpSmall));
3110 }
3111 else
3112 {
3113 float surfaceHeight = cell2.GetSurfaceHeight();
3114 float surfaceHeight2 = cell.GetSurfaceHeight();
3115 num5 = (int)Mathf.Abs((surfaceHeight - surfaceHeight2) * 100f);
3116 if (num5 >= 15)
3117 {
3118 renderer.PlayAnime((surfaceHeight >= surfaceHeight2) ? AnimeID.JumpDown : ((num5 >= 40) ? AnimeID.Jump : AnimeID.JumpSmall));
3119 }
3120 }
3121 }
3122 lastPos.Things.ForeachReverse(delegate(Thing t)
3123 {
3124 t.trait.OnSteppedOut(this);
3125 });
3126 if (!IsPC)
3127 {
3128 pos.Things.ForeachReverse(delegate(Thing t)
3129 {
3130 t.trait.OnStepped(this);
3131 });
3132 }
3133 if (CanDestroyPath())
3134 {
3136 }
3137 if (IsPC)
3138 {
3139 if (renderer.anime == null && renderer.replacer != null)
3140 {
3142 }
3144 {
3145 if (!FLOOR.IsTatami(pos.cell.sourceSurface.id) && pos.cell.room == null)
3146 {
3147 EClass.player.flags.isShoesOff = false;
3148 EClass.pc.Say("shoes_on", EClass.pc);
3149 EClass.pc.SetPCCState(PCCState.Normal);
3150 }
3151 }
3152 else if (FLOOR.IsTatami(pos.cell.sourceSurface.id) && pos.cell.room != null)
3153 {
3154 EClass.player.flags.isShoesOff = true;
3155 EClass.pc.Say("shoes_off", EClass.pc);
3156 EClass.pc.SetPCCState(PCCState.ShoesOff);
3157 }
3158 }
3159 hasMovedThisTurn = true;
3160 return MoveResult.Success;
3161 }
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:2585
bool HasElement(int ele, int req=1)
Definition: Card.cs:5897
SourceMaterial.Row material
Definition: Card.cs:2051
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:6129
int c_lockLv
Definition: Card.cs:964
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
Definition: Card.cs:6684
Point pos
Definition: Card.cs:59
Trait trait
Definition: Card.cs:53
MoveType
Definition: Card.cs:20
void DamageHP(long dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
Definition: Card.cs:4060
MoveResult
Definition: Card.cs:13
bool IsInstalled
Definition: Card.cs:2381
int Evalue(int ele)
Definition: Card.cs:2571
int Dist(Card c)
Definition: Card.cs:7628
void ModExp(string alias, int a)
Definition: Card.cs:2648
bool isLeashed
Definition: Card.cs:842
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:6781
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:3655
bool IsLevitating
Definition: Chara.cs:597
AIAct ai
Definition: Chara.cs:202
override bool IsPC
Definition: Chara.cs:612
bool isDrunk
Definition: Chara.cs:124
Party party
Definition: Chara.cs:43
bool CanDestroyPath()
Definition: Chara.cs:2402
bool IsInCombat
Definition: Chara.cs:864
bool HasCondition(string alias)
Definition: Chara.cs:9329
AIAct SetAI(AIAct g)
Definition: Chara.cs:8798
bool IsIdle
Definition: Chara.cs:853
override bool IsDisabled
Definition: Chara.cs:585
bool hasMovedThisTurn
Definition: Chara.cs:176
override bool isSynced
Definition: Chara.cs:691
bool CanMoveTo(Point p, bool allowDestroyPath=true)
Definition: Chara.cs:2415
void DestroyPath(Point pos)
Definition: Chara.cs:3163
override bool IsPCFaction
Definition: Chara.cs:671
float actTime
Definition: Chara.cs:178
override int MaxHP
Definition: Chara.cs:708
Zone currentZone
Definition: Chara.cs:255
bool CanReplace(Chara c)
Definition: Chara.cs:3274
Point lastPos
Definition: Chara.cs:90
void MoveByForce(Point newPoint, Card c=null, bool checkWall=false)
Definition: Chara.cs:2600
Stats burden
Definition: Chara.cs:1144
Chara parasite
Definition: Chara.cs:30
Chara ride
Definition: Chara.cs:27
MoveResult TryMoveTowards(Point p)
Definition: Chara.cs:2608
void SyncRide()
Definition: Chara.cs:3884
bool isDead
Definition: Chara.cs:389
override void LookAt(Card c)
Definition: Chara.cs:3519
bool isConfused
Definition: Chara.cs:126
override bool IsPCC
Definition: Chara.cs:682
void TryPush(Point point)
Definition: Chara.cs:3207
void SetPCCState(PCCState state)
Definition: Chara.cs:6609
SourceRace.Row race
Definition: Chara.cs:464
bool allyKeepDistance
Definition: ConfigTactics.cs:6
static Game game
Definition: EClass.cs:9
static Scene scene
Definition: EClass.cs:31
static Zone _zone
Definition: EClass.cs:21
static World world
Definition: EClass.cs:41
static Map _map
Definition: EClass.cs:19
static int rnd(long a)
Definition: EClass.cs:59
static BaseGameScreen screen
Definition: EClass.cs:33
static int rndHalf(int a)
Definition: EClass.cs:88
static Player player
Definition: EClass.cs:13
static GameSetting setting
Definition: EClass.cs:35
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:218
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:19
bool isShoesOff
Definition: Player.cs:347
int distanceTravel
Definition: Player.cs:893
Flags flags
Definition: Player.cs:1094
Window.SaveData dataPick
Definition: Player.cs:1034
bool regionMoveWarned
Definition: Player.cs:1157
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:1051
Point Set(int _x, int _z)
Definition: Point.cs:503
List< Thing > Things
Definition: Point.cs:338
int x
Definition: Point.cs:36
int z
Definition: Point.cs:39
List< Chara > Charas
Definition: Point.cs:340
bool HasThing
Definition: Point.cs:251
SourceFloor.Row sourceFloor
Definition: Point.cs:65
bool HasObj
Definition: Point.cs:137
int Distance(Point p)
Definition: Point.cs:989
Cell cell
Definition: Point.cs:51
Point GetRandomNeighbor()
Definition: Point.cs:759
bool HasChara
Definition: Point.cs:238
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:503
virtual bool IsRegion
Definition: Spatial.cs:515
virtual string Name
Definition: Spatial.cs:509
SourceZone.Row source
Definition: Spatial.cs:453
List< Spatial > children
Definition: Spatial.cs:37
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:1081
virtual bool IsChangeFloorHeight
Definition: Trait.cs:73
virtual void OnStepped(Chara c)
Definition: Trait.cs:1077
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:284
override int DangerLv
Definition: Zone.cs:107
bool IsPCFaction
Definition: Zone.cs:470
virtual bool KeepAllyDistance
Definition: Zone.cs:299
virtual bool HiddenInRegionMap
Definition: Zone.cs:410
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 7148 of file Chara.cs.

7149 {
7150 EClass.Sound.Play("pop_drama");
7151 if (book == "_chara" && IsPC)
7152 {
7153 step = "pc";
7154 }
7155 return LayerDrama.Activate(book, sheet, step, this, null, tag);
7156 }
static SoundManager Sound
Definition: EClass.cs:47
static LayerDrama Activate(string book, string idSheet, string idStep, Chara target=null, Card ref1=null, string tag="")
Definition: LayerDrama.cs:66

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

◆ AddCondition() [1/2]

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

Definition at line 9173 of file Chara.cs.

9174 {
9175 c.owner = this;
9176 if (!(c is ConBurning))
9177 {
9178 if (c is ConBleed && ResistLv(964) >= 3)
9179 {
9180 return null;
9181 }
9182 }
9183 else if (ResistLv(950) >= 3)
9184 {
9185 return null;
9186 }
9188 {
9189 if (c.GainResistFactor >= 400)
9190 {
9191 c.power /= 2;
9192 }
9193 ResistCon(c);
9194 if (c.power <= 0)
9195 {
9196 return null;
9197 }
9198 }
9199 if (!force)
9200 {
9201 if (c.source.negate.Length != 0)
9202 {
9203 string[] negate = c.source.negate;
9204 foreach (string text in negate)
9205 {
9206 if (HasElement(text))
9207 {
9208 return null;
9209 }
9210 }
9211 }
9212 Element defenseAttribute = c.GetDefenseAttribute(this);
9213 if (defenseAttribute != null)
9214 {
9215 c.power = 100 * c.power / Mathf.Max(100 + defenseAttribute.Value, 1);
9216 }
9217 if (c.source.resistance.Length != 0)
9218 {
9219 int num = ResistLv(EClass.sources.elements.alias[c.source.resistance[0]].id);
9220 if (num > 0)
9221 {
9222 c.power /= num * num + 1;
9223 if (c.power <= 40)
9224 {
9225 return null;
9226 }
9227 }
9228 }
9229 c.power = c.EvaluatePower(c.power);
9230 if (c.power <= 0)
9231 {
9232 return null;
9233 }
9234 }
9235 int num2 = c.EvaluateTurn(c.power);
9236 if (num2 == 0)
9237 {
9238 return null;
9239 }
9240 for (int j = 0; j < conditions.Count; j++)
9241 {
9242 if (conditions[j].id != c.id)
9243 {
9244 continue;
9245 }
9246 if (c.Type == ConditionType.Stance || c.IsToggle)
9247 {
9248 conditions[j].Kill();
9249 return null;
9250 }
9251 if (conditions[j].CanStack(c))
9252 {
9253 if (conditions[j].WillOverride)
9254 {
9255 if (num2 > conditions[j].value)
9256 {
9257 conditions[j].Kill(silent: true);
9258 continue;
9259 }
9260 return null;
9261 }
9262 if (CanGainConResist)
9263 {
9264 AddResistCon(c);
9265 }
9266 conditions[j].OnStacked(c.power);
9267 conditions[j].OnStartOrStack();
9268 conditions[j].PlayEffect();
9269 }
9270 if (!conditions[j].AllowMultipleInstance)
9271 {
9272 return null;
9273 }
9274 }
9275 foreach (Condition condition in conditions)
9276 {
9277 if (condition.TryNullify(c))
9278 {
9279 return null;
9280 }
9281 }
9282 c.value = num2;
9283 conditions.Add(c);
9284 if (CanGainConResist)
9285 {
9286 AddResistCon(c);
9287 }
9288 c.SetOwner(this);
9289 c.Start();
9290 SetDirtySpeed();
9291 if (c.ShouldRefresh)
9292 {
9293 Refresh();
9294 }
9295 if (c.CancelAI)
9296 {
9297 ai.Cancel();
9298 }
9299 if (IsPC && c.ConsumeTurn && !EClass.pc.isRestrained)
9300 {
9302 }
9303 if (c.SyncRide && (ride != null || parasite != null))
9304 {
9305 if (ride != null)
9306 {
9308 }
9309 if (parasite != null)
9310 {
9312 }
9313 }
9314 return c;
9315 }
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:566
int ResistLv(int res)
Definition: Card.cs:5892
void SetDirtySpeed()
Definition: Chara.cs:1851
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:9168
bool CanGainConResist
Definition: Chara.cs:1161
void AddResistCon(Condition con)
Definition: Chara.cs:9572
void ResistCon(Condition con)
Definition: Chara.cs:9592
static Condition Create(string alias, int power=100, Action< Condition > onCreate=null)
Definition: Condition.cs:46
static SourceManager sources
Definition: EClass.cs:43
int Value
Definition: ELEMENT.cs:292
void EndTurn(bool consume=true)
Definition: Player.cs:2077
SourceElement elements

References AddCondition(), AIAct.Cancel(), Condition.Create(), SourceManager.elements, Player.EndTurn(), BaseCondition.EvaluatePower(), BaseCondition.EvaluateTurn(), BaseCondition.GainResistFactor, BaseCondition.GetDefenseAttribute(), BaseStats.id, Card.isRestrained, BaseCondition.IsToggle, EClass.pc, EClass.player, BaseCondition.power, 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 9163 of file Chara.cs.

9163 : Condition
9164 {
9165 return AddCondition(typeof(T).Name, p, force);
9166 }
string Name
Definition: Card.cs:2137

◆ AddCooldown()

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

Definition at line 8579 of file Chara.cs.

8580 {
8581 if (_cooldowns == null)
8582 {
8583 _cooldowns = new List<int>();
8584 }
8585 if (turns != 0)
8586 {
8587 _cooldowns.Add(idEle * 1000 + turns);
8588 return;
8589 }
8590 SourceElement.Row row = EClass.sources.elements.map[idEle];
8591 if (row.cooldown > 0)
8592 {
8593 _cooldowns.Add(idEle * 1000 + row.cooldown);
8594 }
8595 }
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 10059 of file Chara.cs.

10060 {
10061 if (!IsPCFaction || !IsGlobal)
10062 {
10063 _historyFood = null;
10064 return;
10065 }
10066 if (_historyFood == null)
10067 {
10068 _historyFood = new List<List<string>>
10069 {
10070 new List<string>()
10071 };
10072 }
10073 if (_historyFood[0].Count < 5)
10074 {
10075 _historyFood[0].Add(food.id);
10076 }
10077 }
override bool IsGlobal
Definition: Chara.cs:610
List< List< string > > _historyFood
Definition: Chara.cs:64

References food.

Referenced by FoodEffect.Proc().

◆ AddHobby()

void Chara.AddHobby ( int  id)
inline

Definition at line 8998 of file Chara.cs.

8999 {
9000 foreach (int hobby in _hobbies)
9001 {
9002 if (hobby == id)
9003 {
9004 return;
9005 }
9006 }
9007 _hobbies.Add(id);
9008 }
List< int > _hobbies
Definition: Chara.cs:49

◆ AddRandomBodyPart()

void Chara.AddRandomBodyPart ( bool  msg = false)
inline

Definition at line 2183 of file Chara.cs.

2184 {
2185 int ele = new int[9] { 30, 31, 33, 35, 35, 36, 34, 37, 39 }.RandomItem();
2186 body.AddBodyPart(ele);
2187 if (msg)
2188 {
2189 Say("gain_bodyparts", this, Element.Get(ele).GetName().ToLower());
2190 PlaySound("offering");
2191 }
2192 }
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 9572 of file Chara.cs.

9573 {
9574 if (con.power > 0 && con.GainResistFactor > 0)
9575 {
9576 int key = con.id;
9577 if (resistCon == null)
9578 {
9579 resistCon = new Dictionary<int, int>();
9580 }
9581 if (resistCon.ContainsKey(key))
9582 {
9583 resistCon[key] += con.power * con.GainResistFactor / 100;
9584 }
9585 else
9586 {
9587 resistCon[key] = con.power * con.GainResistFactor / 100;
9588 }
9589 }
9590 }
Dictionary< int, int > resistCon
Definition: Chara.cs:214

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

◆ AddWork()

void Chara.AddWork ( int  id)
inline

Definition at line 9010 of file Chara.cs.

9011 {
9012 foreach (int work in _works)
9013 {
9014 if (work == id)
9015 {
9016 return;
9017 }
9018 }
9019 _works.Add(id);
9020 }
List< int > _works
Definition: Chara.cs:52

◆ ApplyDeathPenalty()

void Chara.ApplyDeathPenalty ( )
inline

Definition at line 5191 of file Chara.cs.

5192 {
5193 if (!IsPC)
5194 {
5195 return;
5196 }
5197 int currency = GetCurrency();
5198 if (currency > 0)
5199 {
5200 int num = currency / 3 + EClass.rnd(currency / 3 + 1);
5201 if (num <= 0)
5202 {
5203 num = 1;
5204 }
5205 Msg.Say("panaltyMoney", this, Lang._currency(num));
5206 ModCurrency(-num);
5208 }
5209 foreach (Element value in EClass.pc.elements.dict.Values)
5210 {
5211 if (EClass.rnd(5) == 0 && value.IsMainAttribute)
5212 {
5213 EClass.pc.elements.ModExp(value.id, -500f);
5214 }
5215 }
5216 }
@ currency
ElementContainerCard elements
Definition: Card.cs:41
int GetCurrency(string id="money")
Definition: Card.cs:3972
void ModCurrency(int a, string id="money")
Definition: Card.cs:3958
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:1959

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

2019 {
2020 switch (tag)
2021 {
2022 case EditorTag.HostilityNeutral:
2023 {
2024 Hostility hostility2 = (base.c_originalHostility = Hostility.Neutral);
2025 this.hostility = hostility2;
2026 break;
2027 }
2028 case EditorTag.HostilityEnemy:
2029 {
2030 Hostility hostility2 = (base.c_originalHostility = Hostility.Enemy);
2031 this.hostility = hostility2;
2032 break;
2033 }
2034 case EditorTag.HostilityFriend:
2035 {
2036 Hostility hostility2 = (base.c_originalHostility = Hostility.Friend);
2037 this.hostility = hostility2;
2038 break;
2039 }
2040 case EditorTag.Male:
2041 bio.SetGender(2);
2042 base.c_idPortrait = Portrait.GetRandomPortrait(2, GetIdPortraitCat());
2043 break;
2044 case EditorTag.Female:
2045 bio.SetGender(1);
2046 base.c_idPortrait = Portrait.GetRandomPortrait(1, GetIdPortraitCat());
2047 break;
2048 case EditorTag.baby:
2049 SetFeat(1232);
2050 break;
2051 }
2052 base.ApplyEditorTags(tag);
2053 }
EditorTag
Definition: EditorTag.cs:2
void SetGender(int g)
Definition: Biography.cs:473
Biography bio
Definition: Card.cs:44
void SetFeat(int id, int value=1, bool msg=false)
Definition: Chara.cs:9797
string GetIdPortraitCat()
Definition: Chara.cs:8042
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 2145 of file Chara.cs.

2146 {
2147 elements.ApplyElementMap(base.uid, SourceValueType.Chara, job.elementMap, base.DefaultLV, remove, applyFeat: true);
2148 if (IsPCC)
2149 {
2150 EClass.game.uniforms.Apply(pccData, job.id, base.IsMale, canUseOtherGender: true);
2151 }
2152 }
SourceValueType
SourceJob.Row job
Definition: Chara.cs:466
void ApplyElementMap(int uid, SourceValueType type, Dictionary< int, int > map, int lv, bool invert=false, bool applyFeat=false)
PCCUniformManager uniforms
Definition: Game.cs:194

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

2232 {
2233 string[] array = race.figure.Split('|');
2234 foreach (string s in array)
2235 {
2236 int num = ParseBodySlot(s);
2237 if (num != -1)
2238 {
2239 if (remove)
2240 {
2241 body.RemoveBodyPart(num);
2242 }
2243 else
2244 {
2245 body.AddBodyPart(num);
2246 }
2247 }
2248 }
2250 elements.ApplyElementMap(base.uid, SourceValueType.Chara, race.elementMap, base.DefaultLV, remove, applyFeat: true);
2251 }
void RefreshBodyParts()
Definition: CharaBody.cs:287
void RemoveBodyPart(int ele)
Definition: CharaBody.cs:316
int ParseBodySlot(string s)
Definition: Chara.cs:2166

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

Referenced by ChangeRace(), and OnCreate().

◆ Banish()

void Chara.Banish ( Chara  owner)
inline

Definition at line 2322 of file Chara.cs.

2323 {
2324 owner?.Say("summon_vanish", this);
2325 pos.PlayEffect("vanish");
2326 pos.PlaySound("vanish");
2327 pos.PlayEffect("teleport");
2328 Destroy();
2329 }
void Destroy()
Definition: Card.cs:5067
SoundSource PlaySound(string id, bool synced=true, float v=1f, bool spatial=true)
Definition: Point.cs:1253
Effect PlayEffect(string id)
Definition: Point.cs:1248

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

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

◆ CalcBurden()

void Chara.CalcBurden ( )
inline

Definition at line 1819 of file Chara.cs.

1820 {
1821 int num = base.ChildrenWeight * 100 / Mathf.Max(1, WeightLimit);
1822 if (num < 0)
1823 {
1824 num = 1000;
1825 }
1827 {
1828 num = 0;
1829 }
1830 burden.Set(num);
1831 SetDirtySpeed();
1832 }
override int WeightLimit
Definition: Chara.cs:710
bool ignoreWeight
Definition: CoreDebug.cs:187
static CoreDebug debug
Definition: EClass.cs:49
Stats Set(int[] _raw, int _rawIndex, Chara _CC)
Definition: Stats.cs:109

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

Referenced by Scene.OnUpdate().

◆ CalcCastingChance()

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

Definition at line 6098 of file Chara.cs.

6099 {
6100 if (!(e is Spell))
6101 {
6102 return 100;
6103 }
6104 if (!IsPC)
6105 {
6106 int num2 = 95;
6107 if (host != null)
6108 {
6109 if (host.ride == this)
6110 {
6111 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.EvalueRiding()));
6112 }
6113 if (host.parasite == this)
6114 {
6115 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.Evalue(227)));
6116 }
6117 }
6118 return num2;
6119 }
6120 int num3 = Evalue(304);
6121 if (!IsPCFaction)
6122 {
6123 num3 = Mathf.Max(num3, base.LV + 5);
6124 }
6125 int num4 = 0;
6126 int num5 = 0;
6127 bool num6 = GetArmorSkill() == 122;
6128 AttackStyle attackStyle = body.GetAttackStyle();
6129 if (num6)
6130 {
6131 num4 = 20 - Evalue(122) / 5;
6132 num5 += 10 - Evalue(1654) * 4;
6133 }
6134 else
6135 {
6136 num4 = 10 - Evalue(120) / 5;
6137 }
6138 if (num4 < 5)
6139 {
6140 num4 = 5;
6141 }
6142 if (ride != null)
6143 {
6144 num4 += 5;
6145 }
6146 if (parasite != null)
6147 {
6148 num4 += 10;
6149 }
6150 if (attackStyle == AttackStyle.TwoWield)
6151 {
6152 num4 += 5;
6153 }
6154 if (attackStyle == AttackStyle.Shield)
6155 {
6156 num4 += 10;
6157 num5 += 20 - Evalue(1654) * 8;
6158 }
6159 if (isConfused)
6160 {
6161 num4 += 10000;
6162 }
6163 if (HasCondition<ConDim>())
6164 {
6165 num4 += ((Evalue(1654) >= 3) ? 1500 : 2500);
6166 }
6167 if (num > 1)
6168 {
6169 num4 += 5 * num;
6170 }
6171 if (num5 < 0)
6172 {
6173 num5 = 0;
6174 }
6175 return Mathf.Clamp(100 + e.Value - 10 - e.source.LV * e.source.cost[0] * num4 / Mathf.Max(10 + num3 * 10, 1), 0, 100 - num5);
6176 }
AttackStyle
Definition: AttackStyle.cs:2
AttackStyle GetAttackStyle()
Definition: CharaBody.cs:445
override int GetArmorSkill()
Definition: Chara.cs:7785
int EvalueRiding()
Definition: Chara.cs:6089
SourceElement.Row source
Definition: ELEMENT.cs:273
Definition: SPELL.cs:617

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

2000 {
2001 int num = base.END;
2002 int num2 = 0;
2003 foreach (Element value in elements.dict.Values)
2004 {
2005 if (value.source.category == "skill")
2006 {
2007 num = ((!IsPC) ? (num + Mathf.Max(value.ValueWithoutLink, 0)) : (num + Mathf.Max(value.vBase, 0)));
2008 }
2009 }
2010 num2 = EClass.curve(num, 30, 10, 60);
2011 if (num2 < 10)
2012 {
2013 num2 = 10;
2014 }
2015 _maxStamina = num2 + 15;
2016 }
int _maxStamina
Definition: Chara.cs:365
static int curve(int _a, int start, int step, int rate=75)
Definition: EClass.cs:69
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 6360 of file Chara.cs.

6361 {
6362 foreach (Chara chara in EClass._map.charas)
6363 {
6364 if (!chara.IsPCFaction && chara.OriginalHostility == OriginalHostility && (fanatic || Dist(chara) <= 6) && (EClass.rnd(3) != 0 || fanatic))
6365 {
6366 chara.GoHostile(tg);
6367 }
6368 }
6369 }
Hostility OriginalHostility
Definition: Chara.cs:471
void GoHostile(Card _tg)
Definition: Chara.cs:6254
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 8130 of file Chara.cs.

8131 {
8132 if (things.IsFull())
8133 {
8134 return false;
8135 }
8136 if (t.c_isImportant)
8137 {
8138 return false;
8139 }
8140 if (t.id == "1084")
8141 {
8142 return true;
8143 }
8144 if (t.trait is TraitBookExp)
8145 {
8146 return true;
8147 }
8148 if (t.trait.CanOnlyCarry || !t.trait.CanBeDestroyed || t.trait.CanExtendBuild || t.rarity == Rarity.Artifact || t.IsContainer)
8149 {
8150 return false;
8151 }
8152 return true;
8153 }
Rarity
Definition: Rarity.cs:2
string id
Definition: Card.cs:35
Rarity rarity
Definition: Card.cs:314
bool c_isImportant
Definition: Card.cs:1024
ThingContainer things
Definition: Card.cs:38
bool IsContainer
Definition: Card.cs:2089
bool IsFull(int y=0)
virtual bool CanExtendBuild
Definition: Trait.cs:170
virtual bool CanBeDestroyed
Definition: Trait.cs:296
virtual bool CanOnlyCarry
Definition: Trait.cs:294

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

8110 {
8112 {
8113 return true;
8114 }
8115 if (!IsValidGiftWeight(t, num))
8116 {
8117 return false;
8118 }
8119 if (t.c_isImportant)
8120 {
8121 return false;
8122 }
8123 if ((t.category.IsChildOf("furniture") || t.category.IsChildOf("junk")) && !HasElement(1411))
8124 {
8125 return false;
8126 }
8127 return true;
8128 }
SourceCategory.Row category
Definition: Card.cs:2049
bool IsValidGiftWeight(Card t, int num=-1)
Definition: Chara.cs:8099

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

4222 {
4223 return true;
4224 }

◆ CanBeTempAlly()

bool Chara.CanBeTempAlly ( Chara  c)
inline

Definition at line 2309 of file Chara.cs.

2310 {
2311 if (IsPCFaction || IsGlobal || IsMinion || IsMultisize || EClass._zone.CountMinions(c) > c.MaxSummon || base.rarity >= Rarity.Legendary)
2312 {
2313 return false;
2314 }
2315 if (HasElement(1222))
2316 {
2317 return false;
2318 }
2319 return true;
2320 }
override bool IsMinion
Definition: Chara.cs:627
int MaxSummon
Definition: Chara.cs:714
override bool IsMultisize
Definition: Chara.cs:706
int CountMinions(Chara c)
Definition: Zone.cs:3697

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

Referenced by GoalCombat.Run().

◆ CanBloom()

bool Chara.CanBloom ( )
inline

Definition at line 8562 of file Chara.cs.

8563 {
8564 if (IsPC || base.isScaled || HasElement(1273))
8565 {
8566 return false;
8567 }
8568 if (!EClass.debug.godMode)
8569 {
8570 if (base.c_daysWithPC > 360)
8571 {
8572 return affinity.CanSleepBeside();
8573 }
8574 return false;
8575 }
8576 return true;
8577 }
bool CanSleepBeside()
Definition: Affinity.cs:77
Affinity affinity
Definition: Chara.cs:314
bool godMode
Definition: CoreDebug.cs:173

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

Referenced by WindowCharaMini.Refresh().

◆ CanDestroyPath()

bool Chara.CanDestroyPath ( )
inline

Definition at line 2402 of file Chara.cs.

2403 {
2404 if (!IsMultisize)
2405 {
2406 if (base.rarity >= Rarity.Superior && !base.IsPCFactionOrMinion && ai is GoalCombat && !EClass._zone.IsPCFaction)
2407 {
2408 return !(EClass._zone is Zone_Town);
2409 }
2410 return false;
2411 }
2412 return true;
2413 }

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

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

◆ CanDuplicate()

bool Chara.CanDuplicate ( )
inline

Definition at line 1758 of file Chara.cs.

1759 {
1760 if (EClass._zone.IsRegion || HasCondition<ConPoison>() || HasCondition<ConConfuse>() || HasCondition<ConDim>() || HasCondition<ConParalyze>() || HasCondition<ConSleep>() || HasCondition<ConBurning>() || HasCondition<ConFreeze>() || HasCondition<ConMiasma>() || corruption >= 100)
1761 {
1762 return false;
1763 }
1765 {
1766 return false;
1767 }
1768 if (id == "mech_scarab" && (isSynced || pos.cell.light > 0 || (!EClass._map.IsIndoor && !pos.cell.HasRoof && !EClass.world.date.IsNight)))
1769 {
1770 return false;
1771 }
1772 return true;
1773 }
byte light
Definition: Cell.cs:60
bool HasRoof
Definition: Cell.cs:648
int corruption
Definition: Chara.cs:377
int CurrentGeneSlot
Definition: Chara.cs:1071
bool IsNight
Definition: Date.cs:112
GamePrincipal principal
Definition: Game.cs:224
bool IsIndoor
Definition: Map.cs:131

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

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

◆ CanEat()

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

Definition at line 7516 of file Chara.cs.

7517 {
7518 if (t.IsDecayed && !HasElement(480))
7519 {
7520 return false;
7521 }
7522 if (shouldEat && (!(t.trait is TraitFoodPrepared) || t.c_isImportant))
7523 {
7524 return false;
7525 }
7526 if (!t.IsNegativeGift && !t.HasTag(CTAG.ignoreUse) && !t.isEquipped)
7527 {
7528 return t.trait.CanEat(this);
7529 }
7530 return false;
7531 }
CTAG
Definition: CTAG.cs:2
bool IsNegativeGift
Definition: Card.cs:2396
bool IsDecayed
Definition: Card.cs:2287
bool HasTag(CTAG tag)
Definition: Card.cs:2595
bool isEquipped
Definition: Thing.cs:17
virtual bool CanEat(Chara c)
Definition: Trait.cs:979

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

7685 {
7686 return !body.IsTooHeavyToEquip(t);
7687 }
bool IsTooHeavyToEquip(Thing thing)
Definition: CharaBody.cs:156

References CharaBody.IsTooHeavyToEquip().

Referenced by GoalAutoCombat.TryUseRanged().

◆ CanInsult()

bool Chara.CanInsult ( )
inline

Definition at line 8030 of file Chara.cs.

8031 {
8032 foreach (ActList.Item item in ability.list.items)
8033 {
8034 if (item.act.id == 6630)
8035 {
8036 return true;
8037 }
8038 }
8039 return false;
8040 }
List< Item > items
Definition: ActList.cs:14
ActList list
Definition: CharaAbility.cs:12
CharaAbility ability
Definition: Chara.cs:424

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

◆ CanInteractTo() [1/2]

bool Chara.CanInteractTo ( Card  c)
inline

Definition at line 2509 of file Chara.cs.

2510 {
2511 return CanInteractTo(c.pos);
2512 }
bool CanInteractTo(Card c)
Definition: Chara.cs:2509

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

2515 {
2516 if (!p.IsValid)
2517 {
2518 return false;
2519 }
2520 if (EClass._map.cells[p.x, p.z].blocked)
2521 {
2522 return true;
2523 }
2524 if (!IsMultisize)
2525 {
2526 int num = ((p.z >= pos.z) ? ((p.x > pos.x) ? 1 : ((p.z > pos.z) ? 2 : 3)) : 0);
2527 if (EClass._map.cells[pos.x, pos.z].weights[num] == 0)
2528 {
2529 return false;
2530 }
2531 if (p.x != pos.x && p.z != pos.z)
2532 {
2533 Cell[,] cells = EClass._map.cells;
2534 int x = p.x;
2535 int z = pos.z;
2536 int num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2537 if (cells[pos.x, pos.z].weights[num2] == 0)
2538 {
2539 return false;
2540 }
2541 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2542 if (cells[p.x, p.z].weights[num2] == 0)
2543 {
2544 return false;
2545 }
2546 x = pos.x;
2547 z = p.z;
2548 num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2549 if (cells[pos.x, pos.z].weights[num2] == 0)
2550 {
2551 return false;
2552 }
2553 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2554 if (cells[p.x, p.z].weights[num2] == 0)
2555 {
2556 return false;
2557 }
2558 }
2559 }
2560 return true;
2561 }
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 4216 of file Chara.cs.

4217 {
4218 return true;
4219 }

◆ CanMoveTo()

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

Definition at line 2415 of file Chara.cs.

2416 {
2417 if (!p.IsValid)
2418 {
2419 return false;
2420 }
2421 int num = ((p.z >= pos.z) ? ((p.x > pos.x) ? 1 : ((p.z > pos.z) ? 2 : 3)) : 0);
2422 if (allowDestroyPath && CanDestroyPath())
2423 {
2424 if (!p.IsInBounds)
2425 {
2426 return false;
2427 }
2428 }
2429 else
2430 {
2431 if (EClass._map.cells[p.x, p.z].blocked || EClass._map.cells[pos.x, pos.z].weights[num] == 0)
2432 {
2433 return false;
2434 }
2435 if (p.x != pos.x && p.z != pos.z)
2436 {
2437 Cell[,] cells = EClass._map.cells;
2438 int x = p.x;
2439 int z = pos.z;
2440 int num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2441 if (cells[pos.x, pos.z].weights[num2] == 0)
2442 {
2443 return false;
2444 }
2445 if (cells[x, z].blocked)
2446 {
2447 return false;
2448 }
2449 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2450 if (cells[p.x, p.z].weights[num2] == 0)
2451 {
2452 return false;
2453 }
2454 x = pos.x;
2455 z = p.z;
2456 num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2457 if (cells[pos.x, pos.z].weights[num2] == 0)
2458 {
2459 return false;
2460 }
2461 if (cells[x, z].blocked)
2462 {
2463 return false;
2464 }
2465 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2466 if (cells[p.x, p.z].weights[num2] == 0)
2467 {
2468 return false;
2469 }
2470 }
2471 }
2472 if (IsPC)
2473 {
2474 if (IsEnemyOnPath(p))
2475 {
2476 return false;
2477 }
2478 }
2479 else if (p.HasChara && !IsMultisize && !CanReplace(p.FirstChara))
2480 {
2481 return false;
2482 }
2483 return true;
2484 }
bool IsEnemyOnPath(Point p, bool cancelAI=true)
Definition: Chara.cs:2486
Chara FirstChara
Definition: Point.cs:288
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 4226 of file Chara.cs.

4227 {
4228 if (c.isDestroyed)
4229 {
4230 return false;
4231 }
4232 Card rootCard = c.GetRootCard();
4233 if (rootCard.isDestroyed || (rootCard.ExistsOnMap && rootCard.pos.Distance(pos) > 1))
4234 {
4235 return false;
4236 }
4237 if (rootCard != this && things.IsFull(c.Thing))
4238 {
4239 return false;
4240 }
4241 return true;
4242 }
bool isDestroyed
Definition: Card.cs:75
bool ExistsOnMap
Definition: Card.cs:2085
virtual Thing Thing
Definition: Card.cs:2058
Card GetRootCard()
Definition: Card.cs:3423

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

3275 {
3277 {
3278 return false;
3279 }
3280 if (IsPC)
3281 {
3282 return true;
3283 }
3284 if (c.IsPC || c.pos.Equals(EClass.pc.pos) || c.host != null)
3285 {
3286 return false;
3287 }
3288 if (!IsHostile(c))
3289 {
3290 if (c.c_uidMaster != 0 || c.isSummon || base.IsPowerful || IsEscorted())
3291 {
3292 return true;
3293 }
3294 if (DestDist < c.DestDist)
3295 {
3296 return true;
3297 }
3298 if (IsPCParty && !c.IsPCParty)
3299 {
3300 return true;
3301 }
3302 if (IsPCFaction && !c.IsPCParty)
3303 {
3304 return true;
3305 }
3306 }
3307 return false;
3308 }
bool IsPCFactionOrMinion
Definition: Card.cs:2272
bool isSummon
Definition: Card.cs:710
int c_uidMaster
Definition: Card.cs:1449
bool noMove
Definition: Card.cs:770
new TraitChara trait
Definition: Chara.cs:503
override bool IsPCParty
Definition: Chara.cs:615
int DestDist
Definition: Chara.cs:998
bool IsHostile()
Definition: Chara.cs:6455
bool IsEscorted()
Definition: Chara.cs:2386
bool Equals(int _x, int _z)
Definition: Point.cs:960
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 5059 of file Chara.cs.

5060 {
5061 return EClass.world.date.IsExpired(base.c_dateDeathLock);
5062 }
bool IsExpired(int time)
Definition: Date.cs:336

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

1219 {
1220 if (c == this)
1221 {
1222 return true;
1223 }
1224 if (!c.pos.IsValid)
1225 {
1226 return false;
1227 }
1228 if (c.isChara)
1229 {
1231 {
1232 return true;
1233 }
1234 if (c.isHidden && c != this && !canSeeInvisible)
1235 {
1236 return false;
1237 }
1238 }
1239 if (IsPC)
1240 {
1241 if (fov != null)
1242 {
1243 return fov.lastPoints.ContainsKey(c.pos.index);
1244 }
1245 return false;
1246 }
1247 return true;
1248 }
virtual Chara Chara
Definition: Card.cs:2070
Fov fov
Definition: Card.cs:57
virtual bool isChara
Definition: Card.cs:2083
bool isHidden
Definition: Card.cs:530
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(), AI_Mofu.GetMofu(), Msg.GetName(), Player.HasValidRangedTarget(), ActMelee.HideHint(), Point.ListVisibleCards(), Point.ListVisibleCharas(), TCExtra.OnDraw(), AM_Adv.OnRenderTile(), TCOrbitChara.Refresh(), TCOrbitThing.Refresh(), AI_Idle.Run(), AI_Steal.Run(), GoalCombat.Run(), ThirstPersonInfo.Set(), Player.TargetRanged(), HotItemAct.TrySetAct(), TraitCatalyst.TrySetHeldAct(), TraitLeash.TrySetHeldAct(), TraitStethoscope.TrySetHeldAct(), TraitWhipEgg.TrySetHeldAct(), and TraitWhipLove.TrySetHeldAct().

◆ CanSeeLos() [1/2]

◆ CanSeeLos() [2/2]

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

Definition at line 1259 of file Chara.cs.

1260 {
1261 if (dist == -1)
1262 {
1263 dist = pos.Distance(p);
1264 }
1265 if (dist > GetSightRadius())
1266 {
1267 return false;
1268 }
1269 if (IsPC)
1270 {
1271 if (fov != null)
1272 {
1273 return fov.lastPoints.ContainsKey(p.index);
1274 }
1275 return false;
1276 }
1277 return Los.IsVisible(pos, p);
1278 }
int GetSightRadius()
Definition: Card.cs:6379
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 1201 of file Chara.cs.

1202 {
1203 if (!p.IsValid || p.IsHidden)
1204 {
1205 return false;
1206 }
1207 if (IsPC)
1208 {
1209 if (fov != null)
1210 {
1211 return fov.lastPoints.ContainsKey(p.index);
1212 }
1213 return false;
1214 }
1215 return true;
1216 }
bool IsHidden
Definition: Point.cs:347

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

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

◆ CanSleep()

bool Chara.CanSleep ( )
inline

Definition at line 1299 of file Chara.cs.

1300 {
1301 if (EClass._zone.events.GetEvent<ZoneEventQuest>() != null)
1302 {
1303 return false;
1304 }
1305 if (!EClass.debug.godMode && sleepiness.GetPhase() == 0)
1306 {
1307 return stamina.GetPhase() <= 1;
1308 }
1309 return true;
1310 }
Stats sleepiness
Definition: Chara.cs:1156
Stats stamina
Definition: Chara.cs:1146
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 2154 of file Chara.cs.

2155 {
2156 ApplyJob(remove: true);
2157 base.c_idJob = idNew;
2158 _job = null;
2159 ApplyJob();
2160 if (IsPCC)
2161 {
2162 PCC.Get(pccData).Build();
2163 }
2164 }
void ApplyJob(bool remove=false)
Definition: Chara.cs:2145
SourceJob.Row _job
Definition: Chara.cs:162

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

6957 {
6958 memberType = type;
6959 }
FactionMemberType memberType
Definition: Chara.cs:46

◆ ChangeRace()

void Chara.ChangeRace ( string  idNew)
inline

Definition at line 2253 of file Chara.cs.

2254 {
2255 ApplyRace(remove: true);
2256 base.c_idRace = idNew;
2257 _race = null;
2258 ApplyRace();
2259 ChangeMaterial(source.defMat.IsEmpty(race.material));
2260 }
@ ChangeMaterial
void ApplyRace(bool remove=false)
Definition: Chara.cs:2231
SourceRace.Row _race
Definition: Chara.cs:160

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

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

◆ ChangeRarity()

override void Chara.ChangeRarity ( Rarity  r)
inlinevirtual

Reimplemented from Card.

Definition at line 1406 of file Chara.cs.

1407 {
1408 if (r != base.rarity)
1409 {
1410 base.rarity = r;
1411 if (renderer != null && renderer.isSynced)
1412 {
1414 }
1415 base.hp = MaxHP;
1416 }
1417 }
void RefreshExtra()

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

Referenced by ZonePreEnterBout.Execute().

◆ ChooseNewGoal()

void Chara.ChooseNewGoal ( )
inline

Definition at line 8669 of file Chara.cs.

8670 {
8671 if (IsPC && EClass.AdvMode)
8672 {
8673 SetNoGoal();
8674 return;
8675 }
8676 if (IsPCParty || base.noMove)
8677 {
8678 SetAI(new GoalIdle());
8679 return;
8680 }
8681 if ((IsHomeMember() && IsInHomeZone()) || IsGuest())
8682 {
8683 Goal goalFromTimeTable = GetGoalFromTimeTable(EClass.world.date.hour);
8684 if (goalFromTimeTable != null)
8685 {
8686 SetAI(goalFromTimeTable);
8687 if (goalFromTimeTable is GoalWork)
8688 {
8689 goalFromTimeTable.Tick();
8690 }
8691 return;
8692 }
8693 }
8694 if (goalList.index == -2)
8695 {
8697 }
8698 SetAI(goalList.Next());
8699 }
Status Tick()
Definition: AIAct.cs:352
Goal GetGoalFromTimeTable(int hour)
Definition: Chara.cs:8701
GoalListType goalListType
Definition: Chara.cs:279
AIAct SetNoGoal()
Definition: Chara.cs:8793
bool IsHomeMember()
Definition: Chara.cs:6517
bool IsGuest()
Definition: Chara.cs:6542
GoalList goalList
Definition: Chara.cs:200
bool IsInHomeZone()
Definition: Chara.cs:6522
int hour
Definition: Date.cs:74
static bool AdvMode
Definition: EClass.cs:11
int index
Definition: GoalList.cs:5
void Refresh(Chara owner, GoalListType type)
Definition: GoalList.cs:9
Goal Next()
Definition: GoalList.cs:39
Definition: Goal.cs:4

References EClass.AdvMode, World.date, Date.hour, GoalList.index, GoalList.Next(), GoalList.Refresh(), AIAct.Tick(), and EClass.world.

Referenced by Zone.Simulate().

◆ ClearBed()

void Chara.ClearBed ( Map  map = null)
inline

Definition at line 7224 of file Chara.cs.

7225 {
7226 if (map == null)
7227 {
7228 map = EClass._map;
7229 }
7230 foreach (Card item in map.props.installed.all)
7231 {
7232 if (item.trait is TraitBed traitBed && traitBed.IsHolder(this))
7233 {
7234 traitBed.RemoveHolder(this);
7235 }
7236 }
7237 }
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 8441 of file Chara.cs.

8442 {
8443 int num = 0;
8444 for (int num2 = things.Count - 1; num2 >= 0; num2--)
8445 {
8446 Thing thing = things[num2];
8447 if (ShouldThrowAway(thing, type))
8448 {
8449 num += thing.GetPrice(CurrencyType.Money, sell: true, PriceType.Default, this) * thing.Num;
8450 thing.Destroy();
8451 }
8452 }
8453 if (num > 0)
8454 {
8455 ModCurrency(num);
8456 if (type == ClearInventoryType.SellAtTown)
8457 {
8458 Msg.Say("party_sell", this, num.ToString() ?? "");
8459 PlaySound("pay");
8460 }
8461 }
8462 }
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:7233
int Num
Definition: Card.cs:158
bool ShouldThrowAway(Thing t, ClearInventoryType type)
Definition: Chara.cs:8370

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

10274 {
10275 if (tempElements != null)
10276 {
10278 tempElements = null;
10279 }
10280 }
ElementContainer tempElements
Definition: Chara.cs:36
void SetParent(Card c)

References ElementContainer.SetParent().

◆ CountDebuff()

int Chara.CountDebuff ( )
inline

Definition at line 9358 of file Chara.cs.

9359 {
9360 int num = 0;
9361 foreach (Condition condition in conditions)
9362 {
9363 if (condition.Type == ConditionType.Debuff)
9364 {
9365 num++;
9366 }
9367 }
9368 return num;
9369 }

References BaseStats.Type.

Referenced by GoalCombat.TryUseAbility().

◆ CountNumEaten()

int Chara.CountNumEaten ( Thing  food)
inline

Definition at line 10079 of file Chara.cs.

10080 {
10081 if (_historyFood == null)
10082 {
10083 return -1;
10084 }
10085 int num = 0;
10086 foreach (List<string> item in _historyFood)
10087 {
10088 foreach (string item2 in item)
10089 {
10090 if (item2 == food.id)
10091 {
10092 num++;
10093 }
10094 }
10095 }
10096 return num;
10097 }

References food, and item.

Referenced by FoodEffect.Proc().

◆ CreateReplacement()

Chara Chara.CreateReplacement ( )
inline

Definition at line 7933 of file Chara.cs.

7934 {
7935 Chara chara = CharaGen.Create(id);
7936 chara.c_originalHostility = base.c_originalHostility;
7937 if (chara.c_originalHostility != 0)
7938 {
7939 chara.hostility = chara.c_originalHostility;
7940 }
7941 if (orgPos != null)
7942 {
7943 chara.orgPos = orgPos.Copy();
7944 }
7945 chara.pos = pos.Copy();
7946 chara.isImported = true;
7947 chara.c_editorTags = base.c_editorTags;
7948 chara.c_editorTraitVal = base.c_editorTraitVal;
7949 chara.c_idTrait = base.c_idTrait;
7950 chara.homeZone = homeZone;
7951 return chara;
7952 }
Hostility c_originalHostility
Definition: Card.cs:976
static Chara Create(string id, int lv=-1)
Definition: CharaGen.cs:17
Zone homeZone
Definition: Chara.cs:267
Point Copy()
Definition: Point.cs:491

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

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

◆ Cuddle()

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

Definition at line 6190 of file Chara.cs.

6191 {
6192 Talk("goodBoy");
6193 Say(headpat ? "headpat" : "cuddle", this, c);
6194 c.ShowEmo(Emo.love);
6195 if (EClass.rnd(IsPC ? 100 : 5000) == 0)
6196 {
6197 c.MakeEgg();
6198 }
6199 if (headpat && this != c)
6200 {
6201 if (c.interest > 0)
6202 {
6203 c.ModAffinity(EClass.pc, 1 + EClass.rnd(3));
6204 c.interest -= 20 + EClass.rnd(10);
6205 }
6207 {
6208 foreach (Chara member in party.members)
6209 {
6210 if (!member.IsPC && CanSeeLos(member))
6211 {
6212 member.AddCondition<ConEuphoric>(100 + Evalue(6904) * 5);
6213 }
6214 }
6215 }
6216 }
6217 if (c.Evalue(1221) > 0)
6218 {
6219 int ele = ((c.MainElement == Element.Void) ? 924 : c.MainElement.id);
6220 if (c.id == "hedgehog_ether")
6221 {
6222 ele = 922;
6223 }
6224 Say("reflect_thorne", c, this);
6225 DamageHP(10L, ele, Power, AttackSource.Condition);
6226 }
6227 }
Emo
Definition: Emo.cs:2
virtual int Power
Definition: Card.cs:2295
void ShowEmo(Emo _emo=Emo.none, float duration=0f, bool skipSame=true)
Definition: Card.cs:6097
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
Definition: Card.cs:5720
Element MainElement
Definition: Chara.cs:717
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Definition: Chara.cs:7855
int interest
Definition: Chara.cs:317
Religion faith
Definition: Chara.cs:439
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(), ActEffect.Proc(), AI_Idle.Run(), and AI_Mofu.Run().

◆ Cure()

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

Definition at line 9421 of file Chara.cs.

9422 {
9423 bool flag = state == BlessedState.Blessed;
9424 switch (type)
9425 {
9426 case CureType.Heal:
9427 case CureType.Prayer:
9428 CureCondition<ConFear>();
9429 CureCondition<ConBlind>(2 * p / 100 + 5);
9430 CureCondition<ConPoison>(5 * p / 100 + 5);
9431 CureCondition<ConConfuse>(10 * p / 100 + 10);
9432 CureCondition<ConDim>(p / 100 + 5);
9433 CureCondition<ConBleed>(2 * p / 100 + 10);
9434 if (flag)
9435 {
9436 SAN.Mod(-15);
9437 }
9438 break;
9439 case CureType.CureBody:
9440 CureCondition<ConBlind>(5 * p / 100 + 15);
9441 CureCondition<ConPoison>(10 * p / 100 + 15);
9442 CureCondition<ConBleed>(5 * p / 100 + 20);
9443 CureTempElements(p, body: true, mind: false);
9444 break;
9445 case CureType.CureMind:
9446 CureCondition<ConFear>();
9447 CureCondition<ConDim>(3 * p / 100 + 10);
9448 CureTempElements(p, body: false, mind: true);
9449 break;
9450 case CureType.Sleep:
9451 {
9452 for (int num2 = conditions.Count - 1; num2 >= 0; num2--)
9453 {
9454 Condition condition2 = conditions[num2];
9455 if (!(condition2 is ConSleep) && !(condition2 is ConFaint))
9456 {
9457 if (condition2.isPerfume)
9458 {
9459 condition2.Mod(-1, force: true);
9460 }
9461 else if (condition2.Type == ConditionType.Bad || condition2.Type == ConditionType.Debuff)
9462 {
9463 condition2.Kill();
9464 }
9465 }
9466 }
9467 CureCondition<ConWait>();
9468 CureCondition<ConDisease>((EClass.rnd(20) + 10) * p / 100);
9469 bool flag3 = HasCondition<ConAnorexia>();
9470 base.c_vomit -= (flag3 ? 3 : 2) * p / 100;
9471 if (base.c_vomit < 0)
9472 {
9473 base.c_vomit = 0;
9474 if (flag3)
9475 {
9476 RemoveCondition<ConAnorexia>();
9477 }
9478 }
9479 break;
9480 }
9481 case CureType.HealComplete:
9482 case CureType.Death:
9483 case CureType.Jure:
9484 case CureType.Boss:
9485 {
9486 bool flag2 = type == CureType.Death;
9487 CureTempElements(p * 100, body: true, mind: true);
9488 for (int num = conditions.Count - 1; num >= 0; num--)
9489 {
9490 Condition condition = conditions[num];
9491 if (condition is ConAnorexia && !flag2)
9492 {
9493 continue;
9494 }
9495 switch (condition.Type)
9496 {
9497 case ConditionType.Bad:
9498 case ConditionType.Debuff:
9499 case ConditionType.Disease:
9500 condition.Kill();
9501 continue;
9502 case ConditionType.Stance:
9503 if (flag2)
9504 {
9505 condition.Kill();
9506 continue;
9507 }
9508 break;
9509 }
9510 if (flag2 && condition.isPerfume)
9511 {
9512 condition.Kill();
9513 }
9514 }
9515 CureCondition<ConWait>();
9516 CureCondition<ConSleep>();
9517 if (flag2 || type == CureType.Boss)
9518 {
9519 SAN.Mod(-20);
9520 RemoveCondition<ConBrightnessOfLife>();
9521 }
9522 if (type == CureType.Jure)
9523 {
9524 SAN.Mod(-999);
9525 if (HasElement(1206))
9526 {
9527 SetFeat(1206, 0, msg: true);
9528 }
9529 }
9530 break;
9531 }
9532 }
9533 }
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:10243
Stats SAN
Definition: Chara.cs:1158
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 9371 of file Chara.cs.

9371 : Condition
9372 {
9373 T condition = GetCondition<T>();
9374 if (condition != null)
9375 {
9376 condition.value -= v;
9377 if (condition.value <= 0)
9378 {
9379 condition.Kill();
9380 }
9381 }
9382 }
T GetCondition< T >()
Definition: Chara.cs:9384

◆ CureHost()

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

Definition at line 9408 of file Chara.cs.

9409 {
9410 if (parasite != null)
9411 {
9412 parasite.Cure(type, p, state);
9413 }
9414 if (ride != null)
9415 {
9416 ride.Cure(type, p, state);
9417 }
9418 Cure(type, p, state);
9419 }
void Cure(CureType type, int p=100, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:9421

References Cure().

Referenced by FactionBranch.DailyOutcome().

◆ CureTempElements()

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

Definition at line 10243 of file Chara.cs.

10244 {
10245 if (tempElements != null)
10246 {
10247 if (body)
10248 {
10250 }
10251 if (mind)
10252 {
10254 }
10255 }
10256 void Cure(int[] eles)
10257 {
10258 foreach (int ele in eles)
10259 {
10260 if (tempElements == null)
10261 {
10262 break;
10263 }
10264 Element element = tempElements.GetElement(ele);
10265 if (element != null && element.vBase < 0)
10266 {
10267 ModTempElement(ele, Mathf.Clamp(p / 20 + EClass.rnd(p / 20), 1, -element.vBase));
10268 }
10269 }
10270 }
10271 }
void ModTempElement(int ele, int a, bool naturalDecay=false, bool onlyRenew=false)
Definition: Chara.cs:10151
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 10209 of file Chara.cs.

10210 {
10211 ModTempElement(ele, onlyRenew ? (-p / 20) : (-(p / 100 + EClass.rnd(p / 100 + 1) + 1)), naturalDecay: false, onlyRenew);
10212 }

References EClass.rnd().

◆ DamageTempElements()

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

Definition at line 10197 of file Chara.cs.

10198 {
10199 if (body)
10200 {
10201 DamageTempElement(Element.List_Body.RandomItem(), p, onlyRenew);
10202 }
10203 if (mind)
10204 {
10205 DamageTempElement(Element.List_Mind.RandomItem(), p, onlyRenew);
10206 }
10207 }
void DamageTempElement(int ele, int p, bool onlyRenew=false)
Definition: Chara.cs:10209

References Element.List_Body, and Element.List_Mind.

◆ DestroyPath()

void Chara.DestroyPath ( Point  pos)
inline

Definition at line 3163 of file Chara.cs.

3164 {
3165 bool broke = false;
3166 pos.ForeachMultiSize(base.W, base.H, delegate(Point _p, bool main)
3167 {
3168 if (_p.IsValid)
3169 {
3170 if (_p.HasBlock)
3171 {
3172 EClass._map.MineBlock(_p, recoverBlock: false, this);
3173 if (_p.HasObj)
3174 {
3175 EClass._map.MineObj(_p, null, this);
3176 }
3177 broke = true;
3178 }
3179 if (_p.HasObj && _p.IsBlocked)
3180 {
3181 EClass._map.MineObj(_p, null, this);
3182 broke = true;
3183 }
3184 _p.Things.ForeachReverse(delegate(Thing t)
3185 {
3186 if (t.IsInstalled && (t.trait.IsBlockPath || t.trait.IsDoor))
3187 {
3188 if (t.isNPCProperty && t.trait.CanBeDestroyed)
3189 {
3190 t.Destroy();
3191 }
3192 else if (!t.IsUnique && !t.trait.CanBeDestroyed)
3193 {
3194 t.SetPlaceState(PlaceState.roaming);
3195 }
3196 }
3197 });
3198 }
3199 });
3200 if (broke)
3201 {
3202 Msg.Say("stomp");
3203 Shaker.ShakeCam("stomp");
3204 }
3205 }
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
bool IsUnique
Definition: Card.cs:2091
void ForeachMultiSize(int w, int h, Action< Point, bool > action)
Definition: Point.cs:1385
bool IsBlocked
Definition: Point.cs:363
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 5254 of file Chara.cs.

5255 {
5256 combatCount = 0;
5257 if (isDead || host != null)
5258 {
5259 return;
5260 }
5261 bool isInActiveZone = IsInActiveZone;
5262 if (isInActiveZone)
5263 {
5264 if (IsPC)
5265 {
5267 }
5268 if (base.isSummon)
5269 {
5270 if (id == "tsunami")
5271 {
5272 pos.PlaySound("water");
5273 }
5274 else
5275 {
5276 Say("summon_vanish", this);
5277 pos.PlayEffect("vanish");
5278 pos.PlaySound("vanish");
5279 }
5280 Destroy();
5281 return;
5282 }
5283 if (attackSource == AttackSource.DeathSentense)
5284 {
5285 if (trait is TraitLittleOne)
5286 {
5287 MakeEgg();
5288 if (IsPCFaction)
5289 {
5291 }
5292 }
5293 PlayEffect("revive");
5294 PlaySound("chime_angel");
5295 }
5296 else
5297 {
5298 Effect.Get("blood").Play((parent is Chara) ? (parent as Chara).pos : pos).SetParticleColor(EClass.Colors.matColors[base.material.alias].main)
5299 .Emit(50);
5300 AddBlood(AI_Slaughter.slaughtering ? 12 : (2 + EClass.rnd(2)));
5301 PlaySound(base.material.GetSoundDead(source));
5302 }
5305 ClearFOV();
5306 }
5307 string text = "";
5308 "dead_in".langGame(EClass._zone.Name);
5309 string text2 = ((origin == null) ? "" : origin.GetName(NameStyle.Full));
5310 if (LangGame.Has("dead_" + attackSource))
5311 {
5312 text = "dead_" + attackSource;
5313 }
5314 else
5315 {
5316 if (e != Element.Void && e != null)
5317 {
5318 text = "dead_" + e.source.alias;
5319 }
5320 if (text == "" || !LangGame.Has(text))
5321 {
5322 text = "dead";
5323 }
5324 }
5325 if (IsPC)
5326 {
5327 EClass._zone.isDeathLocation = true;
5328 string s = ((origin == null) ? text : "dead_by");
5330 if (attackSource == AttackSource.Wrath)
5331 {
5333 }
5334 EClass.player.deathMsg = GameLang.Parse(s.langGame(), thirdPerson: true, EClass.pc.NameBraced, "dead_in".langGame(EClass._zone.Name), text2);
5336 if (EClass._zone.instance is ZoneInstanceRandomQuest zoneInstanceRandomQuest)
5337 {
5338 zoneInstanceRandomQuest.status = ZoneInstance.Status.Fail;
5339 }
5340 AI_PlayMusic.keepPlaying = false;
5341 }
5342 if (isInActiveZone)
5343 {
5344 if (attackSource == AttackSource.DeathSentense)
5345 {
5346 Msg.Say("goto_heaven", this);
5347 }
5348 else
5349 {
5350 if (originalTarget != null || origin == null || !origin.isSynced || (attackSource != AttackSource.Melee && attackSource != AttackSource.Range))
5351 {
5352 Msg.Say(text, this, "", text2);
5353 }
5354 string text3 = TalkTopic("dead");
5355 if (!text3.IsEmpty())
5356 {
5357 text3 = text3.StripBrackets();
5358 }
5359 bool flag = base.rarity >= Rarity.Legendary && !IsPCFaction;
5360 if (!IsPC && flag)
5361 {
5362 MakeGrave(text3);
5363 }
5364 Msg.SetColor();
5365 SpawnLoot(origin);
5366 }
5367 if (IsPC)
5368 {
5370 }
5371 }
5372 if (IsPCFaction)
5373 {
5374 if (homeBranch != null)
5375 {
5376 homeBranch.Log(text, this, "");
5377 }
5378 WidgetPopText.Say("popDead".lang(base.Name), FontColor.Bad);
5379 if (!IsPC)
5380 {
5381 if (EClass.player.stats.allyDeath == 0)
5382 {
5383 Tutorial.Reserve("death_pet");
5384 }
5386 }
5387 }
5388 if (id == "mandrake" || HasElement(488))
5389 {
5390 Say("a_scream", this);
5391 ActEffect.ProcAt(EffectId.Scream, base.LV * 3 + 200, BlessedState.Normal, this, this, pos, isNeg: true);
5392 }
5393 daysStarved = 0;
5394 isDead = true;
5396 enemy = null;
5397 _cooldowns = null;
5398 base.isSale = false;
5399 SetInt(70);
5400 EClass._map.props.sales.Remove(this);
5401 Cure(CureType.Death);
5402 SetAI(new NoGoal());
5404 if (isInActiveZone && EClass._zone.HasLaw && IsHuman && OriginalHostility >= Hostility.Neutral)
5405 {
5406 pos.TalkWitnesses(origin?.Chara, "witness", 3, WitnessType.crime, (Chara c) => !c.IsPCParty && !c.IsUnique);
5407 }
5408 if (IsPC)
5409 {
5410 EClass.player.returnInfo = null;
5411 EClass.player.uidLastTravelZone = 0;
5412 foreach (Chara chara3 in EClass._map.charas)
5413 {
5414 if (chara3.IsHostile())
5415 {
5416 chara3.hostility = chara3.OriginalHostility;
5417 }
5418 if (chara3.enemy == EClass.pc)
5419 {
5420 chara3.enemy = null;
5421 }
5422 }
5423 if (EClass.pc.things.Find("letter_will") != null && EClass.rnd(10) == 0)
5424 {
5425 EClass.player.preventDeathPenalty = true;
5426 }
5427 }
5428 else
5429 {
5430 bool flag2 = currentZone.IsActiveZone && IsLocalChara && !currentZone.IsPCFaction;
5431 if (currentZone is Zone_LittleGarden && id == "littleOne")
5432 {
5433 flag2 = false;
5434 }
5435 if (flag2)
5436 {
5437 EClass._map.deadCharas.Add(this);
5438 }
5439 currentZone.RemoveCard(this);
5440 }
5441 if ((origin != null && origin.IsPCParty) || IsPCFaction)
5442 {
5443 int a = -10;
5444 if (IsPCFaction && !IsPCParty && (origin == null || !origin.IsPCParty))
5445 {
5446 a = -5;
5447 }
5448 ModAffinity(EClass.pc, a, show: false);
5449 string text4 = id;
5450 if (!(text4 == "quru"))
5451 {
5452 if (text4 == "corgon")
5453 {
5454 EClass.game.cards.globalCharas.Find("quru")?.ModAffinity(EClass.pc, -20, show: false);
5455 }
5456 }
5457 else
5458 {
5459 EClass.game.cards.globalCharas.Find("corgon")?.ModAffinity(EClass.pc, -20, show: false);
5460 }
5461 }
5462 if (origin != null)
5463 {
5464 if (origin.IsPCParty || origin.IsPCPartyMinion)
5465 {
5466 int num = 0;
5467 if (OriginalHostility >= Hostility.Friend && IsHuman && !base.IsPCFactionOrMinion)
5468 {
5469 num = -5;
5470 }
5471 else if (race.id == "cat" && OriginalHostility >= Hostility.Neutral)
5472 {
5473 EClass.pc.Say("killcat");
5474 num = -1;
5475 }
5476 if (EClass.pc.party.HasElement(1563) && num < 0)
5477 {
5478 num = num * 30 / 100;
5479 }
5480 if (num != 0)
5481 {
5482 EClass.player.ModKarma(num);
5483 }
5484 }
5485 if (origin == EClass.pc)
5486 {
5487 EClass.pc.faith.Revelation("kill", 10);
5488 }
5489 else if (origin.IsPCFaction)
5490 {
5491 origin.Chara.ModAffinity(EClass.pc, 1, show: false);
5492 origin.Chara.ShowEmo(Emo.love);
5493 }
5494 }
5495 if (base.sourceBacker != null && origin != null && origin.IsPCParty)
5496 {
5497 EClass.player.doneBackers.Add(base.sourceBacker.id);
5498 }
5499 if (base.IsPCFactionOrMinion)
5500 {
5502 {
5503 Msg.Say("abort_allyDead");
5504 }
5505 }
5507 {
5508 Msg.Say("abort_enemyDead");
5509 }
5510 if (IsPCParty && !IsPC)
5511 {
5513 base.c_wasInPcParty = true;
5514 EClass.pc.Say("allyDead");
5515 }
5516 switch (id)
5517 {
5518 case "littleOne":
5519 if (attackSource != AttackSource.DeathSentense && !IsPCFaction)
5520 {
5521 EClass.player.flags.little_killed = true;
5523 }
5524 break;
5525 case "big_daddy":
5526 if (!IsPCFaction)
5527 {
5528 Chara chara = CharaGen.Create("littleOne");
5529 EClass._zone.AddCard(chara, pos.Copy());
5530 Msg.Say("little_pop");
5532 }
5533 break;
5534 case "shark_sister":
5535 if (!IsPCFaction)
5536 {
5537 Chara t = CharaGen.Create("sister_shark");
5538 EClass._zone.AddCard(t, pos.Copy());
5539 Msg.Say("shark_pop");
5540 }
5541 break;
5542 }
5543 if (attackSource == AttackSource.Finish && origin != null && origin.Evalue(665) > 0)
5544 {
5545 Chara chara2 = CharaGen.CreateFromFilter("c_plant", base.LV);
5546 EClass._zone.AddCard(chara2, pos.Copy());
5547 if (chara2.LV < base.LV)
5548 {
5549 chara2.SetLv(base.LV);
5550 }
5551 chara2.MakeMinion((origin.IsPCParty || origin.IsPCPartyMinion) ? EClass.pc : origin.Chara, MinionType.Friend);
5552 Msg.Say("plant_pop", this, chara2);
5553 }
5555 }
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:485
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:2615
void AddBlood(int a=1, int id=-1)
Definition: Card.cs:5944
virtual bool IsPCParty
Definition: Card.cs:2149
Card SetLv(int a)
Definition: Card.cs:2905
ICardParent parent
Definition: Card.cs:55
virtual bool IsPCPartyMinion
Definition: Card.cs:2153
void ClearFOV()
Definition: Card.cs:6547
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:6163
virtual bool IsPCFaction
Definition: Card.cs:2269
void SpawnLoot(Card origin)
Definition: Card.cs:5107
int LV
Definition: Card.cs:386
virtual bool isSynced
Definition: Card.cs:2087
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:879
int daysStarved
Definition: Chara.cs:329
void MakeMinion(Chara _master, MinionType type=MinionType.Default)
Definition: Chara.cs:2331
string NameBraced
Definition: Chara.cs:514
void ClearTempElements()
Definition: Chara.cs:10273
string TalkTopic(string topic="calm")
Definition: Chara.cs:6890
void TryDropBossLoot()
Definition: Chara.cs:5557
bool IsLocalChara
Definition: Chara.cs:841
Chara enemy
Definition: Chara.cs:86
bool IsInActiveZone
Definition: Chara.cs:838
void TryDropCarryOnly()
Definition: Chara.cs:4545
void MakeGrave(string lastword)
Definition: Chara.cs:5171
UD_String_MatData matColors
static ColorProfile Colors
Definition: EClass.cs:39
void RemoveMemeber(Chara c)
string Log(string idLang, string ref1=null, string ref2=null, string ref3=null, string ref4=null)
static string Parse(string text, bool thirdPerson, string val1, string val2=null, string val3=null, string val4=null)
Definition: GameLang.cs:141
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
bool HasElement(int ele, bool excludePC=false)
Definition: Party.cs:194
void RemoveMember(Chara c)
Definition: Party.cs:102
int allyDeath
Definition: Player.cs:111
void ModKarma(int a)
Definition: Player.cs:2512
Stats stats
Definition: Player.cs:1016
int little_dead
Definition: Player.cs:926
HashSet< int > doneBackers
Definition: Player.cs:1073
bool TryAbortAutoCombat(bool immediate=true)
Definition: Player.cs:2406
string deathMsg
Definition: Player.cs:1185
void TalkWitnesses(Chara criminal, string idTalk, int radius=4, WitnessType type=WitnessType.everyone, Func< Chara, bool > talkIf=null, int chance=3)
Definition: Point.cs:815
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:1999
void ResetHostility()
Definition: Zone.cs:2670
ZoneInstance instance
Definition: Zone.cs:52

References EClass._map, EClass._zone, ConfigAutoCombat.abortOnAllyDead, ConfigAutoCombat.abortOnEnemyDead, Zone.AddCard(), AddCondition(), Player.Stats.allyDeath, Game.Config.autoCombat, Game.cards, Map.charas, EClass.Colors, Game.config, CharaGen.Create(), CharaGen.CreateFromFilter(), Map.deadCharas, Player.deathMsg, Debug, Player.doneBackers, enemy, Zone.events, faith, ThingContainer.Find(), CardManager.GlobalCharaList.Find(), EClass.game, Effect.Get(), 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 10228 of file Chara.cs.

10229 {
10230 if (tempElements == null)
10231 {
10232 return;
10233 }
10234 foreach (Element item in tempElements.dict.Values.ToList())
10235 {
10236 if (item.vBase > 0)
10237 {
10238 ModTempElement(item.id, -Mathf.Min(item.vBase * 5 / 100 + 1, item.vBase), naturalDecay: true);
10239 }
10240 }
10241 }

References ElementContainer.dict, and item.

◆ DoAI()

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

Definition at line 6178 of file Chara.cs.

6179 {
6180 SetAI(new DynamicAIAct("", delegate
6181 {
6182 onPerform();
6183 return true;
6184 })
6185 {
6186 wait = wait
6187 });
6188 }

◆ DoHostileAction()

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

Definition at line 6278 of file Chara.cs.

6279 {
6280 if (_tg == null || !_tg.isChara)
6281 {
6282 return;
6283 }
6284 Chara chara = _tg.Chara;
6285 if (chara.IsPC)
6286 {
6287 EClass.pc.combatCount = 10;
6288 }
6289 if (!chara.IsAliveInCurrentZone || !IsAliveInCurrentZone || chara == this)
6290 {
6291 return;
6292 }
6293 if ((IsPCFaction || IsPCFactionMinion) && (chara.IsPCFaction || chara.IsPCFactionMinion))
6294 {
6295 chara.Say("frown", this, chara);
6296 }
6297 else
6298 {
6299 if (EClass._zone.IsRegion)
6300 {
6301 return;
6302 }
6303 if (IsPC)
6304 {
6305 if (chara.IsFriendOrAbove() && !immediate)
6306 {
6307 chara.Say("frown", this, chara);
6308 chara.ShowEmo(Emo.sad);
6309 chara.hostility = Hostility.Neutral;
6310 return;
6311 }
6312 if (!chara.IsPCFaction && chara.hostility >= Hostility.Neutral && !EClass._zone.IsPCFaction)
6313 {
6314 bool flag = chara.id == "fanatic";
6315 if (EClass.rnd(4) == 0 || flag)
6316 {
6317 chara.Say("callHelp", chara);
6318 chara.CallHelp(this, flag);
6319 }
6320 }
6321 if (chara.hostility <= Hostility.Enemy)
6322 {
6323 foreach (Chara member in EClass.pc.party.members)
6324 {
6325 if (member != EClass.pc && member.enemy == null && member.CanSee(chara))
6326 {
6327 member.SetEnemy(chara);
6328 }
6329 }
6330 }
6331 }
6332 else if (chara.IsPC && hostility <= Hostility.Enemy)
6333 {
6334 foreach (Chara member2 in EClass.pc.party.members)
6335 {
6336 if (member2 != EClass.pc && member2.enemy == null && member2.CanSee(this))
6337 {
6338 member2.SetEnemy(this);
6339 }
6340 }
6341 }
6342 if (chara.calmCheckTurn <= 0 || IsPC)
6343 {
6344 chara.calmCheckTurn = (IsPC ? (20 + EClass.rnd(30)) : (10 + EClass.rnd(10)));
6345 }
6346 if (hostility != Hostility.Enemy || chara.hostility != Hostility.Enemy)
6347 {
6348 GoHostile(chara);
6349 chara.GoHostile(this);
6350 if (base.isHidden && !chara.CanSee(this) && !chara.IsDisabled && !chara.IsPCParty && !chara.IsPCPartyMinion && EClass.rnd(10 + Dist(chara) * 10) == 0)
6351 {
6352 Thing t = ThingGen.Create("49");
6353 ActThrow.Throw(chara, pos, t);
6354 Act.TC = chara;
6355 }
6356 }
6357 }
6358 }
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:561
override bool IsPCPartyMinion
Definition: Chara.cs:639
int calmCheckTurn
Definition: Chara.cs:116
bool CanSee(Card c)
Definition: Chara.cs:1218
override bool IsPCFactionMinion
Definition: Chara.cs:655
bool IsFriendOrAbove()
Definition: Chara.cs:6547
Chara SetEnemy(Chara c=null)
Definition: Chara.cs:6229
void CallHelp(Chara tg, bool fanatic=false)
Definition: Chara.cs:6360
Hostility hostility
Definition: Chara.cs:291
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(), ActEffect.Proc(), AI_AttackHome.Run(), AI_Idle.Run(), GoalSiege.Run(), and ActThrow.Throw().

◆ Drink()

void Chara.Drink ( Card  t)
inline

Definition at line 5048 of file Chara.cs.

5049 {
5050 Say("drink", this, t.Duplicate(1));
5051 Say("quaff");
5052 PlaySound("drink");
5053 hunger.Mod(-2);
5054 t.ModNum(-1);
5055 t.trait.OnDrink(this);
5056 _ = IsPC;
5057 }
Thing Duplicate(int num)
Definition: Card.cs:3441
void ModNum(int a, bool notify=true)
Definition: Card.cs:3512
Stats hunger
Definition: Chara.cs:1142
virtual void OnDrink(Chara c)
Definition: Trait.cs:993

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

4558 {
4559 if (held == null)
4560 {
4561 return null;
4562 }
4563 if (IsPC)
4564 {
4565 WidgetHotbar.dirtyCurrentItem = true;
4567 }
4568 Card card = EClass._zone.AddCard(held, dropPos ?? pos);
4569 card.OnLand();
4570 if (card.trait.CanOnlyCarry)
4571 {
4572 card.SetPlaceState(PlaceState.installed);
4573 }
4574 return card;
4575 }
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 4577 of file Chara.cs.

4578 {
4579 if (t.c_isImportant)
4580 {
4581 Msg.Say("markedImportant");
4582 return;
4583 }
4584 if (!t.trait.CanBeDropped)
4585 {
4586 Msg.Say("cantDrop", t);
4587 return;
4588 }
4589 if (t.trait is TraitAbility)
4590 {
4591 SE.Trash();
4592 t.Destroy();
4593 return;
4594 }
4595 Msg.Say("dropItem", t.Name);
4596 t.ignoreAutoPick = true;
4597 PlaySound("drop");
4598 EClass._zone.AddCard(t, pos);
4599 if (t.trait.CanOnlyCarry)
4600 {
4601 t.Install();
4602 }
4603 }
Card Install()
Definition: Card.cs:3738
virtual bool CanBeDropped
Definition: Trait.cs:302

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

1776 {
1777 Chara chara = CharaGen.Create(id);
1778 chara.mana.value = mana.value;
1779 chara.stamina.value = stamina.value;
1780 foreach (KeyValuePair<int, Element> item in elements.dict)
1781 {
1782 Element orCreateElement = chara.elements.GetOrCreateElement(item.Key);
1783 orCreateElement.vBase = item.Value.ValueWithoutLink - orCreateElement.vSource;
1784 }
1785 chara.SetFaith(faith);
1786 chara.bio = IO.DeepCopy(bio);
1787 chara.LV = base.LV;
1788 chara.c_daysWithGod = base.c_daysWithGod;
1789 chara.RefreshFaithElement();
1790 chara.hp = (int)Mathf.Clamp((float)chara.MaxHP * ((float)base.hp / (float)MaxHP) * 0.99f, 0f, chara.MaxHP);
1791 chara.isCopy = true;
1792 chara.isScaled = base.isScaled;
1793 if (HaveFur())
1794 {
1795 chara.c_fur = -1;
1796 }
1797 return chara;
1798 }
bool HaveFur()
Definition: Card.cs:7833
Stats mana
Definition: Chara.cs:1154
void RefreshFaithElement()
Definition: Chara.cs:10108
void SetFaith(string id)
Definition: Chara.cs:1705
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(), and AI_Idle.Run().

◆ EnhanceTempElement()

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

Definition at line 10223 of file Chara.cs.

10224 {
10225 ModTempElement(ele, onlyRenew ? (p / 20) : (p / 100 + EClass.rnd(p / 100 + 1)), naturalDecay: false, onlyRenew);
10226 }

References EClass.rnd().

◆ EnhanceTempElements()

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

Definition at line 10214 of file Chara.cs.

10215 {
10216 int[] array = (body ? Element.List_Body : Element.List_Mind);
10217 foreach (int ele in array)
10218 {
10219 EnhanceTempElement(ele, p, onlyRenew);
10220 }
10221 }
void EnhanceTempElement(int ele, int p, bool onlyRenew=false)
Definition: Chara.cs:10223

References Element.List_Mind.

◆ EQ_CAT()

void Chara.EQ_CAT ( string  s)
inline

Definition at line 5025 of file Chara.cs.

5026 {
5027 int slot = EClass.sources.categories.map[s].slot;
5028 BodySlot bodySlot = ((slot == 0) ? null : body.GetSlot(slot));
5029 if ((slot == 0 || bodySlot != null) && (slot != 37 || !HasElement(1209)))
5030 {
5031 SetEQQuality();
5032 Thing thing = ThingGen.CreateFromCategory(s, base.LV);
5033 AddThing(thing);
5034 if (bodySlot != null && !body.Equip(thing, bodySlot))
5035 {
5036 thing.Destroy();
5037 }
5038 }
5039 }
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:3101
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:4972
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 5005 of file Chara.cs.

5006 {
5007 SetEQQuality();
5008 if (r != Rarity.Random)
5009 {
5010 CardBlueprint.current.rarity = r;
5011 }
5012 Thing thing = ThingGen.Create(s, mat, base.LV);
5013 if (body.GetSlot(thing, onlyEmpty: true) == null)
5014 {
5015 return thing;
5016 }
5017 AddThing(thing);
5018 if (!body.Equip(thing))
5019 {
5020 thing.Destroy();
5021 }
5022 return thing;
5023 }

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

5042 {
5043 SetEQQuality();
5044 Thing t = ThingGen.Create(s, -1, base.LV).SetNum(num);
5045 AddThing(t);
5046 }
Thing SetNum(int a)
Definition: Card.cs:3492

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

◆ EvalueRiding()

int Chara.EvalueRiding ( )
inline

Definition at line 6089 of file Chara.cs.

6090 {
6091 if (ride != null && ride.HasCondition<ConTransmuteBroom>() && HasElement(1417))
6092 {
6093 return 25 + Evalue(226) * 125 / 100;
6094 }
6095 return Evalue(226);
6096 }

References HasCondition().

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

◆ FallFromZone()

void Chara.FallFromZone ( )
inline

Definition at line 3485 of file Chara.cs.

3486 {
3487 Msg.Say("skyFall", EClass.pc, EClass._zone.Name);
3488 Zone zone = (EClass._zone.isExternalZone ? null : EClass._zone.GetTopZone().FindZone(EClass._zone.lv - 1));
3489 zone = zone ?? EClass.world.region;
3491 {
3492 state = ZoneTransition.EnterState.Fall,
3493 x = pos.x,
3494 z = pos.z
3495 });
3496 }
void MoveZone(string alias)
Definition: Chara.cs:3310
int lv
Definition: Spatial.cs:142
Zone FindZone(int lv)
Definition: Spatial.cs:728
Region region
Definition: World.cs:23
Definition: Zone.cs:12
Zone GetTopZone()
Definition: Zone.cs:1920

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

7736 {
7737 TraitToolRange ranged = weapon.trait as TraitToolRange;
7738 Thing thing = (IsPC ? EClass.pc.things.Find<TraitQuiver>() : null);
7739 if (thing != null)
7740 {
7741 Thing thing2 = thing.things.Find((Thing t) => ranged.IsAmmo(t));
7742 if (thing2 != null)
7743 {
7744 return thing2;
7745 }
7746 }
7747 return things.Find((Thing t) => ranged.IsAmmo(t));
7748 }
bool IsAmmo
Definition: Card.cs:2247
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 7239 of file Chara.cs.

7240 {
7241 foreach (Card item in EClass._map.props.installed.all)
7242 {
7243 if (item.trait is TraitBed traitBed && traitBed.IsHolder(this))
7244 {
7245 return traitBed;
7246 }
7247 }
7248 return null;
7249 }

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

7471 {
7472 Thing result = null;
7473 int num = -1;
7474 if (IsPC)
7475 {
7476 return null;
7477 }
7478 foreach (Thing item in things.List((Thing t) => CanEat(t, shouldEat: true) && !t.c_isImportant, onlyAccessible: true))
7479 {
7480 int num2 = CountNumEaten(item);
7481 int num3 = 100 - num2 + (item.HasElement(757) ? 10 : 0);
7482 if (num3 > num)
7483 {
7484 result = item;
7485 num = num3;
7486 }
7487 }
7488 return result;
7489 }
bool CanEat(Thing t, bool shouldEat=false)
Definition: Chara.cs:7516
int CountNumEaten(Thing food)
Definition: Chara.cs:10079
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 2377 of file Chara.cs.

2378 {
2379 if (IsMinion)
2380 {
2381 master = EClass._map.FindChara(base.c_uidMaster);
2382 }
2383 return master;
2384 }
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 6440 of file Chara.cs.

6441 {
6442 for (int i = 0; i < EClass._map.charas.Count; i++)
6443 {
6444 Chara chara = EClass._map.charas[i];
6445 if (chara != this && chara != enemy && IsHostile(chara) && Dist(chara) <= 1 && CanInteractTo(chara.pos))
6446 {
6447 DoHostileAction(chara);
6448 enemy = chara;
6449 return true;
6450 }
6451 }
6452 return false;
6453 }
void DoHostileAction(Card _tg, bool immediate=false)
Definition: Chara.cs:6278

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

6372 {
6373 if (EClass._zone.isPeace && base.IsPCFactionOrMinion && !IsPC)
6374 {
6375 return false;
6376 }
6377 if (enemy != null && !enemy.IsAliveInCurrentZone)
6378 {
6379 enemy = null;
6380 }
6381 if (enemy != null)
6382 {
6383 return false;
6384 }
6385 if (IsPCParty && EClass.pc.isHidden && base.isHidden)
6386 {
6387 return false;
6388 }
6389 bool flag = enemy != null || ai is GoalCombat;
6390 int num = (base.PER + Evalue(210) * 2) * ((!flag) ? 1 : 2);
6391 bool flag2 = IsPCParty && !IsPC && EClass.game.config.tactics.dontWander;
6392 bool flag3 = !IsPCParty;
6393 Chara chara = null;
6394 int num2 = 9999;
6395 for (int i = 0; i < EClass._map.charas.Count; i++)
6396 {
6397 Chara chara2 = EClass._map.charas[i];
6398 if (chara2 == this || !IsHostile(chara2) || !CanSee(chara2))
6399 {
6400 continue;
6401 }
6402 int num3 = Dist(chara2);
6403 int num4 = GetSightRadius() + (flag ? 1 : 0);
6404 if (num3 > num4)
6405 {
6406 continue;
6407 }
6408 if (flag3 && EClass.rnd(chara2.Evalue(152) + 5) * (100 + num3 * num3 * 10) / 100 > EClass.rnd(num))
6409 {
6410 if (this == pos.FirstChara)
6411 {
6412 chara2.ModExp(152, Mathf.Clamp((num - chara2.Evalue(152)) / 2, 1, Mathf.Max(30 - stealthSeen * 2, 1)));
6413 }
6414 stealthSeen++;
6415 }
6416 else if (CanSeeLos(chara2) && (!flag2 || EClass.pc.isBlind || EClass.pc.CanSeeLos(chara2)) && (!IsPCFaction || EClass.pc.ai.ShouldAllyAttack(chara2)))
6417 {
6418 if (!IsPCParty)
6419 {
6420 DoHostileAction(chara2);
6421 enemy = chara2;
6422 return true;
6423 }
6424 if (num3 < num2)
6425 {
6426 num2 = num3;
6427 chara = chara2;
6428 }
6429 }
6430 }
6431 if (chara != null)
6432 {
6433 DoHostileAction(chara);
6434 enemy = chara;
6435 return true;
6436 }
6437 return false;
6438 }
virtual bool ShouldAllyAttack(Chara tg)
Definition: AIAct.cs:134
int stealthSeen
Definition: Chara.cs:188
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 7850 of file Chara.cs.

7851 {
7852 return FindBed()?.owner.pos.cell.room;
7853 }
TraitBed FindBed()
Definition: Chara.cs:7239

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

9995 {
9996 Element orCreateElement = elements.GetOrCreateElement(ele);
9997 if (orCreateElement.ValueWithoutLink == 0)
9998 {
9999 elements.ModBase(orCreateElement.id, 1);
10000 }
10001 if (orCreateElement is Spell)
10002 {
10003 int num = EClass.curve(Evalue(307), 50, 20) + (HasElement(307) ? 20 : 0);
10004 int num2 = origin?.Evalue(765) ?? 0;
10005 num = num * (100 - num2) / 100;
10006 int a = mtp * orCreateElement.source.charge * (100 + num) / 100 / 100;
10007 a = Mathf.Max(1, EClass.rndHalf(a));
10008 if (orCreateElement.source.charge == 1)
10009 {
10010 a = 1;
10011 }
10012 orCreateElement.vPotential += a;
10013 }
10014 Say("spell_gain", this, orCreateElement.Name);
10015 LayerAbility.SetDirty(orCreateElement);
10016 }
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(), AI_Fuck.Finish(), and TraitBaseSpellbook.OnRead().

◆ GetActionText()

string Chara.GetActionText ( )
inline

Definition at line 7183 of file Chara.cs.

7184 {
7185 string result = "?????";
7186 if (ai != null)
7187 {
7188 result = ai.GetCurrentActionText();
7189 }
7190 return result;
7191 }
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 7785 of file Chara.cs.

7786 {
7787 if (body.GetWeight(armorOnly: true) <= 30000)
7788 {
7789 return 120;
7790 }
7791 return 122;
7792 }
int GetWeight(bool armorOnly=false)
Definition: CharaBody.cs:402

References CharaBody.GetWeight().

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

◆ GetBestRangedWeapon()

Thing Chara.GetBestRangedWeapon ( )
inline

Definition at line 7750 of file Chara.cs.

7751 {
7752 Thing result = null;
7753 int num = 0;
7754 foreach (Thing thing in things)
7755 {
7756 if (thing.IsRangedWeapon && CanEquipRanged(thing) && thing.GetEquipValue() > num)
7757 {
7758 num = thing.GetEquipValue();
7759 result = thing;
7760 }
7761 }
7762 return result;
7763 }
int GetEquipValue()
Definition: Card.cs:7134
bool IsRangedWeapon
Definition: Card.cs:2243
bool CanEquipRanged(Thing t)
Definition: Chara.cs:7684

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

◆ GetBuffStats() [1/2]

Element Chara.GetBuffStats ( int  ele)
inline

Definition at line 9346 of file Chara.cs.

9347 {
9348 for (int i = 0; i < conditions.Count; i++)
9349 {
9350 if (conditions[i] is ConBuffStats conBuffStats && conBuffStats.refVal == ele)
9351 {
9352 return conBuffStats.elements.GetElement(ele);
9353 }
9354 }
9355 return null;
9356 }

References BaseCondition.refVal.

◆ GetBuffStats() [2/2]

Element Chara.GetBuffStats ( string  alias)
inline

Definition at line 9341 of file Chara.cs.

9342 {
9343 return GetBuffStats(EClass.sources.elements.alias[alias].id);
9344 }
Element GetBuffStats(string alias)
Definition: Chara.cs:9341

References SourceManager.elements, and EClass.sources.

Referenced by GoalCombat.TryUseAbility().

◆ GetBurden()

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

Definition at line 1800 of file Chara.cs.

1801 {
1802 int num2 = (base.ChildrenWeight + ((t != null) ? ((num == -1) ? t.ChildrenAndSelfWeight : (t.SelfWeight * num)) : 0)) * 100 / WeightLimit;
1803 if (num2 < 0)
1804 {
1805 num2 = 1000;
1806 }
1808 {
1809 num2 = 0;
1810 }
1811 int num3 = ((num2 >= 100) ? ((num2 - 100) / 10 + 1) : 0);
1812 if (num3 > 9)
1813 {
1814 num3 = 9;
1815 }
1816 return num3;
1817 }

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

◆ GetCondition< T >()

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

Definition at line 9384 of file Chara.cs.

9384 : Condition
9385 {
9386 for (int i = 0; i < conditions.Count; i++)
9387 {
9388 if (conditions[i] is T)
9389 {
9390 return conditions[i] as T;
9391 }
9392 }
9393 return null;
9394 }

◆ GetCooldown()

int Chara.GetCooldown ( int  idEle)
inline

Definition at line 8635 of file Chara.cs.

8636 {
8637 if (_cooldowns != null)
8638 {
8639 for (int i = 0; i < _cooldowns.Count; i++)
8640 {
8641 if (_cooldowns[i] / 1000 == idEle)
8642 {
8643 return _cooldowns[i] % 1000;
8644 }
8645 }
8646 }
8647 return 0;
8648 }

Referenced by NotificationCooldown.OnRefresh().

◆ GetCurrentDir()

int Chara.GetCurrentDir ( )
inline

Definition at line 3605 of file Chara.cs.

3606 {
3607 Debug.Log(angle);
3608 if (!renderer.hasActor)
3609 {
3610 if (angle == 0f || angle == 45f || angle == 90f)
3611 {
3612 return 2;
3613 }
3614 if (angle == -135f || angle == 180f || angle == -90f)
3615 {
3616 return 1;
3617 }
3618 if (angle == 135f)
3619 {
3620 return 0;
3621 }
3622 return 3;
3623 }
3624 return renderer.actor.currentDir;
3625 }
virtual int currentDir
Definition: CardActor.cs:41
float angle
Definition: Card.cs:71

References Debug.

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

◆ GetDestination()

Point Chara.GetDestination ( )
inline

Definition at line 7158 of file Chara.cs.

7159 {
7160 return (ai.IsRunning ? ai.GetDestination() : pos).Copy();
7161 }
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 4630 of file Chara.cs.

4631 {
4632 if (elements.Value(122) > elements.Value(120))
4633 {
4634 return elements.GetElement(122);
4635 }
4636 return elements.GetElement(120);
4637 }
int Value(int ele)

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

◆ GetFavAttackStyle()

AttackStyle Chara.GetFavAttackStyle ( )
inline

Definition at line 4605 of file Chara.cs.

4606 {
4607 int num = Evalue(131);
4608 int num2 = Evalue(130);
4609 int num3 = Evalue(123);
4610 if (num > num2 && num > num3)
4611 {
4612 return AttackStyle.TwoWield;
4613 }
4614 if (num2 > num && num2 > num3)
4615 {
4616 return AttackStyle.TwoHand;
4617 }
4618 if (num3 > num && num3 > num2)
4619 {
4620 return AttackStyle.Shield;
4621 }
4622 return AttackStyle.Default;
4623 }

Referenced by WindowChara.RefreshNote().

◆ GetFavCat()

SourceCategory.Row Chara.GetFavCat ( )
inline

Definition at line 7974 of file Chara.cs.

7975 {
7976 SourceCategory.Row r = null;
7977 if (_listFavCat.Count == 0)
7978 {
7979 foreach (SourceCategory.Row row in EClass.sources.categories.rows)
7980 {
7981 if (row.gift > 0)
7982 {
7983 _listFavCat.Add(row);
7984 }
7985 }
7986 }
7987 Rand.UseSeed(base.uid + EClass.game.seed, delegate
7988 {
7989 r = _listFavCat.RandomItem();
7990 });
7991 return r;
7992 }
static List< SourceCategory.Row > _listFavCat
Definition: Chara.cs:194
int seed
Definition: Game.cs:200
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 7954 of file Chara.cs.

7955 {
7956 if (_listFavFood.Count == 0)
7957 {
7958 foreach (SourceThing.Row row in EClass.sources.things.rows)
7959 {
7960 if (row._origin == "dish" && row.value != 0 && row.chance != 0)
7961 {
7962 _listFavFood.Add(row);
7963 }
7964 }
7965 }
7966 SourceThing.Row r = null;
7967 Rand.UseSeed(base.uid + EClass.game.seed, delegate
7968 {
7969 r = _listFavFood.RandomItem();
7970 });
7971 return r;
7972 }
static List< SourceThing.Row > _listFavFood
Definition: Chara.cs:192
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 4625 of file Chara.cs.

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

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

8702 {
8703 if (IsPC)
8704 {
8705 return null;
8706 }
8707 switch (TimeTable.GetSpan(idTimeTable, hour))
8708 {
8709 case TimeTable.Span.Sleep:
8711 {
8712 return new GoalSleep();
8713 }
8714 break;
8715 case TimeTable.Span.Eat:
8716 return new GoalIdle();
8717 case TimeTable.Span.Work:
8718 if (IsGuest())
8719 {
8720 return new GoalIdle();
8721 }
8722 return GetGoalWork();
8723 case TimeTable.Span.Free:
8724 if (IsGuest())
8725 {
8726 return new GoalIdle();
8727 }
8728 return GetGoalHobby();
8729 }
8730 return null;
8731 }
Goal GetGoalWork()
Definition: Chara.cs:8733
Goal GetGoalHobby()
Definition: Chara.cs:8746
string idTimeTable
Definition: Chara.cs:468
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 8746 of file Chara.cs.

8747 {
8748 if (IsPrisoner)
8749 {
8750 return new GoalIdle();
8751 }
8752 if (memberType == FactionMemberType.Livestock)
8753 {
8754 return new GoalGraze();
8755 }
8756 return new GoalHobby();
8757 }
FactionMemberType
bool IsPrisoner
Definition: Chara.cs:1038

Referenced by Zone.Simulate().

◆ GetGoalWork()

Goal Chara.GetGoalWork ( )
inline

Definition at line 8733 of file Chara.cs.

8734 {
8735 if (IsPrisoner)
8736 {
8737 return new GoalIdle();
8738 }
8739 if (memberType == FactionMemberType.Livestock)
8740 {
8741 return new GoalGraze();
8742 }
8743 return new GoalWork();
8744 }

Referenced by Zone.Simulate().

◆ GetHappiness()

int Chara.GetHappiness ( )
inline

Definition at line 7168 of file Chara.cs.

7169 {
7170 int num = 50;
7171 if (FindBed() != null)
7172 {
7173 num += 50;
7174 }
7175 return num;
7176 }

◆ GetHireCost()

int Chara.GetHireCost ( )
inline

Definition at line 7163 of file Chara.cs.

7164 {
7165 return base.LV / 2 + 4;
7166 }

Referenced by CalcGold.Hire().

◆ GetHoverText()

override string Chara.GetHoverText ( )
inlinevirtual

Reimplemented from Card.

Definition at line 6693 of file Chara.cs.

6694 {
6695 string text = base.Name;
6696 if (IsFriendOrAbove())
6697 {
6698 text = text.TagColor(EClass.Colors.colorFriend);
6699 }
6700 else if (IsHostile())
6701 {
6702 text = text.TagColor(EClass.Colors.colorHostile);
6703 }
6704 int num = 2;
6705 int lV = EClass.pc.LV;
6706 if (base.LV >= lV * 5)
6707 {
6708 num = 0;
6709 }
6710 else if (base.LV >= lV * 2)
6711 {
6712 num = 1;
6713 }
6714 else if (base.LV <= lV / 4)
6715 {
6716 num = 4;
6717 }
6718 else if (base.LV <= lV / 2)
6719 {
6720 num = 3;
6721 }
6722 string text2 = Lang.GetList("lvComparison")[num];
6723 text2 = (" (" + text2 + ") ").TagSize(14).TagColor(EClass.Colors.gradientLVComparison.Evaluate(0.25f * (float)num));
6724 string s = (IsFriendOrAbove() ? "HostilityAlly" : (IsNeutral() ? "HostilityNeutral" : "HostilityEnemy"));
6725 s = (" (" + s.lang() + ") ").TagSize(14);
6726 s = "";
6727 if (memberType == FactionMemberType.Guest)
6728 {
6729 s += (" (" + "guest".lang() + ") ").TagSize(14);
6730 }
6731 else if (memberType == FactionMemberType.Livestock)
6732 {
6733 s += (" (" + "livestock".lang() + ") ").TagSize(14);
6734 }
6735 if (!EClass.pc.IsMoving)
6736 {
6737 if (EClass.pc.HasHigherGround(this))
6738 {
6739 text2 += "lowerGround".lang();
6740 }
6741 else if (HasHigherGround(EClass.pc))
6742 {
6743 text2 += "higherGround".lang();
6744 }
6745 }
6746 if (Evalue(1232) > 0)
6747 {
6748 text2 = "milkBaby".lang().TagSize(14) + text2;
6749 }
6750 if (Guild.Fighter.ShowBounty(this) && Guild.Fighter.HasBounty(this))
6751 {
6752 text2 = "hasBounty".lang().TagSize(14) + text2;
6753 }
6754 if (EClass.pc.HasElement(481))
6755 {
6756 text2 += ("(" + faith.Name + ")").TagSize(14);
6757 }
6758 if (EClass.pc.HasElement(6607))
6759 {
6760 s += CraftUtil.GetBloodText(this).TagSize(14).TagColor(EClass.Colors.colorBlood);
6761 }
6762 return text + text2 + s;
6763 }
bool HasHigherGround(Card c)
Definition: Chara.cs:1190
override bool IsMoving
Definition: Chara.cs:608
bool IsNeutral()
Definition: Chara.cs:6498
Color colorHostile
Color colorBlood
Color colorFriend
Gradient gradientLVComparison
static string GetBloodText(Chara c)
Definition: CraftUtil.cs:117
bool ShowBounty(Chara c)
Definition: GuildFighter.cs:39
bool HasBounty(Chara c)
Definition: GuildFighter.cs:44
Definition: Guild.cs:2
static GuildFighter Fighter
Definition: Guild.cs:56

References ColorProfile.colorBlood, ColorProfile.colorFriend, ColorProfile.colorHostile, EClass.Colors, Guild.Fighter, CraftUtil.GetBloodText(), 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 6765 of file Chara.cs.

6766 {
6767 string text = "";
6768 if (knowFav)
6769 {
6770 text += Environment.NewLine;
6771 text = text + "<size=14>" + "favgift".lang(GetFavCat().GetName().ToLower(), GetFavFood().GetName()) + "</size>";
6772 }
6773 string text2 = "";
6775 {
6776 text2 += Environment.NewLine;
6777 text2 = text2 + "Lv:" + base.LV + " HP:" + base.hp + "/" + MaxHP + " MP:" + mana.value + "/" + mana.max + " DV:" + DV + " PV:" + PV + " Hunger:" + hunger.value;
6778 text2 += Environment.NewLine;
6779 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");
6780 text2 += Environment.NewLine;
6781 text2 = text2 + base.uid + IsMinion + "/" + base.c_uidMaster + "/" + master;
6782 text2 = text2 + " dir:" + base.dir + " skin:" + base.idSkin + " scaled:" + base.isScaled;
6783 }
6785 {
6786 text2 += Environment.NewLine;
6787 text2 += "<size=14>";
6788 foreach (Hobby item in ListWorks())
6789 {
6790 text2 = text2 + item.Name + ", ";
6791 }
6792 foreach (Hobby item2 in ListHobbies())
6793 {
6794 text2 = text2 + item2.Name + ", ";
6795 }
6796 text2 = text2.TrimEnd(", ".ToCharArray()) + "</size>";
6797 }
6798 string text3 = "";
6799 IEnumerable<BaseStats> enumerable = conditions.Concat((!IsPCFaction) ? new BaseStats[0] : new BaseStats[2] { hunger, stamina });
6800 if (enumerable.Count() > 0)
6801 {
6802 text3 += Environment.NewLine;
6803 text3 += "<size=14>";
6804 int num = 0;
6805 foreach (BaseStats item3 in enumerable)
6806 {
6807 string text4 = item3.GetPhaseStr();
6808 if (text4.IsEmpty() || text4 == "#")
6809 {
6810 continue;
6811 }
6812 Color c = Color.white;
6813 switch (item3.source.group)
6814 {
6815 case "Bad":
6816 case "Debuff":
6817 case "Disease":
6819 break;
6820 case "Buff":
6822 break;
6823 }
6825 {
6826 text4 = text4 + "(" + item3.GetValue() + ")";
6827 if (resistCon != null && resistCon.ContainsKey(item3.id))
6828 {
6829 text4 = text4 + "{" + resistCon[item3.id] + "}";
6830 }
6831 }
6832 num++;
6833 text3 = text3 + text4.TagColor(c) + ", ";
6834 }
6835 if (num == 0)
6836 {
6837 text3 = "";
6838 }
6839 else
6840 {
6841 text = "";
6842 text3 = text3.TrimEnd(", ".ToCharArray()) + "</size>";
6843 }
6844 }
6846 {
6847 text3 += Environment.NewLine;
6848 foreach (ActList.Item item4 in ability.list.items)
6849 {
6850 text3 = text3 + item4.act.Name + ", ";
6851 }
6852 text3 = text3.TrimEnd(", ".ToCharArray());
6853 }
6854 return text + text2 + text3;
6855 }
override string ToString()
Definition: AIAct.cs:124
virtual string GetPhaseStr()
Definition: BaseStats.cs:47
virtual int GetValue()
Definition: BaseStats.cs:52
bool isScaled
Definition: Card.cs:914
SourceCategory.Row GetFavCat()
Definition: Chara.cs:7974
bool knowFav
Definition: Chara.cs:413
override string GetName(NameStyle style, int num=-1)
Definition: Chara.cs:1357
override int DV
Definition: Chara.cs:729
List< Hobby > ListHobbies(bool useMemberType=true)
Definition: Chara.cs:8889
override int PV
Definition: Chara.cs:758
SourceThing.Row GetFavFood()
Definition: Chara.cs:7954
List< Hobby > ListWorks(bool useMemberType=true)
Definition: Chara.cs:8862
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.isScaled, 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 8056 of file Chara.cs.

8057 {
8058 if (id == "olderyoungersister")
8059 {
8060 if (base.idSkin != 2)
8061 {
8062 return "UN_olderyoungersister";
8063 }
8064 return "UN_olderyoungersister_alt";
8065 }
8066 if (Portrait.allIds.Contains("UN_" + id + ".png"))
8067 {
8068 return "UN_" + id;
8069 }
8070 return base.c_idPortrait;
8071 }
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 8042 of file Chara.cs.

8043 {
8044 string text = race.id;
8045 if ((text == "mifu" || text == "nefu") && EClass.rnd(2) == 0)
8046 {
8047 return "foxfolk";
8048 }
8049 if (trait is TraitGuard)
8050 {
8051 return "guard";
8052 }
8053 return "";
8054 }

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

6952 {
6953 return GetSprite();
6954 }
override Sprite GetSprite(int dir=0)
Definition: Chara.cs:6617

◆ GetName()

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

Reimplemented from Card.

Definition at line 1357 of file Chara.cs.

1358 {
1359 if (base.isBackerContent && EClass.core.config.backer.Show(base.c_idBacker))
1360 {
1361 if (id == "follower" && !IsGlobal)
1362 {
1363 return "_follower".lang(EClass.sources.backers.map[base.c_idBacker].Name, faith.Name);
1364 }
1365 return EClass.sources.backers.map[base.c_idBacker].Name;
1366 }
1367 string text = base.c_altName ?? source.GetName(this);
1368 text = text.Replace("#ele5", MainElement.source.GetAltname(3)).Replace("#ele4", MainElement.source.GetAltname(2)).Replace("#ele3", MainElement.source.GetAltname(1))
1369 .Replace("#ele2", MainElement.source.GetAltname(0))
1370 .Replace("#ele", MainElement.source.GetName().ToLower());
1371 if (base.c_bossType == BossType.Evolved)
1372 {
1373 text = "_evolved".lang(text.ToTitleCase(wholeText: true));
1374 }
1375 trait.SetName(ref text);
1376 if (text.Length > 0 && char.IsLower(text[0]))
1377 {
1378 if (base.rarity >= Rarity.Legendary)
1379 {
1380 text = text.ToTitleCase();
1381 }
1382 else if (num != 0)
1383 {
1384 text = text.AddArticle();
1385 }
1386 }
1387 if (style == NameStyle.Simple)
1388 {
1389 return text;
1390 }
1391 int num2 = ((base.rarity == Rarity.Mythical) ? 3 : ((base.rarity >= Rarity.Legendary) ? 2 : ((!_alias.IsEmpty()) ? 1 : (-1))));
1392 if (trait is TraitAdventurer)
1393 {
1394 num2 = 1;
1395 }
1396 text = (Aka.IsEmpty() ? text.Bracket(num2) : (num2 switch
1397 {
1398 -1 => "_aka",
1399 1 => "_aka3",
1400 _ => "_aka2",
1401 }).lang((num2 == -1) ? Aka : Aka.ToTitleCase(wholeText: true), text.Bracket(num2)));
1402 string text2 = (base.isSale ? "forSale".lang(Lang._currency(GetPrice(CurrencyType.Money, sell: true, PriceType.PlayerShop), "money")) : "");
1403 return text + text2;
1404 }
BossType
Definition: BossType.cs:2
string Aka
Definition: Chara.cs:216
string _alias
Definition: Chara.cs:219
BackerContentConfig backer
Definition: CoreConfig.cs:613
string Name
Definition: Religion.cs:30
SourceBacker backers
virtual void SetName(ref string s)
Definition: Trait.cs:702

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

7995 {
7996 using (List<Chara>.Enumerator enumerator = pos.ListCharasInRadius(this, 3, (Chara c) => c != this && c.race.id == "cat").GetEnumerator())
7997 {
7998 if (enumerator.MoveNext())
7999 {
8000 return enumerator.Current;
8001 }
8002 }
8003 return null;
8004 }
List< Chara > ListCharasInRadius(Chara cc, int dist, Func< Chara, bool > func, bool onlyVisible=true)
Definition: Point.cs:1220

References race.

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

◆ GetPietyValue()

int Chara.GetPietyValue ( )
inline

Definition at line 10099 of file Chara.cs.

10100 {
10101 if (base._IsPC)
10102 {
10103 return 10 + (int)(Mathf.Sqrt(base.c_daysWithGod) * 2f + (float)Evalue(85)) / 2;
10104 }
10105 return 10 + (int)(Mathf.Sqrt(base.LV) * 5f + (float)Evalue(306)) / 2;
10106 }

◆ GetRevived()

void Chara.GetRevived ( )
inline

Definition at line 5064 of file Chara.cs.

5065 {
5066 Revive(EClass.pc.pos.GetNearestPoint(allowBlock: false, allowChara: false), msg: true);
5067 if (!IsPCFaction)
5068 {
5069 return;
5070 }
5072 {
5073 if (homeZone != null && EClass._zone != homeZone)
5074 {
5075 Msg.Say("returnHome", this, homeZone.Name);
5077 }
5078 }
5079 else if (!EClass._zone.IsPCFaction || homeBranch != EClass.Branch || base.c_wasInPcParty)
5080 {
5081 EClass.pc.party.AddMemeber(this, showMsg: true);
5082 }
5083 }
static FactionBranch Branch
Definition: EClass.cs:23
void AddMemeber(Chara c, bool showMsg=false)
Definition: Party.cs:57
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false, int minRadius=0)
Definition: Point.cs:619
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 8840 of file Chara.cs.

8841 {
8842 BaseArea result = null;
8843 foreach (Hobby item in ListWorks())
8844 {
8845 AIWork aI = item.GetAI(this);
8846 if (aI.SetDestination())
8847 {
8848 if (aI.destArea != null)
8849 {
8850 result = aI.destArea;
8851 }
8852 else if (aI.destThing != null)
8853 {
8854 result = aI.destThing.pos.cell.room;
8855 }
8856 break;
8857 }
8858 }
8859 return result;
8860 }
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 6617 of file Chara.cs.

6618 {
6619 if (IsPCC)
6620 {
6621 PCC pCC = PCC.Get(pccData);
6622 pCC.Build();
6623 return pCC.variation.idle[0, 0];
6624 }
6625 if (spriteReplacer != null)
6626 {
6627 return spriteReplacer.data.GetSprite();
6628 }
6629 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);
6630 }
SpriteReplacer spriteReplacer
Definition: Chara.cs:154
override CardRow sourceCard
Definition: Chara.cs:450
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 6641 of file Chara.cs.

6642 {
6643 if (IsPCC)
6644 {
6646 {
6648 }
6649 }
6650 else if (conSleep != null && host == null && pos.Equals(EClass.pc.pos) && IsHuman && (GetBool(123) || affinity.CanSleepBeside()))
6651 {
6652 return EClass.setting.pass.subDead;
6653 }
6654 return SubPassData.Default;
6655 }
bool GetBool(int id)
Definition: BaseCard.cs:15
ConSleep conSleep
Definition: Chara.cs:102
override bool IsDeadOrSleeping
Definition: Chara.cs:573
PassSetting pass
Definition: GameSetting.cs:303
bool altHeldPos
Definition: Player.cs:1153
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 7178 of file Chara.cs.

7179 {
7180 return GetHappiness().ToString() ?? "";
7181 }
int GetHappiness()
Definition: Chara.cs:7168

◆ GetTextHobby()

string Chara.GetTextHobby ( bool  simple = false)
inline

Definition at line 8978 of file Chara.cs.

8979 {
8980 string text = (simple ? "" : ("hobby".lang() + ":"));
8981 foreach (Hobby item in ListHobbies())
8982 {
8983 text = text + " " + item.Name.TagColor((item.GetEfficiency(this) > 0) ? FontColor.Good : FontColor.Warning) + ",";
8984 }
8985 return text.TrimEnd(',');
8986 }

References item.

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

◆ GetTextWork()

string Chara.GetTextWork ( bool  simple = false)
inline

Definition at line 8988 of file Chara.cs.

8989 {
8990 string text = (simple ? "" : ("work".lang() + ":"));
8991 foreach (Hobby item in ListWorks())
8992 {
8993 text = text + " " + item.Name.TagColor((item.GetEfficiency(this) > 0) ? FontColor.Good : FontColor.Warning) + ",";
8994 }
8995 return text.TrimEnd(',');
8996 }

References item.

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

◆ GetTopicText()

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

Definition at line 6857 of file Chara.cs.

6858 {
6859 string key = source.idText.IsEmpty(id);
6860 if (id == "littleOne" && EClass._zone is Zone_LittleGarden)
6861 {
6862 key = "littleOne2";
6863 }
6864 SourceCharaText.Row row = EClass.sources.charaText.map.TryGetValue(key);
6865 if (row == null)
6866 {
6867 return null;
6868 }
6869 string text = row.GetText(topic, returnNull: true);
6870 if (text.IsEmpty())
6871 {
6872 return null;
6873 }
6874 if (text.StartsWith("@"))
6875 {
6876 row = EClass.sources.charaText.map.TryGetValue(text.Replace("@", ""));
6877 if (row == null)
6878 {
6879 return null;
6880 }
6881 text = row.GetText(topic, returnNull: true);
6882 if (text.IsEmpty())
6883 {
6884 return null;
6885 }
6886 }
6887 return text.Split(Environment.NewLine.ToCharArray()).RandomItem();
6888 }
SourceCharaText charaText

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

◆ GetTotalFeat()

int Chara.GetTotalFeat ( )
inline

Definition at line 8016 of file Chara.cs.

8017 {
8018 int num = 0;
8019 if (base.c_upgrades != null)
8020 {
8021 num += base.c_upgrades.spent;
8022 }
8023 if (base.c_genes != null)
8024 {
8025 num += base.c_genes.GetTotalCost();
8026 }
8027 return num + base.feat;
8028 }

◆ GetWork()

Hobby Chara.GetWork ( string  id)
inline

Definition at line 8909 of file Chara.cs.

8910 {
8911 foreach (Hobby item in ListWorks())
8912 {
8913 if (item.source.alias == id)
8914 {
8915 return item;
8916 }
8917 }
8918 foreach (Hobby item2 in ListHobbies())
8919 {
8920 if (item2.source.alias == id)
8921 {
8922 return item2;
8923 }
8924 }
8925 return null;
8926 }
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 9061 of file Chara.cs.

9062 {
9063 if (_workSummary == null)
9064 {
9065 _workSummary = new WorkSummary();
9066 }
9067 return _workSummary;
9068 }
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 8155 of file Chara.cs.

8156 {
8157 if (c.IsHostile() || c.IsDeadOrSleeping)
8158 {
8159 Msg.Say("affinityNone", c, this);
8160 return;
8161 }
8162 if (!t.isCopy && t.IsCursed && t.IsEquipmentOrRanged && !t.IsAmmo && c.HasElement(1414))
8163 {
8164 bool num = t.blessedState == BlessedState.Doomed;
8165 int num2 = 200 + t.LV * 3;
8166 if (t.rarity == Rarity.Legendary)
8167 {
8168 num2 *= 3;
8169 }
8170 if (t.rarity >= Rarity.Mythical)
8171 {
8172 num2 *= 5;
8173 }
8174 if (num)
8175 {
8176 num2 *= 2;
8177 }
8178 EClass.pc.PlayEffect("identify");
8179 EClass.pc.PlaySound("identify");
8180 c.PlayEffect("mutation");
8181 c.Say("draw_curse", c, t);
8182 t.Destroy();
8183 List<Element> list = new List<Element>();
8184 foreach (Element value in EClass.pc.elements.dict.Values)
8185 {
8186 if (value is Spell)
8187 {
8188 list.Add(value);
8189 }
8190 }
8191 if (list.Count == 0)
8192 {
8194 return;
8195 }
8196 Element element = list.RandomItem();
8197 EClass.pc.ModExp(element.id, num2);
8198 EClass.pc.Say("draw_curse2", EClass.pc, element.Name);
8199 c.AddExp(Mathf.Min(num2 / 3, c.ExpToNext));
8200 return;
8201 }
8202 if ((t.id == "lovepotion" || t.id == "dreambug") && !Application.isEditor)
8203 {
8204 GiveLovePotion(c, t);
8205 return;
8206 }
8207 if (t.trait is TraitErohon && c.id == t.c_idRefName)
8208 {
8209 c.OnGiveErohon(t);
8210 return;
8211 }
8212 if (t.trait is TraitTicketMassage)
8213 {
8214 t.ModNum(-1);
8215 c.Talk("ticket");
8216 switch (t.id)
8217 {
8218 case "ticket_massage":
8219 c.ModAffinity(EClass.pc, 10);
8221 {
8222 target = c
8223 });
8224 break;
8225 case "ticket_armpillow":
8226 c.ModAffinity(EClass.pc, 20);
8227 EClass.pc.AddCondition<ConSleep>(300, force: true);
8228 c.SetAI(new AI_ArmPillow
8229 {
8230 target = EClass.pc
8231 });
8232 break;
8233 case "ticket_champagne":
8234 c.ModAffinity(EClass.pc, 10);
8236 break;
8237 }
8238 return;
8239 }
8240 if (t.id == "flyer")
8241 {
8242 stamina.Mod(-1);
8243 if (c.things.Find((Thing a) => a.id == "flyer") != null)
8244 {
8245 c.Talk("flyer_miss");
8246 DoHostileAction(c);
8247 return;
8248 }
8249 if (EClass.rnd(20) != 0 && c.CHA > EClass.rnd(base.CHA + Evalue(291) * 3 + 10))
8250 {
8251 Msg.Say("affinityNone", c, this);
8252 t.Destroy();
8253 elements.ModExp(291, 10f);
8254 return;
8255 }
8256 elements.ModExp(291, 50f);
8257 }
8258 if (t.id == "statue_weird")
8259 {
8260 EClass.pc.Say("statue_sell");
8261 }
8262 t.isGifted = true;
8263 c.nextUse = c.affinity.OnGift(t);
8264 if (!t.isDestroyed)
8265 {
8266 EClass.game.quests.list.ForeachReverse(delegate(Quest q)
8267 {
8268 q.OnGiveItem(c, t);
8269 });
8270 if (c.TryEquip(t))
8271 {
8272 c.nextUse = null;
8273 }
8274 }
8275 }
Thing OnGift(Thing t)
Definition: Affinity.cs:129
int ExpToNext
Definition: Card.cs:2008
bool isCopy
Definition: Card.cs:878
bool IsCursed
Definition: Card.cs:2255
int CHA
Definition: Card.cs:2347
bool IsEquipmentOrRanged
Definition: Card.cs:2218
void SayNothingHappans()
Definition: Card.cs:6776
string c_idRefName
Definition: Card.cs:1641
void AddExp(int a)
Definition: Card.cs:2951
void GiveLovePotion(Chara c, Thing t)
Definition: Chara.cs:8288
bool TryEquip(Thing t, bool useFav=false)
Definition: Chara.cs:7645
void OnGiveErohon(Thing t)
Definition: Chara.cs:8277
QuestManager quests
Definition: Game.cs:182
List< Quest > list
Definition: QuestManager.cs:11
Definition: Quest.cs:7
virtual void OnGiveItem(Chara c, Thing t)
Definition: Quest.cs:536

References AddCondition(), Card.AddExp(), affinity, Card.c_idRefName, Card.CHA, Card.Destroy(), ElementContainer.dict, Card.elements, Card.ExpToNext, ThingContainer.Find(), EClass.game, Card.HasElement(), Card.id, Element.id, Card.IsAmmo, Card.isCopy, Card.IsCursed, IsDeadOrSleeping, Card.isDestroyed, Card.IsEquipmentOrRanged, IsHostile(), 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 8288 of file Chara.cs.

8289 {
8290 c.Say("give_love", c, t);
8291 c.PlaySound(t.material.GetSoundDead());
8292 c.ShowEmo(Emo.angry);
8293 c.ModAffinity(EClass.pc, -20, show: false);
8294 c.Talk("pervert");
8295 t.Destroy();
8296 }

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

6255 {
6256 if (enemy == null && !IsPC)
6257 {
6258 if (GetInt(106) == 0)
6259 {
6260 TalkTopic("aggro");
6261 }
6262 if (OriginalHostility != Hostility.Enemy)
6263 {
6264 ShowEmo(Emo.angry);
6265 }
6266 SetEnemy(_tg.Chara);
6267 }
6269 {
6270 if (hostility >= Hostility.Neutral)
6271 {
6272 Say("angry", this);
6273 }
6274 hostility = Hostility.Enemy;
6275 }
6276 }
int GetInt(int id, int? defaultInt=null)
Definition: BaseCard.cs:25
virtual bool IsPCFactionMinion
Definition: Card.cs:2155

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

1281 {
1282 return HasAccess(c.pos);
1283 }
bool HasAccess(Card c)
Definition: Chara.cs:1280

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

1286 {
1287 if (!EClass._zone.IsPCFaction || p.cell.room == null || IsPC)
1288 {
1289 return true;
1290 }
1291 return p.cell.room.data.accessType switch
1292 {
1293 BaseArea.AccessType.Resident => memberType == FactionMemberType.Default,
1294 BaseArea.AccessType.Private => false,
1295 _ => true,
1296 };
1297 }

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

9318 {
9319 for (int i = 0; i < conditions.Count; i++)
9320 {
9321 if (conditions[i] is T)
9322 {
9323 return true;
9324 }
9325 }
9326 return false;
9327 }

◆ HasCooldown()

bool Chara.HasCooldown ( int  idEle)
inline

Definition at line 8630 of file Chara.cs.

8631 {
8632 return GetCooldown(idEle) != 0;
8633 }
int GetCooldown(int idEle)
Definition: Chara.cs:8635

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

◆ HasHigherGround()

bool Chara.HasHigherGround ( Card  c)
inline

Definition at line 1190 of file Chara.cs.

1191 {
1192 if (c == null)
1193 {
1194 return false;
1195 }
1196 float num = renderer.position.y - pos.Position(0).y + (_isLevitating ? 0.4f : 0f);
1197 float num2 = c.renderer.position.y - c.pos.Position(0).y + ((c.isChara && c.Chara._isLevitating) ? 0.4f : 0f);
1198 return num > num2 + 0.1f;
1199 }
bool _isLevitating
Definition: Chara.cs:134
ref Vector3 Position(int height)
Definition: Point.cs:548

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

8760 {
8761 int num = EClass.sources.hobbies.alias.TryGetValue(alias)?.id ?? 0;
8762 listHobby.Clear();
8763 if (_works == null || _hobbies == null)
8764 {
8765 RerollHobby();
8766 }
8767 foreach (int work in _works)
8768 {
8769 if (work == num)
8770 {
8771 return true;
8772 }
8773 }
8774 foreach (int hobby in _hobbies)
8775 {
8776 if (hobby == num)
8777 {
8778 return true;
8779 }
8780 }
8781 return false;
8782 }
static List< Hobby > listHobby
Definition: Chara.cs:13
void RerollHobby(bool extraSlotChance=true)
Definition: Chara.cs:9022
SourceHobby hobbies

References SourceManager.hobbies, and EClass.sources.

Referenced by AI_Idle.Run().

◆ HasMinion()

bool Chara.HasMinion ( string  id)
inline

Definition at line 2342 of file Chara.cs.

2343 {
2344 foreach (Chara chara in EClass._map.charas)
2345 {
2346 if (chara.c_uidMaster == base.uid)
2347 {
2348 return true;
2349 }
2350 }
2351 return false;
2352 }

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

Referenced by ActEffect.ProcAt().

◆ HealAll()

void Chara.HealAll ( )
inline

Definition at line 1716 of file Chara.cs.

1717 {
1718 Cure(CureType.HealComplete);
1719 base.hp = MaxHP;
1720 mana.value = mana.max;
1721 stamina.value = stamina.max;
1722 Refresh();
1723 }
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 4428 of file Chara.cs.

4429 {
4430 if (held == t || t.isDestroyed || t.Num <= 0)
4431 {
4432 return;
4433 }
4434 if (IsPC && t.isNPCProperty)
4435 {
4436 t.isNPCProperty = false;
4438 pos.TryWitnessCrime(this);
4439 }
4440 PickHeld();
4441 if (t.isChara)
4442 {
4444 {
4445 t.ShowEmo(Emo.love);
4446 }
4447 EClass.player.altHeldPos = t.renderer.data.ForceAltHeldPosition || EClass.rnd(2) == 0;
4448 }
4449 else
4450 {
4451 if (num == -1 || num > t.Num)
4452 {
4453 num = t.Num;
4454 }
4455 if (num < t.Num)
4456 {
4457 t = t.Split(num);
4458 }
4459 }
4460 if (t.GetRootCard() != this)
4461 {
4462 t = Pick(t.Thing, msg: false, tryStack: false);
4463 if (t.GetRootCard() != this)
4464 {
4465 return;
4466 }
4467 }
4468 held = t;
4469 if (held.GetLightRadius() > 0)
4470 {
4472 }
4473 if (IsPC)
4474 {
4476 WidgetHotbar.dirtyCurrentItem = true;
4477 }
4478 }
Thing Split(int a)
Definition: Card.cs:3481
bool isNPCProperty
Definition: Card.cs:554
void RecalculateFOV()
Definition: Card.cs:6341
virtual bool IsAliveInCurrentZone
Definition: Card.cs:2127
int GetLightRadius()
Definition: Card.cs:6388
void PickHeld(bool msg=false)
Definition: Chara.cs:4480
bool TryWitnessCrime(Chara criminal, Chara target=null, int radius=4, Func< Chara, bool > funcWitness=null)
Definition: Point.cs:873

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

9146 {
9147 if (!onDeserialize)
9148 {
9149 _cints[10] = 20;
9150 _cints[11] = 70;
9151 _cints[13] = 70;
9152 _cints[14] = 70;
9153 _cints[15] = 70;
9154 _cints[17] = 0;
9155 _cints[18] = 0;
9156 }
9157 foreach (Condition condition in conditions)
9158 {
9159 condition.SetOwner(this, onDeserialize);
9160 }
9161 }
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 7491 of file Chara.cs.

7492 {
7493 if (t == null)
7494 {
7495 t = FindBestFoodToEat();
7496 }
7497 if (t == null)
7498 {
7499 t = things.Find((Thing a) => CanEat(a, shouldEat: true) && !a.c_isImportant);
7500 }
7501 if (t == null)
7502 {
7503 t = things.Find((Thing a) => CanEat(a) && !a.c_isImportant);
7504 }
7505 if (t != null)
7506 {
7507 Say("eat_start", this, t.Duplicate(1));
7508 if (sound)
7509 {
7510 PlaySound("eat");
7511 }
7512 FoodEffect.Proc(this, t);
7513 }
7514 }
Thing FindBestFoodToEat()
Definition: Chara.cs:7470
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 6508 of file Chara.cs.

6509 {
6510 if (faction == EClass.Home)
6511 {
6512 return homeZone == EClass.game.activeZone;
6513 }
6514 return false;
6515 }
Faction faction
Definition: Chara.cs:427
Zone activeZone
Definition: Game.cs:251

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

◆ IsCriticallyWounded()

bool Chara.IsCriticallyWounded ( bool  includeRide = false)
inline

Definition at line 1177 of file Chara.cs.

1178 {
1179 if (host == null || includeRide)
1180 {
1181 if (Evalue(1421) <= 0)
1182 {
1183 return base.hp < MaxHP / 5;
1184 }
1185 return base.hp + mana.value < (MaxHP + mana.max) / 5;
1186 }
1187 return false;
1188 }

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

2487 {
2488 if (!currentZone.IsRegion && p.IsValid)
2489 {
2490 CellDetail detail = p.detail;
2491 if (detail != null && detail.charas.Count > 0)
2492 {
2493 foreach (Chara chara in p.detail.charas)
2494 {
2495 if (chara.IsHostile(this) || chara.IsHostile() || !chara.trait.CanBePushed)
2496 {
2497 if (cancelAI && EClass.pc.ai is GoalManualMove)
2498 {
2499 EClass.pc.ai.Cancel();
2500 }
2501 return true;
2502 }
2503 }
2504 }
2505 }
2506 return false;
2507 }
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 2386 of file Chara.cs.

2387 {
2388 if (!IsPCPartyMinion)
2389 {
2390 return false;
2391 }
2392 foreach (Quest item in EClass.game.quests.list)
2393 {
2394 if (item is QuestEscort questEscort && questEscort.uidChara == base.uid)
2395 {
2396 return true;
2397 }
2398 }
2399 return false;
2400 }
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 6552 of file Chara.cs.

6553 {
6554 if (base.IsPCFactionOrMinion || IsFriendOrAbove())
6555 {
6557 {
6558 return true;
6559 }
6560 }
6561 else if (IsHostile() && c.IsHostile())
6562 {
6563 return true;
6564 }
6565 return false;
6566 }

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

◆ IsGuest()

◆ IsHomeMember()

◆ IsHostile() [1/2]

◆ IsHostile() [2/2]

bool Chara.IsHostile ( Chara  c)
inline

Definition at line 6460 of file Chara.cs.

6461 {
6462 if (c == null)
6463 {
6464 return false;
6465 }
6466 if (base.IsPCFactionOrMinion)
6467 {
6468 if ((c == EClass.pc.enemy && !c.IsPCFactionOrMinion) || c.hostility <= Hostility.Enemy)
6469 {
6470 return true;
6471 }
6472 }
6473 else
6474 {
6476 {
6477 return true;
6478 }
6479 if (OriginalHostility >= Hostility.Friend)
6480 {
6481 if (hostility <= Hostility.Enemy && c.IsPCFactionOrMinion)
6482 {
6483 return true;
6484 }
6485 if (c.hostility <= Hostility.Enemy && c.OriginalHostility == Hostility.Enemy)
6486 {
6487 return true;
6488 }
6489 }
6490 else if (OriginalHostility <= Hostility.Enemy && (c.IsPCFactionOrMinion || (c.OriginalHostility != Hostility.Enemy && c.hostility >= Hostility.Friend)))
6491 {
6492 return true;
6493 }
6494 }
6495 return false;
6496 }
bool IsCriminal
Definition: Player.cs:1337

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

6523 {
6524 return EClass.game.activeZone == currentZone;
6525 }

Referenced by BaseListPeople.IsDisabled().

◆ IsInSpot< T >()

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

Definition at line 6527 of file Chara.cs.

6527 : TraitSpot
6528 {
6529 foreach (T item in EClass._map.props.installed.traits.List<T>())
6530 {
6531 foreach (Point item2 in item.ListPoints())
6532 {
6533 if (pos.Equals(item2))
6534 {
6535 return true;
6536 }
6537 }
6538 }
6539 return false;
6540 }
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 6498 of file Chara.cs.

6499 {
6500 return hostility == Hostility.Neutral;
6501 }

Referenced by ActPlan._Update().

◆ IsNeutralOrAbove()

bool Chara.IsNeutralOrAbove ( )
inline

◆ IsValidGiftWeight()

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

Definition at line 8099 of file Chara.cs.

8100 {
8101 int num2 = ((!HasElement(1411)) ? 1 : 3);
8102 if (GetBurden(t, num) >= num2)
8103 {
8104 return false;
8105 }
8106 return true;
8107 }
int GetBurden(Card t=null, int num=-1)
Definition: Chara.cs:1800

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

5722 {
5724 {
5725 return;
5726 }
5727 if (t.IsPC)
5728 {
5730 }
5731 if (t.host != null)
5732 {
5733 return;
5734 }
5735 if (t == this)
5736 {
5737 if (!ignoreSelf)
5738 {
5739 Debug.Log(t.pos.GetNearestPoint());
5740 if (TryMove(t.pos.GetNearestPoint()) != MoveResult.Success)
5741 {
5743 }
5744 }
5745 return;
5746 }
5747 if (show)
5748 {
5749 Say("kick", this, t);
5750 }
5751 PlaySound("kick");
5752 if ((t.conSuspend == null || t.conSuspend.uidMachine != 0) && t.trait.CanBePushed && (!t.IsHostile() || EClass.rnd(2) == 0) && !t.noMove && !t.isRestrained)
5753 {
5754 t.MoveByForce(t.pos.GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: true, ignoreCenter: true), this, checkWall && !t.pos.IsBlocked);
5755 }
5756 if (t.conSleep != null)
5757 {
5758 t.conSleep.Kill();
5759 }
5760 if (IsPC && t.IsFriendOrAbove() && !t.IsPCFactionOrMinion && karmaLoss)
5761 {
5763 }
5764 t.PlayEffect("kick");
5765 }
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:5810
ConSuspend conSuspend
Definition: Chara.cs:104
MoveResult TryMove(Point newPoint, bool allowDestroyPath=true)
Definition: Chara.cs:2710
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 5713 of file Chara.cs.

5714 {
5715 foreach (Chara item in p.ListCharas())
5716 {
5717 Kick(item, ignoreSelf, karmaLoss: true, show: true, checkWall);
5718 }
5719 }
List< Chara > ListCharas()
Definition: Point.cs:1171

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

9783 {
9784 List<Element> list = new List<Element>();
9785 foreach (SourceElement.Row item in EClass.sources.elements.rows.Where((SourceElement.Row a) => a.group == "FEAT" && a.cost[0] != -1 && !a.categorySub.IsEmpty()))
9786 {
9788 int num = ((feat.ValueWithoutLink <= 0) ? 1 : (feat.ValueWithoutLink + 1));
9789 if (num <= feat.source.max && !feat.HasTag("class") && !feat.HasTag("hidden") && !feat.HasTag("innate") && (!pet || !feat.HasTag("noPet")) && (showAll || feat.IsPurchaseFeatReqMet(elements)))
9790 {
9791 list.Add(Element.Create(feat.id, num) as Feat);
9792 }
9793 }
9794 return list;
9795 }
int feat
Definition: Card.cs:374
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1105
Definition: FEAT.cs:295

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

8890 {
8891 listHobby.Clear();
8892 if (!useMemberType || memberType != FactionMemberType.Livestock)
8893 {
8894 if (_hobbies == null)
8895 {
8896 RerollHobby();
8897 }
8898 foreach (int hobby in _hobbies)
8899 {
8900 listHobby.Add(new Hobby
8901 {
8902 id = hobby
8903 });
8904 }
8905 }
8906 return listHobby;
8907 }

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

8863 {
8864 listHobby.Clear();
8865 if (useMemberType && memberType == FactionMemberType.Livestock)
8866 {
8867 listHobby.Add(new Hobby
8868 {
8869 id = 45
8870 });
8871 }
8872 else
8873 {
8874 if (_works == null)
8875 {
8876 RerollHobby();
8877 }
8878 foreach (int work in _works)
8879 {
8880 listHobby.Add(new Hobby
8881 {
8882 id = work
8883 });
8884 }
8885 }
8886 return listHobby;
8887 }

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

3525 {
3526 angle = Util.GetAngle(p.x - pos.x, p.z - pos.z);
3527 if (EClass._zone.IsRegion)
3528 {
3529 if (angle > 100f && angle < 170f)
3530 {
3531 base.dir = 2;
3532 }
3533 else if (angle > 170f && angle < 190f)
3534 {
3535 base.dir = 0;
3536 }
3537 else if (angle > 190f || (angle < -10f && angle > -100f))
3538 {
3539 base.dir = 3;
3540 }
3541 else
3542 {
3543 base.dir = 1;
3544 }
3545 angle -= 45f;
3546 }
3547 else if (angle > 170f && angle < 235f)
3548 {
3549 base.dir = 0;
3550 }
3551 else if (angle > 80f && angle < 145f)
3552 {
3553 base.dir = 1;
3554 }
3555 else if (angle > -100f && angle < -35f)
3556 {
3557 base.dir = 3;
3558 }
3559 else if (angle > -10f && angle < 55f)
3560 {
3561 base.dir = 2;
3562 }
3564 }

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

◆ MakeAlly()

void Chara.MakeAlly ( bool  msg = true)
inline

Definition at line 2268 of file Chara.cs.

2269 {
2270 if (IsLocalChara && !base.IsUnique)
2271 {
2272 Debug.Log("Creating Replacement NPC for:" + this);
2274 }
2275 _MakeAlly();
2276 if (msg)
2277 {
2278 EClass.pc.Say("hire", this);
2279 EClass.Sound.Play("good");
2280 }
2281 EClass.pc.party.AddMemeber(this);
2282 if (EClass._zone.IsTown)
2283 {
2285 }
2286 }
Chara CreateReplacement()
Definition: Chara.cs:7933
void _MakeAlly()
Definition: Chara.cs:2288
virtual bool IsTown
Definition: Zone.cs:220
void RefreshListCitizen()
Definition: Zone.cs:3536

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(), ActEffect.Proc(), ActRide.Ride(), DramaOutcome.sister_friend(), ActThrow.Throw(), and Religion.TryGetGift().

◆ MakeBraineCell()

Thing Chara.MakeBraineCell ( )
inline

Definition at line 8078 of file Chara.cs.

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

References DNA.GenerateGene().

◆ MakeGene()

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

Definition at line 8073 of file Chara.cs.

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

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

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

◆ MakeGrave()

void Chara.MakeGrave ( string  lastword)
inline

Definition at line 5171 of file Chara.cs.

5172 {
5173 if (!EClass._zone.IsRegion)
5174 {
5175 List<string> list = new List<string> { "930", "931", "947", "948", "949", "950", "951", "952" };
5176 if (IsPC && EClass.rnd(2) == 0 && EClass.pc.things.Find("letter_will") != null)
5177 {
5178 list = new List<string> { "944", "946", "backerGrave", "backerGrave2" };
5179 }
5180 Thing thing = ThingGen.Create(list.RandomItem());
5181 thing.MakeRefFrom(this);
5182 if (!lastword.IsEmpty())
5183 {
5184 thing.c_note = lastword;
5185 }
5186 thing.isModified = true;
5187 EClass._zone.AddCard(thing, pos).Install();
5188 }
5189 }
Card MakeRefFrom(string id)
Definition: Card.cs:5702

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

2332 {
2333 ReleaseMinion();
2334 Hostility hostility2 = (base.c_originalHostility = (_master.IsPCFaction ? Hostility.Ally : _master.hostility));
2335 this.hostility = hostility2;
2336 base.c_uidMaster = _master.uid;
2337 base.c_minionType = type;
2338 master = _master;
2339 Refresh();
2340 }
int uid
Definition: Card.cs:122

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

2263 {
2264 _MakeAlly();
2265 EClass.pc.party.AddMemeber(this);
2266 }

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

7856 {
7857 if (c == this)
7858 {
7859 return;
7860 }
7861 if (IsPC)
7862 {
7863 c.ModAffinity(EClass.pc, a, show);
7864 }
7865 else
7866 {
7868 {
7869 return;
7870 }
7871 int num = StatsHygiene.GetAffinityMod(EClass.pc.hygiene.GetPhase()) + (HasElement(417) ? 30 : 0) + (EClass.pc.HasCondition<ConSmoking>() ? (-30) : 0);
7872 if (IsPCFaction && homeBranch != null)
7873 {
7874 num += (int)Mathf.Sqrt(homeBranch.Evalue(2117)) * 5;
7875 }
7876 bool flag = a > 0;
7877 if (flag)
7878 {
7879 a = a * num / 100;
7880 if (affinity.GetLunchChance() > EClass.rnd(100) && GetInt(71) >= 0 && GetInt(71) < EClass.world.date.GetRaw())
7881 {
7882 SetInt(71, -1);
7883 }
7884 }
7885 if (show)
7886 {
7887 if (a == 0)
7888 {
7889 if (!showOnlyEmo)
7890 {
7891 Say("affinityNone", this, c);
7892 }
7893 }
7894 else
7895 {
7896 ShowEmo((!flag) ? Emo.angry : Emo.love);
7897 c.ShowEmo(flag ? Emo.love : Emo.sad);
7898 if (!showOnlyEmo)
7899 {
7900 Say(flag ? "affinityPlus" : "affinityMinus", this, c);
7901 }
7902 }
7903 }
7904 if (c.IsPC)
7905 {
7906 a = affinity.Mod(a);
7907 }
7908 }
7909 }
int Mod(int a)
Definition: Affinity.cs:192
int GetLunchChance()
Definition: Affinity.cs:86
Stats hygiene
Definition: Chara.cs:1152
int GetRaw(int offsetHours=0)
Definition: Date.cs:326
int Evalue(int ele)
static int GetAffinityMod(int phase)
Definition: StatsHygiene.cs:19
virtual bool CanChangeAffinity
Definition: Trait.cs:560

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(), DramaManager.ParseLine(), DramaOutcome.revive_pet(), AI_Fuck.Run(), AI_Shear.Run(), and AI_Slaughter.Run().

◆ ModCorruption()

void Chara.ModCorruption ( int  a)
inline

Definition at line 9739 of file Chara.cs.

9740 {
9741 if (a > 0)
9742 {
9743 if (Evalue(962) >= 25 || (ResistLv(962) > 0 && EClass.rnd(ResistLv(962) + 1) != 0))
9744 {
9745 return;
9746 }
9747 int num = Evalue(412);
9748 if (num != 0)
9749 {
9750 float num2 = (float)a * 100f / (float)Mathf.Max(100 + num * 2, 10);
9751 a = (int)num2 + ((EClass.rndf(1f) < num2 % 1f) ? 1 : 0);
9752 }
9753 }
9754 if (a == 0)
9755 {
9756 return;
9757 }
9758 int num3 = (corruption + a) / 100 - corruption / 100;
9759 for (int i = 0; i < Mathf.Abs(num3); i++)
9760 {
9761 if (!MutateRandom((num3 > 0) ? 1 : (-1), 100, ether: true))
9762 {
9763 break;
9764 }
9765 }
9766 corruption += a;
9767 int num4 = 0;
9768 foreach (Element value in elements.dict.Values)
9769 {
9770 if (value.source.category == "ether")
9771 {
9772 num4 += value.Value;
9773 }
9774 }
9775 if (num4 > 0 && IsPC)
9776 {
9777 Tutorial.Reserve("ether");
9778 }
9779 corruption = num4 * 100 + corruption % 100;
9780 }
bool MutateRandom(int vec=0, int tries=100, bool ether=false, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:9898
static float rndf(float a)
Definition: EClass.cs:93

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

9689 {
9690 if (!HasElement(450))
9691 {
9692 long num = bio.height;
9693 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
9694 if (num < 1)
9695 {
9696 num = 1L;
9697 }
9698 if (num > 999999999)
9699 {
9700 num = 999999999L;
9701 }
9702 if (num != bio.height)
9703 {
9704 bio.height = (int)num;
9705 Say((a > 0) ? "height_gain" : "height_lose", this);
9706 }
9707 }
9708 }
int height
Definition: Biography.cs:53

◆ ModTempElement()

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

Definition at line 10151 of file Chara.cs.

10152 {
10153 if (a < 0 && !naturalDecay && HasElement(EClass.sources.elements.alias["sustain_" + EClass.sources.elements.map[ele].alias]?.id ?? 0))
10154 {
10155 return;
10156 }
10157 bool flag = HasElement(1215);
10158 if (tempElements == null)
10159 {
10161 tempElements.SetParent(this);
10162 }
10163 if (a > 0 && flag)
10164 {
10165 a = a * 150 / 100;
10166 }
10167 int num = elements.ValueWithoutLink(ele);
10168 int num2 = Mathf.Abs(num) + 100;
10169 int num3 = num2 / (flag ? 2 : 4);
10170 int num4 = -num - 100;
10171 int num5 = tempElements.Base(ele);
10172 int num6 = num5 + a;
10173 if (onlyRenew)
10174 {
10175 num3 = Mathf.Min(a, num3);
10176 num4 = Mathf.Max(a, -num2 / 3);
10177 }
10178 if (a > 0 && num6 > num3)
10179 {
10180 a = ((num3 > num5) ? (num3 - num5) : 0);
10181 }
10182 if (a < 0 && num6 < num4)
10183 {
10184 a = ((num4 < num5) ? (num4 - num5) : 0);
10185 }
10186 Element element = tempElements.ModBase(ele, a);
10187 if (element.vBase == 0)
10188 {
10189 tempElements.Remove(element.id);
10190 if (tempElements.dict.Count == 0)
10191 {
10192 tempElements = null;
10193 }
10194 }
10195 }
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 9710 of file Chara.cs.

9711 {
9712 if (HasElement(450) || a == 0)
9713 {
9714 return;
9715 }
9716 long num = bio.weight;
9717 long num2 = bio.height;
9718 long num3 = num2 * num2 * 18 / 25000;
9719 long num4 = num2 * num2 * 24 / 10000;
9720 if (ignoreLimit || (num > num3 && num < num4))
9721 {
9722 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
9723 if (num < 1)
9724 {
9725 num = 1L;
9726 }
9727 if (num > 999999999)
9728 {
9729 num = 999999999L;
9730 }
9731 if (num != bio.weight)
9732 {
9733 bio.weight = (int)num;
9734 Say((a > 0) ? "weight_gain" : "weight_lose", this);
9735 }
9736 }
9737 }
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 2600 of file Chara.cs.

2601 {
2602 if (!newPoint.sourceBlock.tileType.IsBlockPass && (!checkWall || (Dist(newPoint) <= 1 && CanMoveTo(newPoint, allowDestroyPath: false))) && _Move(newPoint, MoveType.Force) == MoveResult.Success && ai.Current.CancelWhenMoved)
2603 {
2604 ai.Current.TryCancel(c);
2605 }
2606 }
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:2734

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

3436 {
3437 MoveHome(EClass.game.world.FindZone(id), x, z);
3438 }
void MoveHome(string id, int x=-1, int z=-1)
Definition: Chara.cs:3435
new World world
Definition: Game.cs:176

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

3441 {
3442 if (isDead)
3443 {
3444 Revive();
3445 }
3446 else
3447 {
3448 Cure(CureType.Death);
3449 }
3450 CureCondition<ConSuspend>();
3451 if (IsPCParty)
3452 {
3454 }
3455 FactionBranch factionBranch = homeBranch;
3456 if (x == -1)
3457 {
3458 x = 50;
3459 }
3460 if (z == -1)
3461 {
3462 z = 50;
3463 }
3464 Point point = new Point(x, z);
3465 if (zone.IsActiveZone)
3466 {
3467 point = point.GetNearestPoint(allowBlock: false, allowChara: false);
3468 }
3469 zone.AddCard(this, point);
3470 SetHomeZone(zone);
3471 global.transition = new ZoneTransition
3472 {
3473 state = ZoneTransition.EnterState.Dead,
3474 x = point.x,
3475 z = point.z
3476 };
3477 orgPos = new Point(x, z);
3478 if (factionBranch != null)
3479 {
3481 factionBranch.policies.Validate();
3482 }
3483 }
void RefreshWorkElements(ElementContainer parent=null)
Definition: Chara.cs:8928
Chara SetHomeZone(Zone zone)
Definition: Chara.cs:1427
PolicyManager policies
bool IsActiveZone
Definition: Zone.cs:492

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

2583 {
2584 List<Point> list = new List<Point>();
2585 pos.ForeachNeighbor(delegate(Point p)
2586 {
2587 list.Add(p.Copy());
2588 });
2589 list.Shuffle();
2590 foreach (Point item in list)
2591 {
2592 if (!item.Equals(pos) && !item.HasChara && TryMove(item) == MoveResult.Success)
2593 {
2594 return true;
2595 }
2596 }
2597 return false;
2598 }
void ForeachNeighbor(Action< Point > action, bool diagonal=true)
Definition: Point.cs:1397

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

Referenced by AI_Idle.Run().

◆ MoveRandom()

bool Chara.MoveRandom ( )
inline

Definition at line 2568 of file Chara.cs.

2569 {
2570 Point randomNeighbor = pos.GetRandomNeighbor();
2571 if (!randomNeighbor.Equals(pos) && !randomNeighbor.HasChara && HasAccess(randomNeighbor))
2572 {
2573 if ((race.tag.Contains("water") || source.tag.Contains("water")) && pos.cell.IsTopWaterAndNoSnow && !randomNeighbor.IsDeepWater)
2574 {
2575 return false;
2576 }
2577 return TryMove(randomNeighbor) == MoveResult.Success;
2578 }
2579 return false;
2580 }
bool IsTopWaterAndNoSnow
Definition: Cell.cs:712
bool IsDeepWater
Definition: Point.cs:276

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

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

◆ MoveZone() [1/3]

◆ MoveZone() [2/3]

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

Definition at line 3323 of file Chara.cs.

3324 {
3325 if (z == currentZone)
3326 {
3327 return;
3328 }
3329 if (HasCondition<ConInvulnerable>())
3330 {
3331 RemoveCondition<ConInvulnerable>();
3332 }
3333 if (IsPC)
3334 {
3335 EClass.player.nextZone = z;
3337 {
3340 {
3341 if (EClass.player.returnInfo != null)
3342 {
3343 EClass.player.returnInfo.turns += 5;
3344 }
3346 {
3347 EClass.game.Save(isAutoSave: true);
3348 }
3349 }
3350 EClass.player.deathZoneMove = false;
3351 }
3353 if (currentZone.instance != null)
3354 {
3356 z = EClass.game.spatials.Find(instance.uidZone) ?? EClass.pc.homeZone;
3357 transition = new ZoneTransition
3358 {
3359 state = instance.ReturnState,
3360 x = instance.x,
3361 z = instance.z
3362 };
3363 instance.OnLeaveZone();
3364 Debug.Log(z);
3365 }
3366 EInput.Consume(consumeAxis: true);
3367 EClass.player.uidLastZone = currentZone.uid;
3369 {
3371 {
3372 Msg.Say("enterZone", z.Name);
3373 }
3374 else
3375 {
3376 if (z.IsRegion)
3377 {
3378 Msg.Say("leaveZone", currentZone.Name);
3379 }
3380 else if (z.id != currentZone.id)
3381 {
3382 Msg.Say("enterZone", z.Name);
3383 }
3384 EClass.player.lastZonePos = pos.Copy();
3385 }
3386 EClass.player.lastTransition = transition;
3387 }
3388 foreach (Chara item in EClass._map.charas.Where((Chara c) => c.IsPCPartyMinion && c.master != EClass.pc).ToList())
3389 {
3391 }
3392 EClass.player.listSummon = EClass._map.charas.Where((Chara c) => c.c_uidMaster != 0 && c.FindMaster() == EClass.pc && c.c_minionType == MinionType.Default).ToList();
3393 foreach (Chara item2 in EClass.player.listSummon)
3394 {
3395 EClass._zone.RemoveCard(item2);
3396 }
3397 }
3398 if (party != null && party.leader == this)
3399 {
3400 foreach (Chara member in party.members)
3401 {
3402 if (member != this && !member.isDead && member.parent is Zone)
3403 {
3404 member.MoveZone(z);
3405 }
3406 }
3407 }
3408 if (global == null)
3409 {
3410 Debug.Log(base.Name);
3411 return;
3412 }
3413 transition.uidLastZone = currentZone?.uid ?? 0;
3414 global.transition = transition;
3415 if (z.IsActiveZone)
3416 {
3417 Point spawnPos = z.GetSpawnPos(this);
3418 global.transition = null;
3419 if (IsPC)
3420 {
3421 EClass.player.lastTransition = null;
3422 }
3423 z.AddCard(this, spawnPos);
3424 if (IsBranchMember())
3425 {
3427 }
3428 }
3429 else
3430 {
3431 z.AddCard(this);
3432 }
3433 }
MinionType c_minionType
Definition: Card.cs:988
bool IsBranchMember()
Definition: Chara.cs:6508
GlobalData global
Definition: Chara.cs:76
Chara FindMaster()
Definition: Chara.cs:2377
bool ignoreAutoSave
Definition: CoreDebug.cs:126
bool Save(bool isAutoSave=false, bool silent=false)
Definition: Game.cs:1028
RoomManager rooms
Definition: Map.cs:31
Chara leader
Definition: Party.cs:31
bool deathZoneMove
Definition: Player.cs:1169
List< Chara > listSummon
Definition: Player.cs:1221
ReturnInfo returnInfo
Definition: Player.cs:866
bool simulatingZone
Definition: Player.cs:1179
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:260
Point GetSpawnPos(Chara c, ZoneTransition.EnterState destState=ZoneTransition.EnterState.Auto)
Definition: Zone.cs:1328

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

3316 {
3318 {
3319 state = state
3320 });
3321 }

◆ MutateRandom()

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

Definition at line 9898 of file Chara.cs.

9899 {
9900 if (!ether && vec >= 0 && HasElement(406) && EClass.rnd(5) != 0)
9901 {
9902 Say("resistMutation", this);
9903 return false;
9904 }
9905 IEnumerable<SourceElement.Row> ie = EClass.sources.elements.rows.Where((SourceElement.Row a) => a.category == (ether ? "ether" : "mutation") && !a.tag.Contains("noRandomMutation"));
9906 for (int i = 0; i < tries; i++)
9907 {
9908 SourceElement.Row row = ie.RandomItem();
9909 if (i == 0 && vec < 0 && ether && base.c_corruptionHistory != null && base.c_corruptionHistory.Count > 0)
9910 {
9911 row = EClass.sources.elements.map[base.c_corruptionHistory.LastItem()];
9912 base.c_corruptionHistory.RemoveAt(base.c_corruptionHistory.Count - 1);
9913 if (base.c_corruptionHistory.Count == 0)
9914 {
9915 base.c_corruptionHistory = null;
9916 }
9917 }
9918 Element element = elements.GetElement(row.id);
9919 int num = 1;
9920 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))
9921 {
9922 continue;
9923 }
9924 if (element == null && !row.aliasParent.IsEmpty() && elements.Has(row.aliasParent))
9925 {
9926 row = EClass.sources.elements.alias[row.aliasParent];
9927 element = elements.GetElement(row.id);
9928 }
9929 bool flag = row.tag.Contains("neg");
9930 if (vec > 0)
9931 {
9932 if ((state >= BlessedState.Blessed && flag) || (state <= BlessedState.Cursed && !flag))
9933 {
9934 continue;
9935 }
9936 }
9937 else if (vec < 0 && ((state >= BlessedState.Blessed && !flag) || (state <= BlessedState.Cursed && flag)))
9938 {
9939 continue;
9940 }
9941 bool flag2 = true;
9942 if (element != null)
9943 {
9944 num = element.Value + ((vec != 0) ? vec : ((EClass.rnd(2) == 0) ? 1 : (-1)));
9945 if (num > element.source.max)
9946 {
9947 num = element.source.max - 1;
9948 }
9949 flag = (flag && num > element.Value) || (!flag && num < element.Value);
9950 flag2 = num > element.Value;
9951 if (vec > 0 && !flag2)
9952 {
9953 continue;
9954 }
9955 }
9956 Say(flag2 ? "mutation_gain" : "mutation_loose", this);
9957 SetFeat(row.id, num);
9958 if (flag2 && ether)
9959 {
9960 if (base.c_corruptionHistory == null)
9961 {
9962 base.c_corruptionHistory = new List<int>();
9963 }
9964 base.c_corruptionHistory.Add(row.id);
9965 if (IsPCFaction)
9966 {
9967 Element element2 = elements.GetElement(row.id);
9968 WidgetPopText.Say("popEther".lang(element2.Name, base.Name));
9969 }
9971 {
9972 EClass.player.flags.gotEtherDisease = true;
9973 Thing thing = ThingGen.Create("parchment");
9974 thing.SetStr(53, "letter_ether");
9975 Thing thing2 = ThingGen.Create("1165");
9976 thing2.SetBlessedState(BlessedState.Normal);
9977 Thing p = ThingGen.CreateParcel(null, thing2, thing);
9979 }
9980 }
9981 if (EClass.core.IsGameStarted && pos != null)
9982 {
9983 PlaySound(ether ? "mutation_ether" : "mutation");
9984 PlayEffect("mutation");
9986 Say(row.GetText(flag ? "textDec" : "textInc", returnNull: true) ?? row.alias, this);
9987 }
9988 return true;
9989 }
9990 Say("nothingHappens");
9991 return false;
9992 }
void SetStr(int id, string value=null)
Definition: BaseCard.cs:63
virtual void SetBlessedState(BlessedState s)
Definition: Card.cs:3892
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:467
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 10044 of file Chara.cs.

10045 {
10046 if (_historyFood != null)
10047 {
10048 while (_historyFood.Count > 5)
10049 {
10050 _historyFood.RemoveAt(_historyFood.Count - 1);
10051 }
10052 if (_historyFood[0].Count > 0)
10053 {
10054 _historyFood.Insert(0, new List<string>());
10055 }
10056 }
10057 }

Referenced by GameDate.AdvanceDay().

◆ OnBanish()

void Chara.OnBanish ( )
inline

Definition at line 1441 of file Chara.cs.

1442 {
1443 if (!IsGlobal)
1444 {
1445 return;
1446 }
1447 memberType = FactionMemberType.Default;
1448 foreach (Thing item in things.List((Thing a) => a.HasTag(CTAG.godArtifact)).ToList())
1449 {
1451 }
1452 UniqueData uniqueData = base.c_uniqueData;
1453 if (uniqueData != null)
1454 {
1455 Debug.Log(uniqueData.uidZone + "/" + EClass.game.spatials.map.ContainsKey(uniqueData.uidZone) + "/" + uniqueData.x + "/" + uniqueData.y);
1456 }
1457 if (uniqueData != null && EClass.game.spatials.map.ContainsKey(uniqueData.uidZone))
1458 {
1459 MoveHome(EClass.game.spatials.map[uniqueData.uidZone] as Zone, uniqueData.x, uniqueData.y);
1460 return;
1461 }
1462 Zone z = EClass.game.spatials.Find("somewhere");
1463 if (trait is TraitAdventurer)
1464 {
1465 z = EClass.world.region.ListTowns().RandomItem();
1466 SetHomeZone(z);
1467 }
1468 MoveZone(z, ZoneTransition.EnterState.RandomVisit);
1469 }
void PickOrDrop(Point p, string idThing, int idMat=-1, int num=1, bool msg=true)
Definition: Chara.cs:4244
List< Zone > ListTowns()
Definition: Region.cs:270
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 1508 of file Chara.cs.

1509 {
1510 if (source.job == "*r")
1511 {
1512 base.c_idJob = EClass.sources.jobs.rows.Where((SourceJob.Row j) => j.playable < 4).RandomItem().id;
1513 }
1514 if (bp.idJob != null)
1515 {
1516 base.c_idJob = bp.idJob;
1517 }
1518 if (bp.idRace != null)
1519 {
1520 base.c_idRace = bp.idRace;
1521 }
1522 }
CardBlueprint bp
Definition: Card.cs:77
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 1524 of file Chara.cs.

1525 {
1526 if (source.tag.Contains("boss"))
1527 {
1528 bossText = true;
1529 }
1530 int num = ((bp.lv != -999) ? bp.lv : base.LV);
1531 if (trait.AdvType == TraitChara.Adv_Type.Adv || trait.AdvType == TraitChara.Adv_Type.Adv_Fairy)
1532 {
1533 if (ListAdvRace.Count == 0)
1534 {
1535 ListAdvRace = EClass.sources.races.rows.Where((SourceRace.Row a) => a.playable <= 1 && a.id != "fairy").ToList();
1536 ListAdvJob = EClass.sources.jobs.rows.Where((SourceJob.Row a) => a.playable <= 4).ToList();
1537 }
1538 if (trait.AdvType == TraitChara.Adv_Type.Adv)
1539 {
1540 base.c_idRace = ListAdvRace.RandomItem().id;
1541 }
1542 base.c_idJob = ListAdvJob.RandomItem().id;
1543 _race = null;
1544 _job = null;
1545 num = 10 + EClass.rnd(40);
1546 }
1547 bio = new Biography();
1548 bio.Generate(this);
1549 if (source.idActor.Length != 0 && source.idActor[0] == "pcc" && pccData == null)
1550 {
1551 pccData = PCCData.Create(IDPCCBodySet);
1552 if (source.idActor.Length > 2)
1553 {
1554 pccData.SetPart("body", IDPCCBodySet, source.idActor[2]);
1555 }
1556 else
1557 {
1558 pccData.Randomize(IDPCCBodySet);
1559 }
1560 }
1561 if (source.mainElement.Length != 0)
1562 {
1563 int _genLv = Mathf.Min(genLv, 100);
1564 List<Tuple<string, int, int>> list = new List<Tuple<string, int, int>>();
1565 string[] mainElement = source.mainElement;
1566 for (int i = 0; i < mainElement.Length; i++)
1567 {
1568 string[] array = mainElement[i].Split('/');
1569 SourceElement.Row row = EClass.sources.elements.alias["ele" + array[0]];
1570 int num2 = source.LV * row.eleP / 100;
1571 if (list.Count == 0 || num2 < _genLv || array[0] == bp.idEle)
1572 {
1573 list.Add(new Tuple<string, int, int>(array[0], (array.Length > 1) ? int.Parse(array[1]) : 0, num2));
1574 }
1575 }
1576 Tuple<string, int, int> tuple = list.RandomItemWeighted((Tuple<string, int, int> a) => 10000 / (100 + (_genLv - a.Item3) * 25));
1577 if (!bp.idEle.IsEmpty())
1578 {
1579 tuple = list.Where((Tuple<string, int, int> a) => a.Item1 == bp.idEle || "ele" + a.Item1 == bp.idEle).FirstOrDefault() ?? tuple;
1580 }
1581 SetMainElement(tuple.Item1, (tuple.Item2 == 0) ? 10 : tuple.Item2, elemental: true);
1582 if (list.Count >= 2)
1583 {
1584 num = tuple.Item3 + base.LV - source.LV;
1585 }
1586 }
1587 if (source.name == "*r")
1588 {
1589 base.c_altName = NameGen.getRandomName();
1590 }
1591 if (source.GetText("aka") == "*r" || trait.UseRandomAlias)
1592 {
1593 _alias = AliasGen.GetRandomAlias();
1594 }
1595 happiness = EClass.rnd(100);
1596 contribution = EClass.rnd(100);
1597 RerollHobby();
1598 _idTimeTable = ((EClass.rnd(5) == 0) ? 1 : 0);
1599 ApplyRace();
1600 ApplyJob();
1601 ChangeMaterial(source.defMat.IsEmpty(race.material), ignoreFixedMaterial: true);
1602 if (num != source.LV)
1603 {
1604 SetLv(num);
1605 }
1606 if (base.LV > 5 && race.id == "mutant")
1607 {
1608 for (int j = 0; j < Mathf.Min(1 + base.LV / 5, 22); j++)
1609 {
1610 SetFeat(1644, j + 1);
1611 }
1612 }
1613 switch (id)
1614 {
1615 case "putty_mech_b":
1616 case "putty_mech":
1617 case "robot":
1618 SetFeat(1248, 1 + EClass.rnd(5));
1619 break;
1620 }
1621 InitStats();
1622 body.SetOwner(this);
1624 if (race.EQ.Length != 0 || !source.equip.IsEmpty())
1625 {
1626 TryRestock(onCreate: true);
1627 }
1628 switch (id)
1629 {
1630 case "dodo":
1631 base.idSkin = EClass.rnd(4);
1632 break;
1633 case "putty_snow":
1634 if (EClass.rnd(100) == 0 || EClass.debug.enable)
1635 {
1636 base.idSkin = EClass.rnd(4);
1637 }
1638 break;
1639 case "snail":
1640 base.idSkin = 5;
1641 break;
1642 case "olderyoungersister":
1643 base.idSkin = 1;
1644 break;
1645 case "sister_undead":
1646 case "dog":
1647 case "cat":
1648 base.idSkin = EClass.rnd(sourceCard.tiles.Length);
1649 if (id == "sister_undead" && EClass.rnd(10) == 0)
1650 {
1652 if (row2 != null && (!EClass.player.doneBackers.Contains(row2.id) || EClass.core.config.test.ignoreBackerDestoryFlag))
1653 {
1654 ApplyBacker(row2.id);
1655 }
1656 }
1657 break;
1658 case "baby":
1659 case "ika":
1660 SetFeat(1232, 3);
1661 break;
1662 }
1663 if (HasTag(CTAG.random_color))
1664 {
1665 DyeRandom();
1666 }
1667 SetAI(new NoGoal());
1668 if (!source.faith.IsEmpty())
1669 {
1670 SetFaith(source.faith);
1671 }
1672 else if (EClass.game.activeZone != null && EClass.game.activeZone.id == "foxtown")
1673 {
1675 }
1676 else if (EClass.game.activeZone != null && EClass.game.activeZone.id == "foxtown_nefu")
1677 {
1679 }
1680 else
1681 {
1682 SetFaith(EClass.game.religions.GetRandomReligion(onlyJoinable: true, EClass.rnd(10) == 0));
1683 }
1684 _affinity = 0;
1685 interest = 100;
1688 Refresh();
1689 stamina.value = stamina.max;
1690 mana.value = mana.max;
1691 isCreated = true;
1692 }
static int indexSister
void Generate(Chara c)
Definition: Biography.cs:323
void ClampInitialSkill()
Definition: Card.cs:2943
void DyeRandom()
Definition: Card.cs:5970
void ApplyBacker(int bid)
Definition: Card.cs:6957
int genLv
Definition: Card.cs:194
void SetOwner(Chara chara, bool deserialized=false)
Definition: CharaBody.cs:18
string IDPCCBodySet
Definition: Chara.cs:491
int _affinity
Definition: Chara.cs:303
void SetMainElement(string id, int v=0, bool elemental=false)
Definition: Chara.cs:2067
int happiness
Definition: Chara.cs:108
int contribution
Definition: Chara.cs:18
void CalculateMaxStamina()
Definition: Chara.cs:1999
bool isCreated
Definition: Chara.cs:136
int _idTimeTable
Definition: Chara.cs:341
void TryRestock(bool onCreate)
Definition: Chara.cs:4639
static List< SourceRace.Row > ListAdvRace
Definition: Chara.cs:166
void InitStats(bool onDeserialize=false)
Definition: Chara.cs:9145
bool bossText
Definition: Chara.cs:144
static List< SourceJob.Row > ListAdvJob
Definition: Chara.cs:168
bool ignoreBackerDestoryFlag
Definition: CoreConfig.cs:562
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(), Card.genLv, ReligionManager.GetRandomReligion(), happiness, Card.HasTag(), hostility, SourceBacker.Row.id, Spatial.id, CardBlueprint.idEle, IDPCCBodySet, CoreConfig.Test.ignoreBackerDestoryFlag, BackerContent.indexSister, InitStats(), interest, isCreated, SourceManager.jobs, ListAdvJob, ListAdvRace, SourceBacker.listSister, CardBlueprint.lv, mana, Stats.max, ReligionManager.MoonShadow, OriginalHostility, pccData, EClass.player, race, SourceManager.races, Refresh(), Game.religions, RerollHobby(), EClass.rnd(), SetAI(), SetFaith(), SetFeat(), Card.SetLv(), SetMainElement(), CharaBody.SetOwner(), source, sourceCard, EClass.sources, stamina, CoreConfig.test, RenderRow.tiles, trait, ReligionManager.Trickery, TryRestock(), and TraitChara.UseRandomAlias.

◆ OnDeserialized()

override void Chara.OnDeserialized ( )
inlineprotectedvirtual

Reimplemented from Card.

Definition at line 1327 of file Chara.cs.

1328 {
1329 isCreated = true;
1330 _cbits1.Bits = (uint)_cints[0];
1331 InitStats(onDeserialize: true);
1332 body.SetOwner(this, deserialized: true);
1333 elements.ApplyElementMap(base.uid, SourceValueType.Chara, job.elementMap, base.DefaultLV);
1334 elements.ApplyElementMap(base.uid, SourceValueType.Chara, race.elementMap, base.DefaultLV);
1335 if (global != null && global.goal != null)
1336 {
1337 global.goal.SetOwner(this);
1338 }
1339 if (IsPCC)
1340 {
1341 pccData.state = (base.isCensored ? PCCState.Naked : PCCState.Normal);
1342 }
1343 if (tempElements != null)
1344 {
1345 tempElements.SetParent(this);
1346 }
1347 UpdateAngle();
1349 Refresh();
1350 if (source.tag.Contains("boss"))
1351 {
1352 bossText = true;
1353 }
1354 sharedCheckTurn = EClass.rnd(200);
1355 }
int sharedCheckTurn
Definition: Chara.cs:118
void UpdateAngle()
Definition: Chara.cs:3566
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 8277 of file Chara.cs.

8278 {
8279 Say("give_erohon", this);
8280 AddCondition<ConParalyze>(50, force: true);
8281 AddCondition<ConConfuse>(50, force: true);
8282 AddCondition<ConFear>(1000, force: true);
8283 ModAffinity(EClass.pc, 100);
8284 t.Destroy();
8285 Talk("pervert");
8286 }

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

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

◆ OnInsulted()

void Chara.OnInsulted ( )
inline

Definition at line 8083 of file Chara.cs.

8084 {
8085 if (!isDead)
8086 {
8087 if (HasElement(1231))
8088 {
8089 Talk("insulted");
8090 AddCondition<ConEuphoric>(100 * Evalue(1231));
8091 }
8092 else if (EClass.rnd(20) == 0)
8093 {
8094 SetFeat(1231, 1, msg: true);
8095 }
8096 }
8097 }

References EClass.rnd().

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

◆ OnSerializing()

override void Chara.OnSerializing ( )
inlineprotectedvirtual

Reimplemented from Card.

Definition at line 1312 of file Chara.cs.

1313 {
1314 if (enemy != null)
1315 {
1316 SetInt(55, enemy.uid);
1317 }
1318 _cints[0] = (int)_cbits1.Bits;
1319 List<BodySlot> slots = body.slots;
1320 rawSlots = new int[slots.Count];
1321 for (int i = 0; i < slots.Count; i++)
1322 {
1323 rawSlots[i] = slots[i].elementId;
1324 }
1325 }
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,
bool  isSunLit = false 
)
inline

Definition at line 9650 of file Chara.cs.

9651 {
9652 if (days < 1)
9653 {
9654 days = 1;
9655 }
9656 int num = power * days;
9657 if (stamina.value < 0)
9658 {
9659 stamina.Set(1);
9660 }
9661 if (isWeakToSunlight && isSunLit)
9662 {
9663 base.hp = 0;
9664 if (mana.value > 0)
9665 {
9666 mana.Set(0);
9667 }
9668 AddCondition<ConBurning>(1000, force: true);
9669 }
9670 else
9671 {
9672 HealHP(num);
9673 stamina.Mod(10 + 25 * num / 100 * (100 + elements.GetFeatRef(1642)) / 100);
9674 mana.Mod(num);
9675 }
9676 if (IsPCFaction)
9677 {
9678 hunger.Mod(20);
9679 }
9680 sleepiness.Set(0);
9681 if (!IsMinion)
9682 {
9683 interest = 100;
9684 }
9685 Cure(CureType.Sleep, power);
9686 }
virtual void HealHP(int a, HealSource origin=HealSource.None)
Definition: Card.cs:4000
bool isWeakToSunlight
Definition: Chara.cs:152
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 9630 of file Chara.cs.

9631 {
9632 bool isSunLit = pos.IsSunLit;
9633 TraitPillow traitPillow = pos.FindThing<TraitPillow>();
9634 int num = bed?.Power ?? 20;
9635 if (traitPillow != null)
9636 {
9637 num += traitPillow.owner.Power / 2;
9638 }
9639 if (bed != null)
9640 {
9641 num += bed.Evalue(750) * 5;
9642 if (bed.trait is TraitBedCoffin)
9643 {
9644 isSunLit = false;
9645 }
9646 }
9647 OnSleep(num, days, isSunLit);
9648 }
void OnSleep(Thing bed=null, int days=1)
Definition: Chara.cs:9630
bool IsSunLit
Definition: Point.cs:182
Thing FindThing(Func< Thing, bool > func)
Definition: Point.cs:1140

References bed.

Referenced by LayerSleep.Advance().

◆ ParseBodySlot()

int Chara.ParseBodySlot ( string  s)
inlineprivate

Definition at line 2166 of file Chara.cs.

2167 {
2168 return s switch
2169 {
2170 "é ­" => 30,
2171 "首" => 31,
2172 "体" => 32,
2173 "背" => 33,
2174 "手" => 35,
2175 "指" => 36,
2176 "è…•" => 34,
2177 "è…°" => 37,
2178 "è¶³" => 39,
2179 _ => -1,
2180 };
2181 }

Referenced by ApplyRace(), and ResetBody().

◆ PerformWork()

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

Definition at line 9103 of file Chara.cs.

9104 {
9105 Hobby hobby = new Hobby();
9106 hobby.id = session.id;
9107 WorkSummary workSummary = _workSummary;
9108 hobby.GetAI(this).OnPerformWork(IsRealTime);
9109 if (!isHobby)
9110 {
9111 workSummary.progress += EClass.rnd(5) + 5;
9112 }
9113 int num = PerformWork(hobby, 0, isHobby);
9114 int num2 = PerformWork(hobby, 1, isHobby);
9115 int num3 = PerformWork(hobby, 2, isHobby);
9116 int num4 = PerformWork(hobby, 3, isHobby);
9117 workSummary.money += num;
9118 workSummary.food += num2;
9119 workSummary.knowledge += num3;
9120 workSummary.material += num4;
9121 int PerformWork(Hobby work, int idx, bool isHobby)
9122 {
9123 if (idx >= work.source.resources.Length)
9124 {
9125 return 0;
9126 }
9127 int num5 = work.source.resources[idx];
9128 int num6 = num5;
9129 num5 = Rand.Range(num5 * (100 - work.source.resources[idx]) / 100, num5);
9130 num5 = num5 * (isHobby ? 50 : 100) * session.efficiency / 10000;
9131 if (num6 > 0 && num5 <= 0)
9132 {
9133 num5 = 1;
9134 }
9135 return num5;
9136 }
9137 }
virtual void OnPerformWork(bool realtime)
Definition: AIWork.cs:150
void PerformWork(WorkSession session, bool isHobby=false, bool IsRealTime=false)
Definition: Chara.cs:9103
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 4264 of file Chara.cs.

4265 {
4266 if (t.trait is TraitCard && t.isNew && EClass.game.config.autoCollectCard && !t.c_idRefCard.IsEmpty())
4267 {
4269 return t;
4270 }
4271 if (t.parent == this)
4272 {
4273 return t;
4274 }
4275 t = TryPoisonPotion(t);
4276 ThingContainer.DestData dest = things.GetDest(t, tryStack);
4277 if (!dest.IsValid)
4278 {
4279 if (t.parent != EClass._zone)
4280 {
4281 if (IsPC)
4282 {
4283 Say("backpack_full_drop", t);
4284 SE.Drop();
4285 }
4286 return EClass._zone.AddCard(t, pos).Thing;
4287 }
4288 if (IsPC)
4289 {
4290 Say("backpack_full", t);
4291 }
4292 return t;
4293 }
4294 if (dest.stack != null)
4295 {
4296 if (msg)
4297 {
4298 PlaySound("pick_thing");
4299 Say("pick_thing", this, t);
4300 }
4301 t.TryStackTo(dest.stack);
4302 return dest.stack;
4303 }
4304 TryAbsorbRod(t);
4305 if (msg)
4306 {
4307 PlaySound("pick_thing");
4308 Say("pick_thing", this, t);
4309 }
4311 return dest.container.AddThing(t, tryStack);
4312 }
bool isNew
Definition: Card.cs:482
bool TryStackTo(Thing to)
Definition: Card.cs:3394
string c_idRefCard
Definition: Card.cs:1737
void TryReservePickupTutorial(Thing t)
Definition: Chara.cs:4358
Thing TryPoisonPotion(Thing t)
Definition: Chara.cs:4314
void TryAbsorbRod(Thing t)
Definition: Chara.cs:4328
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(), 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 4480 of file Chara.cs.

4481 {
4482 if (held == null)
4483 {
4484 return;
4485 }
4486 Card card = held;
4487 if (IsPC && held.invY == 1)
4488 {
4489 WidgetHotbar.dirtyCurrentItem = true;
4491 held = null;
4492 return;
4493 }
4494 if (held.isChara)
4495 {
4496 DropHeld();
4497 return;
4498 }
4500 {
4501 Say("canOnlyCarry", held);
4502 DropHeld();
4503 return;
4504 }
4505 bool flag = held != things.TryStack(held.Thing);
4506 if (!flag && things.IsOverflowing())
4507 {
4508 if (IsPC)
4509 {
4510 Say("backpack_full_drop", held);
4511 SE.Drop();
4512 }
4513 DropHeld();
4514 return;
4515 }
4516 if (msg)
4517 {
4518 PlaySound("pick_thing");
4519 Say("pick_held", this, card);
4520 if (IsPC && card.id == "statue_weird")
4521 {
4522 Say("statue_pick");
4523 }
4524 }
4525 if (IsPC)
4526 {
4527 WidgetHotbar.dirtyCurrentItem = true;
4528 if (!flag)
4529 {
4531 if (held.GetRootCard() != EClass.pc)
4532 {
4533 Pick(held.Thing, msg: false);
4534 }
4535 }
4536 }
4537 held = null;
4538 }
int invY
Definition: Card.cs:1955
bool IsHotItem
Definition: Card.cs:119
Card DropHeld(Point dropPos=null)
Definition: Chara.cs:4557
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 4244 of file Chara.cs.

4245 {
4246 if (num != 0)
4247 {
4248 PickOrDrop(p, ThingGen.Create(idThing, idMat).SetNum(num), msg);
4249 }
4250 }

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

4253 {
4254 if (things.GetDest(t).IsValid)
4255 {
4256 Pick(t, msg);
4257 }
4258 else
4259 {
4260 EClass._zone.AddCard(t, p);
4261 }
4262 }

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

◆ Refresh()

void Chara.Refresh ( bool  calledRecursive = false)
inline

Definition at line 1725 of file Chara.cs.

1726 {
1727 if (source == null)
1728 {
1729 Debug.LogError("source is null");
1730 SetSource();
1731 }
1732 if (ride != null && ride.source != null)
1733 {
1734 ride.Refresh(calledRecursive: true);
1735 }
1736 hasTelepathy = false;
1737 isWet = false;
1738 _isLevitating = HasElement(401) || (ride != null && ride._isLevitating);
1740 isWeakToSunlight = HasElement(1251) && !HasElement(431);
1741 base.isHidden = HasElement(415);
1742 foreach (Condition condition in conditions)
1743 {
1744 condition.OnRefresh();
1745 }
1746 if (isWet)
1747 {
1748 base.isHidden = false;
1749 }
1751 SetDirtySpeed();
1752 if (host != null && !calledRecursive && host.source != null)
1753 {
1754 host.Refresh(calledRecursive: true);
1755 }
1756 }
virtual void OnRefresh()
void Refresh(bool calledRecursive=false)
Definition: Chara.cs:1725
bool isWet
Definition: Chara.cs:142
override void SetSource()
Definition: Chara.cs:2055
bool IsUndead
Definition: Chara.cs:891
bool IsHorror
Definition: Chara.cs:915
bool IsMachine
Definition: Chara.cs:903

References _isLevitating, canSeeInvisible, conditions, Debug, Card.HasElement(), hasTelepathy, host, IsHorror, IsMachine, IsMultisize, IsUndead, isWeakToSunlight, 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 10108 of file Chara.cs.

10109 {
10110 if (faithElements != null)
10111 {
10113 }
10115 if (idFaith == "eyth" && !HasElement(1228))
10116 {
10117 return;
10118 }
10119 SourceReligion.Row row = EClass.sources.religions.map.TryGetValue(idFaith);
10120 if (row == null)
10121 {
10122 return;
10123 }
10125 if (!HasCondition<ConExcommunication>())
10126 {
10127 SourceElement.Row row2 = EClass.sources.elements.alias.TryGetValue("featGod_" + row.id + "1");
10128 if (row2 != null)
10129 {
10130 faithElements.SetBase(row2.id, 1);
10131 }
10132 int[] array = row.elements;
10133 int num = GetPietyValue() * (120 + Evalue(1407) * 15 + Evalue(1228) * 20) / 100;
10134 for (int i = 0; i < array.Length; i += 2)
10135 {
10136 int num2 = array[i + 1] * num / 50;
10137 if (array[i] == 79)
10138 {
10139 num2 = EClass.curve(num2, array[i + 1] * 2, 10, 50);
10140 }
10141 if (num2 >= 20 && array[i] >= 950 && array[i] < 970)
10142 {
10143 num2 = 20;
10144 }
10145 faithElements.SetBase(array[i], Mathf.Max(num2, 1));
10146 }
10147 }
10149 }
string idFaith
Definition: Chara.cs:231
ElementContainer faithElements
Definition: Chara.cs:38
int GetPietyValue()
Definition: Chara.cs:10099
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 1860 of file Chara.cs.

1861 {
1862 if (ride != null && !ride.IsDeadOrSleeping)
1863 {
1865 _Speed = ride._Speed;
1866 info?.AddText("rideSpeed".lang(_Speed.ToString() ?? ""));
1867 }
1868 else if (host != null)
1869 {
1870 if (host.ride == this)
1871 {
1872 _Speed = Evalue(79);
1873 _Speed = _Speed * 100 / Mathf.Clamp(100 + (int)_Speed * ((!race.tag.Contains("noRide")) ? 1 : 5) - base.STR - host.EvalueRiding() * 2 - (race.tag.Contains("ride") ? 50 : 0), 100, 1000);
1874 }
1875 else
1876 {
1877 _Speed = (Evalue(79) + host.Evalue(79)) / 2;
1878 }
1879 }
1880 else
1881 {
1882 _Speed = Evalue(79) + Evalue(407) / 2;
1883 }
1884 if (body.GetSlot(37, onlyEmpty: false)?.thing != null && HasElement(1209) && !HasElement(419))
1885 {
1886 _Speed -= 25L;
1887 info?.AddText(-25L, EClass.sources.elements.map[1209].GetName());
1888 }
1889 if (parasite != null)
1890 {
1891 long speed = _Speed;
1892 _Speed = _Speed * 100 / Mathf.Clamp(120 + parasite.LV * 2 - base.STR - Evalue(227) * 2, 100, 1000);
1893 info?.AddText(_Speed - speed, "parasiteSpeed".lang());
1894 }
1895 if (_Speed < elements.ValueWithoutLink(79) / 3)
1896 {
1898 info?.AddText("minSpeed".lang((elements.ValueWithoutLink(79) / 3).ToString() ?? ""));
1899 }
1900 int num = 100;
1901 if (EClass._zone.map != null && EClass._zone.IsUnderwater)
1902 {
1903 int num2 = Evalue(200);
1904 num = 50 + Mathf.Clamp((int)Mathf.Sqrt(num2) * 5 - EClass._zone.DangerLv / 50, 0, 50) + Mathf.Clamp((int)Mathf.Sqrt(num2), 0, 25);
1905 if (info != null && num != 100)
1906 {
1907 info.AddFix(num - 100, EClass.sources.elements.map[200].GetName().ToTitleCase());
1908 }
1909 }
1910 if (IsPCFaction)
1911 {
1912 switch (burden.GetPhase())
1913 {
1914 case 1:
1915 num -= 10;
1916 info?.AddFix(-10, burden.GetPhaseStr());
1917 break;
1918 case 2:
1919 num -= 20;
1920 info?.AddFix(-20, burden.GetPhaseStr());
1921 break;
1922 case 3:
1923 num -= 30;
1924 info?.AddFix(-30, burden.GetPhaseStr());
1925 break;
1926 case 4:
1927 num -= (IsPC ? 50 : 100);
1928 info?.AddFix(IsPC ? (-50) : (-100), burden.GetPhaseStr());
1929 break;
1930 }
1931 if (IsPC)
1932 {
1933 switch (stamina.GetPhase())
1934 {
1935 case 1:
1936 num -= 10;
1937 info?.AddFix(-10, stamina.GetPhaseStr());
1938 break;
1939 case 0:
1940 num -= 20;
1941 info?.AddFix(-20, stamina.GetPhaseStr());
1942 break;
1943 }
1944 switch (sleepiness.GetPhase())
1945 {
1946 case 2:
1947 num -= 10;
1948 info?.AddFix(-10, sleepiness.GetPhaseStr());
1949 break;
1950 case 3:
1951 num -= 20;
1952 info?.AddFix(-20, sleepiness.GetPhaseStr());
1953 break;
1954 }
1955 switch (hunger.GetPhase())
1956 {
1957 case 3:
1958 case 4:
1959 num -= 10;
1960 info?.AddFix(-10, hunger.GetPhaseStr());
1961 break;
1962 case 5:
1963 num -= 30;
1964 info?.AddFix(-30, hunger.GetPhaseStr());
1965 break;
1966 }
1967 num += EClass.player.lastEmptyAlly * Evalue(1646);
1968 info?.AddFix(EClass.player.lastEmptyAlly * Evalue(1646), EClass.sources.elements.map[1646].GetName());
1969 }
1971 {
1972 num += EClass.player.lastEmptyAlly * 10 - 10;
1973 info?.AddFix(EClass.player.lastEmptyAlly * 10 - 10, "exceedParty".lang());
1974 }
1975 }
1976 else if (base.LV >= 1000 && !EClass.game.principal.disableVoidBlessing && !base.IsPCFactionOrMinion)
1977 {
1978 num += EClass.curve((base.LV - 900) / 100 * 10, 500, 100);
1979 info?.AddFix(EClass.curve((base.LV - 900) / 100 * 10, 500, 100), "enemySpeedBuff".lang());
1980 }
1981 if (HasCondition<ConGravity>())
1982 {
1983 num -= 30;
1984 info?.AddFix(-30, GetCondition<ConGravity>().Name);
1985 }
1986 if (_Speed < 10)
1987 {
1988 _Speed = 10L;
1989 }
1990 _Speed = _Speed * num / 100;
1991 if (_Speed < 10)
1992 {
1993 _Speed = 10L;
1994 info?.AddText("minSpeed".lang(10.ToString() ?? ""));
1995 }
1996 dirtySpeed = false;
1997 }
Thing thing
Definition: BodySlot.cs:8
override string ToString()
Definition: Chara.cs:1172
void RefreshSpeed(Element.BonusInfo info=null)
Definition: Chara.cs:1860
bool dirtySpeed
Definition: Chara.cs:170
long _Speed
Definition: Chara.cs:172
void AddText(string text, FontColor col=FontColor.Warning)
Definition: ELEMENT.cs:111
void AddFix(int v, string text)
Definition: ELEMENT.cs:132
bool disableVoidBlessing
int lastEmptyAlly
Definition: Player.cs:1193
virtual bool IsUnderwater
Definition: Zone.cs:266

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

8929 {
8930 if (workElements != null)
8931 {
8933 }
8934 workElements = null;
8935 if (IsPCParty || homeBranch == null || homeBranch.owner == null)
8936 {
8937 return;
8938 }
8939 foreach (Hobby item in ListHobbies())
8940 {
8941 TryAdd(item);
8942 }
8943 foreach (Hobby item2 in ListWorks())
8944 {
8945 TryAdd(item2);
8946 }
8947 if (workElements != null)
8948 {
8950 }
8951 void TryAdd(Hobby h)
8952 {
8953 if (!h.source.elements.IsEmpty())
8954 {
8955 if (workElements == null)
8956 {
8958 }
8959 for (int i = 0; i < h.source.elements.Length; i += 2)
8960 {
8961 int num = h.source.elements[i];
8962 int num2 = h.source.elements[i + 1];
8963 int num3 = 100;
8964 if (num != 2115 && num != 2207)
8965 {
8966 num3 = h.GetEfficiency(this) * homeBranch.efficiency / 100;
8967 if (num3 <= 0)
8968 {
8969 continue;
8970 }
8971 }
8972 workElements.ModBase(num, (num2 < 0) ? (num2 / 10) : Mathf.Max(1, h.source.elements[i + 1] * num3 / 1000));
8973 }
8974 }
8975 }
8976 }
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 2354 of file Chara.cs.

2355 {
2356 base.c_uidMaster = 0;
2357 master = null;
2358 enemy = null;
2359 foreach (Chara chara in EClass._map.charas)
2360 {
2361 if (chara.enemy == this)
2362 {
2363 chara.SetEnemy();
2364 chara.ai.Cancel();
2365 }
2366 }
2367 ai.Cancel();
2368 Refresh();
2369 }

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

9536 {
9537 for (int num = conditions.Count - 1; num >= 0; num--)
9538 {
9539 Condition condition = conditions[num];
9540 if (condition.Type == ConditionType.Stance)
9541 {
9542 condition.Kill();
9543 }
9544 }
9545 }

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

◆ RemoveCondition< T >()

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

Definition at line 9396 of file Chara.cs.

9396 : Condition
9397 {
9398 for (int num = conditions.Count - 1; num >= 0; num--)
9399 {
9400 if (conditions[num] is T)
9401 {
9402 conditions[num].Kill();
9403 break;
9404 }
9405 }
9406 }

References Condition.Kill().

◆ RemoveGlobal()

void Chara.RemoveGlobal ( )
inline

Definition at line 1499 of file Chara.cs.

1500 {
1501 if (IsGlobal)
1502 {
1503 global = null;
1505 }
1506 }

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

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

◆ RemoveLastBodyPart()

void Chara.RemoveLastBodyPart ( bool  msg = false)
inline

Definition at line 2194 of file Chara.cs.

2195 {
2196 if (body.slots.Count != 0)
2197 {
2198 BodySlot bodySlot = body.slots.LastItem();
2199 body.RemoveBodyPartAt(body.slots.Count - 1);
2200 if (msg)
2201 {
2202 Say("lose_bodyparts", this, Element.Get(bodySlot.elementId).GetName().ToLower());
2203 PlaySound("offering");
2204 }
2205 }
2206 }
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 8298 of file Chara.cs.

8299 {
8300 if (HasCondition<StanceTaunt>() || base.isRestrained || attacker == this)
8301 {
8302 return false;
8303 }
8304 if (host != null && host.isRestrained)
8305 {
8306 return false;
8307 }
8308 if (base.IsPCFactionOrMinion && attacker.IsPCFactionOrMinion)
8309 {
8310 return false;
8311 }
8312 bool flag = false;
8313 foreach (Chara chara in EClass._map.charas)
8314 {
8315 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))
8316 {
8317 continue;
8318 }
8319 bool flag2 = chara.HasElement(1225) && !chara.GetBool(126);
8320 if ((!flag2 && (flag || EClass.rnd(2) == 0 || !chara.HasCondition<StanceTaunt>())) || chara.HasCooldown(1225))
8321 {
8322 continue;
8323 }
8324 int num = Mathf.Max(chara.Evalue(1649), (!chara.IsPC) ? ((!flag2) ? 1 : 3) : 0);
8325 int num2 = Dist(chara);
8326 if (num2 > 25)
8327 {
8328 continue;
8329 }
8330 if (num2 > num || !chara.CanSeeLos(pos, num2))
8331 {
8332 if (!flag2)
8333 {
8334 continue;
8335 }
8336 Point nearestPoint = pos.GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: true, ignoreCenter: true);
8337 if (!nearestPoint.IsValid)
8338 {
8339 continue;
8340 }
8341 chara.Teleport(nearestPoint);
8342 chara.AddCooldown(1225, 10);
8343 num2 = Dist(chara);
8344 Say("intercept_loyal", chara, this);
8345 chara.SetEnemy(attacker);
8346 attacker.SetEnemy(chara);
8347 if (num2 > num || !chara.CanSeeLos(pos, num2))
8348 {
8349 continue;
8350 }
8351 }
8352 if (!flag && !HasElement(1225))
8353 {
8354 Say("intercept", chara, this);
8355 if (EClass.rnd(10) == 0)
8356 {
8357 chara.Talk("intercept", base.NameSimple);
8358 }
8359 if (attacker.enemy == this)
8360 {
8361 attacker.SetEnemy(chara);
8362 }
8363 action(chara);
8364 flag = true;
8365 }
8366 }
8367 return flag;
8368 }
void Teleport(Point point, bool silent=false, bool force=false)
Definition: Card.cs:5836
void AddCooldown(int idEle, int turns=0)
Definition: Chara.cs:8579
bool HasCooldown(int idEle)
Definition: Chara.cs:8630

References EClass._map, AddCooldown(), CanSeeLos(), Map.charas, conSuspend, enemy, Card.Evalue(), BaseCard.GetBool(), 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 9022 of file Chara.cs.

9023 {
9024 if (_hobbies != null && _works != null)
9025 {
9026 _hobbies.Clear();
9027 _works.Clear();
9028 }
9029 else
9030 {
9031 _hobbies = new List<int>();
9032 _works = new List<int>();
9033 }
9034 if (source.hobbies.IsEmpty())
9035 {
9036 AddHobby(EClass.sources.hobbies.listHobbies.RandomItem().id);
9037 }
9038 else
9039 {
9040 string[] hobbies = source.hobbies;
9041 foreach (string key in hobbies)
9042 {
9043 AddHobby(EClass.sources.hobbies.alias[key].id);
9044 }
9045 }
9046 if (source.works.IsEmpty())
9047 {
9048 AddWork(EClass.sources.hobbies.listWorks.RandomItem().id);
9049 }
9050 else
9051 {
9052 string[] hobbies = source.works;
9053 foreach (string key2 in hobbies)
9054 {
9055 AddWork(EClass.sources.hobbies.alias[key2].id);
9056 }
9057 }
9059 }
WorkSummary GetWorkSummary()
Definition: Chara.cs:9061
void AddWork(int id)
Definition: Chara.cs:9010
void AddHobby(int id)
Definition: Chara.cs:8998
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 2208 of file Chara.cs.

2209 {
2210 for (int num = body.slots.Count - 1; num >= 0; num--)
2211 {
2212 BodySlot bodySlot = body.slots[num];
2213 if (bodySlot.elementId == 45 || bodySlot.elementId == 40)
2214 {
2215 return;
2216 }
2217 body.RemoveBodyPart(num);
2218 }
2219 string[] array = race.figure.Split('|');
2220 foreach (string s in array)
2221 {
2222 int num2 = ParseBodySlot(s);
2223 if (num2 != -1)
2224 {
2225 body.AddBodyPart(num2);
2226 }
2227 }
2229 }

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

◆ ResetUpgrade()

void Chara.ResetUpgrade ( )
inline

Definition at line 8464 of file Chara.cs.

8465 {
8466 _ = base.c_upgrades;
8467 }

Referenced by CoreDebug.ResetPetUpgrades().

◆ ResistCon()

void Chara.ResistCon ( Condition  con)
inline

Definition at line 9592 of file Chara.cs.

9593 {
9594 if (con.power > 0 && resistCon != null)
9595 {
9596 int a = ClassExtension.TryGetValue<int, int>((IDictionary<int, int>)resistCon, con.id, 0);
9597 if (1000 < EClass.rnd(a))
9598 {
9599 con.power = 0;
9600 }
9601 else if (500 < EClass.rnd(a))
9602 {
9603 con.power /= 5;
9604 }
9605 else if (200 < EClass.rnd(a))
9606 {
9607 con.power /= 3;
9608 }
9609 else if (100 < EClass.rnd(a))
9610 {
9611 con.power /= 2;
9612 }
9613 }
9614 }

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

◆ RestockEquip()

void Chara.RestockEquip ( bool  onCreate)
inline

Definition at line 4649 of file Chara.cs.

4650 {
4651 string equip = source.equip;
4652 if (equip.IsEmpty())
4653 {
4654 equip = job.equip;
4655 }
4656 if (equip == "none")
4657 {
4658 return;
4659 }
4660 bool flag = true;
4661 switch (id)
4662 {
4663 case "kettle":
4664 case "quru":
4665 case "loytel":
4666 case "shojo":
4667 EQ_ID("staff_long", 1);
4668 EQ_CAT("head");
4669 EQ_CAT("torso");
4670 EQ_CAT("arm");
4671 return;
4672 case "adv_yukiimo":
4673 if (onCreate)
4674 {
4675 EQ_ID("tail_snowleopard");
4676 }
4677 break;
4678 case "adv_kiria":
4679 if (onCreate)
4680 {
4681 EQ_ID("sword_zephir");
4682 }
4683 break;
4684 case "adv_mesherada":
4685 if (onCreate)
4686 {
4687 EQ_ID("dagger_hathaway");
4688 }
4689 break;
4690 case "adv_verna":
4691 if (onCreate)
4692 {
4693 EQ_ID("staff_long", -1, Rarity.Legendary);
4694 }
4695 if (onCreate)
4696 {
4697 EQ_ID("cloak_wing", -1, Rarity.Mythical);
4698 }
4699 break;
4700 case "big_sister":
4701 if (onCreate)
4702 {
4703 EQ_ID("sword_muramasa");
4704 }
4705 break;
4706 case "adv_gaki":
4707 if (onCreate)
4708 {
4709 EQ_ID("dagger_gaki");
4710 }
4711 if (onCreate)
4712 {
4713 EQ_ID("dagger_ninto");
4714 }
4715 break;
4716 case "adv_ivory":
4717 EQ_ID("dagger", -1, Rarity.Legendary);
4718 AddThing("60");
4719 break;
4720 case "adv_wini":
4721 if (onCreate)
4722 {
4723 EQ_ID("staff_Cat", -1, Rarity.Mythical);
4724 }
4726 if (onCreate)
4727 {
4728 AddThing("1071");
4729 }
4730 break;
4731 case "namamani":
4732 if (onCreate)
4733 {
4734 AddThing("gun_gravity2");
4735 }
4736 break;
4737 case "lomias":
4738 if (onCreate)
4739 {
4740 AddThing("bow_vindale");
4741 }
4742 break;
4743 case "larnneire":
4744 if (onCreate)
4745 {
4746 EQ_ID("EtherDagger2");
4747 }
4748 break;
4749 case "keeper_garden":
4750 if (!body.HasWeapon())
4751 {
4752 EQ_ID("sword_ragnarok");
4753 }
4754 break;
4755 case "ungaga_pap":
4756 if (onCreate)
4757 {
4758 EQ_ID("axe_destruction");
4759 }
4760 break;
4761 case "lurie_boss":
4762 if (onCreate)
4763 {
4764 EQ_ID("ribbon_duponne");
4765 }
4766 break;
4767 case "seeker":
4768 if (onCreate)
4769 {
4770 EQ_ID("helm_seeker");
4771 }
4772 EQ_ID("robe_pope");
4773 EQ_ID("sword_katana");
4774 EQ_ID("staff");
4775 EQ_ID("sword_katana");
4776 if (onCreate)
4777 {
4778 EQ_ID("boots_seven");
4779 }
4780 if (onCreate)
4781 {
4782 for (int i = 0; i < 20; i++)
4783 {
4785 }
4786 EQ_Item("panty");
4787 AddThing("plat").SetNum(6);
4788 }
4789 break;
4790 case "ephrond":
4791 if (onCreate)
4792 {
4793 AddThing("guitar_efrond");
4794 }
4795 break;
4796 case "ashland":
4797 if (onCreate)
4798 {
4799 AddThing("guitar_ash");
4800 }
4801 break;
4802 case "swordkeeper":
4803 if (onCreate)
4804 {
4805 EQ_ID("EtherDagger");
4806 }
4807 break;
4808 case "mech_angel":
4809 if (onCreate)
4810 {
4811 Thing thing = ThingGen.Create("pole_holy");
4812 thing.SetReplica(on: true);
4813 thing.rarity = Rarity.Normal;
4814 thing.elements.SetTo(60, -15);
4815 thing.elements.SetTo(418, -100);
4816 thing.elements.SetTo(93, 50);
4817 AddThing(thing);
4818 body.Equip(thing);
4819 flag = false;
4820 }
4821 break;
4822 }
4823 if (!TryEquipRanged())
4824 {
4825 switch (id)
4826 {
4827 case "tyche":
4828 case "trooper":
4829 case "mech_scarab":
4830 AddThing("gun_laser");
4831 break;
4832 case "rocketman":
4833 {
4834 Thing thing2 = AddThing("panzerfaust");
4835 thing2.ChangeMaterial("iron");
4836 thing2.c_ammo = 0;
4837 break;
4838 }
4839 default:
4840 switch (equip)
4841 {
4842 case "archer":
4843 EQ_CAT((EClass.rnd(4) == 0) ? "crossbow" : "bow");
4844 break;
4845 case "inquisitor":
4846 case "gunner":
4847 EQ_CAT("gun");
4848 break;
4849 }
4850 break;
4851 }
4852 }
4853 int num = ((base.rarity >= Rarity.Mythical) ? (base.LV * 3) : ((base.rarity >= Rarity.Legendary) ? (base.LV * 2) : base.LV));
4854 if (trait is TraitAdventurer)
4855 {
4856 num *= 3;
4857 }
4858 if (race.id == "asura")
4859 {
4860 for (int j = 0; j < 4; j++)
4861 {
4862 EQ_CAT(job.weapon.RandomItem());
4863 }
4864 }
4865 for (int k = 0; k < ((!(race.id == "mutant")) ? 1 : (2 + base.LV / 30)); k++)
4866 {
4867 if (flag)
4868 {
4869 if (source.ContainsTag("boxer"))
4870 {
4871 EQ_CAT("martial");
4872 }
4873 else if (!job.weapon.IsEmpty())
4874 {
4875 if (race.id == "mutant" || (body.slotMainHand != null && body.slotMainHand.thing == null))
4876 {
4877 EQ_CAT(job.weapon.RandomItem());
4878 }
4879 if (race.id == "mutant" || (Evalue(131) > 0 && EClass.rnd(2) == 0))
4880 {
4881 EQ_CAT(job.weapon.RandomItem());
4882 }
4883 }
4884 }
4885 EQ_CAT("torso");
4886 if (EClass.rnd(num) > 5)
4887 {
4888 EQ_CAT("arm");
4889 }
4890 if (EClass.rnd(num) > 10)
4891 {
4892 EQ_CAT("head");
4893 }
4894 if (EClass.rnd(num) > 15)
4895 {
4896 EQ_CAT("back");
4897 }
4898 if (EClass.rnd(num) > 20)
4899 {
4900 EQ_CAT("ring");
4901 }
4902 if (EClass.rnd(num) > 25)
4903 {
4904 EQ_CAT("amulet");
4905 }
4906 if (EClass.rnd(num) > 30)
4907 {
4908 EQ_CAT("foot");
4909 }
4910 if (EClass.rnd(num) > 35)
4911 {
4912 EQ_CAT("waist");
4913 }
4914 if (EClass.rnd(num) > 40)
4915 {
4916 EQ_CAT("ring");
4917 }
4918 }
4919 if (trait is TraitBard)
4920 {
4921 AddThing(ThingGen.Create("lute"));
4922 if (EClass.debug.enable || EClass.rnd(100) == 0)
4923 {
4924 EQ_ID("shield_lute");
4925 }
4926 }
4927 if (HasTag(CTAG.shield))
4928 {
4929 EQ_CAT("shield");
4930 }
4931 }
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
Definition: Card.cs:3038
Card AddCard(Card c)
Definition: Card.cs:3087
void SetReplica(bool on)
Definition: Card.cs:3072
bool HasWeapon()
Definition: CharaBody.cs:378
BodySlot slotMainHand
Definition: CharaBody.cs:10
void EQ_Item(string s, int num=1)
Definition: Chara.cs:5041
Thing EQ_ID(string s, int mat=-1, Rarity r=Rarity.Random)
Definition: Chara.cs:5005
bool TryEquipRanged()
Definition: Chara.cs:7765
void EQ_CAT(string s)
Definition: Chara.cs:5025
void SetTo(int id, int v)
static Thing CreateSpellbook(string alias, int num=1)
Definition: ThingGen.cs:151

References Card.ChangeMaterial(), RenderRow.ContainsTag(), ThingGen.Create(), ThingGen.CreateFromCategory(), ThingGen.CreateSpellbook(), EClass.debug, Card.elements, CoreDebug.enable, CharaBody.Equip(), SourceChara.Row.equip, SourceJob.Row.equip, CharaBody.HasWeapon(), SourceRace.Row.id, EClass.rnd(), Card.SetReplica(), ElementContainer.SetTo(), CharaBody.slotMainHand, BodySlot.thing, and SourceJob.Row.weapon.

Referenced by CoreDebug.QuickStart().

◆ RestockInventory()

void Chara.RestockInventory ( bool  onCreate)
inline

Definition at line 4933 of file Chara.cs.

4934 {
4935 switch (id)
4936 {
4937 case "lomias":
4938 if (ShouldRestock("_meat"))
4939 {
4940 AddCard(ThingGen.Create("_meat").MakeRefFrom("begger"));
4941 }
4942 break;
4943 case "fiama":
4944 Restock("book_story", 1);
4945 break;
4946 case "rock_thrower":
4947 Restock("stone", 10 + EClass.rnd(10));
4948 break;
4949 case "giant":
4950 Restock("rock", 2 + EClass.rnd(10));
4951 break;
4952 case "farris":
4953 Restock("lute", 1);
4954 Restock("book_story_home", 1);
4955 break;
4956 case "begger":
4957 break;
4958 }
4959 void Restock(string id, int num)
4960 {
4961 if (ShouldRestock(id))
4962 {
4963 AddCard(ThingGen.Create(id).SetNum(num));
4964 }
4965 }
4966 bool ShouldRestock(string id)
4967 {
4968 return things.Find(id) == null;
4969 }
4970 }

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

◆ Revive()

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

Definition at line 5085 of file Chara.cs.

5086 {
5087 if (!isDead)
5088 {
5089 return;
5090 }
5091 isDead = false;
5092 base.hp = MaxHP / 3;
5093 mana.value = 0;
5094 stamina.value = 0;
5095 if (hunger.value > 30)
5096 {
5097 hunger.value = 30;
5098 }
5099 sleepiness.value = 0;
5101 RemoveCondition<StanceTaunt>();
5102 if (id == "keeper_garden")
5103 {
5104 SaiyanRevive();
5105 }
5106 if (IsPC)
5107 {
5109 {
5110 Msg.Say("noDeathPenalty2", this);
5111 }
5113 {
5114 Msg.Say("noDeathPenalty", this);
5115 }
5116 else
5117 {
5119 }
5120 List<Thing> dropList = new List<Thing>();
5121 EClass.pc.things.Foreach(delegate(Thing t)
5122 {
5124 {
5125 t.ignoreAutoPick = true;
5126 dropList.Add(t);
5127 }
5128 }, onlyAccessible: false);
5129 foreach (Thing item in dropList)
5130 {
5132 Msg.Say("backpack_full_drop", item);
5133 }
5134 EClass.player.preventDeathPenalty = false;
5135 }
5136 if (IsPCFaction && homeBranch != null)
5137 {
5138 homeBranch.Log("bRevive", this);
5139 }
5140 if (p != null)
5141 {
5142 if (!p.IsInBounds)
5143 {
5145 }
5146 EClass._zone.AddCard(this, p);
5147 if (msg)
5148 {
5149 SE.Play("revive");
5150 Msg.Say("revive", this);
5151 PlayEffect("revive");
5152 }
5153 SetCensored(enable: false);
5154 }
5155 }
void SetCensored(bool enable)
Definition: Card.cs:7677
Card parentCard
Definition: Card.cs:103
void SaiyanRevive()
Definition: Chara.cs:5157
void ApplyDeathPenalty()
Definition: Chara.cs:5191
bool disableDeathPenaltyProtection
Point GetCenterPos()
Definition: MapBounds.cs:52
int days
Definition: Player.cs:75
bool preventDeathPenalty
Definition: Player.cs:1167
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 3505 of file Chara.cs.

3506 {
3507 if (renderer.hasActor)
3508 {
3509 base.dir = (base.dir + ((!reverse) ? 1 : (-1))).Clamp(0, 3, loop: true);
3510 }
3511 else
3512 {
3513 base.dir = ((base.dir == 0) ? 1 : 0);
3514 }
3515 UpdateAngle();
3517 }

Referenced by AI_Dance.Run().

◆ SaiyanRevive()

void Chara.SaiyanRevive ( )
inline

Definition at line 5157 of file Chara.cs.

5158 {
5159 ModCorruption(-100000);
5160 if (base.LV < 10000000)
5161 {
5162 SetLv(base.LV * 10 + 9);
5163 }
5164 Refresh();
5165 base.hp = MaxHP;
5166 mana.value = mana.max;
5167 stamina.value = stamina.max;
5168 bossText = true;
5169 }
void ModCorruption(int a)
Definition: Chara.cs:9739

References Stats.max, and Refresh().

◆ ScaleByPrincipal()

Chara Chara.ScaleByPrincipal ( )
inline

◆ SetAI()

AIAct Chara.SetAI ( AIAct  g)
inline

Definition at line 8798 of file Chara.cs.

8799 {
8800 if (IsPC)
8801 {
8803 }
8804 if (ai.IsRunning)
8805 {
8806 if (ai == g && ai.IsNoGoal)
8807 {
8808 return g;
8809 }
8810 ai.Cancel();
8811 if (ai == g)
8812 {
8813 Debug.Log("goal is g:" + ai?.ToString() + "/" + this);
8814 return g;
8815 }
8816 }
8817 if (HasCondition<ConWait>())
8818 {
8819 RemoveCondition<ConWait>();
8820 }
8821 ai = g;
8822 ai.SetOwner(this);
8823 if (IsPC)
8824 {
8826 }
8827 return g;
8828 }
virtual bool IsNoGoal
Definition: AIAct.cs:74
void SetOwner(Chara c)
Definition: AIAct.cs:179
QueueManager queues
Definition: Player.cs:1209
void OnSetGoal(AIAct newGoal)
Definition: QueueManager.cs:23

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

Referenced by _Move(), Zone.AddCard(), Thing.DoAct(), UIInventory.DoAct(), Player.EndTurn(), GiveGift(), TraitTrolley.OnActivateTrap(), BaseListPeople.OnClick(), LayerCraft.OnClickCraft(), OnCreate(), ZoneInstanceBout.OnLeaveZone(), AM_Paint.OnUpdateInput(), ActBloodsuck.Perform(), ActNTR.Perform(), ActRanged.Perform(), ActRestrain.Perform(), 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 8788 of file Chara.cs.

8789 {
8790 SetAI(new GoalCombat());
8791 }

Referenced by ZoneEventQuest.AggroEnemy().

◆ SetAIIdle()

void Chara.SetAIIdle ( )
inline

Definition at line 8784 of file Chara.cs.

8785 {
8786 }

◆ SetAIImmediate()

◆ SetCooldown()

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

Definition at line 8597 of file Chara.cs.

8598 {
8599 if (_cooldowns == null)
8600 {
8601 _cooldowns = new List<int>();
8602 }
8603 bool flag = false;
8604 for (int i = 0; i < _cooldowns.Count; i++)
8605 {
8606 if (_cooldowns[i] / 1000 == idEle)
8607 {
8608 if (turns == 0)
8609 {
8610 _cooldowns.RemoveAt(i);
8611 }
8612 else
8613 {
8614 _cooldowns[i] = idEle * 1000 + turns;
8615 }
8616 flag = true;
8617 break;
8618 }
8619 }
8620 if (!flag && turns > 0)
8621 {
8622 AddCooldown(idEle, turns);
8623 }
8624 if (_cooldowns.Count == 0)
8625 {
8626 _cooldowns = null;
8627 }
8628 }

Referenced by ConTransmuteBat.OnRemoved().

◆ SetDir()

override void Chara.SetDir ( int  d)
inlinevirtual

Reimplemented from Card.

Definition at line 3498 of file Chara.cs.

3499 {
3500 base.dir = d;
3501 UpdateAngle();
3503 }

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

◆ SetDirtySpeed()

void Chara.SetDirtySpeed ( )
inline

Definition at line 1851 of file Chara.cs.

1852 {
1853 dirtySpeed = true;
1854 if (host != null)
1855 {
1857 }
1858 }

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

6230 {
6231 enemy = c;
6232 if (c == null)
6233 {
6234 if (ai is GoalCombat)
6235 {
6236 ai.Cancel();
6237 }
6238 }
6239 else
6240 {
6241 calmCheckTurn = 10 + EClass.rnd(30);
6242 }
6243 return c;
6244 }

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

4973 {
4975 Rarity rarity = Rarity.Normal;
4976 int num = ((base.LV >= 1000) ? 7 : ((base.LV >= 500) ? 5 : ((base.LV >= 250) ? 3 : ((base.LV >= 100) ? 2 : ((base.LV >= 50) ? 1 : 0)))));
4977 Rarity rarity2 = base.rarity;
4978 if (id == "big_sister")
4979 {
4980 num = (isOnCreate ? 8 : 4);
4981 }
4982 if (!isOnCreate && EClass.rnd(10) != 0)
4983 {
4984 num /= 2;
4985 }
4986 if (rarity2 == Rarity.Superior && EClass.rnd(10) <= num)
4987 {
4988 rarity = Rarity.Superior;
4989 }
4990 else if (rarity2 == Rarity.Legendary)
4991 {
4992 rarity = ((EClass.rnd(10) <= num) ? Rarity.Legendary : ((EClass.rnd(5) <= num) ? Rarity.Superior : Rarity.Normal));
4993 }
4994 else if (rarity2 >= Rarity.Mythical)
4995 {
4996 rarity = ((EClass.rnd(30) <= num) ? Rarity.Mythical : ((EClass.rnd(10) > num) ? Rarity.Superior : Rarity.Legendary));
4997 }
4998 if (rarity == Rarity.Normal && EClass.rnd(1000) == 0)
4999 {
5000 rarity = Rarity.Legendary;
5001 }
5002 CardBlueprint.current.rarity = rarity;
5003 }
static void Set(CardBlueprint _bp=null)
static CardBlueprint CharaGenEQ
static bool isOnCreate
Definition: Chara.cs:184

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

◆ SetFaction()

Chara Chara.SetFaction ( Faction  f)
inline

Definition at line 1419 of file Chara.cs.

1420 {
1421 _faction = null;
1422 faction = f;
1424 return this;
1425 }
Faction _faction
Definition: Chara.cs:156
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 1710 of file Chara.cs.

1711 {
1712 faith = r;
1714 }

References faith, and RefreshFaithElement().

◆ SetFaith() [2/2]

void Chara.SetFaith ( string  id)
inline

Definition at line 1705 of file Chara.cs.

1706 {
1708 }
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 9797 of file Chara.cs.

9798 {
9799 Feat feat = elements.GetElement(id) as Feat;
9800 int num = 0;
9801 if (feat != null && feat.Value > 0)
9802 {
9803 if (value == feat.Value)
9804 {
9805 return;
9806 }
9807 num = feat.Value;
9808 feat.Apply(-feat.Value, elements);
9809 }
9810 feat = elements.SetBase(id, value - (feat?.vSource ?? 0)) as Feat;
9811 if (feat.Value != 0)
9812 {
9813 feat.Apply(feat.Value, elements);
9814 }
9816 {
9817 Refresh();
9819 }
9820 if (!msg)
9821 {
9822 return;
9823 }
9824 if (feat.source.textInc.IsEmpty())
9825 {
9826 PlaySound("ding_skill");
9828 Say("gainFeat", this, feat.FullName);
9829 }
9830 else
9831 {
9832 bool flag = value < num;
9833 if (feat.source.tag.Contains("neg"))
9834 {
9835 flag = !flag;
9836 }
9837 switch (id)
9838 {
9839 case 1270:
9840 if (!flag)
9841 {
9842 PlaySound("chime_angel");
9843 }
9844 break;
9845 case 1271:
9846 if (!flag)
9847 {
9848 PlaySound("chime_devil");
9849 }
9850 break;
9851 default:
9852 PlaySound("mutation");
9853 break;
9854 }
9856 Say((value > num) ? feat.source.GetText("textInc") : feat.source.GetText("textDec"), this, feat.FullName);
9857 }
9859 }
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(), ConSleep.OnRemoved(), FoodEffect.Proc(), CoreDebug.SetElement(), and DramaOutcome.upgrade_miscreation().

◆ SetGlobal() [1/2]

Chara Chara.SetGlobal ( )
inline

Definition at line 1486 of file Chara.cs.

1487 {
1488 if (!IsGlobal)
1489 {
1491 global = new GlobalData();
1492 base.isSubsetCard = false;
1493 enemy = null;
1494 base.c_uidMaster = 0;
1495 }
1496 return this;
1497 }

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

1472 {
1473 SetGlobal();
1474 homeZone = _home;
1475 _home.AddCard(this, x, z);
1476 global.transition = new ZoneTransition
1477 {
1478 state = ZoneTransition.EnterState.Exact,
1479 x = x,
1480 z = z
1481 };
1482 orgPos = new Point(x, z);
1483 return this;
1484 }

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

1428 {
1429 homeZone = zone;
1430 SetGlobal();
1431 return this;
1432 }

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

1435 {
1436 Hostility hostility2 = (base.c_originalHostility = h);
1437 this.hostility = hostility2;
1438 return this;
1439 }

Referenced by Zone_Specwing.OnActivate(), Zone_CurryRuinDungeon.OnGenerateMap(), Zone.SetAlarm(), and Zone.TryGenerateBigDaddy().

◆ SetMainElement() [1/2]

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

Definition at line 2076 of file Chara.cs.

2077 {
2078 if (base.c_idMainElement != 0)
2079 {
2080 SetElements(base.c_idMainElement, remove: true);
2081 base.c_idMainElement = 0;
2082 }
2083 if (id != 0)
2084 {
2085 _ = EClass.sources.elements.map[id];
2086 SetElements(id, remove: false);
2087 base.c_idMainElement = id;
2088 if (elemental)
2089 {
2090 base.isElemental = true;
2091 _colorInt = 0;
2092 Color colorSprite = EClass.setting.elements[MainElement.source.alias].colorSprite;
2093 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);
2094 }
2095 _ability = null;
2096 }
2097 void SetElements(int idEle, bool remove)
2098 {
2099 elements.SetBase(idEle, (!remove) ? ((v == 0) ? 10 : v) : 0);
2100 elements.ModBase(EClass.sources.elements.alias[EClass.sources.elements.map[idEle].aliasRef].id, remove ? (-20) : 20);
2101 switch (idEle)
2102 {
2103 case 910:
2104 elements.ModBase(951, remove ? 10 : (-10));
2105 break;
2106 case 911:
2107 elements.ModBase(950, remove ? 10 : (-10));
2108 break;
2109 case 912:
2110 elements.ModBase(953, remove ? 10 : (-10));
2111 break;
2112 case 913:
2113 elements.ModBase(952, remove ? 10 : (-10));
2114 break;
2115 case 916:
2116 elements.ModBase(960, remove ? 10 : (-10));
2117 break;
2118 case 919:
2119 elements.ModBase(956, remove ? 10 : (-10));
2120 break;
2121 case 925:
2122 elements.ModBase(962, remove ? 10 : (-10));
2123 break;
2124 case 922:
2125 elements.ModBase(965, remove ? 10 : (-10));
2126 break;
2127 case 921:
2128 elements.ModBase(971, remove ? 10 : (-10));
2129 break;
2130 case 926:
2131 elements.ModBase(961, remove ? 10 : (-10));
2132 break;
2133 case 914:
2134 case 915:
2135 case 917:
2136 case 918:
2137 case 920:
2138 case 923:
2139 case 924:
2140 break;
2141 }
2142 }
2143 }
int _colorInt
Definition: Card.cs:67
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 2067 of file Chara.cs.

2068 {
2069 if (!id.StartsWith("ele"))
2070 {
2071 id = "ele" + id;
2072 }
2073 SetMainElement(EClass.sources.elements.alias[id].id, v, elemental);
2074 }

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

9862 {
9863 SourceElement.Row row = EClass.sources.elements.map[idEle];
9865 Element element = elements.GetElement(idEle);
9866 Element element2 = elements.GetElement(row2.id);
9867 int num = element?.Value ?? 0;
9868 if (a < 0)
9869 {
9870 a = 0;
9871 }
9872 if (a > row.max)
9873 {
9874 a = row.max;
9875 }
9876 bool flag = (row.tag.Contains("neg") ? (a > num) : (a < num));
9877 if (a == 0 && (element == null || element.Value == 0))
9878 {
9880 return;
9881 }
9882 if (element != null && element.Value == a)
9883 {
9885 return;
9886 }
9887 if (element2 != null && element2.Value > 0)
9888 {
9889 SetFeat(element2.id, 0);
9890 }
9891 SetFeat(idEle, a);
9892 PlaySound("mutation");
9893 PlayEffect("mutation");
9895 Say(row.GetText(flag ? "textDec" : "textInc", returnNull: true) ?? row.alias, this);
9896 }

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

8794 {
8795 return SetAI(_NoGoalPC);
8796 }
static NoGoal _NoGoalPC
Definition: Chara.cs:196

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

◆ SetPCCState()

void Chara.SetPCCState ( PCCState  state)
inline

Definition at line 6609 of file Chara.cs.

6610 {
6611 if (IsPCC)
6612 {
6613 PCC.Get(pccData).Build(state);
6614 }
6615 }

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

6658 {
6659 p.mat = base.material;
6660 p.matColor = base.colorInt;
6661 if (!renderer.usePass)
6662 {
6663 return;
6664 }
6665 if (renderer.replacer != null)
6666 {
6667 p.tile = renderer.replacer.tile * ((!flipX) ? 1 : (-1));
6668 }
6669 else if (source._tiles_snow.Length != 0 && EClass._zone.IsSnowCovered)
6670 {
6671 if (source._tiles_snow.Length > 1)
6672 {
6673 int num = ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % source._tiles_snow.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6674 p.tile = source._tiles_snow[(num < source._tiles_snow.Length) ? num : 0] * ((!flipX) ? 1 : (-1));
6675 }
6676 else
6677 {
6678 p.tile = source._tiles_snow[0] * ((!flipX) ? 1 : (-1));
6679 }
6680 }
6681 else if (sourceCard._tiles.Length > 1)
6682 {
6683 int num2 = ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % sourceCard._tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6684 p.tile = sourceCard._tiles[(num2 >= 0 && num2 < sourceCard._tiles.Length) ? num2 : 0] * ((!flipX) ? 1 : (-1));
6685 }
6686 else
6687 {
6688 p.tile = sourceCard._tiles[0] * ((!flipX) ? 1 : (-1));
6689 }
6690 p.dir = base.dir;
6691 }
override bool flipX
Definition: Chara.cs:547
virtual bool IsSnowCovered
Definition: Spatial.cs:545

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

7204 {
7205 switch (m)
7206 {
7207 case UIList.SortMode.ByJob:
7208 sortVal = job._index * 10000 + sourceCard._index;
7209 break;
7210 case UIList.SortMode.ByRace:
7211 sortVal = race._index * 10000 * ((!IsHuman) ? 1 : (-1)) + sourceCard._index;
7212 break;
7213 case UIList.SortMode.ByFeat:
7214 sortVal = -GetTotalFeat();
7215 break;
7216 default:
7217 sortVal = sourceCard._index * ((!IsHuman) ? 1 : (-1));
7218 break;
7219 case UIList.SortMode.ByWorkk:
7220 break;
7221 }
7222 }
int sortVal
Definition: Card.cs:101
int GetTotalFeat()
Definition: Chara.cs:8016
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 2055 of file Chara.cs.

2056 {
2057 source = EClass.sources.charas.map.TryGetValue(id);
2058 if (source == null)
2059 {
2060 Debug.LogWarning("Chara " + id + " not found");
2061 id = "chicken";
2062 source = EClass.sources.charas.map[id];
2063 }
2064 path.walker = this;
2065 }

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

Referenced by Refresh().

◆ SetSummon()

void Chara.SetSummon ( int  duration)
inline

Definition at line 2371 of file Chara.cs.

2372 {
2373 base.c_summonDuration = duration;
2374 base.isSummon = true;
2375 }

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

7534 {
7535 if (t.IsRangedWeapon && t.category.slot == 0)
7536 {
7537 if (!CanEquipRanged(t))
7538 {
7539 return false;
7540 }
7541 int num = 0;
7542 foreach (Thing thing in things)
7543 {
7544 if (thing.IsRangedWeapon)
7545 {
7546 if (thing.category.slot != 0 && thing.isEquipped)
7547 {
7548 return false;
7549 }
7550 if (CanEquipRanged(thing) && thing.GetEquipValue() > num)
7551 {
7552 num = thing.GetEquipValue();
7553 }
7554 }
7555 }
7556 if (t.GetEquipValue() > num)
7557 {
7558 return true;
7559 }
7560 return false;
7561 }
7562 BodySlot bodySlot = body.GetSlot(t);
7563 if (bodySlot == null)
7564 {
7565 return false;
7566 }
7567 if (useFav)
7568 {
7569 switch (GetFavAttackStyle())
7570 {
7571 case AttackStyle.Default:
7572 case AttackStyle.TwoHand:
7573 if (t.IsMeleeWeapon)
7574 {
7575 bodySlot = body.slotMainHand;
7576 }
7577 else if (bodySlot.elementId == 35)
7578 {
7579 return false;
7580 }
7581 break;
7582 case AttackStyle.Shield:
7583 if (t.IsMeleeWeapon)
7584 {
7585 bodySlot = body.slotMainHand;
7586 }
7587 else if (bodySlot.elementId == 35 && t.IsMeleeWeapon)
7588 {
7589 return false;
7590 }
7591 break;
7592 case AttackStyle.TwoWield:
7593 if (bodySlot.elementId == 35 && !t.IsMeleeWeapon)
7594 {
7595 return false;
7596 }
7597 break;
7598 }
7599 }
7600 if (!body.IsEquippable(t, bodySlot, text: false))
7601 {
7602 return false;
7603 }
7604 if (bodySlot.thing != null && (bodySlot.thing.blessedState <= BlessedState.Cursed || bodySlot.thing.GetEquipValue() >= t.GetEquipValue()))
7605 {
7606 return false;
7607 }
7608 if (!base.IsPCFactionOrMinion)
7609 {
7610 int num2 = 0;
7611 foreach (Element value in t.elements.dict.Values)
7612 {
7613 if (value.Value <= 0)
7614 {
7615 int num3 = 100;
7616 switch (value.id)
7617 {
7618 case 418:
7619 num3 = 10;
7620 break;
7621 case 60:
7622 case 61:
7623 case 62:
7624 num3 = 200;
7625 break;
7626 case 962:
7627 num3 = 10000;
7628 break;
7629 }
7630 num2 += value.Value * num3 / 100;
7631 }
7632 }
7633 if (num2 < -40)
7634 {
7635 return false;
7636 }
7637 }
7638 if (t.HasTag(CTAG.gift))
7639 {
7640 return false;
7641 }
7642 return true;
7643 }
bool IsMeleeWeapon
Definition: Card.cs:2241
BlessedState blessedState
Definition: Card.cs:278
bool IsEquippable(Thing thing, BodySlot slot, bool text=true)
Definition: CharaBody.cs:106
AttackStyle GetFavAttackStyle()
Definition: Chara.cs:4605

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

◆ ShouldThrowAway()

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

Definition at line 8370 of file Chara.cs.

8371 {
8372 if (IsPCFaction)
8373 {
8374 if (t.IsFood && t.category.id != "fish" && !t.IsDecayed)
8375 {
8376 return false;
8377 }
8378 if (t.trait.GetHealAction(this) != null)
8379 {
8380 return false;
8381 }
8382 if (t.IsThrownWeapon || t.IsRangedWeapon || t.IsAmmo)
8383 {
8384 return false;
8385 }
8386 if (t.trait is TraitBlanket || t.trait is TraitItemProc || t.trait is TraitBookSkill)
8387 {
8388 return false;
8389 }
8390 }
8391 if (t.isEquipped || t.rarity >= Rarity.Legendary || !t.trait.CanBeDestroyed)
8392 {
8393 return false;
8394 }
8395 if (t.trait is TraitCurrency || t.trait is TraitTool)
8396 {
8397 return false;
8398 }
8399 switch (type)
8400 {
8401 case ClearInventoryType.SellAtTown:
8402 if (!t.isGifted && !t.isNPCProperty)
8403 {
8404 return false;
8405 }
8406 break;
8407 case ClearInventoryType.Purge:
8408 switch (t.category.id)
8409 {
8410 case "fish":
8411 if (EClass.rnd(3) == 0)
8412 {
8413 return true;
8414 }
8415 break;
8416 case "junk":
8417 case "garbage":
8418 if (EClass.rnd(3) != 0)
8419 {
8420 return true;
8421 }
8422 break;
8423 }
8424 if (t.id == "flyer")
8425 {
8426 return true;
8427 }
8428 if (!t.IsDecayed && EClass.rnd(3) == 0)
8429 {
8430 return false;
8431 }
8432 if (!things.IsFull() && t.IsRangedWeapon)
8433 {
8434 return false;
8435 }
8436 break;
8437 }
8438 return true;
8439 }
bool IsThrownWeapon
Definition: Card.cs:2245
bool IsFood
Definition: Card.cs:2175
bool isGifted
Definition: Card.cs:782
virtual Action GetHealAction(Chara c)
Definition: Trait.cs:604

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

6962 {
6963 Zone_Nymelle zone_Nymelle = EClass._zone as Zone_Nymelle;
6964 if (conSuspend != null && IsPCParty)
6965 {
6966 RemoveCondition<ConSuspend>();
6967 }
6968 if (LayerDrama.forceJump == null)
6969 {
6970 if (IsDeadOrSleeping)
6971 {
6972 ShowDialog("_chara", "sleep");
6973 return;
6974 }
6975 if (EClass.pc.isHidden && !CanSee(EClass.pc))
6976 {
6977 ShowDialog("_chara", "invisible");
6978 return;
6979 }
6981 {
6983 ShowDialog("_chara", "give_card");
6984 Thing thing = ThingGen.Create("figure");
6985 thing.MakeFigureFrom(id);
6986 EClass.player.DropReward(thing);
6987 thing = ThingGen.Create("figure3");
6988 thing.MakeFigureFrom(id);
6989 EClass.player.DropReward(thing);
6990 return;
6991 }
6992 if (GetInt(71) == -2)
6993 {
6994 ShowDialog("_chara", "give_lunch");
6995 Thing t = CraftUtil.MakeLoveLunch(this);
6997 SetInt(71, EClass.world.date.GetRaw() + 43200);
6998 return;
6999 }
7000 if (base.isRestrained)
7001 {
7002 ShowDialog("_chara", "strain");
7003 return;
7004 }
7005 if (IsEscorted())
7006 {
7007 ShowDialog("_chara", "escort");
7008 return;
7009 }
7010 if (EClass._zone is Zone_Music)
7011 {
7012 ShowDialog("_chara", "party");
7013 return;
7014 }
7015 if (EClass.game.quests.OnShowDialog(this))
7016 {
7017 return;
7018 }
7019 switch (id)
7020 {
7021 case "loytel":
7022 {
7024 {
7025 EClass.game.quests.Get("pre_debt_runaway").Complete();
7026 EClass.player.flags.loytelEscaped = false;
7027 EClass.game.quests.Add("debt", "loytel");
7028 ShowDialog("loytel", "loytelEscaped");
7029 return;
7030 }
7031 QuestDebt questDebt = EClass.game.quests.Get<QuestDebt>();
7032 if (questDebt != null && questDebt.paid)
7033 {
7034 questDebt.stage++;
7035 if (questDebt.stage > 7)
7036 {
7037 questDebt.stage = 7;
7038 }
7039 ShowDialog("loytel", "debt" + questDebt.stage);
7040 return;
7041 }
7042 break;
7043 }
7044 case "farris":
7045 if (EClass._zone.id == "startVillage" || EClass._zone.id == "startVillage3" || EClass.game.IsSurvival)
7046 {
7047 ShowDialog("farris");
7048 return;
7049 }
7050 switch (EClass.game.quests.GetPhase<QuestExploration>())
7051 {
7052 case -1:
7053 ShowDialog("farris", "nymelle_noQuest");
7054 break;
7055 case 0:
7056 ShowDialog("farris", "nymelle_first");
7057 break;
7058 case 1:
7059 ShowDialog("farris", "home_first");
7060 break;
7061 default:
7062 ShowDialog("farris");
7063 break;
7064 }
7065 return;
7066 case "ashland":
7067 ShowDialog("ashland");
7068 return;
7069 case "fiama":
7070 if (zone_Nymelle != null && zone_Nymelle.IsCrystalLv && EClass.game.quests.GetPhase<QuestExploration>() == 3)
7071 {
7072 SoundManager.ForceBGM();
7073 LayerDrama.ActivateMain("mono", "nymelle_crystal");
7074 }
7076 {
7078 {
7079 EClass.player.flags.fiamaFirstDream = true;
7080 ShowDialog("fiama", "firstDream");
7081 }
7083 {
7084 ShowDialog("fiama", "giveStoryBook").SetOnKill(delegate
7085 {
7086 EClass.player.flags.fiamaStoryBookGiven = true;
7087 EClass.player.DropReward(ThingGen.Create("book_story"));
7088 });
7089 }
7090 else
7091 {
7092 ShowDialog("fiama");
7093 }
7094 }
7095 else
7096 {
7097 ShowDialog("fiama");
7098 }
7099 return;
7100 case "big_sister":
7102 {
7103 ShowDialog("big_sister", "little_saved");
7104 EClass.player.flags.little_saved = false;
7105 return;
7106 }
7108 {
7109 ShowDialog("big_sister", "little_dead");
7110 EClass.player.flags.little_killed = false;
7111 return;
7112 }
7113 break;
7114 }
7115 if (trait is TraitGuildDoorman)
7116 {
7117 string tag = ((trait is TraitDoorman_Fighter) ? "fighter" : ((trait is TraitDoorman_Mage) ? "mage" : "thief"));
7118 ShowDialog("guild_doorman", "main", tag);
7119 return;
7120 }
7121 if (trait is TraitGuildClerk)
7122 {
7123 string tag2 = ((trait is TraitClerk_Fighter) ? "fighter" : ((trait is TraitClerk_Mage) ? "mage" : "thief"));
7124 ShowDialog("guild_clerk", "main", tag2);
7125 return;
7126 }
7127 }
7128 bool flag = true;
7129 if (id == "parttimer_jure" && (!EClass._zone.IsFestival || !(EClass._zone is Zone_Noyel) || EClass.pc.faith == EClass.game.religions.Healing))
7130 {
7131 flag = false;
7132 }
7133 if (flag && File.Exists(CorePath.DramaData + id + ".xlsx"))
7134 {
7135 ShowDialog(id);
7136 }
7137 else
7138 {
7139 ShowDialog("_chara");
7140 }
7141 }
bool CanGiveCard()
Definition: Affinity.cs:63
void MakeFigureFrom(string id)
Definition: Card.cs:5697
void ShowDialog()
Definition: Chara.cs:6961
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:207
bool IsSurvival
Definition: Game.cs:275
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:479
int storyFiama
Definition: Player.cs:623
bool little_saved
Definition: Player.cs:443
bool fiamaStoryBookGiven
Definition: Player.cs:299
bool fiamaFirstDream
Definition: Player.cs:311
bool little_killed
Definition: Player.cs:455
CodexManager codex
Definition: Player.cs:1115
bool EnableDreamStory
Definition: Player.cs:1268
Thing DropReward(Thing t, bool silent=false)
Definition: Player.cs:2543
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:473
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 7143 of file Chara.cs.

7144 {
7145 return _ShowDialog(book, null, step, tag);
7146 }
LayerDrama _ShowDialog(string book, string sheet, string step="main", string tag="")
Definition: Chara.cs:7148

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

9617 {
9618 RemoveCondition<ConAwakening>();
9619 AddCondition(Condition.Create(100, delegate(ConSleep con)
9620 {
9621 con.pcSleep = 15;
9622 con.pcBed = bed;
9623 con.pcPillow = pillow;
9624 con.pickup = pickup;
9625 con.posBed = posBed;
9626 con.posPillow = posPillow;
9627 }), force: true);
9628 }

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

8007 {
8008 Say("abCatSniff", this, c);
8009 AddCondition<ConHOT>(EClass.curve(50 + c.CHA * 5, 400, 100));
8010 c.ShowEmo(Emo.angry);
8011 ShowEmo(Emo.love);
8012 Talk("sniff");
8013 c.Talk(new string[4] { "labor", "disgust", "scold", "callGuards" }.RandomItem());
8014 }

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

4541 {
4542 return held.Split(a);
4543 }

References Card.Split().

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

◆ Stumble()

void Chara.Stumble ( int  mtp = 100)
inline

Definition at line 1834 of file Chara.cs.

1835 {
1836 bool flag = EClass._map.FindThing((Thing t) => t.IsInstalled && t.pos.Equals(EClass.pc.pos) && t.trait is TraitStairsUp) != null;
1837 Say(flag ? "dmgBurdenStairs" : "dmgBurdenFallDown", this);
1838 int num = MaxHP;
1839 if (Evalue(1421) > 0)
1840 {
1841 num = mana.max;
1842 }
1843 int num2 = (num * (base.ChildrenWeight * 100 / WeightLimit) / (flag ? 100 : 200) + 1) * mtp / 100;
1844 if (base.hp <= 0)
1845 {
1846 num2 *= 2;
1847 }
1848 DamageHP(num2, flag ? AttackSource.BurdenStairs : AttackSource.BurdenFallDown);
1849 }
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 3884 of file Chara.cs.

3885 {
3886 if (host != null)
3887 {
3888 host.SyncRide();
3889 }
3890 if (ride != null)
3891 {
3892 SyncRide(ride);
3893 }
3894 if (parasite != null)
3895 {
3897 }
3898 }

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

3901 {
3902 if (!c.pos.Equals(pos))
3903 {
3904 if (!pos.IsValid)
3905 {
3906 Debug.LogError("exception: pos is not valid:" + pos?.ToString() + "/" + this);
3907 pos = new Point();
3908 }
3909 EClass._map.MoveCard(pos, c);
3910 }
3911 }

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

◆ TalkTopic()

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

Definition at line 6890 of file Chara.cs.

6891 {
6892 if (host == null && !IsInActiveZone)
6893 {
6894 return null;
6895 }
6896 if (!isSynced && (host == null || !host.isSynced) && topic != "dead")
6897 {
6898 return null;
6899 }
6900 if (IsPCParty)
6901 {
6902 int num = EClass.pc.party.members.Count - 1;
6903 switch (topic)
6904 {
6905 case "calm":
6906 if (EClass.rnd(num * 5) != 0)
6907 {
6908 return null;
6909 }
6910 break;
6911 case "aggro":
6912 if (EClass.rnd(num * 10) != 0)
6913 {
6914 return null;
6915 }
6916 break;
6917 case "kill":
6918 if (EClass.rnd(num * 3) != 0)
6919 {
6920 return null;
6921 }
6922 break;
6923 case "fov":
6924 return null;
6925 }
6926 }
6927 string topicText = GetTopicText(topic);
6928 if (topicText.IsEmpty())
6929 {
6930 return null;
6931 }
6932 string text = "_bracketTalk".lang();
6933 bool flag = topicText.StartsWith("*");
6934 bool flag2 = topicText.StartsWith("(");
6935 bool flag3 = topicText.StartsWith(text) || (topicText.Length > 0 && topicText[0] == text[0]) || topicText[0] == '“';
6936 topicText = ApplyTone(topicText);
6937 topicText = topicText.Replace("~", "*");
6938 Msg.SetColor(flag2 ? Msg.colors.Thinking : (flag3 ? Msg.colors.Talk : Msg.colors.Ono));
6939 Msg.Say(topicText.Replace("&", ""));
6940 if (topic == "dead")
6941 {
6942 EClass.ui.popGame.PopText(ApplyNewLine(topicText.StripBrackets()), null, "PopTextDead", default(Color), pos.Position() + EClass.setting.render.tc.textPosDead);
6943 }
6944 else if (flag || flag3 || flag2)
6945 {
6946 (host ?? this).renderer.Say(ApplyNewLine(topicText.StripBrackets()), default(Color), IsPCParty ? 0.6f : 0f);
6947 }
6948 return topicText;
6949 }
void Say(string text, Color c=default(Color), float duration=0f)
string ApplyNewLine(string text)
Definition: Card.cs:6748
string ApplyTone(string text, bool stripPun=false)
Definition: Card.cs:6827
string GetTopicText(string topic="calm")
Definition: Chara.cs:6857
static UI ui
Definition: EClass.cs:17
Color Thinking
Definition: MsgColors.cs:17
Color Talk
Definition: MsgColors.cs:7

References Color, Msg.colors, isSynced, MsgColors.Ono, GameSetting.render, EClass.rnd(), Msg.Say(), Msg.SetColor(), EClass.setting, MsgColors.Talk, GameSetting.RenderSetting.tc, GameSetting.RenderSetting.TCSetting.textPosDead, MsgColors.Thinking, and EClass.ui.

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

◆ Tick()

override void Chara.Tick ( )
inlinevirtual

Reimplemented from Card.

Definition at line 3913 of file Chara.cs.

3914 {
3915 SyncRide();
3916 combatCount--;
3917 ignoreSPAbsorb = false;
3918 if (IsPC)
3919 {
3920 if (hasMovedThisTurn)
3921 {
3922 pos.Things.ForeachReverse(delegate(Thing t)
3923 {
3925 {
3926 AI_Goto aI_Goto = ai.Current as AI_Goto;
3927 if ((aI_Goto == null && !(ai is GoalManualMove)) || (aI_Goto != null && !aI_Goto.dest.Equals(pos)))
3928 {
3929 return;
3930 }
3931 }
3932 t.trait.OnStepped(this);
3933 });
3934 if (isDead)
3935 {
3936 return;
3937 }
3938 hasMovedThisTurn = false;
3940 {
3941 EClass.player.haltMove = false;
3942 ActionMode.Adv.TryCancelInteraction(sound: false);
3943 EInput.Consume(1);
3944 return;
3945 }
3946 if (EClass._zone.IsRegion)
3947 {
3949 {
3950 foreach (Chara member in EClass.pc.party.members)
3951 {
3952 if (member.hunger.value > 65)
3953 {
3954 member.InstantEat(null, sound: false);
3955 }
3956 }
3957 }
3958 Chara chara = null;
3960 if (cell2 != null && (cell2.zone == null || (cell2.zone is Zone_Field && !cell2.zone.IsPCFaction)))
3961 {
3962 foreach (Chara chara2 in EClass._map.charas)
3963 {
3964 if (!chara2.IsPCFactionOrMinion && !chara2.IsGlobal && chara2.pos.Equals(EClass.pc.pos))
3965 {
3966 chara = chara2;
3967 break;
3968 }
3969 }
3970 }
3971 if (chara != null)
3972 {
3974 {
3975 EClass.player.safeTravel = 5 + EClass.rnd(5);
3976 }
3977 EClass._zone.RemoveCard(chara);
3978 Msg.Say("encounter");
3979 EClass.player.EnterLocalZone(encounter: true, chara);
3980 }
3981 else if (EClass.player.safeTravel <= 0)
3982 {
3983 if (cell2 != null && cell2.zone == null && !EClass.debug.ignoreEncounter)
3984 {
3986 if (!tileInfo.shore)
3987 {
3988 bool num = EClass.pc.HasCondition<ConWardMonster>();
3989 bool flag = EClass.pc.HasCondition<ConDrawMonster>();
3990 bool flag2 = EClass.game.quests.Get<QuestEscort>() != null;
3991 int num2 = (tileInfo.isRoad ? 22 : 12);
3992 if (flag2)
3993 {
3994 num2 = (tileInfo.isRoad ? 16 : 10);
3995 }
3996 if (num)
3997 {
3998 num2 *= (flag2 ? 2 : 20);
3999 }
4000 if (flag)
4001 {
4002 num2 /= 2;
4003 }
4004 if (EClass.rnd(num2) == 0)
4005 {
4006 Msg.Say("encounter");
4007 if (!flag)
4008 {
4009 EClass.player.safeTravel = 5 + EClass.rnd(5);
4010 }
4011 EClass.player.EnterLocalZone(encounter: true);
4012 }
4013 }
4014 }
4015 }
4016 else
4017 {
4019 }
4020 }
4021 }
4022 EClass.player.pickupDelay = 0f;
4023 if (EClass.player.returnInfo != null)
4024 {
4026 if (EClass.player.returnInfo.turns <= 0)
4027 {
4029 {
4030 EClass.player.returnInfo = null;
4032 }
4033 else
4034 {
4036 {
4037 int uidDest = EClass.player.returnInfo.uidDest;
4038 Zone zone = null;
4039 if (uidDest != 0)
4040 {
4041 zone = EClass.game.spatials.map.TryGetValue(uidDest) as Zone;
4042 }
4043 if (zone == null || zone.destryoed)
4044 {
4045 zone = EClass.world.region;
4046 }
4048 {
4049 Msg.Say("returnFail");
4050 }
4051 else
4052 {
4053 Msg.Say("returnComplete");
4054 EClass.player.uidLastTravelZone = 0;
4056 EClass.player.lastZonePos = null;
4057 }
4058 EClass.player.returnInfo = null;
4059 return;
4060 }
4061 EClass.player.returnInfo = null;
4062 Msg.Say("returnOverweight");
4063 }
4064 }
4065 }
4066 if ((HasNoGoal || !ai.IsRunning) && !WillConsumeTurn())
4067 {
4069 return;
4070 }
4073 {
4074 RecipeUpdater.dirty = true;
4075 }
4077 }
4078 else
4079 {
4080 actTime = EClass.player.baseActTime * Mathf.Max(0.1f, (float)EClass.pc.Speed / (float)Speed);
4081 hasMovedThisTurn = false;
4082 }
4085 {
4086 return;
4087 }
4089 if (host != null && !consumeTurn)
4090 {
4091 if (host.ride == this && ((host.hasMovedThisTurn && IsInCombat) || (enemy != null && turn % 3 != 0)))
4092 {
4093 consumeTurn = true;
4094 }
4095 if (host.parasite == this && enemy != null && EClass.rnd(10) > EClass.rnd(host.Evalue(227) + 10))
4096 {
4097 if (Dist(enemy) < 3 && EClass.rnd(2) == 0)
4098 {
4099 Say("parasite_fail", this, host);
4100 if (EClass.rnd(2) == 0 && GetInt(106) == 0)
4101 {
4102 Talk("parasite_fail");
4103 }
4104 }
4105 consumeTurn = true;
4106 }
4107 }
4108 if (consumeTurn)
4109 {
4110 if (IsPC)
4111 {
4113 }
4114 }
4115 else
4116 {
4117 if (base.isRestrained)
4118 {
4119 TryUnrestrain();
4120 }
4121 if (enemy != null)
4122 {
4124 {
4125 enemy = null;
4126 }
4127 else if (!IsPC && (ai.CancelOnAggro || !ai.IsRunning))
4128 {
4129 SetAIAggro();
4130 }
4131 }
4132 if (HasNoGoal || !ai.IsRunning)
4133 {
4134 ChooseNewGoal();
4135 }
4136 ai.Tick();
4137 }
4138 Cell cell = base.Cell;
4140 {
4141 AddCondition<ConWet>(50);
4142 if (pos.IsHotSpring)
4143 {
4144 hygiene.Mod(2);
4145 }
4146 }
4147 if (IsPC && !EClass._zone.IsRegion && cell.CanSuffocate() && !EClass.debug.godMode)
4148 {
4149 AddCondition<ConSuffocation>(800 / (100 + EvalueMax(200, -5) * 10), force: true);
4150 }
4151 CellEffect e;
4152 if (cell.effect != null)
4153 {
4154 e = cell.effect;
4155 switch (e.id)
4156 {
4157 case 1:
4158 case 2:
4159 case 4:
4160 if (IsLevitating)
4161 {
4162 Say("levitating");
4163 break;
4164 }
4165 AddCondition<ConWet>(50);
4166 ProcEffect();
4167 break;
4168 case 3:
4169 PlaySound("fire_step");
4170 AddCondition<ConBurning>(30);
4171 break;
4172 case 5:
4173 if (!isWet)
4174 {
4175 PlaySound("bubble");
4176 AddCondition<ConWet>(30);
4177 ProcEffect();
4178 }
4179 break;
4180 case 6:
4181 if (hasMovedThisTurn)
4182 {
4183 Say("abMistOfDarkness_step", this);
4184 }
4185 AddCondition<ConDark>(e.power);
4186 break;
4187 }
4188 }
4189 if (IsPC)
4190 {
4191 if (EClass.player.currentHotItem.Thing != null)
4192 {
4194 }
4196 }
4197 void ClearEffect()
4198 {
4199 EClass._map.SetLiquid(cell.x, cell.z, 0, 0);
4200 }
4201 void ProcEffect()
4202 {
4203 if (e.idEffect != 0)
4204 {
4205 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
4206 {
4207 aliasEle = EClass.sources.elements.map[e.idEle].alias,
4208 n1 = e.n1,
4209 refVal = e.refVal
4210 });
4211 ClearEffect();
4212 }
4213 }
4214 }
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:65
void TryUnrestrain(bool force=false, Chara c=null)
Definition: Card.cs:7061
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:7491
int Speed
Definition: Chara.cs:1083
static bool consumeTurn
Definition: Chara.cs:180
void SetAIAggro()
Definition: Chara.cs:8788
bool ignoreSPAbsorb
Definition: Chara.cs:146
void ChooseNewGoal()
Definition: Chara.cs:8669
bool WillConsumeTurn()
Definition: Chara.cs:3643
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:1171
float baseActTime
Definition: Player.cs:1199
void EnterLocalZone(bool encounter=false, Chara mob=null)
Definition: Player.cs:1942
HotItem currentHotItem
Definition: Player.cs:1100
int safeTravel
Definition: Player.cs:920
int eloY
Definition: Point.cs:81
int eloX
Definition: Point.cs:79
bool IsHotSpring
Definition: Point.cs:375
bool destryoed
Definition: Spatial.cs:45
virtual void OnTickHeld()
Definition: Trait.cs:1051
virtual bool IgnoreOnSteppedWhenMoving
Definition: Trait.cs:372
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 3655 of file Chara.cs.

3656 {
3657 if (_cooldowns != null)
3658 {
3659 TickCooldown();
3660 }
3661 turn++;
3662 consumeTurn = false;
3663 preventRegen = false;
3664 emoIcon = Emo2.none;
3665 if (base.isSummon)
3666 {
3667 base.c_summonDuration--;
3668 if (base.c_summonDuration <= 0)
3669 {
3670 Die();
3671 return;
3672 }
3673 }
3675 {
3676 AddCondition<ConWet>(20);
3677 }
3678 switch (turn % 50)
3679 {
3680 case 0:
3681 happiness = (hunger.value + stamina.value + depression.value + bladder.value + hygiene.value) / 5;
3682 break;
3683 case 1:
3684 if (!IsPC || !EClass.debug.godMode)
3685 {
3686 if (EClass.rnd(2) == 0 && !HasCondition<ConAwakening>())
3687 {
3688 sleepiness.Mod(1);
3689 }
3690 if (EClass.rnd(3) == 0)
3691 {
3692 hunger.Mod(1);
3693 }
3694 if (IsPC && (sleepiness.GetPhase() != 0 || stamina.GetPhase() <= 1))
3695 {
3696 Tutorial.Play("sleep");
3697 }
3698 }
3699 break;
3700 case 2:
3701 if (parasite != null)
3702 {
3703 ModExp(227, (EClass._zone.IsRegion ? 5 : 40) * 100 / Mathf.Max(100, 100 + (elements.Base(227) - parasite.LV) * 25));
3704 }
3705 if (ride != null)
3706 {
3707 ModExp(226, (EClass._zone.IsRegion ? 5 : 40) * 100 / Mathf.Max(100, 100 + (elements.Base(226) - ride.LV) * 25));
3708 }
3709 break;
3710 case 3:
3711 {
3712 int phase = hygiene.GetPhase();
3713 int num = 0;
3714 num = ((!IsPC) ? ((phase > 3) ? 50 : 0) : ((phase > 3) ? 50 : 0));
3715 if (num > EClass.rnd(100))
3716 {
3717 hygiene.Mod(-1);
3718 }
3719 break;
3720 }
3721 case 5:
3722 case 30:
3724 {
3725 AddCondition<ConBurning>(1000, force: true);
3726 }
3727 break;
3728 case 15:
3729 if (HasElement(1250) && !HasCondition<ConVampire>())
3730 {
3731 AddCondition<ConVampire>();
3732 }
3733 break;
3734 }
3735 if (turn % 200 == 0)
3736 {
3738 }
3739 if (IsPCParty)
3740 {
3741 if (dirtyWeight)
3742 {
3743 CalcBurden();
3744 }
3745 int phase2 = burden.GetPhase();
3746 int phase3 = hunger.GetPhase();
3747 if (phase3 >= 4)
3748 {
3749 preventRegen = true;
3750 }
3751 if (EClass.rnd(EClass._zone.IsRegion ? 100 : 30) == 0 && phase2 >= 3)
3752 {
3753 Say("dmgBurden", this);
3754 DamageHP(MaxHP * (base.ChildrenWeight * 100 / WeightLimit) / 1000 + 1, AttackSource.Burden);
3755 if (isDead)
3756 {
3757 return;
3758 }
3759 }
3760 if (EClass.rnd(12) == 0)
3761 {
3762 if (IsPC)
3763 {
3764 if (phase2 > 0)
3765 {
3766 ModExp(207, 1 + phase2 * phase2);
3767 }
3768 }
3769 else
3770 {
3771 ModExp(207, 4);
3772 }
3773 }
3774 if (IsPC)
3775 {
3776 if (phase3 >= 5)
3777 {
3778 if (!(ai is AI_Eat) && EClass.rnd(5) == 0)
3779 {
3780 DamageHP(1 + EClass.rnd(2) + MaxHP / 50, AttackSource.Hunger);
3781 }
3782 if (!isDead && EClass.rnd(3) == 0)
3783 {
3784 stamina.Mod(-1);
3785 }
3786 }
3787 if (isDead)
3788 {
3789 return;
3790 }
3791 phase3 = stamina.GetPhase();
3792 if (phase3 <= 0)
3793 {
3794 preventRegen = true;
3795 }
3797 {
3798 if (EClass.rnd(100) == 0 && !isConfused)
3799 {
3800 Msg.Say("rain_confuse");
3801 AddCondition<ConConfuse>(500);
3802 }
3803 if (EClass.rnd(300) == 0 && !isBlind)
3804 {
3805 Msg.Say("rain_confuse");
3806 AddCondition<ConBlind>(200);
3807 }
3808 }
3809 if (turn % (200000 / Mathf.Max(100 + Evalue(409) * 10, 50)) == 0)
3810 {
3811 ModCorruption(1);
3812 }
3813 }
3814 }
3815 if (!IsPC)
3816 {
3817 int num2 = Evalue(409);
3818 if (num2 > 0 && turn % (200000 / Mathf.Max(100 + num2 * 10, 50)) == 0)
3819 {
3820 ModCorruption(1);
3821 }
3822 }
3823 for (int num3 = conditions.Count - 1; num3 >= 0; num3--)
3824 {
3825 if (num3 < conditions.Count)
3826 {
3827 Condition condition = conditions[num3];
3828 if (!condition.TimeBased)
3829 {
3830 condition.Tick();
3831 }
3832 if (!condition.IsKilled)
3833 {
3834 if (condition.ConsumeTurn)
3835 {
3836 consumeTurn = true;
3837 }
3838 if (condition.PreventRegen)
3839 {
3840 preventRegen = true;
3841 }
3842 if (condition.EmoIcon != 0 && condition.EmoIcon > emoIcon)
3843 {
3844 emoIcon = condition.EmoIcon;
3845 }
3846 }
3847 if (isDead)
3848 {
3849 return;
3850 }
3851 }
3852 }
3853 if (id == "tsunami")
3854 {
3855 if (elements.Base(79) < 30)
3856 {
3857 Die();
3858 return;
3859 }
3860 if (IsInCombat)
3861 {
3862 elements.SetTo(79, elements.Base(79) * 3 / 4);
3863 }
3864 }
3865 if (!preventRegen)
3866 {
3867 if (EClass.rnd(25) == 0 && base.hp < MaxHP)
3868 {
3869 HealHP(EClass.rnd(Evalue(300) / 3 + 1) + 1);
3870 elements.ModExp(300, 8f);
3871 }
3872 if (EClass.rnd(8) == 0 && mana.value < mana.max)
3873 {
3874 mana.Mod(EClass.rnd(Evalue(301) / 2 + 1) + 1);
3875 elements.ModExp(301, 8f);
3876 }
3877 if (EClass.rnd(20) == 0 && !IsPC && stamina.value < stamina.max)
3878 {
3879 stamina.Mod(EClass.rnd(5) + 1);
3880 }
3881 }
3882 }
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:85
void TickCooldown()
Definition: Chara.cs:8650
void DiminishTempElements(int a=1)
Definition: Chara.cs:10228
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:5254
bool isBlind
Definition: Chara.cs:130
static bool preventRegen
Definition: Chara.cs:182
void CalcBurden()
Definition: Chara.cs:1819
virtual bool IsKilled
Definition: Condition.cs:7
override void Tick()
Definition: Condition.cs:70
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 8650 of file Chara.cs.

8651 {
8652 for (int num = _cooldowns.Count - 1; num >= 0; num--)
8653 {
8654 if (_cooldowns[num] % 1000 == 1)
8655 {
8656 _cooldowns.RemoveAt(num);
8657 }
8658 else
8659 {
8660 _cooldowns[num]--;
8661 }
8662 }
8663 if (_cooldowns.Count == 0)
8664 {
8665 _cooldowns = null;
8666 }
8667 }

◆ TickWork()

void Chara.TickWork ( VirtualDate  date)
inline

Definition at line 9070 of file Chara.cs.

9071 {
9073 if (span != TimeTable.Span.Work && span != 0)
9074 {
9075 return;
9076 }
9077 WorkSummary workSummary = GetWorkSummary();
9078 if (span == TimeTable.Span.Work)
9079 {
9080 if (workSummary.work != null)
9081 {
9082 PerformWork(workSummary.work, isHobby: false, date.IsRealTime);
9083 }
9084 }
9085 else if (workSummary.hobbies.Count > 0)
9086 {
9087 PerformWork(workSummary.hobbies.RandomItem(), isHobby: true, date.IsRealTime);
9088 }
9089 }
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 1172 of file Chara.cs.

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

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

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

◆ TryAbsorbRod()

void Chara.TryAbsorbRod ( Thing  t)
inline

Definition at line 4328 of file Chara.cs.

4329 {
4330 if (!IsPC || !(t.trait is TraitRod) || t.c_charges <= 0 || !HasElement(1564))
4331 {
4332 return;
4333 }
4334 Say("absorbRod", this, t);
4335 TraitRod rod = t.trait as TraitRod;
4336 bool flag = false;
4337 if (rod.source != null)
4338 {
4339 using IEnumerator<SourceElement.Row> enumerator = EClass.sources.elements.rows.Where((SourceElement.Row a) => a.id == rod.source.id).GetEnumerator();
4340 if (enumerator.MoveNext())
4341 {
4342 SourceElement.Row current = enumerator.Current;
4343 if (IsPC)
4344 {
4345 GainAbility(current.id, t.c_charges * 100, t);
4346 flag = true;
4347 }
4348 }
4349 }
4350 if (!flag)
4351 {
4352 mana.Mod(-50 * t.c_charges);
4353 }
4354 t.c_charges = 0;
4356 }
int c_charges
Definition: Card.cs:1269
void GainAbility(int ele, int mtp=100, Thing origin=null)
Definition: Chara.cs:9994

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

7252 {
7253 if (!IsPCFaction && !IsGuest())
7254 {
7255 return null;
7256 }
7257 foreach (Card item in EClass._map.props.installed.all)
7258 {
7259 if (item.trait is TraitBed traitBed && traitBed.CanAssign(this))
7260 {
7261 traitBed.AddHolder(this);
7262 Msg.Say("claimBed", this);
7263 return traitBed;
7264 }
7265 }
7266 return null;
7267 }
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 5557 of file Chara.cs.

5558 {
5560 {
5561 return;
5562 }
5563 int num = 0;
5564 bool flag = false;
5565 bool flag2 = false;
5566 Point point = pos.GetNearestPoint(allowBlock: true, allowChara: false, allowInstalled: false, ignoreCenter: true) ?? pos;
5567 TreasureType type = TreasureType.BossQuest;
5568 if (EClass._zone.Boss == this)
5569 {
5570 type = TreasureType.BossNefia;
5571 num = 2 + EClass.rnd(2);
5572 flag = (flag2 = true);
5573 EClass._zone.Boss = null;
5574 Msg.Say("boss_win", EClass._zone.Name);
5576 {
5577 Msg.Say("boss_win_void", EClass._zone.Name);
5578 EClass.player.flags.KilledBossInVoid = true;
5579 }
5580 if (EClass._zone.IsNefia)
5581 {
5584 SE.Play("Jingle/fanfare2");
5585 EClass._zone.SetBGM(114, refresh: true, 3f);
5586 }
5589 }
5590 switch (id)
5591 {
5592 case "vernis_boss":
5593 num = 5;
5594 flag = (flag2 = true);
5595 EClass.Sound.StopBGM(3f);
5596 EClass._zone.SetBGM(1, refresh: false);
5597 if (EClass.game.quests.GetPhase<QuestVernis>() == 8)
5598 {
5599 EClass.game.quests.Get<QuestVernis>().UpdateOnTalk();
5600 }
5601 break;
5602 case "lurie_boss":
5603 if (!(EClass._zone is Zone_Exile))
5604 {
5605 num = 5;
5606 flag = (flag2 = true);
5607 EClass._zone.SetBGM(120, refresh: true, 3f);
5609 {
5610 EClass.game.quests.Get<QuestNegotiationDarkness>().ChangePhase(4);
5611 EClass.player.flags.killedDuponne = true;
5612 }
5613 }
5614 break;
5615 case "ungaga_pap":
5616 num = 5;
5617 flag = (flag2 = true);
5619 {
5620 EClass._zone.SetBGM(46, refresh: true, 3f);
5621 }
5622 break;
5623 case "melilith_boss":
5624 num = 5;
5625 flag = (flag2 = true);
5626 EClass.Sound.StopBGM(3f);
5627 EClass._zone.SetBGM(1, refresh: false);
5628 break;
5629 case "doga":
5630 {
5631 QuestCurry questCurry = EClass.game.quests.Get<QuestCurry>();
5632 if (questCurry != null)
5633 {
5634 num = 5;
5635 flag = (flag2 = true);
5636 EClass.Sound.StopBGM(3f);
5637 EClass._zone.SetBGM(1, refresh: false);
5638 questCurry.NextPhase();
5639 }
5640 break;
5641 }
5642 case "fairy_raina":
5643 case "fairy_poina":
5644 {
5645 bool num2 = EClass._map.FindChara((id == "fairy_raina") ? "fairy_poina" : "fairy_raina") == null;
5646 QuestNasu questNasu = EClass.game.quests.Get<QuestNasu>();
5647 if (num2 && questNasu != null && questNasu.phase <= 1)
5648 {
5649 if (questNasu.phase == 0)
5650 {
5651 questNasu.NextPhase();
5652 }
5653 num = 5;
5654 flag = (flag2 = true);
5655 EClass.Sound.StopBGM(3f);
5656 EClass._zone.SetBGM(1, refresh: false);
5657 EClass.player.DropReward(ThingGen.Create("backpack_holding"));
5658 questNasu.NextPhase();
5659 }
5660 break;
5661 }
5662 case "isygarad":
5663 {
5664 num = 5;
5665 flag = (flag2 = true);
5666 QuestExploration questExploration = EClass.game.quests.Get<QuestExploration>();
5667 if (questExploration != null)
5668 {
5669 SE.Play("kill_boss");
5670 questExploration.ChangePhase(3);
5671 EClass.Sound.StopBGM(3f);
5672 EClass._zone.SetBGM(1, refresh: false);
5673 }
5674 break;
5675 }
5676 case "swordkeeper":
5677 num = 10;
5678 flag = true;
5679 SE.Play("kill_boss");
5680 SoundManager.ForceBGM();
5681 LayerDrama.Activate("_event", "event", "swordkeeper_defeat");
5682 break;
5683 }
5684 if (flag)
5685 {
5686 SE.Play("kill_boss");
5687 }
5688 if (num != 0)
5689 {
5691 {
5692 EClass.player.stats.deepest = EClass._zone.DangerLv;
5693 Msg.Say("update_deepest", EClass.player.stats.deepest.ToString() ?? "");
5694 }
5696 {
5697 EClass.player.stats.deepestVoid = -EClass._zone.lv;
5698 Msg.Say("update_deepest_void", EClass.player.stats.deepestVoid.ToString() ?? "");
5699 }
5700 EClass.player.willAutoSave = true;
5701 Thing thing = ThingGen.CreateTreasure("chest_boss", base.LV, type);
5702 point.SetBlock();
5703 point.SetObj();
5704 EClass._zone.AddCard(thing, point).Install();
5705 ThingGen.TryLickChest(thing);
5706 }
5707 if (flag2)
5708 {
5710 }
5711 }
TreasureType
Definition: TreasureType.cs:2
bool KilledBossInVoid
Definition: Player.cs:419
int deepest
Definition: Player.cs:114
long nefiaBeaten
Definition: Player.cs:136
int deepestVoid
Definition: Player.cs:117
void ModFame(int a)
Definition: Player.cs:2090
void SetObj(int id=0, int value=1, int dir=0)
Definition: Point.cs:928
void SetBlock(int idMat=0, int idBlock=0)
Definition: Point.cs:918
int phase
Definition: Quest.cs:40
void NextPhase()
Definition: Quest.cs:572
void ChangePhase(int a)
Definition: Quest.cs:577
bool isConquered
Definition: Spatial.cs:382
static void TryLickChest(Thing chest)
Definition: ThingGen.cs:409
static Thing CreateTreasure(string id, int lv, TreasureType type=TreasureType.Map)
Definition: ThingGen.cs:256
static Thing CreateScroll(int ele, int num=1)
Definition: ThingGen.cs:182
virtual bool IsNefia
Definition: Zone.cs:282
void SetBGM(List< int > ids, bool refresh=true, float fadeDuration=0f)
Definition: Zone.cs:2923
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.Stats.deepest, Player.Stats.deepestVoid, 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, Spatial.lv, Player.ModFame(), Player.ModKarma(), Spatial.Name, Player.Stats.nefiaBeaten, Quest.NextPhase(), Quest.phase, EClass.player, Game.quests, EClass.rnd(), EClass.rndHalf(), Msg.Say(), Zone.SetBGM(), Point.SetBlock(), Point.SetObj(), EClass.Sound, Player.stats, and ThingGen.TryLickChest().

Referenced by ActEffect.Proc().

◆ TryDropCarryOnly()

void Chara.TryDropCarryOnly ( )
inline

Definition at line 4545 of file Chara.cs.

4546 {
4547 if (held != null && held.trait.CanOnlyCarry)
4548 {
4549 DropHeld();
4550 }
4551 foreach (Thing item in things.List((Thing t) => t.trait.CanOnlyCarry))
4552 {
4553 DropThing(item);
4554 }
4555 }
void DropThing(Thing t, int num=-1)
Definition: Chara.cs:4577

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

◆ TryEquip()

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

Definition at line 7645 of file Chara.cs.

7646 {
7647 if (!ShouldEquip(t, useFav))
7648 {
7649 return false;
7650 }
7651 if (t.category.slot == 0)
7652 {
7653 return false;
7654 }
7655 if (useFav)
7656 {
7657 BodySlot slot = body.GetSlot(t);
7658 switch (GetFavAttackStyle())
7659 {
7660 case AttackStyle.Default:
7661 case AttackStyle.TwoHand:
7662 if (t.IsMeleeWeapon)
7663 {
7664 slot = body.slotMainHand;
7665 }
7666 break;
7667 case AttackStyle.Shield:
7668 if (t.IsMeleeWeapon)
7669 {
7670 slot = body.slotMainHand;
7671 }
7672 break;
7673 }
7674 body.Equip(t, slot);
7675 }
7676 else
7677 {
7678 body.Equip(t);
7679 }
7680 Say("equip", this, t);
7681 return true;
7682 }
bool ShouldEquip(Thing t, bool useFav=false)
Definition: Chara.cs:7533

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

7766 {
7767 if (IsPC)
7768 {
7770 if (thing?.trait is TraitToolRange && CanEquipRanged(thing))
7771 {
7772 ranged = thing;
7773 return true;
7774 }
7775 return false;
7776 }
7777 if (ranged != null && ranged.parent == this)
7778 {
7779 return true;
7780 }
7782 return ranged != null;
7783 }
Thing GetBestRangedWeapon()
Definition: Chara.cs:7750

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

7690 {
7691 Thing dest = null;
7692 if (IsPC)
7693 {
7695 {
7696 return FindThrowable(hotbar: true);
7697 }
7698 return null;
7699 }
7700 things.Foreach(delegate(Thing t)
7701 {
7702 if (t.HasTag(CTAG.throwWeapon) || (!base.IsPCFactionOrMinion && t.HasTag(CTAG.throwWeaponEnemy)))
7703 {
7704 dest = t;
7705 }
7706 });
7707 return dest;
7708 Thing FindThrowable(bool hotbar)
7709 {
7710 things.Foreach(delegate(Thing t)
7711 {
7712 if (dest == null)
7713 {
7714 if (t.IsHotItem)
7715 {
7716 if (!hotbar)
7717 {
7718 return;
7719 }
7720 }
7721 else if (hotbar)
7722 {
7723 return;
7724 }
7725 if (t.HasTag(CTAG.throwWeapon))
7726 {
7727 dest = t;
7728 }
7729 }
7730 });
7731 return dest;
7732 }
7733 }

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

4407 {
4408 if (held == t)
4409 {
4410 return true;
4411 }
4412 if (t.isDestroyed || t.Num <= 0)
4413 {
4414 return false;
4415 }
4416 if (!CanPick(t))
4417 {
4418 if (t.parent == null)
4419 {
4420 EClass._zone.AddCard(t, pos);
4421 }
4422 return false;
4423 }
4424 HoldCard(t, num);
4425 return true;
4426 }
bool CanPick(Card c)
Definition: Chara.cs:4226
void HoldCard(Card t, int num=-1)
Definition: Chara.cs:4428

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

7912 {
7913 int num = Evalue(289);
7914 if (num == 0)
7915 {
7916 return false;
7917 }
7918 int lV = t.LV;
7919 if (EClass.rnd(num * num + 5) > EClass.rnd(lV * lV) * 20)
7920 {
7921 t.Identify(show, (num >= 20) ? IDTSource.SkillHigh : IDTSource.Skill);
7922 int num2 = 50;
7923 if (lV > num)
7924 {
7925 num2 += (lV - num) * 10;
7926 }
7927 elements.ModExp(289, Mathf.Min(num2, 1000));
7928 return true;
7929 }
7930 return false;
7931 }
IDTSource
Definition: IDTSource.cs:2
Thing Identify(bool show=true, IDTSource idtSource=IDTSource.Identify)
Definition: Thing.cs:2069

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

2711 {
2712 foreach (Condition condition in conditions)
2713 {
2714 if (!condition.TryMove(newPoint))
2715 {
2716 return MoveResult.Fail;
2717 }
2718 }
2719 if (base.isRestrained)
2720 {
2721 if (!IsPC)
2722 {
2723 return MoveResult.Fail;
2724 }
2725 base.isRestrained = false;
2726 }
2727 if (!CanMoveTo(newPoint, allowDestroyPath))
2728 {
2729 return MoveResult.Fail;
2730 }
2731 return _Move(newPoint);
2732 }
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 2670 of file Chara.cs.

2671 {
2673 {
2674 return MoveResult.Fail;
2675 }
2676 Point point = p.Copy();
2677 int num = p.x - pos.x;
2678 int num2 = p.z - pos.z;
2679 if (num > 1)
2680 {
2681 num = 1;
2682 }
2683 else if (num < -1)
2684 {
2685 num = -1;
2686 }
2687 if (num2 > 1)
2688 {
2689 num2 = 1;
2690 }
2691 else if (num2 < -1)
2692 {
2693 num2 = -1;
2694 }
2695 if (num == 0 && num2 == 0)
2696 {
2697 num = EClass.rnd(3) - 1;
2698 num2 = EClass.rnd(3) - 1;
2699 }
2700 point.Set(pos);
2701 point.x -= num;
2702 point.z -= num2;
2703 if (point.IsValid && !point.HasChara)
2704 {
2705 return TryMove(point, allowDestroyPath: false);
2706 }
2707 return MoveResult.Fail;
2708 }
bool TooHeavyToMove()
Definition: Player.cs:2554

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

2609 {
2610 if (p.Equals(pos))
2611 {
2612 return MoveResult.Success;
2613 }
2615 {
2616 return MoveResult.Fail;
2617 }
2618 bool flag = true;
2619 Point point = null;
2620 _sharedPos.Set(p);
2621 if (CanDestroyPath())
2622 {
2624 {
2625 return MoveResult.Success;
2626 }
2627 Debug.Log(CanMoveTo(pos));
2629 }
2630 int num = pos.Distance(p);
2631 PathProgress pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Default, num + 4, 1);
2632 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 4)
2633 {
2634 PathFinderNode pathFinderNode = pathProgress.nodes[pathProgress.nodes.Count - 1];
2635 if (TryMove(new Point(pathFinderNode.X, pathFinderNode.Z)) == MoveResult.Success)
2636 {
2637 return MoveResult.Success;
2638 }
2639 }
2640 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Combat, num + 4, 1);
2641 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 4)
2642 {
2643 PathFinderNode pathFinderNode2 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2644 if (TryMove(new Point(pathFinderNode2.X, pathFinderNode2.Z)) == MoveResult.Success)
2645 {
2646 return MoveResult.Success;
2647 }
2648 }
2649 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Default, num + 25, 2);
2650 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 25)
2651 {
2652 PathFinderNode pathFinderNode3 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2653 if (TryMove(new Point(pathFinderNode3.X, pathFinderNode3.Z)) == MoveResult.Success)
2654 {
2655 return MoveResult.Success;
2656 }
2657 }
2658 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Combat, num + 25, 2);
2659 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 25)
2660 {
2661 PathFinderNode pathFinderNode4 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2662 if (TryMove(new Point(pathFinderNode4.X, pathFinderNode4.Z)) == MoveResult.Success)
2663 {
2664 return MoveResult.Success;
2665 }
2666 }
2667 return MoveResult.Fail;
2668 }
static Point _sharedPos
Definition: Chara.cs:174
void RequestPathImmediate(PathProgress progress)
Definition: PathManager.cs:41
List< PathFinderNode > nodes
Definition: PathProgress.cs:16
Point GetPointTowards(Point dest)
Definition: Point.cs:801

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

9548 {
9549 if (TC == null || TC.HasCondition<ConInvulnerable>() || TC.Evalue(1421) > 0 || !TC.ExistsOnMap)
9550 {
9551 return false;
9552 }
9553 if (TC.hp > (long)TC.MaxHP * (long)Mathf.Min(5 + (int)Mathf.Sqrt(power), harvest ? 35 : 25) / 100)
9554 {
9555 return false;
9556 }
9557 if (TC.HasElement(427))
9558 {
9559 return false;
9560 }
9561 if (TC.IsPC && EClass.player.invlunerable)
9562 {
9563 return false;
9564 }
9565 PlaySound("hit_finish");
9566 Say("finish");
9567 Say("finish2", this, TC);
9568 TC.DamageHP(TC.MaxHP, AttackSource.Finish, this);
9569 return false;
9570 }
@ harvest
bool invlunerable
Definition: Player.cs:1173
Definition: TC.cs:4

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

Referenced by ActEffect.Proc().

◆ TryNullifyCurse()

bool Chara.TryNullifyCurse ( )
inline

Definition at line 10018 of file Chara.cs.

10019 {
10020 if (IsPCParty)
10021 {
10022 foreach (Chara member in EClass.pc.party.members)
10023 {
10024 if (member.HasElement(1641) && EClass.rnd(3) != 0)
10025 {
10026 Msg.Say("curse_nullify", member);
10027 return true;
10028 }
10029 }
10030 }
10031 else if (HasElement(1641) && EClass.rnd(3) != 0)
10032 {
10033 Say("curse_nullify", this);
10034 return true;
10035 }
10036 if (GetCondition<ConHolyVeil>() != null && EClass.rnd(5) != 0)
10037 {
10038 Say("curse_nullify", this);
10039 return true;
10040 }
10041 return false;
10042 }

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

◆ TryPickGroundItem()

void Chara.TryPickGroundItem ( )
inline

Definition at line 4382 of file Chara.cs.

4383 {
4384 foreach (Card item in pos.ListCards())
4385 {
4386 if ((IsPC || !(EClass.pc.ai is AI_UseCrafter aI_UseCrafter) || !aI_UseCrafter.ings.Contains(item)) && item.isThing && item.placeState == PlaceState.roaming && CanPick(item))
4387 {
4388 Thing thing = Pick(item.Thing);
4389 if (thing != null && !IsPC)
4390 {
4391 thing.isNPCProperty = true;
4392 }
4393 break;
4394 }
4395 }
4396 }

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

Referenced by AI_Fish.Run().

◆ TryPoisonPotion()

Thing Chara.TryPoisonPotion ( Thing  t)
inline

Definition at line 4314 of file Chara.cs.

4315 {
4316 if (t.trait is TraitPotion && t.id != "1165" && !t.source.tag.Contains("neg") && EClass.rnd(2) == 0 && HasElement(1565))
4317 {
4318 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)
4319 .id;
4320 Say("poisonDrip", this);
4321 int num = t.Num;
4322 t.Destroy();
4323 t = ThingGen.Create(text).SetNum(num);
4324 }
4325 return t;
4326 }
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 3207 of file Chara.cs.

3208 {
3209 List<Chara> list = point.ListCharas();
3210 if (list.Count == 0)
3211 {
3212 return;
3213 }
3214 list.Copy().ForeachReverse(delegate(Chara c)
3215 {
3216 if (!c.ai.IsMoveAI && !c.IsPC && c.trait.CanBePushed && c != this && !c.noMove && (!EClass._zone.IsRegion || c.IsPCFactionOrMinion))
3217 {
3218 List<Point> list2 = new List<Point>();
3219 for (int i = point.x - 1; i <= point.x + 1; i++)
3220 {
3221 for (int j = point.z - 1; j <= point.z + 1; j++)
3222 {
3223 if (i != point.x || j != point.z)
3224 {
3225 Point point2 = new Point(i, j);
3226 if (point2.IsValid && !point2.HasChara && !point2.IsBlocked && !point2.cell.hasDoor && !point2.IsBlockByHeight(point))
3227 {
3228 list2.Add(point2);
3229 }
3230 }
3231 }
3232 }
3233 if (list2.Count > 0)
3234 {
3235 if (list2.Count > 1)
3236 {
3237 list2.ForeachReverse(delegate(Point p)
3238 {
3239 if (p.Equals(new Point(point.x + point.x - pos.x, point.z + point.z - pos.z)))
3240 {
3241 list2.Remove(p);
3242 }
3243 });
3244 }
3245 Point newPoint = list2.RandomItem();
3246 if (IsPC)
3247 {
3248 Say("displace", this, c);
3249 PlaySound("push");
3250 }
3251 else if (c.isSynced)
3252 {
3253 c.PlayEffect("push");
3254 }
3255 c.MoveByForce(newPoint, this, checkWall: true);
3256 if (!c.IsPC && c.trait is TraitRogue && EClass.rnd(3) == 0 && GetCurrency() > 20 && !HasElement(426))
3257 {
3258 int num = EClass.rndHalf(10 + Mathf.Min(GetCurrency() / 100, 1000));
3259 c.Talk("pushed");
3260 Say("pushed_money", this, c);
3261 ModCurrency(-num);
3262 c.ModCurrency(num);
3263 c.PlaySound("steal_money");
3264 }
3265 else if (IsPC && !c.IsPCParty && !c.IsUnique && c.IsHumanSpeak && EClass.rnd(5) == 0)
3266 {
3267 c.Talk("pushed");
3268 }
3269 }
3270 }
3271 });
3272 }
bool IsMoveAI
Definition: AIAct.cs:55
bool IsHumanSpeak
Definition: Chara.cs:1015

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

4399 {
4400 if (!EClass._zone.TryAddThingInSharedContainer(t, containers) && dropIfFail)
4401 {
4402 EClass._zone.AddCard(t, pos);
4403 }
4404 }
bool TryAddThingInSharedContainer(Thing t, List< Thing > containers=null, bool add=true, bool msg=false, Chara chara=null, bool sharedOnly=true)
Definition: Zone.cs:2102

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

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

7270 {
7271 if (GetInt(113) != 0)
7272 {
7273 return;
7274 }
7275 _ListItems.Clear();
7276 Thing bestRangedWeapon = GetBestRangedWeapon();
7277 foreach (Thing thing in things)
7278 {
7279 if (!thing.IsAmmo)
7280 {
7281 if (thing.category.slot != 0 && !thing.isEquipped && !thing.HasTag(CTAG.gift))
7282 {
7283 _ListItems.Add(thing);
7284 }
7285 else if (thing.IsRangedWeapon && thing.category.slot == 0 && bestRangedWeapon != thing)
7286 {
7287 _ListItems.Add(thing);
7288 }
7289 }
7290 }
7291 if (_ListItems.Count == 0)
7292 {
7293 return;
7294 }
7295 List<Thing> containers2 = containers.ToList();
7296 foreach (Thing listItem in _ListItems)
7297 {
7298 EClass._zone.TryAddThingInSharedContainer(listItem, containers2, add: true, msg: true, this);
7299 }
7300 }
void Add(Act a, string s="")
Definition: ActPlan.cs:11
static List< Thing > _ListItems
Definition: Chara.cs:190

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

4359 {
4360 if (t.id == "axe")
4361 {
4362 Tutorial.Reserve("tool");
4363 }
4364 if (t.category.id == "mushroom")
4365 {
4366 Tutorial.Reserve("food");
4367 }
4368 if (t.category.id == "herb")
4369 {
4370 Tutorial.Reserve("herb");
4371 }
4372 if (t.id == "pasture")
4373 {
4374 Tutorial.Reserve("pasture");
4375 }
4376 if (t.id == "log")
4377 {
4378 Tutorial.Reserve("process");
4379 }
4380 }

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

◆ TryRestock()

void Chara.TryRestock ( bool  onCreate)
inline

Definition at line 4639 of file Chara.cs.

4640 {
4641 isOnCreate = onCreate;
4642 if (onCreate || (!IsPCFaction && (base.IsUnique || trait is TraitAdventurer || trait is TraitGuard)))
4643 {
4644 RestockEquip((!EClass.core.IsGameStarted || !(EClass._zone is Zone_Music)) && onCreate);
4645 }
4646 RestockInventory(onCreate);
4647 }
void RestockInventory(bool onCreate)
Definition: Chara.cs:4933
void RestockEquip(bool onCreate)
Definition: Chara.cs:4649

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

6247 {
6248 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))
6249 {
6250 SetEnemy(c);
6251 }
6252 }

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

7308 {
7310 }
void TryTakeSharedItems(bool msg=true)
Definition: Chara.cs:7307

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

7313 {
7314 if (base.isSummon || (memberType == FactionMemberType.Livestock && homeBranch != null && !homeBranch.policies.IsActive(2715)))
7315 {
7316 return;
7317 }
7318 int num = 2;
7319 int num2 = 1;
7320 int num3 = 2;
7321 bool flag = GetInt(113) == 0;
7322 int num4 = 2;
7323 int num5 = 2;
7324 int num6 = 2;
7326 {
7327 num5 = 0;
7328 num6 = 0;
7329 }
7330 foreach (Thing thing3 in things)
7331 {
7332 if (CanEat(thing3, shouldEat))
7333 {
7334 if (thing3.HasElement(757))
7335 {
7336 num2 -= thing3.Num;
7337 }
7338 else
7339 {
7340 num -= thing3.Num;
7341 }
7342 }
7343 if (thing3.trait.GetHealAction(this) != null)
7344 {
7345 num3 -= thing3.Num;
7346 }
7347 if (thing3.id == "polish_powder")
7348 {
7349 num4 -= thing3.Num;
7350 }
7351 if (thing3.trait is TraitBlanketColdproof)
7352 {
7353 num5 -= thing3.Num;
7354 }
7355 if (thing3.trait is TraitBlanketFireproof)
7356 {
7357 num6 -= thing3.Num;
7358 }
7359 }
7360 _ListItems.Clear();
7361 foreach (Thing container in containers)
7362 {
7363 if (!container.IsSharedContainer)
7364 {
7365 continue;
7366 }
7367 foreach (Thing thing4 in container.things)
7368 {
7369 if (!thing4.c_isImportant && thing4.IsIdentified)
7370 {
7371 if (num4 > 0 && thing4.id == "polish_powder")
7372 {
7373 _ListItems.Add(thing4);
7374 num4 -= thing4.Num;
7375 }
7376 else if (num5 > 0 && !HasElement(1236) && thing4.trait is TraitBlanketColdproof)
7377 {
7378 _ListItems.Add(thing4);
7379 num5 -= thing4.Num;
7380 }
7381 else if (num6 > 0 && thing4.trait is TraitBlanketFireproof)
7382 {
7383 _ListItems.Add(thing4);
7384 num6 -= thing4.Num;
7385 }
7386 else if (num2 > 0 && CanEat(thing4, shouldEat) && !thing4.c_isImportant && thing4.HasElement(757))
7387 {
7388 _ListItems.Add(thing4);
7389 num2 -= thing4.Num;
7390 }
7391 else if (num > 0 && CanEat(thing4, shouldEat) && !thing4.c_isImportant)
7392 {
7393 _ListItems.Add(thing4);
7394 num -= thing4.Num;
7395 }
7396 else if (num3 > 0 && thing4.trait.GetHealAction(this) != null)
7397 {
7398 _ListItems.Add(thing4);
7399 num3 -= thing4.Num;
7400 }
7401 else if (flag && thing4.IsEquipmentOrRanged && !thing4.HasTag(CTAG.gift) && ShouldEquip(thing4, useFav: true))
7402 {
7403 _ListItems.Add(thing4);
7404 }
7405 }
7406 }
7407 }
7408 if (_ListItems.Count == 0)
7409 {
7410 return;
7411 }
7412 _ListItems.ForeachReverse(delegate(Thing t)
7413 {
7414 if (t.IsEquipmentOrRanged)
7415 {
7416 bool flag3 = false;
7417 int slot = t.category.slot;
7418 int equipValue = t.GetEquipValue();
7419 foreach (Thing listItem in _ListItems)
7420 {
7421 if (listItem.category.slot == slot && listItem.GetEquipValue() > equipValue)
7422 {
7423 flag3 = true;
7424 break;
7425 }
7426 }
7427 if (flag3)
7428 {
7429 _ListItems.Remove(t);
7430 }
7431 }
7432 });
7433 bool flag2 = false;
7434 foreach (Thing listItem2 in _ListItems)
7435 {
7436 Thing thing = listItem2;
7437 if (things.IsFull(thing))
7438 {
7439 break;
7440 }
7441 Thing thing2 = listItem2.parent as Thing;
7442 if (thing.HasElement(757))
7443 {
7444 if (thing.Num > 1)
7445 {
7446 thing = thing.Split(1);
7447 }
7448 }
7449 else if (thing.Num > 2)
7450 {
7451 thing = thing.Split(2);
7452 }
7453 if (msg)
7454 {
7455 Say("takeSharedItem", this, thing, thing2.GetName(NameStyle.Full));
7456 }
7457 AddCard(thing);
7458 if (ShouldEquip(thing, useFav: true) && thing.category.slot != 0)
7459 {
7460 TryEquip(thing, useFav: true);
7461 flag2 = true;
7462 }
7463 }
7464 if (flag2 && flag)
7465 {
7466 TryPutSharedItems(containers);
7467 }
7468 }
bool IsIdentified
Definition: Card.cs:2377
bool HasItemProtection
bool IsActive(int id, int days=-1)
override string GetName(NameStyle style, int _num=-1)
Definition: Thing.cs:531
bool IsSharedContainer
Definition: Thing.cs:112

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

8470 {
8471 if (!EClass.debug.enable || IsPC || !IsGlobal || !IsPCFaction)
8472 {
8473 return;
8474 }
8475 for (int i = 0; i < 100; i++)
8476 {
8477 if (base.feat == 0)
8478 {
8479 break;
8480 }
8481 if (base.c_upgrades == null)
8482 {
8483 base.c_upgrades = new CharaUpgrade();
8484 }
8485 if (base.c_upgrades.halt)
8486 {
8487 break;
8488 }
8489 Rand.SetSeed(base.uid + base.c_upgrades.count);
8490 int num = EClass.rnd(100);
8491 int num2 = 0;
8492 int num3 = 1;
8493 int num4 = 0;
8494 bool flag = false;
8495 IEnumerable<SourceElement.Row> ie = EClass.sources.elements.rows.Where((SourceElement.Row a) => !elements.Has(a) && a.category == "skill" && !a.tag.Contains("noPet"));
8496 List<Element> list = ListAvailabeFeats(pet: true);
8497 if (num >= 90 && list.Count > 0)
8498 {
8499 Element element = list.RandomItem();
8500 num2 = element.id;
8501 num4 = element.CostLearn;
8502 }
8503 else if (num >= 60 && ie.Any())
8504 {
8505 num2 = ie.RandomItem().id;
8506 num4 = 3;
8507 }
8508 else
8509 {
8510 num2 = Element.List_MainAttributesMajor.RandomItem();
8511 num4 = 1;
8512 num3 = 2;
8513 flag = true;
8514 }
8515 Rand.SetSeed();
8516 if (num4 > base.feat)
8517 {
8518 break;
8519 }
8520 base.feat -= num4;
8521 base.c_upgrades.count++;
8522 base.c_upgrades.spent += num4;
8523 bool flag2 = false;
8524 if (flag)
8525 {
8526 foreach (CharaUpgrade.Item item in base.c_upgrades.items)
8527 {
8528 if (item.idEle == num2)
8529 {
8530 item.value += num3;
8531 item.cost += num4;
8532 flag2 = true;
8533 break;
8534 }
8535 }
8536 }
8537 if (!flag2)
8538 {
8539 base.c_upgrades.items.Add(new CharaUpgrade.Item
8540 {
8541 idEle = num2,
8542 value = num3,
8543 cost = num4
8544 });
8545 }
8546 SourceElement.Row row = EClass.sources.elements.map[num2];
8547 if (row.category == "feat")
8548 {
8549 SetFeat(num2, elements.ValueWithoutLink(num2) + 1, msg: true);
8550 }
8551 else if (elements.ValueWithoutLink(row.id) == 0)
8552 {
8553 elements.Learn(row.id);
8554 }
8555 else
8556 {
8557 elements.ModBase(num2, num3);
8558 }
8559 }
8560 }
List< Element > ListAvailabeFeats(bool pet=false, bool showAll=false)
Definition: Chara.cs:9782
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 WindowCharaMini.Refresh().

◆ TryUse()

bool Chara.TryUse ( Thing  t)
inline

Definition at line 7794 of file Chara.cs.

7795 {
7796 if (t.id == "338")
7797 {
7798 Thing thing = things.Find((Thing a) => a.IsEquipmentOrRanged && !a.isAcidproof);
7799 if (thing != null)
7800 {
7801 Say("dip", this, thing, t.GetName(NameStyle.Full, 1));
7802 SE.Change();
7803 t.trait.OnBlend(thing, this);
7804 return true;
7805 }
7806 return false;
7807 }
7808 if (t.IsNegativeGift || t.source.HasTag(CTAG.ignoreUse))
7809 {
7810 return false;
7811 }
7812 if (t.id == "cigar")
7813 {
7814 (t.trait as TraitItemProc).OnUse(this);
7815 return true;
7816 }
7817 if (t.trait.CanEat(this) && hunger.GetPhase() > ((IsPCFaction || IsPCFactionMinion) ? 2 : 0))
7818 {
7820 {
7821 target = t
7822 });
7823 return true;
7824 }
7825 if (t.trait.CanDrink(this))
7826 {
7827 Drink(t);
7828 return true;
7829 }
7830 if (t.trait.CanRead(this))
7831 {
7833 {
7834 target = t
7835 });
7836 return true;
7837 }
7838 if (base.hp < MaxHP * 90 / 100)
7839 {
7840 Action healAction = t.trait.GetHealAction(this);
7841 if (healAction != null)
7842 {
7843 healAction();
7844 return true;
7845 }
7846 }
7847 return false;
7848 }
bool isAcidproof
Definition: Card.cs:686
void SetAIImmediate(AIAct g)
Definition: Chara.cs:8830
virtual bool CanRead(Chara c)
Definition: Trait.cs:970
virtual bool CanDrink(Chara c)
Definition: Trait.cs:988
virtual void OnBlend(Thing t, Chara c)
Definition: Trait.cs:614

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

9092 {
9093 if (EClass.world.date.IsExpired(GetInt(51)))
9094 {
9095 Expedition expedition = Expedition.Create(this, sourceWork.expedition.ToEnum<ExpeditionType>());
9096 SetInt(51, EClass.world.date.GetRaw() + 60 * (expedition.hours + 24));
9097 homeBranch.expeditions.Add(expedition);
9098 return true;
9099 }
9100 return false;
9101 }
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 3566 of file Chara.cs.

3567 {
3568 if (IsPCC)
3569 {
3570 if (base.dir == 0)
3571 {
3572 angle = 225f;
3573 }
3574 else if (base.dir == 1)
3575 {
3576 angle = 135f;
3577 }
3578 else if (base.dir == 2)
3579 {
3580 angle = 45f;
3581 }
3582 else if (base.dir == 3)
3583 {
3584 angle = -45f;
3585 }
3586 }
3587 else if (base.dir == 0)
3588 {
3589 angle = 165f;
3590 }
3591 else if (base.dir == 1)
3592 {
3593 angle = 300f;
3594 }
3595 else if (base.dir == 2)
3596 {
3597 angle = 0f;
3598 }
3599 else if (base.dir == 3)
3600 {
3601 angle = 120f;
3602 }
3603 }

Referenced by OnDeserialized().

◆ UpdateSight()

void Chara.UpdateSight ( )
inline

Definition at line 3627 of file Chara.cs.

3628 {
3629 int num = 4;
3630 for (int i = -num; i < num + 1; i++)
3631 {
3632 for (int j = -num; j < num + 1; j++)
3633 {
3634 shared.Set(pos.x + i, pos.z + j);
3635 if (shared.IsValid && !shared.cell.isSeen && i >= -1 && i <= 1 && j >= -1)
3636 {
3637 _ = 1;
3638 }
3639 }
3640 }
3641 }
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 5772 of file Chara.cs.

5773 {
5774 if (HasCooldown(a.id))
5775 {
5776 return false;
5777 }
5778 if (a.source.proc.TryGet(0) == "Heal" && HasElement(1422) && !IsPC)
5779 {
5780 List<int> list = new List<int> { 8400, 8401, 8402, 8403, 8404, 8405 };
5781 int num = list.IndexOf(a.id);
5782 if (num != -1)
5783 {
5784 int num2 = list.TryGet(num + Evalue(1422));
5785 a = elements.GetElement(num2)?.act ?? ACT.Create(num2);
5786 }
5787 }
5788 int num3 = 1;
5789 Act.Cost cost = a.GetCost(this);
5790 a.GetPower(this);
5791 int i = 1;
5792 int num4 = 0;
5793 bool flag = a.IsTargetHostileParty();
5794 if (IsPC && HasCondition<StanceManaCost>())
5795 {
5796 num4 = Evalue(1657);
5797 }
5798 _pts.Clear();
5799 if (a.TargetType.ForceParty)
5800 {
5801 pt = true;
5802 }
5803 if (pt)
5804 {
5805 i = 0;
5806 if (flag)
5807 {
5808 ForeachEnemy(delegate
5809 {
5810 i++;
5811 });
5812 }
5813 else
5814 {
5815 ForeachParty(delegate
5816 {
5817 i++;
5818 });
5819 }
5820 }
5821 if (a is Spell && IsPC && a.vPotential < i)
5822 {
5823 i = 1;
5824 _pts.Clear();
5825 _pts.Add(this);
5826 pt = false;
5827 }
5828 int num5 = 100;
5829 if (!a.TargetType.ForceParty && i > 1)
5830 {
5831 num5 = (IsPC ? (i * 100) : (50 + i * 50));
5832 }
5833 int num6 = cost.cost * num5 / 100;
5834 if (cost.type == Act.CostType.MP && Evalue(483) > 0)
5835 {
5836 num6 = num6 * 100 / (100 + (int)Mathf.Sqrt(Evalue(483) * 10) * 3);
5837 }
5838 if (i == 0)
5839 {
5840 if (IsPC)
5841 {
5843 }
5844 return false;
5845 }
5846 if (!IsPC && cost.type == Act.CostType.MP && mana.value < 0 && (EClass.rnd(4) != 0 || IsPCFaction || (base.IsPowerful && mana.value < -20)))
5847 {
5848 return false;
5849 }
5850 if (IsPC)
5851 {
5852 if (!Dialog.warned && cost.type == Act.CostType.MP && cost.cost > 0 && mana.value < num6 && !EClass.debug.godMode)
5853 {
5854 ActPlan.warning = true;
5855 Dialog.TryWarnMana(delegate
5856 {
5857 if (UseAbility(a, tc, pos, pt))
5858 {
5860 }
5861 });
5862 return false;
5863 }
5864 EClass.ui.CloseLayers();
5865 }
5866 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))
5867 {
5868 Say("shakeHead", this);
5869 return true;
5870 }
5871 if (tc != null && tc != this)
5872 {
5873 LookAt(tc.pos);
5874 }
5875 if (pos != null && !base.pos.Equals(pos))
5876 {
5877 LookAt(pos);
5878 }
5879 if (a.CanRapidFire && HasElement(1648))
5880 {
5881 num3 = 1 + Evalue(1648);
5882 }
5883 if (IsPC && cost.cost > 0 && a.Value == 0)
5884 {
5886 return false;
5887 }
5888 if (a is Spell)
5889 {
5890 string s = (isConfused ? "_cast_confuse" : (HasCondition<ConDim>() ? "_cast_dim" : ""));
5891 if (!a.source.tag.Contains("useHand"))
5892 {
5893 Say(race.castStyle.IsEmpty("cast"), this, a.source.GetName().ToLower(), s.lang());
5894 }
5895 if (IsPC)
5896 {
5897 _ = (i + 1) / 2;
5898 if (a.vPotential < i)
5899 {
5900 Msg.Say("noSpellStock");
5901 EInput.Consume();
5902 return false;
5903 }
5904 if (num4 > 0 && a.vPotential >= i * 2)
5905 {
5906 a.vPotential -= i * 2;
5907 num6 = num6 * (100 - num4 * 20) / 100;
5908 }
5909 else
5910 {
5911 a.vPotential -= i;
5912 }
5914 }
5915 }
5916 else if (a.source.langAct.Length != 0 && tc != null)
5917 {
5918 string text = a.source.langAct[0];
5919 string text2 = ((a.source.langAct.Length >= 2) ? a.source.langAct[1] : "");
5920 if (text == "spell_hand")
5921 {
5922 string[] list2 = Lang.GetList("attack" + race.meleeStyle.IsEmpty("Touch"));
5923 string @ref = text2.lang(list2[4]);
5924 Say(tc.IsPCParty ? "cast_hand_ally" : "cast_hand", this, tc, @ref, tc.IsPCParty ? list2[1] : list2[2]);
5925 }
5926 else
5927 {
5928 Say(text, this, tc, text2.IsEmpty() ? "" : text2.lang());
5929 }
5930 if (a.source.id == 6630)
5931 {
5932 Talk("insult_" + (base.IsMale ? "m" : "f"));
5933 }
5934 }
5935 switch (cost.type)
5936 {
5937 case Act.CostType.MP:
5938 if (Evalue(1421) >= 2 && base.hp <= MaxHP / (9 - Evalue(1421) * 2))
5939 {
5940 num6 /= 2;
5941 }
5942 PlayEffect("cast");
5943 mana.Mod(-num6);
5944 if (isDead)
5945 {
5946 return true;
5947 }
5948 elements.ModExp(304, Mathf.Clamp(num6 * 2, 1, 200));
5949 break;
5950 case Act.CostType.SP:
5951 stamina.Mod(-num6);
5952 ignoreSPAbsorb = true;
5953 break;
5954 }
5955 if (a is Spell && GetCondition<ConSilence>() != null)
5956 {
5957 Say("cast_silence", this);
5958 return true;
5959 }
5960 if (isDead)
5961 {
5962 return true;
5963 }
5964 int spellExp = elements.GetSpellExp(this, a, num5);
5965 if (EClass.rnd(100) >= CalcCastingChance(a, i) && !EClass.debug.godMode)
5966 {
5967 Say("fizzle", this);
5968 PlayEffect("fizzle");
5969 PlaySound("fizzle");
5970 if (cost.cost > 0 && a.source.lvFactor > 0)
5971 {
5972 ModExp(a.id, spellExp / 5);
5973 }
5974 RemoveCondition<ConInvisibility>();
5975 return true;
5976 }
5977 bool flag2 = true;
5978 if (a.source.cooldown > 0 && (!IsPC || !a.source.tag.Contains("CD_npc")))
5979 {
5980 AddCooldown(a.id, a.source.cooldown);
5981 }
5982 if (HasTalk("phrase_" + a.source.alias))
5983 {
5984 EClass.player.forceTalk = true;
5985 Talk("phrase_" + a.source.alias);
5986 }
5987 if (pt)
5988 {
5989 Act.forcePt = true;
5990 if (flag)
5991 {
5992 ForeachEnemy(delegate(Chara c)
5993 {
5994 a.Perform(this, c, c.pos);
5995 });
5996 }
5997 else
5998 {
5999 ForeachParty(delegate(Chara c)
6000 {
6001 a.Perform(this, c, c.pos);
6002 });
6003 }
6004 Act.forcePt = false;
6005 }
6006 else
6007 {
6008 for (int j = 0; j < num3; j++)
6009 {
6010 if (a.TargetType != TargetType.SelfParty && tc != null && !tc.IsAliveInCurrentZone)
6011 {
6012 break;
6013 }
6014 ActEffect.RapidCount = j;
6015 ActEffect.RapidDelay = a.RapidDelay;
6016 flag2 = a.Perform(this, tc, pos);
6017 }
6018 }
6019 if (flag2 && !isDead)
6020 {
6021 if (cost.cost > 0 && a.source.lvFactor > 0)
6022 {
6023 ModExp(a.id, spellExp);
6024 }
6025 if (a.source.alias.StartsWith("sword_"))
6026 {
6027 ModExp(101, 50);
6028 }
6029 }
6030 ActEffect.RapidCount = 0;
6031 if (flag2 && !a.source.tag.Contains("keepInvisi") && EClass.rnd(2) == 0)
6032 {
6033 RemoveCondition<ConInvisibility>();
6034 RemoveCondition<ConDark>();
6035 }
6036 return flag2;
6037 void ForeachEnemy(Action<Chara> action)
6038 {
6039 if (_pts.Count == 0)
6040 {
6041 for (int num10 = EClass._map.charas.Count - 1; num10 >= 0; num10--)
6042 {
6043 Chara chara3 = EClass._map.charas[num10];
6044 if (chara3 != this && CanSeeLos(chara3) && chara3.IsHostile(this))
6045 {
6046 _pts.Add(chara3);
6047 }
6048 }
6049 }
6050 for (int num11 = _pts.Count - 1; num11 >= 0; num11--)
6051 {
6052 action(_pts[num11]);
6053 }
6054 }
6055 void ForeachParty(Action<Chara> action)
6056 {
6057 if (_pts.Count == 0)
6058 {
6059 if (IsPCParty)
6060 {
6061 for (int num7 = EClass.pc.party.members.Count - 1; num7 >= 0; num7--)
6062 {
6063 Chara chara = EClass.pc.party.members[num7];
6064 if (chara == this || chara.host != null || CanSeeLos(chara))
6065 {
6066 _pts.Add(chara);
6067 }
6068 }
6069 }
6070 else
6071 {
6072 for (int num8 = EClass._map.charas.Count - 1; num8 >= 0; num8--)
6073 {
6074 Chara chara2 = EClass._map.charas[num8];
6075 if ((chara2 == this || (chara2.IsFriendOrAbove(this) && CanSeeLos(chara2))) && (chara2 == tc || _pts.Count < 3 || EClass.rnd(_pts.Count * _pts.Count) > 6))
6076 {
6077 _pts.Add(chara2);
6078 }
6079 }
6080 }
6081 }
6082 for (int num9 = _pts.Count - 1; num9 >= 0; num9--)
6083 {
6084 action(_pts[num9]);
6085 }
6086 }
6087 }
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:6679
bool UseAbility(string idAct, Card tc=null, Point pos=null, bool pt=false)
Definition: Chara.cs:5767
static List< Chara > _pts
Definition: Chara.cs:186
int CalcCastingChance(Element e, int num=1)
Definition: Chara.cs:6098
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:1076
virtual Act.Cost GetCost(Chara c)
Definition: ELEMENT.cs:1028
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 9139 of file Chara.cs.

9140 {
9141 _goalWork.FindWork(this, setAI: false);
9143 }
static GoalHobby _goalHobby
Definition: Chara.cs:208
static GoalWork _goalWork
Definition: Chara.cs:206
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 5218 of file Chara.cs.

5219 {
5220 base.c_vomit++;
5221 Say("vomit", this);
5222 PlaySound("vomit");
5223 if (!EClass._zone.IsRegion)
5224 {
5225 Thing thing = ThingGen.Create("731");
5227 {
5228 thing.MakeRefFrom(this);
5229 }
5230 EClass._zone.AddCard(thing, pos);
5231 }
5232 if (HasCondition<ConAnorexia>())
5233 {
5234 ModExp(70, -50);
5235 ModExp(71, -75);
5236 ModExp(77, -100);
5237 }
5238 else if (base.c_vomit > 10)
5239 {
5240 AddCondition<ConAnorexia>();
5241 }
5242 AddCondition<ConDim>();
5243 if (HasCondition<ConAnorexia>())
5244 {
5245 ModWeight(-1 * (1 + EClass.rnd(5)));
5246 }
5247 if (hunger.GetPhase() >= 4)
5248 {
5249 DamageHP(9999L, AttackSource.Hunger);
5250 }
5251 hunger.Mod(30);
5252 }
void ModWeight(int a, bool ignoreLimit=false)
Definition: Chara.cs:9710

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

3644 {
3645 for (int num = conditions.Count - 1; num >= 0; num--)
3646 {
3647 if (conditions[num].ConsumeTurn)
3648 {
3649 return true;
3650 }
3651 }
3652 return false;
3653 }

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

7194 {
7195 n.Clear();
7196 UIItem uIItem = n.AddHeaderCard(base.Name.ToTitleCase());
7197 SetImage(uIItem.image2);
7198 uIItem.text2.SetText(race.GetText().ToTitleCase(wholeText: true) + " " + job.GetText().ToTitleCase(wholeText: true));
7199 n.AddText("");
7200 n.Build();
7201 }
void SetImage(Image image, int dir, int idSkin=0)
Definition: Card.cs:6070
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 204 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 156 of file Chara.cs.

Referenced by SetFaction().

◆ _goalHobby

GoalHobby Chara._goalHobby = new GoalHobby()
staticprivate

Definition at line 208 of file Chara.cs.

◆ _goalWork

GoalWork Chara._goalWork = new GoalWork()
staticprivate

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

◆ _listFavFood

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

Definition at line 192 of file Chara.cs.

◆ _ListItems

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

Definition at line 190 of file Chara.cs.

◆ _NoGoalPC

NoGoal Chara._NoGoalPC = new NoGoal()
static

Definition at line 196 of file Chara.cs.

◆ _NoGoalRepeat

NoGoal Chara._NoGoalRepeat = new NoGoal()
static

Definition at line 198 of file Chara.cs.

Referenced by ActPlan.Item.Perform().

◆ _pts

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

Definition at line 186 of file Chara.cs.

◆ _race

SourceRace.Row Chara._race

Definition at line 160 of file Chara.cs.

Referenced by ChangeRace(), and OnCreate().

◆ _sharedPos

Point Chara._sharedPos = new Point()
staticprivate

Definition at line 174 of file Chara.cs.

Referenced by TryMoveTowards().

◆ _Speed

long Chara._Speed
private

Definition at line 172 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 164 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 178 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 180 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 170 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 200 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 176 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 184 of file Chara.cs.

◆ isParalyzed

bool Chara.isParalyzed

Definition at line 132 of file Chara.cs.

Referenced by Point.ListWitnesses().

◆ isWeakToSunlight

bool Chara.isWeakToSunlight

Definition at line 152 of file Chara.cs.

Referenced by Refresh().

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

Referenced by OnCreate().

◆ ListAdvRace

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

Definition at line 166 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(), Zone.OnVisit(), 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 182 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 214 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 154 of file Chara.cs.

Referenced by LayerEditSkin.RefreshImage().

◆ stealthSeen

int Chara.stealthSeen

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

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

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

◆ _alias

string Chara._alias
getset

Definition at line 218 of file Chara.cs.

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

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

◆ _idTimeTable

int Chara._idTimeTable
getset

Definition at line 340 of file Chara.cs.

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

Referenced by OnCreate().

◆ _maxStamina

int Chara._maxStamina
getset

Definition at line 364 of file Chara.cs.

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

Referenced by CalculateMaxStamina().

◆ ability

◆ actorPrefab

override string Chara.actorPrefab
get

Definition at line 518 of file Chara.cs.

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

◆ affinity

◆ Aka

◆ AliasMaterialOnCreate

override string Chara.AliasMaterialOnCreate
get

Definition at line 558 of file Chara.cs.

◆ baseWorkElements

ElementContainer Chara.baseWorkElements
get

Definition at line 1110 of file Chara.cs.

1111 {
1112 get
1113 {
1114 if (_baseWorkElements == null)
1115 {
1117 foreach (Hobby item in ListHobbies())
1118 {
1119 Build(item);
1120 }
1121 foreach (Hobby item2 in ListWorks())
1122 {
1123 Build(item2);
1124 }
1125 }
1126 return _baseWorkElements;
1127 void Build(Hobby h)
1128 {
1129 if (!h.source.elements.IsEmpty())
1130 {
1131 for (int i = 0; i < h.source.elements.Length; i += 2)
1132 {
1133 int ele = h.source.elements[i];
1134 int v = h.source.elements[i + 1];
1135 _baseWorkElements.ModBase(ele, v);
1136 }
1137 }
1138 }
1139 }
1140 }
ElementContainer _baseWorkElements
Definition: Chara.cs:204

◆ bladder

Stats Chara.bladder
get

Definition at line 1150 of file Chara.cs.

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

◆ burden

◆ CanGainConResist

bool Chara.CanGainConResist
get

Definition at line 1160 of file Chara.cs.

1161 {
1162 get
1163 {
1164 if (base.rarity >= Rarity.Legendary)
1165 {
1166 return !IsPCFaction;
1167 }
1168 return false;
1169 }
1170 }

◆ CanOpenDoor

bool Chara.CanOpenDoor
get

Definition at line 818 of file Chara.cs.

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

◆ CanWitness

bool Chara.CanWitness
get

Definition at line 1002 of file Chara.cs.

1003 {
1004 get
1005 {
1006 if (!IsHuman && !IsFairy && !IsGod)
1007 {
1008 return race.id == "mutant";
1009 }
1010 return true;
1011 }
1012 }
bool IsFairy
Definition: Chara.cs:939
bool IsGod
Definition: Chara.cs:951

Referenced by Point.ListWitnesses().

◆ corruption

int Chara.corruption
getset

Definition at line 376 of file Chara.cs.

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

Referenced by CanDuplicate().

◆ CurrentGeneSlot

int Chara.CurrentGeneSlot
get

Definition at line 1070 of file Chara.cs.

1071 {
1072 get
1073 {
1074 if (base.c_genes != null)
1075 {
1076 return base.c_genes.GetGeneSlot(this);
1077 }
1078 return 0;
1079 }
1080 }

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

◆ CurrentSpan

TimeTable.Span Chara.CurrentSpan
get

Definition at line 836 of file Chara.cs.

Referenced by ConSleep.Tick().

◆ currentZone

Zone Chara.currentZone
getset

Definition at line 254 of file Chara.cs.

255 {
256 get
257 {
258 return RefZone.Get(_cints[1]);
259 }
260 set
261 {
262 _cints[1] = RefZone.Set(value);
263 }
264 }
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 328 of file Chara.cs.

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

◆ depression

Stats Chara.depression
get

Definition at line 1148 of file Chara.cs.

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

◆ DestDist

int Chara.DestDist
get

Definition at line 998 of file Chara.cs.

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

◆ DV

override int Chara.DV
get

Definition at line 728 of file Chara.cs.

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

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

◆ faction

Faction Chara.faction
getset

Definition at line 426 of file Chara.cs.

427 {
428 get
429 {
430 return _faction ?? (_faction = EClass.game.factions.dictAll.TryGetValue(idFaction));
431 }
432 set
433 {
434 idFaction = value?.uid;
435 }
436 }
string idFaction
Definition: Chara.cs:243
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(), ActEffect.Proc(), Card.PurgeDuplicateArtifact(), Card.PurgeEythArtifact(), UIHomeInfo.Refresh(), UIHomeInfo.RefreshInfo(), WindowChara.RefreshInfo(), ContentPolicy.RefreshPolicyList(), WindowChara.RefreshProfile(), ContentFaction.RefreshZones(), FactionBranch.RemoveMemeber(), AI_Idle.Run(), SetFaction(), FactionBranch.SetOwner(), GameDate.ShipPackages(), Player.SimulateFaction(), ContentRanking.SwitchRanking(), CharaBody.Unequip(), FactionBranch.Upgrade(), FactionBranch.ValidateUpgradePolicies(), ElementContainer.Value(), ElementContainerCard.ValueBonus(), Element.BonusInfo.WriteNote(), and TraitBookPlan.WriteNote().

◆ faith

◆ flipX

override bool Chara.flipX
get

Definition at line 546 of file Chara.cs.

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

Referenced by CharaActor.RefreshSprite().

◆ goalListType

GoalListType Chara.goalListType
getset

Definition at line 278 of file Chara.cs.

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

◆ HasHost

override bool Chara.HasHost
get

Definition at line 688 of file Chara.cs.

Referenced by ActEffect.Proc().

◆ HasNoGoal

◆ homeBranch

◆ homeZone

◆ hostility

◆ hunger

◆ hygiene

Stats Chara.hygiene
get

Definition at line 1152 of file Chara.cs.

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

◆ idFaction

string Chara.idFaction
getset

Definition at line 242 of file Chara.cs.

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

◆ idFaith

string Chara.idFaith
getset

Definition at line 230 of file Chara.cs.

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

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

◆ IDPCCBodySet

string Chara.IDPCCBodySet
get

Definition at line 490 of file Chara.cs.

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

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

◆ idTimeTable

string Chara.idTimeTable
get

Definition at line 468 of file Chara.cs.

Referenced by LayerQuestBoard.RefreshHire().

◆ interest

int Chara.interest
getset

Definition at line 316 of file Chara.cs.

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

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

◆ IsAdventurer

bool Chara.IsAdventurer
get

Definition at line 1040 of file Chara.cs.

1041 {
1042 get
1043 {
1044 if (global != null && faction != EClass.pc.faction)
1045 {
1046 return IsPCC;
1047 }
1048 return false;
1049 }
1050 }

◆ isAlawysVisible

bool Chara.isAlawysVisible
getset

Definition at line 400 of file Chara.cs.

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

◆ IsAliveInCurrentZone

◆ IsAnimal

bool Chara.IsAnimal
get

Definition at line 866 of file Chara.cs.

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

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

◆ IsCat

bool Chara.IsCat
get

Definition at line 986 of file Chara.cs.

987 {
988 get
989 {
990 if (!(race.id == "cat") && !(race.id == "catsister"))
991 {
992 return race.id == "catgod";
993 }
994 return true;
995 }
996 }

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

◆ isChara

override bool Chara.isChara
get

Definition at line 686 of file Chara.cs.

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

◆ isDead

◆ IsDeadOrSleeping

override bool Chara.IsDeadOrSleeping
get

◆ IsDisabled

override bool Chara.IsDisabled
get

◆ IsDragon

bool Chara.IsDragon
get

Definition at line 962 of file Chara.cs.

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

◆ IsEyth

bool Chara.IsEyth
get

◆ IsFairy

bool Chara.IsFairy
get

Definition at line 938 of file Chara.cs.

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

Referenced by Faction.IsWearingPanty().

◆ IsFish

bool Chara.IsFish
get

Definition at line 926 of file Chara.cs.

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

◆ IsGlobal

◆ IsGod

bool Chara.IsGod
get

Definition at line 950 of file Chara.cs.

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

◆ IsHorror

bool Chara.IsHorror
get

Definition at line 914 of file Chara.cs.

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

Referenced by Refresh().

◆ IsHuman

bool Chara.IsHuman
get

Definition at line 878 of file Chara.cs.

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

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

1015 {
1016 get
1017 {
1018 if (!IsHuman && !race.tag.Contains("humanSpeak"))
1019 {
1020 return HasTag(CTAG.humanSpeak);
1021 }
1022 return true;
1023 }
1024 }

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

◆ IsIdle

bool Chara.IsIdle
get

Definition at line 852 of file Chara.cs.

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

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

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

◆ IsLocalChara

bool Chara.IsLocalChara
get

Definition at line 840 of file Chara.cs.

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

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

◆ IsMachine

bool Chara.IsMachine
get

Definition at line 902 of file Chara.cs.

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

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

◆ IsMaid

bool Chara.IsMaid
get

Definition at line 1026 of file Chara.cs.

1027 {
1028 get
1029 {
1030 if (EClass.Branch != null)
1031 {
1032 return EClass.Branch.uidMaid == base.uid;
1033 }
1034 return false;
1035 }
1036 }

Referenced by FactionBranch.GetMaid().

◆ IsMinion

override bool Chara.IsMinion
get

Definition at line 626 of file Chara.cs.

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

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

◆ IsMofuable

bool Chara.IsMofuable
get

Definition at line 1098 of file Chara.cs.

1099 {
1100 get
1101 {
1102 if (!race.tag.Contains("mofu"))
1103 {
1104 return HasElement(419);
1105 }
1106 return true;
1107 }
1108 }

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

◆ IsMoving

override bool Chara.IsMoving
get

Definition at line 608 of file Chara.cs.

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

◆ IsMultisize

◆ IsPC

override bool Chara.IsPC
get

Definition at line 612 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(), Biography.GetAge(), GetBurden(), Element.GetCost(), GetFirstStep(), TraitToolBrush.GetHeldEmo(), FactionBranch.GetResidentTax(), Zone.GetSpawnPos(), HasAccess(), Party.HasElement(), 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(), TraitBookExp.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(), ActEffect.ProcAt(), 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(), Map.TrySmoothPick(), GoalCombat.TryUseAbility(), CharaBody.Unequip(), CharaBody.UnqeuipIfTooHeavy(), CharaRenderer.UpdatePosition(), and DramaOutcome.upgrade_miscreation().

◆ IsPCC

◆ IsPCFaction

override bool Chara.IsPCFaction
get

Definition at line 670 of file Chara.cs.

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

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

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

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

◆ IsPCParty

override bool Chara.IsPCParty
get

Definition at line 614 of file Chara.cs.

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

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(), AI_Fish.Makefish(), TraitHitchingPost.OnActivateTrap(), FactionBranch.OnAdvanceDay(), FactionBranch.OnAfterSimulate(), ZoneEventDefenseGame.OnCharaDie(), BaseListPeople.OnClick(), Zone_CursedManor.OnGenerateMap(), ListPeopleExpedition.OnList(), AI_Fish.ProgressFish.OnProgressComplete(), TraitBaseSpellbook.OnRead(), ConTransmute.OnRemoved(), AI_Read.OnSetOwner(), FactionBranch.OnSimulateDay(), FactionBranch.OnSimulateHour(), ConTransmute.OnStart(), TraitGeneMachine.OnUse(), Zone.OnVisit(), ActWait.Perform(), ActWater.Perform(), ActZap.Perform(), AttackProcess.Perform(), AttackProcess.Prepare(), FoodEffect.Proc(), ActEffect.Proc(), ActEffect.ProcAt(), TCOrbitChara.RefreshAll(), Zone.RefreshCriminal(), FactionBranch.RefreshEfficiency(), UIHomeInfo.RefreshReport(), RefreshSpeed(), RequestProtection(), AI_Eat.Run(), AI_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 638 of file Chara.cs.

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

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

◆ IsPlant

bool Chara.IsPlant
get

Definition at line 974 of file Chara.cs.

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

Referenced by GoalCombat.Run().

◆ IsPrisoner

bool Chara.IsPrisoner
get

Definition at line 1038 of file Chara.cs.

◆ isSynced

override bool Chara.isSynced
get

◆ isThing

override bool Chara.isThing
get

Definition at line 684 of file Chara.cs.

◆ IsUndead

bool Chara.IsUndead
get

Definition at line 890 of file Chara.cs.

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

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

◆ IsWealthy

bool Chara.IsWealthy
get

Definition at line 1054 of file Chara.cs.

1055 {
1056 get
1057 {
1058 if (!source.works.Contains("Rich"))
1059 {
1060 return source.hobbies.Contains("Rich");
1061 }
1062 return true;
1063 }
1064 }

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

◆ job

◆ knowFav

bool Chara.knowFav
getset

Definition at line 412 of file Chara.cs.

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

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

◆ MainElement

Element Chara.MainElement
get

Definition at line 716 of file Chara.cs.

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

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

Referenced by ActEffect.Proc().

◆ OriginalHostility

Hostility Chara.OriginalHostility
get

Definition at line 470 of file Chara.cs.

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

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

787 {
788 get
789 {
790 if (spriteReplacer != null)
791 {
793 }
794 if (base.idSkin > 0)
795 {
796 switch (sourceCard.tiles.TryGet(base.idSkin))
797 {
798 case 2319:
799 case 2619:
800 case 2621:
801 case 2623:
802 case 2625:
804 case 2320:
805 case 2611:
806 case 2620:
807 case 2622:
808 case 2624:
809 case 2626:
810 case 2828:
812 }
813 }
814 return sourceCard.pref;
815 }
816 }
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 BaseTileMap.DrawTile(), and LayerEditSkin.OnClickEdit().

◆ PrefIndex

override int Chara.PrefIndex
get

Definition at line 530 of file Chara.cs.

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

◆ PV

override int Chara.PV
get

Definition at line 757 of file Chara.cs.

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

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

◆ race

◆ SAN

◆ SelfWeight

override int Chara.SelfWeight
get

Definition at line 712 of file Chara.cs.

◆ sleepiness

Stats Chara.sleepiness
get

◆ sourceCard

override CardRow Chara.sourceCard
get

◆ sourceRenderCard

override CardRow Chara.sourceRenderCard
get

Definition at line 452 of file Chara.cs.

453 {
454 get
455 {
456 if (pccData != null && !(source.renderData is RenderDataPcc))
457 {
459 }
460 return source;
461 }
462 }
static Row rowDefaultPCC
Definition: SourceChara.cs:140

◆ Speed

int Chara.Speed
get

Definition at line 1082 of file Chara.cs.

1083 {
1084 get
1085 {
1086 if (dirtySpeed)
1087 {
1088 RefreshSpeed();
1089 }
1090 if (_Speed > 100000000)
1091 {
1092 return 100000000;
1093 }
1094 return (int)_Speed;
1095 }
1096 }

Referenced by GameUpdater.ConditionUpdater.FixedUpdate().

◆ stamina

◆ tactics

Tactics Chara.tactics
get

Definition at line 834 of file Chara.cs.

◆ trait

◆ uidEditor

int Chara.uidEditor
getset

Definition at line 352 of file Chara.cs.

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

Referenced by SerializedCards.Add().

◆ WeightLimit

override int Chara.WeightLimit
get

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