Elin Decompiled Documentation EA 23.102 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)
 
void SetFaction (Faction f)
 
void SetHomeZone (Zone zone)
 
void OnBanish ()
 
Chara SetGlobal (Zone _home, int x, int z)
 
Chara SetGlobal ()
 
void RemoveGlobal ()
 
override void OnBeforeCreate ()
 
override void OnCreate (int genLv)
 
void SetFaith (string id)
 
void SetFaith (Religion r)
 
void HealAll ()
 
void Refresh (bool calledRecursive=false)
 
Chara Duplicate ()
 
int GetBurden (Card t=null, int num=-1)
 
void CalcBurden ()
 
void Stumble (int mtp=100)
 
void SetDirtySpeed ()
 
void RefreshSpeed (Element.BonusInfo info=null)
 
void CalculateMaxStamina ()
 
override void ApplyEditorTags (EditorTag tag)
 
override void SetSource ()
 
void SetMainElement (string id, int v=0, bool elemental=false)
 
void SetMainElement (int id, int v=0, bool elemental=false)
 
void ApplyJob (bool remove=false)
 
void ChangeJob (string idNew)
 
void AddRandomBodyPart (bool msg=false)
 
void RemoveLastBodyPart (bool msg=false)
 
void ResetBody ()
 
void ApplyRace (bool remove=false)
 
void ChangeRace (string idNew)
 
void MakePartyMemeber ()
 
void MakeAlly (bool msg=true)
 
void _MakeAlly ()
 
bool CanBeTempAlly (Chara c)
 
void MakeMinion (Chara _master, MinionType type=MinionType.Default)
 
void ReleaseMinion ()
 
void SetSummon (int duration)
 
Chara FindMaster ()
 
bool IsEscorted ()
 
bool CanDestroyPath ()
 
bool CanMoveTo (Point p, bool allowDestroyPath=true)
 
bool IsEnemyOnPath (Point p, bool cancelAI=true)
 
bool CanInteractTo (Card c)
 
bool CanInteractTo (Point p)
 
Point GetFirstStep (Point newPoint, PathManager.MoveType moveType=PathManager.MoveType.Default)
 
bool MoveRandom ()
 
bool MoveNeighborDefinitely ()
 
void MoveByForce (Point newPoint, Card c=null, bool checkWall=false)
 
MoveResult TryMoveTowards (Point p)
 
MoveResult TryMoveFrom (Point p)
 
MoveResult TryMove (Point newPoint, bool allowDestroyPath=true)
 
override MoveResult _Move (Point newPoint, MoveType type=MoveType.Walk)
 
void DestroyPath (Point pos)
 
void TryPush (Point point)
 
bool CanReplace (Chara c)
 
void MoveZone (string alias)
 
void MoveZone (Zone z, ZoneTransition.EnterState state=ZoneTransition.EnterState.Auto)
 
void MoveZone (Zone z, ZoneTransition transition)
 
void MoveHome (string id, int x=-1, int z=-1)
 
void MoveHome (Zone zone, int x=-1, int z=-1)
 
void FallFromZone ()
 
override void SetDir (int d)
 
override void Rotate (bool reverse=false)
 
override void LookAt (Card c)
 
override void LookAt (Point p)
 
void UpdateAngle ()
 
int GetCurrentDir ()
 
void UpdateSight ()
 
bool WillConsumeTurn ()
 
void TickConditions ()
 
void SyncRide ()
 
void SyncRide (Chara c)
 
override void Tick ()
 
bool CanLift (Card c)
 
bool CanAutoPick (Card c)
 
bool CanPick (Card c)
 
void PickOrDrop (Point p, string idThing, int idMat=-1, int num=1, bool msg=true)
 
void PickOrDrop (Point p, Thing t, bool msg=true)
 
Thing Pick (Thing t, bool msg=true, bool tryStack=true)
 
Thing TryPoisonPotion (Thing t)
 
void TryAbsorbRod (Thing t)
 
void TryReservePickupTutorial (Thing t)
 
void TryPickGroundItem ()
 
void TryPutShared (Thing t, List< Thing > containers=null, bool dropIfFail=true)
 
bool TryHoldCard (Card t, int num=-1, bool pickHeld=false)
 
void HoldCard (Card t, int num=-1)
 
void PickHeld (bool msg=false)
 
Card SplitHeld (int a)
 
void TryDropCarryOnly ()
 
Card DropHeld (Point dropPos=null)
 
void DropThing (Thing t, int num=-1)
 
AttackStyle GetFavAttackStyle ()
 
Element GetFavWeaponSkill ()
 
Element GetFavArmorSkill ()
 
void TryRestock (bool onCreate)
 
void RestockEquip (bool onCreate)
 
void RestockInventory (bool onCreate)
 
Thing EQ_ID (string s, int mat=-1, Rarity r=Rarity.Random)
 
void EQ_CAT (string s)
 
void EQ_Item (string s, int num=1)
 
void Drink (Card t)
 
bool CanRevive ()
 
void GetRevived ()
 
void Revive (Point p=null, bool msg=false)
 
void MakeGrave (string lastword)
 
void ApplyDeathPenalty ()
 
void Vomit ()
 
override void Die (Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None)
 
void TryDropBossLoot ()
 
void Kick (Point p, bool ignoreSelf=false)
 
void Kick (Chara t, bool ignoreSelf=false, bool karmaLoss=true, bool show=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)
 
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 ()
 
int GetTotalFeat ()
 
bool CanInsult ()
 
string GetIdPortraitCat ()
 
string GetIdPortrait ()
 
Thing GiveBirth (Thing t, bool effect)
 
Thing MakeGene (DNA.Type? type=null)
 
Thing MakeBraineCell ()
 
Thing MakeMilk (bool effect=true, int num=1, bool addToZone=true)
 
Thing MakeEgg (bool effect=true, int num=1, bool addToZone=true)
 
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)
 
void RequestProtection (Chara attacker, Action< Chara > action)
 
bool ShouldThrowAway (Thing t, ClearInventoryType type)
 
void ClearInventory (ClearInventoryType type)
 
void ResetUpgrade ()
 
void TryUpgrade (bool msg=true)
 
void AddCooldown (int idEle, int turns=0)
 
bool HasCooldown (int idEle)
 
void TickCooldown ()
 
void ChooseNewGoal ()
 
Goal GetGoalFromTimeTable (int hour)
 
Goal GetGoalWork ()
 
Goal GetGoalHobby ()
 
void SetAIIdle ()
 
void SetAIAggro ()
 
AIAct SetNoGoal ()
 
AIAct SetAI (AIAct g)
 
void SetAIImmediate (AIAct g)
 
BaseArea GetRoomWork ()
 
List< HobbyListWorks (bool useMemberType=true)
 
List< HobbyListHobbies (bool useMemberType=true)
 
Hobby GetWork (string id)
 
void RefreshWorkElements (ElementContainer parent=null)
 
string GetTextHobby (bool simple=false)
 
string GetTextWork (bool simple=false)
 
void AddHobby (int id)
 
void AddWork (int id)
 
void RerollHobby (bool extraSlotChance=true)
 
WorkSummary GetWorkSummary ()
 
void TickWork (VirtualDate date)
 
bool TryWorkOutside (SourceHobby.Row sourceWork)
 
void PerformWork (WorkSession session, bool isHobby=false, bool IsRealTime=false)
 
void ValidateWorks ()
 
void InitStats (bool onDeserialize=false)
 
Condition AddCondition< T > (int p=100, bool force=false)
 
Condition AddCondition (string id, int p=100, bool force=false)
 
Condition AddCondition (Condition c, bool force=false)
 
override bool HasCondition< T > ()
 
bool HasCondition (string alias)
 
Element GetBuffStats (string alias)
 
Element GetBuffStats (int ele)
 
void CureCondition< T > (int v=99999)
 
GetCondition< T > ()
 
void RemoveCondition< T > ()
 
void CureHost (CureType type, int p=100, BlessedState state=BlessedState.Normal)
 
void Cure (CureType type, int p=100, BlessedState state=BlessedState.Normal)
 
bool TryNeckHunt (Chara TC, int power, bool harvest=false)
 
void AddResistCon (Condition con)
 
void ResistCon (Condition con)
 
void Sleep (Thing bed=null, Thing pillow=null, bool pickup=false, ItemPosition posBed=null, ItemPosition posPillow=null)
 
void OnSleep (Thing bed=null, int days=1)
 
void OnSleep (int power, int days=1)
 
void ModHeight (int a)
 
void ModWeight (int a, bool ignoreLimit=false)
 
void ModCorruption (int a)
 
List< ElementListAvailabeFeats (bool pet=false, bool showAll=false)
 
void SetFeat (int id, int value=1, bool msg=false)
 
bool MutateRandom (int vec=0, int tries=100, bool ether=false, BlessedState state=BlessedState.Normal)
 
void GainAbility (int ele, int mtp=100)
 
bool TryNullifyCurse ()
 
int GetPietyValue ()
 
void RefreshFaithElement ()
 
void ModTempElement (int ele, int a, bool naturalDecay=false)
 
void DamageTempElements (int p, bool body, bool mind)
 
void DamageTempElement (int ele, int p)
 
void EnhanceTempElements (int p, bool body, bool mind)
 
void EnhanceTempElement (int ele, int p)
 
void DiminishTempElements (int a=1)
 
void CureTempElements (int p, bool body, bool mind)
 
- Public Member Functions inherited from Card
override string ToString ()
 
bool CanReserve (AIAct act)
 
bool TryReserve (AIAct act)
 
void Mod ()
 
Window.SaveData GetWindowSaveData ()
 
bool IsExcludeFromCraft ()
 
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)
 
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 AddExp (int a)
 
void LevelUp ()
 
virtual void ApplyMaterialElements (bool remove)
 
virtual void ApplyMaterial (bool remove=false)
 
Card ChangeMaterial (int idNew, bool ignoreFixedMaterial=false)
 
Card ChangeMaterial (string idNew, bool ignoreFixedMaterial=false)
 
Card ChangeMaterial (SourceMaterial.Row row, bool ignoreFixedMaterial=false)
 
void SetReplica (bool on)
 
Thing Add (string id, int num=1, int lv=1)
 
Card AddCard (Card c)
 
void RemoveCard (Card c)
 
void NotifyAddThing (Thing t, int num)
 
Thing AddThing (string id, int lv=-1)
 
Thing AddThing (Thing t, bool tryStack=true, int destInvX=-1, int destInvY=-1)
 
void PurgeDuplicateArtifact (Thing af)
 
void RemoveThings ()
 
void RemoveThing (Thing thing)
 
bool ShouldTrySetDirtyInventory ()
 
virtual bool CanStackTo (Thing to)
 
bool TryStackTo (Thing to)
 
ICardParent GetRoot ()
 
Card GetRootCard ()
 
bool IsStackable (Thing tg)
 
Thing Duplicate (int num)
 
Thing Split (int a)
 
Thing SetNum (int a)
 
Thing SetNoSell ()
 
void ModNum (int a, bool notify=true)
 
void AddSocket ()
 
void ApplySocket (Thing t)
 
void ApplySocket (int id, int lv, Card mod=null)
 
void EjectSockets ()
 
SocketData AddRune (Card rune)
 
SocketData AddRune (int idEle, int v)
 
SocketData GetRuneEnc (int idEle)
 
int CountRune ()
 
int MaxRune ()
 
bool CanAddRune (SourceElement.Row row)
 
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)
 
virtual void SetBlessedState (BlessedState s)
 
virtual void ChangeRarity (Rarity q)
 
bool TryPay (int a, string id="money")
 
void SetCharge (int a)
 
void ModCharge (int a, bool destroy=false)
 
void ModCurrency (int a, string id="money")
 
int GetCurrency (string id="money")
 
virtual void HealHPHost (int a, HealSource origin=HealSource.None)
 
virtual void HealHP (int a, HealSource origin=HealSource.None)
 
virtual int GetArmorSkill ()
 
virtual int ApplyProtection (int dmg, int mod=100)
 
void DamageHP (int dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
 
void DamageHP (int dmg, int ele, int eleP=100, AttackSource attackSource=AttackSource.None, Card origin=null, bool showEffect=true, Thing weapon=null)
 
virtual void Die (Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None)
 
void Explode (Point p, Card origin)
 
void Deconstruct ()
 
void Destroy ()
 
void SpawnLoot (Card origin)
 
Thing TryMakeRandomItem (int lv=-1)
 
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)
 
void MakeRefFrom (string id)
 
void MakeRefFrom (Card c1, Card c2=null)
 
void 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)
 
virtual CardRenderer _CreateRenderer ()
 
void AddBlood (int a=1, int id=-1)
 
RenderParam GetRenderParam ()
 
virtual void SetRenderParam (RenderParam p)
 
void DyeRandom ()
 
void Dye (string idMat)
 
void Dye (SourceMaterial.Row mat)
 
void RefreshColor ()
 
ref Color GetRandomColor ()
 
virtual Sprite GetSprite (int dir=0)
 
virtual Sprite GetImageSprite ()
 
void SetImage (Image image, int dir, int idSkin=0)
 
virtual void SetImage (Image image)
 
void ShowEmo (Emo _emo=Emo.none, float duration=0f, bool skipSame=true)
 
void PlaySoundHold (bool spatial=true)
 
void PlaySoundDrop (bool spatial=true)
 
void PlaySoundImpact (bool spatial=true)
 
void PlaySoundDead (bool spatial=true)
 
SoundSource PlaySound (string id, float v=1f, bool spatial=true)
 
void KillAnime ()
 
void PlayAnime (AnimeID id, bool force=false)
 
void PlayAnime (AnimeID id, Point dest, bool force=false)
 
void PlayAnimeLoot ()
 
Effect PlayEffect (string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
 
void PlayEffect (int ele, bool useRenderPos=true, float range=0f)
 
virtual void SetDir (int d)
 
void SetRandomDir ()
 
virtual void LookAt (Card c)
 
virtual void LookAt (Point p)
 
virtual void Rotate (bool reverse=false)
 
void ChangeAltitude (int a)
 
virtual SubPassData GetSubPassData ()
 
void SetFreePos (Point point)
 
void RenderMarker (Point point, bool active, HitResult result, bool main, int dir, bool useCurrentPosition=false)
 
void RecalculateFOV ()
 
bool HasLight ()
 
float GetLightPower ()
 
int GetSightRadius ()
 
int GetLightRadius ()
 
void CalculateFOV ()
 
void SetRandomLightColors ()
 
Fov CreateFov ()
 
void ClearFOV ()
 
virtual void OnSimulateHour (VirtualDate date)
 
void DecayNatural (int hour=1)
 
void CheckJustCooked ()
 
void Decay (int a=10)
 
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 ()
 
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 (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
 
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 isDrunk
 
bool isConfused
 
bool isFainted
 
bool isBlind
 
bool isParalyzed
 
bool _isLevitating
 
bool isCreated
 
bool canSeeInvisible
 
bool hasTelepathy
 
bool isWet
 
bool bossText
 
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
 
- 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]
 
bool CanOpenDoor [get]
 
Tactics tactics [get]
 
TimeTable.Span CurrentSpan [get]
 
bool IsInActiveZone [get]
 
bool IsLocalChara [get]
 
bool IsIdle [get]
 
bool IsInCombat [get]
 
int DestDist [get]
 
bool HasNoGoal [get]
 
bool CanWitness [get]
 
bool IsHuman [get]
 
bool IsHumanSpeak [get]
 
bool IsMaid [get]
 
bool IsPrisoner [get]
 
bool IsAdventurer [get]
 
bool IsEyth [get]
 
bool IsWealthy [get]
 
FactionBranch homeBranch [get]
 
int MaxGeneSlot [get]
 
int CurrentGeneSlot [get]
 
int Speed [get]
 
bool IsMofuable [get]
 
ElementContainer baseWorkElements [get]
 
Stats hunger [get]
 
Stats burden [get]
 
Stats stamina [get]
 
Stats depression [get]
 
Stats bladder [get]
 
Stats hygiene [get]
 
Stats mana [get]
 
Stats sleepiness [get]
 
Stats SAN [get]
 
bool CanGainConResist [get]
 
- Properties inherited from Card
Card parentCard [get]
 
Thing parentThing [get]
 
int colorInt [get]
 
bool IsHotItem [get]
 
int uid [get, set]
 
int idMaterial [get, set]
 
int dir [get, set]
 
int Num [get, set]
 
int _x [get, set]
 
int _z [get, set]
 
int refVal [get, set]
 
int decay [get, set]
 
int altitude [get, set]
 
int hp [get, set]
 
float fx [get, set]
 
float fy [get, set]
 
BlessedState blessedState [get, set]
 
PlaceState _placeState [get, set]
 
int rarityLv [get, set]
 
Rarity rarity [get, set]
 
int encLV [get, set]
 
int posInvX [get, set]
 
int posInvY [get, set]
 
int idSkin [get, set]
 
int feat [get, set]
 
int LV [get, set]
 
int exp [get, set]
 
int qualityTier [get, set]
 
bool isCensored [get, set]
 
bool isDeconstructing [get, set]
 
bool isDyed [get, set]
 
bool isModified [get, set]
 
bool isNew [get, set]
 
bool isPlayerCreation [get, set]
 
bool ignoreAutoPick [get, set]
 
bool freePos [get, set]
 
bool isHidden [get, set]
 
bool isOn [get, set]
 
bool isNPCProperty [get, set]
 
bool isRestrained [get, set]
 
bool isRoofItem [get, set]
 
bool isMasked [get, set]
 
bool disableAutoToggle [get, set]
 
bool isImported [get, set]
 
bool autoRefuel [get, set]
 
bool ignoreStackHeight [get, set]
 
bool isFloating [get, set]
 
bool isWeightChanged [get, set]
 
bool isFireproof [get, set]
 
bool isAcidproof [get, set]
 
bool isReplica [get, set]
 
bool isSummon [get, set]
 
bool isElemental [get, set]
 
bool isBroken [get, set]
 
bool isSubsetCard [get, set]
 
bool noSnow [get, set]
 
bool noMove [get, set]
 
bool isGifted [get, set]
 
bool isCrafted [get, set]
 
bool isLostProperty [get, set]
 
bool noShadow [get, set]
 
bool noSell [get, set]
 
bool isLeashed [get, set]
 
bool isStolen [get, set]
 
bool isSale [get, set]
 
bool isCopy [get, set]
 
bool isRestocking [get, set]
 
bool hasSpawned [get, set]
 
bool isBackerContent [get]
 
SourceBacker.Row sourceBacker [get]
 
BedType c_bedType [get, set]
 
int c_equippedSlot [get, set]
 
int c_lockLv [get, set]
 
Hostility c_originalHostility [get, set]
 
MinionType c_minionType [get, set]
 
int c_vomit [get, set]
 
bool c_wasInPcParty [get, set]
 
bool c_isImportant [get, set]
 
bool c_lockedHard [get, set]
 
bool c_revealLock [get, set]
 
bool c_isTrained [get, set]
 
bool c_isPrayed [get, set]
 
bool c_isDisableStockUse [get, set]
 
int c_lightColor [get, set]
 
Color LightColor [get]
 
int c_uidZone [get, set]
 
int c_uidRefCard [get, set]
 
int c_priceFix [get, set]
 
int c_priceAdd [get, set]
 
int c_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_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]
 
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_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]
 
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 ShowFoodEnc [get]
 
bool IsWeapon [get]
 
bool IsEquipmentOrRanged [get]
 
bool IsEquipmentOrRangedOrAmmo [get]
 
bool IsMeleeWeapon [get]
 
bool IsRangedWeapon [get]
 
bool IsThrownWeapon [get]
 
bool IsAmmo [get]
 
bool IsAgent [get]
 
bool IsFurniture [get]
 
bool IsBlessed [get]
 
bool IsCursed [get]
 
bool IsRestrainedResident [get]
 
virtual bool IsPCFaction [get]
 
bool IsPCFactionOrMinion [get]
 
virtual bool IsGlobal [get]
 
virtual int MaxDecay [get]
 
bool IsDecayed [get]
 
bool IsRotting [get]
 
bool IsFresn [get]
 
virtual int MaxHP [get]
 
virtual int Power [get]
 
int FameLv [get]
 
virtual int[] Tiles [get]
 
virtual int PrefIndex [get]
 
bool IsVariation [get]
 
virtual int DV [get]
 
virtual int PV [get]
 
int HIT [get]
 
int DMG [get]
 
int STR [get]
 
int DEX [get]
 
int END [get]
 
int PER [get]
 
int LER [get]
 
int WIL [get]
 
int MAG [get]
 
int CHA [get]
 
int INT [get]
 
int LUC [get]
 
int W [get]
 
int H [get]
 
bool IsIdentified [get]
 
string TextRarity [get]
 
bool IsInstalled [get]
 
bool IsMale [get]
 
bool IsNegativeGift [get]
 
bool HasContainerSize [get]
 
Thing Tool [get]
 
virtual SourceMaterial.Row DefaultMaterial [get]
 
virtual bool HasHost [get]
 
int Quality [get]
 
int QualityLv [get]
 
LightData LightData [get]
 
CardRenderer HostRenderer [get]
 
bool ShouldShowMsg [get]
 
bool CanInspect [get]
 
string InspectName [get]
 
Point InspectPoint [get]
 
Vector3 InspectPosition [get]
 
- Properties inherited from EClass
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Faction Wilds [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 
- Properties inherited from IInspect
bool CanInspect [get]
 
string InspectName [get]
 
Point InspectPoint [get]
 
Vector3 InspectPosition [get]
 

Private Member Functions

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

Private Attributes

Faction _faction
 
int _Speed
 
bool hasMovedThisTurn
 

Static Private Attributes

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

Additional Inherited Members

- Public Types inherited from Card
enum  MoveResult { Fail , Success , Door }
 
enum  MoveType { Walk , Force }
 
- Public Types inherited from IInspect
enum  NoteMode { Default , Recipe , Product , Info }
 
- Static Public Member Functions inherited from Card
static string ApplyTone (Chara c, ref string text, string _tones, int gender, bool stripPun=false)
 
static int GetTilePrice (TileRow row, SourceMaterial.Row mat)
 
- Static Public Member Functions inherited from EClass
static int 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 5993 of file Chara.cs.

5994 {
5995 CardRenderer cardRenderer = renderer;
5996 CharaRenderer charaRenderer = new CharaRenderer();
5997 if (race.id == "spider" && source.tiles.Length > 1)
5998 {
5999 base.idSkin = (EClass.core.config.game.antiSpider ? 1 : 0);
6000 }
6001 if (source.moveAnime == "hop")
6002 {
6003 charaRenderer.hopCurve = EClass.setting.render.anime.hop;
6004 }
6005 if (host != null)
6006 {
6007 charaRenderer.pccData = PCCData.Create("ride");
6008 string idPart = base.c_idRidePCC.IsEmpty(EClass.core.pccs.sets["ride"].map["body"].map.Keys.First());
6009 charaRenderer.pccData.SetPart("body", "ride", idPart);
6010 charaRenderer.pccData.ride = EClass.core.pccs.GetRideData(idPart);
6011 }
6012 else
6013 {
6014 foreach (Condition condition in conditions)
6015 {
6016 RendererReplacer rendererReplacer = condition.GetRendererReplacer();
6017 if (rendererReplacer != null)
6018 {
6019 charaRenderer.replacer = rendererReplacer;
6020 charaRenderer.data = rendererReplacer.data;
6021 break;
6022 }
6023 }
6024 if (charaRenderer.replacer == null)
6025 {
6026 charaRenderer.pccData = pccData;
6027 }
6028 }
6029 renderer = charaRenderer;
6030 renderer.SetOwner(this);
6031 if (cardRenderer != null)
6032 {
6033 renderer.SetFirst(first: false, cardRenderer.position);
6034 }
6035 return charaRenderer;
6036 }
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:57
PCCData pccData
Chara host
Definition: Chara.cs:33
List< Condition > conditions
Definition: Chara.cs:196
SourceChara.Row source
Definition: Chara.cs:143
PCCData pccData
Definition: Chara.cs:64
SourceRace.Row race
Definition: Chara.cs:449
PCCManager pccs
Definition: Core.cs:41
Definition: EClass.cs:5
static Core core
Definition: EClass.cs:6
static GameSetting setting
Definition: EClass.cs:34
RenderSetting render
Definition: GameSetting.cs:301

References GameSetting.RenderSetting.anime, EClass.core, RendererReplacer.data, BaseCondition.GetRendererReplacer(), GameSetting.RenderSetting.AnimeSetting.hop, SourceRace.Row.id, SourceChara.Row.moveAnime, CharaRenderer.pccData, Core.pccs, CardRenderer.position, GameSetting.render, CardRenderer.replacer, CharaRenderer.SetOwner(), EClass.setting, and RenderRow.tiles.

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

◆ _MakeAlly()

void Chara._MakeAlly ( )
inline

Definition at line 2024 of file Chara.cs.

2025 {
2026 if (EClass.pc.homeBranch != null)
2027 {
2029 }
2030 else
2031 {
2032 SetGlobal();
2034 }
2035 Hostility hostility2 = (base.c_originalHostility = Hostility.Ally);
2036 this.hostility = hostility2;
2037 orgPos = null;
2038 base.c_summonDuration = 0;
2039 base.isSummon = false;
2040 ReleaseMinion();
2041 SetInt(32);
2042 Refresh();
2043 }
Hostility
Definition: Hostility.cs:2
list. Refresh()
void SetInt(int id, int value=0)
Definition: BaseCard.cs:39
void SetFaction(Faction f)
Definition: Chara.cs:1227
void ReleaseMinion()
Definition: Chara.cs:2069
Point orgPos
Definition: Chara.cs:21
FactionBranch homeBranch
Definition: Chara.cs:889
Chara SetGlobal()
Definition: Chara.cs:1281
static Faction Home
Definition: EClass.cs:26
static Chara pc
Definition: EClass.cs:14
void AddMemeber(Chara c)

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

Referenced by MakeAlly(), and MakePartyMemeber().

◆ _Move()

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

Reimplemented from Card.

Definition at line 2446 of file Chara.cs.

2447 {
2448 if (isDead)
2449 {
2450 return MoveResult.Fail;
2451 }
2452 if (IsPC)
2453 {
2454 float num = EClass.setting.defaultActPace;
2455 switch (burden.GetPhase())
2456 {
2457 case 3:
2458 num *= 1.5f;
2459 break;
2460 case 4:
2461 num *= 2f;
2462 break;
2463 }
2465 {
2466 int num2 = 30;
2467 if (!EClass.pc.HasElement(408))
2468 {
2470 {
2471 case Weather.Condition.Rain:
2472 num2 += 5;
2473 break;
2474 case Weather.Condition.RainHeavy:
2475 num2 += 10;
2476 num *= 1.5f;
2477 break;
2478 case Weather.Condition.Snow:
2479 num2 += 10;
2480 break;
2481 case Weather.Condition.SnowHeavy:
2482 num2 += 15;
2483 num *= 1.5f;
2484 break;
2485 }
2486 }
2487 if (newPoint.matFloor.id == 48)
2488 {
2489 num2 += 20;
2490 num *= 1.8f;
2491 }
2492 num2 = num2 * 100 / (100 + EvalueMax(240, -20) + EvalueMax(407, -5) * 5);
2493 EClass.world.date.AdvanceMin(num2 * 6);
2494 EClass.player.lastZonePos = null;
2496 int num3 = base.hp;
2497 for (int i = 0; i < num2 * 4; i++)
2498 {
2499 EClass.pc.party.members.ForeachReverse(delegate(Chara m)
2500 {
2501 if (!m.isDead)
2502 {
2503 m.TickConditions();
2504 }
2505 });
2506 if (base.hp < MaxHP / 5 && base.hp < num3 && !EClass.player.regionMoveWarned)
2507 {
2508 EClass.player.regionMoveWarned = true;
2509 Msg.Say("regionAbortMove");
2510 EInput.Consume(consumeAxis: true);
2511 SetAI(new NoGoal());
2512 return MoveResult.Fail;
2513 }
2514 }
2515 if (newPoint.cell.CanSuffocate())
2516 {
2517 AddCondition<ConSuffocation>((EClass.pc.Evalue(200) != 0) ? (2000 / (100 + EvalueMax(200, -5) * 10)) : 30);
2518 int num4 = GetCondition<ConSuffocation>()?.GetPhase() ?? 0;
2519 if (num4 >= 2)
2520 {
2521 DamageHP(EClass.rndHalf(10 + MaxHP / 5), AttackSource.Condition);
2522 }
2523 if (!isDead && !HasElement(429))
2524 {
2525 ModExp(200, 8 + num4 * 12);
2526 }
2527 }
2528 EClass.player.regionMoveWarned = false;
2529 if (isDead)
2530 {
2531 return MoveResult.Fail;
2532 }
2533 }
2534 if (num > EClass.setting.defaultActPace * 3f)
2535 {
2536 num = EClass.setting.defaultActPace * 3f;
2537 }
2538 actTime = num;
2539 }
2540 Chara chara = ((ride == null) ? this : ride);
2541 if (!EClass._zone.IsRegion || chara.IsPC)
2542 {
2543 bool flag = (chara.isConfused && EClass.rnd(2) == 0) || (chara.isDrunk && EClass.rnd(IsIdle ? 2 : 8) == 0 && !chara.HasElement(1215));
2544 if (host != null && host.ride == this && ((host.isConfused && EClass.rnd(2) == 0) || (host.isDrunk && EClass.rnd(IsIdle ? 2 : 8) == 0 && !host.HasElement(1215))))
2545 {
2546 flag = true;
2547 }
2548 if (flag && newPoint.Distance(pos) <= 1)
2549 {
2550 Point randomNeighbor = pos.GetRandomNeighbor();
2551 if (CanMoveTo(randomNeighbor, allowDestroyPath: false))
2552 {
2553 newPoint = randomNeighbor;
2554 if (isDrunk)
2555 {
2556 Talk("drunk");
2557 }
2558 }
2559 }
2560 }
2561 if (newPoint.x != pos.x || newPoint.z != pos.z)
2562 {
2563 LookAt(newPoint);
2564 }
2565 CellEffect effect = base.Cell.effect;
2566 if (effect != null && effect.id == 7)
2567 {
2568 CellEffect effect2 = base.Cell.effect;
2569 if (race.height < 500 && !race.tag.Contains("webfree") && EClass.rnd(effect2.power + 25) > EClass.rnd(base.STR + base.DEX + 1))
2570 {
2571 Say("abWeb_caught", this);
2572 PlaySound("web");
2573 effect2.power = effect2.power * 3 / 4;
2574 renderer.PlayAnime(AnimeID.Shiver);
2575 return MoveResult.Fail;
2576 }
2577 Say("abWeb_pass", this);
2578 EClass._map.SetEffect(base.Cell.x, base.Cell.z);
2579 }
2580 if (IsPC)
2581 {
2582 if (EClass._zone.IsRegion)
2583 {
2585 }
2586 else if ((newPoint.x > pos.x && newPoint.z > pos.z) || (newPoint.x < pos.x && newPoint.z < pos.z))
2587 {
2589 }
2590 }
2591 if (newPoint.cell.hasDoor)
2592 {
2593 foreach (Thing thing in pos.Things)
2594 {
2595 if (thing.trait is TraitDoor traitDoor && traitDoor.owner.c_lockLv > 0)
2596 {
2597 if (base.INT < 10)
2598 {
2599 return MoveResult.Fail;
2600 }
2601 traitDoor.TryOpenLock(this);
2602 return MoveResult.Door;
2603 }
2604 }
2605 }
2606 Cell cell = newPoint.cell;
2607 Cell cell2 = pos.cell;
2608 bool flag2 = cell.HasLiquid && !IsLevitating;
2609 bool hasBridge = cell.HasBridge;
2610 bool hasRamp = cell.HasRamp;
2611 bool flag3 = EClass._zone.IsSnowCovered && !cell.HasRoof && !cell.isClearSnow;
2612 TileRow tileRow = (hasRamp ? ((TileRow)cell.sourceBlock) : ((TileRow)(hasBridge ? cell.sourceBridge : cell.sourceFloor)));
2613 SourceMaterial.Row row = (hasRamp ? cell.matBlock : (hasBridge ? cell.matBridge : cell.matFloor));
2614 bool flag4 = cell.IsTopWater && !cell.isFloating;
2615 if (!EClass._zone.IsRegion)
2616 {
2617 if (cell.hasDoorBoat)
2618 {
2619 tileRow = FLOOR.sourceWood;
2620 row = MATERIAL.sourceOak;
2621 flag4 = false;
2622 }
2623 else if (flag3 && !tileRow.ignoreSnow)
2624 {
2625 if (tileRow.tileType.IsWater)
2626 {
2627 tileRow = FLOOR.sourceIce;
2628 row = MATERIAL.sourceIce;
2629 }
2630 else
2631 {
2632 tileRow = FLOOR.sourceSnow;
2633 row = MATERIAL.sourceSnow;
2634 }
2635 flag4 = false;
2636 }
2637 }
2638 if ((pos.sourceFloor.isBeach || cell2.IsSnowTile) && !pos.HasObj)
2639 {
2640 EClass._map.SetFoormark(pos, 1, (int)Util.GetAngle(pos.x - newPoint.x, pos.z - newPoint.z), cell2.IsSnowTile ? 312 : 304);
2641 }
2642 if (isSynced)
2643 {
2644 string text = ((flag2 || flag4) ? "water" : tileRow.soundFoot.IsEmpty(row.soundFoot.IsEmpty("default")));
2645 if (cell.obj != 0 && cell.sourceObj.tileType.IsPlayFootSound && !cell.matObj.soundFoot.IsEmpty())
2646 {
2647 text = cell.matObj.soundFoot;
2648 }
2649 if (IsPC)
2650 {
2651 foreach (Thing thing2 in newPoint.Things)
2652 {
2653 if (thing2.IsInstalled && (thing2.trait.IsChangeFloorHeight || thing2.Pref.Surface))
2654 {
2655 text = thing2.material.soundFoot;
2656 }
2657 }
2658 }
2659 if (!text.IsEmpty())
2660 {
2661 SoundManager.altLastData = IsPC;
2662 PlaySound("Footstep/" + text, IsPC ? 1f : 0.9f);
2663 }
2664 if (!flag4)
2665 {
2667 PCOrbit pcOrbit = EClass.screen.pcOrbit;
2668 bool flag5 = scene.actionMode.gameSpeed > 1f;
2669 scene.psFoot.transform.position = renderer.position + pcOrbit.footPos;
2670 scene.psFoot.startColor = row.matColor;
2671 scene.psFoot.Emit(pcOrbit.emitFoot * ((!flag5) ? 1 : 2));
2672 if (flag5 && IsPC)
2673 {
2674 scene.psSmoke.transform.position = renderer.position + pcOrbit.smokePos;
2675 scene.psSmoke.Emit(pcOrbit.emitSmoke);
2676 }
2677 }
2678 if (flag2 || flag4)
2679 {
2680 Effect.Get("ripple").Play(0.4f * actTime * EClass.scene.actionMode.gameSpeed, newPoint);
2681 }
2682 }
2683 lastPos.Set(pos);
2684 if (type != MoveType.Force)
2685 {
2686 if (newPoint.HasChara && ai.Current.PushChara)
2687 {
2688 TryPush(newPoint);
2689 }
2690 if (newPoint.HasChara && newPoint.Charas.Count == 1)
2691 {
2692 Chara chara2 = newPoint.Charas[0];
2693 if (CanReplace(chara2))
2694 {
2695 chara2.MoveByForce(lastPos, this);
2696 if (chara.IsPC)
2697 {
2698 Say("replace_pc", chara, chara2);
2699 }
2700 }
2701 }
2702 }
2703 if (cell.hasDoor)
2704 {
2705 foreach (Thing thing3 in newPoint.Things)
2706 {
2707 if (thing3.trait is TraitDoor traitDoor2)
2708 {
2709 traitDoor2.TryOpen(this);
2710 }
2711 }
2712 }
2713 EClass._zone.map.MoveCard(newPoint, this);
2714 SyncRide();
2716 {
2717 foreach (Chara member in EClass.pc.party.members)
2718 {
2719 if (member.isLeashed && !member.IsPC && member.host == null && !member.IsDisabled && !member.HasCondition<ConEntangle>() && !member.IsInCombat && member.Dist(EClass.pc) > 1)
2720 {
2721 member.TryMoveTowards(EClass.pc.pos);
2722 }
2723 }
2724 }
2726 {
2728 }
2729 if (IsPC)
2730 {
2731 PlaySound("Footstep/Extra/pcfootstep");
2732 if (pos.HasThing)
2733 {
2734 foreach (Card item in pos.ListCards())
2735 {
2736 if (!item.isThing || item.placeState != 0 || item.ignoreAutoPick)
2737 {
2738 continue;
2739 }
2741 {
2743 ContainerFlag containerFlag = item.category.GetRoot().id.ToEnum<ContainerFlag>();
2744 if (containerFlag == ContainerFlag.none)
2745 {
2746 containerFlag = ContainerFlag.other;
2747 }
2748 if ((dataPick.noRotten && item.IsDecayed) || (dataPick.onlyRottable && item.trait.Decay == 0))
2749 {
2750 continue;
2751 }
2752 if (dataPick.userFilter)
2753 {
2754 switch (dataPick.IsFilterPass(item.GetName(NameStyle.Full, 1)))
2755 {
2756 case Window.SaveData.FilterResult.PassWithoutFurtherTest:
2757 Pick(item.Thing);
2758 continue;
2759 case Window.SaveData.FilterResult.Block:
2760 continue;
2761 }
2762 }
2763 if (dataPick.advDistribution)
2764 {
2765 foreach (int cat in dataPick.cats)
2766 {
2767 if (item.category.uid == cat)
2768 {
2769 Pick(item.Thing);
2770 }
2771 }
2772 }
2773 else if (!dataPick.flag.HasFlag(containerFlag))
2774 {
2775 Pick(item.Thing);
2776 }
2777 }
2778 else
2779 {
2780 Pick(item.Thing);
2781 }
2782 }
2783 }
2784 if (EClass._zone.IsRegion)
2785 {
2787 if (cell3?.zone != null && !cell3.zone.HiddenInRegionMap && (!(cell3.zone is Zone_Field) || cell3.zone.children.Count > 0 || cell3.zone.IsPCFaction))
2788 {
2789 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() ?? "");
2790 }
2791 if (pos.matFloor.alias == "snow" && EClass.rnd(3) == 0)
2792 {
2794 Msg.Say(Lang.GetList("walk_snow").RandomItem());
2795 }
2796 else if (EClass.world.weather.CurrentCondition == Weather.Condition.RainHeavy && EClass.rnd(3) == 0)
2797 {
2799 Msg.Say(Lang.GetList("walk_storm").RandomItem());
2800 }
2801 }
2803 }
2804 if (IsPCC)
2805 {
2806 int num5 = Mathf.Abs(cell2.topHeight - cell.topHeight);
2807 if ((num5 >= 3 && lastPos.sourceBlock.tileType.slopeHeight == 0 && newPoint.sourceBlock.tileType.slopeHeight == 0) || cell2.hasDoorBoat || cell.hasDoorBoat)
2808 {
2809 renderer.PlayAnime((cell2.topHeight >= cell.topHeight) ? AnimeID.JumpDown : ((num5 >= 6) ? AnimeID.Jump : AnimeID.JumpSmall));
2810 }
2811 else
2812 {
2813 float surfaceHeight = cell2.GetSurfaceHeight();
2814 float surfaceHeight2 = cell.GetSurfaceHeight();
2815 num5 = (int)Mathf.Abs((surfaceHeight - surfaceHeight2) * 100f);
2816 if (num5 >= 15)
2817 {
2818 renderer.PlayAnime((surfaceHeight >= surfaceHeight2) ? AnimeID.JumpDown : ((num5 >= 40) ? AnimeID.Jump : AnimeID.JumpSmall));
2819 }
2820 }
2821 }
2822 lastPos.Things.ForeachReverse(delegate(Thing t)
2823 {
2824 t.trait.OnSteppedOut(this);
2825 });
2826 if (!IsPC)
2827 {
2828 pos.Things.ForeachReverse(delegate(Thing t)
2829 {
2830 t.trait.OnStepped(this);
2831 });
2832 }
2833 if (CanDestroyPath())
2834 {
2836 }
2837 if (IsPC)
2838 {
2839 if (renderer.anime == null && renderer.replacer != null)
2840 {
2842 }
2844 {
2845 if (!FLOOR.IsTatami(pos.cell.sourceSurface.id) && pos.cell.room == null)
2846 {
2847 EClass.player.flags.isShoesOff = false;
2848 EClass.pc.Say("shoes_on", EClass.pc);
2849 EClass.pc.SetPCCState(PCCState.Normal);
2850 }
2851 }
2852 else if (FLOOR.IsTatami(pos.cell.sourceSurface.id) && pos.cell.room != null)
2853 {
2854 EClass.player.flags.isShoesOff = true;
2855 EClass.pc.Say("shoes_off", EClass.pc);
2856 EClass.pc.SetPCCState(PCCState.ShoesOff);
2857 }
2858 }
2859 hasMovedThisTurn = true;
2860 return MoveResult.Success;
2861 }
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:43
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:2445
void DamageHP(int dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
Definition: Card.cs:3735
bool HasElement(int ele, int req=1)
Definition: Card.cs:5214
SourceMaterial.Row material
Definition: Card.cs:1927
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:5404
int c_lockLv
Definition: Card.cs:924
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
Definition: Card.cs:5949
Point pos
Definition: Card.cs:55
Trait trait
Definition: Card.cs:49
MoveType
Definition: Card.cs:20
MoveResult
Definition: Card.cs:13
bool IsInstalled
Definition: Card.cs:2241
int Evalue(int ele)
Definition: Card.cs:2431
int Dist(Card c)
Definition: Card.cs:6777
void ModExp(string alias, int a)
Definition: Card.cs:2508
bool isLeashed
Definition: Card.cs:814
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:6046
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:1684
bool CanSuffocate()
Definition: Cell.cs:1111
Definition: Chara.cs:10
void TickConditions()
Definition: Chara.cs:3355
bool IsLevitating
Definition: Chara.cs:582
AIAct ai
Definition: Chara.cs:187
override bool IsPC
Definition: Chara.cs:597
bool isDrunk
Definition: Chara.cs:119
Party party
Definition: Chara.cs:43
bool CanDestroyPath()
Definition: Chara.cs:2118
bool IsInCombat
Definition: Chara.cs:817
bool HasCondition(string alias)
Definition: Chara.cs:8568
AIAct SetAI(AIAct g)
Definition: Chara.cs:8045
bool IsIdle
Definition: Chara.cs:806
override bool IsDisabled
Definition: Chara.cs:570
bool hasMovedThisTurn
Definition: Chara.cs:161
override bool isSynced
Definition: Chara.cs:676
bool CanMoveTo(Point p, bool allowDestroyPath=true)
Definition: Chara.cs:2131
void DestroyPath(Point pos)
Definition: Chara.cs:2863
float actTime
Definition: Chara.cs:163
override int MaxHP
Definition: Chara.cs:693
Zone currentZone
Definition: Chara.cs:240
bool CanReplace(Chara c)
Definition: Chara.cs:2974
Point lastPos
Definition: Chara.cs:87
void MoveByForce(Point newPoint, Card c=null, bool checkWall=false)
Definition: Chara.cs:2312
Stats burden
Definition: Chara.cs:953
Chara ride
Definition: Chara.cs:27
MoveResult TryMoveTowards(Point p)
Definition: Chara.cs:2320
void SyncRide()
Definition: Chara.cs:3559
bool isDead
Definition: Chara.cs:374
override void LookAt(Card c)
Definition: Chara.cs:3219
bool isConfused
Definition: Chara.cs:121
override bool IsPCC
Definition: Chara.cs:667
void TryPush(Point point)
Definition: Chara.cs:2907
void SetPCCState(PCCState state)
Definition: Chara.cs:6038
bool allyKeepDistance
Definition: ConfigTactics.cs:6
new GameConfig game
Definition: CoreConfig.cs:596
CoreConfig config
Definition: Core.cs:70
static Game game
Definition: EClass.cs:8
static Scene scene
Definition: EClass.cs:30
static int rnd(int a)
Definition: EClass.cs:50
static Zone _zone
Definition: EClass.cs:20
static World world
Definition: EClass.cs:40
static Map _map
Definition: EClass.cs:18
static BaseGameScreen screen
Definition: EClass.cs:32
static int rndHalf(int a)
Definition: EClass.cs:74
static Player player
Definition: EClass.cs:12
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:273
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
ConfigTactics tactics
Definition: Game.cs:90
Config config
Definition: Game.cs:215
Definition: Lang.cs:6
static string[] GetList(string id)
Definition: Lang.cs:114
static SourceMaterial.Row sourceOak
Definition: MATERIAL.cs:39
static SourceMaterial.Row sourceSnow
Definition: MATERIAL.cs:33
static SourceMaterial.Row sourceIce
Definition: MATERIAL.cs:35
void MoveCard(Point p, Card t)
Definition: Map.cs:835
void SetFoormark(Point pos, int id, int angle, int offset=0)
Definition: Map.cs:2038
void SetEffect(int x, int z, CellEffect effect=null)
Definition: Map.cs:1495
Color Ono
Definition: MsgColors.cs:13
Definition: Msg.cs:5
static MsgColors colors
Definition: Msg.cs:20
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
static void SetColor()
Definition: Msg.cs:22
Definition: NoGoal.cs:4
int emitFoot
Definition: PCOrbit.cs:9
int emitSmoke
Definition: PCOrbit.cs:11
Vector3 smokePos
Definition: PCOrbit.cs:15
Vector3 footPos
Definition: PCOrbit.cs:13
List< Chara > members
Definition: Party.cs:18
bool isShoesOff
Definition: Player.cs:234
int distanceTravel
Definition: Player.cs:700
Flags flags
Definition: Player.cs:895
Window.SaveData dataPick
Definition: Player.cs:835
bool regionMoveWarned
Definition: Player.cs:958
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:1015
Point Set(int _x, int _z)
Definition: Point.cs:479
List< Thing > Things
Definition: Point.cs:314
int x
Definition: Point.cs:36
int z
Definition: Point.cs:39
List< Chara > Charas
Definition: Point.cs:316
bool HasThing
Definition: Point.cs:239
SourceFloor.Row sourceFloor
Definition: Point.cs:65
bool HasObj
Definition: Point.cs:137
int Distance(Point p)
Definition: Point.cs:953
Cell cell
Definition: Point.cs:51
Point GetRandomNeighbor()
Definition: Point.cs:731
bool HasChara
Definition: Point.cs:226
TileType tileType
Definition: RenderRow.cs:77
Definition: Scene.cs:8
ParticleSystem psSmoke
Definition: Scene.cs:107
ActionMode actionMode
Definition: Scene.cs:77
ParticleSystem psFoot
Definition: Scene.cs:105
EloMap elomap
Definition: Scene.cs:143
bool Surface
Definition: SourcePref.cs:314
virtual bool ShowDangerLv
Definition: Spatial.cs:489
virtual bool IsRegion
Definition: Spatial.cs:501
virtual string Name
Definition: Spatial.cs:495
SourceZone.Row source
Definition: Spatial.cs:441
List< Spatial > children
Definition: Spatial.cs:37
override int GetPhase()
Definition: Stats.cs:117
Definition: Thing.cs:8
override SourcePref Pref
Definition: Thing.cs:50
bool ignoreSnow
Definition: TileRow.cs:6
string soundFoot
Definition: TileRow.cs:14
virtual bool IsWater
Definition: TileType.cs:159
virtual void OnSteppedOut(Chara c)
Definition: Trait.cs:1030
virtual bool IsChangeFloorHeight
Definition: Trait.cs:68
virtual void OnStepped(Chara c)
Definition: Trait.cs:1026
Card owner
Definition: Trait.cs:26
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:280
override int DangerLv
Definition: Zone.cs:107
bool IsPCFaction
Definition: Zone.cs:464
virtual bool KeepAllyDistance
Definition: Zone.cs:295
virtual bool HiddenInRegionMap
Definition: Zone.cs:406
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, 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, 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 6538 of file Chara.cs.

6539 {
6540 EClass.Sound.Play("pop_drama");
6541 if (book == "_chara" && IsPC)
6542 {
6543 step = "pc";
6544 }
6545 return LayerDrama.Activate(book, sheet, step, this, null, tag);
6546 }
static SoundManager Sound
Definition: EClass.cs:46
static LayerDrama Activate(string book, string idSheet, string idStep, Chara target=null, Card ref1=null, string tag="")
Definition: LayerDrama.cs:66

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

◆ AddCondition() [1/2]

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

Definition at line 8420 of file Chara.cs.

8421 {
8422 c.owner = this;
8423 if (!(c is ConBurning))
8424 {
8425 if (c is ConBleed && ResistLv(964) >= 3)
8426 {
8427 return null;
8428 }
8429 }
8430 else if (ResistLv(950) >= 3)
8431 {
8432 return null;
8433 }
8435 {
8436 if (c.GainResistFactor >= 400)
8437 {
8438 c.power /= 2;
8439 }
8440 ResistCon(c);
8441 if (c.power <= 0)
8442 {
8443 return null;
8444 }
8445 }
8446 if (!force)
8447 {
8448 if (c.source.negate.Length != 0)
8449 {
8450 string[] negate = c.source.negate;
8451 foreach (string text in negate)
8452 {
8453 if (HasElement(text))
8454 {
8455 return null;
8456 }
8457 }
8458 }
8459 Element defenseAttribute = c.GetDefenseAttribute(this);
8460 if (defenseAttribute != null)
8461 {
8462 c.power = 100 * c.power / (100 + defenseAttribute.Value);
8463 }
8464 if (c.source.resistance.Length != 0)
8465 {
8466 int num = ResistLv(EClass.sources.elements.alias[c.source.resistance[0]].id);
8467 if (num > 0)
8468 {
8469 c.power /= num * num + 1;
8470 if (c.power <= 40)
8471 {
8472 return null;
8473 }
8474 }
8475 }
8476 c.power = c.EvaluatePower(c.power);
8477 if (c.power <= 0)
8478 {
8479 return null;
8480 }
8481 }
8482 for (int j = 0; j < conditions.Count; j++)
8483 {
8484 if (conditions[j].id != c.id)
8485 {
8486 continue;
8487 }
8488 if (c.Type == ConditionType.Stance || c.IsToggle)
8489 {
8490 conditions[j].Kill();
8491 return null;
8492 }
8493 if (conditions[j].CanStack(c))
8494 {
8495 if (conditions[j].WillOverride)
8496 {
8497 conditions[j].Kill(silent: true);
8498 continue;
8499 }
8500 if (CanGainConResist)
8501 {
8502 AddResistCon(c);
8503 }
8504 conditions[j].OnStacked(c.power);
8505 conditions[j].OnStartOrStack();
8506 conditions[j].PlayEffect();
8507 }
8508 if (!conditions[j].AllowMultipleInstance)
8509 {
8510 return null;
8511 }
8512 }
8513 foreach (Condition condition in conditions)
8514 {
8515 if (condition.TryNullify(c))
8516 {
8517 return null;
8518 }
8519 }
8520 int num2 = c.EvaluateTurn(c.power);
8521 if (num2 == 0)
8522 {
8523 return null;
8524 }
8525 c.value = num2;
8526 conditions.Add(c);
8527 if (CanGainConResist)
8528 {
8529 AddResistCon(c);
8530 }
8531 c.SetOwner(this);
8532 c.Start();
8533 SetDirtySpeed();
8534 if (c.ShouldRefresh)
8535 {
8536 Refresh();
8537 }
8538 if (IsPC && c.ConsumeTurn && !EClass.pc.isRestrained)
8539 {
8541 }
8542 if (c.SyncRide && (ride != null || parasite != null))
8543 {
8544 if (ride != null)
8545 {
8547 }
8548 if (parasite != null)
8549 {
8551 }
8552 }
8553 return c;
8554 }
ConditionType
Definition: ConditionType.cs:2
virtual bool SyncRide
virtual bool IsToggle
virtual bool ShouldRefresh
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:538
int ResistLv(int res)
Definition: Card.cs:5209
void SetDirtySpeed()
Definition: Chara.cs:1605
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:8415
bool CanGainConResist
Definition: Chara.cs:970
Chara parasite
Definition: Chara.cs:30
void AddResistCon(Condition con)
Definition: Chara.cs:8772
void ResistCon(Condition con)
Definition: Chara.cs:8792
static Condition Create(string alias, int power=100, Action< Condition > onCreate=null)
Definition: Condition.cs:46
static SourceManager sources
Definition: EClass.cs:42
int Value
Definition: ELEMENT.cs:282
void EndTurn(bool consume=true)
Definition: Player.cs:1866
SourceElement elements

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

◆ AddCondition() [2/2]

◆ AddCondition< T >()

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

Definition at line 8410 of file Chara.cs.

8410 : Condition
8411 {
8412 return AddCondition(typeof(T).Name, p, force);
8413 }
string Name
Definition: Card.cs:2013

◆ AddCooldown()

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

Definition at line 7889 of file Chara.cs.

7890 {
7891 if (_cooldowns == null)
7892 {
7893 _cooldowns = new List<int>();
7894 }
7895 if (turns != 0)
7896 {
7897 _cooldowns.Add(idEle * 1000 + turns);
7898 return;
7899 }
7900 SourceElement.Row row = EClass.sources.elements.map[idEle];
7901 if (row.cooldown > 0)
7902 {
7903 _cooldowns.Add(idEle * 1000 + row.cooldown);
7904 }
7905 }
List< int > _cooldowns
Definition: Chara.cs:58

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

Referenced by Card.DamageHP(), ActEffect.Proc(), and RequestProtection().

◆ AddHobby()

void Chara.AddHobby ( int  id)
inline

Definition at line 8245 of file Chara.cs.

8246 {
8247 foreach (int hobby in _hobbies)
8248 {
8249 if (hobby == id)
8250 {
8251 return;
8252 }
8253 }
8254 _hobbies.Add(id);
8255 }
List< int > _hobbies
Definition: Chara.cs:49

◆ AddRandomBodyPart()

void Chara.AddRandomBodyPart ( bool  msg = false)
inline

Definition at line 1920 of file Chara.cs.

1921 {
1922 int ele = new int[9] { 30, 31, 33, 35, 35, 36, 34, 37, 39 }.RandomItem();
1923 body.AddBodyPart(ele);
1924 if (msg)
1925 {
1926 Say("gain_bodyparts", this, Element.Get(ele).GetName().ToLower());
1927 PlaySound("offering");
1928 }
1929 }
void AddBodyPart(int ele, Thing thing=null)
Definition: CharaBody.cs:261
CharaBody body
Definition: Chara.cs:91
static SourceElement.Row Get(int id)
Definition: ELEMENT.cs:391

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

8773 {
8774 if (con.power > 0 && con.GainResistFactor > 0)
8775 {
8776 int key = con.id;
8777 if (resistCon == null)
8778 {
8779 resistCon = new Dictionary<int, int>();
8780 }
8781 if (resistCon.ContainsKey(key))
8782 {
8783 resistCon[key] += con.power * con.GainResistFactor / 100;
8784 }
8785 else
8786 {
8787 resistCon[key] = con.power * con.GainResistFactor / 100;
8788 }
8789 }
8790 }
Dictionary< int, int > resistCon
Definition: Chara.cs:199

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

◆ AddWork()

void Chara.AddWork ( int  id)
inline

Definition at line 8257 of file Chara.cs.

8258 {
8259 foreach (int work in _works)
8260 {
8261 if (work == id)
8262 {
8263 return;
8264 }
8265 }
8266 _works.Add(id);
8267 }
List< int > _works
Definition: Chara.cs:52

◆ ApplyDeathPenalty()

void Chara.ApplyDeathPenalty ( )
inline

Definition at line 4737 of file Chara.cs.

4738 {
4739 if (!IsPC)
4740 {
4741 return;
4742 }
4743 int currency = GetCurrency();
4744 if (currency > 0)
4745 {
4746 int num = currency / 3 + EClass.rnd(currency / 3 + 1);
4747 if (num <= 0)
4748 {
4749 num = 1;
4750 }
4751 Msg.Say("panaltyMoney", this, Lang._currency(num));
4752 ModCurrency(-num);
4754 }
4755 foreach (Element value in EClass.pc.elements.dict.Values)
4756 {
4757 if (EClass.rnd(5) == 0 && value.IsMainAttribute)
4758 {
4759 EClass.pc.elements.ModExp(value.id, -500);
4760 }
4761 }
4762 }
@ currency
ElementContainerCard elements
Definition: Card.cs:37
int GetCurrency(string id="money")
Definition: Card.cs:3652
void ModCurrency(int a, string id="money")
Definition: Card.cs:3638
Dictionary< int, Element > dict
void ModExp(int ele, int a, bool chain=false)
int id
Definition: ELEMENT.cs:240
bool IsMainAttribute
Definition: ELEMENT.cs:373
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:1893

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

1756 {
1757 switch (tag)
1758 {
1759 case EditorTag.HostilityNeutral:
1760 {
1761 Hostility hostility2 = (base.c_originalHostility = Hostility.Neutral);
1762 this.hostility = hostility2;
1763 break;
1764 }
1765 case EditorTag.HostilityEnemy:
1766 {
1767 Hostility hostility2 = (base.c_originalHostility = Hostility.Enemy);
1768 this.hostility = hostility2;
1769 break;
1770 }
1771 case EditorTag.HostilityFriend:
1772 {
1773 Hostility hostility2 = (base.c_originalHostility = Hostility.Friend);
1774 this.hostility = hostility2;
1775 break;
1776 }
1777 case EditorTag.Male:
1778 bio.SetGender(2);
1779 base.c_idPortrait = Portrait.GetRandomPortrait(2, GetIdPortraitCat());
1780 break;
1781 case EditorTag.Female:
1782 bio.SetGender(1);
1783 base.c_idPortrait = Portrait.GetRandomPortrait(1, GetIdPortraitCat());
1784 break;
1785 case EditorTag.baby:
1786 SetFeat(1232);
1787 break;
1788 }
1789 base.ApplyEditorTags(tag);
1790 }
EditorTag
Definition: EditorTag.cs:2
void SetGender(int g)
Definition: Biography.cs:450
Biography bio
Definition: Card.cs:40
void SetFeat(int id, int value=1, bool msg=false)
Definition: Chara.cs:8964
string GetIdPortraitCat()
Definition: Chara.cs:7320
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 1882 of file Chara.cs.

1883 {
1884 elements.ApplyElementMap(base.uid, SourceValueType.Chara, job.elementMap, base.DefaultLV, remove, applyFeat: true);
1885 if (IsPCC)
1886 {
1887 EClass.game.uniforms.Apply(pccData, job.id, base.IsMale, canUseOtherGender: true);
1888 }
1889 }
SourceValueType
SourceJob.Row job
Definition: Chara.cs:451
void ApplyElementMap(int uid, SourceValueType type, Dictionary< int, int > map, int lv, bool invert=false, bool applyFeat=false)
PCCUniformManager uniforms
Definition: Game.cs:191

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

Referenced by ChangeJob(), and OnCreate().

◆ ApplyRace()

void Chara.ApplyRace ( bool  remove = false)
inline

Definition at line 1968 of file Chara.cs.

1969 {
1970 string[] array = race.figure.Split('|');
1971 foreach (string s in array)
1972 {
1973 int num = ParseBodySlot(s);
1974 if (num != -1)
1975 {
1976 if (remove)
1977 {
1978 body.RemoveBodyPart(num);
1979 }
1980 else
1981 {
1982 body.AddBodyPart(num);
1983 }
1984 }
1985 }
1986 elements.ApplyElementMap(base.uid, SourceValueType.Chara, race.elementMap, base.DefaultLV, remove, applyFeat: true);
1987 }
void RemoveBodyPart(int ele)
Definition: CharaBody.cs:310
int ParseBodySlot(string s)
Definition: Chara.cs:1903

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

Referenced by ChangeRace(), and OnCreate().

◆ CalcBurden()

void Chara.CalcBurden ( )
inline

Definition at line 1573 of file Chara.cs.

1574 {
1575 int num = base.ChildrenWeight * 100 / Mathf.Max(1, WeightLimit);
1576 if (num < 0)
1577 {
1578 num = 1000;
1579 }
1581 {
1582 num = 0;
1583 }
1584 burden.Set(num);
1585 SetDirtySpeed();
1586 }
override int WeightLimit
Definition: Chara.cs:695
bool ignoreWeight
Definition: CoreDebug.cs:186
static CoreDebug debug
Definition: EClass.cs:48
Stats Set(int[] _raw, int _rawIndex, Chara _CC)
Definition: Stats.cs:109

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

Referenced by Scene.OnUpdate().

◆ CalcCastingChance()

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

Definition at line 5535 of file Chara.cs.

5536 {
5537 if (!(e is Spell))
5538 {
5539 return 100;
5540 }
5541 if (!IsPC)
5542 {
5543 int num2 = 95;
5544 if (host != null)
5545 {
5546 if (host.ride == this)
5547 {
5548 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.EvalueRiding()));
5549 }
5550 if (host.parasite == this)
5551 {
5552 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.Evalue(227)));
5553 }
5554 }
5555 return num2;
5556 }
5557 int num3 = Evalue(304);
5558 if (!IsPCFaction)
5559 {
5560 num3 = Mathf.Max(num3, base.LV + 5);
5561 }
5562 int num4 = 0;
5563 int num5 = 0;
5564 bool num6 = GetArmorSkill() == 122;
5565 AttackStyle attackStyle = body.GetAttackStyle();
5566 if (num6)
5567 {
5568 num4 = 20 - Evalue(122) / 5;
5569 num5 += 10 - Evalue(1654) * 4;
5570 }
5571 else
5572 {
5573 num4 = 10 - Evalue(120) / 5;
5574 }
5575 if (num4 < 5)
5576 {
5577 num4 = 5;
5578 }
5579 if (ride != null)
5580 {
5581 num4 += 5;
5582 }
5583 if (parasite != null)
5584 {
5585 num4 += 10;
5586 }
5587 if (attackStyle == AttackStyle.TwoWield)
5588 {
5589 num4 += 5;
5590 }
5591 if (attackStyle == AttackStyle.Shield)
5592 {
5593 num4 += 5;
5594 num5 += 10 - Evalue(1654) * 4;
5595 }
5596 if (isConfused)
5597 {
5598 num4 += 10000;
5599 }
5600 if (HasCondition<ConDim>())
5601 {
5602 num4 += ((Evalue(1654) >= 3) ? 1500 : 2500);
5603 }
5604 if (num > 1)
5605 {
5606 num4 += 5 * num;
5607 }
5608 if (num5 < 0)
5609 {
5610 num5 = 0;
5611 }
5612 return Mathf.Clamp(100 + e.Value - 10 - e.source.LV * e.source.cost[0] * num4 / (10 + num3 * 10), 0, 100 - num5);
5613 }
AttackStyle
Definition: AttackStyle.cs:2
AttackStyle GetAttackStyle()
Definition: CharaBody.cs:427
override int GetArmorSkill()
Definition: Chara.cs:7101
int EvalueRiding()
Definition: Chara.cs:5526
override bool IsPCFaction
Definition: Chara.cs:656
SourceElement.Row source
Definition: ELEMENT.cs:263
Definition: SPELL.cs:468

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

1737 {
1738 int num = base.END;
1739 int num2 = 0;
1740 foreach (Element value in elements.dict.Values)
1741 {
1742 if (value.source.category == "skill")
1743 {
1744 num = ((!IsPC) ? (num + Mathf.Max(value.ValueWithoutLink, 0)) : (num + Mathf.Max(value.vBase, 0)));
1745 }
1746 }
1747 num2 = EClass.curve(num, 30, 10, 60);
1748 if (num2 < 10)
1749 {
1750 num2 = 10;
1751 }
1752 _maxStamina = num2 + 15;
1753 }
int _maxStamina
Definition: Chara.cs:350
static int curve(int a, int start, int step, int rate=75)
Definition: EClass.cs:55
int ValueWithoutLink
Definition: ELEMENT.cs:284
int vBase
Definition: ELEMENT.cs:242

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

5790 {
5791 foreach (Chara chara in EClass._map.charas)
5792 {
5793 if (!chara.IsPCFaction && chara.OriginalHostility == OriginalHostility && (fanatic || Dist(chara) <= 6) && (EClass.rnd(3) != 0 || fanatic))
5794 {
5795 chara.GoHostile(tg);
5796 }
5797 }
5798 }
Hostility OriginalHostility
Definition: Chara.cs:456
void GoHostile(Card _tg)
Definition: Chara.cs:5683
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 7455 of file Chara.cs.

7456 {
7457 if (things.IsFull())
7458 {
7459 return false;
7460 }
7461 if (t.c_isImportant)
7462 {
7463 return false;
7464 }
7465 if (t.id == "1084")
7466 {
7467 return true;
7468 }
7469 if (t.trait is TraitBookSecret)
7470 {
7471 return true;
7472 }
7473 if (t.trait.CanOnlyCarry || !t.trait.CanBeDestroyed || t.trait.CanExtendBuild || t.rarity == Rarity.Artifact || t.IsContainer)
7474 {
7475 return false;
7476 }
7477 return true;
7478 }
Rarity
Definition: Rarity.cs:2
string id
Definition: Card.cs:31
Rarity rarity
Definition: Card.cs:298
bool c_isImportant
Definition: Card.cs:984
ThingContainer things
Definition: Card.cs:34
bool IsContainer
Definition: Card.cs:1965
bool IsFull(int y=0)
virtual bool CanExtendBuild
Definition: Trait.cs:161
virtual bool CanBeDestroyed
Definition: Trait.cs:285
virtual bool CanOnlyCarry
Definition: Trait.cs:283

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

7435 {
7436 if (EClass.debug.enable)
7437 {
7438 return true;
7439 }
7440 if (!IsValidGiftWeight(t, num))
7441 {
7442 return false;
7443 }
7444 if (t.c_isImportant)
7445 {
7446 return false;
7447 }
7448 if ((t.category.IsChildOf("furniture") || t.category.IsChildOf("junk")) && !HasElement(1411))
7449 {
7450 return false;
7451 }
7452 return true;
7453 }
SourceCategory.Row category
Definition: Card.cs:1925
bool IsValidGiftWeight(Card t, int num=-1)
Definition: Chara.cs:7424
bool enable
Definition: CoreDebug.cs:285

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

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

◆ CanAutoPick()

bool Chara.CanAutoPick ( Card  c)
inline

Definition at line 3877 of file Chara.cs.

3878 {
3879 return true;
3880 }

◆ CanBeTempAlly()

bool Chara.CanBeTempAlly ( Chara  c)
inline

Definition at line 2045 of file Chara.cs.

2046 {
2047 if (IsPCFaction || IsGlobal || IsMinion || IsMultisize || EClass._zone.CountMinions(c) > c.MaxSummon || base.rarity >= Rarity.Legendary)
2048 {
2049 return false;
2050 }
2051 if (HasElement(1222))
2052 {
2053 return false;
2054 }
2055 return true;
2056 }
override bool IsGlobal
Definition: Chara.cs:595
override bool IsMinion
Definition: Chara.cs:612
int MaxSummon
Definition: Chara.cs:699
override bool IsMultisize
Definition: Chara.cs:691
int CountMinions(Chara c)
Definition: Zone.cs:3420

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

Referenced by GoalCombat.Run().

◆ CanDestroyPath()

bool Chara.CanDestroyPath ( )
inline

Definition at line 2118 of file Chara.cs.

2119 {
2120 if (!IsMultisize)
2121 {
2122 if (base.rarity >= Rarity.Superior && !base.IsPCFactionOrMinion && ai is GoalCombat && !EClass._zone.IsPCFaction)
2123 {
2124 return !(EClass._zone is Zone_Town);
2125 }
2126 return false;
2127 }
2128 return true;
2129 }

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

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

◆ CanEat()

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

Definition at line 6862 of file Chara.cs.

6863 {
6864 if (t.IsDecayed && !HasElement(480))
6865 {
6866 return false;
6867 }
6868 if (shouldEat && (!(t.trait is TraitFoodPrepared) || t.c_isImportant))
6869 {
6870 return false;
6871 }
6872 if (!t.IsNegativeGift && !t.HasTag(CTAG.ignoreUse) && !t.isEquipped)
6873 {
6874 return t.trait.CanEat(this);
6875 }
6876 return false;
6877 }
CTAG
Definition: CTAG.cs:2
bool IsNegativeGift
Definition: Card.cs:2256
bool IsDecayed
Definition: Card.cs:2147
bool HasTag(CTAG tag)
Definition: Card.cs:2455
bool isEquipped
Definition: Thing.cs:17
virtual bool CanEat(Chara c)
Definition: Trait.cs:928

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

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

◆ CanEquipRanged()

bool Chara.CanEquipRanged ( Thing  t)
inline

Definition at line 7000 of file Chara.cs.

7001 {
7002 return !body.IsTooHeavyToEquip(t);
7003 }
bool IsTooHeavyToEquip(Thing thing)
Definition: CharaBody.cs:156

References CharaBody.IsTooHeavyToEquip().

Referenced by GoalAutoCombat.TryUseRanged().

◆ CanInsult()

bool Chara.CanInsult ( )
inline

Definition at line 7308 of file Chara.cs.

7309 {
7310 foreach (ActList.Item item in ability.list.items)
7311 {
7312 if (item.act.id == 6630)
7313 {
7314 return true;
7315 }
7316 }
7317 return false;
7318 }
List< Item > items
Definition: ActList.cs:14
ActList list
Definition: CharaAbility.cs:12
CharaAbility ability
Definition: Chara.cs:409

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

◆ CanInteractTo() [1/2]

bool Chara.CanInteractTo ( Card  c)
inline

Definition at line 2225 of file Chara.cs.

2226 {
2227 return CanInteractTo(c.pos);
2228 }
bool CanInteractTo(Card c)
Definition: Chara.cs:2225

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

2231 {
2232 if (!p.IsValid)
2233 {
2234 return false;
2235 }
2236 if (EClass._map.cells[p.x, p.z].blocked)
2237 {
2238 return true;
2239 }
2240 if (!IsMultisize)
2241 {
2242 int num = ((p.z >= pos.z) ? ((p.x > pos.x) ? 1 : ((p.z > pos.z) ? 2 : 3)) : 0);
2243 if (EClass._map.cells[pos.x, pos.z].weights[num] == 0)
2244 {
2245 return false;
2246 }
2247 if (p.x != pos.x && p.z != pos.z)
2248 {
2249 Cell[,] cells = EClass._map.cells;
2250 int x = p.x;
2251 int z = pos.z;
2252 int num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2253 if (cells[pos.x, pos.z].weights[num2] == 0)
2254 {
2255 return false;
2256 }
2257 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2258 if (cells[p.x, p.z].weights[num2] == 0)
2259 {
2260 return false;
2261 }
2262 x = pos.x;
2263 z = p.z;
2264 num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2265 if (cells[pos.x, pos.z].weights[num2] == 0)
2266 {
2267 return false;
2268 }
2269 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2270 if (cells[p.x, p.z].weights[num2] == 0)
2271 {
2272 return false;
2273 }
2274 }
2275 }
2276 return true;
2277 }
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 3872 of file Chara.cs.

3873 {
3874 return true;
3875 }

◆ CanMoveTo()

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

Definition at line 2131 of file Chara.cs.

2132 {
2133 if (!p.IsValid)
2134 {
2135 return false;
2136 }
2137 int num = ((p.z >= pos.z) ? ((p.x > pos.x) ? 1 : ((p.z > pos.z) ? 2 : 3)) : 0);
2138 if (allowDestroyPath && CanDestroyPath())
2139 {
2140 if (!p.IsInBounds)
2141 {
2142 return false;
2143 }
2144 }
2145 else
2146 {
2147 if (EClass._map.cells[p.x, p.z].blocked || EClass._map.cells[pos.x, pos.z].weights[num] == 0)
2148 {
2149 return false;
2150 }
2151 if (p.x != pos.x && p.z != pos.z)
2152 {
2153 Cell[,] cells = EClass._map.cells;
2154 int x = p.x;
2155 int z = pos.z;
2156 int num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2157 if (cells[pos.x, pos.z].weights[num2] == 0)
2158 {
2159 return false;
2160 }
2161 if (cells[x, z].blocked)
2162 {
2163 return false;
2164 }
2165 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2166 if (cells[p.x, p.z].weights[num2] == 0)
2167 {
2168 return false;
2169 }
2170 x = pos.x;
2171 z = p.z;
2172 num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2173 if (cells[pos.x, pos.z].weights[num2] == 0)
2174 {
2175 return false;
2176 }
2177 if (cells[x, z].blocked)
2178 {
2179 return false;
2180 }
2181 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2182 if (cells[p.x, p.z].weights[num2] == 0)
2183 {
2184 return false;
2185 }
2186 }
2187 }
2188 if (IsPC)
2189 {
2190 if (IsEnemyOnPath(p))
2191 {
2192 return false;
2193 }
2194 }
2195 else if (p.HasChara && !IsMultisize && !CanReplace(p.FirstChara))
2196 {
2197 return false;
2198 }
2199 return true;
2200 }
bool IsEnemyOnPath(Point p, bool cancelAI=true)
Definition: Chara.cs:2202
Chara FirstChara
Definition: Point.cs:264
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 3882 of file Chara.cs.

3883 {
3884 if (c.isDestroyed)
3885 {
3886 return false;
3887 }
3888 Card rootCard = c.GetRootCard();
3889 if (rootCard.isDestroyed || (rootCard.ExistsOnMap && rootCard.pos.Distance(pos) > 1))
3890 {
3891 return false;
3892 }
3893 if (rootCard != this && things.IsFull(c.Thing))
3894 {
3895 return false;
3896 }
3897 return true;
3898 }
bool isDestroyed
Definition: Card.cs:71
bool ExistsOnMap
Definition: Card.cs:1961
virtual Thing Thing
Definition: Card.cs:1934
Card GetRootCard()
Definition: Card.cs:3173

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

2975 {
2977 {
2978 return false;
2979 }
2980 if (IsPC)
2981 {
2982 return true;
2983 }
2984 if (c.IsPC || c.pos.Equals(EClass.pc.pos) || c.host != null)
2985 {
2986 return false;
2987 }
2988 if (!IsHostile(c))
2989 {
2990 if (c.c_uidMaster != 0 || c.isSummon || base.IsPowerful || IsEscorted())
2991 {
2992 return true;
2993 }
2994 if (DestDist < c.DestDist)
2995 {
2996 return true;
2997 }
2998 if (IsPCParty && !c.IsPCParty)
2999 {
3000 return true;
3001 }
3002 if (IsPCFaction && !c.IsPCParty)
3003 {
3004 return true;
3005 }
3006 }
3007 return false;
3008 }
bool IsPCFactionOrMinion
Definition: Card.cs:2132
bool isSummon
Definition: Card.cs:682
int c_uidMaster
Definition: Card.cs:1373
bool noMove
Definition: Card.cs:742
new TraitChara trait
Definition: Chara.cs:488
override bool IsPCParty
Definition: Chara.cs:600
int DestDist
Definition: Chara.cs:819
bool IsHostile()
Definition: Chara.cs:5884
bool IsEscorted()
Definition: Chara.cs:2102
bool Equals(int _x, int _z)
Definition: Point.cs:924
virtual bool CanBePushed
Definition: TraitChara.cs:115

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

4624 {
4625 return EClass.world.date.IsExpired(base.c_dateDeathLock);
4626 }
bool IsExpired(int time)
Definition: Date.cs:332

References World.date, Date.IsExpired(), and EClass.world.

Referenced by FactionBranch.DailyOutcome(), and Zone.Revive().

◆ CanSee()

bool Chara.CanSee ( Card  c)
inline

Definition at line 1027 of file Chara.cs.

1028 {
1029 if (c == this)
1030 {
1031 return true;
1032 }
1033 if (!c.pos.IsValid)
1034 {
1035 return false;
1036 }
1037 if (c.isChara)
1038 {
1039 if (hasTelepathy && c.Chara.race.visibleWithTelepathy)
1040 {
1041 return true;
1042 }
1043 if (c.isHidden && c != this && !canSeeInvisible)
1044 {
1045 return false;
1046 }
1047 }
1048 if (IsPC)
1049 {
1050 if (fov != null)
1051 {
1052 return fov.lastPoints.ContainsKey(c.pos.index);
1053 }
1054 return false;
1055 }
1056 return true;
1057 }
virtual Chara Chara
Definition: Card.cs:1946
Fov fov
Definition: Card.cs:53
virtual bool isChara
Definition: Card.cs:1959
bool isHidden
Definition: Card.cs:502
bool canSeeInvisible
Definition: Chara.cs:133
bool hasTelepathy
Definition: Chara.cs:135
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 race.

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

◆ CanSeeLos() [1/2]

bool Chara.CanSeeLos ( Card  c,
int  dist = -1 
)
inline

◆ CanSeeLos() [2/2]

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

Definition at line 1068 of file Chara.cs.

1069 {
1070 if (dist == -1)
1071 {
1072 dist = pos.Distance(p);
1073 }
1074 if (dist > GetSightRadius())
1075 {
1076 return false;
1077 }
1078 if (IsPC)
1079 {
1080 if (fov != null)
1081 {
1082 return fov.lastPoints.ContainsKey(p.index);
1083 }
1084 return false;
1085 }
1086 return Los.IsVisible(pos, p);
1087 }
int GetSightRadius()
Definition: Card.cs:5649
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 1010 of file Chara.cs.

1011 {
1012 if (!p.IsValid || p.IsHidden)
1013 {
1014 return false;
1015 }
1016 if (IsPC)
1017 {
1018 if (fov != null)
1019 {
1020 return fov.lastPoints.ContainsKey(p.index);
1021 }
1022 return false;
1023 }
1024 return true;
1025 }
bool IsHidden
Definition: Point.cs:323

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

1109 {
1110 if (EClass._zone.events.GetEvent<ZoneEventQuest>() != null)
1111 {
1112 return false;
1113 }
1114 if (!EClass.debug.godMode && sleepiness.GetPhase() == 0)
1115 {
1116 return stamina.GetPhase() <= 1;
1117 }
1118 return true;
1119 }
Stats sleepiness
Definition: Chara.cs:965
Stats stamina
Definition: Chara.cs:955
bool godMode
Definition: CoreDebug.cs:172
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 1891 of file Chara.cs.

1892 {
1893 ApplyJob(remove: true);
1894 base.c_idJob = idNew;
1895 _job = null;
1896 ApplyJob();
1897 if (IsPCC)
1898 {
1899 PCC.Get(pccData).Build();
1900 }
1901 }
void ApplyJob(bool remove=false)
Definition: Chara.cs:1882
SourceJob.Row _job
Definition: Chara.cs:147

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

6364 {
6365 memberType = type;
6366 }
FactionMemberType memberType
Definition: Chara.cs:46

◆ ChangeRace()

void Chara.ChangeRace ( string  idNew)
inline

Definition at line 1989 of file Chara.cs.

1990 {
1991 ApplyRace(remove: true);
1992 base.c_idRace = idNew;
1993 _race = null;
1994 ApplyRace();
1995 ChangeMaterial(race.material);
1996 }
@ ChangeMaterial
void ApplyRace(bool remove=false)
Definition: Chara.cs:1968
SourceRace.Row _race
Definition: Chara.cs:145

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

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

◆ ChangeRarity()

override void Chara.ChangeRarity ( Rarity  r)
inlinevirtual

Reimplemented from Card.

Definition at line 1214 of file Chara.cs.

1215 {
1216 if (r != base.rarity)
1217 {
1218 base.rarity = r;
1219 if (renderer != null && renderer.isSynced)
1220 {
1222 }
1223 base.hp = MaxHP;
1224 }
1225 }
void RefreshExtra()

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

Referenced by ZonePreEnterBout.Execute().

◆ ChooseNewGoal()

void Chara.ChooseNewGoal ( )
inline

Definition at line 7941 of file Chara.cs.

7942 {
7943 if (IsPC && EClass.AdvMode)
7944 {
7945 SetNoGoal();
7946 return;
7947 }
7948 if (IsPCParty || base.noMove)
7949 {
7950 SetAI(new GoalIdle());
7951 return;
7952 }
7953 if ((IsHomeMember() && IsInHomeZone()) || IsGuest())
7954 {
7955 Goal goalFromTimeTable = GetGoalFromTimeTable(EClass.world.date.hour);
7956 if (goalFromTimeTable != null)
7957 {
7958 SetAI(goalFromTimeTable);
7959 if (goalFromTimeTable is GoalWork)
7960 {
7961 goalFromTimeTable.Tick();
7962 }
7963 return;
7964 }
7965 }
7966 if (goalList.index == -2)
7967 {
7969 }
7970 SetAI(goalList.Next());
7971 }
Status Tick()
Definition: AIAct.cs:352
Goal GetGoalFromTimeTable(int hour)
Definition: Chara.cs:7973
GoalListType goalListType
Definition: Chara.cs:264
AIAct SetNoGoal()
Definition: Chara.cs:8040
bool IsHomeMember()
Definition: Chara.cs:5942
bool IsGuest()
Definition: Chara.cs:5967
GoalList goalList
Definition: Chara.cs:185
bool IsInHomeZone()
Definition: Chara.cs:5947
int hour
Definition: Date.cs:74
static bool AdvMode
Definition: EClass.cs:10
int index
Definition: GoalList.cs:5
void Refresh(Chara owner, GoalListType type)
Definition: GoalList.cs:9
Goal Next()
Definition: GoalList.cs:39
Definition: Goal.cs:4

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

Referenced by Zone.Simulate().

◆ ClearBed()

void Chara.ClearBed ( Map  map = null)
inline

Definition at line 6614 of file Chara.cs.

6615 {
6616 if (map == null)
6617 {
6618 map = EClass._map;
6619 }
6620 foreach (Card item in map.props.installed.all)
6621 {
6622 if (item.trait is TraitBed traitBed && traitBed.IsHolder(this))
6623 {
6624 traitBed.RemoveHolder(this);
6625 }
6626 }
6627 }
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:129

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

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

◆ ClearInventory()

void Chara.ClearInventory ( ClearInventoryType  type)
inline

Definition at line 7768 of file Chara.cs.

7769 {
7770 int num = 0;
7771 for (int num2 = things.Count - 1; num2 >= 0; num2--)
7772 {
7773 Thing thing = things[num2];
7774 if (ShouldThrowAway(thing, type))
7775 {
7776 num += thing.GetPrice(CurrencyType.Money, sell: true, PriceType.Default, this) * thing.Num;
7777 thing.Destroy();
7778 }
7779 }
7780 if (num > 0)
7781 {
7782 ModCurrency(num);
7783 if (type == ClearInventoryType.SellAtTown)
7784 {
7785 Msg.Say("party_sell", this, num.ToString() ?? "");
7786 PlaySound("pay");
7787 }
7788 }
7789 }
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:6449
void Destroy()
Definition: Card.cs:4538
int Num
Definition: Card.cs:154
bool ShouldThrowAway(Thing t, ClearInventoryType type)
Definition: Chara.cs:7693

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

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

◆ CreateReplacement()

Chara Chara.CreateReplacement ( )
inline

Definition at line 7233 of file Chara.cs.

7234 {
7235 Chara chara = CharaGen.Create(id);
7236 chara.c_originalHostility = base.c_originalHostility;
7237 if (chara.c_originalHostility != 0)
7238 {
7239 chara.hostility = chara.c_originalHostility;
7240 }
7241 if (orgPos != null)
7242 {
7243 chara.orgPos = orgPos.Copy();
7244 }
7245 chara.pos = pos.Copy();
7246 chara.isImported = true;
7247 chara.c_editorTags = base.c_editorTags;
7248 chara.c_editorTraitVal = base.c_editorTraitVal;
7249 chara.c_idTrait = base.c_idTrait;
7250 chara.homeZone = homeZone;
7251 return chara;
7252 }
Hostility c_originalHostility
Definition: Card.cs:936
static Chara Create(string id, int lv=-1)
Definition: CharaGen.cs:17
Zone homeZone
Definition: Chara.cs:252
Point Copy()
Definition: Point.cs:467

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

5628 {
5629 Talk("goodBoy");
5630 Say(headpat ? "headpat" : "cuddle", this, c);
5631 c.ShowEmo(Emo.love);
5632 if (EClass.rnd(IsPC ? 100 : 5000) == 0)
5633 {
5634 c.MakeEgg();
5635 }
5636 if (!headpat || this == c)
5637 {
5638 return;
5639 }
5640 if (c.interest > 0)
5641 {
5642 c.ModAffinity(EClass.pc, 1 + EClass.rnd(3));
5643 c.interest -= 20 + EClass.rnd(10);
5644 }
5646 {
5647 return;
5648 }
5649 foreach (Chara member in party.members)
5650 {
5651 if (!member.IsPC && CanSeeLos(member))
5652 {
5653 member.AddCondition<ConEuphoric>(100 + Evalue(6904) * 5);
5654 }
5655 }
5656 }
Emo
Definition: Emo.cs:2
void ShowEmo(Emo _emo=Emo.none, float duration=0f, bool skipSame=true)
Definition: Card.cs:5372
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Definition: Chara.cs:7166
int interest
Definition: Chara.cs:302
Religion faith
Definition: Chara.cs:424
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true)
Definition: Chara.cs:7396
ReligionManager religions
Definition: Game.cs:158
ReligionMoonShadow MoonShadow

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

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

◆ Cure()

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

Definition at line 8647 of file Chara.cs.

8648 {
8649 bool flag = state == BlessedState.Blessed;
8650 switch (type)
8651 {
8652 case CureType.Heal:
8653 case CureType.Prayer:
8654 CureCondition<ConFear>();
8655 CureCondition<ConBlind>(2 * p / 100 + 5);
8656 CureCondition<ConPoison>(5 * p / 100 + 5);
8657 CureCondition<ConConfuse>(10 * p / 100 + 10);
8658 CureCondition<ConDim>(p / 100 + 5);
8659 CureCondition<ConBleed>(2 * p / 100 + 10);
8660 if (flag)
8661 {
8662 SAN.Mod(-15);
8663 }
8664 break;
8665 case CureType.CureBody:
8666 CureCondition<ConBlind>(5 * p / 100 + 15);
8667 CureCondition<ConPoison>(10 * p / 100 + 15);
8668 CureCondition<ConBleed>(5 * p / 100 + 20);
8669 CureTempElements(p, body: true, mind: false);
8670 break;
8671 case CureType.CureMind:
8672 CureCondition<ConFear>();
8673 CureCondition<ConDim>(3 * p / 100 + 10);
8674 CureTempElements(p, body: false, mind: true);
8675 break;
8676 case CureType.Sleep:
8677 {
8678 for (int num2 = conditions.Count - 1; num2 >= 0; num2--)
8679 {
8680 Condition condition2 = conditions[num2];
8681 if (!(condition2 is ConSleep) && !(condition2 is ConFaint))
8682 {
8683 if (condition2.isPerfume)
8684 {
8685 condition2.Mod(-1, force: true);
8686 }
8687 else if (condition2.Type == ConditionType.Bad || condition2.Type == ConditionType.Debuff)
8688 {
8689 condition2.Kill();
8690 }
8691 }
8692 }
8693 CureCondition<ConWait>();
8694 CureCondition<ConDisease>((EClass.rnd(20) + 10) * p / 100);
8695 bool flag2 = HasCondition<ConAnorexia>();
8696 base.c_vomit -= (flag2 ? 3 : 2) * p / 100;
8697 if (base.c_vomit < 0)
8698 {
8699 base.c_vomit = 0;
8700 if (flag2)
8701 {
8702 RemoveCondition<ConAnorexia>();
8703 }
8704 }
8705 break;
8706 }
8707 case CureType.HealComplete:
8708 case CureType.Death:
8709 case CureType.Jure:
8710 case CureType.Boss:
8711 {
8712 CureTempElements(p * 100, body: true, mind: true);
8713 for (int num = conditions.Count - 1; num >= 0; num--)
8714 {
8715 Condition condition = conditions[num];
8716 if (!(condition is ConAnorexia) || type == CureType.Death)
8717 {
8718 if (condition.Type == ConditionType.Bad || condition.Type == ConditionType.Debuff || condition.Type == ConditionType.Disease)
8719 {
8720 condition.Kill();
8721 }
8722 else if (type == CureType.Death && condition.isPerfume)
8723 {
8724 condition.Kill();
8725 }
8726 }
8727 }
8728 CureCondition<ConWait>();
8729 CureCondition<ConSleep>();
8730 if (type == CureType.Death || type == CureType.Boss)
8731 {
8732 SAN.Mod(-20);
8733 }
8734 if (type == CureType.Jure)
8735 {
8736 SAN.Mod(-999);
8737 if (HasElement(1206))
8738 {
8739 SetFeat(1206, 0, msg: true);
8740 }
8741 }
8742 break;
8743 }
8744 }
8745 }
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:9284
Stats SAN
Definition: Chara.cs:967
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(), Card.DamageHP(), HealAll(), ActPray.Pray(), and Zone.Simulate().

◆ CureCondition< T >()

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

Definition at line 8597 of file Chara.cs.

8597 : Condition
8598 {
8599 T condition = GetCondition<T>();
8600 if (condition != null)
8601 {
8602 condition.value -= v;
8603 if (condition.value <= 0)
8604 {
8605 condition.Kill();
8606 }
8607 }
8608 }
T GetCondition< T >()
Definition: Chara.cs:8610

◆ CureHost()

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

Definition at line 8634 of file Chara.cs.

8635 {
8636 if (parasite != null)
8637 {
8638 parasite.Cure(type, p, state);
8639 }
8640 if (ride != null)
8641 {
8642 ride.Cure(type, p, state);
8643 }
8644 Cure(type, p, state);
8645 }
void Cure(CureType type, int p=100, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:8647

References Cure().

Referenced by FactionBranch.DailyOutcome().

◆ CureTempElements()

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

Definition at line 9284 of file Chara.cs.

9285 {
9286 if (tempElements != null)
9287 {
9288 if (body)
9289 {
9291 }
9292 if (mind)
9293 {
9295 }
9296 }
9297 void Cure(int[] eles)
9298 {
9299 foreach (int ele in eles)
9300 {
9301 if (tempElements == null)
9302 {
9303 break;
9304 }
9305 Element element = tempElements.GetElement(ele);
9306 if (element != null && element.vBase < 0)
9307 {
9308 ModTempElement(ele, Mathf.Clamp(p / 20 + EClass.rnd(p / 20), 1, -element.vBase));
9309 }
9310 }
9311 }
9312 }
void ModTempElement(int ele, int a, bool naturalDecay=false)
Definition: Chara.cs:9209
ElementContainer tempElements
Definition: Chara.cs:36
Element GetElement(string alias)
static int[] List_Body
Definition: ELEMENT.cs:234
static int[] List_Mind
Definition: ELEMENT.cs:236

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

◆ DamageTempElement()

void Chara.DamageTempElement ( int  ele,
int  p 
)
inline

Definition at line 9247 of file Chara.cs.

9248 {
9249 ModTempElement(ele, -(p / 100 + EClass.rnd(p / 100 + 1) + 1));
9250 }

References EClass.rnd().

◆ DamageTempElements()

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

Definition at line 9235 of file Chara.cs.

9236 {
9237 if (body)
9238 {
9239 DamageTempElement(Element.List_Body.RandomItem(), p);
9240 }
9241 if (mind)
9242 {
9243 DamageTempElement(Element.List_Mind.RandomItem(), p);
9244 }
9245 }
void DamageTempElement(int ele, int p)
Definition: Chara.cs:9247

References Element.List_Body, and Element.List_Mind.

◆ DestroyPath()

void Chara.DestroyPath ( Point  pos)
inline

Definition at line 2863 of file Chara.cs.

2864 {
2865 bool broke = false;
2866 pos.ForeachMultiSize(base.W, base.H, delegate(Point _p, bool main)
2867 {
2868 if (_p.IsValid)
2869 {
2870 if (_p.HasBlock)
2871 {
2872 EClass._map.MineBlock(_p, recoverBlock: false, this);
2873 if (_p.HasObj)
2874 {
2875 EClass._map.MineObj(_p, null, this);
2876 }
2877 broke = true;
2878 }
2879 if (_p.HasObj && _p.IsBlocked)
2880 {
2881 EClass._map.MineObj(_p, null, this);
2882 broke = true;
2883 }
2884 _p.Things.ForeachReverse(delegate(Thing t)
2885 {
2886 if (t.IsInstalled && (t.trait.IsBlockPath || t.trait.IsDoor))
2887 {
2888 if (t.isNPCProperty && t.trait.CanBeDestroyed)
2889 {
2890 t.Destroy();
2891 }
2892 else
2893 {
2894 t.SetPlaceState(PlaceState.roaming);
2895 }
2896 }
2897 });
2898 }
2899 });
2900 if (broke)
2901 {
2902 Msg.Say("stomp");
2903 Shaker.ShakeCam("stomp");
2904 }
2905 }
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
void ForeachMultiSize(int w, int h, Action< Point, bool > action)
Definition: Point.cs:1349
bool IsBlocked
Definition: Point.cs:339
Definition: Shaker.cs:5
static void ShakeCam(string id="default", float magnitude=1f)
Definition: Shaker.cs:25
virtual bool IsBlockPath
Definition: Trait.cs:52
virtual bool IsDoor
Definition: Trait.cs:56

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

Referenced by _Move().

◆ Die()

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

Reimplemented from Card.

Definition at line 4800 of file Chara.cs.

4801 {
4802 combatCount = 0;
4803 if (isDead || host != null)
4804 {
4805 return;
4806 }
4807 bool isInActiveZone = IsInActiveZone;
4808 if (isInActiveZone)
4809 {
4810 if (IsPC)
4811 {
4813 }
4814 if (base.isSummon)
4815 {
4816 Say("summon_vanish", this);
4817 pos.PlayEffect("vanish");
4818 pos.PlaySound("vanish");
4819 Destroy();
4820 return;
4821 }
4822 if (attackSource == AttackSource.DeathSentense)
4823 {
4824 if (trait is TraitLittleOne)
4825 {
4826 MakeEgg();
4827 }
4828 PlayEffect("revive");
4829 PlaySound("chime_angel");
4830 }
4831 else
4832 {
4833 Effect.Get("blood").Play((parent is Chara) ? (parent as Chara).pos : pos).SetParticleColor(EClass.Colors.matColors[base.material.alias].main)
4834 .Emit(50);
4835 AddBlood(AI_Slaughter.slaughtering ? 12 : (2 + EClass.rnd(2)));
4836 PlaySound(base.material.GetSoundDead(source));
4837 }
4840 ClearFOV();
4841 }
4842 string text = "";
4843 "dead_in".langGame(EClass._zone.Name);
4844 string text2 = ((origin == null) ? "" : origin.GetName(NameStyle.Full));
4845 if (LangGame.Has("dead_" + attackSource))
4846 {
4847 text = "dead_" + attackSource;
4848 }
4849 else
4850 {
4851 if (e != Element.Void && e != null)
4852 {
4853 text = "dead_" + e.source.alias;
4854 }
4855 if (text == "" || !LangGame.Has(text))
4856 {
4857 text = "dead";
4858 }
4859 }
4860 if (IsPC)
4861 {
4862 EClass._zone.isDeathLocation = true;
4863 string s = ((origin == null) ? text : "dead_by");
4865 if (attackSource == AttackSource.Wrath)
4866 {
4868 }
4869 EClass.player.deathMsg = GameLang.Parse(s.langGame(), thirdPerson: true, EClass.pc.NameBraced, "dead_in".langGame(EClass._zone.Name), text2);
4871 if (EClass._zone.instance is ZoneInstanceRandomQuest zoneInstanceRandomQuest)
4872 {
4873 zoneInstanceRandomQuest.status = ZoneInstance.Status.Fail;
4874 }
4875 AI_PlayMusic.keepPlaying = false;
4876 }
4877 if (isInActiveZone)
4878 {
4879 if (attackSource == AttackSource.DeathSentense)
4880 {
4881 Msg.Say("goto_heaven", this);
4882 }
4883 else
4884 {
4885 if (origin == null || !origin.isSynced || (attackSource != AttackSource.Melee && attackSource != AttackSource.Range))
4886 {
4887 Msg.Say(text, this, "", text2);
4888 }
4889 string text3 = TalkTopic("dead");
4890 if (!text3.IsEmpty())
4891 {
4892 text3 = text3.StripBrackets();
4893 }
4894 bool flag = base.rarity >= Rarity.Legendary && !IsPCFaction;
4895 if (!IsPC && flag)
4896 {
4897 MakeGrave(text3);
4898 }
4899 Msg.SetColor();
4900 SpawnLoot(origin);
4901 }
4902 if (IsPC)
4903 {
4905 }
4906 }
4907 if (IsPCFaction)
4908 {
4909 if (homeBranch != null)
4910 {
4911 homeBranch.Log(text, this, "");
4912 }
4913 WidgetPopText.Say("popDead".lang(base.Name), FontColor.Bad);
4914 if (!IsPC)
4915 {
4916 if (EClass.player.stats.allyDeath == 0)
4917 {
4918 Tutorial.Reserve("death_pet");
4919 }
4921 }
4922 }
4923 if (id == "mandrake")
4924 {
4925 Say("a_scream", this);
4926 ActEffect.ProcAt(EffectId.Scream, base.LV * 3 + 200, BlessedState.Normal, this, this, pos, isNeg: true);
4927 }
4928 daysStarved = 0;
4929 isDead = true;
4930 enemy = null;
4931 _cooldowns = null;
4932 base.isSale = false;
4933 EClass._map.props.sales.Remove(this);
4934 Cure(CureType.Death);
4935 SetAI(new NoGoal());
4937 if (isInActiveZone && EClass._zone.HasLaw && IsHuman && OriginalHostility >= Hostility.Neutral)
4938 {
4939 pos.TalkWitnesses(origin?.Chara, "witness", 3, WitnessType.crime, (Chara c) => !c.IsPCParty && !c.IsUnique);
4940 }
4941 if (IsPC)
4942 {
4943 EClass.player.returnInfo = null;
4944 EClass.player.uidLastTravelZone = 0;
4945 foreach (Chara chara2 in EClass._map.charas)
4946 {
4947 if (chara2.IsHostile())
4948 {
4949 chara2.hostility = chara2.OriginalHostility;
4950 }
4951 if (chara2.enemy == EClass.pc)
4952 {
4953 chara2.enemy = null;
4954 }
4955 }
4956 if (EClass.pc.things.Find("letter_will") != null && EClass.rnd(10) == 0)
4957 {
4958 EClass.player.preventDeathPenalty = true;
4959 }
4960 }
4961 else
4962 {
4963 bool flag2 = currentZone.IsActiveZone && IsLocalChara && !currentZone.IsPCFaction;
4964 if (currentZone is Zone_LittleGarden && id == "littleOne")
4965 {
4966 flag2 = false;
4967 }
4968 if (flag2)
4969 {
4970 EClass._map.deadCharas.Add(this);
4971 }
4972 currentZone.RemoveCard(this);
4973 }
4974 string text4;
4975 if ((origin != null && origin.IsPCParty) || IsPCFaction)
4976 {
4977 int a = -10;
4978 if (IsPCFaction && !IsPCParty && (origin == null || !origin.IsPCParty))
4979 {
4980 a = -5;
4981 }
4982 ModAffinity(EClass.pc, a, show: false);
4983 text4 = id;
4984 if (!(text4 == "quru"))
4985 {
4986 if (text4 == "corgon")
4987 {
4988 EClass.game.cards.globalCharas.Find("quru")?.ModAffinity(EClass.pc, -20, show: false);
4989 }
4990 }
4991 else
4992 {
4993 EClass.game.cards.globalCharas.Find("corgon")?.ModAffinity(EClass.pc, -20, show: false);
4994 }
4995 }
4996 if (origin != null)
4997 {
4998 if (origin.IsPCParty || origin.IsPCPartyMinion)
4999 {
5000 int num = 0;
5001 if (OriginalHostility >= Hostility.Friend && IsHuman && !base.IsPCFactionOrMinion)
5002 {
5003 num = -5;
5004 }
5005 else if (race.id == "cat" && OriginalHostility >= Hostility.Neutral)
5006 {
5007 EClass.pc.Say("killcat");
5008 num = -1;
5009 }
5010 if (EClass.pc.party.HasElement(1563) && num < 0)
5011 {
5012 num = num * 30 / 100;
5013 }
5014 if (num != 0)
5015 {
5016 EClass.player.ModKarma(num);
5017 }
5018 }
5019 if (origin == EClass.pc)
5020 {
5021 EClass.pc.faith.Revelation("kill", 10);
5022 }
5023 else if (origin.IsPCFaction)
5024 {
5025 origin.Chara.ModAffinity(EClass.pc, 1, show: false);
5026 origin.Chara.ShowEmo(Emo.love);
5027 }
5028 }
5029 if (base.sourceBacker != null && origin != null && origin.IsPCParty)
5030 {
5031 EClass.player.doneBackers.Add(base.sourceBacker.id);
5032 }
5033 if (base.IsPCFactionOrMinion)
5034 {
5036 {
5037 Msg.Say("abort_allyDead");
5038 }
5039 }
5041 {
5042 Msg.Say("abort_enemyDead");
5043 }
5044 if (IsPCParty && !IsPC)
5045 {
5047 base.c_wasInPcParty = true;
5048 EClass.pc.Say("allyDead");
5049 }
5050 text4 = id;
5051 if (!(text4 == "littleOne"))
5052 {
5053 if (text4 == "big_daddy" && !IsPCFaction)
5054 {
5055 Chara t = CharaGen.Create("littleOne");
5056 EClass._zone.AddCard(t, pos.Copy());
5057 Msg.Say("little_pop");
5058 }
5059 }
5060 else if (attackSource != AttackSource.DeathSentense)
5061 {
5062 EClass.player.flags.little_killed = true;
5064 }
5065 if (attackSource == AttackSource.Finish && origin != null && origin.Evalue(665) > 0)
5066 {
5067 Chara chara = CharaGen.CreateFromFilter("c_plant", base.LV);
5068 EClass._zone.AddCard(chara, pos.Copy());
5069 if (chara.LV < base.LV)
5070 {
5071 chara.SetLv(base.LV);
5072 }
5073 chara.MakeMinion((origin.IsPCParty || origin.IsPCPartyMinion) ? EClass.pc : origin.Chara, MinionType.Friend);
5074 Msg.Say("plant_pop", this, chara);
5075 }
5076 foreach (ZoneEvent item in EClass._zone.events.list)
5077 {
5078 item.OnCharaDie(this);
5079 }
5080 }
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:392
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:2475
bool IsUnique
Definition: Card.cs:1967
void AddBlood(int a=1, int id=-1)
Definition: Card.cs:5236
virtual bool IsPCParty
Definition: Card.cs:2025
Card SetLv(int a)
Definition: Card.cs:2735
ICardParent parent
Definition: Card.cs:51
virtual bool IsPCPartyMinion
Definition: Card.cs:2029
void ClearFOV()
Definition: Card.cs:5817
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:5438
virtual bool IsPCFaction
Definition: Card.cs:2129
void SpawnLoot(Card origin)
Definition: Card.cs:4578
int LV
Definition: Card.cs:370
virtual bool isSynced
Definition: Card.cs:1963
static Chara CreateFromFilter(string id, int lv=-1, int levelRange=-1)
Definition: CharaGen.cs:22
int combatCount
Definition: Chara.cs:111
bool IsHuman
Definition: Chara.cs:835
int daysStarved
Definition: Chara.cs:314
void MakeMinion(Chara _master, MinionType type=MinionType.Default)
Definition: Chara.cs:2058
string NameBraced
Definition: Chara.cs:499
string TalkTopic(string topic="calm")
Definition: Chara.cs:6297
void TryDropBossLoot()
Definition: Chara.cs:5082
bool IsLocalChara
Definition: Chara.cs:794
Chara enemy
Definition: Chara.cs:83
bool IsInActiveZone
Definition: Chara.cs:791
void TryDropCarryOnly()
Definition: Chara.cs:4201
void MakeGrave(string lastword)
Definition: Chara.cs:4717
UD_String_MatData matColors
static ColorProfile Colors
Definition: EClass.cs:38
static Element Void
Definition: ELEMENT.cs:228
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:123
ConfigAutoCombat autoCombat
Definition: Game.cs:93
CardManager cards
Definition: Game.cs:155
static bool Has(string id)
Definition: LangGame.cs:46
List< Chara > deadCharas
Definition: Map.cs:46
static ThirstPersonInfo thirdPerson1
Definition: Msg.cs:6
void RemoveMember(Chara c)
Definition: Party.cs:84
bool HasElement(int ele)
Definition: Party.cs:163
int allyDeath
Definition: Player.cs:90
void ModKarma(int a)
Definition: Player.cs:2289
Stats stats
Definition: Player.cs:817
int little_dead
Definition: Player.cs:733
HashSet< int > doneBackers
Definition: Player.cs:874
bool TryAbortAutoCombat(bool immediate=true)
Definition: Player.cs:2183
string deathMsg
Definition: Player.cs:986
SoundSource PlaySound(string id, bool synced=true, float v=1f, bool spatial=true)
Definition: Point.cs:1217
void TalkWitnesses(Chara criminal, string idTalk, int radius=4, WitnessType type=WitnessType.everyone, Func< Chara, bool > talkIf=null, int chance=3)
Definition: Point.cs:787
Effect PlayEffect(string id)
Definition: Point.cs:1212
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)
List< ZoneEvent > list
virtual bool HasLaw
Definition: Zone.cs:226
void RemoveCard(Card t)
Definition: Zone.cs:1933
void ResetHostility()
Definition: Zone.cs:2509
ZoneInstance instance
Definition: Zone.cs:52

References EClass._map, EClass._zone, ConfigAutoCombat.abortOnAllyDead, ConfigAutoCombat.abortOnEnemyDead, Zone.AddCard(), Player.Stats.allyDeath, Game.Config.autoCombat, Game.cards, Card.Chara, Map.charas, EClass.Colors, Game.config, CharaGen.Create(), CharaGen.CreateFromFilter(), Map.deadCharas, Player.deathMsg, Debug, Player.doneBackers, enemy, Zone.events, faith, ThingContainer.Find(), CardManager.GlobalCharaList.Find(), EClass.game, Effect.Get(), CardManager.globalCharas, LangGame.Has(), Party.HasElement(), Zone.HasLaw, SourceRace.Row.id, Zone.instance, IsHostile(), IsPCParty, Card.IsUnique, item, ZoneEventManager.list, Player.little_dead, FactionBranch.Log(), Card.LV, MakeMinion(), ColorProfile.matColors, ModAffinity(), Player.ModKarma(), Spatial.Name, NameBraced, Religion.NameShort, OriginalHostility, GameLang.Parse(), party, EClass.pc, Effect.Play(), EClass.player, ActEffect.ProcAt(), Map.props, Religion.recentWrath, Party.RemoveMember(), 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, Player.stats, Card.things, Msg.thirdPerson1, Player.TryAbortAutoCombat(), and Element.Void.

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

◆ DiminishTempElements()

void Chara.DiminishTempElements ( int  a = 1)
inline

Definition at line 9269 of file Chara.cs.

9270 {
9271 if (tempElements == null)
9272 {
9273 return;
9274 }
9275 foreach (Element item in tempElements.dict.Values.ToList())
9276 {
9277 if (item.vBase > 0)
9278 {
9279 ModTempElement(item.id, -Mathf.Min(a, item.vBase), naturalDecay: true);
9280 }
9281 }
9282 }

References ElementContainer.dict, and item.

◆ DoAI()

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

Definition at line 5615 of file Chara.cs.

5616 {
5617 SetAI(new DynamicAIAct("", delegate
5618 {
5619 onPerform();
5620 return true;
5621 })
5622 {
5623 wait = wait
5624 });
5625 }

◆ DoHostileAction()

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

Definition at line 5707 of file Chara.cs.

5708 {
5709 if (_tg == null || !_tg.isChara)
5710 {
5711 return;
5712 }
5713 Chara chara = _tg.Chara;
5714 if (chara.IsPC)
5715 {
5716 EClass.pc.combatCount = 10;
5717 }
5718 if (!chara.IsAliveInCurrentZone || !IsAliveInCurrentZone || chara == this)
5719 {
5720 return;
5721 }
5722 if ((IsPCFaction || IsPCFactionMinion) && (chara.IsPCFaction || chara.IsPCFactionMinion))
5723 {
5724 chara.Say("frown", this, chara);
5725 }
5726 else
5727 {
5728 if (EClass._zone.IsRegion)
5729 {
5730 return;
5731 }
5732 if (IsPC)
5733 {
5734 if (chara.IsFriendOrAbove() && !immediate)
5735 {
5736 chara.Say("frown", this, chara);
5737 chara.ShowEmo(Emo.sad);
5738 chara.hostility = Hostility.Neutral;
5739 return;
5740 }
5741 if (!chara.IsPCFaction && chara.hostility >= Hostility.Neutral && !EClass._zone.IsPCFaction)
5742 {
5743 bool flag = chara.id == "fanatic";
5744 if (EClass.rnd(4) == 0 || flag)
5745 {
5746 chara.Say("callHelp", chara);
5747 chara.CallHelp(this, flag);
5748 }
5749 }
5750 if (chara.hostility <= Hostility.Enemy)
5751 {
5752 foreach (Chara member in EClass.pc.party.members)
5753 {
5754 if (member != EClass.pc && member.enemy == null && member.CanSee(chara))
5755 {
5756 member.SetEnemy(chara);
5757 }
5758 }
5759 }
5760 }
5761 else if (chara.IsPC && hostility <= Hostility.Enemy)
5762 {
5763 foreach (Chara member2 in EClass.pc.party.members)
5764 {
5765 if (member2 != EClass.pc && member2.enemy == null && member2.CanSee(this))
5766 {
5767 member2.SetEnemy(this);
5768 }
5769 }
5770 }
5771 if (chara.calmCheckTurn <= 0 || IsPC)
5772 {
5773 chara.calmCheckTurn = (IsPC ? (20 + EClass.rnd(30)) : (10 + EClass.rnd(10)));
5774 }
5775 if (hostility != Hostility.Enemy || chara.hostility != Hostility.Enemy)
5776 {
5777 GoHostile(chara);
5778 chara.GoHostile(this);
5779 if (base.isHidden && !chara.CanSee(this) && !chara.IsDisabled && !chara.IsPCParty && !chara.IsPCPartyMinion && EClass.rnd(10 + Dist(chara) * 10) == 0)
5780 {
5781 Thing t = ThingGen.Create("49");
5782 ActThrow.Throw(chara, pos, t);
5783 Act.TC = chara;
5784 }
5785 }
5786 }
5787 }
static EffectIRenderer Throw(Card c, Point p, Thing t, ThrowMethod method=ThrowMethod.Default, float failChance=0f)
Definition: ActThrow.cs:93
override bool IsAliveInCurrentZone
Definition: Chara.cs:546
override bool IsPCPartyMinion
Definition: Chara.cs:624
int calmCheckTurn
Definition: Chara.cs:113
bool CanSee(Card c)
Definition: Chara.cs:1027
override bool IsPCFactionMinion
Definition: Chara.cs:640
bool IsFriendOrAbove()
Definition: Chara.cs:5972
Chara SetEnemy(Chara c=null)
Definition: Chara.cs:5658
void CallHelp(Chara tg, bool fanatic=false)
Definition: Chara.cs:5789
Hostility hostility
Definition: Chara.cs:276
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 ActMelee.Attack(), Point.CallGuard(), ActEffect.DamageEle(), DramaOutcome.fiama_starter_gift(), AI_Fuck.Finish(), ActRanged.Perform(), ActSummonGuard.Perform(), ActWater.Perform(), AI_AttackHome.Run(), AI_Idle.Run(), GoalSiege.Run(), and ActThrow.Throw().

◆ Drink()

void Chara.Drink ( Card  t)
inline

Definition at line 4612 of file Chara.cs.

4613 {
4614 Say("drink", this, t.Duplicate(1));
4615 Say("quaff");
4616 PlaySound("drink");
4617 hunger.Mod(-2);
4618 t.ModNum(-1);
4619 t.trait.OnDrink(this);
4620 _ = IsPC;
4621 }
Thing Duplicate(int num)
Definition: Card.cs:3191
void ModNum(int a, bool notify=true)
Definition: Card.cs:3262
Stats hunger
Definition: Chara.cs:951
virtual void OnDrink(Chara c)
Definition: Trait.cs:942

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

4214 {
4215 if (held == null)
4216 {
4217 return null;
4218 }
4219 if (IsPC)
4220 {
4221 WidgetHotbar.dirtyCurrentItem = true;
4223 }
4224 Card card = EClass._zone.AddCard(held, dropPos ?? pos);
4225 card.OnLand();
4226 if (card.trait.CanOnlyCarry)
4227 {
4228 card.SetPlaceState(PlaceState.installed);
4229 }
4230 return card;
4231 }
PlaceState
Definition: PlaceState.cs:2
Card held
Definition: Chara.cs:67
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 4233 of file Chara.cs.

4234 {
4235 if (t.c_isImportant)
4236 {
4237 Msg.Say("markedImportant");
4238 return;
4239 }
4240 if (!t.trait.CanBeDropped)
4241 {
4242 Msg.Say("cantDrop", t);
4243 return;
4244 }
4245 if (t.trait is TraitAbility)
4246 {
4247 SE.Trash();
4248 t.Destroy();
4249 return;
4250 }
4251 Msg.Say("dropItem", t.Name);
4252 t.ignoreAutoPick = true;
4253 PlaySound("drop");
4254 EClass._zone.AddCard(t, pos);
4255 if (t.trait.CanOnlyCarry)
4256 {
4257 t.Install();
4258 }
4259 }
Card Install()
Definition: Card.cs:3448
virtual bool CanBeDropped
Definition: Trait.cs:289

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

1531 {
1532 Chara chara = CharaGen.Create(id);
1533 chara.mana.value = mana.value;
1534 chara.stamina.value = stamina.value;
1535 foreach (KeyValuePair<int, Element> item in elements.dict)
1536 {
1537 Element orCreateElement = chara.elements.GetOrCreateElement(item.Key);
1538 orCreateElement.vBase = item.Value.ValueWithoutLink - orCreateElement.vSource;
1539 }
1540 chara.SetFaith(faith);
1541 chara.bio = IO.DeepCopy(bio);
1542 chara.LV = base.LV;
1543 chara.c_daysWithGod = base.c_daysWithGod;
1544 chara.RefreshFaithElement();
1545 chara.hp = (int)Mathf.Clamp((float)chara.MaxHP * ((float)base.hp / (float)MaxHP) * 0.99f, 0f, chara.MaxHP);
1546 chara.isCopy = true;
1547 if (HaveFur())
1548 {
1549 chara.c_fur = -1;
1550 }
1551 return chara;
1552 }
bool HaveFur()
Definition: Card.cs:6982
Stats mana
Definition: Chara.cs:963
void RefreshFaithElement()
Definition: Chara.cs:9166
void SetFaith(string id)
Definition: Chara.cs:1484
Element GetOrCreateElement(Element ele)
int vSource
Definition: ELEMENT.cs:252
Definition: IO.cs:11
virtual int value
Definition: Stats.cs:56

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

Referenced by ActEffect.Proc().

◆ EnhanceTempElement()

void Chara.EnhanceTempElement ( int  ele,
int  p 
)
inline

Definition at line 9264 of file Chara.cs.

9265 {
9266 ModTempElement(ele, p / 100 + EClass.rnd(p / 100 + 1));
9267 }

References EClass.rnd().

◆ EnhanceTempElements()

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

Definition at line 9252 of file Chara.cs.

9253 {
9254 if (body)
9255 {
9256 EnhanceTempElement(Element.List_Body.RandomItem(), p);
9257 }
9258 if (mind)
9259 {
9260 EnhanceTempElement(Element.List_Mind.RandomItem(), p);
9261 }
9262 }
void EnhanceTempElement(int ele, int p)
Definition: Chara.cs:9264

References Element.List_Body, and Element.List_Mind.

◆ EQ_CAT()

void Chara.EQ_CAT ( string  s)
inline

Definition at line 4589 of file Chara.cs.

4590 {
4591 int slot = EClass.sources.categories.map[s].slot;
4592 BodySlot bodySlot = ((slot == 0) ? null : body.GetSlot(slot));
4593 if ((slot == 0 || bodySlot != null) && (slot != 37 || !HasElement(1209)))
4594 {
4595 SetEQQuality();
4596 Thing thing = ThingGen.CreateFromCategory(s, base.LV);
4597 AddThing(thing);
4598 if (bodySlot != null && !body.Equip(thing, bodySlot))
4599 {
4600 thing.Destroy();
4601 }
4602 }
4603 }
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:2901
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:341
void SetEQQuality()
Definition: Chara.cs:4536
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 4569 of file Chara.cs.

4570 {
4571 SetEQQuality();
4572 if (r != Rarity.Random)
4573 {
4574 CardBlueprint.current.rarity = r;
4575 }
4576 Thing thing = ThingGen.Create(s, mat, base.LV);
4577 if (body.GetSlot(thing, onlyEmpty: true) == null)
4578 {
4579 return thing;
4580 }
4581 AddThing(thing);
4582 if (!body.Equip(thing))
4583 {
4584 thing.Destroy();
4585 }
4586 return thing;
4587 }

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

4606 {
4607 SetEQQuality();
4608 Thing t = ThingGen.Create(s, -1, base.LV).SetNum(num);
4609 AddThing(t);
4610 }
Thing SetNum(int a)
Definition: Card.cs:3242

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

◆ EvalueRiding()

int Chara.EvalueRiding ( )
inline

Definition at line 5526 of file Chara.cs.

5527 {
5528 if (ride != null && ride.HasCondition<ConTransmuteBroom>() && HasElement(1417))
5529 {
5530 return 25 + Evalue(226) * 125 / 100;
5531 }
5532 return Evalue(226);
5533 }

References HasCondition().

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

◆ FallFromZone()

void Chara.FallFromZone ( )
inline

Definition at line 3185 of file Chara.cs.

3186 {
3187 Msg.Say("skyFall", EClass.pc, EClass._zone.Name);
3188 Zone zone = (EClass._zone.isExternalZone ? null : EClass._zone.GetTopZone().FindZone(EClass._zone.lv - 1));
3189 zone = zone ?? EClass.world.region;
3191 {
3192 state = ZoneTransition.EnterState.Fall,
3193 x = pos.x,
3194 z = pos.z
3195 });
3196 }
void MoveZone(string alias)
Definition: Chara.cs:3010
int lv
Definition: Spatial.cs:142
Zone FindZone(int lv)
Definition: Spatial.cs:714
Region region
Definition: World.cs:23
Definition: Zone.cs:12
Zone GetTopZone()
Definition: Zone.cs:1854

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

7052 {
7053 TraitToolRange ranged = weapon.trait as TraitToolRange;
7054 Thing thing = (IsPC ? EClass.pc.things.Find<TraitQuiver>() : null);
7055 if (thing != null)
7056 {
7057 Thing thing2 = thing.things.Find((Thing t) => ranged.IsAmmo(t));
7058 if (thing2 != null)
7059 {
7060 return thing2;
7061 }
7062 }
7063 return things.Find((Thing t) => ranged.IsAmmo(t));
7064 }
bool IsAmmo
Definition: Card.cs:2107
Thing ranged
Definition: Chara.cs:95

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

6630 {
6631 foreach (Card item in EClass._map.props.installed.all)
6632 {
6633 if (item.trait is TraitBed traitBed && traitBed.IsHolder(this))
6634 {
6635 return traitBed;
6636 }
6637 }
6638 return null;
6639 }

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().

◆ FindMaster()

Chara Chara.FindMaster ( )
inline

Definition at line 2093 of file Chara.cs.

2094 {
2095 if (IsMinion)
2096 {
2097 master = EClass._map.FindChara(base.c_uidMaster);
2098 }
2099 return master;
2100 }
Chara master
Definition: Chara.cs:85
Chara FindChara(string id)
Definition: Map.cs:2546

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

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

◆ FindNearestNewEnemy()

bool Chara.FindNearestNewEnemy ( )
inline

Definition at line 5869 of file Chara.cs.

5870 {
5871 for (int i = 0; i < EClass._map.charas.Count; i++)
5872 {
5873 Chara chara = EClass._map.charas[i];
5874 if (chara != this && chara != enemy && IsHostile(chara) && Dist(chara) <= 1 && CanInteractTo(chara.pos))
5875 {
5876 DoHostileAction(chara);
5877 enemy = chara;
5878 return true;
5879 }
5880 }
5881 return false;
5882 }
void DoHostileAction(Card _tg, bool immediate=false)
Definition: Chara.cs:5707

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

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

◆ FindNewEnemy()

bool Chara.FindNewEnemy ( )
inline

Definition at line 5800 of file Chara.cs.

5801 {
5802 if (EClass._zone.isPeace && base.IsPCFactionOrMinion && !IsPC)
5803 {
5804 return false;
5805 }
5806 if (enemy != null && !enemy.IsAliveInCurrentZone)
5807 {
5808 enemy = null;
5809 }
5810 if (enemy != null)
5811 {
5812 return false;
5813 }
5814 if (IsPCParty && EClass.pc.isHidden && base.isHidden)
5815 {
5816 return false;
5817 }
5818 bool flag = enemy != null || ai is GoalCombat;
5819 int num = (base.PER + Evalue(210) * 2) * ((!flag) ? 1 : 2);
5820 bool flag2 = IsPCParty && !IsPC && EClass.game.config.tactics.dontWander;
5821 bool flag3 = !IsPCParty;
5822 Chara chara = null;
5823 int num2 = 9999;
5824 for (int i = 0; i < EClass._map.charas.Count; i++)
5825 {
5826 Chara chara2 = EClass._map.charas[i];
5827 if (chara2 == this || !IsHostile(chara2) || !CanSee(chara2))
5828 {
5829 continue;
5830 }
5831 int num3 = Dist(chara2);
5832 int num4 = GetSightRadius() + (flag ? 1 : 0);
5833 if (num3 > num4)
5834 {
5835 continue;
5836 }
5837 if (flag3 && EClass.rnd(chara2.Evalue(152) + 5) * (100 + num3 * num3 * 10) / 100 > EClass.rnd(num))
5838 {
5839 if (this == pos.FirstChara)
5840 {
5841 chara2.ModExp(152, Mathf.Clamp((num - chara2.Evalue(152)) / 2, 1, Mathf.Max(30 - stealthSeen * 2, 1)));
5842 }
5843 stealthSeen++;
5844 }
5845 else if (CanSeeLos(chara2) && (!flag2 || EClass.pc.isBlind || EClass.pc.CanSeeLos(chara2)) && (!IsPCFaction || EClass.pc.ai.ShouldAllyAttack(chara2)))
5846 {
5847 if (!IsPCParty)
5848 {
5849 DoHostileAction(chara2);
5850 enemy = chara2;
5851 return true;
5852 }
5853 if (num3 < num2)
5854 {
5855 num2 = num3;
5856 chara = chara2;
5857 }
5858 }
5859 }
5860 if (chara != null)
5861 {
5862 DoHostileAction(chara);
5863 enemy = chara;
5864 return true;
5865 }
5866 return false;
5867 }
virtual bool ShouldAllyAttack(Chara tg)
Definition: AIAct.cs:134
int stealthSeen
Definition: Chara.cs:173
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 7161 of file Chara.cs.

7162 {
7163 return FindBed()?.owner.pos.cell.room;
7164 }
TraitBed FindBed()
Definition: Chara.cs:6629

Referenced by GoalWork.FindWork(), BaseListPeople.OnInstantiate(), GoalWork.OnSimulatePosition(), AI_Idle.Run(), and GoalWork.ValidateHobby().

◆ GainAbility()

void Chara.GainAbility ( int  ele,
int  mtp = 100 
)
inline

Definition at line 9111 of file Chara.cs.

9112 {
9113 Element orCreateElement = elements.GetOrCreateElement(ele);
9114 if (orCreateElement.ValueWithoutLink == 0)
9115 {
9116 elements.ModBase(orCreateElement.id, 1);
9117 }
9118 if (orCreateElement is Spell)
9119 {
9120 int num = mtp * orCreateElement.source.charge * (100 + Evalue(307) + (HasElement(307) ? 20 : 0)) / 100 / 100;
9121 if (orCreateElement.source.charge == 1)
9122 {
9123 num = 1;
9124 }
9125 orCreateElement.vPotential += Mathf.Max(1, num / 2 + EClass.rnd(num / 2 + 1));
9126 }
9127 Say("spell_gain", this, orCreateElement.Name);
9128 LayerAbility.SetDirty(orCreateElement);
9129 }
Element ModBase(int ele, int v)
virtual string Name
Definition: ELEMENT.cs:294
static void SetDirty(Element a)

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

Referenced by Player.DreamSpell(), and TraitBaseSpellbook.OnRead().

◆ GetActionText()

string Chara.GetActionText ( )
inline

Definition at line 6573 of file Chara.cs.

6574 {
6575 string result = "?????";
6576 if (ai != null)
6577 {
6578 result = ai.GetCurrentActionText();
6579 }
6580 return result;
6581 }
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 7101 of file Chara.cs.

7102 {
7103 if (body.GetWeight(armorOnly: true) <= 30000)
7104 {
7105 return 120;
7106 }
7107 return 122;
7108 }
int GetWeight(bool armorOnly=false)
Definition: CharaBody.cs:384

References CharaBody.GetWeight().

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

◆ GetBestRangedWeapon()

Thing Chara.GetBestRangedWeapon ( )
inline

Definition at line 7066 of file Chara.cs.

7067 {
7068 Thing result = null;
7069 int num = 0;
7070 foreach (Thing thing in things)
7071 {
7072 if (thing.IsRangedWeapon && CanEquipRanged(thing) && thing.GetEquipValue() > num)
7073 {
7074 num = thing.GetEquipValue();
7075 result = thing;
7076 }
7077 }
7078 return result;
7079 }
int GetEquipValue()
Definition: Card.cs:6366
bool IsRangedWeapon
Definition: Card.cs:2103
bool CanEquipRanged(Thing t)
Definition: Chara.cs:7000

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

◆ GetBuffStats() [1/2]

Element Chara.GetBuffStats ( int  ele)
inline

Definition at line 8585 of file Chara.cs.

8586 {
8587 for (int i = 0; i < conditions.Count; i++)
8588 {
8589 if (conditions[i] is ConBuffStats conBuffStats && conBuffStats.refVal == ele)
8590 {
8591 return conBuffStats.elements.GetElement(ele);
8592 }
8593 }
8594 return null;
8595 }

References BaseCondition.refVal.

◆ GetBuffStats() [2/2]

Element Chara.GetBuffStats ( string  alias)
inline

Definition at line 8580 of file Chara.cs.

8581 {
8582 return GetBuffStats(EClass.sources.elements.alias[alias].id);
8583 }
Element GetBuffStats(string alias)
Definition: Chara.cs:8580

References SourceManager.elements, and EClass.sources.

Referenced by GoalCombat.TryUseAbility().

◆ GetBurden()

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

Definition at line 1554 of file Chara.cs.

1555 {
1556 int num2 = (base.ChildrenWeight + ((t != null) ? ((num == -1) ? t.ChildrenAndSelfWeight : (t.SelfWeight * num)) : 0)) * 100 / WeightLimit;
1557 if (num2 < 0)
1558 {
1559 num2 = 1000;
1560 }
1562 {
1563 num2 = 0;
1564 }
1565 int num3 = ((num2 >= 100) ? ((num2 - 100) / 10 + 1) : 0);
1566 if (num3 > 9)
1567 {
1568 num3 = 9;
1569 }
1570 return num3;
1571 }

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

◆ GetCondition< T >()

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

Definition at line 8610 of file Chara.cs.

8610 : Condition
8611 {
8612 for (int i = 0; i < conditions.Count; i++)
8613 {
8614 if (conditions[i] is T)
8615 {
8616 return conditions[i] as T;
8617 }
8618 }
8619 return null;
8620 }

◆ GetCurrentDir()

int Chara.GetCurrentDir ( )
inline

Definition at line 3305 of file Chara.cs.

3306 {
3307 Debug.Log(angle);
3308 if (!renderer.hasActor)
3309 {
3310 if (angle == 0f || angle == 45f || angle == 90f)
3311 {
3312 return 2;
3313 }
3314 if (angle == -135f || angle == 180f || angle == -90f)
3315 {
3316 return 1;
3317 }
3318 if (angle == 135f)
3319 {
3320 return 0;
3321 }
3322 return 3;
3323 }
3324 return renderer.actor.currentDir;
3325 }
virtual int currentDir
Definition: CardActor.cs:41
float angle
Definition: Card.cs:67

References Debug.

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

◆ GetDestination()

Point Chara.GetDestination ( )
inline

Definition at line 6548 of file Chara.cs.

6549 {
6550 return (ai.IsRunning ? ai.GetDestination() : pos).Copy();
6551 }
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 4286 of file Chara.cs.

4287 {
4288 if (elements.Value(122) > elements.Value(120))
4289 {
4290 return elements.GetElement(122);
4291 }
4292 return elements.GetElement(120);
4293 }
int Value(int ele)

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

◆ GetFavAttackStyle()

AttackStyle Chara.GetFavAttackStyle ( )
inline

Definition at line 4261 of file Chara.cs.

4262 {
4263 int num = Evalue(131);
4264 int num2 = Evalue(130);
4265 int num3 = Evalue(123);
4266 if (num > num2 && num > num3)
4267 {
4268 return AttackStyle.TwoWield;
4269 }
4270 if (num2 > num && num2 > num3)
4271 {
4272 return AttackStyle.TwoHand;
4273 }
4274 if (num3 > num && num3 > num2)
4275 {
4276 return AttackStyle.Shield;
4277 }
4278 return AttackStyle.Default;
4279 }

Referenced by WindowChara.RefreshNote().

◆ GetFavCat()

SourceCategory.Row Chara.GetFavCat ( )
inline

Definition at line 7274 of file Chara.cs.

7275 {
7276 SourceCategory.Row r = null;
7277 if (_listFavCat.Count == 0)
7278 {
7279 foreach (SourceCategory.Row row in EClass.sources.categories.rows)
7280 {
7281 if (row.gift > 0)
7282 {
7283 _listFavCat.Add(row);
7284 }
7285 }
7286 }
7287 Rand.UseSeed(base.uid + EClass.game.seed, delegate
7288 {
7289 r = _listFavCat.RandomItem();
7290 });
7291 return r;
7292 }
static List< SourceCategory.Row > _listFavCat
Definition: Chara.cs:179
int seed
Definition: Game.cs:197
Definition: Rand.cs:4
static void UseSeed(int seed, Action action)
Definition: Rand.cs:22

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

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

◆ GetFavFood()

SourceThing.Row Chara.GetFavFood ( )
inline

Definition at line 7254 of file Chara.cs.

7255 {
7256 if (_listFavFood.Count == 0)
7257 {
7258 foreach (SourceThing.Row row in EClass.sources.things.rows)
7259 {
7260 if (row._origin == "dish" && row.value != 0)
7261 {
7262 _listFavFood.Add(row);
7263 }
7264 }
7265 }
7266 SourceThing.Row r = null;
7267 Rand.UseSeed(base.uid + EClass.game.seed, delegate
7268 {
7269 r = _listFavFood.RandomItem();
7270 });
7271 return r;
7272 }
static List< SourceThing.Row > _listFavFood
Definition: Chara.cs:177
SourceThing things

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

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

◆ GetFavWeaponSkill()

Element Chara.GetFavWeaponSkill ( )
inline

Definition at line 4281 of file Chara.cs.

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

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

2280 {
2281 return PathManager.Instance.GetFirstStep(pos, newPoint, this, IsPC ? 40 : 10, (!IsMultisize) ? moveType : PathManager.MoveType.Default);
2282 }
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(), GoalCombat.Run(), GoalManualMove.Run(), and GoalManualMove.TryMove().

◆ GetGoalFromTimeTable()

Goal Chara.GetGoalFromTimeTable ( int  hour)
inline

Definition at line 7973 of file Chara.cs.

7974 {
7975 if (IsPC)
7976 {
7977 return null;
7978 }
7979 switch (TimeTable.GetSpan(idTimeTable, hour))
7980 {
7981 case TimeTable.Span.Sleep:
7983 {
7984 return new GoalSleep();
7985 }
7986 break;
7987 case TimeTable.Span.Eat:
7988 return new GoalIdle();
7989 case TimeTable.Span.Work:
7990 if (IsGuest())
7991 {
7992 return new GoalIdle();
7993 }
7994 return GetGoalWork();
7995 case TimeTable.Span.Free:
7996 if (IsGuest())
7997 {
7998 return new GoalIdle();
7999 }
8000 return GetGoalHobby();
8001 }
8002 return null;
8003 }
Goal GetGoalWork()
Definition: Chara.cs:8005
Goal GetGoalHobby()
Definition: Chara.cs:8018
string idTimeTable
Definition: Chara.cs:453
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 8018 of file Chara.cs.

8019 {
8020 if (IsPrisoner)
8021 {
8022 return new GoalIdle();
8023 }
8024 if (memberType == FactionMemberType.Livestock)
8025 {
8026 return new GoalGraze();
8027 }
8028 return new GoalHobby();
8029 }
FactionMemberType
bool IsPrisoner
Definition: Chara.cs:861

Referenced by Zone.Simulate().

◆ GetGoalWork()

Goal Chara.GetGoalWork ( )
inline

Definition at line 8005 of file Chara.cs.

8006 {
8007 if (IsPrisoner)
8008 {
8009 return new GoalIdle();
8010 }
8011 if (memberType == FactionMemberType.Livestock)
8012 {
8013 return new GoalGraze();
8014 }
8015 return new GoalWork();
8016 }

Referenced by Zone.Simulate().

◆ GetHappiness()

int Chara.GetHappiness ( )
inline

Definition at line 6558 of file Chara.cs.

6559 {
6560 int num = 50;
6561 if (FindBed() != null)
6562 {
6563 num += 50;
6564 }
6565 return num;
6566 }

◆ GetHireCost()

int Chara.GetHireCost ( )
inline

Definition at line 6553 of file Chara.cs.

6554 {
6555 return base.LV / 2 + 4;
6556 }

Referenced by CalcGold.Hire().

◆ GetHoverText()

override string Chara.GetHoverText ( )
inlinevirtual

Reimplemented from Card.

Definition at line 6118 of file Chara.cs.

6119 {
6120 string text = base.Name;
6121 if (IsFriendOrAbove())
6122 {
6123 text = text.TagColor(EClass.Colors.colorFriend);
6124 }
6125 else if (IsHostile())
6126 {
6127 text = text.TagColor(EClass.Colors.colorHostile);
6128 }
6129 int num = 2;
6130 int lV = EClass.pc.LV;
6131 if (base.LV >= lV * 5)
6132 {
6133 num = 0;
6134 }
6135 else if (base.LV >= lV * 2)
6136 {
6137 num = 1;
6138 }
6139 else if (base.LV <= lV / 4)
6140 {
6141 num = 4;
6142 }
6143 else if (base.LV <= lV / 2)
6144 {
6145 num = 3;
6146 }
6147 string text2 = Lang.GetList("lvComparison")[num];
6148 text2 = (" (" + text2 + ") ").TagSize(14).TagColor(EClass.Colors.gradientLVComparison.Evaluate(0.25f * (float)num));
6149 string s = (IsFriendOrAbove() ? "HostilityAlly" : (IsNeutral() ? "HostilityNeutral" : "HostilityEnemy"));
6150 s = (" (" + s.lang() + ") ").TagSize(14);
6151 s = "";
6152 if (memberType == FactionMemberType.Guest)
6153 {
6154 s += (" (" + "guest".lang() + ") ").TagSize(14);
6155 }
6156 else if (memberType == FactionMemberType.Livestock)
6157 {
6158 s += (" (" + "livestock".lang() + ") ").TagSize(14);
6159 }
6160 if (!EClass.pc.IsMoving)
6161 {
6162 if (EClass.pc.HasHigherGround(this))
6163 {
6164 text2 += "lowerGround".lang();
6165 }
6166 else if (HasHigherGround(EClass.pc))
6167 {
6168 text2 += "higherGround".lang();
6169 }
6170 }
6171 if (Evalue(1232) > 0)
6172 {
6173 text2 = "milkBaby".lang().TagSize(14) + text2;
6174 }
6175 if (Guild.Fighter.ShowBounty(this) && Guild.Fighter.HasBounty(this))
6176 {
6177 text2 = "hasBounty".lang().TagSize(14) + text2;
6178 }
6179 if (EClass.pc.HasElement(481))
6180 {
6181 text2 += ("(" + faith.Name + ")").TagSize(14);
6182 }
6183 return text + text2 + s;
6184 }
bool HasHigherGround(Card c)
Definition: Chara.cs:999
override bool IsMoving
Definition: Chara.cs:593
bool IsNeutral()
Definition: Chara.cs:5923
Color colorHostile
Color colorFriend
Gradient gradientLVComparison
bool ShowBounty(Chara c)
Definition: GuildFighter.cs:39
bool HasBounty(Chara c)
Definition: GuildFighter.cs:44
Definition: Guild.cs:2
static GuildFighter Fighter
Definition: Guild.cs:23

References ColorProfile.colorFriend, ColorProfile.colorHostile, EClass.Colors, Guild.Fighter, Lang.GetList(), ColorProfile.gradientLVComparison, GuildFighter.HasBounty(), Card.HasElement(), HasHigherGround(), IsMoving, Card.LV, EClass.pc, and GuildFighter.ShowBounty().

Referenced by WidgetMouseover.Refresh().

◆ GetHoverText2()

override string Chara.GetHoverText2 ( )
inlinevirtual

Reimplemented from Card.

Definition at line 6186 of file Chara.cs.

6187 {
6188 string text = "";
6189 if (knowFav)
6190 {
6191 text += Environment.NewLine;
6192 text = text + "<size=14>" + "favgift".lang(GetFavCat().GetName().ToLower(), GetFavFood().GetName()) + "</size>";
6193 }
6194 string text2 = "";
6196 {
6197 text2 += Environment.NewLine;
6198 text2 = text2 + "Lv:" + base.LV + " HP:" + base.hp + "/" + MaxHP + " MP:" + mana.value + "/" + mana.max + " DV:" + DV + " PV:" + PV + " Hunger:" + hunger.value;
6199 text2 += Environment.NewLine;
6200 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");
6201 text2 += Environment.NewLine;
6202 text2 = text2 + base.uid + IsMinion + "/" + base.c_uidMaster + "/" + master;
6203 text2 = text2 + " dir:" + base.dir + " skin:" + base.idSkin;
6204 }
6205 string text3 = "";
6206 IEnumerable<BaseStats> enumerable = conditions.Concat((!IsPCFaction) ? new BaseStats[0] : new BaseStats[2] { hunger, stamina });
6207 if (enumerable.Count() > 0)
6208 {
6209 text3 += Environment.NewLine;
6210 text3 += "<size=14>";
6211 int num = 0;
6212 foreach (BaseStats item in enumerable)
6213 {
6214 string text4 = item.GetPhaseStr();
6215 if (text4.IsEmpty() || text4 == "#")
6216 {
6217 continue;
6218 }
6219 Color c = Color.white;
6220 switch (item.source.group)
6221 {
6222 case "Bad":
6223 case "Debuff":
6224 case "Disease":
6226 break;
6227 case "Buff":
6229 break;
6230 }
6232 {
6233 text4 = text4 + "(" + item.GetValue() + ")";
6234 if (resistCon != null && resistCon.ContainsKey(item.id))
6235 {
6236 text4 = text4 + "{" + resistCon[item.id] + "}";
6237 }
6238 }
6239 num++;
6240 text3 = text3 + text4.TagColor(c) + ", ";
6241 }
6242 if (num == 0)
6243 {
6244 text3 = "";
6245 }
6246 else
6247 {
6248 text = "";
6249 text3 = text3.TrimEnd(", ".ToCharArray()) + "</size>";
6250 }
6251 }
6253 {
6254 text3 += Environment.NewLine;
6255 foreach (ActList.Item item2 in ability.list.items)
6256 {
6257 text3 = text3 + item2.act.Name + ", ";
6258 }
6259 text3 = text3.TrimEnd(", ".ToCharArray());
6260 }
6261 return text + text2 + text3;
6262 }
override string ToString()
Definition: AIAct.cs:124
int idSkin
Definition: Card.cs:346
SourceCategory.Row GetFavCat()
Definition: Chara.cs:7274
bool knowFav
Definition: Chara.cs:398
override string GetName(NameStyle style, int num=-1)
Definition: Chara.cs:1166
override int DV
Definition: Chara.cs:714
override int PV
Definition: Chara.cs:743
SourceThing.Row GetFavFood()
Definition: Chara.cs:7254
Color colorDebuff
bool showExtra
Definition: CoreDebug.cs:167
SourceTactics tactics

References Color, ColorProfile.colorBuff, ColorProfile.colorDebuff, EClass.Colors, EClass.debug, SourceJob.Row.id, Card.idSkin, item, ActList.items, CharaAbility.list, CoreDebug.showExtra, EClass.sources, SourceChara.Row.tactics, SourceManager.tactics, AIAct.ToString(), and Stats.value.

Referenced by WidgetMouseover.Refresh().

◆ GetIdPortrait()

string Chara.GetIdPortrait ( )
inline

Definition at line 7334 of file Chara.cs.

7335 {
7336 if (id == "olderyoungersister")
7337 {
7338 if (base.idSkin != 2)
7339 {
7340 return "UN_olderyoungersister";
7341 }
7342 return "UN_olderyoungersister_alt";
7343 }
7344 if (Portrait.allIds.Contains("UN_" + id + ".png"))
7345 {
7346 return "UN_" + id;
7347 }
7348 return base.c_idPortrait;
7349 }
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 7320 of file Chara.cs.

7321 {
7322 string text = race.id;
7323 if ((text == "mifu" || text == "nefu") && EClass.rnd(2) == 0)
7324 {
7325 return "foxfolk";
7326 }
7327 if (trait is TraitGuard)
7328 {
7329 return "guard";
7330 }
7331 return "";
7332 }

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

6359 {
6360 return GetSprite();
6361 }
override Sprite GetSprite(int dir=0)
Definition: Chara.cs:6046

◆ GetName()

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

Reimplemented from Card.

Definition at line 1166 of file Chara.cs.

1167 {
1168 if (base.isBackerContent && EClass.core.config.backer.Show(base.c_idBacker))
1169 {
1170 if (id == "follower" && !IsGlobal)
1171 {
1172 return "_follower".lang(EClass.sources.backers.map[base.c_idBacker].Name, faith.Name);
1173 }
1174 return EClass.sources.backers.map[base.c_idBacker].Name;
1175 }
1176 string text = base.c_altName ?? source.GetName(this);
1177 text = text.Replace("#ele4", MainElement.source.GetAltname(2)).Replace("#ele3", MainElement.source.GetAltname(1)).Replace("#ele2", MainElement.source.GetAltname(0))
1178 .Replace("#ele", MainElement.source.GetName().ToLower());
1179 if (base.c_bossType == BossType.Evolved)
1180 {
1181 text = "_evolved".lang(text.ToTitleCase(wholeText: true));
1182 }
1183 trait.SetName(ref text);
1184 if (text.Length > 0 && char.IsLower(text[0]))
1185 {
1186 if (base.rarity >= Rarity.Legendary)
1187 {
1188 text = text.ToTitleCase();
1189 }
1190 else if (num != 0)
1191 {
1192 text = text.AddArticle();
1193 }
1194 }
1195 if (style == NameStyle.Simple)
1196 {
1197 return text;
1198 }
1199 int num2 = ((base.rarity == Rarity.Mythical) ? 3 : ((base.rarity >= Rarity.Legendary) ? 2 : ((!_alias.IsEmpty()) ? 1 : (-1))));
1200 if (trait is TraitAdventurer)
1201 {
1202 num2 = 1;
1203 }
1204 text = (Aka.IsEmpty() ? text.Bracket(num2) : (num2 switch
1205 {
1206 -1 => "_aka",
1207 1 => "_aka3",
1208 _ => "_aka2",
1209 }).lang((num2 == -1) ? Aka : Aka.ToTitleCase(wholeText: true), text.Bracket(num2)));
1210 string text2 = (base.isSale ? "forSale".lang(Lang._currency(GetPrice(CurrencyType.Money, sell: true, PriceType.PlayerShop), "money")) : "");
1211 return text + text2;
1212 }
BossType
Definition: BossType.cs:2
Element MainElement
Definition: Chara.cs:702
string Aka
Definition: Chara.cs:201
string _alias
Definition: Chara.cs:204
BackerContentConfig backer
Definition: CoreConfig.cs:600
string Name
Definition: Religion.cs:30
SourceBacker backers
virtual void SetName(ref string s)
Definition: Trait.cs:651

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().

◆ GetPietyValue()

int Chara.GetPietyValue ( )
inline

Definition at line 9157 of file Chara.cs.

9158 {
9159 if (base._IsPC)
9160 {
9161 return 10 + (int)(Mathf.Sqrt(base.c_daysWithGod) * 2f + (float)Evalue(85)) / 2;
9162 }
9163 return 10 + (int)(Mathf.Sqrt(base.LV) * 5f + (float)Evalue(306)) / 2;
9164 }

◆ GetRevived()

void Chara.GetRevived ( )
inline

Definition at line 4628 of file Chara.cs.

4629 {
4630 Revive(EClass.pc.pos.GetNearestPoint(allowBlock: false, allowChara: false), msg: true);
4631 if (!IsPCFaction)
4632 {
4633 return;
4634 }
4636 {
4637 if (homeZone != null && EClass._zone != homeZone)
4638 {
4639 Msg.Say("returnHome", this, homeZone.Name);
4641 }
4642 }
4643 else if (!EClass._zone.IsPCFaction || homeBranch != EClass.Branch || base.c_wasInPcParty)
4644 {
4645 EClass.pc.party.AddMemeber(this, showMsg: true);
4646 }
4647 }
static FactionBranch Branch
Definition: EClass.cs:22
void AddMemeber(Chara c, bool showMsg=false)
Definition: Party.cs:51
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false)
Definition: Point.cs:595
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 8087 of file Chara.cs.

8088 {
8089 BaseArea result = null;
8090 foreach (Hobby item in ListWorks())
8091 {
8092 AIWork aI = item.GetAI(this);
8093 if (aI.SetDestination())
8094 {
8095 if (aI.destArea != null)
8096 {
8097 result = aI.destArea;
8098 }
8099 else if (aI.destThing != null)
8100 {
8101 result = aI.destThing.pos.cell.room;
8102 }
8103 break;
8104 }
8105 }
8106 return result;
8107 }
Definition: AIWork.cs:5
Thing destThing
Definition: AIWork.cs:16
bool SetDestination()
Definition: AIWork.cs:55
BaseArea destArea
Definition: AIWork.cs:12
List< Hobby > ListWorks(bool useMemberType=true)
Definition: Chara.cs:8109
Definition: Hobby.cs:4

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

6047 {
6048 if (IsPCC)
6049 {
6050 PCC pCC = PCC.Get(pccData);
6051 pCC.Build();
6052 return pCC.variation.idle[0, 0];
6053 }
6054 return sourceCard.GetSprite((sourceCard._tiles.Length > 1) ? ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % sourceCard._tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0))) : 0);
6055 }
override CardRow sourceCard
Definition: Chara.cs:435
int[] _tiles
Definition: RenderRow.cs:12
Sprite GetSprite(int dir=0, int skin=0, bool snow=false)
Definition: RenderRow.cs:261

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

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

◆ GetSubPassData()

override SubPassData Chara.GetSubPassData ( )
inlinevirtual

Reimplemented from Card.

Definition at line 6066 of file Chara.cs.

6067 {
6068 if (IsPCC)
6069 {
6071 {
6073 }
6074 }
6075 else if (conSleep != null && host == null && pos.Equals(EClass.pc.pos) && IsHuman && GetBool(123))
6076 {
6077 return EClass.setting.pass.subDead;
6078 }
6079 return SubPassData.Default;
6080 }
bool GetBool(int id)
Definition: BaseCard.cs:15
ConSleep conSleep
Definition: Chara.cs:99
override bool IsDeadOrSleeping
Definition: Chara.cs:558
PassSetting pass
Definition: GameSetting.cs:303
bool altHeldPos
Definition: Player.cs:954
static SubPassData Default
Definition: SubPassData.cs:7

References Player.altHeldPos, 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 6568 of file Chara.cs.

6569 {
6570 return GetHappiness().ToString() ?? "";
6571 }
int GetHappiness()
Definition: Chara.cs:6558

◆ GetTextHobby()

string Chara.GetTextHobby ( bool  simple = false)
inline

Definition at line 8225 of file Chara.cs.

8226 {
8227 string text = (simple ? "" : ("hobby".lang() + ":"));
8228 foreach (Hobby item in ListHobbies())
8229 {
8230 text = text + " " + item.Name.TagColor((item.GetEfficiency(this) > 0) ? FontColor.Good : FontColor.Warning) + ",";
8231 }
8232 return text.TrimEnd(',');
8233 }
List< Hobby > ListHobbies(bool useMemberType=true)
Definition: Chara.cs:8136

References item.

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

◆ GetTextWork()

string Chara.GetTextWork ( bool  simple = false)
inline

Definition at line 8235 of file Chara.cs.

8236 {
8237 string text = (simple ? "" : ("work".lang() + ":"));
8238 foreach (Hobby item in ListWorks())
8239 {
8240 text = text + " " + item.Name.TagColor((item.GetEfficiency(this) > 0) ? FontColor.Good : FontColor.Warning) + ",";
8241 }
8242 return text.TrimEnd(',');
8243 }

References item.

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

◆ GetTopicText()

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

Definition at line 6264 of file Chara.cs.

6265 {
6266 string key = source.idText.IsEmpty(id);
6267 if (id == "littleOne" && EClass._zone is Zone_LittleGarden)
6268 {
6269 key = "littleOne2";
6270 }
6271 SourceCharaText.Row row = EClass.sources.charaText.map.TryGetValue(key);
6272 if (row == null)
6273 {
6274 return null;
6275 }
6276 string text = row.GetText(topic, returnNull: true);
6277 if (text.IsEmpty())
6278 {
6279 return null;
6280 }
6281 if (text.StartsWith("@"))
6282 {
6283 row = EClass.sources.charaText.map.TryGetValue(text.Replace("@", ""));
6284 if (row == null)
6285 {
6286 return null;
6287 }
6288 text = row.GetText(topic, returnNull: true);
6289 if (text.IsEmpty())
6290 {
6291 return null;
6292 }
6293 }
6294 return text.Split(Environment.NewLine.ToCharArray()).RandomItem();
6295 }
SourceCharaText charaText

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

◆ GetTotalFeat()

int Chara.GetTotalFeat ( )
inline

Definition at line 7294 of file Chara.cs.

7295 {
7296 int num = 0;
7297 if (base.c_upgrades != null)
7298 {
7299 num += base.c_upgrades.spent;
7300 }
7301 if (base.c_genes != null)
7302 {
7303 num += base.c_genes.GetTotalCost();
7304 }
7305 return num + base.feat;
7306 }

◆ GetWork()

Hobby Chara.GetWork ( string  id)
inline

Definition at line 8156 of file Chara.cs.

8157 {
8158 foreach (Hobby item in ListWorks())
8159 {
8160 if (item.source.alias == id)
8161 {
8162 return item;
8163 }
8164 }
8165 foreach (Hobby item2 in ListHobbies())
8166 {
8167 if (item2.source.alias == id)
8168 {
8169 return item2;
8170 }
8171 }
8172 return null;
8173 }
SourceHobby.Row source
Definition: Hobby.cs:7

References item, and Hobby.source.

Referenced by FactionBranch.AutoClean(), FactionBranch.GenerateGarbage(), and FactionBranch.OnAdvanceDay().

◆ GetWorkSummary()

WorkSummary Chara.GetWorkSummary ( )
inline

Definition at line 8308 of file Chara.cs.

8309 {
8310 if (_workSummary == null)
8311 {
8312 _workSummary = new WorkSummary();
8313 }
8314 return _workSummary;
8315 }
WorkSummary _workSummary
Definition: Chara.cs:55

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

◆ GiveBirth()

Thing Chara.GiveBirth ( Thing  t,
bool  effect 
)
inline

Definition at line 7351 of file Chara.cs.

7352 {
7353 EClass.player.forceTalk = true;
7354 Talk("giveBirth");
7356 if (effect)
7357 {
7358 PlayEffect("revive");
7359 PlaySound("egg");
7360 PlayAnime(AnimeID.Shiver);
7361 AddCondition<ConDim>(200);
7362 }
7363 return t;
7364 }
void PlayAnime(AnimeID id, bool force=false)
Definition: Card.cs:5423
bool TryAddThing(Thing target, Point p, bool destroyIfFail=false)
Definition: Zone.cs:2133

References EClass._zone, and Zone.TryAddThing().

◆ GiveGift()

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

Definition at line 7480 of file Chara.cs.

7481 {
7482 if (c.IsHostile() || c.IsDeadOrSleeping)
7483 {
7484 Msg.Say("affinityNone", c, this);
7485 return;
7486 }
7487 if (!t.isCopy && t.IsCursed && t.IsEquipmentOrRanged && !t.IsAmmo && c.HasElement(1414))
7488 {
7489 bool num = t.blessedState == BlessedState.Doomed;
7490 int num2 = 200 + t.LV * 3;
7491 if (t.rarity == Rarity.Legendary)
7492 {
7493 num2 *= 3;
7494 }
7495 if (t.rarity >= Rarity.Mythical)
7496 {
7497 num2 *= 5;
7498 }
7499 if (num)
7500 {
7501 num2 *= 2;
7502 }
7503 EClass.pc.PlayEffect("identify");
7504 EClass.pc.PlaySound("identify");
7505 c.PlayEffect("mutation");
7506 c.Say("draw_curse", c, t);
7507 t.Destroy();
7508 List<Element> list = new List<Element>();
7509 foreach (Element value in EClass.pc.elements.dict.Values)
7510 {
7511 if (value is Spell)
7512 {
7513 list.Add(value);
7514 }
7515 }
7516 if (list.Count == 0)
7517 {
7519 return;
7520 }
7521 Element element = list.RandomItem();
7522 EClass.pc.ModExp(element.id, num2);
7523 EClass.pc.Say("draw_curse2", EClass.pc, element.Name);
7524 c.AddExp(Mathf.Min(num2 / 3, c.ExpToNext));
7525 return;
7526 }
7527 if ((t.id == "lovepotion" || t.id == "dreambug") && !Application.isEditor)
7528 {
7529 GiveLovePotion(c, t);
7530 return;
7531 }
7532 if (t.trait is TraitErohon && c.id == t.c_idRefName)
7533 {
7534 c.OnGiveErohon(t);
7535 return;
7536 }
7537 if (t.trait is TraitTicketMassage)
7538 {
7539 t.ModNum(-1);
7540 c.Talk("ticket");
7541 switch (t.id)
7542 {
7543 case "ticket_massage":
7544 c.ModAffinity(EClass.pc, 10);
7546 {
7547 target = c
7548 });
7549 break;
7550 case "ticket_armpillow":
7551 c.ModAffinity(EClass.pc, 20);
7552 EClass.pc.AddCondition<ConSleep>(300, force: true);
7553 c.SetAI(new AI_ArmPillow
7554 {
7555 target = EClass.pc
7556 });
7557 break;
7558 case "ticket_champagne":
7559 c.ModAffinity(EClass.pc, 10);
7561 break;
7562 }
7563 return;
7564 }
7565 if (t.id == "flyer")
7566 {
7567 stamina.Mod(-1);
7568 if (c.things.Find((Thing a) => a.id == "flyer") != null)
7569 {
7570 c.Talk("flyer_miss");
7571 DoHostileAction(c);
7572 return;
7573 }
7574 if (EClass.rnd(20) != 0 && c.CHA > EClass.rnd(base.CHA + Evalue(291) * 3 + 10))
7575 {
7576 Msg.Say("affinityNone", c, this);
7577 t.Destroy();
7578 elements.ModExp(291, 10);
7579 return;
7580 }
7581 elements.ModExp(291, 50);
7582 }
7583 if (t.id == "statue_weird")
7584 {
7585 EClass.pc.Say("statue_sell");
7586 }
7587 t.isGifted = true;
7588 c.nextUse = c.affinity.OnGift(t);
7589 if (!t.isDestroyed)
7590 {
7591 EClass.game.quests.list.ForeachReverse(delegate(Quest q)
7592 {
7593 q.OnGiveItem(c, t);
7594 });
7595 if (c.TryEquip(t))
7596 {
7597 c.nextUse = null;
7598 }
7599 }
7600 }
Thing OnGift(Thing t)
Definition: Affinity.cs:103
int ExpToNext
Definition: Card.cs:1884
bool isCopy
Definition: Card.cs:850
bool IsCursed
Definition: Card.cs:2115
int CHA
Definition: Card.cs:2207
bool IsEquipmentOrRanged
Definition: Card.cs:2078
void SayNothingHappans()
Definition: Card.cs:6041
string c_idRefName
Definition: Card.cs:1541
void AddExp(int a)
Definition: Card.cs:2767
void GiveLovePotion(Chara c, Thing t)
Definition: Chara.cs:7613
Affinity affinity
Definition: Chara.cs:299
bool TryEquip(Thing t, bool useFav=false)
Definition: Chara.cs:6961
void OnGiveErohon(Thing t)
Definition: Chara.cs:7602
QuestManager quests
Definition: Game.cs:179
List< Quest > list
Definition: QuestManager.cs:11
Definition: Quest.cs:7
virtual void OnGiveItem(Chara c, Thing t)
Definition: Quest.cs:531

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

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

◆ GiveLovePotion()

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

Definition at line 7613 of file Chara.cs.

7614 {
7615 c.Say("give_love", c, t);
7616 c.PlaySound(t.material.GetSoundDead());
7617 c.ShowEmo(Emo.angry);
7618 c.ModAffinity(EClass.pc, -20, show: false);
7619 c.Talk("pervert");
7620 t.Destroy();
7621 }

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

5684 {
5685 if (enemy == null && !IsPC)
5686 {
5687 if (GetInt(106) == 0)
5688 {
5689 TalkTopic("aggro");
5690 }
5691 if (OriginalHostility != Hostility.Enemy)
5692 {
5693 ShowEmo(Emo.angry);
5694 }
5695 SetEnemy(_tg.Chara);
5696 }
5698 {
5699 if (hostility >= Hostility.Neutral)
5700 {
5701 Say("angry", this);
5702 }
5703 hostility = Hostility.Enemy;
5704 }
5705 }
int GetInt(int id, int? defaultInt=null)
Definition: BaseCard.cs:25
virtual bool IsPCFactionMinion
Definition: Card.cs:2031

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

Referenced by CallHelp(), DoHostileAction(), and RequestProtection().

◆ HasAccess() [1/2]

bool Chara.HasAccess ( Card  c)
inline

Definition at line 1089 of file Chara.cs.

1090 {
1091 return HasAccess(c.pos);
1092 }
bool HasAccess(Card c)
Definition: Chara.cs:1089

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

1095 {
1096 if (!EClass._zone.IsPCFaction || p.cell.room == null || IsPC)
1097 {
1098 return true;
1099 }
1100 return p.cell.room.data.accessType switch
1101 {
1102 BaseArea.AccessType.Resident => memberType == FactionMemberType.Default,
1103 BaseArea.AccessType.Private => false,
1104 _ => true,
1105 };
1106 }

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

8557 {
8558 for (int i = 0; i < conditions.Count; i++)
8559 {
8560 if (conditions[i] is T)
8561 {
8562 return true;
8563 }
8564 }
8565 return false;
8566 }

◆ HasCooldown()

bool Chara.HasCooldown ( int  idEle)
inline

Definition at line 7907 of file Chara.cs.

7908 {
7909 if (_cooldowns != null)
7910 {
7911 for (int i = 0; i < _cooldowns.Count; i++)
7912 {
7913 if (_cooldowns[i] / 1000 == idEle)
7914 {
7915 return true;
7916 }
7917 }
7918 }
7919 return false;
7920 }

Referenced by Card.DamageHP(), and RequestProtection().

◆ HasHigherGround()

bool Chara.HasHigherGround ( Card  c)
inline

Definition at line 999 of file Chara.cs.

1000 {
1001 if (c == null)
1002 {
1003 return false;
1004 }
1005 float num = renderer.position.y - pos.Position(0).y + (_isLevitating ? 0.4f : 0f);
1006 float num2 = c.renderer.position.y - c.pos.Position(0).y + ((c.isChara && c.Chara._isLevitating) ? 0.4f : 0f);
1007 return num > num2 + 0.1f;
1008 }
bool _isLevitating
Definition: Chara.cs:129
ref Vector3 Position(int height)
Definition: Point.cs:524

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

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

◆ HealAll()

void Chara.HealAll ( )
inline

Definition at line 1495 of file Chara.cs.

1496 {
1497 Cure(CureType.Death);
1498 base.hp = MaxHP;
1499 mana.value = mana.max;
1500 stamina.value = stamina.max;
1501 Refresh();
1502 }
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 4084 of file Chara.cs.

4085 {
4086 if (held == t || t.isDestroyed || t.Num <= 0)
4087 {
4088 return;
4089 }
4090 if (IsPC && t.isNPCProperty)
4091 {
4092 t.isNPCProperty = false;
4094 pos.TryWitnessCrime(this);
4095 }
4096 PickHeld();
4097 if (t.isChara)
4098 {
4100 {
4101 t.ShowEmo(Emo.love);
4102 }
4103 EClass.player.altHeldPos = t.renderer.data.ForceAltHeldPosition || EClass.rnd(2) == 0;
4104 }
4105 else
4106 {
4107 if (num == -1 || num > t.Num)
4108 {
4109 num = t.Num;
4110 }
4111 if (num < t.Num)
4112 {
4113 t = t.Split(num);
4114 }
4115 }
4116 if (t.GetRootCard() != this)
4117 {
4118 t = Pick(t.Thing, msg: false, tryStack: false);
4119 if (t.GetRootCard() != this)
4120 {
4121 return;
4122 }
4123 }
4124 held = t;
4125 if (held.GetLightRadius() > 0)
4126 {
4128 }
4129 if (IsPC)
4130 {
4132 WidgetHotbar.dirtyCurrentItem = true;
4133 }
4134 }
Thing Split(int a)
Definition: Card.cs:3231
bool isNPCProperty
Definition: Card.cs:526
void RecalculateFOV()
Definition: Card.cs:5616
virtual bool IsAliveInCurrentZone
Definition: Card.cs:2003
int GetLightRadius()
Definition: Card.cs:5658
void PickHeld(bool msg=false)
Definition: Chara.cs:4136
bool TryWitnessCrime(Chara criminal, Chara target=null, int radius=4, Func< Chara, bool > funcWitness=null)
Definition: Point.cs:845

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

8393 {
8394 if (!onDeserialize)
8395 {
8396 _cints[10] = 20;
8397 _cints[11] = 70;
8398 _cints[13] = 70;
8399 _cints[14] = 70;
8400 _cints[15] = 70;
8401 _cints[17] = 0;
8402 _cints[18] = 0;
8403 }
8404 foreach (Condition condition in conditions)
8405 {
8406 condition.SetOwner(this, onDeserialize);
8407 }
8408 }
int[] _cints
Definition: Chara.cs:79

References BaseCondition.SetOwner().

Referenced by OnCreate(), and OnDeserialized().

◆ InstantEat()

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

Definition at line 6840 of file Chara.cs.

6841 {
6842 if (t == null)
6843 {
6844 t = things.Find((Thing a) => CanEat(a, shouldEat: true) && !a.c_isImportant);
6845 }
6846 if (t == null)
6847 {
6848 t = things.Find((Thing a) => CanEat(a) && !a.c_isImportant);
6849 }
6850 if (t != null)
6851 {
6852 Say("eat_start", this, t.Duplicate(1));
6853 if (sound)
6854 {
6855 PlaySound("eat");
6856 }
6857 FoodEffect.Proc(this, t);
6858 t.ModNum(-1);
6859 }
6860 }
bool CanEat(Thing t, bool shouldEat=false)
Definition: Chara.cs:6862
static void Proc(Chara c, Thing food)
Definition: FoodEffect.cs:82

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

5934 {
5935 if (faction == EClass.Home)
5936 {
5937 return homeZone == EClass.game.activeZone;
5938 }
5939 return false;
5940 }
Faction faction
Definition: Chara.cs:412
Zone activeZone
Definition: Game.cs:245

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

◆ IsCriticallyWounded()

bool Chara.IsCriticallyWounded ( bool  includeRide = false)
inline

Definition at line 986 of file Chara.cs.

987 {
988 if (host == null || includeRide)
989 {
990 if (Evalue(1421) <= 0)
991 {
992 return base.hp < MaxHP / 5;
993 }
994 return base.hp + mana.value < (MaxHP + mana.max) / 5;
995 }
996 return false;
997 }

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

2203 {
2204 if (!currentZone.IsRegion && p.IsValid)
2205 {
2206 CellDetail detail = p.detail;
2207 if (detail != null && detail.charas.Count > 0)
2208 {
2209 foreach (Chara chara in p.detail.charas)
2210 {
2211 if (chara.IsHostile(this) || !chara.trait.CanBePushed)
2212 {
2213 if (cancelAI && EClass.pc.ai is GoalManualMove)
2214 {
2215 EClass.pc.ai.Cancel();
2216 }
2217 return true;
2218 }
2219 }
2220 }
2221 }
2222 return false;
2223 }
virtual Status Cancel()
Definition: AIAct.cs:291
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 2102 of file Chara.cs.

2103 {
2104 if (!IsPCPartyMinion)
2105 {
2106 return false;
2107 }
2108 foreach (Quest item in EClass.game.quests.list)
2109 {
2110 if (item is QuestEscort questEscort && questEscort.uidChara == base.uid)
2111 {
2112 return true;
2113 }
2114 }
2115 return false;
2116 }
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 5977 of file Chara.cs.

5978 {
5979 if (base.IsPCFactionOrMinion || IsFriendOrAbove())
5980 {
5982 {
5983 return true;
5984 }
5985 }
5986 else if (IsHostile() && c.IsHostile())
5987 {
5988 return true;
5989 }
5990 return false;
5991 }

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

◆ IsGuest()

◆ IsHomeMember()

◆ IsHostile() [1/2]

◆ IsHostile() [2/2]

bool Chara.IsHostile ( Chara  c)
inline

Definition at line 5889 of file Chara.cs.

5890 {
5891 if (c == null)
5892 {
5893 return false;
5894 }
5895 if (base.IsPCFactionOrMinion)
5896 {
5897 if ((c == EClass.pc.enemy && !c.IsPCFactionOrMinion) || c.hostility <= Hostility.Enemy)
5898 {
5899 return true;
5900 }
5901 }
5902 else
5903 {
5905 {
5906 return true;
5907 }
5908 if (OriginalHostility >= Hostility.Friend)
5909 {
5910 if (c.hostility <= Hostility.Enemy && c.OriginalHostility == Hostility.Enemy)
5911 {
5912 return true;
5913 }
5914 }
5915 else if (OriginalHostility <= Hostility.Enemy && (c.IsPCFactionOrMinion || (c.OriginalHostility != Hostility.Enemy && c.hostility >= Hostility.Friend)))
5916 {
5917 return true;
5918 }
5919 }
5920 return false;
5921 }
bool IsCriminal
Definition: Player.cs:1138

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

5948 {
5949 return EClass.game.activeZone == currentZone;
5950 }

Referenced by BaseListPeople.IsDisabled().

◆ IsInSpot< T >()

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

Definition at line 5952 of file Chara.cs.

5952 : TraitSpot
5953 {
5954 foreach (T item in EClass._map.props.installed.traits.List<T>())
5955 {
5956 foreach (Point item2 in item.ListPoints())
5957 {
5958 if (pos.Equals(item2))
5959 {
5960 return true;
5961 }
5962 }
5963 }
5964 return false;
5965 }
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 5923 of file Chara.cs.

5924 {
5925 return hostility == Hostility.Neutral;
5926 }

Referenced by ActPlan._Update().

◆ IsNeutralOrAbove()

bool Chara.IsNeutralOrAbove ( )
inline

◆ IsValidGiftWeight()

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

Definition at line 7424 of file Chara.cs.

7425 {
7426 int num2 = ((!HasElement(1411)) ? 1 : 3);
7427 if (GetBurden(t, num) >= num2)
7428 {
7429 return false;
7430 }
7431 return true;
7432 }
int GetBurden(Card t=null, int num=-1)
Definition: Chara.cs:1554

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

◆ Kick() [1/2]

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

Definition at line 5182 of file Chara.cs.

5183 {
5185 {
5186 return;
5187 }
5188 if (t.IsPC)
5189 {
5191 }
5192 if (t.host != null)
5193 {
5194 return;
5195 }
5196 if (t == this)
5197 {
5198 if (!ignoreSelf)
5199 {
5200 Debug.Log(t.pos.GetNearestPoint());
5201 if (TryMove(t.pos.GetNearestPoint()) != MoveResult.Success)
5202 {
5204 }
5205 }
5206 return;
5207 }
5208 if (show)
5209 {
5210 Say("kick", this, t);
5211 }
5212 PlaySound("kick");
5213 if ((t.conSuspend == null || t.conSuspend.uidMachine != 0) && t.trait.CanBePushed && (!t.IsHostile() || EClass.rnd(2) == 0) && !t.noMove && !t.isRestrained)
5214 {
5215 t.MoveByForce(t.pos.GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: true, ignoreCenter: true), this, !t.pos.IsBlocked);
5216 }
5217 if (t.conSleep != null)
5218 {
5219 t.conSleep.Kill();
5220 }
5221 if (IsPC && t.IsFriendOrAbove() && !t.IsPCFactionOrMinion && karmaLoss)
5222 {
5224 }
5225 t.PlayEffect("kick");
5226 }
void ClearPlans()
Definition: AM_Adv.cs:436
static AM_Adv Adv
Definition: ActionMode.cs:15
void MoveImmediate(Point p, bool focus=true, bool cancelAI=true)
Definition: Card.cs:5127
ConSuspend conSuspend
Definition: Chara.cs:101
MoveResult TryMove(Point newPoint, bool allowDestroyPath=true)
Definition: Chara.cs:2422
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 
)
inline

Definition at line 5174 of file Chara.cs.

5175 {
5176 foreach (Chara item in p.ListCharas())
5177 {
5178 Kick(item, ignoreSelf);
5179 }
5180 }
List< Chara > ListCharas()
Definition: Point.cs:1135

References item, and Kick.

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

◆ ListAvailabeFeats()

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

Definition at line 8949 of file Chara.cs.

8950 {
8951 List<Element> list = new List<Element>();
8952 foreach (SourceElement.Row item in EClass.sources.elements.rows.Where((SourceElement.Row a) => a.group == "FEAT" && a.cost[0] != -1 && !a.categorySub.IsEmpty()))
8953 {
8955 int num = ((feat.ValueWithoutLink <= 0) ? 1 : (feat.ValueWithoutLink + 1));
8956 if (num <= feat.source.max && !feat.HasTag("class") && !feat.HasTag("hidden") && !feat.HasTag("innate") && (!pet || !feat.HasTag("noPet")) && (showAll || feat.IsPurchaseFeatReqMet(elements)))
8957 {
8958 list.Add(Element.Create(feat.id, num) as Feat);
8959 }
8960 }
8961 return list;
8962 }
int feat
Definition: Card.cs:358
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:913
Definition: FEAT.cs:249

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

8137 {
8138 listHobby.Clear();
8139 if (!useMemberType || memberType != FactionMemberType.Livestock)
8140 {
8141 if (_hobbies == null)
8142 {
8143 RerollHobby();
8144 }
8145 foreach (int hobby in _hobbies)
8146 {
8147 listHobby.Add(new Hobby
8148 {
8149 id = hobby
8150 });
8151 }
8152 }
8153 return listHobby;
8154 }
static List< Hobby > listHobby
Definition: Chara.cs:13
void RerollHobby(bool extraSlotChance=true)
Definition: Chara.cs:8269

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

8110 {
8111 listHobby.Clear();
8112 if (useMemberType && memberType == FactionMemberType.Livestock)
8113 {
8114 listHobby.Add(new Hobby
8115 {
8116 id = 45
8117 });
8118 }
8119 else
8120 {
8121 if (_works == null)
8122 {
8123 RerollHobby();
8124 }
8125 foreach (int work in _works)
8126 {
8127 listHobby.Add(new Hobby
8128 {
8129 id = work
8130 });
8131 }
8132 }
8133 return listHobby;
8134 }

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

3225 {
3226 angle = Util.GetAngle(p.x - pos.x, p.z - pos.z);
3227 if (EClass._zone.IsRegion)
3228 {
3229 if (angle > 100f && angle < 170f)
3230 {
3231 base.dir = 2;
3232 }
3233 else if (angle > 170f && angle < 190f)
3234 {
3235 base.dir = 0;
3236 }
3237 else if (angle > 190f || (angle < -10f && angle > -100f))
3238 {
3239 base.dir = 3;
3240 }
3241 else
3242 {
3243 base.dir = 1;
3244 }
3245 angle -= 45f;
3246 }
3247 else if (angle > 170f && angle < 235f)
3248 {
3249 base.dir = 0;
3250 }
3251 else if (angle > 80f && angle < 145f)
3252 {
3253 base.dir = 1;
3254 }
3255 else if (angle > -100f && angle < -35f)
3256 {
3257 base.dir = 3;
3258 }
3259 else if (angle > -10f && angle < 55f)
3260 {
3261 base.dir = 2;
3262 }
3264 }

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

◆ MakeAlly()

void Chara.MakeAlly ( bool  msg = true)
inline

Definition at line 2004 of file Chara.cs.

2005 {
2006 if (IsLocalChara && !base.IsUnique)
2007 {
2008 Debug.Log("Creating Replacement NPC for:" + this);
2010 }
2011 _MakeAlly();
2012 if (msg)
2013 {
2014 EClass.pc.Say("hire", this);
2015 EClass.Sound.Play("good");
2016 }
2017 EClass.pc.party.AddMemeber(this);
2018 if (EClass._zone.IsTown)
2019 {
2021 }
2022 }
Chara CreateReplacement()
Definition: Chara.cs:7233
void _MakeAlly()
Definition: Chara.cs:2024
virtual bool IsTown
Definition: Zone.cs:220
void RefreshListCitizen()
Definition: Zone.cs:3285

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(), TraitDiary.OnRead(), TraitGiftNewYear.OnUse(), DramaOutcome.poppy_found(), ActRide.Ride(), DramaOutcome.sister_friend(), ActThrow.Throw(), and Religion.TryGetGift().

◆ MakeBraineCell()

Thing Chara.MakeBraineCell ( )
inline

Definition at line 7371 of file Chara.cs.

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

References DNA.GenerateGene().

Referenced by CoreDebug.UpdateInput().

◆ MakeEgg()

Thing Chara.MakeEgg ( bool  effect = true,
int  num = 1,
bool  addToZone = true 
)
inline

Definition at line 7396 of file Chara.cs.

7397 {
7398 Thing thing = ThingGen.Create((EClass.rnd(EClass.debug.enable ? 1 : 20) == 0) ? "egg_fertilized" : "_egg").SetNum(num);
7399 thing.MakeFoodFrom(this);
7400 thing.c_idMainElement = base.c_idMainElement;
7401 if (!addToZone)
7402 {
7403 return thing;
7404 }
7405 return GiveBirth(thing, effect);
7406 }
int c_idMainElement
Definition: Card.cs:1337
Card MakeFoodFrom(string _id)
Definition: Card.cs:4918
Thing GiveBirth(Thing t, bool effect)
Definition: Chara.cs:7351

References Card.c_idMainElement, ThingGen.Create(), EClass.debug, CoreDebug.enable, Card.MakeFoodFrom(), EClass.rnd(), and Card.SetNum().

Referenced by Cuddle(), FactionBranch.DailyOutcome(), ActEffect.LoveMiracle(), and CoreDebug.UpdateInput().

◆ MakeGene()

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

Definition at line 7366 of file Chara.cs.

7367 {
7368 return DNA.GenerateGene(this, type);
7369 }

References DNA.GenerateGene().

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

◆ MakeGrave()

void Chara.MakeGrave ( string  lastword)
inline

Definition at line 4717 of file Chara.cs.

4718 {
4719 if (!EClass._zone.IsRegion)
4720 {
4721 List<string> list = new List<string> { "930", "931", "947", "948", "949", "950", "951", "952" };
4722 if (IsPC && EClass.rnd(2) == 0 && EClass.pc.things.Find("letter_will") != null)
4723 {
4724 list = new List<string> { "944", "946", "backerGrave", "backerGrave2" };
4725 }
4726 Thing thing = ThingGen.Create(list.RandomItem());
4727 thing.MakeRefFrom(this);
4728 if (!lastword.IsEmpty())
4729 {
4730 thing.c_note = lastword;
4731 }
4732 thing.isModified = true;
4733 EClass._zone.AddCard(thing, pos).Install();
4734 }
4735 }
void MakeRefFrom(string id)
Definition: Card.cs:5094

References EClass._zone, Zone.AddCard(), ThingGen.Create(), ThingContainer.Find(), Card.Install(), Spatial.IsRegion, Card.MakeRefFrom(), EClass.pc, EClass.rnd(), and Card.things.

◆ MakeMilk()

Thing Chara.MakeMilk ( bool  effect = true,
int  num = 1,
bool  addToZone = true 
)
inline

Definition at line 7376 of file Chara.cs.

7377 {
7378 Thing thing = ThingGen.Create("milk").SetNum(num);
7379 thing.MakeRefFrom(this);
7380 int num2 = base.LV - source.LV;
7382 {
7383 num2 = 0;
7384 }
7385 if (num2 >= 10)
7386 {
7387 thing.SetEncLv(num2 / 10);
7388 }
7389 if (!addToZone)
7390 {
7391 return thing;
7392 }
7393 return GiveBirth(thing, effect);
7394 }
void SetEncLv(int a)
Definition: Card.cs:3567
virtual bool IsUserZone
Definition: Zone.cs:264

References EClass._zone, ThingGen.Create(), Zone.IsUserZone, RenderRow.LV, Card.MakeRefFrom(), Card.SetEncLv(), and Card.SetNum().

Referenced by FactionBranch.DailyOutcome(), ActEffect.LoveMiracle(), and CoreDebug.UpdateInput().

◆ MakeMinion()

void Chara.MakeMinion ( Chara  _master,
MinionType  type = MinionType::Default 
)
inline

Definition at line 2058 of file Chara.cs.

2059 {
2060 ReleaseMinion();
2061 Hostility hostility2 = (base.c_originalHostility = (_master.IsPCFaction ? Hostility.Ally : _master.hostility));
2062 this.hostility = hostility2;
2063 base.c_uidMaster = _master.uid;
2064 base.c_minionType = type;
2065 master = _master;
2066 Refresh();
2067 }
int uid
Definition: Card.cs:118

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

1999 {
2000 _MakeAlly();
2001 EClass.pc.party.AddMemeber(this);
2002 }

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

7167 {
7168 if (c == this)
7169 {
7170 return;
7171 }
7172 if (IsPC)
7173 {
7174 c.ModAffinity(EClass.pc, a, show);
7175 return;
7176 }
7177 int num = StatsHygiene.GetAffinityMod(EClass.pc.hygiene.GetPhase()) + (HasElement(417) ? 20 : 0);
7178 if (IsPCFaction && homeBranch != null)
7179 {
7180 num += (int)Mathf.Sqrt(homeBranch.Evalue(2117)) * 5;
7181 }
7182 bool flag = a > 0;
7183 if (flag)
7184 {
7185 a = a * num / 100;
7186 }
7187 if (c.IsPC)
7188 {
7189 a = affinity.Mod(a);
7190 }
7191 if (!show)
7192 {
7193 return;
7194 }
7195 if (a == 0)
7196 {
7197 if (!showOnlyEmo)
7198 {
7199 Say("affinityNone", this, c);
7200 }
7201 return;
7202 }
7203 ShowEmo((!flag) ? Emo.angry : Emo.love);
7204 c.ShowEmo(flag ? Emo.love : Emo.sad);
7205 if (!showOnlyEmo)
7206 {
7207 Say(flag ? "affinityPlus" : "affinityMinus", this, c);
7208 }
7209 }
int Mod(int a)
Definition: Affinity.cs:162
Stats hygiene
Definition: Chara.cs:961
int Evalue(int ele)
static int GetAffinityMod(int phase)
Definition: StatsHygiene.cs:19

References FactionBranch.Evalue(), StatsHygiene.GetAffinityMod(), Stats.GetPhase(), hygiene, IsPC, Affinity.Mod(), ModAffinity(), EClass.pc, and Card.ShowEmo().

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

◆ ModCorruption()

void Chara.ModCorruption ( int  a)
inline

Definition at line 8906 of file Chara.cs.

8907 {
8908 if (a > 0)
8909 {
8910 if (ResistLv(962) > 0 && EClass.rnd(ResistLv(962) + 1) != 0)
8911 {
8912 return;
8913 }
8914 int num = Evalue(412);
8915 if (num != 0)
8916 {
8917 float num2 = (float)a * 100f / (float)Mathf.Max(100 + num * 2, 10);
8918 a = (int)num2 + ((EClass.rndf(1f) > num2 % 1f) ? 1 : 0);
8919 }
8920 }
8921 if (a == 0)
8922 {
8923 return;
8924 }
8925 int num3 = (corruption + a) / 100 - corruption / 100;
8926 for (int i = 0; i < Mathf.Abs(num3); i++)
8927 {
8928 if (!MutateRandom((num3 > 0) ? 1 : (-1), 100, ether: true))
8929 {
8930 break;
8931 }
8932 }
8933 corruption += a;
8934 int num4 = 0;
8935 foreach (Element value in elements.dict.Values)
8936 {
8937 if (value.source.category == "ether")
8938 {
8939 num4 += value.Value;
8940 }
8941 }
8942 if (num4 > 0 && IsPC)
8943 {
8944 Tutorial.Reserve("ether");
8945 }
8946 corruption = num4 * 100 + corruption % 100;
8947 }
bool MutateRandom(int vec=0, int tries=100, bool ether=false, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:9015
int corruption
Definition: Chara.cs:362
static float rndf(float a)
Definition: EClass.cs:79

References Tutorial.Reserve(), EClass.rnd(), EClass.rndf(), Element.source, and Element.Value.

Referenced by Card.DamageHP(), and CoreDebug.Fix_EtherDisease().

◆ ModHeight()

void Chara.ModHeight ( int  a)
inline

Definition at line 8866 of file Chara.cs.

8867 {
8868 int height = bio.height;
8869 height = height * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
8870 if (height < 1)
8871 {
8872 height = 1;
8873 }
8874 if (height != bio.height)
8875 {
8876 bio.height = height;
8877 Say((a > 0) ? "height_gain" : "height_lose", this);
8878 }
8879 }
int height
Definition: Biography.cs:53

◆ ModTempElement()

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

Definition at line 9209 of file Chara.cs.

9210 {
9211 if (a < 0 && !naturalDecay && HasElement(EClass.sources.elements.alias["sustain_" + EClass.sources.elements.map[ele].alias]?.id ?? 0))
9212 {
9213 return;
9214 }
9215 if (tempElements == null)
9216 {
9218 tempElements.SetParent(this);
9219 }
9220 if (a > 0 && tempElements.Base(ele) > a)
9221 {
9222 a = a * 100 / (200 + (tempElements.Base(ele) - a) * 10);
9223 }
9224 Element element = tempElements.ModBase(ele, a);
9225 if (element.vBase == 0)
9226 {
9227 tempElements.Remove(element.id);
9228 if (tempElements.dict.Count == 0)
9229 {
9230 tempElements = null;
9231 }
9232 }
9233 }
void SetParent(Card c)
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 8881 of file Chara.cs.

8882 {
8883 if (a == 0)
8884 {
8885 return;
8886 }
8887 int weight = bio.weight;
8888 int height = bio.height;
8889 int num = height * height * 18 / 25000;
8890 int num2 = height * height * 24 / 10000;
8891 if (ignoreLimit || (weight > num && weight < num2))
8892 {
8893 weight = weight * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
8894 if (weight < 1)
8895 {
8896 weight = 1;
8897 }
8898 if (weight != bio.weight)
8899 {
8900 bio.weight = weight;
8901 Say((a > 0) ? "weight_gain" : "weight_lose", this);
8902 }
8903 }
8904 }
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 2312 of file Chara.cs.

2313 {
2314 if (!newPoint.sourceBlock.tileType.IsBlockPass && (!checkWall || (Dist(newPoint) <= 1 && CanMoveTo(newPoint, allowDestroyPath: false))) && _Move(newPoint, MoveType.Force) == MoveResult.Success && ai.Current.CancelWhenMoved)
2315 {
2316 ai.Current.TryCancel(c);
2317 }
2318 }
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:2446

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

3136 {
3137 MoveHome(EClass.game.world.FindZone(id), x, z);
3138 }
void MoveHome(string id, int x=-1, int z=-1)
Definition: Chara.cs:3135
new World world
Definition: Game.cs:173

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

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

◆ MoveHome() [2/2]

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

Definition at line 3140 of file Chara.cs.

3141 {
3142 if (isDead)
3143 {
3144 Revive();
3145 }
3146 else
3147 {
3148 Cure(CureType.Death);
3149 }
3150 CureCondition<ConSuspend>();
3151 if (IsPCParty)
3152 {
3154 }
3155 FactionBranch factionBranch = homeBranch;
3156 if (x == -1)
3157 {
3158 x = 50;
3159 }
3160 if (z == -1)
3161 {
3162 z = 50;
3163 }
3164 Point point = new Point(x, z);
3165 if (zone.IsActiveZone)
3166 {
3167 point = point.GetNearestPoint(allowBlock: false, allowChara: false);
3168 }
3169 zone.AddCard(this, point);
3170 SetHomeZone(zone);
3171 global.transition = new ZoneTransition
3172 {
3173 state = ZoneTransition.EnterState.Dead,
3174 x = point.x,
3175 z = point.z
3176 };
3177 orgPos = new Point(x, z);
3178 if (factionBranch != null)
3179 {
3181 factionBranch.policies.Validate();
3182 }
3183 }
void SetHomeZone(Zone zone)
Definition: Chara.cs:1234
void RefreshWorkElements(ElementContainer parent=null)
Definition: Chara.cs:8175
PolicyManager policies
bool IsActiveZone
Definition: Zone.cs:486

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

2295 {
2296 List<Point> list = new List<Point>();
2297 pos.ForeachNeighbor(delegate(Point p)
2298 {
2299 list.Add(p.Copy());
2300 });
2301 list.Shuffle();
2302 foreach (Point item in list)
2303 {
2304 if (!item.Equals(pos) && !item.HasChara && TryMove(item) == MoveResult.Success)
2305 {
2306 return true;
2307 }
2308 }
2309 return false;
2310 }
void ForeachNeighbor(Action< Point > action, bool diagonal=true)
Definition: Point.cs:1361

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

Referenced by AI_Idle.Run().

◆ MoveRandom()

bool Chara.MoveRandom ( )
inline

Definition at line 2284 of file Chara.cs.

2285 {
2286 Point randomNeighbor = pos.GetRandomNeighbor();
2287 if (!randomNeighbor.Equals(pos) && !randomNeighbor.HasChara && HasAccess(randomNeighbor))
2288 {
2289 return TryMove(randomNeighbor) == MoveResult.Success;
2290 }
2291 return false;
2292 }

References Point.Equals(), Point.GetRandomNeighbor(), HasAccess(), Point.HasChara, Card.pos, 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 3023 of file Chara.cs.

3024 {
3025 if (z == currentZone)
3026 {
3027 return;
3028 }
3029 if (HasCondition<ConInvulnerable>())
3030 {
3031 RemoveCondition<ConInvulnerable>();
3032 }
3033 if (IsPC)
3034 {
3035 EClass.player.nextZone = z;
3037 {
3040 {
3041 if (EClass.player.returnInfo != null)
3042 {
3043 EClass.player.returnInfo.turns += 5;
3044 }
3046 {
3047 EClass.game.Save(isAutoSave: true);
3048 }
3049 }
3050 EClass.player.deathZoneMove = false;
3051 }
3053 if (currentZone.instance != null)
3054 {
3056 z = EClass.game.spatials.Find(instance.uidZone) ?? EClass.pc.homeZone;
3057 transition = new ZoneTransition
3058 {
3059 state = instance.ReturnState,
3060 x = instance.x,
3061 z = instance.z
3062 };
3063 instance.OnLeaveZone();
3064 Debug.Log(z);
3065 }
3066 EInput.Consume(consumeAxis: true);
3067 EClass.player.uidLastZone = currentZone.uid;
3069 {
3071 {
3072 Msg.Say("enterZone", z.Name);
3073 }
3074 else
3075 {
3076 if (z.IsRegion)
3077 {
3078 Msg.Say("leaveZone", currentZone.Name);
3079 }
3080 else if (z.id != currentZone.id)
3081 {
3082 Msg.Say("enterZone", z.Name);
3083 }
3084 EClass.player.lastZonePos = pos.Copy();
3085 }
3086 EClass.player.lastTransition = transition;
3087 }
3088 foreach (Chara item in EClass._map.charas.Where((Chara c) => c.IsPCPartyMinion && c.master != EClass.pc).ToList())
3089 {
3091 }
3092 EClass.player.listSummon = EClass._map.charas.Where((Chara c) => c.c_uidMaster != 0 && c.FindMaster() == EClass.pc && c.c_minionType == MinionType.Default).ToList();
3093 foreach (Chara item2 in EClass.player.listSummon)
3094 {
3095 EClass._zone.RemoveCard(item2);
3096 }
3097 }
3098 if (party != null && party.leader == this)
3099 {
3100 foreach (Chara member in party.members)
3101 {
3102 if (member != this && !member.isDead && member.parent is Zone)
3103 {
3104 member.MoveZone(z);
3105 }
3106 }
3107 }
3108 if (global == null)
3109 {
3110 Debug.Log(base.Name);
3111 return;
3112 }
3113 transition.uidLastZone = currentZone?.uid ?? 0;
3114 global.transition = transition;
3115 if (z.IsActiveZone)
3116 {
3117 Point spawnPos = z.GetSpawnPos(this);
3118 global.transition = null;
3119 if (IsPC)
3120 {
3121 EClass.player.lastTransition = null;
3122 }
3123 z.AddCard(this, spawnPos);
3124 if (IsBranchMember())
3125 {
3127 }
3128 }
3129 else
3130 {
3131 z.AddCard(this);
3132 }
3133 }
MinionType c_minionType
Definition: Card.cs:948
bool IsBranchMember()
Definition: Chara.cs:5933
GlobalData global
Definition: Chara.cs:73
Chara FindMaster()
Definition: Chara.cs:2093
bool ignoreAutoSave
Definition: CoreDebug.cs:125
bool Save(bool isAutoSave=false, bool silent=false)
Definition: Game.cs:960
RoomManager rooms
Definition: Map.cs:31
Chara leader
Definition: Party.cs:30
bool deathZoneMove
Definition: Player.cs:970
List< Chara > listSummon
Definition: Player.cs:1022
ReturnInfo returnInfo
Definition: Player.cs:673
bool simulatingZone
Definition: Player.cs:980
void AssignCharas()
Definition: RoomManager.cs:39
int uid
Definition: Spatial.cs:70
string id
Definition: Spatial.cs:13
virtual ZoneTransition.EnterState ReturnState
Definition: ZoneInstance.cs:26
virtual void OnLeaveZone()
Definition: ZoneInstance.cs:36
virtual bool WillAutoSave
Definition: Zone.cs:258
Point GetSpawnPos(Chara c, ZoneTransition.EnterState destState=ZoneTransition.EnterState.Auto)
Definition: Zone.cs:1282

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

3016 {
3018 {
3019 state = state
3020 });
3021 }

◆ MutateRandom()

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

Definition at line 9015 of file Chara.cs.

9016 {
9017 if (!ether && vec >= 0 && HasElement(406) && EClass.rnd(5) != 0)
9018 {
9019 Say("resistMutation", this);
9020 return false;
9021 }
9022 IEnumerable<SourceElement.Row> ie = EClass.sources.elements.rows.Where((SourceElement.Row a) => a.category == (ether ? "ether" : "mutation"));
9023 for (int i = 0; i < tries; i++)
9024 {
9025 SourceElement.Row row = ie.RandomItem();
9026 if (i == 0 && vec < 0 && ether && base.c_corruptionHistory != null && base.c_corruptionHistory.Count > 0)
9027 {
9028 row = EClass.sources.elements.map[base.c_corruptionHistory.LastItem()];
9029 base.c_corruptionHistory.RemoveAt(base.c_corruptionHistory.Count - 1);
9030 if (base.c_corruptionHistory.Count == 0)
9031 {
9032 base.c_corruptionHistory = null;
9033 }
9034 }
9035 Element element = elements.GetElement(row.id);
9036 int num = 1;
9037 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))
9038 {
9039 continue;
9040 }
9041 if (element == null && !row.aliasParent.IsEmpty() && elements.Has(row.aliasParent))
9042 {
9043 row = EClass.sources.elements.alias[row.aliasParent];
9044 element = elements.GetElement(row.id);
9045 }
9046 bool flag = row.tag.Contains("neg");
9047 if (vec > 0)
9048 {
9049 if ((state >= BlessedState.Blessed && flag) || (state <= BlessedState.Cursed && !flag))
9050 {
9051 continue;
9052 }
9053 }
9054 else if (vec < 0 && ((state >= BlessedState.Blessed && !flag) || (state <= BlessedState.Cursed && flag)))
9055 {
9056 continue;
9057 }
9058 bool flag2 = true;
9059 if (element != null)
9060 {
9061 num = element.Value + ((vec != 0) ? vec : ((EClass.rnd(2) == 0) ? 1 : (-1)));
9062 if (num > element.source.max)
9063 {
9064 num = element.source.max - 1;
9065 }
9066 flag = (flag && num > element.Value) || (!flag && num < element.Value);
9067 flag2 = num > element.Value;
9068 if (vec > 0 && !flag2)
9069 {
9070 continue;
9071 }
9072 }
9073 Say(flag2 ? "mutation_gain" : "mutation_loose", this);
9074 SetFeat(row.id, num);
9075 if (flag2 && ether)
9076 {
9077 if (base.c_corruptionHistory == null)
9078 {
9079 base.c_corruptionHistory = new List<int>();
9080 }
9081 base.c_corruptionHistory.Add(row.id);
9082 if (IsPCFaction)
9083 {
9084 Element element2 = elements.GetElement(row.id);
9085 WidgetPopText.Say("popEther".lang(element2.Name, base.Name));
9086 }
9088 {
9089 EClass.player.flags.gotEtherDisease = true;
9090 Thing thing = ThingGen.Create("parchment");
9091 thing.SetStr(53, "letter_ether");
9092 Thing thing2 = ThingGen.Create("1165");
9093 thing2.SetBlessedState(BlessedState.Normal);
9094 Thing p = ThingGen.CreateParcel(null, thing2, thing);
9096 }
9097 }
9098 if (EClass.core.IsGameStarted && pos != null)
9099 {
9100 PlaySound(ether ? "mutation_ether" : "mutation");
9101 PlayEffect("mutation");
9103 Say(row.GetText(flag ? "textDec" : "textInc", returnNull: true) ?? row.alias, this);
9104 }
9105 return true;
9106 }
9107 Say("nothingHappens");
9108 return false;
9109 }
void SetStr(int id, string value=null)
Definition: BaseCard.cs:63
virtual void SetBlessedState(BlessedState s)
Definition: Card.cs:3572
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:354
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.

◆ OnBanish()

void Chara.OnBanish ( )
inline

Definition at line 1240 of file Chara.cs.

1241 {
1242 if (!IsGlobal)
1243 {
1244 return;
1245 }
1246 memberType = FactionMemberType.Default;
1247 UniqueData uniqueData = base.c_uniqueData;
1248 if (uniqueData != null)
1249 {
1250 Debug.Log(uniqueData.uidZone + "/" + EClass.game.spatials.map.ContainsKey(uniqueData.uidZone) + "/" + uniqueData.x + "/" + uniqueData.y);
1251 }
1252 if (uniqueData != null && EClass.game.spatials.map.ContainsKey(uniqueData.uidZone))
1253 {
1254 MoveHome(EClass.game.spatials.map[uniqueData.uidZone] as Zone, uniqueData.x, uniqueData.y);
1255 return;
1256 }
1257 Zone z = EClass.game.spatials.Find("somewhere");
1258 if (trait is TraitAdventurer)
1259 {
1260 z = EClass.world.region.ListTowns().RandomItem();
1261 SetHomeZone(z);
1262 }
1263 MoveZone(z, ZoneTransition.EnterState.RandomVisit);
1264 }
List< Zone > ListTowns()
Definition: Region.cs:231
GlobalSpatialList map
int uidZone
Definition: UniqueData.cs:12

References Debug, SpatialManager.Find(), EClass.game, IsGlobal, Region.ListTowns(), SpatialManager.map, memberType, MoveHome(), MoveZone(), World.region, SetHomeZone(), Game.spatials, 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 1303 of file Chara.cs.

1304 {
1305 if (source.job == "*r")
1306 {
1307 base.c_idJob = EClass.sources.jobs.rows.Where((SourceJob.Row j) => j.playable < 4).RandomItem().id;
1308 }
1309 if (bp.idJob != null)
1310 {
1311 base.c_idJob = bp.idJob;
1312 }
1313 if (bp.idRace != null)
1314 {
1315 base.c_idRace = bp.idRace;
1316 }
1317 }
CardBlueprint bp
Definition: Card.cs:73
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 1319 of file Chara.cs.

1320 {
1321 if (source.tag.Contains("boss"))
1322 {
1323 bossText = true;
1324 }
1325 int num = ((bp.lv != -999) ? bp.lv : base.LV);
1326 if (trait.AdvType == TraitChara.Adv_Type.Adv || trait.AdvType == TraitChara.Adv_Type.Adv_Fairy)
1327 {
1328 if (ListAdvRace.Count == 0)
1329 {
1330 ListAdvRace = EClass.sources.races.rows.Where((SourceRace.Row a) => a.playable <= 1 && a.id != "fairy").ToList();
1331 ListAdvJob = EClass.sources.jobs.rows.Where((SourceJob.Row a) => a.playable <= 4).ToList();
1332 }
1333 if (trait.AdvType == TraitChara.Adv_Type.Adv)
1334 {
1335 base.c_idRace = ListAdvRace.RandomItem().id;
1336 }
1337 base.c_idJob = ListAdvJob.RandomItem().id;
1338 _race = null;
1339 _job = null;
1340 num = 10 + EClass.rnd(40);
1341 }
1342 bio = new Biography();
1343 bio.Generate(this);
1344 if (source.idActor.Length != 0 && source.idActor[0] == "pcc" && pccData == null)
1345 {
1346 pccData = PCCData.Create(IDPCCBodySet);
1347 if (source.idActor.Length > 2)
1348 {
1349 pccData.SetPart("body", IDPCCBodySet, source.idActor[2]);
1350 }
1351 else
1352 {
1353 pccData.Randomize(IDPCCBodySet);
1354 }
1355 }
1356 if (source.mainElement.Length != 0)
1357 {
1358 int _genLv = Mathf.Min(genLv, 100);
1359 List<Tuple<string, int, int>> list = new List<Tuple<string, int, int>>();
1360 string[] mainElement = source.mainElement;
1361 for (int i = 0; i < mainElement.Length; i++)
1362 {
1363 string[] array = mainElement[i].Split('/');
1364 SourceElement.Row row = EClass.sources.elements.alias["ele" + array[0]];
1365 int num2 = source.LV * row.eleP / 100;
1366 if (list.Count == 0 || num2 < _genLv || array[0] == bp.idEle)
1367 {
1368 list.Add(new Tuple<string, int, int>(array[0], (array.Length > 1) ? int.Parse(array[1]) : 0, num2));
1369 }
1370 }
1371 Tuple<string, int, int> tuple = list.RandomItemWeighted((Tuple<string, int, int> a) => 10000 / (100 + (_genLv - a.Item3) * 25));
1372 if (!bp.idEle.IsEmpty())
1373 {
1374 tuple = list.Where((Tuple<string, int, int> a) => a.Item1 == bp.idEle).FirstOrDefault() ?? tuple;
1375 }
1376 SetMainElement(tuple.Item1, (tuple.Item2 == 0) ? 10 : tuple.Item2, elemental: true);
1377 if (list.Count >= 2)
1378 {
1379 num = tuple.Item3 + base.LV - source.LV;
1380 }
1381 }
1382 if (source.name == "*r")
1383 {
1384 base.c_altName = NameGen.getRandomName();
1385 }
1386 if (source.GetText("aka") == "*r" || trait.UseRandomAlias)
1387 {
1388 _alias = AliasGen.GetRandomAlias();
1389 }
1390 happiness = EClass.rnd(100);
1391 contribution = EClass.rnd(100);
1392 RerollHobby();
1393 _idTimeTable = ((EClass.rnd(5) == 0) ? 1 : 0);
1394 ApplyRace();
1395 ApplyJob();
1396 if (num != source.LV)
1397 {
1398 SetLv(num);
1399 }
1400 if (base.LV > 5 && race.id == "mutant")
1401 {
1402 for (int j = 0; j < Mathf.Min(1 + base.LV / 5, 22); j++)
1403 {
1404 SetFeat(1644, j + 1);
1405 }
1406 }
1407 InitStats();
1408 body.SetOwner(this);
1410 if (race.EQ.Length != 0)
1411 {
1412 TryRestock(onCreate: true);
1413 }
1414 switch (id)
1415 {
1416 case "golem_wood":
1417 ChangeMaterial("pine");
1418 break;
1419 case "golem_steel":
1420 ChangeMaterial("steel");
1421 break;
1422 case "golem_gold":
1423 ChangeMaterial("gold");
1424 break;
1425 case "dodo":
1426 base.idSkin = EClass.rnd(4);
1427 break;
1428 case "putty_snow":
1429 if (EClass.rnd(100) == 0 || EClass.debug.enable)
1430 {
1431 base.idSkin = EClass.rnd(4);
1432 }
1433 break;
1434 case "snail":
1435 base.idSkin = 5;
1436 break;
1437 case "olderyoungersister":
1438 base.idSkin = 1;
1439 break;
1440 case "sister_undead":
1441 case "dog":
1442 case "cat":
1443 base.idSkin = EClass.rnd(sourceCard.tiles.Length);
1444 if (id == "sister_undead" && EClass.rnd(10) == 0)
1445 {
1447 if (row2 != null && (!EClass.player.doneBackers.Contains(row2.id) || EClass.core.config.test.ignoreBackerDestoryFlag))
1448 {
1449 ApplyBacker(row2.id);
1450 }
1451 }
1452 break;
1453 }
1454 if (HasTag(CTAG.random_color))
1455 {
1456 DyeRandom();
1457 }
1458 SetAI(new NoGoal());
1459 if (!source.faith.IsEmpty())
1460 {
1461 SetFaith(source.faith);
1462 }
1463 else if (EClass.game.activeZone != null && EClass.game.activeZone.id == "foxtown")
1464 {
1466 }
1467 else if (EClass.game.activeZone != null && EClass.game.activeZone.id == "foxtown_nefu")
1468 {
1470 }
1471 else
1472 {
1473 SetFaith(EClass.game.religions.GetRandomReligion(onlyJoinable: true, EClass.rnd(10) == 0));
1474 }
1475 _affinity = 0;
1476 interest = 100;
1478 Refresh();
1479 stamina.value = stamina.max;
1480 mana.value = mana.max;
1481 isCreated = true;
1482 }
static int indexSister
void Generate(Chara c)
Definition: Biography.cs:308
void DyeRandom()
Definition: Card.cs:5262
void ApplyBacker(int bid)
Definition: Card.cs:6193
void SetOwner(Chara chara, bool deserialized=false)
Definition: CharaBody.cs:18
string IDPCCBodySet
Definition: Chara.cs:476
int _affinity
Definition: Chara.cs:288
void SetMainElement(string id, int v=0, bool elemental=false)
Definition: Chara.cs:1804
int happiness
Definition: Chara.cs:105
int contribution
Definition: Chara.cs:18
void CalculateMaxStamina()
Definition: Chara.cs:1736
bool isCreated
Definition: Chara.cs:131
int _idTimeTable
Definition: Chara.cs:326
void TryRestock(bool onCreate)
Definition: Chara.cs:4295
static List< SourceRace.Row > ListAdvRace
Definition: Chara.cs:151
void InitStats(bool onDeserialize=false)
Definition: Chara.cs:8392
bool bossText
Definition: Chara.cs:139
static List< SourceJob.Row > ListAdvJob
Definition: Chara.cs:153
bool ignoreBackerDestoryFlag
Definition: CoreConfig.cs:549
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:129

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

◆ OnDeserialized()

override void Chara.OnDeserialized ( )
inlineprotectedvirtual

Reimplemented from Card.

Definition at line 1136 of file Chara.cs.

1137 {
1138 isCreated = true;
1139 _cbits1.Bits = (uint)_cints[0];
1140 InitStats(onDeserialize: true);
1141 body.SetOwner(this, deserialized: true);
1142 elements.ApplyElementMap(base.uid, SourceValueType.Chara, job.elementMap, base.DefaultLV);
1143 elements.ApplyElementMap(base.uid, SourceValueType.Chara, race.elementMap, base.DefaultLV);
1144 if (global != null && global.goal != null)
1145 {
1146 global.goal.SetOwner(this);
1147 }
1148 if (IsPCC)
1149 {
1150 pccData.state = (base.isCensored ? PCCState.Naked : PCCState.Normal);
1151 }
1152 if (tempElements != null)
1153 {
1154 tempElements.SetParent(this);
1155 }
1156 UpdateAngle();
1158 Refresh();
1159 if (source.tag.Contains("boss"))
1160 {
1161 bossText = true;
1162 }
1163 sharedCheckTurn = EClass.rnd(200);
1164 }
int sharedCheckTurn
Definition: Chara.cs:115
void UpdateAngle()
Definition: Chara.cs:3266
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 7602 of file Chara.cs.

7603 {
7604 Say("give_erohon", this);
7605 AddCondition<ConParalyze>(50, force: true);
7606 AddCondition<ConConfuse>(50, force: true);
7607 AddCondition<ConFear>(1000, force: true);
7608 ModAffinity(EClass.pc, 100);
7609 t.Destroy();
7610 Talk("pervert");
7611 }

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

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

◆ OnInsulted()

void Chara.OnInsulted ( )
inline

Definition at line 7408 of file Chara.cs.

7409 {
7410 if (!isDead)
7411 {
7412 if (HasElement(1231))
7413 {
7414 Talk("insulted");
7415 AddCondition<ConEuphoric>();
7416 }
7417 else if (EClass.rnd(20) == 0)
7418 {
7419 SetFeat(1231, 1, msg: true);
7420 }
7421 }
7422 }

References EClass.rnd().

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

◆ OnSerializing()

override void Chara.OnSerializing ( )
inlineprotectedvirtual

Reimplemented from Card.

Definition at line 1121 of file Chara.cs.

1122 {
1123 if (enemy != null)
1124 {
1125 SetInt(55, enemy.uid);
1126 }
1127 _cints[0] = (int)_cbits1.Bits;
1128 List<BodySlot> slots = body.slots;
1129 rawSlots = new int[slots.Count];
1130 for (int i = 0; i < slots.Count; i++)
1131 {
1132 rawSlots[i] = slots[i].elementId;
1133 }
1134 }
List< BodySlot > slots
Definition: CharaBody.cs:8
int[] rawSlots
Definition: Chara.cs:70
BitArray32 _cbits1
Definition: Chara.cs:81
uint Bits
Definition: BitArray32.cs:6

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

◆ OnSleep() [1/2]

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

Definition at line 8840 of file Chara.cs.

8841 {
8842 if (days < 1)
8843 {
8844 days = 1;
8845 }
8846 int num = power * days;
8847 if (stamina.value < 0)
8848 {
8849 stamina.Set(1);
8850 }
8851 HealHP(num);
8852 stamina.Mod(10 + 25 * num / 100 * (100 + elements.GetFeatRef(1642)) / 100);
8853 mana.Mod(num);
8854 if (IsPCFaction)
8855 {
8856 hunger.Mod(20);
8857 }
8858 sleepiness.Set(0);
8859 if (!IsMinion)
8860 {
8861 interest = 100;
8862 }
8863 Cure(CureType.Sleep, power);
8864 }
virtual void HealHP(int a, HealSource origin=HealSource.None)
Definition: Card.cs:3680
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 8825 of file Chara.cs.

8826 {
8827 TraitPillow traitPillow = pos.FindThing<TraitPillow>();
8828 int num = bed?.Power ?? 20;
8829 if (traitPillow != null)
8830 {
8831 num += traitPillow.owner.Power / 2;
8832 }
8833 if (bed != null)
8834 {
8835 num += bed.Evalue(750) * 5;
8836 }
8837 OnSleep(num, days);
8838 }
void OnSleep(Thing bed=null, int days=1)
Definition: Chara.cs:8825
Thing FindThing(Func< Thing, bool > func)
Definition: Point.cs:1104

References bed.

Referenced by LayerSleep.Advance().

◆ ParseBodySlot()

int Chara.ParseBodySlot ( string  s)
inlineprivate

Definition at line 1903 of file Chara.cs.

1904 {
1905 return s switch
1906 {
1907 "é ­" => 30,
1908 "首" => 31,
1909 "体" => 32,
1910 "背" => 33,
1911 "手" => 35,
1912 "指" => 36,
1913 "è…•" => 34,
1914 "è…°" => 37,
1915 "足" => 39,
1916 _ => -1,
1917 };
1918 }

Referenced by ApplyRace(), and ResetBody().

◆ PerformWork()

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

Definition at line 8350 of file Chara.cs.

8351 {
8352 Hobby hobby = new Hobby();
8353 hobby.id = session.id;
8354 WorkSummary workSummary = _workSummary;
8355 hobby.GetAI(this).OnPerformWork(IsRealTime);
8356 if (!isHobby)
8357 {
8358 workSummary.progress += EClass.rnd(5) + 5;
8359 }
8360 int num = PerformWork(hobby, 0, isHobby);
8361 int num2 = PerformWork(hobby, 1, isHobby);
8362 int num3 = PerformWork(hobby, 2, isHobby);
8363 int num4 = PerformWork(hobby, 3, isHobby);
8364 workSummary.money += num;
8365 workSummary.food += num2;
8366 workSummary.knowledge += num3;
8367 workSummary.material += num4;
8368 int PerformWork(Hobby work, int idx, bool isHobby)
8369 {
8370 if (idx >= work.source.resources.Length)
8371 {
8372 return 0;
8373 }
8374 int num5 = work.source.resources[idx];
8375 int num6 = num5;
8376 num5 = Rand.Range(num5 * (100 - work.source.resources[idx]) / 100, num5);
8377 num5 = num5 * (isHobby ? 50 : 100) * session.efficiency / 10000;
8378 if (num6 > 0 && num5 <= 0)
8379 {
8380 num5 = 1;
8381 }
8382 return num5;
8383 }
8384 }
virtual void OnPerformWork(bool realtime)
Definition: AIWork.cs:145
void PerformWork(WorkSession session, bool isHobby=false, bool IsRealTime=false)
Definition: Chara.cs:8350
AIWork GetAI(Chara c)
Definition: Hobby.cs:11
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 3920 of file Chara.cs.

3921 {
3922 if (t.trait is TraitCard && t.isNew && EClass.game.config.autoCollectCard && !t.c_idRefCard.IsEmpty())
3923 {
3925 return t;
3926 }
3927 if (t.parent == this)
3928 {
3929 return t;
3930 }
3931 t = TryPoisonPotion(t);
3932 ThingContainer.DestData dest = things.GetDest(t, tryStack);
3933 if (!dest.IsValid)
3934 {
3935 if (t.parent != EClass._zone)
3936 {
3937 if (IsPC)
3938 {
3939 Say("backpack_full_drop", t);
3940 SE.Drop();
3941 }
3942 return EClass._zone.AddCard(t, pos).Thing;
3943 }
3944 if (IsPC)
3945 {
3946 Say("backpack_full", t);
3947 }
3948 return t;
3949 }
3950 if (dest.stack != null)
3951 {
3952 if (msg)
3953 {
3954 PlaySound("pick_thing");
3955 Say("pick_thing", this, t);
3956 }
3957 t.TryStackTo(dest.stack);
3958 return dest.stack;
3959 }
3960 TryAbsorbRod(t);
3961 if (msg)
3962 {
3963 PlaySound("pick_thing");
3964 Say("pick_thing", this, t);
3965 }
3967 return dest.container.AddThing(t, tryStack);
3968 }
bool isNew
Definition: Card.cs:454
bool TryStackTo(Thing to)
Definition: Card.cs:3144
string c_idRefCard
Definition: Card.cs:1637
void TryReservePickupTutorial(Thing t)
Definition: Chara.cs:4014
Thing TryPoisonPotion(Thing t)
Definition: Chara.cs:3970
void TryAbsorbRod(Thing t)
Definition: Chara.cs:3984
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(), CoreDebug.Fix_LoytelDebt(), FactionBranch.GetDailyIncome(), FortuneRollData.GetPrize(), TraitDrink.OnBlend(), InvOwner.OnClick(), ContentCodex.OnClickGetCard(), AI_UseCrafter.OnEnd(), AI_Fish.ProgressFish.OnProgressComplete(), ConSleep.OnRemoved(), AM_Blueprint.OnSave(), InvOwner.OnShiftClick(), QuestDebt.OnStart(), QuestDeliver.OnStart(), TraitGiftJure.OnUse(), TraitGiftNewYear.OnUse(), TraitGiftPack.OnUse(), TraitParcel.OnUse(), TraitPlamoBox.OnUse(), TraitPotionEmpty.OnUse(), InvOwnerDeliver.PayBill(), ActDreamBug.Perform(), ActPick.Perform(), GrowSystem.PopHarvest(), ActEffect.Proc(), InvOwner.Transaction.Process(), Map.PutAway(), InvOwner.PutBack(), 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 4136 of file Chara.cs.

4137 {
4138 if (held == null)
4139 {
4140 return;
4141 }
4142 Card card = held;
4143 if (IsPC && held.invY == 1)
4144 {
4145 WidgetHotbar.dirtyCurrentItem = true;
4147 held = null;
4148 return;
4149 }
4150 if (held.isChara)
4151 {
4152 DropHeld();
4153 return;
4154 }
4156 {
4157 Say("canOnlyCarry", held);
4158 DropHeld();
4159 return;
4160 }
4161 bool flag = held != things.TryStack(held.Thing);
4162 if (!flag && things.IsOverflowing())
4163 {
4164 if (IsPC)
4165 {
4166 Say("backpack_full_drop", held);
4167 SE.Drop();
4168 }
4169 DropHeld();
4170 return;
4171 }
4172 if (msg)
4173 {
4174 PlaySound("pick_thing");
4175 Say("pick_held", this, card);
4176 if (IsPC && card.id == "statue_weird")
4177 {
4178 Say("statue_pick");
4179 }
4180 }
4181 if (IsPC)
4182 {
4183 WidgetHotbar.dirtyCurrentItem = true;
4184 if (!flag)
4185 {
4187 if (held.GetRootCard() != EClass.pc)
4188 {
4189 Pick(held.Thing, msg: false);
4190 }
4191 }
4192 }
4193 held = null;
4194 }
int invY
Definition: Card.cs:1831
bool IsHotItem
Definition: Card.cs:115
Card DropHeld(Point dropPos=null)
Definition: Chara.cs:4213
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 3900 of file Chara.cs.

3901 {
3902 if (num != 0)
3903 {
3904 PickOrDrop(p, ThingGen.Create(idThing, idMat).SetNum(num), msg);
3905 }
3906 }
void PickOrDrop(Point p, string idThing, int idMat=-1, int num=1, bool msg=true)
Definition: Chara.cs:3900

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

Referenced by Map.MineObj(), 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 3908 of file Chara.cs.

3909 {
3910 if (things.GetDest(t).IsValid)
3911 {
3912 Pick(t, msg);
3913 }
3914 else
3915 {
3916 EClass._zone.AddCard(t, p);
3917 }
3918 }

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

◆ Refresh()

void Chara.Refresh ( bool  calledRecursive = false)
inline

Definition at line 1504 of file Chara.cs.

1505 {
1506 if (ride != null)
1507 {
1508 ride.Refresh(calledRecursive: true);
1509 }
1510 hasTelepathy = false;
1511 isWet = false;
1512 _isLevitating = HasElement(401) || (ride != null && ride._isLevitating);
1514 base.isHidden = HasElement(415);
1515 foreach (Condition condition in conditions)
1516 {
1517 condition.OnRefresh();
1518 }
1519 if (isWet)
1520 {
1521 base.isHidden = false;
1522 }
1523 SetDirtySpeed();
1524 if (host != null && !calledRecursive)
1525 {
1526 host.Refresh(calledRecursive: true);
1527 }
1528 }
virtual void OnRefresh()
void Refresh(bool calledRecursive=false)
Definition: Chara.cs:1504
bool isWet
Definition: Chara.cs:137

References _isLevitating, canSeeInvisible, conditions, Card.HasElement(), hasTelepathy, host, isWet, BaseCondition.OnRefresh(), Refresh(), ride, and SetDirtySpeed().

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

9167 {
9168 if (faithElements != null)
9169 {
9171 }
9173 if (idFaith == "eyth" && !HasElement(1228))
9174 {
9175 return;
9176 }
9177 SourceReligion.Row row = EClass.sources.religions.map.TryGetValue(idFaith);
9178 if (row == null)
9179 {
9180 return;
9181 }
9183 SourceElement.Row row2 = EClass.sources.elements.alias.TryGetValue("featGod_" + row.id + "1");
9184 if (row2 != null)
9185 {
9186 faithElements.SetBase(row2.id, 1);
9187 }
9188 if (!HasCondition<ConExcommunication>())
9189 {
9190 int[] array = row.elements;
9191 int num = GetPietyValue() * (120 + Evalue(1407) * 15) / 100;
9192 for (int i = 0; i < array.Length; i += 2)
9193 {
9194 int num2 = array[i + 1] * num / 50;
9195 if (array[i] == 79)
9196 {
9197 num2 = EClass.curve(num2, array[i + 1] * 2, 10, 50);
9198 }
9199 if (num2 >= 20 && array[i] >= 950 && array[i] < 970)
9200 {
9201 num2 = 20;
9202 }
9203 faithElements.SetBase(array[i], Mathf.Max(num2, 1));
9204 }
9205 }
9207 }
string idFaith
Definition: Chara.cs:216
ElementContainer faithElements
Definition: Chara.cs:38
int GetPietyValue()
Definition: Chara.cs:9157
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 1614 of file Chara.cs.

1615 {
1616 if (ride != null && !ride.IsDeadOrSleeping)
1617 {
1619 _Speed = ride._Speed;
1620 }
1621 else if (host != null)
1622 {
1623 if (host.ride == this)
1624 {
1625 _Speed = Evalue(79);
1626 _Speed = _Speed * 100 / Mathf.Clamp(100 + _Speed * ((!race.tag.Contains("noRide")) ? 1 : 5) - base.STR - host.EvalueRiding() * 2 - (race.tag.Contains("ride") ? 50 : 0), 100, 1000);
1627 }
1628 else
1629 {
1630 _Speed = (Evalue(79) + host.Evalue(79)) / 2;
1631 }
1632 }
1633 else
1634 {
1635 _Speed = Evalue(79) + Evalue(407) / 2;
1636 }
1637 if (body.GetSlot(37, onlyEmpty: false)?.thing != null && HasElement(1209))
1638 {
1639 _Speed -= 25;
1640 }
1641 if (parasite != null)
1642 {
1643 _Speed = _Speed * 100 / Mathf.Clamp(120 + parasite.LV * 2 - base.STR - Evalue(227) * 2, 100, 1000);
1644 }
1645 if (_Speed < elements.ValueWithoutLink(79) / 3)
1646 {
1648 info?.AddText("minSpeed".lang((elements.ValueWithoutLink(79) / 3).ToString() ?? ""));
1649 }
1650 int num = 100;
1651 if (IsPCFaction)
1652 {
1653 switch (burden.GetPhase())
1654 {
1655 case 1:
1656 num -= 10;
1657 info?.AddFix(-10, burden.GetPhaseStr());
1658 break;
1659 case 2:
1660 num -= 20;
1661 info?.AddFix(-20, burden.GetPhaseStr());
1662 break;
1663 case 3:
1664 num -= 30;
1665 info?.AddFix(-30, burden.GetPhaseStr());
1666 break;
1667 case 4:
1668 num -= (IsPC ? 50 : 100);
1669 info?.AddFix(IsPC ? (-50) : (-100), burden.GetPhaseStr());
1670 break;
1671 }
1672 if (IsPC)
1673 {
1674 switch (stamina.GetPhase())
1675 {
1676 case 1:
1677 num -= 10;
1678 info?.AddFix(-10, stamina.GetPhaseStr());
1679 break;
1680 case 0:
1681 num -= 20;
1682 info?.AddFix(-20, stamina.GetPhaseStr());
1683 break;
1684 }
1685 switch (sleepiness.GetPhase())
1686 {
1687 case 2:
1688 num -= 10;
1689 info?.AddFix(-10, sleepiness.GetPhaseStr());
1690 break;
1691 case 3:
1692 num -= 20;
1693 info?.AddFix(-20, sleepiness.GetPhaseStr());
1694 break;
1695 }
1696 switch (hunger.GetPhase())
1697 {
1698 case 3:
1699 case 4:
1700 num -= 10;
1701 info?.AddFix(-10, hunger.GetPhaseStr());
1702 break;
1703 case 5:
1704 num -= 30;
1705 info?.AddFix(-30, hunger.GetPhaseStr());
1706 break;
1707 }
1708 num += EClass.player.lastEmptyAlly * Evalue(1646);
1709 info?.AddFix(EClass.player.lastEmptyAlly * Evalue(1646), EClass.sources.elements.map[1646].GetName());
1710 }
1712 {
1713 num += EClass.player.lastEmptyAlly * 10 - 10;
1714 info?.AddFix(EClass.player.lastEmptyAlly * 10 - 10, "exceedParty".lang());
1715 }
1716 }
1717 else if (base.LV >= 1000 && !EClass.game.principal.disableVoidBlessing && !base.IsPCFactionOrMinion)
1718 {
1719 num += EClass.curve((base.LV - 900) / 100 * 10, 500, 100);
1720 info?.AddFix(EClass.curve((base.LV - 900) / 100 * 10, 500, 100), "enemySpeedBuff".lang());
1721 }
1722 if (HasCondition<ConGravity>())
1723 {
1724 num -= 30;
1725 info?.AddFix(-30, GetCondition<ConGravity>().Name);
1726 }
1727 _Speed = _Speed * num / 100;
1728 if (_Speed < 10)
1729 {
1730 _Speed = 10;
1731 info?.AddText("minSpeed".lang(10.ToString() ?? ""));
1732 }
1733 dirtySpeed = false;
1734 }
virtual string GetPhaseStr()
Definition: BaseStats.cs:47
Thing thing
Definition: BodySlot.cs:8
int _Speed
Definition: Chara.cs:157
override string ToString()
Definition: Chara.cs:981
void RefreshSpeed(Element.BonusInfo info=null)
Definition: Chara.cs:1614
bool dirtySpeed
Definition: Chara.cs:155
int ValueWithoutLink(int ele)
void AddText(string text, FontColor col=FontColor.Warning)
Definition: ELEMENT.cs:101
void AddFix(int v, string text)
Definition: ELEMENT.cs:122
bool disableVoidBlessing
GamePrincipal principal
Definition: Game.cs:221
int lastEmptyAlly
Definition: Player.cs:994

References _Speed, body, burden, EClass.curve(), 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, Player.lastEmptyAlly, Card.LV, 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 8175 of file Chara.cs.

8176 {
8177 if (workElements != null)
8178 {
8180 }
8181 workElements = null;
8182 if (IsPCParty || homeBranch == null || homeBranch.owner == null)
8183 {
8184 return;
8185 }
8186 foreach (Hobby item in ListHobbies())
8187 {
8188 TryAdd(item);
8189 }
8190 foreach (Hobby item2 in ListWorks())
8191 {
8192 TryAdd(item2);
8193 }
8194 if (workElements != null)
8195 {
8197 }
8198 void TryAdd(Hobby h)
8199 {
8200 if (!h.source.elements.IsEmpty())
8201 {
8202 if (workElements == null)
8203 {
8205 }
8206 for (int i = 0; i < h.source.elements.Length; i += 2)
8207 {
8208 int num = h.source.elements[i];
8209 int num2 = h.source.elements[i + 1];
8210 int num3 = 100;
8211 if (num != 2115 && num != 2207)
8212 {
8213 num3 = h.GetEfficiency(this) * homeBranch.efficiency / 100;
8214 if (num3 <= 0)
8215 {
8216 continue;
8217 }
8218 }
8219 workElements.ModBase(num, (num2 < 0) ? (num2 / 10) : Mathf.Max(1, h.source.elements[i + 1] * num3 / 1000));
8220 }
8221 }
8222 }
8223 }
ElementContainer workElements
Definition: Chara.cs:40
int GetEfficiency(Chara c)
Definition: Hobby.cs:30

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

2070 {
2071 Debug.Log("released:" + this);
2072 base.c_uidMaster = 0;
2073 master = null;
2074 enemy = null;
2075 foreach (Chara chara in EClass._map.charas)
2076 {
2077 if (chara.enemy == this)
2078 {
2079 chara.SetEnemy();
2080 chara.ai.Cancel();
2081 }
2082 }
2083 ai.Cancel();
2084 Refresh();
2085 }

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

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

◆ RemoveCondition< T >()

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

Definition at line 8622 of file Chara.cs.

8622 : Condition
8623 {
8624 for (int num = conditions.Count - 1; num >= 0; num--)
8625 {
8626 if (conditions[num] is T)
8627 {
8628 conditions[num].Kill();
8629 break;
8630 }
8631 }
8632 }

References Condition.Kill().

◆ RemoveGlobal()

void Chara.RemoveGlobal ( )
inline

Definition at line 1294 of file Chara.cs.

1295 {
1296 if (IsGlobal && !(trait is TraitUniqueChara) && !base.IsUnique && !EClass.game.cards.listAdv.Contains(this))
1297 {
1298 global = null;
1300 }
1301 }
List< Chara > listAdv
Definition: CardManager.cs:64

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

Referenced by FactionBranch.RemoveMemeber().

◆ RemoveLastBodyPart()

void Chara.RemoveLastBodyPart ( bool  msg = false)
inline

Definition at line 1931 of file Chara.cs.

1932 {
1933 if (body.slots.Count != 0)
1934 {
1935 BodySlot bodySlot = body.slots.LastItem();
1936 body.RemoveBodyPartAt(body.slots.Count - 1);
1937 if (msg)
1938 {
1939 Say("lose_bodyparts", this, Element.Get(bodySlot.elementId).GetName().ToLower());
1940 PlaySound("offering");
1941 }
1942 }
1943 }
int elementId
Definition: BodySlot.cs:6
void RemoveBodyPartAt(int idx)
Definition: CharaBody.cs:316

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

Referenced by TraitFoodEggFertilized.Incubate().

◆ RequestProtection()

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

Definition at line 7623 of file Chara.cs.

7624 {
7625 if (HasCondition<StanceTaunt>() || base.isRestrained || attacker == this || (host != null && host.isRestrained) || (IsPCFaction && attacker.IsPCFaction))
7626 {
7627 return;
7628 }
7629 bool flag = false;
7630 foreach (Chara chara in EClass._map.charas)
7631 {
7632 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))
7633 {
7634 continue;
7635 }
7636 bool flag2 = chara.HasElement(1225);
7637 if ((!flag2 && (flag || EClass.rnd(2) == 0 || !chara.HasCondition<StanceTaunt>())) || chara.HasCooldown(1225))
7638 {
7639 continue;
7640 }
7641 int num = Mathf.Max(chara.Evalue(1649), (!chara.IsPC) ? ((!flag2) ? 1 : 3) : 0);
7642 int num2 = Dist(chara);
7643 if (num2 > 25)
7644 {
7645 continue;
7646 }
7647 if (num2 > num || !chara.CanSeeLos(pos, num2))
7648 {
7649 if (!flag2)
7650 {
7651 continue;
7652 }
7653 if (Dist(chara) < 5)
7654 {
7655 chara.GoHostile(attacker);
7656 chara.SetEnemy(attacker);
7657 attacker.SetEnemy(chara);
7658 continue;
7659 }
7660 Point nearestPoint = pos.GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: true, ignoreCenter: true);
7661 if (!nearestPoint.IsValid)
7662 {
7663 continue;
7664 }
7665 chara.Teleport(nearestPoint);
7666 chara.AddCooldown(1225, 10);
7667 num2 = Dist(chara);
7668 Say("intercept_loyal", chara, this);
7669 chara.SetEnemy(attacker);
7670 attacker.SetEnemy(chara);
7671 if (num2 > num || !chara.CanSeeLos(pos, num2))
7672 {
7673 continue;
7674 }
7675 }
7676 if (!flag && !HasElement(1225))
7677 {
7678 Say("intercept", chara, this);
7679 if (EClass.rnd(10) == 0)
7680 {
7681 chara.Talk("intercept", base.NameSimple);
7682 }
7683 if (attacker.enemy == this)
7684 {
7685 attacker.SetEnemy(chara);
7686 }
7687 action(chara);
7688 flag = true;
7689 }
7690 }
7691 }
void Teleport(Point point, bool silent=false, bool force=false)
Definition: Card.cs:5153
void AddCooldown(int idEle, int turns=0)
Definition: Chara.cs:7889
bool HasCooldown(int idEle)
Definition: Chara.cs:7907

References EClass._map, AddCooldown(), CanSeeLos(), Map.charas, conSuspend, enemy, Card.Evalue(), Point.GetNearestPoint(), GoHostile(), HasCondition(), HasCooldown(), Card.HasElement(), host, IsDisabled, IsFriendOrAbove(), IsPC, IsPCFaction, 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 8269 of file Chara.cs.

8270 {
8271 if (_hobbies != null && _works != null)
8272 {
8273 _hobbies.Clear();
8274 _works.Clear();
8275 }
8276 else
8277 {
8278 _hobbies = new List<int>();
8279 _works = new List<int>();
8280 }
8281 if (source.hobbies.IsEmpty())
8282 {
8283 AddHobby(EClass.sources.hobbies.listHobbies.RandomItem().id);
8284 }
8285 else
8286 {
8287 string[] hobbies = source.hobbies;
8288 foreach (string key in hobbies)
8289 {
8290 AddHobby(EClass.sources.hobbies.alias[key].id);
8291 }
8292 }
8293 if (source.works.IsEmpty())
8294 {
8295 AddWork(EClass.sources.hobbies.listWorks.RandomItem().id);
8296 }
8297 else
8298 {
8299 string[] hobbies = source.works;
8300 foreach (string key2 in hobbies)
8301 {
8302 AddWork(EClass.sources.hobbies.alias[key2].id);
8303 }
8304 }
8306 }
WorkSummary GetWorkSummary()
Definition: Chara.cs:8308
void AddWork(int id)
Definition: Chara.cs:8257
void AddHobby(int id)
Definition: Chara.cs:8245
List< Row > listWorks
Definition: SourceHobby.cs:64
List< Row > listHobbies
Definition: SourceHobby.cs:61
SourceHobby hobbies
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 1945 of file Chara.cs.

1946 {
1947 for (int num = body.slots.Count - 1; num >= 0; num--)
1948 {
1949 BodySlot bodySlot = body.slots[num];
1950 if (bodySlot.elementId == 45 || bodySlot.elementId == 40)
1951 {
1952 return;
1953 }
1954 body.RemoveBodyPart(num);
1955 }
1956 string[] array = race.figure.Split('|');
1957 foreach (string s in array)
1958 {
1959 int num2 = ParseBodySlot(s);
1960 if (num2 != -1)
1961 {
1962 body.AddBodyPart(num2);
1963 }
1964 }
1966 }
void RefreshBodyParts()
Definition: CharaBody.cs:287

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

◆ ResetUpgrade()

void Chara.ResetUpgrade ( )
inline

Definition at line 7791 of file Chara.cs.

7792 {
7793 _ = base.c_upgrades;
7794 }

Referenced by CoreDebug.ResetPetUpgrades().

◆ ResistCon()

void Chara.ResistCon ( Condition  con)
inline

Definition at line 8792 of file Chara.cs.

8793 {
8794 if (con.power > 0 && resistCon != null)
8795 {
8796 int a = ClassExtension.TryGetValue<int, int>((IDictionary<int, int>)resistCon, con.id, 0);
8797 if (1000 < EClass.rnd(a))
8798 {
8799 con.power = 0;
8800 }
8801 else if (500 < EClass.rnd(a))
8802 {
8803 con.power /= 5;
8804 }
8805 else if (200 < EClass.rnd(a))
8806 {
8807 con.power /= 2;
8808 }
8809 }
8810 }

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

◆ RestockEquip()

void Chara.RestockEquip ( bool  onCreate)
inline

Definition at line 4305 of file Chara.cs.

4306 {
4307 string equip = source.equip;
4308 if (equip.IsEmpty())
4309 {
4310 equip = job.equip;
4311 }
4312 if (equip == "none")
4313 {
4314 return;
4315 }
4316 switch (id)
4317 {
4318 case "kettle":
4319 case "quru":
4320 case "loytel":
4321 case "shojo":
4322 EQ_ID("staff_long", 1);
4323 EQ_CAT("head");
4324 EQ_CAT("torso");
4325 EQ_CAT("arm");
4326 return;
4327 case "adv_kiria":
4328 if (onCreate)
4329 {
4330 EQ_ID("sword_zephir");
4331 }
4332 break;
4333 case "adv_mesherada":
4334 if (onCreate)
4335 {
4336 EQ_ID("dagger_hathaway");
4337 }
4338 break;
4339 case "adv_verna":
4340 if (onCreate)
4341 {
4342 EQ_ID("staff_long", -1, Rarity.Legendary);
4343 }
4344 if (onCreate)
4345 {
4346 EQ_ID("cloak_wing", -1, Rarity.Mythical);
4347 }
4348 break;
4349 case "big_sister":
4350 if (onCreate)
4351 {
4352 EQ_ID("sword_muramasa");
4353 }
4354 break;
4355 case "adv_gaki":
4356 if (onCreate)
4357 {
4358 EQ_ID("dagger_gaki");
4359 }
4360 if (onCreate)
4361 {
4362 EQ_ID("dagger_ninto");
4363 }
4364 break;
4365 case "adv_ivory":
4366 EQ_ID("dagger", -1, Rarity.Legendary);
4367 AddThing("60");
4368 break;
4369 case "adv_wini":
4370 if (onCreate)
4371 {
4372 EQ_ID("staff_Cat", -1, Rarity.Mythical);
4373 }
4375 if (onCreate)
4376 {
4377 AddThing("1071");
4378 }
4379 break;
4380 case "seeker":
4381 if (onCreate)
4382 {
4383 EQ_ID("helm_seeker");
4384 }
4385 EQ_ID("robe_pope");
4386 EQ_ID("sword_katana");
4387 EQ_ID("staff");
4388 EQ_ID("sword_katana");
4389 if (onCreate)
4390 {
4391 EQ_ID("boots_seven");
4392 }
4393 if (onCreate)
4394 {
4395 for (int i = 0; i < 20; i++)
4396 {
4398 }
4399 EQ_Item("panty");
4400 AddThing("plat").SetNum(6);
4401 }
4402 break;
4403 case "ephrond":
4404 if (onCreate)
4405 {
4406 AddThing("guitar_efrond");
4407 }
4408 break;
4409 case "ashland":
4410 if (onCreate)
4411 {
4412 AddThing("guitar_ash");
4413 }
4414 break;
4415 case "swordkeeper":
4416 if (onCreate)
4417 {
4418 EQ_ID("EtherDagger");
4419 }
4420 break;
4421 }
4422 switch (equip)
4423 {
4424 case "archer":
4425 if (onCreate || !TryEquipRanged())
4426 {
4427 EQ_CAT((EClass.rnd(4) == 0) ? "crossbow" : "bow");
4428 }
4429 break;
4430 case "inquisitor":
4431 case "gunner":
4432 if (onCreate || !TryEquipRanged())
4433 {
4434 EQ_CAT("gun");
4435 }
4436 break;
4437 }
4438 int num = ((base.rarity >= Rarity.Mythical) ? (base.LV * 3) : ((base.rarity >= Rarity.Legendary) ? (base.LV * 2) : base.LV));
4439 if (trait is TraitAdventurer)
4440 {
4441 num *= 3;
4442 }
4443 if (race.id == "asura")
4444 {
4445 for (int j = 0; j < 4; j++)
4446 {
4447 EQ_CAT(job.weapon.RandomItem());
4448 }
4449 }
4450 for (int k = 0; k < ((!(race.id == "mutant")) ? 1 : (2 + base.LV / 30)); k++)
4451 {
4452 if (source.ContainsTag("boxer"))
4453 {
4454 EQ_CAT("martial");
4455 }
4456 else if (!job.weapon.IsEmpty())
4457 {
4458 if (race.id == "mutant" || (body.slotMainHand != null && body.slotMainHand.thing == null))
4459 {
4460 EQ_CAT(job.weapon.RandomItem());
4461 }
4462 if (race.id == "mutant" || (Evalue(131) > 0 && EClass.rnd(2) == 0))
4463 {
4464 EQ_CAT(job.weapon.RandomItem());
4465 }
4466 }
4467 EQ_CAT("torso");
4468 if (EClass.rnd(num) > 5)
4469 {
4470 EQ_CAT("arm");
4471 }
4472 if (EClass.rnd(num) > 10)
4473 {
4474 EQ_CAT("head");
4475 }
4476 if (EClass.rnd(num) > 15)
4477 {
4478 EQ_CAT("back");
4479 }
4480 if (EClass.rnd(num) > 20)
4481 {
4482 EQ_CAT("ring");
4483 }
4484 if (EClass.rnd(num) > 25)
4485 {
4486 EQ_CAT("amulet");
4487 }
4488 if (EClass.rnd(num) > 30)
4489 {
4490 EQ_CAT("foot");
4491 }
4492 if (EClass.rnd(num) > 35)
4493 {
4494 EQ_CAT("waist");
4495 }
4496 if (EClass.rnd(num) > 40)
4497 {
4498 EQ_CAT("ring");
4499 }
4500 }
4501 if (trait is TraitBard)
4502 {
4503 AddThing(ThingGen.Create("lute"));
4504 }
4505 }
Card AddCard(Card c)
Definition: Card.cs:2887
BodySlot slotMainHand
Definition: CharaBody.cs:10
void EQ_Item(string s, int num=1)
Definition: Chara.cs:4605
Thing EQ_ID(string s, int mat=-1, Rarity r=Rarity.Random)
Definition: Chara.cs:4569
bool TryEquipRanged()
Definition: Chara.cs:7081
void EQ_CAT(string s)
Definition: Chara.cs:4589
static Thing CreateSpellbook(string alias, int num=1)
Definition: ThingGen.cs:151

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

Referenced by CoreDebug.QuickStart().

◆ RestockInventory()

void Chara.RestockInventory ( bool  onCreate)
inline

Definition at line 4507 of file Chara.cs.

4508 {
4509 switch (id)
4510 {
4511 case "fiama":
4512 Restock("book_story", 1);
4513 break;
4514 case "rock_thrower":
4515 Restock("stone", 10 + EClass.rnd(10));
4516 break;
4517 case "giant":
4518 Restock("rock", 2 + EClass.rnd(10));
4519 break;
4520 case "farris":
4521 Restock("lute", 1);
4522 Restock("book_story_home", 1);
4523 break;
4524 case "begger":
4525 break;
4526 }
4527 void Restock(string id, int num)
4528 {
4529 if (things.Find(id) == null)
4530 {
4531 AddCard(ThingGen.Create(id).SetNum(num));
4532 }
4533 }
4534 }

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

◆ Revive()

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

Definition at line 4649 of file Chara.cs.

4650 {
4651 if (!isDead)
4652 {
4653 return;
4654 }
4655 isDead = false;
4656 base.hp = MaxHP / 3;
4657 mana.value = 0;
4658 stamina.value = 0;
4659 if (hunger.value > 30)
4660 {
4661 hunger.value = 30;
4662 }
4663 sleepiness.value = 0;
4665 RemoveCondition<StanceTaunt>();
4666 if (IsPC)
4667 {
4669 {
4670 Msg.Say("noDeathPenalty2", this);
4671 }
4673 {
4674 Msg.Say("noDeathPenalty", this);
4675 }
4676 else
4677 {
4679 }
4680 List<Thing> dropList = new List<Thing>();
4681 EClass.pc.things.Foreach(delegate(Thing t)
4682 {
4684 {
4685 t.ignoreAutoPick = true;
4686 dropList.Add(t);
4687 }
4688 }, onlyAccessible: false);
4689 foreach (Thing item in dropList)
4690 {
4692 Msg.Say("backpack_full_drop", item);
4693 }
4694 EClass.player.preventDeathPenalty = false;
4695 }
4696 if (IsPCFaction && homeBranch != null)
4697 {
4698 homeBranch.Log("bRevive", this);
4699 }
4700 if (p != null)
4701 {
4702 if (!p.IsInBounds)
4703 {
4705 }
4706 EClass._zone.AddCard(this, p);
4707 if (msg)
4708 {
4709 SE.Play("revive");
4710 Msg.Say("revive", this);
4711 PlayEffect("revive");
4712 }
4713 SetCensored(enable: false);
4714 }
4715 }
void SetCensored(bool enable)
Definition: Card.cs:6826
Card parentCard
Definition: Card.cs:99
void ApplyDeathPenalty()
Definition: Chara.cs:4737
bool disableDeathPenaltyProtection
Point GetCenterPos()
Definition: MapBounds.cs:52
int days
Definition: Player.cs:68
bool preventDeathPenalty
Definition: Player.cs:968
void Foreach(Action< Thing > action, bool onlyAccessible=true)
override int SelfWeight
Definition: Thing.cs:62

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

3206 {
3207 if (renderer.hasActor)
3208 {
3209 base.dir = (base.dir + ((!reverse) ? 1 : (-1))).Clamp(0, 3, loop: true);
3210 }
3211 else
3212 {
3213 base.dir = ((base.dir == 0) ? 1 : 0);
3214 }
3215 UpdateAngle();
3217 }

Referenced by AI_Dance.Run().

◆ SetAI()

AIAct Chara.SetAI ( AIAct  g)
inline

Definition at line 8045 of file Chara.cs.

8046 {
8047 if (IsPC)
8048 {
8050 }
8051 if (ai.IsRunning)
8052 {
8053 if (ai == g && ai.IsNoGoal)
8054 {
8055 return g;
8056 }
8057 ai.Cancel();
8058 if (ai == g)
8059 {
8060 Debug.Log("goal is g:" + ai?.ToString() + "/" + this);
8061 return g;
8062 }
8063 }
8064 if (HasCondition<ConWait>())
8065 {
8066 RemoveCondition<ConWait>();
8067 }
8068 ai = g;
8069 ai.SetOwner(this);
8070 if (IsPC)
8071 {
8073 }
8074 return g;
8075 }
virtual bool IsNoGoal
Definition: AIAct.cs:74
void SetOwner(Chara c)
Definition: AIAct.cs:179
QueueManager queues
Definition: Player.cs:1010
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(), ZoneEventSiege.OnTickRound(), AM_Paint.OnUpdateInput(), ActNTR.Perform(), ActRanged.Perform(), ActRestrain.Perform(), ActPlan.Item.Perform(), LayerCraftFloat.RefreshCraft(), AI_Idle.Run(), GoalSpot.Run(), Zone.Simulate(), ConSleep.SuccubusVisit(), ActThrow.Throw(), TaskManager.Designations.TryRemoveDesignation(), InvOwnerCraft.TryStartCraft(), and GoalWork.TryWork().

◆ SetAIAggro()

void Chara.SetAIAggro ( )
inline

Definition at line 8035 of file Chara.cs.

8036 {
8037 SetAI(new GoalCombat());
8038 }

Referenced by ZoneEventQuest.AggroEnemy().

◆ SetAIIdle()

void Chara.SetAIIdle ( )
inline

Definition at line 8031 of file Chara.cs.

8032 {
8033 }

◆ SetAIImmediate()

void Chara.SetAIImmediate ( AIAct  g)
inline

◆ SetDir()

override void Chara.SetDir ( int  d)
inlinevirtual

Reimplemented from Card.

Definition at line 3198 of file Chara.cs.

3199 {
3200 base.dir = d;
3201 UpdateAngle();
3203 }

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

◆ SetDirtySpeed()

void Chara.SetDirtySpeed ( )
inline

Definition at line 1605 of file Chara.cs.

1606 {
1607 dirtySpeed = true;
1608 if (host != null)
1609 {
1611 }
1612 }

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

5659 {
5660 enemy = c;
5661 if (c == null)
5662 {
5663 if (ai is GoalCombat)
5664 {
5665 ai.Cancel();
5666 }
5667 }
5668 else
5669 {
5670 calmCheckTurn = 10 + EClass.rnd(30);
5671 }
5672 return c;
5673 }

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

4537 {
4539 Rarity rarity = Rarity.Normal;
4540 int num = ((base.LV >= 1000) ? 7 : ((base.LV >= 500) ? 5 : ((base.LV >= 250) ? 3 : ((base.LV >= 100) ? 2 : ((base.LV >= 50) ? 1 : 0)))));
4541 Rarity rarity2 = base.rarity;
4542 if (id == "big_sister")
4543 {
4544 num = (isOnCreate ? 8 : 4);
4545 }
4546 if (!isOnCreate && EClass.rnd(10) != 0)
4547 {
4548 num /= 2;
4549 }
4550 if (rarity2 == Rarity.Superior && EClass.rnd(10) <= num)
4551 {
4552 rarity = Rarity.Superior;
4553 }
4554 else if (rarity2 == Rarity.Legendary)
4555 {
4556 rarity = ((EClass.rnd(10) <= num) ? Rarity.Legendary : ((EClass.rnd(5) <= num) ? Rarity.Superior : Rarity.Normal));
4557 }
4558 else if (rarity2 >= Rarity.Mythical)
4559 {
4560 rarity = ((EClass.rnd(30) <= num) ? Rarity.Mythical : ((EClass.rnd(10) > num) ? Rarity.Superior : Rarity.Legendary));
4561 }
4562 if (rarity == Rarity.Normal && EClass.rnd(1000) == 0)
4563 {
4564 rarity = Rarity.Legendary;
4565 }
4566 CardBlueprint.current.rarity = rarity;
4567 }
static void Set(CardBlueprint _bp)
static CardBlueprint CharaGenEQ
static bool isOnCreate
Definition: Chara.cs:169

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

◆ SetFaction()

void Chara.SetFaction ( Faction  f)
inline

Definition at line 1227 of file Chara.cs.

1228 {
1229 _faction = null;
1230 faction = f;
1232 }
Faction _faction
Definition: Chara.cs:141
Hostility GetHostility()
Definition: FACTION.cs:253

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

1490 {
1491 faith = r;
1493 }

References faith, and RefreshFaithElement().

◆ SetFaith() [2/2]

void Chara.SetFaith ( string  id)
inline

Definition at line 1484 of file Chara.cs.

1485 {
1487 }
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 8964 of file Chara.cs.

8965 {
8966 Feat feat = elements.GetElement(id) as Feat;
8967 int num = 0;
8968 if (feat != null && feat.Value > 0)
8969 {
8970 if (value == feat.Value)
8971 {
8972 return;
8973 }
8974 num = feat.Value;
8975 feat.Apply(-feat.Value, elements);
8976 }
8977 if (value > 0)
8978 {
8979 feat = elements.SetBase(id, value - (feat?.vSource ?? 0)) as Feat;
8980 feat.Apply(feat.Value, elements);
8981 }
8982 else
8983 {
8984 elements.Remove(id);
8985 }
8987 {
8988 Refresh();
8990 }
8991 if (!msg)
8992 {
8993 return;
8994 }
8995 if (feat.source.textInc.IsEmpty())
8996 {
8997 PlaySound("ding_skill");
8999 Say("gainFeat", this, feat.FullName);
9000 }
9001 else
9002 {
9003 bool flag = value < num;
9004 if (feat.source.tag.Contains("neg"))
9005 {
9006 flag = !flag;
9007 }
9008 PlaySound("mutation");
9010 Say((value > num) ? feat.source.GetText("textInc") : feat.source.GetText("textDec"), this, feat.FullName);
9011 }
9013 }
Color Negative
Definition: MsgColors.cs:15
Color Ding
Definition: MsgColors.cs:11

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

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

◆ SetGlobal() [1/2]

Chara Chara.SetGlobal ( )
inline

Definition at line 1281 of file Chara.cs.

1282 {
1283 if (!IsGlobal)
1284 {
1286 global = new GlobalData();
1287 base.isSubsetCard = false;
1288 enemy = null;
1289 base.c_uidMaster = 0;
1290 }
1291 return this;
1292 }

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

1267 {
1268 SetGlobal();
1269 homeZone = _home;
1270 _home.AddCard(this, x, z);
1271 global.transition = new ZoneTransition
1272 {
1273 state = ZoneTransition.EnterState.Exact,
1274 x = x,
1275 z = z
1276 };
1277 orgPos = new Point(x, z);
1278 return this;
1279 }

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

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

◆ SetHomeZone()

void Chara.SetHomeZone ( Zone  zone)
inline

Definition at line 1234 of file Chara.cs.

1235 {
1236 homeZone = zone;
1237 SetGlobal();
1238 }

References homeZone, and SetGlobal().

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

◆ SetMainElement() [1/2]

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

Definition at line 1813 of file Chara.cs.

1814 {
1815 if (base.c_idMainElement != 0)
1816 {
1817 SetElements(base.c_idMainElement, remove: true);
1818 base.c_idMainElement = 0;
1819 }
1820 if (id != 0)
1821 {
1822 _ = EClass.sources.elements.map[id];
1823 SetElements(id, remove: false);
1824 base.c_idMainElement = id;
1825 if (elemental)
1826 {
1827 base.isElemental = true;
1828 _colorInt = 0;
1829 Color colorSprite = EClass.setting.elements[MainElement.source.alias].colorSprite;
1830 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);
1831 }
1832 _ability = null;
1833 }
1834 void SetElements(int idEle, bool remove)
1835 {
1836 elements.SetBase(idEle, (!remove) ? ((v == 0) ? 10 : v) : 0);
1837 elements.ModBase(EClass.sources.elements.alias[EClass.sources.elements.map[idEle].aliasRef].id, remove ? (-20) : 20);
1838 switch (idEle)
1839 {
1840 case 910:
1841 elements.ModBase(951, remove ? 10 : (-10));
1842 break;
1843 case 911:
1844 elements.ModBase(950, remove ? 10 : (-10));
1845 break;
1846 case 912:
1847 elements.ModBase(953, remove ? 10 : (-10));
1848 break;
1849 case 913:
1850 elements.ModBase(952, remove ? 10 : (-10));
1851 break;
1852 case 916:
1853 elements.ModBase(960, remove ? 10 : (-10));
1854 break;
1855 case 919:
1856 elements.ModBase(956, remove ? 10 : (-10));
1857 break;
1858 case 925:
1859 elements.ModBase(962, remove ? 10 : (-10));
1860 break;
1861 case 922:
1862 elements.ModBase(965, remove ? 10 : (-10));
1863 break;
1864 case 921:
1865 elements.ModBase(971, remove ? 10 : (-10));
1866 break;
1867 case 926:
1868 elements.ModBase(961, remove ? 10 : (-10));
1869 break;
1870 case 914:
1871 case 915:
1872 case 917:
1873 case 918:
1874 case 920:
1875 case 923:
1876 case 924:
1877 break;
1878 }
1879 }
1880 }
int _colorInt
Definition: Card.cs:63
CharaAbility _ability
Definition: Chara.cs:93
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 1804 of file Chara.cs.

1805 {
1806 if (!id.StartsWith("ele"))
1807 {
1808 id = "ele" + id;
1809 }
1810 SetMainElement(EClass.sources.elements.alias[id].id, v, elemental);
1811 }

References SourceManager.elements, Card.id, SetMainElement(), and EClass.sources.

Referenced by TraitFoodEggFertilized.Incubate(), OnCreate(), ActEffect.ProcAt(), SerializedCards.Restore(), and SetMainElement().

◆ SetNoGoal()

AIAct Chara.SetNoGoal ( )
inline

Definition at line 8040 of file Chara.cs.

8041 {
8042 return SetAI(_NoGoalPC);
8043 }
static NoGoal _NoGoalPC
Definition: Chara.cs:181

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

◆ SetPCCState()

void Chara.SetPCCState ( PCCState  state)
inline

Definition at line 6038 of file Chara.cs.

6039 {
6040 if (IsPCC)
6041 {
6042 PCC.Get(pccData).Build(state);
6043 }
6044 }

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

6083 {
6084 p.mat = base.material;
6085 p.matColor = base.colorInt;
6086 if (!renderer.usePass)
6087 {
6088 return;
6089 }
6090 if (renderer.replacer != null)
6091 {
6092 p.tile = renderer.replacer.tile * ((!flipX) ? 1 : (-1));
6093 }
6094 else if (source._tiles_snow.Length != 0 && EClass._zone.IsSnowCovered)
6095 {
6096 if (source._tiles_snow.Length > 1)
6097 {
6098 int num = ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % source._tiles_snow.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6099 p.tile = source._tiles_snow[(num < source._tiles_snow.Length) ? num : 0] * ((!flipX) ? 1 : (-1));
6100 }
6101 else
6102 {
6103 p.tile = source._tiles_snow[0] * ((!flipX) ? 1 : (-1));
6104 }
6105 }
6106 else if (sourceCard._tiles.Length > 1)
6107 {
6108 int num2 = ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % sourceCard._tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6109 p.tile = sourceCard._tiles[(num2 >= 0 && num2 < sourceCard._tiles.Length) ? num2 : 0] * ((!flipX) ? 1 : (-1));
6110 }
6111 else
6112 {
6113 p.tile = sourceCard._tiles[0] * ((!flipX) ? 1 : (-1));
6114 }
6115 p.dir = base.dir;
6116 }
override bool flipX
Definition: Chara.cs:532
virtual bool IsSnowCovered
Definition: Spatial.cs:531

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

6594 {
6595 switch (m)
6596 {
6597 case UIList.SortMode.ByJob:
6598 sortVal = job._index * 10000 + sourceCard._index;
6599 break;
6600 case UIList.SortMode.ByRace:
6601 sortVal = race._index * 10000 * ((!IsHuman) ? 1 : (-1)) + sourceCard._index;
6602 break;
6603 case UIList.SortMode.ByFeat:
6604 sortVal = -GetTotalFeat();
6605 break;
6606 default:
6607 sortVal = sourceCard._index * ((!IsHuman) ? 1 : (-1));
6608 break;
6609 case UIList.SortMode.ByWorkk:
6610 break;
6611 }
6612 }
int sortVal
Definition: Card.cs:97
int GetTotalFeat()
Definition: Chara.cs:7294
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 1792 of file Chara.cs.

1793 {
1794 source = EClass.sources.charas.map.TryGetValue(id);
1795 if (source == null)
1796 {
1797 Debug.LogWarning("Chara " + id + " not found");
1798 id = "begger";
1799 source = EClass.sources.charas.map[id];
1800 }
1801 path.walker = this;
1802 }
SourceChara charas

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

◆ SetSummon()

void Chara.SetSummon ( int  duration)
inline

Definition at line 2087 of file Chara.cs.

2088 {
2089 base.c_summonDuration = duration;
2090 base.isSummon = true;
2091 }

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

6880 {
6881 if (t.IsRangedWeapon && t.category.slot == 0)
6882 {
6883 if (!CanEquipRanged(t))
6884 {
6885 return false;
6886 }
6887 int num = 0;
6888 foreach (Thing thing in things)
6889 {
6890 if (thing.IsRangedWeapon)
6891 {
6892 if (thing.category.slot != 0 && thing.isEquipped)
6893 {
6894 return false;
6895 }
6896 if (CanEquipRanged(thing) && thing.GetEquipValue() > num)
6897 {
6898 num = thing.GetEquipValue();
6899 }
6900 }
6901 }
6902 if (t.GetEquipValue() > num)
6903 {
6904 return true;
6905 }
6906 return false;
6907 }
6908 BodySlot bodySlot = body.GetSlot(t);
6909 if (bodySlot == null)
6910 {
6911 return false;
6912 }
6913 if (useFav)
6914 {
6915 switch (GetFavAttackStyle())
6916 {
6917 case AttackStyle.Default:
6918 case AttackStyle.TwoHand:
6919 if (t.IsMeleeWeapon)
6920 {
6921 bodySlot = body.slotMainHand;
6922 }
6923 else if (bodySlot.elementId == 35)
6924 {
6925 return false;
6926 }
6927 break;
6928 case AttackStyle.Shield:
6929 if (t.IsMeleeWeapon)
6930 {
6931 bodySlot = body.slotMainHand;
6932 }
6933 else if (bodySlot.elementId == 35 && t.IsMeleeWeapon)
6934 {
6935 return false;
6936 }
6937 break;
6938 case AttackStyle.TwoWield:
6939 if (bodySlot.elementId == 35 && !t.IsMeleeWeapon)
6940 {
6941 return false;
6942 }
6943 break;
6944 }
6945 }
6946 if (!body.IsEquippable(t, bodySlot, text: false))
6947 {
6948 return false;
6949 }
6950 if (bodySlot.thing != null && (bodySlot.thing.blessedState <= BlessedState.Cursed || bodySlot.thing.GetEquipValue() >= t.GetEquipValue()))
6951 {
6952 return false;
6953 }
6954 if (t.HasTag(CTAG.gift))
6955 {
6956 return false;
6957 }
6958 return true;
6959 }
bool IsMeleeWeapon
Definition: Card.cs:2101
BlessedState blessedState
Definition: Card.cs:262
bool IsEquippable(Thing thing, BodySlot slot, bool text=true)
Definition: CharaBody.cs:106
AttackStyle GetFavAttackStyle()
Definition: Chara.cs:4261

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

◆ ShouldThrowAway()

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

Definition at line 7693 of file Chara.cs.

7694 {
7695 if (IsPCFaction)
7696 {
7697 if (t.IsFood && t.category.id != "fish" && !t.IsDecayed)
7698 {
7699 return false;
7700 }
7701 if (t.trait.GetHealAction(this) != null)
7702 {
7703 return false;
7704 }
7705 if (t.IsThrownWeapon || t.IsRangedWeapon || t.IsAmmo)
7706 {
7707 return false;
7708 }
7709 if (t.trait is TraitBlanket || t.trait is TraitItemProc || t.trait is TraitBookSkill)
7710 {
7711 return false;
7712 }
7713 }
7714 if (t.isEquipped || t.rarity >= Rarity.Legendary || !t.trait.CanBeDestroyed)
7715 {
7716 return false;
7717 }
7718 if (trait is TraitBard && t.trait is TraitToolMusic)
7719 {
7720 return false;
7721 }
7722 if (t.trait is TraitCurrency)
7723 {
7724 return false;
7725 }
7726 switch (type)
7727 {
7728 case ClearInventoryType.SellAtTown:
7729 if (!t.isGifted && !t.isNPCProperty)
7730 {
7731 return false;
7732 }
7733 break;
7734 case ClearInventoryType.Purge:
7735 switch (t.category.id)
7736 {
7737 case "fish":
7738 if (EClass.rnd(3) == 0)
7739 {
7740 return true;
7741 }
7742 break;
7743 case "junk":
7744 case "garbage":
7745 if (EClass.rnd(3) != 0)
7746 {
7747 return true;
7748 }
7749 break;
7750 }
7751 if (t.id == "flyer")
7752 {
7753 return true;
7754 }
7755 if (!t.IsDecayed && EClass.rnd(3) == 0)
7756 {
7757 return false;
7758 }
7759 if (t.IsRangedWeapon && !things.IsFull())
7760 {
7761 return false;
7762 }
7763 break;
7764 }
7765 return true;
7766 }
bool IsThrownWeapon
Definition: Card.cs:2105
bool IsFood
Definition: Card.cs:2051
bool isGifted
Definition: Card.cs:754
virtual Action GetHealAction(Chara c)
Definition: Trait.cs:553

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

6369 {
6370 Zone_Nymelle zone_Nymelle = EClass._zone as Zone_Nymelle;
6371 if (conSuspend != null && IsPCParty)
6372 {
6373 RemoveCondition<ConSuspend>();
6374 }
6375 if (IsDeadOrSleeping)
6376 {
6377 ShowDialog("_chara", "sleep");
6378 }
6379 else if (base.isRestrained)
6380 {
6381 ShowDialog("_chara", "strain");
6382 }
6383 else if (EClass.pc.isHidden && !CanSee(EClass.pc))
6384 {
6385 ShowDialog("_chara", "invisible");
6386 }
6387 else if (IsEscorted())
6388 {
6389 ShowDialog("_chara", "escort");
6390 }
6391 else if (EClass._zone is Zone_Music)
6392 {
6393 ShowDialog("_chara", "party");
6394 }
6395 else
6396 {
6397 if (LayerDrama.forceJump == null && EClass.game.quests.OnShowDialog(this))
6398 {
6399 return;
6400 }
6401 switch (id)
6402 {
6403 case "loytel":
6404 {
6406 {
6407 EClass.game.quests.Get("pre_debt_runaway").Complete();
6408 EClass.player.flags.loytelEscaped = false;
6409 EClass.game.quests.Add("debt", "loytel");
6410 ShowDialog("loytel", "loytelEscaped");
6411 return;
6412 }
6413 QuestDebt questDebt = EClass.game.quests.Get<QuestDebt>();
6414 if (questDebt != null && questDebt.paid)
6415 {
6416 questDebt.stage++;
6417 if (questDebt.stage > 6)
6418 {
6419 questDebt.stage = 1;
6420 }
6421 ShowDialog("loytel", "debt" + questDebt.stage);
6422 return;
6423 }
6424 break;
6425 }
6426 case "farris":
6427 if (EClass._zone.id == "startVillage" || EClass._zone.id == "startVillage3")
6428 {
6429 ShowDialog("_chara");
6430 return;
6431 }
6432 switch (EClass.game.quests.GetPhase<QuestExploration>())
6433 {
6434 case -1:
6435 ShowDialog("farris", "nymelle_noQuest");
6436 break;
6437 case 0:
6438 ShowDialog("farris", "nymelle_first");
6439 break;
6440 case 1:
6441 ShowDialog("farris", "home_first");
6442 break;
6443 default:
6444 ShowDialog("_chara");
6445 break;
6446 }
6447 return;
6448 case "ashland":
6449 if (zone_Nymelle != null && zone_Nymelle.IsCrystalLv)
6450 {
6451 SoundManager.ForceBGM();
6452 LayerDrama.ActivateMain("mono", "nymelle_crystal");
6453 }
6454 else
6455 {
6456 ShowDialog("ashland");
6457 }
6458 return;
6459 case "fiama":
6460 if (zone_Nymelle != null && zone_Nymelle.IsCrystalLv)
6461 {
6462 SoundManager.ForceBGM();
6463 LayerDrama.ActivateMain("mono", "nymelle_crystal");
6464 }
6466 {
6468 {
6469 EClass.player.flags.fiamaFirstDream = true;
6470 ShowDialog("fiama", "firstDream");
6471 }
6473 {
6474 ShowDialog("fiama", "giveStoryBook").SetOnKill(delegate
6475 {
6476 EClass.player.flags.fiamaStoryBookGiven = true;
6477 EClass.player.DropReward(ThingGen.Create("book_story"));
6478 });
6479 }
6480 else
6481 {
6482 ShowDialog("fiama");
6483 }
6484 }
6485 else
6486 {
6487 ShowDialog("fiama");
6488 }
6489 return;
6490 case "big_sister":
6492 {
6493 ShowDialog("big_sister", "little_saved");
6494 EClass.player.flags.little_saved = false;
6495 return;
6496 }
6498 {
6499 ShowDialog("big_sister", "little_dead");
6500 EClass.player.flags.little_killed = false;
6501 return;
6502 }
6503 break;
6504 }
6505 if (trait is TraitGuildDoorman)
6506 {
6507 string tag = ((trait is TraitDoorman_Fighter) ? "fighter" : ((trait is TraitDoorman_Mage) ? "mage" : "thief"));
6508 ShowDialog("guild_doorman", "main", tag);
6509 return;
6510 }
6511 if (trait is TraitGuildClerk)
6512 {
6513 string tag2 = ((trait is TraitClerk_Fighter) ? "fighter" : ((trait is TraitClerk_Mage) ? "mage" : "thief"));
6514 ShowDialog("guild_clerk", "main", tag2);
6515 return;
6516 }
6517 bool flag = true;
6518 if (id == "parttimer_jure" && (!EClass._zone.IsFestival || !(EClass._zone is Zone_Noyel) || EClass.pc.faith == EClass.game.religions.Healing))
6519 {
6520 flag = false;
6521 }
6522 if (flag && File.Exists(CorePath.DramaData + id + ".xlsx"))
6523 {
6524 ShowDialog(id);
6525 }
6526 else
6527 {
6528 ShowDialog("_chara");
6529 }
6530 }
6531 }
void ShowDialog()
Definition: Chara.cs:6368
static string DramaData
Definition: CorePath.cs:178
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:366
int storyFiama
Definition: Player.cs:474
bool little_saved
Definition: Player.cs:330
bool fiamaStoryBookGiven
Definition: Player.cs:186
bool fiamaFirstDream
Definition: Player.cs:198
bool little_killed
Definition: Player.cs:342
bool EnableDreamStory
Definition: Player.cs:1069
Thing DropReward(Thing t, bool silent=false)
Definition: Player.cs:2320
bool paid
Definition: QuestDebt.cs:9
int stage
Definition: QuestDebt.cs:12
bool OnShowDialog(Chara c)
Quest Add(string id, string idGlobalChara=null)
Definition: QuestManager.cs:29
Quest Get(string id)
void Complete()
Definition: Quest.cs:468
ReligionHealing Healing
bool IsCrystalLv
Definition: Zone_Nymelle.cs:25
virtual bool IsFestival
Definition: Zone.cs:206

References EClass._zone, LayerDrama.ActivateMain(), QuestManager.Add(), Quest.Complete(), ThingGen.Create(), CorePath.DramaData, Player.DropReward(), Player.EnableDreamStory, faith, Player.Flags.fiamaFirstDream, Player.Flags.fiamaStoryBookGiven, Player.flags, LayerDrama.forceJump, EClass.game, QuestManager.Get(), ReligionManager.Healing, Spatial.id, Zone_Nymelle.IsCrystalLv, Zone.IsFestival, Card.isHidden, Player.Flags.little_killed, Player.Flags.little_saved, Player.Flags.loytelEscaped, QuestManager.OnShowDialog(), QuestDebt.paid, EClass.pc, EClass.player, Game.quests, Game.religions, QuestDebt.stage, and Player.Flags.storyFiama.

Referenced by Card.DamageHP(), 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 6533 of file Chara.cs.

6534 {
6535 return _ShowDialog(book, null, step, tag);
6536 }
LayerDrama _ShowDialog(string book, string sheet, string step="main", string tag="")
Definition: Chara.cs:6538

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

8813 {
8814 AddCondition(Condition.Create(100, delegate(ConSleep con)
8815 {
8816 con.pcSleep = 15;
8817 con.pcBed = bed;
8818 con.pcPillow = pillow;
8819 con.pickup = pickup;
8820 con.posBed = posBed;
8821 con.posPillow = posPillow;
8822 }), force: true);
8823 }

References bed, and Condition.Create().

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

◆ SplitHeld()

Card Chara.SplitHeld ( int  a)
inline

Definition at line 4196 of file Chara.cs.

4197 {
4198 return held.Split(a);
4199 }

References Card.Split().

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

◆ Stumble()

void Chara.Stumble ( int  mtp = 100)
inline

Definition at line 1588 of file Chara.cs.

1589 {
1590 bool flag = EClass._map.FindThing((Thing t) => t.IsInstalled && t.pos.Equals(EClass.pc.pos) && t.trait is TraitStairsUp) != null;
1591 Say(flag ? "dmgBurdenStairs" : "dmgBurdenFallDown", this);
1592 int num = MaxHP;
1593 if (Evalue(1421) > 0)
1594 {
1595 num = mana.max;
1596 }
1597 int num2 = (num * (base.ChildrenWeight * 100 / WeightLimit) / (flag ? 100 : 200) + 1) * mtp / 100;
1598 if (base.hp <= 0)
1599 {
1600 num2 *= 2;
1601 }
1602 DamageHP(num2, flag ? AttackSource.BurdenStairs : AttackSource.BurdenFallDown);
1603 }
Thing FindThing(Func< Thing, bool > func)
Definition: Map.cs:2570

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

3560 {
3561 if (host != null)
3562 {
3563 host.SyncRide();
3564 }
3565 if (ride != null)
3566 {
3567 SyncRide(ride);
3568 }
3569 if (parasite != null)
3570 {
3572 }
3573 }

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

3576 {
3577 if (!c.pos.Equals(pos))
3578 {
3579 if (!pos.IsValid)
3580 {
3581 Debug.LogError("exception: pos is not valid:" + pos?.ToString() + "/" + this);
3582 pos = new Point();
3583 }
3584 EClass._map.MoveCard(pos, c);
3585 }
3586 }

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

◆ TalkTopic()

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

Definition at line 6297 of file Chara.cs.

6298 {
6299 if (host == null && !IsInActiveZone)
6300 {
6301 return null;
6302 }
6303 if (!isSynced && (host == null || !host.isSynced) && topic != "dead")
6304 {
6305 return null;
6306 }
6307 if (IsPCParty)
6308 {
6309 int num = EClass.pc.party.members.Count - 1;
6310 switch (topic)
6311 {
6312 case "calm":
6313 if (EClass.rnd(num * 5) != 0)
6314 {
6315 return null;
6316 }
6317 break;
6318 case "aggro":
6319 if (EClass.rnd(num * 10) != 0)
6320 {
6321 return null;
6322 }
6323 break;
6324 case "kill":
6325 if (EClass.rnd(num * 3) != 0)
6326 {
6327 return null;
6328 }
6329 break;
6330 case "fov":
6331 return null;
6332 }
6333 }
6334 string topicText = GetTopicText(topic);
6335 if (topicText.IsEmpty())
6336 {
6337 return null;
6338 }
6339 string text = "_bracketTalk".lang();
6340 bool flag = topicText.StartsWith("*");
6341 bool flag2 = topicText.StartsWith("(");
6342 bool flag3 = topicText.StartsWith(text) || (topicText.Length > 0 && topicText[0] == text[0]) || topicText[0] == '“';
6343 topicText = ApplyTone(topicText);
6344 topicText = topicText.Replace("~", "*");
6345 Msg.SetColor(flag2 ? Msg.colors.Thinking : (flag3 ? Msg.colors.Talk : Msg.colors.Ono));
6346 Msg.Say(topicText.Replace("&", ""));
6347 if (topic == "dead")
6348 {
6349 EClass.ui.popGame.PopText(ApplyNewLine(topicText.StripBrackets()), null, "PopTextDead", default(Color), pos.Position() + EClass.setting.render.tc.textPosDead);
6350 }
6351 else if (flag || flag3 || flag2)
6352 {
6353 (host ?? this).renderer.Say(ApplyNewLine(topicText.StripBrackets()), default(Color), IsPCParty ? 0.6f : 0f);
6354 }
6355 return topicText;
6356 }
void Say(string text, Color c=default(Color), float duration=0f)
string ApplyNewLine(string text)
Definition: Card.cs:6013
string ApplyTone(string text, bool stripPun=false)
Definition: Card.cs:6092
string GetTopicText(string topic="calm")
Definition: Chara.cs:6264
static UI ui
Definition: EClass.cs:16
Color Thinking
Definition: MsgColors.cs:17
Color Talk
Definition: MsgColors.cs:7

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

Referenced by AI_Idle.Run().

◆ Tick()

override void Chara.Tick ( )
inlinevirtual

Reimplemented from Card.

Definition at line 3588 of file Chara.cs.

3589 {
3590 SyncRide();
3591 combatCount--;
3592 if (IsPC)
3593 {
3594 if (hasMovedThisTurn)
3595 {
3596 pos.Things.ForeachReverse(delegate(Thing t)
3597 {
3598 t.trait.OnStepped(this);
3599 });
3600 if (isDead)
3601 {
3602 return;
3603 }
3604 hasMovedThisTurn = false;
3606 {
3607 EClass.player.haltMove = false;
3608 ActionMode.Adv.TryCancelInteraction(sound: false);
3609 EInput.Consume(1);
3610 return;
3611 }
3612 if (EClass._zone.IsRegion)
3613 {
3615 {
3616 foreach (Chara member in EClass.pc.party.members)
3617 {
3618 if (member.hunger.value > 65)
3619 {
3620 member.InstantEat(null, sound: false);
3621 }
3622 }
3623 }
3624 Chara chara = null;
3626 if (cell2 != null && (cell2.zone == null || (cell2.zone is Zone_Field && !cell2.zone.IsPCFaction)))
3627 {
3628 foreach (Chara chara2 in EClass._map.charas)
3629 {
3630 if (!chara2.IsPCFactionOrMinion && !chara2.IsGlobal && chara2.pos.Equals(EClass.pc.pos))
3631 {
3632 chara = chara2;
3633 break;
3634 }
3635 }
3636 }
3637 if (chara != null)
3638 {
3640 {
3641 EClass.player.safeTravel = 5 + EClass.rnd(5);
3642 }
3643 EClass._zone.RemoveCard(chara);
3644 Msg.Say("encounter");
3645 EClass.player.EnterLocalZone(encounter: true, chara);
3646 }
3647 else if (EClass.player.safeTravel <= 0)
3648 {
3649 if (cell2 != null && cell2.zone == null && !EClass.debug.ignoreEncounter)
3650 {
3652 if (!tileInfo.shore)
3653 {
3654 bool num = EClass.pc.HasCondition<ConWardMonster>();
3655 bool flag = EClass.pc.HasCondition<ConDrawMonster>();
3656 bool flag2 = EClass.game.quests.Get<QuestEscort>() != null;
3657 int num2 = (tileInfo.isRoad ? 22 : 12);
3658 if (flag2)
3659 {
3660 num2 = (tileInfo.isRoad ? 16 : 10);
3661 }
3662 if (num)
3663 {
3664 num2 *= (flag2 ? 2 : 20);
3665 }
3666 if (flag)
3667 {
3668 num2 /= 2;
3669 }
3670 if (EClass.rnd(num2) == 0)
3671 {
3672 Msg.Say("encounter");
3673 if (!flag)
3674 {
3675 EClass.player.safeTravel = 5 + EClass.rnd(5);
3676 }
3677 EClass.player.EnterLocalZone(encounter: true);
3678 }
3679 }
3680 }
3681 }
3682 else
3683 {
3685 }
3686 }
3687 }
3688 EClass.player.pickupDelay = 0f;
3689 if (EClass.player.returnInfo != null)
3690 {
3692 if (EClass.player.returnInfo.turns <= 0)
3693 {
3695 {
3696 int uidDest = EClass.player.returnInfo.uidDest;
3697 Zone zone = null;
3698 if (uidDest != 0)
3699 {
3700 zone = EClass.game.spatials.map.TryGetValue(uidDest) as Zone;
3701 }
3702 if (zone == null || zone.destryoed)
3703 {
3704 zone = EClass.world.region;
3705 }
3707 {
3708 Msg.Say("returnFail");
3709 }
3710 else
3711 {
3712 Msg.Say("returnComplete");
3713 EClass.player.uidLastTravelZone = 0;
3715 EClass.player.lastZonePos = null;
3716 }
3717 EClass.player.returnInfo = null;
3718 return;
3719 }
3720 EClass.player.returnInfo = null;
3721 Msg.Say("returnOverweight");
3722 }
3723 }
3724 if ((HasNoGoal || !ai.IsRunning) && !WillConsumeTurn())
3725 {
3727 return;
3728 }
3731 {
3732 RecipeUpdater.dirty = true;
3733 }
3735 }
3736 else
3737 {
3738 actTime = EClass.player.baseActTime * Mathf.Max(0.1f, (float)EClass.pc.Speed / (float)Speed);
3739 hasMovedThisTurn = false;
3740 }
3743 {
3744 return;
3745 }
3747 if (host != null && !consumeTurn)
3748 {
3749 if (host.ride == this && ((host.hasMovedThisTurn && IsInCombat) || (enemy != null && turn % 3 != 0)))
3750 {
3751 consumeTurn = true;
3752 }
3753 if (host.parasite == this && enemy != null && EClass.rnd(10) > EClass.rnd(host.Evalue(227) + 10))
3754 {
3755 if (Dist(enemy) < 3 && EClass.rnd(2) == 0)
3756 {
3757 Say("parasite_fail", this, host);
3758 if (EClass.rnd(2) == 0 && GetInt(106) == 0)
3759 {
3760 Talk("parasite_fail");
3761 }
3762 }
3763 consumeTurn = true;
3764 }
3765 }
3766 if (consumeTurn)
3767 {
3768 if (IsPC)
3769 {
3771 }
3772 }
3773 else
3774 {
3775 if (base.isRestrained)
3776 {
3777 TryUnrestrain();
3778 }
3779 if (enemy != null)
3780 {
3782 {
3783 enemy = null;
3784 }
3785 else if (!IsPC && (ai.CancelOnAggro || !ai.IsRunning))
3786 {
3787 SetAIAggro();
3788 }
3789 }
3790 if (HasNoGoal || !ai.IsRunning)
3791 {
3792 ChooseNewGoal();
3793 }
3794 ai.Tick();
3795 }
3796 Cell cell = base.Cell;
3797 if (cell.IsTopWaterAndNoSnow && !cell.isFloating)
3798 {
3799 AddCondition<ConWet>(50);
3800 if (pos.IsHotSpring)
3801 {
3802 hygiene.Mod(2);
3803 }
3804 }
3805 if (IsPC && !EClass._zone.IsRegion && cell.CanSuffocate())
3806 {
3807 AddCondition<ConSuffocation>(800 / (100 + EvalueMax(200, -5) * 10));
3808 }
3809 CellEffect e;
3810 if (cell.effect != null)
3811 {
3812 e = cell.effect;
3813 switch (e.id)
3814 {
3815 case 1:
3816 case 2:
3817 case 4:
3818 if (IsLevitating)
3819 {
3820 Say("levitating");
3821 break;
3822 }
3823 AddCondition<ConWet>(50);
3824 ProcEffect();
3825 break;
3826 case 3:
3827 PlaySound("fire_step");
3828 AddCondition<ConBurning>(30);
3829 break;
3830 case 5:
3831 if (!isWet)
3832 {
3833 PlaySound("bubble");
3834 AddCondition<ConWet>(30);
3835 ProcEffect();
3836 }
3837 break;
3838 case 6:
3839 if (hasMovedThisTurn)
3840 {
3841 Say("abMistOfDarkness_step", this);
3842 }
3843 break;
3844 }
3845 }
3846 if (IsPC)
3847 {
3848 if (EClass.player.currentHotItem.Thing != null)
3849 {
3851 }
3853 }
3854 void ClearEffect()
3855 {
3856 EClass._map.SetLiquid(cell.x, cell.z, 0, 0);
3857 }
3858 void ProcEffect()
3859 {
3860 if (e.idEffect != 0)
3861 {
3862 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
3863 {
3864 aliasEle = EClass.sources.elements.map[e.idEle].alias,
3865 n1 = e.n1
3866 });
3867 ClearEffect();
3868 }
3869 }
3870 }
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:61
void TryUnrestrain(bool force=false, Chara c=null)
Definition: Card.cs:6297
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
bool IsTopWaterAndNoSnow
Definition: Cell.cs:712
byte z
Definition: Cell.cs:58
byte x
Definition: Cell.cs:56
void InstantEat(Thing t=null, bool sound=true)
Definition: Chara.cs:6840
int Speed
Definition: Chara.cs:906
static bool consumeTurn
Definition: Chara.cs:165
void SetAIAggro()
Definition: Chara.cs:8035
void ChooseNewGoal()
Definition: Chara.cs:7941
bool WillConsumeTurn()
Definition: Chara.cs:3343
bool ignoreEncounter
Definition: CoreDebug.cs:200
bool shore
Definition: EloMap.cs:50
TileInfo GetTileInfo(int gx, int gy)
Definition: EloMap.cs:287
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:1464
int turns
Definition: Player.cs:74
bool haltMove
Definition: Player.cs:972
float baseActTime
Definition: Player.cs:1000
void EnterLocalZone(bool encounter=false, Chara mob=null)
Definition: Player.cs:1736
HotItem currentHotItem
Definition: Player.cs:901
int safeTravel
Definition: Player.cs:727
int eloY
Definition: Point.cs:81
int eloX
Definition: Point.cs:79
bool IsHotSpring
Definition: Point.cs:351
bool destryoed
Definition: Spatial.cs:45
virtual void OnTickHeld()
Definition: Trait.cs:1000
Definition: ActRef.cs:2

References EClass._map, EClass._zone, Game.activeZone, ActionMode.Adv, CoreConfig.GameConfig.alwaysUpdateRecipe, ConfigPreference.autoEat, Player.baseActTime, burden, AIAct.CancelOnAggro, Cell.CanSuffocate(), Map.charas, Core.config, Game.config, EInput.Consume(), EClass.core, Player.currentHotItem, EClass.debug, Spatial.destryoed, Cell.effect, Scene.elomap, Point.eloX, Point.eloY, Player.EnterLocalZone(), Point.Equals(), Card.Evalue(), CoreConfig.game, EClass.game, QuestManager.Get(), EloMap.GetCell(), Stats.GetPhase(), EloMap.GetTileInfo(), Player.haltMove, HasCondition(), hasMovedThisTurn, hunger, CellEffect.id, CellEffect.idEffect, CoreDebug.ignoreEncounter, CoreDebug.ignoreWeight, InstantEat(), IsAliveInCurrentZone, CellEffect.isBlessed, CellEffect.isCursed, Cell.isFloating, IsGlobal, CellEffect.isHostileAct, Zone.IsPCFaction, Card.IsPCFactionOrMinion, Spatial.IsRegion, AIAct.IsRunning, Cell.IsTopWaterAndNoSnow, SpatialManager.map, Party.members, Stats.Mod(), MoveZone(), BaseGameScreen.OnEndPlayerTurn(), Trait.OnStepped(), Trait.OnTickHeld(), parasite, party, EClass.pc, EClass.player, Card.pos, CellEffect.power, Game.Config.preference, ActEffect.ProcAt(), Game.quests, World.region, Zone.RemoveCard(), Player.returnInfo, ride, EClass.rnd(), Player.safeTravel, Msg.Say(), EClass.scene, EClass.screen, Map.SetLiquid(), AM_Adv.SetTurbo(), EloMap.TileInfo.shore, Game.spatials, Speed, Player.stats, HotItem.Thing, AIAct.Tick(), Card.trait, AM_Adv.TryCancelInteraction(), Player.ReturnInfo.turns, Player.Stats.turns, Player.ReturnInfo.uidDest, Stats.value, EClass.world, Cell.x, Cell.z, and EloMap.Cell.zone.

◆ TickConditions()

void Chara.TickConditions ( )
inline

Definition at line 3355 of file Chara.cs.

3356 {
3357 if (_cooldowns != null)
3358 {
3359 TickCooldown();
3360 }
3361 turn++;
3362 consumeTurn = false;
3363 preventRegen = false;
3364 emoIcon = Emo2.none;
3365 if (base.isSummon)
3366 {
3367 base.c_summonDuration--;
3368 if (base.c_summonDuration <= 0)
3369 {
3370 Die();
3371 return;
3372 }
3373 }
3375 {
3376 AddCondition<ConWet>(20);
3377 }
3378 switch (turn % 50)
3379 {
3380 case 0:
3381 happiness = (hunger.value + stamina.value + depression.value + bladder.value + hygiene.value) / 5;
3382 break;
3383 case 1:
3384 if (!IsPC || !EClass.debug.godMode)
3385 {
3386 if (EClass.rnd(2) == 0)
3387 {
3388 sleepiness.Mod(1);
3389 }
3390 if (EClass.rnd(3) == 0)
3391 {
3392 hunger.Mod(1);
3393 }
3394 if (IsPC && (sleepiness.GetPhase() != 0 || stamina.GetPhase() <= 1))
3395 {
3396 Tutorial.Play("sleep");
3397 }
3398 }
3399 break;
3400 case 2:
3401 if (parasite != null)
3402 {
3403 ModExp(227, (EClass._zone.IsRegion ? 5 : 40) * 100 / Mathf.Max(100, 100 + (elements.Base(227) - parasite.LV) * 25));
3404 }
3405 if (ride != null)
3406 {
3407 ModExp(226, (EClass._zone.IsRegion ? 5 : 40) * 100 / Mathf.Max(100, 100 + (elements.Base(226) - ride.LV) * 25));
3408 }
3409 break;
3410 case 3:
3411 {
3412 int phase = hygiene.GetPhase();
3413 int num = 0;
3414 num = ((!IsPC) ? ((phase > 3) ? 50 : 0) : ((phase > 3) ? 50 : 0));
3415 if (num > EClass.rnd(100))
3416 {
3417 hygiene.Mod(-1);
3418 }
3419 break;
3420 }
3421 }
3422 if (turn % 500 == 0)
3423 {
3425 }
3426 if (IsPCParty)
3427 {
3428 if (dirtyWeight)
3429 {
3430 CalcBurden();
3431 }
3432 int phase2 = burden.GetPhase();
3433 int phase3 = hunger.GetPhase();
3434 if (phase3 >= 4)
3435 {
3436 preventRegen = true;
3437 }
3438 if (EClass.rnd(EClass._zone.IsRegion ? 100 : 30) == 0 && phase2 >= 3)
3439 {
3440 Say("dmgBurden", this);
3441 DamageHP(MaxHP * (base.ChildrenWeight * 100 / WeightLimit) / 1000 + 1, AttackSource.Burden);
3442 if (isDead)
3443 {
3444 return;
3445 }
3446 }
3447 if (EClass.rnd(12) == 0)
3448 {
3449 if (IsPC)
3450 {
3451 if (phase2 > 0)
3452 {
3453 ModExp(207, 1 + phase2 * phase2);
3454 }
3455 }
3456 else
3457 {
3458 ModExp(207, 4);
3459 }
3460 }
3461 if (IsPC)
3462 {
3463 if (phase3 >= 5)
3464 {
3465 if (!(ai is AI_Eat) && EClass.rnd(5) == 0)
3466 {
3467 DamageHP(1 + EClass.rnd(2) + MaxHP / 50, AttackSource.Hunger);
3468 }
3469 if (!isDead && EClass.rnd(3) == 0)
3470 {
3471 stamina.Mod(-1);
3472 }
3473 }
3474 if (isDead)
3475 {
3476 return;
3477 }
3478 phase3 = stamina.GetPhase();
3479 if (phase3 <= 0)
3480 {
3481 preventRegen = true;
3482 }
3484 {
3485 if (EClass.rnd(100) == 0 && !isConfused)
3486 {
3487 Msg.Say("rain_confuse");
3488 AddCondition<ConConfuse>(500);
3489 }
3490 if (EClass.rnd(300) == 0 && !isBlind)
3491 {
3492 Msg.Say("rain_confuse");
3493 AddCondition<ConBlind>(200);
3494 }
3495 }
3496 if (turn % (200000 / Mathf.Max(100 + Evalue(409) * 10, 50)) == 0)
3497 {
3498 ModCorruption(1);
3499 }
3500 }
3501 }
3502 if (!IsPC)
3503 {
3504 int num2 = Evalue(409);
3505 if (num2 > 0 && turn % (200000 / Mathf.Max(100 + num2 * 10, 50)) == 0)
3506 {
3507 ModCorruption(1);
3508 }
3509 }
3510 for (int num3 = conditions.Count - 1; num3 >= 0; num3--)
3511 {
3512 if (num3 < conditions.Count)
3513 {
3514 Condition condition = conditions[num3];
3515 if (!condition.TimeBased)
3516 {
3517 condition.Tick();
3518 }
3519 if (!condition.IsKilled)
3520 {
3521 if (condition.ConsumeTurn)
3522 {
3523 consumeTurn = true;
3524 }
3525 if (condition.PreventRegen)
3526 {
3527 preventRegen = true;
3528 }
3529 if (condition.EmoIcon != 0 && condition.EmoIcon > emoIcon)
3530 {
3531 emoIcon = condition.EmoIcon;
3532 }
3533 }
3534 if (isDead)
3535 {
3536 return;
3537 }
3538 }
3539 }
3540 if (!preventRegen)
3541 {
3542 if (EClass.rnd(25) == 0 && base.hp < MaxHP)
3543 {
3544 HealHP(EClass.rnd(Evalue(300) / 3 + 1) + 1);
3545 elements.ModExp(300, 8);
3546 }
3547 if (EClass.rnd(8) == 0 && mana.value < mana.max)
3548 {
3549 mana.Mod(EClass.rnd(Evalue(301) / 2 + 1) + 1);
3550 elements.ModExp(301, 8);
3551 }
3552 if (EClass.rnd(20) == 0 && !IsPC && stamina.value < stamina.max)
3553 {
3554 stamina.Mod(EClass.rnd(5) + 1);
3555 }
3556 }
3557 }
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:81
bool HasRoof
Definition: Cell.cs:648
void TickCooldown()
Definition: Chara.cs:7922
override void Die(Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None)
Definition: Chara.cs:4800
void DiminishTempElements(int a=1)
Definition: Chara.cs:9269
Emo2 emoIcon
Definition: Chara.cs:103
void ModCorruption(int a)
Definition: Chara.cs:8906
bool isBlind
Definition: Chara.cs:125
static bool preventRegen
Definition: Chara.cs:167
void CalcBurden()
Definition: Chara.cs:1573
virtual bool IsKilled
Definition: Condition.cs:7
override void Tick()
Definition: Condition.cs:70
bool IsIndoor
Definition: Map.cs:131
static void Play(string idStep)
Definition: Tutorial.cs:7
bool IsRaining
Definition: Weather.cs:117

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

Referenced by _Move().

◆ TickCooldown()

void Chara.TickCooldown ( )
inline

Definition at line 7922 of file Chara.cs.

7923 {
7924 for (int num = _cooldowns.Count - 1; num >= 0; num--)
7925 {
7926 if (_cooldowns[num] % 1000 == 1)
7927 {
7928 _cooldowns.RemoveAt(num);
7929 }
7930 else
7931 {
7932 _cooldowns[num]--;
7933 }
7934 }
7935 if (_cooldowns.Count == 0)
7936 {
7937 _cooldowns = null;
7938 }
7939 }

◆ TickWork()

void Chara.TickWork ( VirtualDate  date)
inline

Definition at line 8317 of file Chara.cs.

8318 {
8320 if (span != TimeTable.Span.Work && span != 0)
8321 {
8322 return;
8323 }
8324 WorkSummary workSummary = GetWorkSummary();
8325 if (span == TimeTable.Span.Work)
8326 {
8327 if (workSummary.work != null)
8328 {
8329 PerformWork(workSummary.work, isHobby: false, date.IsRealTime);
8330 }
8331 }
8332 else if (workSummary.hobbies.Count > 0)
8333 {
8334 PerformWork(workSummary.hobbies.RandomItem(), isHobby: true, date.IsRealTime);
8335 }
8336 }
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 981 of file Chara.cs.

982 {
983 return base.Name + "(" + ai?.ToString() + ")" + pos?.ToString() + "/" + base.ExistsOnMap + "/" + isDead;
984 }
override string ToString()
Definition: Point.cs:500

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

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

◆ TryAbsorbRod()

void Chara.TryAbsorbRod ( Thing  t)
inline

Definition at line 3984 of file Chara.cs.

3985 {
3986 if (!IsPC || !(t.trait is TraitRod) || t.c_charges <= 0 || !HasElement(1564))
3987 {
3988 return;
3989 }
3990 Say("absorbRod", this, t);
3991 TraitRod rod = t.trait as TraitRod;
3992 bool flag = false;
3993 if (rod.source != null)
3994 {
3995 using IEnumerator<SourceElement.Row> enumerator = EClass.sources.elements.rows.Where((SourceElement.Row a) => a.id == rod.source.id).GetEnumerator();
3996 if (enumerator.MoveNext())
3997 {
3998 SourceElement.Row current = enumerator.Current;
3999 if (IsPC)
4000 {
4001 GainAbility(current.id, t.c_charges * 100);
4002 flag = true;
4003 }
4004 }
4005 }
4006 if (!flag)
4007 {
4008 mana.Mod(-50 * t.c_charges);
4009 }
4010 t.c_charges = 0;
4012 }
int c_charges
Definition: Card.cs:1205
void GainAbility(int ele, int mtp=100)
Definition: Chara.cs:9111

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

6642 {
6643 if (!IsPCFaction && !IsGuest())
6644 {
6645 return null;
6646 }
6647 foreach (Card item in EClass._map.props.installed.all)
6648 {
6649 if (item.trait is TraitBed traitBed && traitBed.CanAssign(this))
6650 {
6651 traitBed.AddHolder(this);
6652 Msg.Say("claimBed", this);
6653 return traitBed;
6654 }
6655 }
6656 return null;
6657 }
bool CanAssign(Chara c)
Definition: TraitBed.cs:154

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

5083 {
5085 {
5086 return;
5087 }
5088 int num = 0;
5089 bool flag = false;
5090 bool flag2 = false;
5091 Point point = pos.GetNearestPoint(allowBlock: true, allowChara: false, allowInstalled: false, ignoreCenter: true) ?? pos;
5092 TreasureType type = TreasureType.BossQuest;
5093 if (EClass._zone.Boss == this)
5094 {
5095 type = TreasureType.BossNefia;
5096 num = 2 + EClass.rnd(2);
5097 flag = (flag2 = true);
5098 EClass._zone.Boss = null;
5099 Msg.Say("boss_win", EClass._zone.Name);
5101 {
5102 Msg.Say("boss_win_void", EClass._zone.Name);
5103 EClass.player.flags.KilledBossInVoid = true;
5104 }
5105 if (EClass._zone.IsNefia)
5106 {
5108 EClass.Sound.StopBGM(2f);
5109 SE.Play("Jingle/fanfare2");
5110 EClass._zone.SetBGM(114);
5111 }
5114 }
5115 switch (id)
5116 {
5117 case "vernis_boss":
5118 num = 5;
5119 flag = (flag2 = true);
5120 EClass.Sound.StopBGM(3f);
5121 EClass._zone.SetBGM(1, refresh: false);
5122 if (EClass.game.quests.GetPhase<QuestVernis>() == 8)
5123 {
5124 EClass.game.quests.Get<QuestVernis>().UpdateOnTalk();
5125 }
5126 break;
5127 case "melilith_boss":
5128 num = 5;
5129 flag = (flag2 = true);
5130 EClass.Sound.StopBGM(3f);
5131 EClass._zone.SetBGM(1, refresh: false);
5132 break;
5133 case "isygarad":
5134 {
5135 num = 5;
5136 flag = (flag2 = true);
5137 QuestExploration questExploration = EClass.game.quests.Get<QuestExploration>();
5138 if (questExploration != null)
5139 {
5140 SE.Play("kill_boss");
5141 questExploration.ChangePhase(3);
5142 EClass.Sound.StopBGM(3f);
5143 EClass._zone.SetBGM(1, refresh: false);
5144 }
5145 break;
5146 }
5147 case "swordkeeper":
5148 num = 10;
5149 flag = true;
5150 SE.Play("kill_boss");
5151 SoundManager.ForceBGM();
5152 LayerDrama.Activate("_event", "event", "swordkeeper_defeat");
5153 break;
5154 }
5155 if (flag)
5156 {
5157 SE.Play("kill_boss");
5158 }
5159 if (num != 0)
5160 {
5161 EClass.player.willAutoSave = true;
5162 Thing thing = ThingGen.CreateTreasure("chest_boss", base.LV, type);
5163 point.SetBlock();
5164 point.SetObj();
5165 EClass._zone.AddCard(thing, point).Install();
5166 ThingGen.TryLickChest(thing);
5167 }
5168 if (flag2)
5169 {
5171 }
5172 }
TreasureType
Definition: TreasureType.cs:2
bool KilledBossInVoid
Definition: Player.cs:306
void ModFame(int a)
Definition: Player.cs:1879
void SetObj(int id=0, int value=1, int dir=0)
Definition: Point.cs:892
void SetBlock(int idMat=0, int idBlock=0)
Definition: Point.cs:882
void ChangePhase(int a)
Definition: Quest.cs:572
bool isConquered
Definition: Spatial.cs:382
static void TryLickChest(Thing chest)
Definition: ThingGen.cs:348
static Thing CreateTreasure(string id, int lv, TreasureType type=TreasureType.Map)
Definition: ThingGen.cs:203
static Thing CreateScroll(int ele, int num=1)
Definition: ThingGen.cs:163
void SetBGM(List< int > ids, bool refresh=true)
Definition: Zone.cs:2706
virtual bool IsNefia
Definition: Zone.cs:278
Chara Boss
Definition: Zone.cs:83

References EClass._zone, LayerDrama.Activate(), Zone.AddCard(), Zone.Boss, Quest.ChangePhase(), ThingGen.CreateScroll(), ThingGen.CreateTreasure(), Zone.DangerLv, EClass.debug, CoreDebug.enable, Player.flags, EClass.game, QuestManager.Get(), Point.GetNearestPoint(), Zone.GetTopZone(), Card.Install(), Spatial.isConquered, Zone.IsNefia, Player.Flags.KilledBossInVoid, Player.ModFame(), Player.ModKarma(), Spatial.Name, EClass.player, Game.quests, EClass.rnd(), EClass.rndHalf(), Msg.Say(), Zone.SetBGM(), Point.SetBlock(), Point.SetObj(), EClass.Sound, and ThingGen.TryLickChest().

Referenced by ActEffect.Proc().

◆ TryDropCarryOnly()

void Chara.TryDropCarryOnly ( )
inline

Definition at line 4201 of file Chara.cs.

4202 {
4203 if (held != null && held.trait.CanOnlyCarry)
4204 {
4205 DropHeld();
4206 }
4207 foreach (Thing item in things.List((Thing t) => t.trait.CanOnlyCarry))
4208 {
4209 DropThing(item);
4210 }
4211 }
void DropThing(Thing t, int num=-1)
Definition: Chara.cs:4233
List< Thing > List(Func< Thing, bool > func, bool onlyAccessible=false)

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

◆ TryEquip()

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

Definition at line 6961 of file Chara.cs.

6962 {
6963 if (!ShouldEquip(t, useFav))
6964 {
6965 return false;
6966 }
6967 if (t.category.slot == 0)
6968 {
6969 return false;
6970 }
6971 if (useFav)
6972 {
6973 BodySlot slot = body.GetSlot(t);
6974 switch (GetFavAttackStyle())
6975 {
6976 case AttackStyle.Default:
6977 case AttackStyle.TwoHand:
6978 if (t.IsMeleeWeapon)
6979 {
6980 slot = body.slotMainHand;
6981 }
6982 break;
6983 case AttackStyle.Shield:
6984 if (t.IsMeleeWeapon)
6985 {
6986 slot = body.slotMainHand;
6987 }
6988 break;
6989 }
6990 body.Equip(t, slot);
6991 }
6992 else
6993 {
6994 body.Equip(t);
6995 }
6996 Say("equip", this, t);
6997 return true;
6998 }
bool ShouldEquip(Thing t, bool useFav=false)
Definition: Chara.cs:6879

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

7082 {
7083 if (IsPC)
7084 {
7086 if (thing?.trait is TraitToolRange && CanEquipRanged(thing))
7087 {
7088 ranged = thing;
7089 return true;
7090 }
7091 return false;
7092 }
7093 if (ranged != null && ranged.parent == this)
7094 {
7095 return true;
7096 }
7098 return ranged != null;
7099 }
Thing GetBestRangedWeapon()
Definition: Chara.cs:7066

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

7006 {
7007 Thing dest = null;
7008 if (IsPC)
7009 {
7011 {
7012 return FindThrowable(hotbar: true);
7013 }
7014 return null;
7015 }
7016 things.Foreach(delegate(Thing t)
7017 {
7018 if (t.HasTag(CTAG.throwWeapon) || (!base.IsPCFactionOrMinion && t.HasTag(CTAG.throwWeaponEnemy)))
7019 {
7020 dest = t;
7021 }
7022 });
7023 return dest;
7024 Thing FindThrowable(bool hotbar)
7025 {
7026 things.Foreach(delegate(Thing t)
7027 {
7028 if (dest == null)
7029 {
7030 if (t.IsHotItem)
7031 {
7032 if (!hotbar)
7033 {
7034 return;
7035 }
7036 }
7037 else if (hotbar)
7038 {
7039 return;
7040 }
7041 if (t.HasTag(CTAG.throwWeapon))
7042 {
7043 dest = t;
7044 }
7045 }
7046 });
7047 return dest;
7048 }
7049 }

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

4063 {
4064 if (held == t)
4065 {
4066 return true;
4067 }
4068 if (t.isDestroyed || t.Num <= 0)
4069 {
4070 return false;
4071 }
4072 if (!CanPick(t))
4073 {
4074 if (t.parent == null)
4075 {
4076 EClass._zone.AddCard(t, pos);
4077 }
4078 return false;
4079 }
4080 HoldCard(t, num);
4081 return true;
4082 }
bool CanPick(Card c)
Definition: Chara.cs:3882
void HoldCard(Card t, int num=-1)
Definition: Chara.cs:4084

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

7212 {
7213 int num = Evalue(289);
7214 if (num == 0)
7215 {
7216 return false;
7217 }
7218 int lV = t.LV;
7219 if (EClass.rnd(num * num + 5) > EClass.rnd(lV * lV) * 20)
7220 {
7221 t.Identify(show, (num >= 20) ? IDTSource.SkillHigh : IDTSource.Skill);
7222 int num2 = 50;
7223 if (lV > num)
7224 {
7225 num2 += (lV - num) * 10;
7226 }
7227 elements.ModExp(289, Mathf.Min(num2, 1000));
7228 return true;
7229 }
7230 return false;
7231 }
IDTSource
Definition: IDTSource.cs:2
Thing Identify(bool show=true, IDTSource idtSource=IDTSource.Identify)
Definition: Thing.cs:1959

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

2423 {
2424 foreach (Condition condition in conditions)
2425 {
2426 if (!condition.TryMove(newPoint))
2427 {
2428 return MoveResult.Fail;
2429 }
2430 }
2431 if (base.isRestrained)
2432 {
2433 if (!IsPC)
2434 {
2435 return MoveResult.Fail;
2436 }
2437 base.isRestrained = false;
2438 }
2439 if (!CanMoveTo(newPoint, allowDestroyPath))
2440 {
2441 return MoveResult.Fail;
2442 }
2443 return _Move(newPoint);
2444 }
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 2382 of file Chara.cs.

2383 {
2385 {
2386 return MoveResult.Fail;
2387 }
2388 Point point = p.Copy();
2389 int num = p.x - pos.x;
2390 int num2 = p.z - pos.z;
2391 if (num > 1)
2392 {
2393 num = 1;
2394 }
2395 else if (num < -1)
2396 {
2397 num = -1;
2398 }
2399 if (num2 > 1)
2400 {
2401 num2 = 1;
2402 }
2403 else if (num2 < -1)
2404 {
2405 num2 = -1;
2406 }
2407 if (num == 0 && num2 == 0)
2408 {
2409 num = EClass.rnd(3) - 1;
2410 num2 = EClass.rnd(3) - 1;
2411 }
2412 point.Set(pos);
2413 point.x -= num;
2414 point.z -= num2;
2415 if (point.IsValid && !point.HasChara)
2416 {
2417 return TryMove(point, allowDestroyPath: false);
2418 }
2419 return MoveResult.Fail;
2420 }
bool TooHeavyToMove()
Definition: Player.cs:2331

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 GoalCombat.Run(), ConFear.Tick(), and GoalCombat.TryMove().

◆ TryMoveTowards()

MoveResult Chara.TryMoveTowards ( Point  p)
inline

Definition at line 2320 of file Chara.cs.

2321 {
2322 if (p.Equals(pos))
2323 {
2324 return MoveResult.Success;
2325 }
2327 {
2328 return MoveResult.Fail;
2329 }
2330 bool flag = true;
2331 Point point = null;
2332 _sharedPos.Set(p);
2333 if (CanDestroyPath())
2334 {
2336 {
2337 return MoveResult.Success;
2338 }
2339 Debug.Log(CanMoveTo(pos));
2341 }
2342 int num = pos.Distance(p);
2343 PathProgress pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Default, num + 4, 1);
2344 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 4)
2345 {
2346 PathFinderNode pathFinderNode = pathProgress.nodes[pathProgress.nodes.Count - 1];
2347 if (TryMove(new Point(pathFinderNode.X, pathFinderNode.Z)) == MoveResult.Success)
2348 {
2349 return MoveResult.Success;
2350 }
2351 }
2352 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Combat, num + 4, 1);
2353 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 4)
2354 {
2355 PathFinderNode pathFinderNode2 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2356 if (TryMove(new Point(pathFinderNode2.X, pathFinderNode2.Z)) == MoveResult.Success)
2357 {
2358 return MoveResult.Success;
2359 }
2360 }
2361 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Default, num + 25, 2);
2362 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 25)
2363 {
2364 PathFinderNode pathFinderNode3 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2365 if (TryMove(new Point(pathFinderNode3.X, pathFinderNode3.Z)) == MoveResult.Success)
2366 {
2367 return MoveResult.Success;
2368 }
2369 }
2370 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Combat, num + 25, 2);
2371 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 25)
2372 {
2373 PathFinderNode pathFinderNode4 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2374 if (TryMove(new Point(pathFinderNode4.X, pathFinderNode4.Z)) == MoveResult.Success)
2375 {
2376 return MoveResult.Success;
2377 }
2378 }
2379 return MoveResult.Fail;
2380 }
static Point _sharedPos
Definition: Chara.cs:159
void RequestPathImmediate(PathProgress progress)
Definition: PathManager.cs:41
List< PathFinderNode > nodes
Definition: PathProgress.cs:16
Point GetPointTowards(Point dest)
Definition: Point.cs:773

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

8748 {
8749 if (TC == null || TC.HasCondition<ConInvulnerable>() || TC.Evalue(1421) > 0 || !TC.ExistsOnMap)
8750 {
8751 return false;
8752 }
8753 if (TC.hp > TC.MaxHP * Mathf.Min(5 + (int)Mathf.Sqrt(power), harvest ? 35 : 25) / 100)
8754 {
8755 return false;
8756 }
8757 if (TC.HasElement(427))
8758 {
8759 return false;
8760 }
8761 if (TC.IsPC && EClass.player.invlunerable)
8762 {
8763 return false;
8764 }
8765 PlaySound("hit_finish");
8766 Say("finish");
8767 Say("finish2", this, TC);
8768 TC.DamageHP(TC.MaxHP, AttackSource.Finish, this);
8769 return false;
8770 }
@ harvest
bool invlunerable
Definition: Player.cs:974
Definition: TC.cs:4

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

Referenced by ActEffect.Proc().

◆ TryNullifyCurse()

bool Chara.TryNullifyCurse ( )
inline

Definition at line 9131 of file Chara.cs.

9132 {
9133 if (IsPCParty)
9134 {
9135 foreach (Chara member in EClass.pc.party.members)
9136 {
9137 if (member.HasElement(1641) && EClass.rnd(3) != 0)
9138 {
9139 Msg.Say("curse_nullify", member);
9140 return true;
9141 }
9142 }
9143 }
9144 else if (HasElement(1641) && EClass.rnd(3) != 0)
9145 {
9146 Say("curse_nullify", this);
9147 return true;
9148 }
9149 if (GetCondition<ConHolyVeil>() != null && EClass.rnd(5) != 0)
9150 {
9151 Say("curse_nullify", this);
9152 return true;
9153 }
9154 return false;
9155 }

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

◆ TryPickGroundItem()

void Chara.TryPickGroundItem ( )
inline

Definition at line 4038 of file Chara.cs.

4039 {
4040 foreach (Card item in pos.ListCards())
4041 {
4042 if ((IsPC || !(EClass.pc.ai is AI_UseCrafter aI_UseCrafter) || !aI_UseCrafter.ings.Contains(item)) && item.isThing && item.placeState == PlaceState.roaming && CanPick(item))
4043 {
4044 Thing thing = Pick(item.Thing);
4045 if (thing != null && !IsPC)
4046 {
4047 thing.isNPCProperty = true;
4048 }
4049 break;
4050 }
4051 }
4052 }

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

Referenced by AI_Fish.Run().

◆ TryPoisonPotion()

Thing Chara.TryPoisonPotion ( Thing  t)
inline

Definition at line 3970 of file Chara.cs.

3971 {
3972 if (t.trait is TraitPotion && t.id != "1165" && !t.source.tag.Contains("neg") && EClass.rnd(2) == 0 && HasElement(1565))
3973 {
3974 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)
3975 .id;
3976 Say("poisonDrip", this);
3977 int num = t.Num;
3978 t.Destroy();
3979 t = ThingGen.Create(text).SetNum(num);
3980 }
3981 return t;
3982 }
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 2907 of file Chara.cs.

2908 {
2909 List<Chara> list = point.ListCharas();
2910 if (list.Count == 0)
2911 {
2912 return;
2913 }
2914 list.Copy().ForeachReverse(delegate(Chara c)
2915 {
2916 if (!c.ai.IsMoveAI && !c.IsPC && c.trait.CanBePushed && c != this && !c.noMove && (!EClass._zone.IsRegion || c.IsPCFactionOrMinion))
2917 {
2918 List<Point> list2 = new List<Point>();
2919 for (int i = point.x - 1; i <= point.x + 1; i++)
2920 {
2921 for (int j = point.z - 1; j <= point.z + 1; j++)
2922 {
2923 if (i != point.x || j != point.z)
2924 {
2925 Point point2 = new Point(i, j);
2926 if (point2.IsValid && !point2.HasChara && !point2.IsBlocked && !point2.cell.hasDoor && !point2.IsBlockByHeight(point))
2927 {
2928 list2.Add(point2);
2929 }
2930 }
2931 }
2932 }
2933 if (list2.Count > 0)
2934 {
2935 if (list2.Count > 1)
2936 {
2937 list2.ForeachReverse(delegate(Point p)
2938 {
2939 if (p.Equals(new Point(point.x + point.x - pos.x, point.z + point.z - pos.z)))
2940 {
2941 list2.Remove(p);
2942 }
2943 });
2944 }
2945 Point newPoint = list2.RandomItem();
2946 if (IsPC)
2947 {
2948 Say("displace", this, c);
2949 PlaySound("push");
2950 }
2951 else if (c.isSynced)
2952 {
2953 c.PlayEffect("push");
2954 }
2955 c.MoveByForce(newPoint, this, checkWall: true);
2956 if (!c.IsPC && c.trait is TraitRogue && EClass.rnd(3) == 0 && GetCurrency() > 20 && !HasElement(426))
2957 {
2958 int num = EClass.rndHalf(10 + Mathf.Min(GetCurrency() / 100, 1000));
2959 c.Talk("pushed");
2960 Say("pushed_money", this, c);
2961 ModCurrency(-num);
2962 c.ModCurrency(num);
2963 c.PlaySound("steal_money");
2964 }
2965 else if (IsPC && !c.IsPCParty && !c.IsUnique && c.IsHuman && EClass.rnd(5) == 0)
2966 {
2967 c.Talk("pushed");
2968 }
2969 }
2970 }
2971 });
2972 }
bool IsMoveAI
Definition: AIAct.cs:55

References EClass._zone, ai, TraitChara.CanBePushed, if(), IsHuman, 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 4054 of file Chara.cs.

4055 {
4056 if (!EClass._zone.TryAddThingInSharedContainer(t, containers) && dropIfFail)
4057 {
4058 EClass._zone.AddCard(t, pos);
4059 }
4060 }
bool TryAddThingInSharedContainer(Thing t, List< Thing > containers=null, bool add=true, bool msg=false, Chara chara=null, bool sharedOnly=true)
Definition: Zone.cs:2036

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

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

6660 {
6661 if (GetInt(113) != 0)
6662 {
6663 return;
6664 }
6665 _ListItems.Clear();
6666 Thing bestRangedWeapon = GetBestRangedWeapon();
6667 foreach (Thing thing in things)
6668 {
6669 if (!thing.IsAmmo)
6670 {
6671 if (thing.category.slot != 0 && !thing.isEquipped && !thing.HasTag(CTAG.gift))
6672 {
6673 _ListItems.Add(thing);
6674 }
6675 else if (thing.IsRangedWeapon && thing.category.slot == 0 && bestRangedWeapon != thing)
6676 {
6677 _ListItems.Add(thing);
6678 }
6679 }
6680 }
6681 if (_ListItems.Count == 0)
6682 {
6683 return;
6684 }
6685 List<Thing> containers2 = containers.ToList();
6686 foreach (Thing listItem in _ListItems)
6687 {
6688 EClass._zone.TryAddThingInSharedContainer(listItem, containers2, add: true, msg: true, this);
6689 }
6690 }
void Add(Act a, string s="")
Definition: ActPlan.cs:11
static List< Thing > _ListItems
Definition: Chara.cs:175

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

4015 {
4016 if (t.id == "axe")
4017 {
4018 Tutorial.Reserve("tool");
4019 }
4020 if (t.category.id == "mushroom")
4021 {
4022 Tutorial.Reserve("food");
4023 }
4024 if (t.category.id == "herb")
4025 {
4026 Tutorial.Reserve("herb");
4027 }
4028 if (t.id == "pasture")
4029 {
4030 Tutorial.Reserve("pasture");
4031 }
4032 if (t.id == "log")
4033 {
4034 Tutorial.Reserve("process");
4035 }
4036 }

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

◆ TryRestock()

void Chara.TryRestock ( bool  onCreate)
inline

Definition at line 4295 of file Chara.cs.

4296 {
4297 isOnCreate = onCreate;
4298 if (onCreate || (!IsPCFaction && (base.IsUnique || trait is TraitAdventurer || trait is TraitGuard)))
4299 {
4300 RestockEquip((!EClass.core.IsGameStarted || !(EClass._zone is Zone_Music)) && onCreate);
4301 }
4302 RestockInventory(onCreate);
4303 }
void RestockInventory(bool onCreate)
Definition: Chara.cs:4507
void RestockEquip(bool onCreate)
Definition: Chara.cs:4305

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

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

◆ TrySetEnemy()

void Chara.TrySetEnemy ( Chara  c)
inline

Definition at line 5675 of file Chara.cs.

5676 {
5677 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))
5678 {
5679 SetEnemy(c);
5680 }
5681 }

References Game.Config.autoCombat, ConfigAutoCombat.bDontChangeTarget, Game.config, EClass.game, hostility, IsPC, IsPCFaction, IsPCFactionMinion, and EClass.rnd().

Referenced by Card.DamageHP(), and GoalCombat.Run().

◆ TryTakeSharedItems() [1/2]

void Chara.TryTakeSharedItems ( bool  msg = true)
inline

Definition at line 6697 of file Chara.cs.

6698 {
6700 }
void TryTakeSharedItems(bool msg=true)
Definition: Chara.cs:6697

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

6703 {
6704 if (base.isSummon || (memberType == FactionMemberType.Livestock && homeBranch != null && !homeBranch.policies.IsActive(2715)))
6705 {
6706 return;
6707 }
6708 int num = 2;
6709 int num2 = 2;
6710 bool flag = GetInt(113) == 0;
6711 int num3 = 2;
6712 int num4 = 2;
6713 int num5 = 2;
6715 {
6716 num4 = 0;
6717 num5 = 0;
6718 }
6719 foreach (Thing thing3 in things)
6720 {
6721 if (CanEat(thing3, shouldEat))
6722 {
6723 num -= thing3.Num;
6724 }
6725 if (thing3.trait.GetHealAction(this) != null)
6726 {
6727 num2 -= thing3.Num;
6728 }
6729 if (thing3.id == "polish_powder")
6730 {
6731 num3 -= thing3.Num;
6732 }
6733 if (thing3.trait is TraitBlanketColdproof)
6734 {
6735 num4 -= thing3.Num;
6736 }
6737 if (thing3.trait is TraitBlanketFireproof)
6738 {
6739 num5 -= thing3.Num;
6740 }
6741 }
6742 _ListItems.Clear();
6743 foreach (Thing container in containers)
6744 {
6745 if (!container.IsSharedContainer)
6746 {
6747 continue;
6748 }
6749 foreach (Thing thing4 in container.things)
6750 {
6751 if (!thing4.c_isImportant)
6752 {
6753 if (num3 > 0 && thing4.id == "polish_powder")
6754 {
6755 _ListItems.Add(thing4);
6756 num3 -= thing4.Num;
6757 }
6758 else if (num4 > 0 && !HasElement(1236) && thing4.trait is TraitBlanketColdproof)
6759 {
6760 _ListItems.Add(thing4);
6761 num4 -= thing4.Num;
6762 }
6763 else if (num5 > 0 && thing4.trait is TraitBlanketFireproof)
6764 {
6765 _ListItems.Add(thing4);
6766 num5 -= thing4.Num;
6767 }
6768 else if (num > 0 && CanEat(thing4, shouldEat) && !thing4.c_isImportant)
6769 {
6770 _ListItems.Add(thing4);
6771 num -= thing4.Num;
6772 }
6773 else if (num2 > 0 && thing4.trait.GetHealAction(this) != null)
6774 {
6775 _ListItems.Add(thing4);
6776 num2 -= thing4.Num;
6777 }
6778 else if (flag && thing4.IsEquipmentOrRanged && !thing4.HasTag(CTAG.gift) && ShouldEquip(thing4, useFav: true))
6779 {
6780 _ListItems.Add(thing4);
6781 }
6782 }
6783 }
6784 }
6785 if (_ListItems.Count == 0)
6786 {
6787 return;
6788 }
6789 _ListItems.ForeachReverse(delegate(Thing t)
6790 {
6791 if (t.IsEquipmentOrRanged)
6792 {
6793 bool flag3 = false;
6794 int slot = t.category.slot;
6795 int equipValue = t.GetEquipValue();
6796 foreach (Thing listItem in _ListItems)
6797 {
6798 if (listItem.category.slot == slot && listItem.GetEquipValue() > equipValue)
6799 {
6800 flag3 = true;
6801 break;
6802 }
6803 }
6804 if (flag3)
6805 {
6806 _ListItems.Remove(t);
6807 }
6808 }
6809 });
6810 bool flag2 = false;
6811 foreach (Thing listItem2 in _ListItems)
6812 {
6813 Thing thing = listItem2;
6814 if (things.IsFull(thing))
6815 {
6816 break;
6817 }
6818 Thing thing2 = listItem2.parent as Thing;
6819 if (thing.Num > 2)
6820 {
6821 thing = thing.Split(2);
6822 }
6823 if (msg)
6824 {
6825 Say("takeSharedItem", this, thing, thing2.GetName(NameStyle.Full));
6826 }
6827 AddCard(thing);
6828 if (ShouldEquip(thing, useFav: true) && thing.category.slot != 0)
6829 {
6830 TryEquip(thing, useFav: true);
6831 flag2 = true;
6832 }
6833 }
6834 if (flag2 && flag)
6835 {
6836 TryPutSharedItems(containers);
6837 }
6838 }
bool HasItemProtection
bool IsActive(int id, int days=-1)
override string GetName(NameStyle style, int _num=-1)
Definition: Thing.cs:494
bool IsSharedContainer
Definition: Thing.cs:92

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

◆ TryUpgrade()

void Chara.TryUpgrade ( bool  msg = true)
inline

Definition at line 7796 of file Chara.cs.

7797 {
7798 if (!EClass.debug.enable || IsPC || !IsGlobal || !IsPCFaction)
7799 {
7800 return;
7801 }
7802 for (int i = 0; i < 100; i++)
7803 {
7804 if (base.feat == 0)
7805 {
7806 break;
7807 }
7808 if (base.c_upgrades == null)
7809 {
7810 base.c_upgrades = new CharaUpgrade();
7811 }
7812 if (base.c_upgrades.halt)
7813 {
7814 break;
7815 }
7816 Rand.SetSeed(base.uid + base.c_upgrades.count);
7817 int num = EClass.rnd(100);
7818 int num2 = 0;
7819 int num3 = 1;
7820 int num4 = 0;
7821 bool flag = false;
7822 IEnumerable<SourceElement.Row> ie = EClass.sources.elements.rows.Where((SourceElement.Row a) => !elements.Has(a) && a.category == "skill" && !a.tag.Contains("noPet"));
7823 List<Element> list = ListAvailabeFeats(pet: true);
7824 if (num >= 90 && list.Count > 0)
7825 {
7826 Element element = list.RandomItem();
7827 num2 = element.id;
7828 num4 = element.CostLearn;
7829 }
7830 else if (num >= 60 && ie.Any())
7831 {
7832 num2 = ie.RandomItem().id;
7833 num4 = 3;
7834 }
7835 else
7836 {
7837 num2 = Element.List_MainAttributesMajor.RandomItem();
7838 num4 = 1;
7839 num3 = 2;
7840 flag = true;
7841 }
7842 Rand.SetSeed();
7843 if (num4 > base.feat)
7844 {
7845 break;
7846 }
7847 base.feat -= num4;
7848 base.c_upgrades.count++;
7849 base.c_upgrades.spent += num4;
7850 bool flag2 = false;
7851 if (flag)
7852 {
7853 foreach (CharaUpgrade.Item item in base.c_upgrades.items)
7854 {
7855 if (item.idEle == num2)
7856 {
7857 item.value += num3;
7858 item.cost += num4;
7859 flag2 = true;
7860 break;
7861 }
7862 }
7863 }
7864 if (!flag2)
7865 {
7866 base.c_upgrades.items.Add(new CharaUpgrade.Item
7867 {
7868 idEle = num2,
7869 value = num3,
7870 cost = num4
7871 });
7872 }
7873 SourceElement.Row row = EClass.sources.elements.map[num2];
7874 if (row.category == "feat")
7875 {
7876 SetFeat(num2, elements.ValueWithoutLink(num2) + 1, msg: true);
7877 }
7878 else if (elements.ValueWithoutLink(row.id) == 0)
7879 {
7880 elements.Learn(row.id);
7881 }
7882 else
7883 {
7884 elements.ModBase(num2, num3);
7885 }
7886 }
7887 }
List< Element > ListAvailabeFeats(bool pet=false, bool showAll=false)
Definition: Chara.cs:8949
void Learn(int ele, int v=1)
virtual int CostLearn
Definition: ELEMENT.cs:304
static int[] List_MainAttributesMajor
Definition: ELEMENT.cs:232
static void SetSeed(int a=-1)
Definition: Rand.cs:37

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

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

◆ TryUse()

bool Chara.TryUse ( Thing  t)
inline

Definition at line 7110 of file Chara.cs.

7111 {
7112 if (t.id == "338")
7113 {
7114 Thing thing = things.Find((Thing a) => a.IsEquipmentOrRanged && !a.isAcidproof);
7115 if (thing != null)
7116 {
7117 Say("dip", this, thing, t.GetName(NameStyle.Full, 1));
7118 SE.Change();
7119 t.trait.OnBlend(thing, this);
7120 return true;
7121 }
7122 return false;
7123 }
7124 if (t.IsNegativeGift || t.source.HasTag(CTAG.ignoreUse))
7125 {
7126 return false;
7127 }
7128 if (t.trait.CanEat(this) && hunger.GetPhase() > ((IsPCFaction || IsPCFactionMinion) ? 2 : 0))
7129 {
7131 {
7132 target = t
7133 });
7134 return true;
7135 }
7136 if (t.trait.CanDrink(this))
7137 {
7138 Drink(t);
7139 return true;
7140 }
7141 if (t.trait.CanRead(this))
7142 {
7144 {
7145 target = t
7146 });
7147 return true;
7148 }
7149 if (base.hp < MaxHP * 90 / 100)
7150 {
7151 Action healAction = t.trait.GetHealAction(this);
7152 if (healAction != null)
7153 {
7154 healAction();
7155 return true;
7156 }
7157 }
7158 return false;
7159 }
bool isAcidproof
Definition: Card.cs:658
void SetAIImmediate(AIAct g)
Definition: Chara.cs:8077
virtual bool CanRead(Chara c)
Definition: Trait.cs:919
virtual bool CanDrink(Chara c)
Definition: Trait.cs:937
virtual void OnBlend(Thing t, Chara c)
Definition: Trait.cs:563

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(), and AI_Idle.Run().

◆ TryWorkOutside()

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

Definition at line 8338 of file Chara.cs.

8339 {
8340 if (EClass.world.date.IsExpired(GetInt(51)))
8341 {
8342 Expedition expedition = Expedition.Create(this, sourceWork.expedition.ToEnum<ExpeditionType>());
8343 SetInt(51, EClass.world.date.GetRaw() + 60 * (expedition.hours + 24));
8344 homeBranch.expeditions.Add(expedition);
8345 return true;
8346 }
8347 return false;
8348 }
ExpeditionType
int GetRaw(int offsetHours=0)
Definition: Date.cs:322
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 3266 of file Chara.cs.

3267 {
3268 if (IsPCC)
3269 {
3270 if (base.dir == 0)
3271 {
3272 angle = 225f;
3273 }
3274 else if (base.dir == 1)
3275 {
3276 angle = 135f;
3277 }
3278 else if (base.dir == 2)
3279 {
3280 angle = 45f;
3281 }
3282 else if (base.dir == 3)
3283 {
3284 angle = -45f;
3285 }
3286 }
3287 else if (base.dir == 0)
3288 {
3289 angle = 165f;
3290 }
3291 else if (base.dir == 1)
3292 {
3293 angle = 300f;
3294 }
3295 else if (base.dir == 2)
3296 {
3297 angle = 0f;
3298 }
3299 else if (base.dir == 3)
3300 {
3301 angle = 120f;
3302 }
3303 }

Referenced by OnDeserialized().

◆ UpdateSight()

void Chara.UpdateSight ( )
inline

Definition at line 3327 of file Chara.cs.

3328 {
3329 int num = 4;
3330 for (int i = -num; i < num + 1; i++)
3331 {
3332 for (int j = -num; j < num + 1; j++)
3333 {
3334 shared.Set(pos.x + i, pos.z + j);
3335 if (shared.IsValid && !shared.cell.isSeen && i >= -1 && i <= 1 && j >= -1)
3336 {
3337 _ = 1;
3338 }
3339 }
3340 }
3341 }
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 5233 of file Chara.cs.

5234 {
5235 if (!IsPC && HasCooldown(a.id))
5236 {
5237 return false;
5238 }
5239 int num = 1;
5240 Act.Cost cost = a.GetCost(this);
5241 a.GetPower(this);
5242 int i = 1;
5243 int num2 = 0;
5244 bool flag = a.IsTargetHostileParty();
5245 if (IsPC && HasCondition<StanceManaCost>())
5246 {
5247 num2 = Evalue(1657);
5248 }
5249 _pts.Clear();
5250 if (a.TargetType.ForceParty)
5251 {
5252 pt = true;
5253 }
5254 if (pt)
5255 {
5256 i = 0;
5257 if (flag)
5258 {
5259 ForeachEnemy(delegate
5260 {
5261 i++;
5262 });
5263 }
5264 else
5265 {
5266 ForeachParty(delegate
5267 {
5268 i++;
5269 });
5270 }
5271 }
5272 if (a is Spell && IsPC && a.vPotential < i)
5273 {
5274 i = 1;
5275 _pts.Clear();
5276 _pts.Add(this);
5277 pt = false;
5278 }
5279 int num3 = 100;
5280 if (!a.TargetType.ForceParty && i > 1)
5281 {
5282 num3 = (IsPC ? (i * 100) : (50 + i * 50));
5283 }
5284 int num4 = cost.cost * num3 / 100;
5285 if (cost.type == Act.CostType.MP && Evalue(483) > 0)
5286 {
5287 num4 = num4 * 100 / (100 + (int)Mathf.Sqrt(Evalue(483) * 10) * 3);
5288 }
5289 if (i == 0)
5290 {
5291 if (IsPC)
5292 {
5294 }
5295 return false;
5296 }
5297 if (!IsPC && cost.type == Act.CostType.MP && mana.value < 0 && (EClass.rnd(4) != 0 || IsPCFaction || (base.IsPowerful && mana.value < -20)))
5298 {
5299 return false;
5300 }
5301 if (IsPC)
5302 {
5303 if (!Dialog.warned && cost.type == Act.CostType.MP && cost.cost > 0 && mana.value < num4 && !EClass.debug.godMode)
5304 {
5305 ActPlan.warning = true;
5306 Dialog.TryWarnMana(delegate
5307 {
5308 if (UseAbility(a, tc, pos, pt))
5309 {
5311 }
5312 });
5313 return false;
5314 }
5315 EClass.ui.CloseLayers();
5316 }
5317 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))
5318 {
5319 Say("shakeHead", this);
5320 return true;
5321 }
5322 if (tc != null && tc != this)
5323 {
5324 LookAt(tc.pos);
5325 }
5326 if (pos != null && !base.pos.Equals(pos))
5327 {
5328 LookAt(pos);
5329 }
5330 if (a.CanRapidFire && HasElement(1648))
5331 {
5332 num = 1 + Evalue(1648);
5333 }
5334 if (IsPC && cost.cost > 0 && a.Value == 0)
5335 {
5337 return false;
5338 }
5339 if (a is Spell)
5340 {
5341 string s = (isConfused ? "_cast_confuse" : (HasCondition<ConDim>() ? "_cast_dim" : ""));
5342 if (!a.source.tag.Contains("useHand"))
5343 {
5344 Say(race.castStyle.IsEmpty("cast"), this, a.source.GetName().ToLower(), s.lang());
5345 }
5346 if (IsPC)
5347 {
5348 _ = (i + 1) / 2;
5349 if (a.vPotential < i)
5350 {
5351 Msg.Say("noSpellStock");
5352 EInput.Consume();
5353 return false;
5354 }
5355 if (num2 > 0 && a.vPotential >= i * 2)
5356 {
5357 a.vPotential -= i * 2;
5358 num4 = num4 * (100 - num2 * 20) / 100;
5359 }
5360 else
5361 {
5362 a.vPotential -= i;
5363 }
5365 }
5366 }
5367 else if (a.source.langAct.Length != 0 && tc != null)
5368 {
5369 string text = a.source.langAct[0];
5370 string text2 = ((a.source.langAct.Length >= 2) ? a.source.langAct[1] : "");
5371 if (text == "spell_hand")
5372 {
5373 string[] list = Lang.GetList("attack" + race.meleeStyle.IsEmpty("Touch"));
5374 string @ref = text2.lang(list[4]);
5375 Say(tc.IsPCParty ? "cast_hand_ally" : "cast_hand", this, tc, @ref, tc.IsPCParty ? list[1] : list[2]);
5376 }
5377 else
5378 {
5379 Say(text, this, tc, text2.IsEmpty() ? "" : text2.lang());
5380 }
5381 if (a.source.id == 6630)
5382 {
5383 Talk("insult_" + (base.IsMale ? "m" : "f"));
5384 }
5385 }
5386 switch (cost.type)
5387 {
5388 case Act.CostType.MP:
5389 if (Evalue(1421) >= 2 && base.hp <= MaxHP / (9 - Evalue(1421) * 2))
5390 {
5391 num4 /= 2;
5392 }
5393 PlayEffect("cast");
5394 mana.Mod(-num4);
5395 if (isDead)
5396 {
5397 return true;
5398 }
5399 elements.ModExp(304, Mathf.Clamp(num4 * 2, 1, 200));
5400 break;
5401 case Act.CostType.SP:
5402 stamina.Mod(-num4);
5403 break;
5404 }
5405 if (a is Spell && GetCondition<ConSilence>() != null)
5406 {
5407 Say("cast_silence", this);
5408 return true;
5409 }
5410 if (isDead)
5411 {
5412 return true;
5413 }
5414 int spellExp = elements.GetSpellExp(this, a, num3);
5415 if (EClass.rnd(100) >= CalcCastingChance(a, i) && !EClass.debug.godMode)
5416 {
5417 Say("fizzle", this);
5418 PlayEffect("fizzle");
5419 PlaySound("fizzle");
5420 if (cost.cost > 0 && a.source.lvFactor > 0)
5421 {
5422 ModExp(a.id, spellExp / 5);
5423 }
5424 RemoveCondition<ConInvisibility>();
5425 return true;
5426 }
5427 bool flag2 = true;
5428 if (pt)
5429 {
5430 Act.forcePt = true;
5431 if (flag)
5432 {
5433 ForeachEnemy(delegate(Chara c)
5434 {
5435 a.Perform(this, c, c.pos);
5436 });
5437 }
5438 else
5439 {
5440 ForeachParty(delegate(Chara c)
5441 {
5442 a.Perform(this, c, c.pos);
5443 });
5444 }
5445 Act.forcePt = false;
5446 }
5447 else
5448 {
5449 for (int j = 0; j < num; j++)
5450 {
5451 if (a.TargetType != TargetType.SelfParty && tc != null && !tc.IsAliveInCurrentZone)
5452 {
5453 break;
5454 }
5455 ActEffect.RapidCount = j;
5456 ActEffect.RapidDelay = a.RapidDelay;
5457 flag2 = a.Perform(this, tc, pos);
5458 }
5459 }
5460 if (flag2 && !isDead && cost.cost > 0 && a.source.lvFactor > 0)
5461 {
5462 ModExp(a.id, spellExp);
5463 }
5464 ActEffect.RapidCount = 0;
5465 if (!IsPC && a.source.cooldown > 0)
5466 {
5467 AddCooldown(a.id, a.source.cooldown);
5468 }
5469 if (flag2 && !a.source.tag.Contains("keepInvisi") && EClass.rnd(2) == 0)
5470 {
5471 RemoveCondition<ConInvisibility>();
5472 }
5473 return flag2;
5474 void ForeachEnemy(Action<Chara> action)
5475 {
5476 if (_pts.Count == 0)
5477 {
5478 for (int num8 = EClass._map.charas.Count - 1; num8 >= 0; num8--)
5479 {
5480 Chara chara3 = EClass._map.charas[num8];
5481 if (chara3 != this && CanSeeLos(chara3) && chara3.IsHostile(this))
5482 {
5483 _pts.Add(chara3);
5484 }
5485 }
5486 }
5487 for (int num9 = _pts.Count - 1; num9 >= 0; num9--)
5488 {
5489 action(_pts[num9]);
5490 }
5491 }
5492 void ForeachParty(Action<Chara> action)
5493 {
5494 if (_pts.Count == 0)
5495 {
5496 if (IsPCParty)
5497 {
5498 for (int num5 = EClass.pc.party.members.Count - 1; num5 >= 0; num5--)
5499 {
5500 Chara chara = EClass.pc.party.members[num5];
5501 if (chara == this || chara.host != null || CanSeeLos(chara))
5502 {
5503 _pts.Add(chara);
5504 }
5505 }
5506 }
5507 else
5508 {
5509 for (int num6 = EClass._map.charas.Count - 1; num6 >= 0; num6--)
5510 {
5511 Chara chara2 = EClass._map.charas[num6];
5512 if ((chara2 == this || (chara2.IsFriendOrAbove(this) && CanSeeLos(chara2))) && (chara2 == tc || _pts.Count < 3 || EClass.rnd(_pts.Count * _pts.Count) > 6))
5513 {
5514 _pts.Add(chara2);
5515 }
5516 }
5517 }
5518 }
5519 for (int num7 = _pts.Count - 1; num7 >= 0; num7--)
5520 {
5521 action(_pts[num7]);
5522 }
5523 }
5524 }
Definition: ACT.cs:62
CostType
Definition: ACT.cs:64
virtual bool Perform()
Definition: ACT.cs:264
virtual TargetType TargetType
Definition: ACT.cs:140
virtual float RapidDelay
Definition: ACT.cs:173
bool IsTargetHostileParty()
Definition: ACT.cs:239
virtual bool CanRapidFire
Definition: ACT.cs:171
bool UseAbility(string idAct, Card tc=null, Point pos=null, bool pt=false)
Definition: Chara.cs:5228
static List< Chara > _pts
Definition: Chara.cs:171
int CalcCastingChance(Element e, int num=1)
Definition: Chara.cs:5535
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:246
virtual int GetPower(Card c)
Definition: ELEMENT.cs:884
virtual Act.Cost GetCost(Chara c)
Definition: ELEMENT.cs:853
static string SayNothingHappen()
Definition: Msg.cs:96
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, Act.CanRapidFire, SourceRace.Row.castStyle, Map.charas, EInput.Consume(), Act.Cost.cost, 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

Definition at line 5228 of file Chara.cs.

5229 {
5230 return UseAbility(elements.GetElement(idAct)?.act ?? ACT.Create(idAct), tc, pos, pt);
5231 }
Definition: ACT.cs:6
static Act Create(int id)
Definition: ACT.cs:36
Act act
Definition: ELEMENT.cs:384

References ACT.Create().

Referenced by AM_Adv._OnUpdateInput(), AI_Idle.Run(), ButtonAbility.SpecialHoldAction(), HotItemAct.TrySetAct(), TraitCatalyst.TrySetHeldAct(), ButtonAbility.TryUse(), and GoalCombat.TryUseAbility().

◆ ValidateWorks()

void Chara.ValidateWorks ( )
inline

Definition at line 8386 of file Chara.cs.

8387 {
8388 _goalWork.FindWork(this, setAI: false);
8390 }
static GoalHobby _goalHobby
Definition: Chara.cs:193
static GoalWork _goalWork
Definition: Chara.cs:191
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 4764 of file Chara.cs.

4765 {
4766 base.c_vomit++;
4767 Say("vomit", this);
4768 PlaySound("vomit");
4769 if (!EClass._zone.IsRegion)
4770 {
4771 Thing thing = ThingGen.Create("731");
4773 {
4774 thing.MakeRefFrom(this);
4775 }
4776 EClass._zone.AddCard(thing, pos);
4777 }
4778 if (HasCondition<ConAnorexia>())
4779 {
4780 ModExp(70, -50);
4781 ModExp(71, -75);
4782 ModExp(77, -100);
4783 }
4784 else if (base.c_vomit > 10)
4785 {
4786 AddCondition<ConAnorexia>();
4787 }
4788 AddCondition<ConDim>();
4789 if (HasCondition<ConAnorexia>())
4790 {
4791 ModWeight(-1 * (1 + EClass.rnd(5)));
4792 }
4793 if (hunger.GetPhase() >= 4)
4794 {
4795 DamageHP(9999, AttackSource.Hunger);
4796 }
4797 hunger.Mod(30);
4798 }
void ModWeight(int a, bool ignoreLimit=false)
Definition: Chara.cs:8881

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

3344 {
3345 for (int num = conditions.Count - 1; num >= 0; num--)
3346 {
3347 if (conditions[num].ConsumeTurn)
3348 {
3349 return true;
3350 }
3351 }
3352 return false;
3353 }

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

6584 {
6585 n.Clear();
6586 UIItem uIItem = n.AddHeaderCard(base.Name.ToTitleCase());
6587 SetImage(uIItem.image2);
6588 uIItem.text2.SetText(race.GetText().ToTitleCase(wholeText: true) + " " + job.GetText().ToTitleCase(wholeText: true));
6589 n.AddText("");
6590 n.Build();
6591 }
void SetImage(Image image, int dir, int idSkin=0)
Definition: Card.cs:5355
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 93 of file Chara.cs.

Referenced by SetMainElement().

◆ _baseWorkElements

ElementContainer Chara._baseWorkElements

Definition at line 189 of file Chara.cs.

◆ _cbits1

BitArray32 Chara._cbits1

Definition at line 81 of file Chara.cs.

Referenced by OnSerializing().

◆ _cints

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

Definition at line 79 of file Chara.cs.

Referenced by OnDeserialized(), and OnSerializing().

◆ _cooldowns

List<int> Chara._cooldowns

Definition at line 58 of file Chara.cs.

◆ _faction

Faction Chara._faction
private

Definition at line 141 of file Chara.cs.

Referenced by SetFaction().

◆ _goalHobby

GoalHobby Chara._goalHobby = new GoalHobby()
staticprivate

Definition at line 193 of file Chara.cs.

◆ _goalWork

GoalWork Chara._goalWork = new GoalWork()
staticprivate

Definition at line 191 of file Chara.cs.

◆ _hobbies

List<int> Chara._hobbies

Definition at line 49 of file Chara.cs.

◆ _isLevitating

bool Chara._isLevitating

Definition at line 129 of file Chara.cs.

Referenced by HasHigherGround(), and Refresh().

◆ _job

SourceJob.Row Chara._job

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

◆ _listFavFood

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

Definition at line 177 of file Chara.cs.

◆ _ListItems

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

Definition at line 175 of file Chara.cs.

◆ _NoGoalPC

NoGoal Chara._NoGoalPC = new NoGoal()
static

Definition at line 181 of file Chara.cs.

◆ _NoGoalRepeat

NoGoal Chara._NoGoalRepeat = new NoGoal()
static

Definition at line 183 of file Chara.cs.

Referenced by ActPlan.Item.Perform().

◆ _pts

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

Definition at line 171 of file Chara.cs.

◆ _race

SourceRace.Row Chara._race

Definition at line 145 of file Chara.cs.

Referenced by ChangeRace(), and OnCreate().

◆ _sharedPos

Point Chara._sharedPos = new Point()
staticprivate

Definition at line 159 of file Chara.cs.

Referenced by TryMoveTowards().

◆ _Speed

int Chara._Speed
private

Definition at line 157 of file Chara.cs.

Referenced by RefreshSpeed().

◆ _strs

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

Definition at line 76 of file Chara.cs.

◆ _tactics

Tactics Chara._tactics

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

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

◆ ai

◆ body

◆ bossText

bool Chara.bossText

Definition at line 139 of file Chara.cs.

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

◆ calmCheckTurn

int Chara.calmCheckTurn

Definition at line 113 of file Chara.cs.

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

◆ canSeeInvisible

bool Chara.canSeeInvisible

Definition at line 133 of file Chara.cs.

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

◆ combatCount

int Chara.combatCount

Definition at line 111 of file Chara.cs.

◆ conditions

◆ conSleep

ConSleep Chara.conSleep

◆ consumeTurn

bool Chara.consumeTurn
static

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

Referenced by RefreshSpeed(), and SetDirtySpeed().

◆ emoIcon

Emo2 Chara.emoIcon

Definition at line 103 of file Chara.cs.

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

◆ enemy

◆ faithElements

◆ global

◆ goalList

GoalList Chara.goalList = new GoalList()

Definition at line 185 of file Chara.cs.

◆ happiness

int Chara.happiness

Definition at line 105 of file Chara.cs.

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

◆ hasMovedThisTurn

bool Chara.hasMovedThisTurn
private

Definition at line 161 of file Chara.cs.

Referenced by _Move(), and Tick().

◆ hasTelepathy

bool Chara.hasTelepathy

◆ held

◆ host

◆ idleActTimer

int Chara.idleActTimer

Definition at line 109 of file Chara.cs.

Referenced by AI_Idle.Run().

◆ idleTimer

float Chara.idleTimer

Definition at line 117 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.

◆ isBlind

◆ isConfused

◆ isCreated

bool Chara.isCreated

Definition at line 131 of file Chara.cs.

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

◆ isDrunk

bool Chara.isDrunk

Definition at line 119 of file Chara.cs.

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

◆ isFainted

bool Chara.isFainted

Definition at line 123 of file Chara.cs.

◆ isOnCreate

bool Chara.isOnCreate
static

Definition at line 169 of file Chara.cs.

◆ isParalyzed

bool Chara.isParalyzed

Definition at line 127 of file Chara.cs.

Referenced by Point.ListWitnesses().

◆ isWet

bool Chara.isWet

Definition at line 137 of file Chara.cs.

Referenced by Card.DamageHP(), Refresh(), and GoalCombat.TryUseAbility().

◆ lastPos

Point Chara.lastPos = new Point()

Definition at line 87 of file Chara.cs.

Referenced by _Move().

◆ ListAdvJob

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

Definition at line 153 of file Chara.cs.

Referenced by OnCreate().

◆ ListAdvRace

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

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

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

◆ memberType

◆ nextUse

Thing Chara.nextUse

Definition at line 97 of file Chara.cs.

Referenced by AI_Idle.Run().

◆ orgPos

◆ parasite

◆ party

◆ path

PathProgress Chara.path = new PathProgress()

Definition at line 89 of file Chara.cs.

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

◆ pccData

◆ preventRegen

bool Chara.preventRegen
static

Definition at line 167 of file Chara.cs.

◆ quest

◆ ranged

◆ rawSlots

int [] Chara.rawSlots

Definition at line 70 of file Chara.cs.

Referenced by OnSerializing().

◆ resistCon

Dictionary<int, int> Chara.resistCon

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

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

◆ source

◆ stealthSeen

int Chara.stealthSeen

Definition at line 173 of file Chara.cs.

◆ tempElements

◆ turnLastSeen

int Chara.turnLastSeen = -100

Definition at line 107 of file Chara.cs.

Referenced by AI_Idle.Run().

◆ workElements

ElementContainer Chara.workElements

Definition at line 40 of file Chara.cs.

Property Documentation

◆ _affinity

int Chara._affinity
getset

Definition at line 287 of file Chara.cs.

288 {
289 get
290 {
291 return _cints[5];
292 }
293 set
294 {
295 _cints[5] = value;
296 }
297 }

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

◆ _alias

string Chara._alias
getset

Definition at line 203 of file Chara.cs.

204 {
205 get
206 {
207 return _strs[0];
208 }
209 set
210 {
211 _strs[0] = value;
212 }
213 }
string[] _strs
Definition: Chara.cs:76

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

◆ _idTimeTable

int Chara._idTimeTable
getset

Definition at line 325 of file Chara.cs.

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

Referenced by OnCreate().

◆ _maxStamina

int Chara._maxStamina
getset

Definition at line 349 of file Chara.cs.

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

Referenced by CalculateMaxStamina().

◆ ability

◆ actorPrefab

override string Chara.actorPrefab
get

Definition at line 503 of file Chara.cs.

504 {
505 get
506 {
507 if (IsPCC)
508 {
509 return "CharaActorPCC";
510 }
511 return "CharaActor";
512 }
513 }

◆ affinity

◆ Aka

◆ AliasMaterialOnCreate

override string Chara.AliasMaterialOnCreate
get

Definition at line 543 of file Chara.cs.

◆ baseWorkElements

ElementContainer Chara.baseWorkElements
get

Definition at line 919 of file Chara.cs.

920 {
921 get
922 {
923 if (_baseWorkElements == null)
924 {
926 foreach (Hobby item in ListHobbies())
927 {
928 Build(item);
929 }
930 foreach (Hobby item2 in ListWorks())
931 {
932 Build(item2);
933 }
934 }
935 return _baseWorkElements;
936 void Build(Hobby h)
937 {
938 if (!h.source.elements.IsEmpty())
939 {
940 for (int i = 0; i < h.source.elements.Length; i += 2)
941 {
942 int ele = h.source.elements[i];
943 int v = h.source.elements[i + 1];
945 }
946 }
947 }
948 }
949 }
ElementContainer _baseWorkElements
Definition: Chara.cs:189

◆ bladder

Stats Chara.bladder
get

Definition at line 959 of file Chara.cs.

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

◆ burden

◆ CanGainConResist

bool Chara.CanGainConResist
get

Definition at line 969 of file Chara.cs.

970 {
971 get
972 {
973 if (base.rarity >= Rarity.Legendary)
974 {
975 return !IsPCFaction;
976 }
977 return false;
978 }
979 }

◆ CanOpenDoor

bool Chara.CanOpenDoor
get

Definition at line 771 of file Chara.cs.

772 {
773 get
774 {
775 if (base.INT < 5)
776 {
777 if (IsPCFaction)
778 {
779 return memberType == FactionMemberType.Default;
780 }
781 return false;
782 }
783 return true;
784 }
785 }

◆ CanWitness

bool Chara.CanWitness
get

Definition at line 823 of file Chara.cs.

824 {
825 get
826 {
827 if (!race.IsHuman && !race.IsFairy && !race.IsGod)
828 {
829 return race.id == "mutant";
830 }
831 return true;
832 }
833 }

Referenced by Point.ListWitnesses().

◆ corruption

int Chara.corruption
getset

Definition at line 361 of file Chara.cs.

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

Referenced by ActEffect.Proc().

◆ CurrentGeneSlot

int Chara.CurrentGeneSlot
get

Definition at line 893 of file Chara.cs.

894 {
895 get
896 {
897 if (base.c_genes != null)
898 {
899 return base.c_genes.GetGeneSlot(this);
900 }
901 return 0;
902 }
903 }

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

◆ CurrentSpan

TimeTable.Span Chara.CurrentSpan
get

Definition at line 789 of file Chara.cs.

Referenced by ConSleep.Tick().

◆ currentZone

Zone Chara.currentZone
getset

Definition at line 239 of file Chara.cs.

240 {
241 get
242 {
243 return RefZone.Get(_cints[1]);
244 }
245 set
246 {
247 _cints[1] = RefZone.Set(value);
248 }
249 }
static int Set(Zone zone)
Definition: RefZone.cs:12
static Zone Get(int uid)
Definition: RefZone.cs:3

Referenced by _Move(), AM_ViewZone._OnUpdateInput(), 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(), 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(), ItemGeneral.SetChara(), ButtonChara.SetChara(), Meeting.SetChara(), Quest.SetClient(), ListPeopleExpedition.SetSubText(), UIZoneInfo.SetZone(), Player.SimulateFaction(), and EloPos.WriteNote().

◆ daysStarved

int Chara.daysStarved
getset

Definition at line 313 of file Chara.cs.

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

◆ depression

Stats Chara.depression
get

Definition at line 957 of file Chara.cs.

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

◆ DestDist

int Chara.DestDist
get

Definition at line 819 of file Chara.cs.

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

◆ DV

override int Chara.DV
get

Definition at line 713 of file Chara.cs.

714 {
715 get
716 {
717 if (IsPCFaction)
718 {
719 return WeaknessMod(elements.Value(64));
720 }
721 int num = base.LV;
722 if (num > 50)
723 {
724 num = 50 + (num - 50) / 10;
725 }
726 return WeaknessMod(num + elements.Value(64) * (100 + num + race.DV * 5) / 100);
727 int WeaknessMod(int a)
728 {
729 if (HasCondition<ConWeakness>())
730 {
731 if (a <= 0)
732 {
733 return a * 2;
734 }
735 return a / 2;
736 }
737 return a;
738 }
739 }
740 }

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

◆ faction

Faction Chara.faction
getset

Definition at line 411 of file Chara.cs.

412 {
413 get
414 {
415 return _faction ?? (_faction = EClass.game.factions.dictAll.TryGetValue(idFaction));
416 }
417 set
418 {
419 idFaction = value?.uid;
420 }
421 }
string idFaction
Definition: Chara.cs:228
Dictionary< string, Faction > dictAll
FactionManager factions
Definition: Game.cs:161

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

◆ faith

◆ flipX

override bool Chara.flipX
get

Definition at line 531 of file Chara.cs.

532 {
533 get
534 {
535 if (base.dir != 1)
536 {
537 return base.dir == 2;
538 }
539 return true;
540 }
541 }

Referenced by CharaActor.RefreshSprite().

◆ goalListType

GoalListType Chara.goalListType
getset

Definition at line 263 of file Chara.cs.

264 {
265 get
266 {
267 return _cints[3].ToEnum<GoalListType>();
268 }
269 set
270 {
271 _cints[3] = (int)value;
272 }
273 }
GoalListType
Definition: GoalListType.cs:2

◆ HasHost

override bool Chara.HasHost
get

Definition at line 673 of file Chara.cs.

Referenced by ActEffect.Proc().

◆ HasNoGoal

◆ homeBranch

◆ homeZone

◆ hostility

◆ hunger

◆ hygiene

Stats Chara.hygiene
get

Definition at line 961 of file Chara.cs.

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

◆ idFaction

string Chara.idFaction
getset

Definition at line 227 of file Chara.cs.

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

◆ idFaith

string Chara.idFaith
getset

Definition at line 215 of file Chara.cs.

216 {
217 get
218 {
219 return _strs[1];
220 }
221 set
222 {
223 _strs[1] = value;
224 }
225 }

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

◆ IDPCCBodySet

string Chara.IDPCCBodySet
get

Definition at line 475 of file Chara.cs.

476 {
477 get
478 {
479 if (source.idActor.Length <= 1)
480 {
481 return "female";
482 }
483 return source.idActor[1];
484 }
485 }

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

◆ idTimeTable

string Chara.idTimeTable
get

Definition at line 453 of file Chara.cs.

Referenced by LayerQuestBoard.RefreshHire().

◆ interest

int Chara.interest
getset

Definition at line 301 of file Chara.cs.

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

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

◆ IsAdventurer

bool Chara.IsAdventurer
get

Definition at line 863 of file Chara.cs.

864 {
865 get
866 {
867 if (global != null && faction != EClass.pc.faction)
868 {
869 return IsPCC;
870 }
871 return false;
872 }
873 }

◆ isAlawysVisible

bool Chara.isAlawysVisible
getset

Definition at line 385 of file Chara.cs.

386 {
387 get
388 {
389 return _cbits1[1];
390 }
391 set
392 {
393 _cbits1[1] = value;
394 }
395 }

◆ IsAliveInCurrentZone

◆ isChara

override bool Chara.isChara
get

Definition at line 671 of file Chara.cs.

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

◆ isDead

◆ IsDeadOrSleeping

override bool Chara.IsDeadOrSleeping
get

Definition at line 557 of file Chara.cs.

558 {
559 get
560 {
561 if (!isDead && conSleep == null && conSuspend == null)
562 {
563 return isFainted;
564 }
565 return true;
566 }
567 }
bool isFainted
Definition: Chara.cs:123

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

◆ IsDisabled

override bool Chara.IsDisabled
get

◆ IsEyth

bool Chara.IsEyth
get

Definition at line 875 of file Chara.cs.

Referenced by TraitAltar.OnOffer().

◆ IsGlobal

◆ IsHuman

bool Chara.IsHuman
get

◆ IsHumanSpeak

bool Chara.IsHumanSpeak
get

Definition at line 837 of file Chara.cs.

838 {
839 get
840 {
841 if (!IsHuman)
842 {
843 return race.tag.Contains("humanSpeak");
844 }
845 return true;
846 }
847 }

Referenced by ConEntangle.Tick().

◆ IsIdle

bool Chara.IsIdle
get

Definition at line 805 of file Chara.cs.

806 {
807 get
808 {
809 if (!IsDeadOrSleeping)
810 {
811 return ai.Current.IsIdle;
812 }
813 return false;
814 }
815 }
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 581 of file Chara.cs.

582 {
583 get
584 {
585 if (ride != null)
586 {
587 return ride._isLevitating;
588 }
589 return _isLevitating;
590 }
591 }

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

◆ IsLocalChara

bool Chara.IsLocalChara
get

Definition at line 793 of file Chara.cs.

794 {
795 get
796 {
797 if (!IsGlobal && !base.isSubsetCard)
798 {
799 return homeZone == EClass._zone;
800 }
801 return false;
802 }
803 }

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

◆ IsMaid

bool Chara.IsMaid
get

Definition at line 849 of file Chara.cs.

850 {
851 get
852 {
853 if (EClass.Branch != null)
854 {
855 return EClass.Branch.uidMaid == base.uid;
856 }
857 return false;
858 }
859 }

Referenced by FactionBranch.GetMaid().

◆ IsMinion

override bool Chara.IsMinion
get

Definition at line 611 of file Chara.cs.

612 {
613 get
614 {
615 if (master == null)
616 {
617 return base.c_uidMaster != 0;
618 }
619 return true;
620 }
621 }

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

◆ IsMofuable

bool Chara.IsMofuable
get

Definition at line 917 of file Chara.cs.

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

◆ IsMoving

override bool Chara.IsMoving
get

Definition at line 593 of file Chara.cs.

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

◆ IsMultisize

override bool Chara.IsMultisize
get

◆ IsPC

override bool Chara.IsPC
get

Definition at line 597 of file Chara.cs.

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

◆ IsPCC

◆ IsPCFaction

override bool Chara.IsPCFaction
get

Definition at line 655 of file Chara.cs.

656 {
657 get
658 {
659 if (EClass.pc != null)
660 {
661 return faction == EClass.pc.faction;
662 }
663 return false;
664 }
665 }

Referenced by ActPlan._Update(), Element._WriteNote(), GameDate.AdvanceHour(), DramaCustomSequence.Build(), CallHelp(), TraitTrolley.CanActivate(), Thing.CanAutoFire(), CanBeTempAlly(), InvOwner.CanShiftClick(), 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(), StatsMana.Mod(), TraitHitchingPost.OnActivateTrap(), GlobalGoalAdv.OnAdvanceHour(), 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(), ActEffect.Proc(), InvOwner.Transaction.Process(), 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 639 of file Chara.cs.

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

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

◆ IsPCParty

override bool Chara.IsPCParty
get

◆ IsPCPartyMinion

override bool Chara.IsPCPartyMinion
get

Definition at line 623 of file Chara.cs.

624 {
625 get
626 {
627 if (master != null)
628 {
629 if (!master.IsPCParty)
630 {
631 return master.IsPCPartyMinion;
632 }
633 return true;
634 }
635 return false;
636 }
637 }

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

◆ IsPrisoner

bool Chara.IsPrisoner
get

Definition at line 861 of file Chara.cs.

◆ isSynced

override bool Chara.isSynced
get

◆ isThing

override bool Chara.isThing
get

Definition at line 669 of file Chara.cs.

◆ IsWealthy

bool Chara.IsWealthy
get

Definition at line 877 of file Chara.cs.

878 {
879 get
880 {
881 if (!source.works.Contains("Rich"))
882 {
883 return source.hobbies.Contains("Rich");
884 }
885 return true;
886 }
887 }

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

◆ job

◆ knowFav

bool Chara.knowFav
getset

Definition at line 397 of file Chara.cs.

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

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

◆ MainElement

Element Chara.MainElement
get

Definition at line 701 of file Chara.cs.

702 {
703 get
704 {
705 if (base.c_idMainElement == 0)
706 {
707 return Element.Void;
708 }
709 return elements.GetElement(base.c_idMainElement);
710 }
711 }

Referenced by Card.DamageHP(), 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 501 of file Chara.cs.

◆ OriginalHostility

Hostility Chara.OriginalHostility
get

Definition at line 455 of file Chara.cs.

456 {
457 get
458 {
459 if (EClass.pc == null || !IsPCFaction)
460 {
461 if (base.c_originalHostility == (Hostility)0)
462 {
463 if (!source.hostility.IsEmpty())
464 {
465 return source.hostility.ToEnum<Hostility>();
466 }
467 return Hostility.Enemy;
468 }
469 return base.c_originalHostility;
470 }
471 return Hostility.Ally;
472 }
473 }

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

◆ PrefIndex

override int Chara.PrefIndex
get

Definition at line 515 of file Chara.cs.

516 {
517 get
518 {
519 if (sourceCard._tiles.Length != 0 || renderer.replacer != null)
520 {
521 if (base.dir != 1 && base.dir != 2)
522 {
523 return 0;
524 }
525 return 1;
526 }
527 return base.dir;
528 }
529 }

◆ PV

override int Chara.PV
get

Definition at line 742 of file Chara.cs.

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

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

◆ race

◆ SAN

◆ SelfWeight

override int Chara.SelfWeight
get

Definition at line 697 of file Chara.cs.

◆ sleepiness

Stats Chara.sleepiness
get

Definition at line 965 of file Chara.cs.

Referenced by WidgetStats._OnActivate(), CanSleep(), RefreshSpeed(), and ConSleep.Tick().

◆ sourceCard

override CardRow Chara.sourceCard
get

◆ sourceRenderCard

override CardRow Chara.sourceRenderCard
get

Definition at line 437 of file Chara.cs.

438 {
439 get
440 {
441 if (pccData != null && !(source.renderData is RenderDataPcc))
442 {
444 }
445 return source;
446 }
447 }
static Row rowDefaultPCC
Definition: SourceChara.cs:130

◆ Speed

int Chara.Speed
get

Definition at line 905 of file Chara.cs.

906 {
907 get
908 {
909 if (dirtySpeed)
910 {
911 RefreshSpeed();
912 }
913 return _Speed;
914 }
915 }

Referenced by GameUpdater.ConditionUpdater.FixedUpdate(), and Tick().

◆ stamina

◆ tactics

Tactics Chara.tactics
get

Definition at line 787 of file Chara.cs.

◆ trait

◆ uidEditor

int Chara.uidEditor
getset

Definition at line 337 of file Chara.cs.

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

Referenced by SerializedCards.Add().

◆ WeightLimit

override int Chara.WeightLimit
get

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