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

Public Member Functions

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

Public Attributes

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

Static Public Attributes

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

Protected Member Functions

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

Properties

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

Private Member Functions

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

Private Attributes

Faction _faction
 
long _Speed
 
bool hasMovedThisTurn
 

Static Private Attributes

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

Additional Inherited Members

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

Detailed Description

Definition at line 9 of file Chara.cs.

Member Function Documentation

◆ _CreateRenderer()

override CardRenderer Chara._CreateRenderer ( )
inlinevirtual

Reimplemented from Card.

Definition at line 6794 of file Chara.cs.

6795 {
6796 CardRenderer cardRenderer = renderer;
6797 CharaRenderer charaRenderer = new CharaRenderer();
6798 if (source.skinAntiSpider != 0 && EClass.core.config.game.antiSpider)
6799 {
6800 base.idSkin = source.skinAntiSpider;
6801 }
6802 if (host != null)
6803 {
6804 charaRenderer.pccData = PCCData.Create("ride");
6805 string idPart = base.c_idRidePCC.IsEmpty(EClass.core.pccs.sets["ride"].map["body"].map.Keys.First());
6806 charaRenderer.pccData.SetPart("body", "ride", idPart);
6807 charaRenderer.pccData.ride = EClass.core.pccs.GetRideData(idPart);
6808 }
6809 else
6810 {
6811 foreach (Condition condition in conditions)
6812 {
6813 RendererReplacer rendererReplacer = condition.GetRendererReplacer();
6814 if (rendererReplacer != null)
6815 {
6816 charaRenderer.replacer = rendererReplacer;
6817 charaRenderer.data = rendererReplacer.data;
6818 break;
6819 }
6820 }
6821 if (charaRenderer.replacer == null)
6822 {
6823 charaRenderer.pccData = pccData;
6824 }
6825 }
6826 renderer = charaRenderer;
6827 renderer.SetOwner(this);
6828 if (cardRenderer != null)
6829 {
6830 renderer.SetFirst(first: false, cardRenderer.position);
6831 }
6832 return charaRenderer;
6833 }
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:62
PCCData pccData
Chara host
Definition: Chara.cs:33
List< Condition > conditions
Definition: Chara.cs:213
SourceChara.Row source
Definition: Chara.cs:160
PCCData pccData
Definition: Chara.cs:67
new GameConfig game
Definition: CoreConfig.cs:611
PCCManager pccs
Definition: Core.cs:41
CoreConfig config
Definition: Core.cs:70
Definition: EClass.cs:6
static Core core
Definition: EClass.cs:7

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

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

◆ _MakeAlly()

void Chara._MakeAlly ( )
inline

Definition at line 2359 of file Chara.cs.

2360 {
2361 if (EClass.pc.homeBranch != null)
2362 {
2364 }
2365 else
2366 {
2367 SetGlobal();
2369 }
2370 Hostility hostility2 = (base.c_originalHostility = Hostility.Ally);
2371 this.hostility = hostility2;
2372 orgPos = null;
2373 base.c_summonDuration = 0;
2374 base.isSummon = false;
2375 UnmakeMinion();
2376 SetInt(32);
2377 Refresh();
2378 }
Hostility
Definition: Hostility.cs:2
list. Refresh()
void SetInt(int id, int value=0)
Definition: BaseCard.cs:39
void UnmakeMinion()
Definition: Chara.cs:2413
Chara SetFaction(Faction f)
Definition: Chara.cs:1453
Point orgPos
Definition: Chara.cs:21
FactionBranch homeBranch
Definition: Chara.cs:1080
Chara SetGlobal()
Definition: Chara.cs:1520
static Faction Home
Definition: EClass.cs:27
static Chara pc
Definition: EClass.cs:15
void AddMemeber(Chara c)

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

Referenced by MakeAlly(), and MakePartyMemeber().

◆ _Move()

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

Reimplemented from Card.

Definition at line 2781 of file Chara.cs.

2782 {
2783 if (isDead)
2784 {
2785 return MoveResult.Fail;
2786 }
2787 if (IsPC)
2788 {
2789 float num = EClass.setting.defaultActPace;
2790 switch (burden.GetPhase())
2791 {
2792 case 3:
2793 num *= 1.5f;
2794 break;
2795 case 4:
2796 num *= 2f;
2797 break;
2798 }
2800 {
2801 int num2 = 30;
2802 if (!EClass.pc.HasElement(408))
2803 {
2805 {
2806 case Weather.Condition.Rain:
2807 num2 += 5;
2808 break;
2809 case Weather.Condition.RainHeavy:
2810 num2 += 10;
2811 num *= 1.5f;
2812 break;
2813 case Weather.Condition.Snow:
2814 num2 += 10;
2815 break;
2816 case Weather.Condition.SnowHeavy:
2817 num2 += 15;
2818 num *= 1.5f;
2819 break;
2820 }
2821 }
2822 if (newPoint.matFloor.id == 48)
2823 {
2824 num2 += 20;
2825 num *= 1.8f;
2826 }
2827 num2 = num2 * 100 / (100 + EClass.sqrt(EvalueMax(240, -20) * 10) + EvalueMax(407, -5) * 5);
2828 EClass.world.date.AdvanceMin(num2 * 6);
2829 EClass.player.lastZonePos = null;
2831 int num3 = base.hp;
2832 for (int i = 0; i < num2 * 4; i++)
2833 {
2834 EClass.pc.party.members.ForeachReverse(delegate(Chara m)
2835 {
2836 if (!m.isDead)
2837 {
2838 m.TickConditions();
2839 }
2840 });
2841 if (base.hp < MaxHP / 5 && base.hp < num3 && !EClass.player.regionMoveWarned)
2842 {
2843 EClass.player.regionMoveWarned = true;
2844 Msg.Say("regionAbortMove");
2845 EInput.Consume(consumeAxis: true);
2846 SetAI(new NoGoal());
2847 return MoveResult.Fail;
2848 }
2849 }
2850 if (newPoint.cell.CanSuffocate())
2851 {
2852 bool flag = HasElement(1252);
2853 if (!flag)
2854 {
2855 AddCondition<ConSuffocation>((Evalue(200) != 0) ? (2000 / (100 + EvalueMax(200, -5) * 10)) : 30, force: true);
2856 }
2857 int num4 = GetCondition<ConSuffocation>()?.GetPhase() ?? 0;
2858 if (num4 >= 2)
2859 {
2860 DamageHP(EClass.rndHalf(10 + MaxHP / 5), AttackSource.Condition);
2861 }
2862 if (!isDead && !HasElement(429))
2863 {
2864 ModExp(200, ((!flag) ? 1 : 10) + num4 * 12);
2865 }
2866 }
2867 EClass.player.regionMoveWarned = false;
2868 if (isDead)
2869 {
2870 return MoveResult.Fail;
2871 }
2872 }
2873 if (num > EClass.setting.defaultActPace * 3f)
2874 {
2875 num = EClass.setting.defaultActPace * 3f;
2876 }
2877 actTime = num;
2878 }
2879 if (IsPCFaction && EClass.rnd(5) == 0 && newPoint.cell.CanSuffocate())
2880 {
2881 int num5 = Mathf.Min(5 + EClass._zone.DangerLv / 10, 200);
2882 ModExp(200, EClass._zone.IsRegion ? 50 : num5);
2883 if (ride != null)
2884 {
2885 ride.ModExp(200, EClass._zone.IsRegion ? 50 : num5);
2886 }
2887 if (parasite != null)
2888 {
2889 parasite.ModExp(200, EClass._zone.IsRegion ? 50 : num5);
2890 }
2891 }
2892 Chara chara = ((ride == null) ? this : ride);
2893 if (!EClass._zone.IsRegion || chara.IsPC)
2894 {
2895 bool flag2 = (chara.isConfused && EClass.rnd(2) == 0) || (chara.isDrunk && EClass.rnd(IsIdle ? 2 : 8) == 0 && !chara.HasElement(1215));
2896 if (host != null && host.ride == this && ((host.isConfused && EClass.rnd(2) == 0) || (host.isDrunk && EClass.rnd(IsIdle ? 2 : 8) == 0 && !host.HasElement(1215))))
2897 {
2898 flag2 = true;
2899 }
2900 if (flag2 && newPoint.Distance(pos) <= 1)
2901 {
2902 Point randomNeighbor = pos.GetRandomNeighbor();
2903 if (CanMoveTo(randomNeighbor, allowDestroyPath: false))
2904 {
2905 newPoint = randomNeighbor;
2906 if (isDrunk)
2907 {
2908 Talk("drunk");
2909 }
2910 }
2911 }
2912 }
2913 if (newPoint.x != pos.x || newPoint.z != pos.z)
2914 {
2915 LookAt(newPoint);
2916 }
2917 CellEffect effect = base.Cell.effect;
2918 if (effect != null && effect.id == 7)
2919 {
2920 CellEffect effect2 = base.Cell.effect;
2921 if (race.height < 500 && !race.tag.Contains("webfree") && EClass.rnd(effect2.power + 25) > EClass.rnd(base.STR + base.DEX + 1))
2922 {
2923 Say("abWeb_caught", this);
2924 PlaySound("web");
2925 effect2.power = effect2.power * 3 / 4;
2926 renderer.PlayAnime(AnimeID.Shiver);
2927 return MoveResult.Fail;
2928 }
2929 Say("abWeb_pass", this);
2930 EClass._map.SetEffect(base.Cell.x, base.Cell.z);
2931 }
2932 if (IsPC)
2933 {
2934 EClass.player.renderExtraTime = 0f;
2935 if (EClass._zone.IsRegion)
2936 {
2938 }
2939 else if ((newPoint.x > pos.x && newPoint.z > pos.z) || (newPoint.x < pos.x && newPoint.z < pos.z))
2940 {
2941 EClass.player.renderExtraTime = actTime * EClass.setting.render.anime.diagonalSpeed;
2942 }
2943 }
2944 if (newPoint.HasChara)
2945 {
2946 foreach (Chara item in newPoint.ListCharas())
2947 {
2948 if (item.mimicry != null && item.IsHostile(this))
2949 {
2950 if (item.mimicry.ShouldRevealOnPush)
2951 {
2952 item.mimicry.RevealMimicry(this, surprise: true);
2953 }
2954 return MoveResult.Event;
2955 }
2956 }
2957 }
2958 if (newPoint.cell.hasDoor)
2959 {
2960 foreach (Thing thing in pos.Things)
2961 {
2962 if (thing.trait is TraitDoor traitDoor && traitDoor.owner.c_lockLv > 0)
2963 {
2964 if (base.INT < 10)
2965 {
2966 return MoveResult.Fail;
2967 }
2968 traitDoor.TryOpenLock(this);
2969 return MoveResult.Door;
2970 }
2971 }
2972 }
2973 Cell cell = newPoint.cell;
2974 Cell cell2 = pos.cell;
2975 bool flag3 = cell.HasLiquid && !IsLevitating;
2976 bool hasBridge = cell.HasBridge;
2977 bool hasRamp = cell.HasRamp;
2978 bool flag4 = EClass._zone.IsSnowCovered && !cell.HasRoof && !cell.isClearSnow;
2979 TileRow tileRow = (hasRamp ? ((TileRow)cell.sourceBlock) : ((TileRow)(hasBridge ? cell.sourceBridge : cell.sourceFloor)));
2980 SourceMaterial.Row row = (hasRamp ? cell.matBlock : (hasBridge ? cell.matBridge : cell.matFloor));
2981 bool flag5 = cell.IsTopWater && !cell.isFloating;
2982 if (!EClass._zone.IsRegion)
2983 {
2984 if (cell.hasDoorBoat)
2985 {
2986 tileRow = FLOOR.sourceWood;
2987 row = MATERIAL.sourceOak;
2988 flag5 = false;
2989 }
2990 else if (flag4 && !tileRow.ignoreSnow)
2991 {
2992 if (tileRow.tileType.IsWater)
2993 {
2994 tileRow = FLOOR.sourceIce;
2995 row = MATERIAL.sourceIce;
2996 }
2997 else
2998 {
2999 tileRow = FLOOR.sourceSnow;
3000 row = MATERIAL.sourceSnow;
3001 }
3002 flag5 = false;
3003 }
3004 }
3005 if ((pos.sourceFloor.isBeach || cell2.IsSnowTile) && !pos.HasObj)
3006 {
3007 EClass._map.SetFoormark(pos, 1, (int)Util.GetAngle(pos.x - newPoint.x, pos.z - newPoint.z), cell2.IsSnowTile ? 312 : 304);
3008 }
3009 if (isSynced)
3010 {
3011 string text = ((flag3 || flag5) ? "water" : tileRow.soundFoot.IsEmpty(row.soundFoot.IsEmpty("default")));
3012 if (cell.obj != 0 && cell.sourceObj.tileType.IsPlayFootSound && !cell.matObj.soundFoot.IsEmpty())
3013 {
3014 text = cell.matObj.soundFoot;
3015 }
3016 if (IsPC)
3017 {
3018 foreach (Thing thing2 in newPoint.Things)
3019 {
3020 if (thing2.IsInstalled && (thing2.trait.IsChangeFloorHeight || thing2.Pref.Surface))
3021 {
3022 text = thing2.material.soundFoot;
3023 }
3024 }
3025 }
3026 if (!text.IsEmpty())
3027 {
3028 SoundManager.altLastData = IsPC;
3029 PlaySound("Footstep/" + text, IsPC ? 1f : 0.9f);
3030 }
3031 if (!flag5)
3032 {
3034 PCOrbit pcOrbit = EClass.screen.pcOrbit;
3035 bool flag6 = scene.actionMode.gameSpeed > 1f;
3036 scene.psFoot.transform.position = renderer.position + pcOrbit.footPos;
3037 scene.psFoot.startColor = row.matColor;
3038 scene.psFoot.Emit(pcOrbit.emitFoot * ((!flag6) ? 1 : 2));
3039 if (flag6 && IsPC)
3040 {
3041 scene.psSmoke.transform.position = renderer.position + pcOrbit.smokePos;
3042 scene.psSmoke.Emit(pcOrbit.emitSmoke);
3043 }
3044 }
3045 if (flag3 || flag5)
3046 {
3047 Effect.Get("ripple").Play(newPoint);
3048 }
3049 }
3050 lastPos.Set(pos);
3051 if (type != MoveType.Force)
3052 {
3053 if (newPoint.HasChara && ai.Current.PushChara)
3054 {
3055 TryPush(newPoint);
3056 }
3057 if (newPoint.HasChara && newPoint.Charas.Count == 1)
3058 {
3059 Chara chara2 = newPoint.Charas[0];
3060 if (CanReplace(chara2))
3061 {
3062 chara2.MoveByForce(lastPos, this);
3063 if (chara.IsPC)
3064 {
3065 Say("replace_pc", chara, chara2);
3066 }
3067 }
3068 }
3069 }
3070 if (cell.hasDoor)
3071 {
3072 foreach (Thing thing3 in newPoint.Things)
3073 {
3074 if (thing3.trait is TraitDoor traitDoor2)
3075 {
3076 traitDoor2.TryOpen(this);
3077 }
3078 }
3079 }
3080 EClass._zone.map.MoveCard(newPoint, this);
3081 SyncRide();
3083 {
3084 foreach (Chara member in EClass.pc.party.members)
3085 {
3086 if (member.isLeashed && !member.IsPC && member.host == null && !member.IsDisabled && !member.HasCondition<ConEntangle>() && !member.IsInCombat && member.Dist(EClass.pc) > 1)
3087 {
3088 member.TryMoveTowards(EClass.pc.pos);
3089 }
3090 }
3091 }
3093 {
3095 }
3096 if (IsPC)
3097 {
3098 PlaySound("Footstep/Extra/pcfootstep");
3099 if (pos.HasThing)
3100 {
3101 foreach (Card item2 in pos.ListCards())
3102 {
3103 if (!item2.isThing || item2.placeState != 0 || item2.ignoreAutoPick)
3104 {
3105 continue;
3106 }
3108 {
3110 ContainerFlag containerFlag = item2.category.GetRoot().id.ToEnum<ContainerFlag>();
3111 if (containerFlag == ContainerFlag.none)
3112 {
3113 containerFlag = ContainerFlag.other;
3114 }
3115 if ((dataPick.noRotten && item2.IsDecayed) || (dataPick.onlyRottable && item2.trait.Decay == 0))
3116 {
3117 continue;
3118 }
3119 if (dataPick.userFilter)
3120 {
3121 switch (dataPick.IsFilterPass(item2.GetName(NameStyle.Full, 1)))
3122 {
3123 case Window.SaveData.FilterResult.PassWithoutFurtherTest:
3124 Pick(item2.Thing);
3125 continue;
3126 case Window.SaveData.FilterResult.Block:
3127 continue;
3128 }
3129 }
3130 if (dataPick.advDistribution)
3131 {
3132 foreach (int cat in dataPick.cats)
3133 {
3134 if (item2.category.uid == cat)
3135 {
3136 Pick(item2.Thing);
3137 }
3138 }
3139 }
3140 else if (!dataPick.flag.HasFlag(containerFlag))
3141 {
3142 Pick(item2.Thing);
3143 }
3144 }
3145 else
3146 {
3147 Pick(item2.Thing);
3148 }
3149 }
3150 }
3151 if (EClass._zone.IsRegion)
3152 {
3154 if (cell3?.zone != null && !cell3.zone.HiddenInRegionMap && (!(cell3.zone is Zone_Field) || cell3.zone.children.Count > 0 || cell3.zone.IsPCFaction))
3155 {
3156 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() ?? "");
3157 }
3158 if (pos.matFloor.alias == "snow" && EClass.rnd(3) == 0)
3159 {
3161 Msg.Say(Lang.GetList("walk_snow").RandomItem());
3162 }
3163 else if (EClass.world.weather.CurrentCondition == Weather.Condition.RainHeavy && EClass.rnd(3) == 0)
3164 {
3166 Msg.Say(Lang.GetList("walk_storm").RandomItem());
3167 }
3168 }
3170 }
3171 if (IsPCC)
3172 {
3173 int num6 = Mathf.Abs(cell2.topHeight - cell.topHeight);
3174 if ((num6 >= 3 && lastPos.sourceBlock.tileType.slopeHeight == 0 && newPoint.sourceBlock.tileType.slopeHeight == 0) || cell2.hasDoorBoat || cell.hasDoorBoat)
3175 {
3176 renderer.PlayAnime((cell2.topHeight >= cell.topHeight) ? AnimeID.JumpDown : ((num6 >= 6) ? AnimeID.Jump : AnimeID.JumpSmall));
3177 }
3178 else
3179 {
3180 float surfaceHeight = cell2.GetSurfaceHeight();
3181 float surfaceHeight2 = cell.GetSurfaceHeight();
3182 num6 = (int)Mathf.Abs((surfaceHeight - surfaceHeight2) * 100f);
3183 if (num6 >= 15)
3184 {
3185 renderer.PlayAnime((surfaceHeight >= surfaceHeight2) ? AnimeID.JumpDown : ((num6 >= 40) ? AnimeID.Jump : AnimeID.JumpSmall));
3186 }
3187 }
3188 }
3189 lastPos.Things.ForeachReverse(delegate(Thing t)
3190 {
3191 t.trait.OnSteppedOut(this);
3192 });
3193 if (!IsPC)
3194 {
3195 pos.Things.ForeachReverse(delegate(Thing t)
3196 {
3197 t.trait.OnStepped(this);
3198 });
3199 }
3200 if (CanDestroyPath())
3201 {
3203 }
3204 if (IsPC)
3205 {
3206 if (renderer.anime == null && renderer.replacer != null)
3207 {
3209 }
3211 {
3212 if (!FLOOR.IsTatami(pos.cell.sourceSurface.id) && pos.cell.room == null)
3213 {
3214 EClass.player.flags.isShoesOff = false;
3215 EClass.pc.Say("shoes_on", EClass.pc);
3216 EClass.pc.SetPCCState(PCCState.Normal);
3217 }
3218 }
3219 else if (FLOOR.IsTatami(pos.cell.sourceSurface.id) && pos.cell.room != null)
3220 {
3221 EClass.player.flags.isShoesOff = true;
3222 EClass.pc.Say("shoes_off", EClass.pc);
3223 EClass.pc.SetPCCState(PCCState.ShoesOff);
3224 }
3225 }
3226 bool flag7 = flag5 || EClass._zone.IsUnderwater;
3227 if (wasInWater != flag7)
3228 {
3229 wasInWater = flag7;
3230 RefreshSpeed();
3231 }
3232 hasMovedThisTurn = true;
3233 return MoveResult.Success;
3234 }
AnimeID
Definition: AnimeID.cs:2
AttackSource
Definition: AttackSource.cs:2
ContainerFlag
Definition: ContainerFlag.cs:5
NameStyle
Definition: NameStyle.cs:2
AIAct Current
Definition: AIAct.cs:103
virtual bool PushChara
Definition: AIAct.cs:82
static void Search(Chara c, bool manual=false)
Definition: ActWait.cs:46
virtual bool isPCC
Definition: CardActor.cs:39
void PlayAnime(AnimeID id, bool force)
TransAnime anime
Definition: CardRenderer.cs:23
virtual void NextFrame()
CardActor actor
Definition: CardRenderer.cs:11
Definition: Card.cs:11
virtual string GetName(NameStyle style, int num=-1)
Definition: Card.cs:2655
bool IsDecayed
Definition: Card.cs:2327
virtual bool isThing
Definition: Card.cs:2119
int EvalueMax(int ele, int min=0)
Definition: Card.cs:2625
SourceMaterial.Row material
Definition: Card.cs:2089
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:6426
int c_lockLv
Definition: Card.cs:977
bool ignoreAutoPick
Definition: Card.cs:507
void Talk(string idTopic, string ref1=null, string ref2=null, bool forceSync=false)
Definition: Card.cs:6986
PlaceState placeState
Definition: Card.cs:84
Point pos
Definition: Card.cs:60
Trait trait
Definition: Card.cs:54
MoveType
Definition: Card.cs:21
void DamageHP(long dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
Definition: Card.cs:4149
MoveResult
Definition: Card.cs:13
bool IsInstalled
Definition: Card.cs:2421
virtual Thing Thing
Definition: Card.cs:2096
int Evalue(int ele)
Definition: Card.cs:2611
int Dist(Card c)
Definition: Card.cs:7979
void ModExp(string alias, int a)
Definition: Card.cs:2688
SourceCategory.Row category
Definition: Card.cs:2087
virtual RenderRow TileRow
Definition: Card.cs:2173
bool isLeashed
Definition: Card.cs:843
bool HasElement(int ele, bool includeNagative=false)
Definition: Card.cs:6173
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:7104
Definition: Cell.cs:7
Room room
Definition: Cell.cs:102
SourceBlock.Row sourceBlock
Definition: Cell.cs:1052
bool IsSnowTile
Definition: Cell.cs:782
bool hasDoorBoat
Definition: Cell.cs:498
bool HasBridge
Definition: Cell.cs:671
bool isClearSnow
Definition: Cell.cs:450
bool isFloating
Definition: Cell.cs:474
SourceMaterial.Row matObj
Definition: Cell.cs:1036
byte topHeight
Definition: Cell.cs:78
SourceMaterial.Row matFloor
Definition: Cell.cs:1032
byte obj
Definition: Cell.cs:38
SourceObj.Row sourceObj
Definition: Cell.cs:1072
bool HasRamp
Definition: Cell.cs:837
bool hasDoor
Definition: Cell.cs:258
SourceFloor.Row sourceSurface
Definition: Cell.cs:1059
float GetSurfaceHeight()
Definition: Cell.cs:1688
bool CanSuffocate()
Definition: Cell.cs:1111
Definition: Chara.cs:10
void TickConditions()
Definition: Chara.cs:3738
bool wasInWater
Definition: Chara.cs:150
bool IsLevitating
Definition: Chara.cs:599
AIAct ai
Definition: Chara.cs:204
override bool IsPC
Definition: Chara.cs:626
bool isDrunk
Definition: Chara.cs:126
Party party
Definition: Chara.cs:43
bool CanDestroyPath()
Definition: Chara.cs:2489
bool IsInCombat
Definition: Chara.cs:878
bool HasCondition(string alias)
Definition: Chara.cs:9635
AIAct SetAI(AIAct g)
Definition: Chara.cs:9104
bool IsIdle
Definition: Chara.cs:867
override bool IsDisabled
Definition: Chara.cs:587
bool hasMovedThisTurn
Definition: Chara.cs:178
override bool isSynced
Definition: Chara.cs:705
bool CanMoveTo(Point p, bool allowDestroyPath=true)
Definition: Chara.cs:2502
void DestroyPath(Point pos)
Definition: Chara.cs:3236
override bool IsPCFaction
Definition: Chara.cs:685
float actTime
Definition: Chara.cs:180
override int MaxHP
Definition: Chara.cs:722
Zone currentZone
Definition: Chara.cs:257
bool CanReplace(Chara c)
Definition: Chara.cs:3347
Point lastPos
Definition: Chara.cs:90
void MoveByForce(Point newPoint, Card c=null, bool checkWall=false)
Definition: Chara.cs:2687
Stats burden
Definition: Chara.cs:1170
Chara parasite
Definition: Chara.cs:30
Chara ride
Definition: Chara.cs:27
void RefreshSpeed(Element.BonusInfo info=null)
Definition: Chara.cs:1907
MoveResult TryMoveTowards(Point p)
Definition: Chara.cs:2695
void SyncRide()
Definition: Chara.cs:4006
bool isDead
Definition: Chara.cs:391
override void LookAt(Card c)
Definition: Chara.cs:3602
bool isConfused
Definition: Chara.cs:128
override bool IsPCC
Definition: Chara.cs:696
void TryPush(Point point)
Definition: Chara.cs:3280
void SetPCCState(PCCState state)
Definition: Chara.cs:6835
SourceRace.Row race
Definition: Chara.cs:466
bool allyKeepDistance
Definition: ConfigTactics.cs:6
static Game game
Definition: EClass.cs:9
static Scene scene
Definition: EClass.cs:31
static Zone _zone
Definition: EClass.cs:21
static World world
Definition: EClass.cs:41
static Map _map
Definition: EClass.cs:19
static int rnd(long a)
Definition: EClass.cs:59
static BaseGameScreen screen
Definition: EClass.cs:33
static int rndHalf(int a)
Definition: EClass.cs:97
static Player player
Definition: EClass.cs:13
static int sqrt(int a)
Definition: EClass.cs:88
static GameSetting setting
Definition: EClass.cs:35
Definition: EInput.cs:8
static void Consume(int _skipFrame)
Definition: EInput.cs:667
Definition: Effect.cs:7
static Effect Get(Effect original)
Definition: Effect.cs:85
void Play(float delay, Point from, float fixY=0f, Point to=null, Sprite sprite=null)
Definition: Effect.cs:100
Zone zone
Definition: EloMap.cs:11
Cell GetCell(Point pos)
Definition: EloMap.cs:272
Definition: FLOOR.cs:2
static SourceFloor.Row sourceSnow
Definition: FLOOR.cs:31
static SourceFloor.Row sourceIce
Definition: FLOOR.cs:35
static bool IsTatami(int id)
Definition: FLOOR.cs:39
static SourceFloor.Row sourceWood
Definition: FLOOR.cs:37
void AdvanceMin(int a)
Definition: GameDate.cs:22
float defaultActPace
Definition: GameSetting.cs:327
RenderSetting render
Definition: GameSetting.cs:301
ConfigTactics tactics
Definition: Game.cs:91
Config config
Definition: Game.cs:219
Definition: Lang.cs:6
static string[] GetList(string id)
Definition: Lang.cs:116
static SourceMaterial.Row sourceOak
Definition: MATERIAL.cs:47
static SourceMaterial.Row sourceSnow
Definition: MATERIAL.cs:41
static SourceMaterial.Row sourceIce
Definition: MATERIAL.cs:43
void MoveCard(Point p, Card t)
Definition: Map.cs:841
void SetFoormark(Point pos, int id, int angle, int offset=0)
Definition: Map.cs:2060
void SetEffect(int x, int z, CellEffect effect=null)
Definition: Map.cs:1508
Color Ono
Definition: MsgColors.cs:13
Definition: Msg.cs:5
static MsgColors colors
Definition: Msg.cs:20
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
static void SetColor()
Definition: Msg.cs:22
Definition: NoGoal.cs:4
int emitFoot
Definition: PCOrbit.cs:9
int emitSmoke
Definition: PCOrbit.cs:11
Vector3 smokePos
Definition: PCOrbit.cs:15
Vector3 footPos
Definition: PCOrbit.cs:13
List< Chara > members
Definition: Party.cs:19
bool isShoesOff
Definition: Player.cs:376
int distanceTravel
Definition: Player.cs:960
Flags flags
Definition: Player.cs:1161
Window.SaveData dataPick
Definition: Player.cs:1101
bool regionMoveWarned
Definition: Player.cs:1227
Definition: Point.cs:9
SourceMaterial.Row matFloor
Definition: Point.cs:57
SourceBlock.Row sourceBlock
Definition: Point.cs:63
List< Card > ListCards(bool includeMasked=false)
Definition: Point.cs:1051
Point Set(int _x, int _z)
Definition: Point.cs:503
List< Thing > Things
Definition: Point.cs:338
int x
Definition: Point.cs:36
int z
Definition: Point.cs:39
List< Chara > Charas
Definition: Point.cs:340
bool HasThing
Definition: Point.cs:251
List< Chara > ListCharas()
Definition: Point.cs:1171
SourceFloor.Row sourceFloor
Definition: Point.cs:65
bool HasObj
Definition: Point.cs:137
int Distance(Point p)
Definition: Point.cs:989
Cell cell
Definition: Point.cs:51
Point GetRandomNeighbor()
Definition: Point.cs:759
bool HasChara
Definition: Point.cs:238
TileType tileType
Definition: RenderRow.cs:77
Definition: Scene.cs:8
ParticleSystem psSmoke
Definition: Scene.cs:113
ParticleSystem psFoot
Definition: Scene.cs:111
EloMap elomap
Definition: Scene.cs:149
bool Surface
Definition: SourcePref.cs:330
virtual bool ShowDangerLv
Definition: Spatial.cs:503
virtual bool IsRegion
Definition: Spatial.cs:515
virtual string Name
Definition: Spatial.cs:509
SourceZone.Row source
Definition: Spatial.cs:453
List< Spatial > children
Definition: Spatial.cs:37
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:165
virtual void OnSteppedOut(Chara c)
Definition: Trait.cs:1106
virtual bool IsChangeFloorHeight
Definition: Trait.cs:74
virtual void OnStepped(Chara c)
Definition: Trait.cs:1102
Card owner
Definition: Trait.cs:28
Definition: Util.cs:10
static float GetAngle(Vector3 self, Vector3 target)
Definition: Util.cs:121
Condition
Definition: Weather.cs:16
Condition CurrentCondition
Definition: Weather.cs:79
FilterResult IsFilterPass(string text)
Definition: Window.cs:498
ContainerFlag flag
Definition: Window.cs:267
HashSet< int > cats
Definition: Window.cs:119
bool userFilter
Definition: Window.cs:132
bool noRotten
Definition: Window.cs:439
bool advDistribution
Definition: Window.cs:427
Definition: Window.cs:13
GameDate date
Definition: World.cs:6
Weather weather
Definition: World.cs:12
virtual bool PetFollow
Definition: Zone.cs:289
override int DangerLv
Definition: Zone.cs:110
bool IsPCFaction
Definition: Zone.cs:475
virtual bool IsUnderwater
Definition: Zone.cs:271
virtual bool KeepAllyDistance
Definition: Zone.cs:304
virtual bool HiddenInRegionMap
Definition: Zone.cs:415
Map map
Definition: Zone.cs:63

References EClass._map, EClass._zone, 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(), Card.category, Window.SaveData.cats, Point.cell, Point.Charas, Spatial.children, Msg.colors, Core.config, Game.config, EInput.Consume(), EClass.core, AIAct.Current, Weather.CurrentCondition, currentZone, Card.DamageHP(), Zone.DangerLv, Player.dataPick, World.date, GameSetting.defaultActPace, DestroyPath(), GameSetting.RenderSetting.AnimeSetting.diagonalSpeed, Card.Dist(), Point.Distance(), Player.distanceTravel, Scene.elomap, PCOrbit.emitFoot, PCOrbit.emitSmoke, Card.Evalue(), Card.EvalueMax(), Window.SaveData.flag, Player.flags, PCOrbit.footPos, CoreConfig.game, EClass.game, Effect.Get(), EloMap.GetCell(), Lang.GetList(), Card.GetName(), Stats.GetPhase(), Point.GetRandomNeighbor(), Cell.GetSurfaceHeight(), CardRenderer.hasActor, Cell.HasBridge, Point.HasChara, HasCondition(), Cell.hasDoor, Cell.hasDoorBoat, Card.HasElement(), hasMovedThisTurn, Point.HasObj, Cell.HasRamp, Point.HasThing, Zone.HiddenInRegionMap, host, CellEffect.id, Card.ignoreAutoPick, TileRow.ignoreSnow, Trait.IsChangeFloorHeight, Cell.isClearSnow, isConfused, isDead, Card.IsDecayed, IsDisabled, isDrunk, Window.SaveData.IsFilterPass(), Cell.isFloating, IsIdle, IsInCombat, Card.IsInstalled, Card.isLeashed, IsLevitating, IsPC, CardActor.isPCC, IsPCC, IsPCFaction, Zone.IsPCFaction, Spatial.IsRegion, Player.Flags.isShoesOff, Cell.IsSnowTile, isSynced, FLOOR.IsTatami(), Card.isThing, Zone.IsUnderwater, TileType.IsWater, item, Zone.KeepAllyDistance, lastPos, Point.ListCards(), Point.ListCharas(), LookAt(), Zone.map, SourceMaterial.Row.matColor, Card.material, Cell.matFloor, Point.matFloor, Cell.matObj, MaxHP, Party.members, Card.ModExp(), MoveByForce(), Map.MoveCard(), Spatial.Name, CardRenderer.NextFrame(), Window.SaveData.noRotten, Cell.obj, MsgColors.Ono, Trait.OnStepped(), Trait.OnSteppedOut(), Trait.owner, parasite, party, EClass.pc, BaseGameScreen.pcOrbit, Zone.PetFollow, Pick, Card.placeState, Effect.Play(), CardRenderer.PlayAnime(), EClass.player, Card.PlaySound(), Card.pos, CellEffect.power, Thing.Pref, Scene.psFoot, Scene.psSmoke, AIAct.PushChara, race, RefreshSpeed(), Player.regionMoveWarned, GameSetting.RenderSetting.AnimeSetting.regionSpeed, GameSetting.render, Card.renderer, CardRenderer.replacer, ride, EClass.rnd(), EClass.rndHalf(), 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, EClass.sqrt(), SourcePref.Surface, SyncRide(), Game.Config.tactics, Card.Talk(), CoreConfig.test, Card.Thing, Point.Things, TickConditions(), Card.TileRow, RenderRow.tileType, Cell.topHeight, Card.trait, TryMoveTowards(), TryPush(), Window.SaveData.userFilter, Util, wasInWater, World.weather, EClass.world, Point.x, Point.z, and EloMap.Cell.zone.

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

◆ _ShowDialog()

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

Definition at line 7414 of file Chara.cs.

7415 {
7416 EClass.Sound.Play("pop_drama");
7417 if (book == "_chara" && IsPC)
7418 {
7419 step = "pc";
7420 }
7421 if (id == "lomias")
7422 {
7424 }
7425 return LayerDrama.Activate(book, sheet, step, this, null, tag);
7426 }
ID_Achievement
static SoundManager Sound
Definition: EClass.cs:47
static LayerDrama Activate(string book, string idSheet, string idStep, Chara target=null, Card ref1=null, string tag="")
Definition: LayerDrama.cs:66
Definition: Steam.cs:10
static void GetAchievement(ID_Achievement id)
Definition: Steam.cs:51

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

◆ AddCondition() [1/2]

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

Definition at line 9479 of file Chara.cs.

9480 {
9481 c.owner = this;
9482 if (!(c is ConBurning))
9483 {
9484 if (c is ConBleed && ResistLv(964) >= 3)
9485 {
9486 return null;
9487 }
9488 }
9489 else if (ResistLv(950) >= 3)
9490 {
9491 return null;
9492 }
9494 {
9495 if (c.GainResistFactor >= 400)
9496 {
9497 c.power /= 2;
9498 }
9499 ResistCon(c);
9500 if (c.power <= 0)
9501 {
9502 return null;
9503 }
9504 }
9505 if (!force)
9506 {
9507 if (c.source.negate.Length != 0)
9508 {
9509 string[] negate = c.source.negate;
9510 foreach (string text in negate)
9511 {
9512 if (HasElement(text))
9513 {
9514 return null;
9515 }
9516 }
9517 }
9518 Element defenseAttribute = c.GetDefenseAttribute(this);
9519 if (defenseAttribute != null)
9520 {
9521 c.power = 100 * c.power / Mathf.Max(100 + defenseAttribute.Value, 1);
9522 }
9523 if (c.source.resistance.Length != 0)
9524 {
9525 int num = ResistLv(EClass.sources.elements.alias[c.source.resistance[0]].id);
9526 if (num > 0)
9527 {
9528 c.power /= num * num + 1;
9529 if (c.power <= 40)
9530 {
9531 return null;
9532 }
9533 }
9534 }
9535 c.power = c.EvaluatePower(c.power);
9536 if (c.power <= 0)
9537 {
9538 return null;
9539 }
9540 }
9541 int num2 = c.EvaluateTurn(c.power);
9542 if (num2 == 0)
9543 {
9544 return null;
9545 }
9546 for (int j = 0; j < conditions.Count; j++)
9547 {
9548 if (conditions[j].id != c.id)
9549 {
9550 continue;
9551 }
9552 if (c.Type == ConditionType.Stance || c.IsToggle)
9553 {
9554 conditions[j].Kill();
9555 return null;
9556 }
9557 if (conditions[j].CanStack(c))
9558 {
9559 if (conditions[j].ShouldOverride(c))
9560 {
9561 if (conditions[j].IsOverrideConditionMet(c, num2))
9562 {
9563 conditions[j].Kill(silent: true);
9564 continue;
9565 }
9566 return null;
9567 }
9568 if (CanGainConResist)
9569 {
9570 AddResistCon(c);
9571 }
9572 conditions[j].OnStacked(c.power);
9573 conditions[j].OnStartOrStack();
9574 conditions[j].PlayEffect();
9575 }
9576 if (!conditions[j].AllowMultipleInstance)
9577 {
9578 return null;
9579 }
9580 }
9581 foreach (Condition condition in conditions)
9582 {
9583 if (condition.TryNullify(c))
9584 {
9585 return null;
9586 }
9587 }
9588 c.value = num2;
9589 conditions.Add(c);
9590 if (CanGainConResist)
9591 {
9592 AddResistCon(c);
9593 }
9594 c.SetOwner(this);
9595 c.Start();
9596 SetDirtySpeed();
9597 if (c.ShouldRefresh)
9598 {
9599 Refresh();
9600 }
9601 if (c.CancelAI)
9602 {
9603 ai.Cancel();
9604 }
9605 if (IsPC && c.ConsumeTurn && !EClass.pc.isRestrained)
9606 {
9608 }
9609 if (c.SyncRide && (ride != null || parasite != null))
9610 {
9611 if (ride != null)
9612 {
9614 }
9615 if (parasite != null)
9616 {
9618 }
9619 }
9620 return c;
9621 }
ConditionType
Definition: ConditionType.cs:2
virtual Status Cancel()
Definition: AIAct.cs:305
virtual bool SyncRide
virtual bool IsToggle
virtual bool ShouldRefresh
virtual bool CancelAI
virtual int EvaluatePower(int p)
virtual int GainResistFactor
virtual bool ConsumeTurn
Element GetDefenseAttribute(Chara c=null)
virtual int EvaluateTurn(int p)
virtual void SetOwner(Chara _owner, bool onDeserialize=false)
virtual bool TryNullify(Condition c)
virtual ConditionType Type
Definition: BaseStats.cs:19
SourceStat.Row source
Definition: BaseStats.cs:15
int id
Definition: BaseStats.cs:11
bool isRestrained
Definition: Card.cs:567
int ResistLv(int res)
Definition: Card.cs:6168
void SetDirtySpeed()
Definition: Chara.cs:1898
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:9474
bool CanGainConResist
Definition: Chara.cs:1187
void AddResistCon(Condition con)
Definition: Chara.cs:9888
void ResistCon(Condition con)
Definition: Chara.cs:9908
static Condition Create(string alias, int power=100, Action< Condition > onCreate=null)
Definition: Condition.cs:46
static SourceManager sources
Definition: EClass.cs:43
int Value
Definition: ELEMENT.cs:297
void EndTurn(bool consume=true)
Definition: Player.cs:2153
SourceElement elements

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

9469 : Condition
9470 {
9471 return AddCondition(typeof(T).Name, p, force);
9472 }
string Name
Definition: Card.cs:2177

◆ AddCooldown()

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

Definition at line 8885 of file Chara.cs.

8886 {
8887 if (_cooldowns == null)
8888 {
8889 _cooldowns = new List<int>();
8890 }
8891 if (turns != 0)
8892 {
8893 _cooldowns.Add(idEle * 1000 + turns);
8894 return;
8895 }
8896 SourceElement.Row row = EClass.sources.elements.map[idEle];
8897 if (row.cooldown > 0)
8898 {
8899 _cooldowns.Add(idEle * 1000 + row.cooldown);
8900 }
8901 }
List< int > _cooldowns
Definition: Chara.cs:58

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

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

◆ AddFoodHistory()

void Chara.AddFoodHistory ( Thing  food)
inline

Definition at line 10378 of file Chara.cs.

10379 {
10380 if (!IsPCFaction || !IsGlobal)
10381 {
10382 _historyFood = null;
10383 return;
10384 }
10385 if (_historyFood == null)
10386 {
10387 _historyFood = new List<List<string>>
10388 {
10389 new List<string>()
10390 };
10391 }
10392 if (_historyFood[0].Count < 5)
10393 {
10394 _historyFood[0].Add(food.id);
10395 }
10396 }
override bool IsGlobal
Definition: Chara.cs:624
List< List< string > > _historyFood
Definition: Chara.cs:64

References food.

Referenced by FoodEffect.Proc().

◆ AddHobby()

void Chara.AddHobby ( int  id)
inline

Definition at line 9304 of file Chara.cs.

9305 {
9306 foreach (int hobby in _hobbies)
9307 {
9308 if (hobby == id)
9309 {
9310 return;
9311 }
9312 }
9313 _hobbies.Add(id);
9314 }
List< int > _hobbies
Definition: Chara.cs:49

◆ AddRandomBodyPart()

void Chara.AddRandomBodyPart ( bool  msg = false)
inline

Definition at line 2243 of file Chara.cs.

2244 {
2245 int ele = new int[9] { 30, 31, 33, 35, 35, 36, 34, 37, 39 }.RandomItem();
2246 body.AddBodyPart(ele);
2247 if (msg)
2248 {
2249 Say("gain_bodyparts", this, Element.Get(ele).GetName().ToLower());
2250 PlaySound("offering");
2251 }
2252 }
void AddBodyPart(int ele, Thing thing=null)
Definition: CharaBody.cs:283
CharaBody body
Definition: Chara.cs:94
static SourceElement.Row Get(int id)
Definition: ELEMENT.cs:406

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

Referenced by Feat.Apply().

◆ AddResistCon()

void Chara.AddResistCon ( Condition  con)
inline

Definition at line 9888 of file Chara.cs.

9889 {
9890 if (con.power > 0 && con.GainResistFactor > 0)
9891 {
9892 int key = con.id;
9893 if (resistCon == null)
9894 {
9895 resistCon = new Dictionary<int, int>();
9896 }
9897 if (resistCon.ContainsKey(key))
9898 {
9899 resistCon[key] += con.power * con.GainResistFactor / 100;
9900 }
9901 else
9902 {
9903 resistCon[key] = con.power * con.GainResistFactor / 100;
9904 }
9905 }
9906 }
Dictionary< int, int > resistCon
Definition: Chara.cs:216

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

◆ AddWork()

void Chara.AddWork ( int  id)
inline

Definition at line 9316 of file Chara.cs.

9317 {
9318 foreach (int work in _works)
9319 {
9320 if (work == id)
9321 {
9322 return;
9323 }
9324 }
9325 _works.Add(id);
9326 }
List< int > _works
Definition: Chara.cs:52

◆ ApplyDeathPenalty()

void Chara.ApplyDeathPenalty ( )
inline

Definition at line 5354 of file Chara.cs.

5355 {
5356 if (!IsPC)
5357 {
5358 return;
5359 }
5360 int currency = GetCurrency();
5361 if (currency > 0)
5362 {
5363 int num = currency / 3 + EClass.rnd(currency / 3 + 1);
5364 if (num <= 0)
5365 {
5366 num = 1;
5367 }
5368 Msg.Say("panaltyMoney", this, Lang._currency(num));
5369 ModCurrency(-num);
5371 }
5372 foreach (Element value in EClass.pc.elements.dict.Values)
5373 {
5374 if (EClass.rnd(5) == 0 && value.IsMainAttribute)
5375 {
5376 EClass.pc.elements.ModExp(value.id, -500f);
5377 }
5378 }
5379 }
@ currency
ElementContainerCard elements
Definition: Card.cs:42
int GetCurrency(string id="money")
Definition: Card.cs:4057
void ModCurrency(int a, string id="money")
Definition: Card.cs:4043
void ModExp(int ele, float a, bool chain=false)
Dictionary< int, Element > dict
int id
Definition: ELEMENT.cs:255
bool IsMainAttribute
Definition: ELEMENT.cs:388
static string _currency(object a, string IDCurrency)
Definition: Lang.cs:164
static Thing CreateCurrency(int a, string id="money")
Definition: ThingGen.cs:37
Card AddCard(Card t, Point point)
Definition: Zone.cs:2017

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

2079 {
2080 switch (tag)
2081 {
2082 case EditorTag.HostilityNeutral:
2083 {
2084 Hostility hostility2 = (base.c_originalHostility = Hostility.Neutral);
2085 this.hostility = hostility2;
2086 break;
2087 }
2088 case EditorTag.HostilityEnemy:
2089 {
2090 Hostility hostility2 = (base.c_originalHostility = Hostility.Enemy);
2091 this.hostility = hostility2;
2092 break;
2093 }
2094 case EditorTag.HostilityFriend:
2095 {
2096 Hostility hostility2 = (base.c_originalHostility = Hostility.Friend);
2097 this.hostility = hostility2;
2098 break;
2099 }
2100 case EditorTag.Male:
2101 bio.SetGender(2);
2102 base.c_idPortrait = Portrait.GetRandomPortrait(2, GetIdPortraitCat());
2103 break;
2104 case EditorTag.Female:
2105 bio.SetGender(1);
2106 base.c_idPortrait = Portrait.GetRandomPortrait(1, GetIdPortraitCat());
2107 break;
2108 case EditorTag.baby:
2109 SetFeat(1232);
2110 break;
2111 }
2112 base.ApplyEditorTags(tag);
2113 }
EditorTag
Definition: EditorTag.cs:2
void SetGender(int g)
Definition: Biography.cs:478
Biography bio
Definition: Card.cs:45
void SetFeat(int id, int value=1, bool msg=false)
Definition: Chara.cs:10113
string GetIdPortraitCat()
Definition: Chara.cs:8348
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 2205 of file Chara.cs.

2206 {
2207 elements.ApplyElementMap(base.uid, SourceValueType.Chara, job.elementMap, base.DefaultLV, remove, applyFeat: true);
2208 if (IsPCC)
2209 {
2210 EClass.game.uniforms.Apply(pccData, job.id, base.IsMale, canUseOtherGender: true);
2211 }
2212 }
SourceValueType
SourceJob.Row job
Definition: Chara.cs:468
void ApplyElementMap(int uid, SourceValueType type, Dictionary< int, int > map, int lv, bool invert=false, bool applyFeat=false)
PCCUniformManager uniforms
Definition: Game.cs:195

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

Referenced by ChangeJob(), and OnCreate().

◆ ApplyRace()

void Chara.ApplyRace ( bool  remove = false)
inline

Definition at line 2291 of file Chara.cs.

2292 {
2293 string[] array = race.figure.Split('|');
2294 foreach (string s in array)
2295 {
2296 int num = ParseBodySlot(s);
2297 if (num != -1)
2298 {
2299 if (remove)
2300 {
2301 body.RemoveBodyPart(num);
2302 }
2303 else
2304 {
2305 body.AddBodyPart(num);
2306 }
2307 }
2308 }
2310 elements.ApplyElementMap(base.uid, SourceValueType.Chara, race.elementMap, base.DefaultLV, remove, applyFeat: true);
2311 if (!remove)
2312 {
2313 if (race.id == "bike" && id != "bike_cub")
2314 {
2315 SetFeat(1423, (id == "chara" || id == "player") ? 10 : (1 + EClass.rnd(10)));
2316 }
2317 if (race.id == "horse" && EClass.rnd(5) == 0)
2318 {
2319 SetFeat(1423, 1 + EClass.rnd(5));
2320 }
2321 }
2322 }
void RefreshBodyParts()
Definition: CharaBody.cs:309
void RemoveBodyPart(int ele)
Definition: CharaBody.cs:338
int ParseBodySlot(string s)
Definition: Chara.cs:2226

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

Referenced by ChangeRace(), and OnCreate().

◆ Banish()

void Chara.Banish ( Chara  owner)
inline

Definition at line 2393 of file Chara.cs.

2394 {
2395 owner?.Say("summon_vanish", this);
2396 pos.PlayEffect("vanish");
2397 pos.PlaySound("vanish");
2398 pos.PlayEffect("teleport");
2399 Destroy();
2400 }
void Destroy()
Definition: Card.cs:5182
SoundSource PlaySound(string id, bool synced=true, float v=1f, bool spatial=true)
Definition: Point.cs:1253
Effect PlayEffect(string id)
Definition: Point.cs:1248

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

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

◆ BanishAllMinions()

void Chara.BanishAllMinions ( )
inline

Definition at line 2430 of file Chara.cs.

2431 {
2432 List<Chara> list = new List<Chara>();
2433 foreach (Chara chara in EClass._map.charas)
2434 {
2435 if (chara.IsMinion && chara.master == this)
2436 {
2437 list.Add(chara);
2438 }
2439 }
2440 foreach (Chara item in list)
2441 {
2442 item.Banish(this);
2443 }
2444 }
override bool IsMinion
Definition: Chara.cs:641
Chara master
Definition: Chara.cs:88
List< Chara > charas
Definition: Map.cs:81

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

◆ CalcBurden()

void Chara.CalcBurden ( )
inline

Definition at line 1866 of file Chara.cs.

1867 {
1868 int num = base.ChildrenWeight * 100 / Mathf.Max(1, WeightLimit);
1869 if (num < 0)
1870 {
1871 num = 1000;
1872 }
1874 {
1875 num = 0;
1876 }
1877 burden.Set(num);
1878 SetDirtySpeed();
1879 }
override int WeightLimit
Definition: Chara.cs:724
bool ignoreWeight
Definition: CoreDebug.cs:187
static CoreDebug debug
Definition: EClass.cs:49
Stats Set(int[] _raw, int _rawIndex, Chara _CC)
Definition: Stats.cs:109

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

Referenced by Scene.OnUpdate().

◆ CalcCastingChance()

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

Definition at line 6272 of file Chara.cs.

6273 {
6274 if (!(e is Spell))
6275 {
6276 return 100;
6277 }
6278 if (!IsPC)
6279 {
6280 int num2 = 95;
6281 if (host != null)
6282 {
6283 if (host.ride == this)
6284 {
6285 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.EvalueRiding()));
6286 }
6287 if (host.parasite == this)
6288 {
6289 return num2 * 100 / (100 + 300 / Mathf.Max(5, 10 + host.Evalue(227)));
6290 }
6291 }
6292 return num2;
6293 }
6294 int num3 = Evalue(304);
6295 if (!IsPCFaction)
6296 {
6297 num3 = Mathf.Max(num3, base.LV + 5);
6298 }
6299 int num4 = 0;
6300 int num5 = 0;
6301 bool num6 = GetArmorSkill() == 122;
6302 AttackStyle attackStyle = body.GetAttackStyle();
6303 if (num6)
6304 {
6305 num4 = 20 - Evalue(122) / 5;
6306 num5 += 10 - Evalue(1654) * 4;
6307 }
6308 else
6309 {
6310 num4 = 10 - Evalue(120) / 5;
6311 }
6312 if (num4 < 5)
6313 {
6314 num4 = 5;
6315 }
6316 if (ride != null)
6317 {
6318 num4 += 5;
6319 }
6320 if (parasite != null)
6321 {
6322 num4 += 10;
6323 }
6324 if (attackStyle == AttackStyle.TwoWield)
6325 {
6326 num4 += 5;
6327 }
6328 if (attackStyle == AttackStyle.Shield)
6329 {
6330 num4 += 10;
6331 num5 += 20 - Evalue(1654) * 8;
6332 }
6333 if (isConfused)
6334 {
6335 num4 += 10000;
6336 }
6337 if (HasCondition<ConDim>())
6338 {
6339 num4 += ((Evalue(1654) >= 3) ? 1500 : 2500);
6340 }
6341 if (num > 1)
6342 {
6343 num4 += 5 * num;
6344 }
6345 if (num5 < 0)
6346 {
6347 num5 = 0;
6348 }
6349 return Mathf.Clamp(100 + e.Value - 10 - e.source.LV * e.source.cost[0] * num4 / Mathf.Max(10 + num3 * 10, 1), 0, 100 - num5);
6350 }
AttackStyle
Definition: AttackStyle.cs:2
AttackStyle GetAttackStyle()
Definition: CharaBody.cs:479
override int GetArmorSkill()
Definition: Chara.cs:8067
int EvalueRiding()
Definition: Chara.cs:6263
SourceElement.Row source
Definition: ELEMENT.cs:278
Definition: SPELL.cs:630

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

Referenced by Element._WriteNote().

◆ CalculateMaxStamina()

void Chara.CalculateMaxStamina ( )
inline

Definition at line 2059 of file Chara.cs.

2060 {
2061 int num = base.END;
2062 int num2 = 0;
2063 foreach (Element value in elements.dict.Values)
2064 {
2065 if (value.source.category == "skill")
2066 {
2067 num = ((!IsPC) ? (num + Mathf.Max(value.ValueWithoutLink, 0)) : (num + Mathf.Max(value.vBase, 0)));
2068 }
2069 }
2070 num2 = EClass.curve(num, 30, 10, 60);
2071 if (num2 < 10)
2072 {
2073 num2 = 10;
2074 }
2075 _maxStamina = num2 + 15;
2076 }
int _maxStamina
Definition: Chara.cs:367
static int curve(long _a, int start, int step, int rate=75)
Definition: EClass.cs:69
int ValueWithoutLink
Definition: ELEMENT.cs:299
int vBase
Definition: ELEMENT.cs:257

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

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

◆ CallHelp()

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

Definition at line 6578 of file Chara.cs.

6579 {
6580 foreach (Chara chara in EClass._map.charas)
6581 {
6582 if (!chara.IsPCFaction && chara.OriginalHostility == OriginalHostility && (fanatic || Dist(chara) <= 6) && (EClass.rnd(3) != 0 || fanatic))
6583 {
6584 chara.GoHostile(tg);
6585 }
6586 }
6587 }
Hostility OriginalHostility
Definition: Chara.cs:473
void GoHostile(Card _tg)
Definition: Chara.cs:6472

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

8437 {
8438 if (things.IsFull())
8439 {
8440 return false;
8441 }
8442 if (t.c_isImportant)
8443 {
8444 return false;
8445 }
8446 if (t.id == "1084")
8447 {
8448 return true;
8449 }
8450 if (t.trait is TraitBookExp)
8451 {
8452 return true;
8453 }
8454 if (t.trait.CanOnlyCarry || !t.trait.CanBeDestroyed || t.trait.CanExtendBuild || t.rarity == Rarity.Artifact || t.IsContainer)
8455 {
8456 return false;
8457 }
8458 return true;
8459 }
Rarity
Definition: Rarity.cs:2
string id
Definition: Card.cs:36
Rarity rarity
Definition: Card.cs:315
bool c_isImportant
Definition: Card.cs:1037
ThingContainer things
Definition: Card.cs:39
bool IsContainer
Definition: Card.cs:2127
bool IsFull(int y=0)
virtual bool CanExtendBuild
Definition: Trait.cs:181
virtual bool CanBeDestroyed
Definition: Trait.cs:307
virtual bool CanOnlyCarry
Definition: Trait.cs:305

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

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

◆ CanAcceptItem()

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

Definition at line 8415 of file Chara.cs.

8416 {
8418 {
8419 return true;
8420 }
8421 if (!IsValidGiftWeight(t, num))
8422 {
8423 return false;
8424 }
8425 if (!skipImportantCheck && t.c_isImportant)
8426 {
8427 return false;
8428 }
8429 if ((t.category.IsChildOf("furniture") || t.category.IsChildOf("junk")) && !HasElement(1411))
8430 {
8431 return false;
8432 }
8433 return true;
8434 }
bool IsValidGiftWeight(Card t, int num=-1)
Definition: Chara.cs:8405

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

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

◆ CanAutoPick()

bool Chara.CanAutoPick ( Card  c)
inline

Definition at line 4343 of file Chara.cs.

4344 {
4345 return true;
4346 }

◆ CanBeTempAlly()

bool Chara.CanBeTempAlly ( Chara  c)
inline

Definition at line 2380 of file Chara.cs.

2381 {
2382 if (IsPCFaction || IsGlobal || IsMinion || IsMultisize || EClass._zone.CountMinions(c) > c.MaxSummon || base.rarity >= Rarity.Legendary)
2383 {
2384 return false;
2385 }
2386 if (HasElement(1222))
2387 {
2388 return false;
2389 }
2390 return true;
2391 }
int MaxSummon
Definition: Chara.cs:728
override bool IsMultisize
Definition: Chara.cs:720
int CountMinions(Chara c)
Definition: Zone.cs:3808

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

Referenced by GoalCombat.Run().

◆ CanBloom()

bool Chara.CanBloom ( )
inline

Definition at line 8868 of file Chara.cs.

8869 {
8870 if (IsPC || base.isScaled || HasElement(1273))
8871 {
8872 return false;
8873 }
8874 if (!EClass.debug.godMode)
8875 {
8876 if (base.c_daysWithPC > 360)
8877 {
8878 return affinity.CanSleepBeside();
8879 }
8880 return false;
8881 }
8882 return true;
8883 }
bool CanSleepBeside()
Definition: Affinity.cs:84
Affinity affinity
Definition: Chara.cs:316
bool godMode
Definition: CoreDebug.cs:173

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

Referenced by WindowCharaMini.Refresh().

◆ CanDestroyPath()

bool Chara.CanDestroyPath ( )
inline

Definition at line 2489 of file Chara.cs.

2490 {
2491 if (!IsMultisize)
2492 {
2493 if (base.rarity >= Rarity.Superior && !base.IsPCFactionOrMinion && ai is GoalCombat && !EClass._zone.IsPCFaction)
2494 {
2495 return !(EClass._zone is Zone_Town);
2496 }
2497 return false;
2498 }
2499 return true;
2500 }

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

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

◆ CanDuplicate()

bool Chara.CanDuplicate ( )
inline

Definition at line 1792 of file Chara.cs.

1793 {
1794 if (EClass._zone.IsRegion || HasCondition<ConPoison>() || HasCondition<ConConfuse>() || HasCondition<ConDim>() || HasCondition<ConParalyze>() || HasCondition<ConSleep>() || HasCondition<ConBurning>() || HasCondition<ConFreeze>() || HasCondition<ConMiasma>() || corruption >= 100)
1795 {
1796 return false;
1797 }
1799 {
1800 return false;
1801 }
1802 string text = id;
1803 if (!(text == "mech_scarab"))
1804 {
1805 if (text == "spider_queen" && (pos.cell.light > 0 || pos.IsSunLit))
1806 {
1807 return false;
1808 }
1809 }
1810 else if (isSynced || pos.cell.light > 0 || (!EClass._map.IsIndoor && !pos.cell.HasRoof && !EClass.world.date.IsNight))
1811 {
1812 return false;
1813 }
1814 return true;
1815 }
byte light
Definition: Cell.cs:60
bool HasRoof
Definition: Cell.cs:648
int corruption
Definition: Chara.cs:379
int CurrentGeneSlot
Definition: Chara.cs:1097
bool IsNight
Definition: Date.cs:112
GamePrincipal principal
Definition: Game.cs:225
bool IsIndoor
Definition: Map.cs:131
bool IsSunLit
Definition: Point.cs:182

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

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

◆ CanEat()

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

Definition at line 7794 of file Chara.cs.

7795 {
7796 if (t.IsDecayed && !HasElement(480))
7797 {
7798 return false;
7799 }
7800 if (HasElement(1250) && !t.HasElement(710))
7801 {
7802 return false;
7803 }
7804 if (shouldEat && (!(t.trait is TraitFoodPrepared) || t.c_isImportant))
7805 {
7806 return false;
7807 }
7808 if (!t.IsNegativeGift && !t.HasTag(CTAG.ignoreUse) && !t.isEquipped)
7809 {
7810 return t.trait.CanEat(this);
7811 }
7812 return false;
7813 }
CTAG
Definition: CTAG.cs:2
bool IsNegativeGift
Definition: Card.cs:2436
bool HasTag(CTAG tag)
Definition: Card.cs:2635
bool isEquipped
Definition: Thing.cs:17
virtual bool CanEat(Chara c)
Definition: Trait.cs:1004

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

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

◆ CanEquipRanged()

bool Chara.CanEquipRanged ( Thing  t)
inline

Definition at line 7966 of file Chara.cs.

7967 {
7968 return !body.IsTooHeavyToEquip(t);
7969 }
bool IsTooHeavyToEquip(Thing thing)
Definition: CharaBody.cs:168

References CharaBody.IsTooHeavyToEquip().

Referenced by GoalAutoCombat.TryUseRanged().

◆ CanInsult()

bool Chara.CanInsult ( )
inline

Definition at line 8336 of file Chara.cs.

8337 {
8338 foreach (ActList.Item item in ability.list.items)
8339 {
8340 if (item.act.id == 6630)
8341 {
8342 return true;
8343 }
8344 }
8345 return false;
8346 }
List< Item > items
Definition: ActList.cs:14
ActList list
Definition: CharaAbility.cs:12
CharaAbility ability
Definition: Chara.cs:426

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

◆ CanInteractTo() [1/2]

bool Chara.CanInteractTo ( Card  c)
inline

Definition at line 2596 of file Chara.cs.

2597 {
2598 return CanInteractTo(c.pos);
2599 }
bool CanInteractTo(Card c)
Definition: Chara.cs:2596

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

2602 {
2603 if (!p.IsValid)
2604 {
2605 return false;
2606 }
2607 if (EClass._map.cells[p.x, p.z].blocked)
2608 {
2609 return true;
2610 }
2611 if (!IsMultisize)
2612 {
2613 int num = ((p.z >= pos.z) ? ((p.x > pos.x) ? 1 : ((p.z > pos.z) ? 2 : 3)) : 0);
2614 if (EClass._map.cells[pos.x, pos.z].weights[num] == 0)
2615 {
2616 return false;
2617 }
2618 if (p.x != pos.x && p.z != pos.z)
2619 {
2620 Cell[,] cells = EClass._map.cells;
2621 int x = p.x;
2622 int z = pos.z;
2623 int num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2624 if (cells[pos.x, pos.z].weights[num2] == 0)
2625 {
2626 return false;
2627 }
2628 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2629 if (cells[p.x, p.z].weights[num2] == 0)
2630 {
2631 return false;
2632 }
2633 x = pos.x;
2634 z = p.z;
2635 num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2636 if (cells[pos.x, pos.z].weights[num2] == 0)
2637 {
2638 return false;
2639 }
2640 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2641 if (cells[p.x, p.z].weights[num2] == 0)
2642 {
2643 return false;
2644 }
2645 }
2646 }
2647 return true;
2648 }
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 4338 of file Chara.cs.

4339 {
4340 return true;
4341 }

Referenced by HotItemNoItem._TrySetAct().

◆ CanMoveTo()

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

Definition at line 2502 of file Chara.cs.

2503 {
2504 if (!p.IsValid)
2505 {
2506 return false;
2507 }
2508 int num = ((p.z >= pos.z) ? ((p.x > pos.x) ? 1 : ((p.z > pos.z) ? 2 : 3)) : 0);
2509 if (allowDestroyPath && CanDestroyPath())
2510 {
2511 if (!p.IsInBounds)
2512 {
2513 return false;
2514 }
2515 }
2516 else
2517 {
2518 if (EClass._map.cells[p.x, p.z].blocked || EClass._map.cells[pos.x, pos.z].weights[num] == 0)
2519 {
2520 return false;
2521 }
2522 if (p.x != pos.x && p.z != pos.z)
2523 {
2524 Cell[,] cells = EClass._map.cells;
2525 int x = p.x;
2526 int z = pos.z;
2527 int num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2528 if (cells[pos.x, pos.z].weights[num2] == 0)
2529 {
2530 return false;
2531 }
2532 if (cells[x, z].blocked)
2533 {
2534 return false;
2535 }
2536 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2537 if (cells[p.x, p.z].weights[num2] == 0)
2538 {
2539 return false;
2540 }
2541 x = pos.x;
2542 z = p.z;
2543 num2 = ((z >= pos.z) ? ((x > pos.x) ? 1 : ((z > pos.z) ? 2 : 3)) : 0);
2544 if (cells[pos.x, pos.z].weights[num2] == 0)
2545 {
2546 return false;
2547 }
2548 if (cells[x, z].blocked)
2549 {
2550 return false;
2551 }
2552 num2 = ((z >= p.z) ? ((x > p.x) ? 1 : ((z > p.z) ? 2 : 3)) : 0);
2553 if (cells[p.x, p.z].weights[num2] == 0)
2554 {
2555 return false;
2556 }
2557 }
2558 }
2559 if (IsPC)
2560 {
2561 if (IsEnemyOnPath(p))
2562 {
2563 return false;
2564 }
2565 }
2566 else if (p.HasChara && !IsMultisize && !CanReplace(p.FirstChara))
2567 {
2568 return false;
2569 }
2570 return true;
2571 }
bool IsEnemyOnPath(Point p, bool cancelAI=true)
Definition: Chara.cs:2573
Chara FirstChara
Definition: Point.cs:288
bool IsInBounds
Definition: Point.cs:104

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

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

◆ CanPick()

bool Chara.CanPick ( Card  c)
inline

Definition at line 4348 of file Chara.cs.

4349 {
4350 if (c.isDestroyed)
4351 {
4352 return false;
4353 }
4354 Card rootCard = c.GetRootCard();
4355 if (rootCard.isDestroyed || (rootCard.ExistsOnMap && rootCard.pos.Distance(pos) > 1))
4356 {
4357 return false;
4358 }
4359 if (rootCard != this && things.IsFull(c.Thing))
4360 {
4361 return false;
4362 }
4363 return true;
4364 }
bool isDestroyed
Definition: Card.cs:76
bool ExistsOnMap
Definition: Card.cs:2123
Card GetRootCard()
Definition: Card.cs:3508

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

3348 {
3350 {
3351 return false;
3352 }
3353 if (IsPC)
3354 {
3355 return true;
3356 }
3357 if (c.IsPC || c.pos.Equals(EClass.pc.pos) || c.host != null)
3358 {
3359 return false;
3360 }
3361 if (!IsHostile(c))
3362 {
3363 if (c.c_uidMaster != 0 || c.isSummon || base.IsPowerful || IsEscorted())
3364 {
3365 return true;
3366 }
3367 if (DestDist < c.DestDist)
3368 {
3369 return true;
3370 }
3371 if (IsPCParty && !c.IsPCParty)
3372 {
3373 return true;
3374 }
3375 if (IsPCFaction && !c.IsPCParty)
3376 {
3377 return true;
3378 }
3379 }
3380 return false;
3381 }
bool IsPCFactionOrMinion
Definition: Card.cs:2312
bool isSummon
Definition: Card.cs:711
int c_uidMaster
Definition: Card.cs:1475
bool noMove
Definition: Card.cs:771
new TraitChara trait
Definition: Chara.cs:505
override bool IsPCParty
Definition: Chara.cs:629
int DestDist
Definition: Chara.cs:1012
bool IsHostile()
Definition: Chara.cs:6677
bool IsEscorted()
Definition: Chara.cs:2473
bool Equals(int _x, int _z)
Definition: Point.cs:960
virtual bool CanBePushed
Definition: TraitChara.cs:113

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

Referenced by _Move(), and CanMoveTo().

◆ CanRevive()

bool Chara.CanRevive ( )
inline

Definition at line 5222 of file Chara.cs.

5223 {
5224 return EClass.world.date.IsExpired(base.c_dateDeathLock);
5225 }
bool IsExpired(int time)
Definition: Date.cs:338

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

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

◆ CanSee()

bool Chara.CanSee ( Card  c)
inline

Definition at line 1244 of file Chara.cs.

1245 {
1246 if (c == this)
1247 {
1248 return true;
1249 }
1250 if (!c.pos.IsValid)
1251 {
1252 return false;
1253 }
1254 if (c.isChara)
1255 {
1257 {
1258 return true;
1259 }
1260 if (c.isHidden && c != this && !canSeeInvisible)
1261 {
1262 return false;
1263 }
1264 }
1265 if (IsPC)
1266 {
1267 if (fov != null)
1268 {
1269 return fov.lastPoints.ContainsKey(c.pos.index);
1270 }
1271 return false;
1272 }
1273 return true;
1274 }
virtual Chara Chara
Definition: Card.cs:2108
Fov fov
Definition: Card.cs:58
virtual bool isChara
Definition: Card.cs:2121
bool isHidden
Definition: Card.cs:531
bool canSeeInvisible
Definition: Chara.cs:140
bool visibleWithTelepathy
Definition: Chara.cs:152
bool hasTelepathy
Definition: Chara.cs:142
Dictionary< int, byte > lastPoints
Definition: Fov.cs:36
int index
Definition: Point.cs:49

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

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

◆ CanSeeLos() [1/2]

◆ CanSeeLos() [2/2]

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

Definition at line 1285 of file Chara.cs.

1286 {
1287 if (dist == -1)
1288 {
1289 dist = pos.Distance(p);
1290 }
1291 if (dist > GetSightRadius())
1292 {
1293 return false;
1294 }
1295 if (IsPC)
1296 {
1297 if (fov != null)
1298 {
1299 return fov.lastPoints.ContainsKey(p.index);
1300 }
1301 return false;
1302 }
1303 return Los.IsVisible(pos, p);
1304 }
int GetSightRadius()
Definition: Card.cs:6680
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 1227 of file Chara.cs.

1228 {
1229 if (!p.IsValid || p.IsHidden)
1230 {
1231 return false;
1232 }
1233 if (IsPC)
1234 {
1235 if (fov != null)
1236 {
1237 return fov.lastPoints.ContainsKey(p.index);
1238 }
1239 return false;
1240 }
1241 return true;
1242 }
bool IsHidden
Definition: Point.cs:347

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

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

◆ CanSleep()

bool Chara.CanSleep ( )
inline

Definition at line 1325 of file Chara.cs.

1326 {
1327 if (EClass._zone.events.GetEvent<ZoneEventQuest>() != null)
1328 {
1329 return false;
1330 }
1331 if (!EClass.debug.godMode && sleepiness.GetPhase() == 0)
1332 {
1333 return stamina.GetPhase() <= 1;
1334 }
1335 return true;
1336 }
Stats sleepiness
Definition: Chara.cs:1182
Stats stamina
Definition: Chara.cs:1172
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 2214 of file Chara.cs.

2215 {
2216 ApplyJob(remove: true);
2217 base.c_idJob = idNew;
2218 _job = null;
2219 ApplyJob();
2220 if (IsPCC)
2221 {
2222 PCC.Get(pccData).Build();
2223 }
2224 }
void ApplyJob(bool remove=false)
Definition: Chara.cs:2205
SourceJob.Row _job
Definition: Chara.cs:164

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

7212 {
7213 memberType = type;
7214 }
FactionMemberType memberType
Definition: Chara.cs:46

◆ ChangeRace()

void Chara.ChangeRace ( string  idNew)
inline

Definition at line 2324 of file Chara.cs.

2325 {
2326 ApplyRace(remove: true);
2327 base.c_idRace = idNew;
2328 _race = null;
2329 ApplyRace();
2330 ChangeMaterial(source.defMat.IsEmpty(race.material));
2331 }
@ ChangeMaterial
void ApplyRace(bool remove=false)
Definition: Chara.cs:2291
SourceRace.Row _race
Definition: Chara.cs:162

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

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

◆ ChangeRarity()

override void Chara.ChangeRarity ( Rarity  r)
inlinevirtual

Reimplemented from Card.

Definition at line 1440 of file Chara.cs.

1441 {
1442 if (r != base.rarity)
1443 {
1444 base.rarity = r;
1445 if (renderer != null && renderer.isSynced)
1446 {
1448 }
1449 base.hp = MaxHP;
1450 }
1451 }
void RefreshExtra()

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

Referenced by ZonePreEnterBout.Execute().

◆ ChooseNewGoal()

void Chara.ChooseNewGoal ( )
inline

Definition at line 8975 of file Chara.cs.

8976 {
8977 if (IsPC && EClass.AdvMode)
8978 {
8979 SetNoGoal();
8980 return;
8981 }
8982 if (IsPCParty || base.noMove)
8983 {
8984 SetAI(new GoalIdle());
8985 return;
8986 }
8987 if ((IsHomeMember() && IsInHomeZone()) || IsGuest())
8988 {
8989 Goal goalFromTimeTable = GetGoalFromTimeTable(EClass.world.date.hour);
8990 if (goalFromTimeTable != null)
8991 {
8992 SetAI(goalFromTimeTable);
8993 if (goalFromTimeTable is GoalWork)
8994 {
8995 goalFromTimeTable.Tick();
8996 }
8997 return;
8998 }
8999 }
9000 if (goalList.index == -2)
9001 {
9003 }
9004 SetAI(goalList.Next());
9005 }
Status Tick()
Definition: AIAct.cs:366
Goal GetGoalFromTimeTable(int hour)
Definition: Chara.cs:9007
GoalListType goalListType
Definition: Chara.cs:281
AIAct SetNoGoal()
Definition: Chara.cs:9099
bool IsHomeMember()
Definition: Chara.cs:6743
bool IsGuest()
Definition: Chara.cs:6768
GoalList goalList
Definition: Chara.cs:202
bool IsInHomeZone()
Definition: Chara.cs:6748
int hour
Definition: Date.cs:74
static bool AdvMode
Definition: EClass.cs:11
int index
Definition: GoalList.cs:5
void Refresh(Chara owner, GoalListType type)
Definition: GoalList.cs:9
Goal Next()
Definition: GoalList.cs:39
Definition: Goal.cs:4

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

Referenced by Zone.Simulate().

◆ ClearBed()

void Chara.ClearBed ( Map  map = null)
inline

Definition at line 7501 of file Chara.cs.

7502 {
7503 if (map == null)
7504 {
7505 map = EClass._map;
7506 }
7507 foreach (Card item in map.props.installed.all)
7508 {
7509 if (item.trait is TraitBed traitBed && traitBed.IsHolder(this))
7510 {
7511 traitBed.RemoveHolder(this);
7512 }
7513 }
7514 }
PropsManager props
Definition: Map.cs:91
PropsInstalled installed
Definition: PropsManager.cs:8
PropSet all
Definition: Props.cs:8
bool IsHolder(Chara c)
Definition: TraitBed.cs:135

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

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

◆ ClearInventory()

void Chara.ClearInventory ( ClearInventoryType  type)
inline

Definition at line 8747 of file Chara.cs.

8748 {
8749 int num = 0;
8750 for (int num2 = things.Count - 1; num2 >= 0; num2--)
8751 {
8752 Thing thing = things[num2];
8753 if (ShouldThrowAway(thing, type))
8754 {
8755 num += thing.GetPrice(CurrencyType.Money, sell: true, PriceType.Default, this) * thing.Num;
8756 thing.Destroy();
8757 }
8758 }
8759 if (num > 0)
8760 {
8761 ModCurrency(num);
8762 if (type == ClearInventoryType.SellAtTown)
8763 {
8764 Msg.Say("party_sell", this, num.ToString() ?? "");
8765 PlaySound("pay");
8766 }
8767 }
8768 }
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:7557
int Num
Definition: Card.cs:159
bool ShouldThrowAway(Thing t, ClearInventoryType type)
Definition: Chara.cs:8676

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

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

◆ ClearTempElements()

void Chara.ClearTempElements ( )
inline

Definition at line 10592 of file Chara.cs.

10593 {
10594 if (tempElements != null)
10595 {
10597 tempElements = null;
10598 }
10599 }
ElementContainer tempElements
Definition: Chara.cs:36
void SetParent(Card c)

References ElementContainer.SetParent().

◆ CountDebuff()

int Chara.CountDebuff ( )
inline

Definition at line 9664 of file Chara.cs.

9665 {
9666 int num = 0;
9667 foreach (Condition condition in conditions)
9668 {
9669 if (condition.Type == ConditionType.Debuff)
9670 {
9671 num++;
9672 }
9673 }
9674 return num;
9675 }

References BaseStats.Type.

Referenced by GoalCombat.TryUseAbility().

◆ CountNumEaten()

int Chara.CountNumEaten ( Thing  food)
inline

Definition at line 10398 of file Chara.cs.

10399 {
10400 if (_historyFood == null)
10401 {
10402 return -1;
10403 }
10404 int num = 0;
10405 foreach (List<string> item in _historyFood)
10406 {
10407 foreach (string item2 in item)
10408 {
10409 if (item2 == food.id)
10410 {
10411 num++;
10412 }
10413 }
10414 }
10415 return num;
10416 }

References food, and item.

Referenced by FoodEffect.Proc().

◆ CreateReplacement()

Chara Chara.CreateReplacement ( )
inline

Definition at line 8215 of file Chara.cs.

8216 {
8217 Chara chara = CharaGen.Create(id);
8218 chara.c_originalHostility = base.c_originalHostility;
8219 if (chara.c_originalHostility != 0)
8220 {
8221 chara.hostility = chara.c_originalHostility;
8222 }
8223 if (orgPos != null)
8224 {
8225 chara.orgPos = orgPos.Copy();
8226 }
8227 chara.pos = pos.Copy();
8228 chara.isImported = true;
8229 chara.c_editorTags = base.c_editorTags;
8230 chara.c_editorTraitVal = base.c_editorTraitVal;
8231 chara.c_idTrait = base.c_idTrait;
8232 chara.homeZone = homeZone;
8233 return chara;
8234 }
Hostility c_originalHostility
Definition: Card.cs:989
static Chara Create(string id, int lv=-1)
Definition: CharaGen.cs:17
Zone homeZone
Definition: Chara.cs:269
Point Copy()
Definition: Point.cs:491

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

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

◆ Cuddle()

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

Definition at line 6364 of file Chara.cs.

6365 {
6366 Talk("goodBoy");
6367 Say(headpat ? "headpat" : "cuddle", this, c);
6368 c.ShowEmo(Emo.love);
6369 if (EClass.rnd(IsPC ? 100 : 5000) == 0)
6370 {
6371 c.MakeEgg();
6372 }
6373 if (headpat && this != c)
6374 {
6375 if (c.interest > 0)
6376 {
6377 c.ModAffinity(EClass.pc, 1 + EClass.rnd(3));
6378 c.interest -= 20 + EClass.rnd(10);
6379 }
6381 {
6382 foreach (Chara member in party.members)
6383 {
6384 if (!member.IsPC && CanSeeLos(member))
6385 {
6386 member.AddCondition<ConEuphoric>(100 + Evalue(6904) * 5);
6387 }
6388 }
6389 }
6390 }
6391 if (c.Evalue(1221) > 0)
6392 {
6393 int ele = ((c.MainElement == Element.Void) ? 924 : c.MainElement.id);
6394 if (c.id == "hedgehog_ether")
6395 {
6396 ele = 922;
6397 }
6398 Say("reflect_thorne", this, c);
6399 DamageHP(10L, ele, Power, AttackSource.Condition);
6400 }
6401 }
Emo
Definition: Emo.cs:2
virtual int Power
Definition: Card.cs:2335
void ShowEmo(Emo _emo=Emo.none, float duration=0f, bool skipSame=true)
Definition: Card.cs:6394
Thing MakeEgg(bool effect=true, int num=1, bool addToZone=true, int fertChance=20, BlessedState? state=null)
Definition: Card.cs:5870
Element MainElement
Definition: Chara.cs:731
void ModAffinity(Chara c, int a, bool show=true, bool showOnlyEmo=false)
Definition: Chara.cs:8137
int interest
Definition: Chara.cs:319
Religion faith
Definition: Chara.cs:441
static Element Void
Definition: ELEMENT.cs:243
ReligionManager religions
Definition: Game.cs:159
ReligionMoonShadow MoonShadow

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

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

◆ Cure()

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

Definition at line 9727 of file Chara.cs.

9728 {
9729 bool flag = state == BlessedState.Blessed;
9730 switch (type)
9731 {
9732 case CureType.Heal:
9733 case CureType.Prayer:
9734 CureCondition<ConFear>();
9735 CureCondition<ConBlind>(2 * p / 100 + 5);
9736 CureCondition<ConPoison>(5 * p / 100 + 5);
9737 CureCondition<ConConfuse>(10 * p / 100 + 10);
9738 CureCondition<ConDim>(p / 100 + 5);
9739 CureCondition<ConBleed>(2 * p / 100 + 10);
9740 if (flag)
9741 {
9742 SAN.Mod(-15);
9743 }
9744 break;
9745 case CureType.CureBody:
9746 CureCondition<ConBlind>(5 * p / 100 + 15);
9747 CureCondition<ConPoison>(10 * p / 100 + 15);
9748 CureCondition<ConBleed>(5 * p / 100 + 20);
9749 CureTempElements(p, body: true, mind: false);
9750 break;
9751 case CureType.CureMind:
9752 CureCondition<ConFear>();
9753 CureCondition<ConDim>(3 * p / 100 + 10);
9754 CureTempElements(p, body: false, mind: true);
9755 break;
9756 case CureType.Sleep:
9757 {
9758 for (int num2 = conditions.Count - 1; num2 >= 0; num2--)
9759 {
9760 Condition condition2 = conditions[num2];
9761 if (!(condition2 is ConSleep) && !(condition2 is ConFaint))
9762 {
9763 if (condition2.isPerfume)
9764 {
9765 condition2.Mod(-1, force: true);
9766 }
9767 else if (condition2.Type == ConditionType.Bad || condition2.Type == ConditionType.Debuff)
9768 {
9769 condition2.Kill();
9770 }
9771 }
9772 }
9773 CureCondition<ConWait>();
9774 CureCondition<ConDisease>((EClass.rnd(20) + 10) * p / 100);
9775 bool flag2 = HasCondition<ConAnorexia>();
9776 base.c_vomit -= (flag2 ? 3 : 2) * p / 100;
9777 if (base.c_vomit < 0)
9778 {
9779 base.c_vomit = 0;
9780 if (flag2)
9781 {
9782 RemoveCondition<ConAnorexia>();
9783 }
9784 }
9785 break;
9786 }
9787 case CureType.HealComplete:
9788 case CureType.Death:
9789 case CureType.Jure:
9790 case CureType.Boss:
9791 case CureType.Unicorn:
9792 {
9793 CureTempElements(p * 100, body: true, mind: true);
9794 for (int num = conditions.Count - 1; num >= 0; num--)
9795 {
9796 Condition condition = conditions[num];
9797 if (condition is ConAnorexia && type != CureType.Death && type != CureType.Unicorn && type != CureType.Jure)
9798 {
9799 continue;
9800 }
9801 switch (condition.Type)
9802 {
9803 case ConditionType.Bad:
9804 case ConditionType.Debuff:
9805 case ConditionType.Disease:
9806 condition.Kill();
9807 continue;
9808 case ConditionType.Stance:
9809 if (type == CureType.Death)
9810 {
9811 condition.Kill();
9812 continue;
9813 }
9814 break;
9815 }
9816 if (type == CureType.Death && condition.isPerfume)
9817 {
9818 condition.Kill();
9819 }
9820 }
9821 CureCondition<ConWait>();
9822 CureCondition<ConSleep>();
9823 switch (type)
9824 {
9825 case CureType.Death:
9826 case CureType.Boss:
9827 case CureType.Unicorn:
9828 SAN.Mod(-20);
9829 RemoveCondition<ConBrightnessOfLife>();
9830 RemoveCondition<ConDeathSentense>();
9831 break;
9832 case CureType.Jure:
9833 SAN.Mod(-999);
9834 if (HasElement(1206))
9835 {
9836 SetFeat(1206, 0, msg: true);
9837 }
9838 RemoveCondition<ConBrightnessOfLife>();
9839 RemoveCondition<ConDeathSentense>();
9840 break;
9841 case CureType.CureBody:
9842 case CureType.CureMind:
9843 case CureType.Prayer:
9844 break;
9845 }
9846 break;
9847 }
9848 }
9849 }
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:10562
Stats SAN
Definition: Chara.cs:1184
void Kill(bool silent=false)
Definition: Condition.cs:91
virtual void Mod(int a)
Definition: Stats.cs:135

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

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

◆ CureCondition< T >()

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

Definition at line 9677 of file Chara.cs.

9677 : Condition
9678 {
9679 T condition = GetCondition<T>();
9680 if (condition != null)
9681 {
9682 condition.value -= v;
9683 if (condition.value <= 0)
9684 {
9685 condition.Kill();
9686 }
9687 }
9688 }
override T GetCondition< T >()
Definition: Chara.cs:9690

◆ CureHost()

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

Definition at line 9714 of file Chara.cs.

9715 {
9716 if (parasite != null)
9717 {
9718 parasite.Cure(type, p, state);
9719 }
9720 if (ride != null)
9721 {
9722 ride.Cure(type, p, state);
9723 }
9724 Cure(type, p, state);
9725 }
void Cure(CureType type, int p=100, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:9727

References Cure().

Referenced by FactionBranch.DailyOutcome().

◆ CureTempElements()

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

Definition at line 10562 of file Chara.cs.

10563 {
10564 if (tempElements != null)
10565 {
10566 if (body)
10567 {
10569 }
10570 if (mind)
10571 {
10573 }
10574 }
10575 void Cure(int[] eles)
10576 {
10577 foreach (int ele in eles)
10578 {
10579 if (tempElements == null)
10580 {
10581 break;
10582 }
10583 Element element = tempElements.GetElement(ele);
10584 if (element != null && element.vBase < 0)
10585 {
10586 ModTempElement(ele, Mathf.Clamp(p / 20 + EClass.rnd(p / 20), 1, -element.vBase));
10587 }
10588 }
10589 }
10590 }
void ModTempElement(int ele, int a, bool naturalDecay=false, bool onlyRenew=false)
Definition: Chara.cs:10470
Element GetElement(string alias)
static int[] List_Body
Definition: ELEMENT.cs:249
static int[] List_Mind
Definition: ELEMENT.cs:251

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

◆ DamageTempElement()

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

Definition at line 10528 of file Chara.cs.

10529 {
10530 ModTempElement(ele, onlyRenew ? (-p / 20) : (-(p / 100 + EClass.rnd(p / 100 + 1) + 1)), naturalDecay: false, onlyRenew);
10531 }

References EClass.rnd().

◆ DamageTempElements()

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

Definition at line 10516 of file Chara.cs.

10517 {
10518 if (body)
10519 {
10520 DamageTempElement(Element.List_Body.RandomItem(), p, onlyRenew);
10521 }
10522 if (mind)
10523 {
10524 DamageTempElement(Element.List_Mind.RandomItem(), p, onlyRenew);
10525 }
10526 }
void DamageTempElement(int ele, int p, bool onlyRenew=false)
Definition: Chara.cs:10528

References Element.List_Body, and Element.List_Mind.

◆ DestroyPath()

void Chara.DestroyPath ( Point  pos)
inline

Definition at line 3236 of file Chara.cs.

3237 {
3238 bool broke = false;
3239 pos.ForeachMultiSize(base.W, base.H, delegate(Point _p, bool main)
3240 {
3241 if (_p.IsValid)
3242 {
3243 if (_p.HasBlock)
3244 {
3245 EClass._map.MineBlock(_p, recoverBlock: false, this);
3246 if (_p.HasObj)
3247 {
3248 EClass._map.MineObj(_p, null, this);
3249 }
3250 broke = true;
3251 }
3252 if (_p.HasObj && _p.IsBlocked)
3253 {
3254 EClass._map.MineObj(_p, null, this);
3255 broke = true;
3256 }
3257 _p.Things.ForeachReverse(delegate(Thing t)
3258 {
3259 if (t.IsInstalled && (t.trait.IsBlockPath || t.trait.IsDoor))
3260 {
3261 if (t.isNPCProperty && t.trait.CanBeDestroyed)
3262 {
3263 t.Destroy();
3264 }
3265 else if (!t.IsUnique && !t.trait.CanBeDestroyed)
3266 {
3267 t.SetPlaceState(PlaceState.roaming);
3268 }
3269 }
3270 });
3271 }
3272 });
3273 if (broke)
3274 {
3275 Msg.Say("stomp");
3276 Shaker.ShakeCam("stomp");
3277 }
3278 }
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
bool IsUnique
Definition: Card.cs:2129
void ForeachMultiSize(int w, int h, Action< Point, bool > action)
Definition: Point.cs:1385
bool IsBlocked
Definition: Point.cs:363
Definition: Shaker.cs:5
static void ShakeCam(string id="default", float magnitude=1f)
Definition: Shaker.cs:25
virtual bool IsBlockPath
Definition: Trait.cs:54
virtual bool IsDoor
Definition: Trait.cs:58

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

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

◆ Die()

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

Reimplemented from Card.

Definition at line 5417 of file Chara.cs.

5418 {
5419 combatCount = 0;
5420 if (isDead)
5421 {
5422 return;
5423 }
5424 if (host != null)
5425 {
5426 base.hp = -1;
5427 if ((uint)(attackSource - 17) > 1u)
5428 {
5429 AddCondition<ConFaint>(200, force: true);
5430 return;
5431 }
5432 ActRide.Unride(host, this);
5433 }
5434 bool isInActiveZone = IsInActiveZone;
5435 if (isInActiveZone)
5436 {
5437 if (id == "putty" && origin != null && origin.IsPCParty)
5438 {
5440 }
5441 if (IsPC)
5442 {
5444 }
5445 if (base.isSummon)
5446 {
5447 if (id == "tsunami")
5448 {
5449 pos.PlaySound("water");
5450 }
5451 else
5452 {
5453 Say("summon_vanish", this);
5454 pos.PlayEffect("vanish");
5455 pos.PlaySound("vanish");
5456 }
5457 Destroy();
5458 return;
5459 }
5460 if ((uint)(attackSource - 17) <= 1u)
5461 {
5462 if (attackSource == AttackSource.Euthanasia && trait is TraitLittleOne)
5463 {
5464 MakeEgg();
5465 if (IsPCFaction)
5466 {
5468 }
5469 }
5470 PlayEffect("revive");
5471 PlaySound("chime_angel");
5472 }
5473 else
5474 {
5475 Effect.Get("blood").Play((parent is Chara) ? (parent as Chara).pos : pos).SetParticleColor(EClass.Colors.matColors[base.material.alias].main)
5476 .Emit(50);
5477 AddBlood(AI_Slaughter.slaughtering ? 12 : (2 + EClass.rnd(2)));
5478 PlaySound(base.material.GetSoundDead(source));
5479 }
5482 ClearFOV();
5483 }
5484 if (base.hp >= 0)
5485 {
5486 base.hp = -1;
5487 }
5488 string text = "";
5489 "dead_in".langGame(EClass._zone.Name);
5490 string text2 = ((origin == null) ? "" : origin.GetName(NameStyle.Full));
5491 if (LangGame.Has("dead_" + attackSource))
5492 {
5493 text = "dead_" + attackSource;
5494 }
5495 else
5496 {
5497 if (e != Element.Void && e != null)
5498 {
5499 text = "dead_" + e.source.alias;
5500 }
5501 if (text == "" || !LangGame.Has(text))
5502 {
5503 text = "dead";
5504 }
5505 }
5506 if (IsPC)
5507 {
5508 EClass._zone.isDeathLocation = true;
5509 string s = ((origin == null) ? text : "dead_by");
5511 if (attackSource == AttackSource.Wrath)
5512 {
5514 }
5515 EClass.player.deathMsg = GameLang.Parse(s.langGame(), thirdPerson: true, EClass.pc.NameBraced, "dead_in".langGame(EClass._zone.Name), text2);
5517 if (EClass._zone.instance is ZoneInstanceRandomQuest zoneInstanceRandomQuest)
5518 {
5519 zoneInstanceRandomQuest.status = ZoneInstance.Status.Fail;
5520 }
5521 AI_PlayMusic.keepPlaying = false;
5522 }
5523 if (isInActiveZone)
5524 {
5525 if (attackSource == AttackSource.DeathSentence || attackSource == AttackSource.Euthanasia)
5526 {
5527 Msg.Say("goto_heaven", this);
5528 }
5529 else
5530 {
5531 if (originalTarget != null || origin == null || !origin.isSynced || (attackSource != AttackSource.Melee && attackSource != AttackSource.Range))
5532 {
5533 Msg.Say(text, this, "", text2);
5534 }
5535 string text3 = TalkTopic("dead");
5536 if (!text3.IsEmpty())
5537 {
5538 text3 = text3.StripBrackets();
5539 }
5540 bool flag = base.rarity >= Rarity.Legendary && !IsPCFaction;
5541 if (!IsPC && flag)
5542 {
5543 MakeGrave(text3);
5544 }
5545 Msg.SetColor();
5546 SpawnLoot(origin);
5547 }
5548 if (IsPC)
5549 {
5551 }
5552 }
5553 if (IsPCFaction)
5554 {
5555 if (homeBranch != null)
5556 {
5557 homeBranch.Log(text, this, "");
5558 }
5559 WidgetPopText.Say("popDead".lang(base.Name), FontColor.Bad);
5560 if (!IsPC)
5561 {
5562 if (EClass.player.stats.allyDeath == 0)
5563 {
5564 Tutorial.Reserve("death_pet");
5565 }
5567 }
5568 }
5569 if (id == "mandrake" || HasElement(488))
5570 {
5571 Say("a_scream", this);
5572 ActEffect.ProcAt(EffectId.Scream, base.LV * 3 + 200, BlessedState.Normal, this, this, pos, isNeg: true);
5573 }
5574 daysStarved = 0;
5575 isDead = true;
5577 enemy = null;
5578 _cooldowns = null;
5579 base.isSale = false;
5580 SetInt(70);
5581 EClass._map.props.sales.Remove(this);
5582 Cure(CureType.Death);
5583 SetAI(new NoGoal());
5585 if (isInActiveZone && EClass._zone.HasLaw && IsHuman && OriginalHostility >= Hostility.Neutral)
5586 {
5587 pos.TalkWitnesses(origin?.Chara, "witness", 3, WitnessType.crime, (Chara c) => !c.IsPCParty && !c.IsUnique);
5588 }
5589 if (IsPC)
5590 {
5591 EClass.player.returnInfo = null;
5592 EClass.player.uidLastTravelZone = 0;
5593 foreach (Chara chara3 in EClass._map.charas)
5594 {
5595 if (chara3.IsHostile())
5596 {
5597 chara3.hostility = chara3.OriginalHostility;
5598 }
5599 if (chara3.enemy == EClass.pc)
5600 {
5601 chara3.enemy = null;
5602 }
5603 }
5604 if (EClass.pc.things.Find("letter_will") != null && EClass.rnd(10) == 0)
5605 {
5606 EClass.player.preventDeathPenalty = true;
5607 }
5608 }
5609 else
5610 {
5611 bool flag2 = currentZone.IsActiveZone && IsLocalChara && !currentZone.IsPCFaction;
5612 if (currentZone is Zone_LittleGarden && id == "littleOne")
5613 {
5614 flag2 = false;
5615 }
5616 if (flag2)
5617 {
5618 EClass._map.deadCharas.Add(this);
5619 }
5620 currentZone.RemoveCard(this);
5621 }
5622 if ((origin != null && origin.IsPCParty) || IsPCFaction)
5623 {
5624 int a = -10;
5625 if (IsPCFaction && !IsPCParty && (origin == null || !origin.IsPCParty))
5626 {
5627 a = -5;
5628 }
5629 ModAffinity(EClass.pc, a, show: false);
5630 string text4 = id;
5631 if (!(text4 == "quru"))
5632 {
5633 if (text4 == "corgon")
5634 {
5635 EClass.game.cards.globalCharas.Find("quru")?.ModAffinity(EClass.pc, -20, show: false);
5636 }
5637 }
5638 else
5639 {
5640 EClass.game.cards.globalCharas.Find("corgon")?.ModAffinity(EClass.pc, -20, show: false);
5641 }
5642 }
5643 if (origin != null)
5644 {
5645 if (origin.IsPCParty || origin.IsPCPartyMinion)
5646 {
5647 int num = 0;
5649 {
5650 num = -20;
5651 }
5652 else if (OriginalHostility >= Hostility.Friend && IsHuman && !base.IsPCFactionOrMinion)
5653 {
5654 num = -5;
5655 }
5656 else if (race.id == "cat" && OriginalHostility >= Hostility.Neutral)
5657 {
5658 EClass.pc.Say("killcat");
5659 num = -1;
5660 }
5661 if (EClass.pc.party.HasElement(1563) && num < 0)
5662 {
5663 num = num * 30 / 100;
5664 }
5665 if (num != 0)
5666 {
5667 EClass.player.ModKarma(num);
5668 }
5669 }
5670 if (origin == EClass.pc)
5671 {
5672 EClass.pc.faith.Revelation("kill", 10);
5673 }
5674 else if (origin.IsPCFaction)
5675 {
5676 origin.Chara.ModAffinity(EClass.pc, 1, show: false);
5677 origin.Chara.ShowEmo(Emo.love);
5678 }
5679 }
5680 if (base.sourceBacker != null && origin != null && origin.IsPCParty)
5681 {
5682 EClass.player.doneBackers.Add(base.sourceBacker.id);
5683 }
5684 if (base.IsPCFactionOrMinion)
5685 {
5687 {
5688 Msg.Say("abort_allyDead");
5689 }
5690 }
5692 {
5693 Msg.Say("abort_enemyDead");
5694 }
5695 if (IsPCParty && !IsPC)
5696 {
5698 base.c_wasInPcParty = true;
5699 EClass.pc.Say("allyDead");
5700 }
5701 switch (id)
5702 {
5703 case "littleOne":
5704 if (attackSource != AttackSource.Euthanasia && !IsPCFaction)
5705 {
5706 EClass.player.flags.little_killed = true;
5708 }
5709 break;
5710 case "big_daddy":
5711 if (!IsPCFaction)
5712 {
5713 Chara chara = CharaGen.Create("littleOne");
5714 EClass._zone.AddCard(chara, pos.Copy());
5715 Msg.Say("little_pop");
5717 }
5718 break;
5719 case "shark_sister":
5720 if (!IsPCFaction)
5721 {
5722 Chara t = CharaGen.Create("sister_shark");
5723 EClass._zone.AddCard(t, pos.Copy());
5724 Msg.Say("shark_pop");
5725 }
5726 break;
5727 }
5728 if (attackSource == AttackSource.Finish && origin != null && origin.Evalue(665) > 0)
5729 {
5730 Chara chara2 = CharaGen.CreateFromFilter("c_plant", base.LV);
5731 EClass._zone.AddCard(chara2, pos.Copy());
5732 if (chara2.LV < base.LV)
5733 {
5734 chara2.SetLv(base.LV);
5735 }
5736 chara2.MakeMinion((origin.IsPCParty || origin.IsPCPartyMinion) ? EClass.pc : origin.Chara, MinionType.Friend);
5737 Msg.Say("plant_pop", this, chara2);
5738 }
5741 }
EffectId
Definition: EffectId.cs:2
FontColor
Definition: FontColor.cs:2
MinionType
Definition: MinionType.cs:2
WitnessType
Definition: WitnessType.cs:2
static bool slaughtering
Definition: AI_Slaughter.cs:6
static void ProcAt(EffectId id, int power, BlessedState state, Card cc, Card tc, Point tp, bool isNeg, ActRef actRef=default(ActRef))
Definition: ActEffect.cs:493
static void Unride(Chara host, Chara mount, bool talk=true)
Definition: ActRide.cs:107
Chara Find(string id)
Definition: CardManager.cs:20
GlobalCharaList globalCharas
Definition: CardManager.cs:46
void RefreshSprite()
virtual void RefreshStateIcon()
void AddBlood(int a=1, int id=-1)
Definition: Card.cs:6233
virtual bool IsPCParty
Definition: Card.cs:2189
Card SetLv(int a)
Definition: Card.cs:2977
ICardParent parent
Definition: Card.cs:56
virtual bool IsPCPartyMinion
Definition: Card.cs:2193
void ClearFOV()
Definition: Card.cs:6849
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:6460
virtual bool IsPCFaction
Definition: Card.cs:2309
void SpawnLoot(Card origin)
Definition: Card.cs:5222
int LV
Definition: Card.cs:387
virtual bool isSynced
Definition: Card.cs:2125
static Chara CreateFromFilter(string id, int lv=-1, int levelRange=-1)
Definition: CharaGen.cs:22
int combatCount
Definition: Chara.cs:116
bool IsHuman
Definition: Chara.cs:893
int daysStarved
Definition: Chara.cs:331
void MakeMinion(Chara _master, MinionType type=MinionType.Default)
Definition: Chara.cs:2402
string NameBraced
Definition: Chara.cs:516
void ClearTempElements()
Definition: Chara.cs:10592
string TalkTopic(string topic="calm")
Definition: Chara.cs:7145
void TryDropBossLoot()
Definition: Chara.cs:5743
bool IsLocalChara
Definition: Chara.cs:855
Chara enemy
Definition: Chara.cs:86
bool IsInActiveZone
Definition: Chara.cs:852
void TryDropCarryOnly()
Definition: Chara.cs:4671
void MakeGrave(string lastword)
Definition: Chara.cs:5334
UD_String_MatData matColors
static ColorProfile Colors
Definition: EClass.cs:39
void RemoveMemeber(Chara c)
string Log(string idLang, string ref1=null, string ref2=null, string ref3=null, string ref4=null)
static string Parse(string text, bool thirdPerson, string val1, string val2=null, string val3=null, string val4=null)
Definition: GameLang.cs:178
ConfigAutoCombat autoCombat
Definition: Game.cs:94
CardManager cards
Definition: Game.cs:156
static bool Has(string id)
Definition: LangGame.cs:46
List< Chara > deadCharas
Definition: Map.cs:46
static ThirstPersonInfo thirdPerson1
Definition: Msg.cs:6
bool HasElement(int ele, bool excludePC=false)
Definition: Party.cs:198
void RemoveMember(Chara c)
Definition: Party.cs:102
int allyDeath
Definition: Player.cs:111
void ModKarma(int a)
Definition: Player.cs:2610
Stats stats
Definition: Player.cs:1083
int little_dead
Definition: Player.cs:993
HashSet< int > doneBackers
Definition: Player.cs:1140
bool TryAbortAutoCombat(bool immediate=true)
Definition: Player.cs:2504
string deathMsg
Definition: Player.cs:1255
void TalkWitnesses(Chara criminal, string idTalk, int radius=4, WitnessType type=WitnessType.everyone, Func< Chara, bool > talkIf=null, int chance=3)
Definition: Point.cs:815
List< Card > sales
Definition: PropsManager.cs:14
static Religion recentWrath
Definition: Religion.cs:22
void Revelation(string idTalk, int chance=100)
Definition: Religion.cs:146
string NameShort
Definition: Religion.cs:34
Thing Find(int uid)
void Set(string n)
static void Reserve(string idStep, Action onBeforePlay=null)
Definition: Tutorial.cs:55
static void Say(string text, FontColor fontColor=FontColor.Default, Sprite sprite=null)
void OnCharaDie(Chara c)
void RefreshDeathSentense()
Definition: Zone.cs:1115
virtual bool HasLaw
Definition: Zone.cs:231
void RemoveCard(Card t)
Definition: Zone.cs:2057
void ResetHostility()
Definition: Zone.cs:2752
ZoneInstance instance
Definition: Zone.cs:55

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

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

◆ DiminishTempElements()

void Chara.DiminishTempElements ( int  a = 1)
inline

Definition at line 10547 of file Chara.cs.

10548 {
10549 if (tempElements == null)
10550 {
10551 return;
10552 }
10553 foreach (Element item in tempElements.dict.Values.ToList())
10554 {
10555 if (item.vBase > 0)
10556 {
10557 ModTempElement(item.id, -Mathf.Min(item.vBase * 5 / 100 + 1, item.vBase), naturalDecay: true);
10558 }
10559 }
10560 }

References ElementContainer.dict, and item.

◆ Divorce()

void Chara.Divorce ( Chara  c)
inline

Definition at line 8289 of file Chara.cs.

8290 {
8291 if (base.c_love != null)
8292 {
8293 base.c_love.dateMarriage = 0;
8294 base.c_love.dateWedding = 0;
8295 SetFeat(1275, 0);
8297 }
8298 }
int divorced
Definition: Player.cs:135

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

◆ DoAI()

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

Definition at line 6352 of file Chara.cs.

6353 {
6354 SetAI(new DynamicAIAct("", delegate
6355 {
6356 onPerform();
6357 return true;
6358 })
6359 {
6360 wait = wait
6361 });
6362 }

◆ DoHostileAction()

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

Definition at line 6496 of file Chara.cs.

6497 {
6498 if (_tg == null || !_tg.isChara)
6499 {
6500 return;
6501 }
6502 Chara chara = _tg.Chara;
6503 if (chara.IsPC)
6504 {
6505 EClass.pc.combatCount = 10;
6506 }
6507 if (!chara.IsAliveInCurrentZone || !IsAliveInCurrentZone || chara == this)
6508 {
6509 return;
6510 }
6511 if ((IsPCFaction || IsPCFactionMinion) && (chara.IsPCFaction || chara.IsPCFactionMinion))
6512 {
6513 chara.Say("frown", this, chara);
6514 }
6515 else
6516 {
6517 if (EClass._zone.IsRegion)
6518 {
6519 return;
6520 }
6521 if (IsPC)
6522 {
6523 if (chara.IsFriendOrAbove() && !immediate)
6524 {
6525 chara.Say("frown", this, chara);
6526 chara.ShowEmo(Emo.sad);
6527 chara.hostility = Hostility.Neutral;
6528 return;
6529 }
6530 if (!chara.IsPCFaction && chara.hostility >= Hostility.Neutral && !EClass._zone.IsPCFaction)
6531 {
6532 bool flag = chara.id == "fanatic";
6533 if (EClass.rnd(4) == 0 || flag)
6534 {
6535 chara.Say("callHelp", chara);
6536 chara.CallHelp(this, flag);
6537 }
6538 }
6539 if (chara.hostility <= Hostility.Enemy)
6540 {
6541 foreach (Chara member in EClass.pc.party.members)
6542 {
6543 if (member != EClass.pc && member.enemy == null && member.CanSee(chara))
6544 {
6545 member.SetEnemy(chara);
6546 }
6547 }
6548 }
6549 }
6550 else if (chara.IsPC && hostility <= Hostility.Enemy)
6551 {
6552 foreach (Chara member2 in EClass.pc.party.members)
6553 {
6554 if (member2 != EClass.pc && member2.enemy == null && member2.CanSee(this))
6555 {
6556 member2.SetEnemy(this);
6557 }
6558 }
6559 }
6560 if (chara.calmCheckTurn <= 0 || IsPC)
6561 {
6562 chara.calmCheckTurn = (IsPC ? (20 + EClass.rnd(30)) : (10 + EClass.rnd(10)));
6563 }
6564 if (hostility != Hostility.Enemy || chara.hostility != Hostility.Enemy)
6565 {
6566 GoHostile(chara);
6567 chara.GoHostile(this);
6568 if (base.isHidden && !chara.CanSee(this) && !chara.IsDisabled && !chara.IsPCParty && !chara.IsPCPartyMinion && EClass.rnd(10 + Dist(chara) * 10) == 0)
6569 {
6570 Thing t = ThingGen.Create("49");
6571 ActThrow.Throw(chara, pos, t);
6572 Act.TC = chara;
6573 }
6574 }
6575 }
6576 }
static EffectIRenderer Throw(Card c, Point p, Thing t, ThrowMethod method=ThrowMethod.Default, float failChance=0f)
Definition: ActThrow.cs:97
override bool IsAliveInCurrentZone
Definition: Chara.cs:563
override bool IsPCPartyMinion
Definition: Chara.cs:653
int calmCheckTurn
Definition: Chara.cs:118
bool CanSee(Card c)
Definition: Chara.cs:1244
override bool IsPCFactionMinion
Definition: Chara.cs:669
bool IsFriendOrAbove()
Definition: Chara.cs:6773
Chara SetEnemy(Chara c=null)
Definition: Chara.cs:6447
void CallHelp(Chara tg, bool fanatic=false)
Definition: Chara.cs:6578
Hostility hostility
Definition: Chara.cs:293
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53

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

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

◆ Drink()

void Chara.Drink ( Card  t)
inline

Definition at line 5211 of file Chara.cs.

5212 {
5213 Say("drink", this, t.Duplicate(1));
5214 Say("quaff");
5215 PlaySound("drink");
5216 hunger.Mod(-2);
5217 t.ModNum(-1);
5218 t.trait.OnDrink(this);
5219 _ = IsPC;
5220 }
Thing Duplicate(int num)
Definition: Card.cs:3526
void ModNum(int a, bool notify=true)
Definition: Card.cs:3597
Stats hunger
Definition: Chara.cs:1168
virtual void OnDrink(Chara c)
Definition: Trait.cs:1018

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

4684 {
4685 if (held == null)
4686 {
4687 return null;
4688 }
4689 if (IsPC)
4690 {
4691 WidgetHotbar.dirtyCurrentItem = true;
4693 }
4694 Card card = EClass._zone.AddCard(held, dropPos ?? pos);
4695 card.OnLand();
4696 if (card.trait.CanOnlyCarry)
4697 {
4698 card.SetPlaceState(PlaceState.installed);
4699 }
4700 return card;
4701 }
PlaceState
Definition: PlaceState.cs:2
Card held
Definition: Chara.cs:70
static void SetDirty(Thing t)

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

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

◆ DropThing()

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

Definition at line 4703 of file Chara.cs.

4704 {
4705 if (t.c_isImportant)
4706 {
4707 Msg.Say("markedImportant");
4708 return;
4709 }
4710 if (!t.trait.CanBeDropped)
4711 {
4712 Msg.Say("cantDrop", t);
4713 return;
4714 }
4715 if (t.trait is TraitAbility)
4716 {
4717 SE.Trash();
4718 t.Destroy();
4719 return;
4720 }
4721 Msg.Say("dropItem", t.Name);
4722 t.ignoreAutoPick = true;
4723 PlaySound("drop");
4724 EClass._zone.AddCard(t, pos);
4725 if (t.trait.CanOnlyCarry)
4726 {
4727 t.Install();
4728 }
4729 }
Card Install()
Definition: Card.cs:3823
virtual bool CanBeDropped
Definition: Trait.cs:313

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

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

◆ Duplicate()

Chara Chara.Duplicate ( )
inline

Definition at line 1817 of file Chara.cs.

1818 {
1819 Chara chara = CharaGen.Create(id);
1820 chara.mana.value = mana.value;
1821 chara.stamina.value = stamina.value;
1822 foreach (KeyValuePair<int, Element> item in elements.dict)
1823 {
1824 if (item.Key != 1275)
1825 {
1826 Element orCreateElement = chara.elements.GetOrCreateElement(item.Key);
1827 orCreateElement.vBase = item.Value.ValueWithoutLink - orCreateElement.vSource;
1828 }
1829 }
1830 chara.SetFaith(faith);
1831 chara.bio = IO.DeepCopy(bio);
1832 chara.LV = base.LV;
1833 chara.c_daysWithGod = base.c_daysWithGod;
1834 chara.RefreshFaithElement();
1835 chara.hp = (int)Mathf.Clamp((float)chara.MaxHP * ((float)base.hp / (float)MaxHP) * 0.99f, 0f, chara.MaxHP);
1836 chara.isCopy = true;
1837 chara.isScaled = base.isScaled;
1838 chara.c_altName = base.c_altName;
1839 chara._alias = _alias;
1840 if (HaveFur())
1841 {
1842 chara.c_fur = -1;
1843 }
1844 return chara;
1845 }
bool HaveFur()
Definition: Card.cs:8189
Stats mana
Definition: Chara.cs:1180
void RefreshFaithElement()
Definition: Chara.cs:10427
string _alias
Definition: Chara.cs:221
void SetFaith(string id)
Definition: Chara.cs:1739
Element GetOrCreateElement(Element ele)
int vSource
Definition: ELEMENT.cs:267
Definition: IO.cs:11
virtual int value
Definition: Stats.cs:56

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

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

◆ EnhanceTempElement()

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

Definition at line 10542 of file Chara.cs.

10543 {
10544 ModTempElement(ele, onlyRenew ? (p / 20) : (p / 100 + EClass.rnd(p / 100 + 1)), naturalDecay: false, onlyRenew);
10545 }

References EClass.rnd().

◆ EnhanceTempElements()

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

Definition at line 10533 of file Chara.cs.

10534 {
10535 int[] array = (body ? Element.List_Body : Element.List_Mind);
10536 foreach (int ele in array)
10537 {
10538 EnhanceTempElement(ele, p, onlyRenew);
10539 }
10540 }
void EnhanceTempElement(int ele, int p, bool onlyRenew=false)
Definition: Chara.cs:10542

References Element.List_Mind.

◆ EQ_CAT()

void Chara.EQ_CAT ( string  s)
inline

Definition at line 5188 of file Chara.cs.

5189 {
5190 int slot = EClass.sources.categories.map[s].slot;
5191 BodySlot bodySlot = ((slot == 0) ? null : body.GetSlot(slot));
5192 if ((slot == 0 || bodySlot != null) && (slot != 37 || !HasElement(1209)))
5193 {
5194 SetEQQuality();
5195 Thing thing = ThingGen.CreateFromCategory(s, base.LV);
5196 AddThing(thing);
5197 if (bodySlot != null && !body.Equip(thing, bodySlot))
5198 {
5199 thing.Destroy();
5200 }
5201 }
5202 }
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:3180
bool Equip(Thing thing, BodySlot slot=null, bool msg=true)
Definition: CharaBody.cs:194
BodySlot GetSlot(Thing t, bool onlyEmpty=false, bool secondSlot=false)
Definition: CharaBody.cs:369
void SetEQQuality()
Definition: Chara.cs:5135
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 5168 of file Chara.cs.

5169 {
5170 SetEQQuality();
5171 if (r != Rarity.Random)
5172 {
5173 CardBlueprint.current.rarity = r;
5174 }
5175 Thing thing = ThingGen.Create(s, mat, base.LV);
5176 if (body.GetSlot(thing, onlyEmpty: true) == null)
5177 {
5178 return thing;
5179 }
5180 AddThing(thing);
5181 if (!body.Equip(thing))
5182 {
5183 thing.Destroy();
5184 }
5185 return thing;
5186 }

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

5205 {
5206 SetEQQuality();
5207 Thing t = ThingGen.Create(s, -1, base.LV).SetNum(num);
5208 AddThing(t);
5209 }
Thing SetNum(int a)
Definition: Card.cs:3577

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

◆ EvalueRiding()

int Chara.EvalueRiding ( )
inline

Definition at line 6263 of file Chara.cs.

6264 {
6265 if (ride != null && ride.HasCondition<ConTransmuteBroom>() && HasElement(1417))
6266 {
6267 return 25 + Evalue(226) * 125 / 100;
6268 }
6269 return Evalue(226);
6270 }

References HasCondition().

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

◆ FallFromZone()

void Chara.FallFromZone ( )
inline

Definition at line 3568 of file Chara.cs.

3569 {
3570 Msg.Say("skyFall", EClass.pc, EClass._zone.Name);
3571 Zone zone = (EClass._zone.isExternalZone ? null : EClass._zone.GetTopZone().FindZone(EClass._zone.lv - 1));
3572 zone = zone ?? EClass.world.region;
3574 {
3575 state = ZoneTransition.EnterState.Fall,
3576 x = pos.x,
3577 z = pos.z
3578 });
3579 }
void MoveZone(string alias)
Definition: Chara.cs:3383
int lv
Definition: Spatial.cs:142
Zone FindZone(int lv)
Definition: Spatial.cs:728
Region region
Definition: World.cs:23
Definition: Zone.cs:12
Zone GetTopZone()
Definition: Zone.cs:1973

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

8018 {
8019 TraitToolRange ranged = weapon.trait as TraitToolRange;
8020 Thing thing = (IsPC ? EClass.pc.things.Find<TraitQuiver>() : null);
8021 if (thing != null)
8022 {
8023 Thing thing2 = thing.things.Find((Thing t) => ranged.IsAmmo(t));
8024 if (thing2 != null)
8025 {
8026 return thing2;
8027 }
8028 }
8029 return things.Find((Thing t) => ranged.IsAmmo(t));
8030 }
bool IsAmmo
Definition: Card.cs:2287
Thing ranged
Definition: Chara.cs:98

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

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

◆ FindBed()

TraitBed Chara.FindBed ( )
inline

Definition at line 7516 of file Chara.cs.

7517 {
7518 foreach (Card item in EClass._map.props.installed.all)
7519 {
7520 if (item.trait is TraitBed traitBed && traitBed.IsHolder(this))
7521 {
7522 return traitBed;
7523 }
7524 }
7525 return null;
7526 }

References EClass._map, Props.all, PropsManager.installed, TraitBed.IsHolder(), item, and Map.props.

Referenced by Hobby.GetEfficiency(), ListPeopleBed.OnClick(), BaseListPeople.OnInstantiate(), ListPeopleBed.OnInstantiate(), GoalSleep.OnSimulatePosition(), AI_Idle.Run(), GoalSleep.Run(), and GoalVisitorGuest.Run().

◆ FindBestFoodToEat()

Thing Chara.FindBestFoodToEat ( )
inline

Definition at line 7748 of file Chara.cs.

7749 {
7750 Thing result = null;
7751 int num = -1;
7752 if (IsPC)
7753 {
7754 return null;
7755 }
7756 foreach (Thing item in things.List((Thing t) => CanEat(t, shouldEat: true) && !t.c_isImportant, onlyAccessible: true))
7757 {
7758 int num2 = CountNumEaten(item);
7759 int num3 = 100 - num2 + (item.HasElement(757) ? 10 : 0);
7760 if (num3 > num)
7761 {
7762 result = item;
7763 num = num3;
7764 }
7765 }
7766 return result;
7767 }
bool CanEat(Thing t, bool shouldEat=false)
Definition: Chara.cs:7794
int CountNumEaten(Thing food)
Definition: Chara.cs:10398
List< Thing > List(Func< Thing, bool > func, bool onlyAccessible=false)

References Card.c_isImportant, and item.

Referenced by AI_Idle.Run().

◆ FindMaster()

Chara Chara.FindMaster ( )
inline

Definition at line 2464 of file Chara.cs.

2465 {
2466 if (IsMinion)
2467 {
2468 master = EClass._map.FindChara(base.c_uidMaster);
2469 }
2470 return master;
2471 }
Chara FindChara(string id)
Definition: Map.cs:2568

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

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

◆ FindNearestNewEnemy()

bool Chara.FindNearestNewEnemy ( )
inline

Definition at line 6662 of file Chara.cs.

6663 {
6664 for (int i = 0; i < EClass._map.charas.Count; i++)
6665 {
6666 Chara chara = EClass._map.charas[i];
6667 if (chara != this && chara != enemy && (chara.mimicry == null || !chara.mimicry.IsThing) && IsHostile(chara) && Dist(chara) <= 1 && CanInteractTo(chara.pos))
6668 {
6669 DoHostileAction(chara);
6670 enemy = chara;
6671 return true;
6672 }
6673 }
6674 return false;
6675 }
void DoHostileAction(Card _tg, bool immediate=false)
Definition: Chara.cs:6496
ConBaseTransmuteMimic mimicry
Definition: Chara.cs:106

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

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

◆ FindNewEnemy()

bool Chara.FindNewEnemy ( )
inline

Definition at line 6589 of file Chara.cs.

6590 {
6591 if (EClass._zone.isPeace && base.IsPCFactionOrMinion && !IsPC)
6592 {
6593 return false;
6594 }
6595 if (enemy != null && !enemy.IsAliveInCurrentZone)
6596 {
6597 enemy = null;
6598 }
6599 if (enemy != null)
6600 {
6601 return false;
6602 }
6603 if (IsPCParty && EClass.pc.isHidden && base.isHidden)
6604 {
6605 return false;
6606 }
6607 if (mimicry != null && mimicry.IsThing)
6608 {
6609 return false;
6610 }
6611 bool flag = enemy != null || ai is GoalCombat;
6612 int num = (base.PER + Evalue(210) * 2) * ((!flag) ? 1 : 2);
6613 bool flag2 = IsPCParty && !IsPC && EClass.game.config.tactics.dontWander;
6614 bool flag3 = !IsPCParty;
6615 Chara chara = null;
6616 int num2 = 9999;
6617 for (int i = 0; i < EClass._map.charas.Count; i++)
6618 {
6619 Chara chara2 = EClass._map.charas[i];
6620 if (chara2 == this || !IsHostile(chara2) || !CanSee(chara2) || (chara2.mimicry != null && chara2.mimicry.IsThing))
6621 {
6622 continue;
6623 }
6624 int num3 = Dist(chara2);
6625 int num4 = GetSightRadius() + (flag ? 1 : 0);
6626 if (num3 > num4)
6627 {
6628 continue;
6629 }
6630 if (flag3 && EClass.rnd(chara2.Evalue(152) + 5) * (100 + num3 * num3 * 10) / 100 > EClass.rnd(num))
6631 {
6632 if (this == pos.FirstChara)
6633 {
6634 chara2.ModExp(152, Mathf.Clamp((num - chara2.Evalue(152)) / 2, 1, Mathf.Max(30 - stealthSeen * 2, 1)));
6635 }
6636 stealthSeen++;
6637 }
6638 else if (CanSeeLos(chara2) && (!flag2 || EClass.pc.isBlind || EClass.pc.CanSeeLos(chara2)) && (!base.IsPCFactionOrMinion || EClass.pc.ai.ShouldAllyAttack(chara2)))
6639 {
6640 if (!IsPCParty)
6641 {
6642 DoHostileAction(chara2);
6643 enemy = chara2;
6644 return true;
6645 }
6646 if (num3 < num2)
6647 {
6648 num2 = num3;
6649 chara = chara2;
6650 }
6651 }
6652 }
6653 if (chara != null)
6654 {
6655 DoHostileAction(chara);
6656 enemy = chara;
6657 return true;
6658 }
6659 return false;
6660 }
virtual bool ShouldAllyAttack(Chara tg)
Definition: AIAct.cs:134
int stealthSeen
Definition: Chara.cs:190
bool isPeace
Definition: Spatial.cs:406

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

Referenced by GoalCombat.Run().

◆ FindRoom()

Room Chara.FindRoom ( )
inline

Definition at line 8132 of file Chara.cs.

8133 {
8134 return FindBed()?.owner.pos.cell.room;
8135 }
TraitBed FindBed()
Definition: Chara.cs:7516

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

◆ GainAbility()

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

Definition at line 10313 of file Chara.cs.

10314 {
10315 Element orCreateElement = elements.GetOrCreateElement(ele);
10316 if (orCreateElement.ValueWithoutLink == 0)
10317 {
10318 elements.ModBase(orCreateElement.id, 1);
10319 }
10320 if (orCreateElement is Spell)
10321 {
10322 int num = EClass.curve(Evalue(307), 50, 20) + (HasElement(307) ? 20 : 0);
10323 int num2 = origin?.Evalue(765) ?? 0;
10324 num = num * (100 - num2) / 100;
10325 int a = mtp * orCreateElement.source.charge * (100 + num) / 100 / 100;
10326 a = Mathf.Max(1, EClass.rndHalf(a));
10327 if (orCreateElement.source.charge == 1)
10328 {
10329 a = 1;
10330 }
10331 orCreateElement.vPotential += a;
10332 }
10333 Say("spell_gain", this, orCreateElement.Name);
10334 LayerAbility.SetDirty(orCreateElement);
10335 }
Element ModBase(int ele, int v)
virtual string Name
Definition: ELEMENT.cs:309
static void SetDirty(Element a)

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

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

◆ GetActionText()

string Chara.GetActionText ( )
inline

Definition at line 7453 of file Chara.cs.

7454 {
7455 string result = "?????";
7456 if (ai != null)
7457 {
7458 result = ai.GetCurrentActionText();
7459 }
7460 return result;
7461 }
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 8067 of file Chara.cs.

8068 {
8069 if (body.GetWeight(armorOnly: true) <= (HasElement(1204) ? 6000 : 30000))
8070 {
8071 return 120;
8072 }
8073 return 122;
8074 }
int GetWeight(bool armorOnly=false)
Definition: CharaBody.cs:436

References CharaBody.GetWeight().

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

◆ GetBestRangedWeapon()

Thing Chara.GetBestRangedWeapon ( )
inline

Definition at line 8032 of file Chara.cs.

8033 {
8034 Thing result = null;
8035 int num = 0;
8036 foreach (Thing thing in things)
8037 {
8038 if (thing.IsRangedWeapon && CanEquipRanged(thing) && thing.GetEquipValue() > num)
8039 {
8040 num = thing.GetEquipValue();
8041 result = thing;
8042 }
8043 }
8044 return result;
8045 }
int GetEquipValue()
Definition: Card.cs:7458
bool IsRangedWeapon
Definition: Card.cs:2283
bool CanEquipRanged(Thing t)
Definition: Chara.cs:7966

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

◆ GetBuffStats() [1/2]

Element Chara.GetBuffStats ( int  ele)
inline

Definition at line 9652 of file Chara.cs.

9653 {
9654 for (int i = 0; i < conditions.Count; i++)
9655 {
9656 if (conditions[i] is ConBuffStats conBuffStats && conBuffStats.refVal == ele)
9657 {
9658 return conBuffStats.elements.GetElement(ele);
9659 }
9660 }
9661 return null;
9662 }

References BaseCondition.refVal.

◆ GetBuffStats() [2/2]

Element Chara.GetBuffStats ( string  alias)
inline

Definition at line 9647 of file Chara.cs.

9648 {
9649 return GetBuffStats(EClass.sources.elements.alias[alias].id);
9650 }
Element GetBuffStats(string alias)
Definition: Chara.cs:9647

References SourceManager.elements, and EClass.sources.

Referenced by GoalCombat.TryUseAbility().

◆ GetBurden()

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

Definition at line 1847 of file Chara.cs.

1848 {
1849 int num2 = (base.ChildrenWeight + ((t != null) ? ((num == -1) ? t.ChildrenAndSelfWeight : (t.SelfWeight * num)) : 0)) * 100 / WeightLimit;
1850 if (num2 < 0)
1851 {
1852 num2 = 1000;
1853 }
1855 {
1856 num2 = 0;
1857 }
1858 int num3 = ((num2 >= 100) ? ((num2 - 100) / 10 + 1) : 0);
1859 if (num3 > 9)
1860 {
1861 num3 = 9;
1862 }
1863 return num3;
1864 }

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

◆ GetCondition< T >()

override T Chara.GetCondition< T > ( )
inlinevirtual

Reimplemented from Card.

Definition at line 9690 of file Chara.cs.

9691 {
9692 for (int i = 0; i < conditions.Count; i++)
9693 {
9694 if (conditions[i] is T)
9695 {
9696 return conditions[i] as T;
9697 }
9698 }
9699 return null;
9700 }

◆ GetCooldown()

int Chara.GetCooldown ( int  idEle)
inline

Definition at line 8941 of file Chara.cs.

8942 {
8943 if (_cooldowns != null)
8944 {
8945 for (int i = 0; i < _cooldowns.Count; i++)
8946 {
8947 if (_cooldowns[i] / 1000 == idEle)
8948 {
8949 return _cooldowns[i] % 1000;
8950 }
8951 }
8952 }
8953 return 0;
8954 }

Referenced by NotificationCooldown.OnRefresh().

◆ GetCurrentDir()

int Chara.GetCurrentDir ( )
inline

Definition at line 3688 of file Chara.cs.

3689 {
3690 Debug.Log(angle);
3691 if (!renderer.hasActor)
3692 {
3693 if (angle == 0f || angle == 45f || angle == 90f)
3694 {
3695 return 2;
3696 }
3697 if (angle == -135f || angle == 180f || angle == -90f)
3698 {
3699 return 1;
3700 }
3701 if (angle == 135f)
3702 {
3703 return 0;
3704 }
3705 return 3;
3706 }
3707 return renderer.actor.currentDir;
3708 }
virtual int currentDir
Definition: CardActor.cs:41
float angle
Definition: Card.cs:72

References Debug.

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

◆ GetDestination()

Point Chara.GetDestination ( )
inline

Definition at line 7428 of file Chara.cs.

7429 {
7430 return (ai.IsRunning ? ai.GetDestination() : pos).Copy();
7431 }
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 4756 of file Chara.cs.

4757 {
4758 if (elements.Value(122) > elements.Value(120))
4759 {
4760 return elements.GetElement(122);
4761 }
4762 return elements.GetElement(120);
4763 }
int Value(int ele)

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

◆ GetFavAttackStyle()

AttackStyle Chara.GetFavAttackStyle ( )
inline

Definition at line 4731 of file Chara.cs.

4732 {
4733 int num = Evalue(131);
4734 int num2 = Evalue(130);
4735 int num3 = Evalue(123);
4736 if (num > num2 && num > num3)
4737 {
4738 return AttackStyle.TwoWield;
4739 }
4740 if (num2 > num && num2 > num3)
4741 {
4742 return AttackStyle.TwoHand;
4743 }
4744 if (num3 > num && num3 > num2)
4745 {
4746 return AttackStyle.Shield;
4747 }
4748 return AttackStyle.Default;
4749 }

Referenced by WindowChara.RefreshNote().

◆ GetFavCat()

SourceCategory.Row Chara.GetFavCat ( )
inline

Definition at line 8256 of file Chara.cs.

8257 {
8258 SourceCategory.Row r = null;
8259 if (_listFavCat.Count == 0)
8260 {
8261 foreach (SourceCategory.Row row in EClass.sources.categories.rows)
8262 {
8263 if (row.gift > 0)
8264 {
8265 _listFavCat.Add(row);
8266 }
8267 }
8268 }
8269 Rand.UseSeed(base.uid + EClass.game.seed, delegate
8270 {
8271 r = _listFavCat.RandomItem();
8272 });
8273 return r;
8274 }
static List< SourceCategory.Row > _listFavCat
Definition: Chara.cs:196
int seed
Definition: Game.cs:201
Definition: Rand.cs:4
static void UseSeed(int seed, Action action)
Definition: Rand.cs:24

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

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

◆ GetFavFood()

SourceThing.Row Chara.GetFavFood ( )
inline

Definition at line 8236 of file Chara.cs.

8237 {
8238 if (_listFavFood.Count == 0)
8239 {
8240 foreach (SourceThing.Row row in EClass.sources.things.rows)
8241 {
8242 if (row._origin == "dish" && row.value != 0 && row.chance != 0)
8243 {
8244 _listFavFood.Add(row);
8245 }
8246 }
8247 }
8248 SourceThing.Row r = null;
8249 Rand.UseSeed(base.uid + EClass.game.seed, delegate
8250 {
8251 r = _listFavFood.RandomItem();
8252 });
8253 return r;
8254 }
static List< SourceThing.Row > _listFavFood
Definition: Chara.cs:194
SourceThing things

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

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

◆ GetFavWeaponSkill()

Element Chara.GetFavWeaponSkill ( )
inline

Definition at line 4751 of file Chara.cs.

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

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

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

◆ GetFirstStep()

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

Definition at line 2650 of file Chara.cs.

2651 {
2652 return PathManager.Instance.GetFirstStep(pos, newPoint, this, IsPC ? 40 : 10, (!IsMultisize) ? moveType : PathManager.MoveType.Default);
2653 }
Point GetFirstStep(Point origin, Point _dest, IPathfindWalker walker, int maxDist=20, MoveType moveType=MoveType.Default)
Definition: PathManager.cs:67
static PathManager Instance
Definition: PathManager.cs:16

References PathManager.GetFirstStep(), PathManager.Instance, IsMultisize, IsPC, and Card.pos.

Referenced by GoalManualMove.CanMove(), ActEffect.Proc(), GoalCombat.Run(), GoalManualMove.Run(), and GoalManualMove.TryMove().

◆ GetGoalFromTimeTable()

Goal Chara.GetGoalFromTimeTable ( int  hour)
inline

Definition at line 9007 of file Chara.cs.

9008 {
9009 if (IsPC)
9010 {
9011 return null;
9012 }
9013 switch (TimeTable.GetSpan(idTimeTable, hour))
9014 {
9015 case TimeTable.Span.Sleep:
9017 {
9018 return new GoalSleep();
9019 }
9020 break;
9021 case TimeTable.Span.Eat:
9022 return new GoalIdle();
9023 case TimeTable.Span.Work:
9024 if (IsGuest())
9025 {
9026 return new GoalIdle();
9027 }
9028 return GetGoalWork();
9029 case TimeTable.Span.Free:
9030 if (IsGuest())
9031 {
9032 return new GoalIdle();
9033 }
9034 return GetGoalHobby();
9035 }
9036 return null;
9037 }
Goal GetGoalWork()
Definition: Chara.cs:9039
Goal GetGoalHobby()
Definition: Chara.cs:9052
string idTimeTable
Definition: Chara.cs:470
static Span GetSpan(string id, int hour)
Definition: TimeTable.cs:45
bool isSimulating
Definition: Zone.cs:75

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

◆ GetGoalHobby()

Goal Chara.GetGoalHobby ( )
inline

Definition at line 9052 of file Chara.cs.

9053 {
9054 if (IsPrisoner)
9055 {
9056 return new GoalIdle();
9057 }
9058 if (memberType == FactionMemberType.Livestock)
9059 {
9060 return new GoalGraze();
9061 }
9062 return new GoalHobby();
9063 }
FactionMemberType
bool IsPrisoner
Definition: Chara.cs:1052

Referenced by Zone.Simulate().

◆ GetGoalWork()

Goal Chara.GetGoalWork ( )
inline

Definition at line 9039 of file Chara.cs.

9040 {
9041 if (IsPrisoner)
9042 {
9043 return new GoalIdle();
9044 }
9045 if (memberType == FactionMemberType.Livestock)
9046 {
9047 return new GoalGraze();
9048 }
9049 return new GoalWork();
9050 }

Referenced by Zone.Simulate().

◆ GetHappiness()

int Chara.GetHappiness ( )
inline

Definition at line 7438 of file Chara.cs.

7439 {
7440 int num = 50;
7441 if (FindBed() != null)
7442 {
7443 num += 50;
7444 }
7445 return num;
7446 }

◆ GetHireCost()

int Chara.GetHireCost ( )
inline

Definition at line 7433 of file Chara.cs.

7434 {
7435 return base.LV / 2 + 4;
7436 }

Referenced by CalcGold.Hire().

◆ GetHoverText()

override string Chara.GetHoverText ( )
inlinevirtual

Reimplemented from Card.

Definition at line 6935 of file Chara.cs.

6936 {
6937 if (mimicry != null && mimicry.IsThing)
6938 {
6939 return mimicry.GetHoverText();
6940 }
6941 string text = ((mimicry != null) ? mimicry.GetName(NameStyle.Full) : base.Name);
6942 if (IsFriendOrAbove())
6943 {
6944 text = text.TagColor(EClass.Colors.colorFriend);
6945 }
6946 else if (IsHostile())
6947 {
6948 text = text.TagColor(EClass.Colors.colorHostile);
6949 }
6950 int num = 2;
6951 int lV = EClass.pc.LV;
6952 if (base.LV >= lV * 5)
6953 {
6954 num = 0;
6955 }
6956 else if (base.LV >= lV * 2)
6957 {
6958 num = 1;
6959 }
6960 else if (base.LV <= lV / 4)
6961 {
6962 num = 4;
6963 }
6964 else if (base.LV <= lV / 2)
6965 {
6966 num = 3;
6967 }
6968 string text2 = Lang.GetList("lvComparison")[num];
6969 text2 = (" (" + text2 + ") ").TagSize(14).TagColor(EClass.Colors.gradientLVComparison.Evaluate(0.25f * (float)num));
6970 string s = (IsFriendOrAbove() ? "HostilityAlly" : (IsNeutral() ? "HostilityNeutral" : "HostilityEnemy"));
6971 s = (" (" + s.lang() + ") ").TagSize(14);
6972 s = "";
6973 if (memberType == FactionMemberType.Guest)
6974 {
6975 s += (" (" + "guest".lang() + ") ").TagSize(14);
6976 }
6977 else if (memberType == FactionMemberType.Livestock)
6978 {
6979 s += (" (" + "livestock".lang() + ") ").TagSize(14);
6980 }
6981 if (!EClass.pc.IsMoving)
6982 {
6983 if (EClass.pc.HasHigherGround(this))
6984 {
6985 text2 += "lowerGround".lang();
6986 }
6987 else if (HasHigherGround(EClass.pc))
6988 {
6989 text2 += "higherGround".lang();
6990 }
6991 }
6992 if (Evalue(1232) > 0)
6993 {
6994 text2 = "milkBaby".lang().TagSize(14) + text2;
6995 }
6996 if (Guild.Fighter.ShowBounty(this) && Guild.Fighter.HasBounty(this))
6997 {
6998 text2 = "hasBounty".lang().TagSize(14) + text2;
6999 }
7000 if (EClass.pc.HasElement(481))
7001 {
7002 text2 += ("(" + faith.Name + ")").TagSize(14);
7003 }
7004 if (EClass.pc.HasElement(6607))
7005 {
7006 s += CraftUtil.GetBloodText(this).TagSize(14).TagColor(EClass.Colors.colorBlood);
7007 }
7008 return text + text2 + s;
7009 }
bool HasHigherGround(Card c)
Definition: Chara.cs:1216
override bool IsMoving
Definition: Chara.cs:622
bool IsNeutral()
Definition: Chara.cs:6724
Color colorHostile
Color colorBlood
Color colorFriend
Gradient gradientLVComparison
virtual string GetName(NameStyle style, int num=-1)
virtual string GetHoverText()
static string GetBloodText(Chara c)
Definition: CraftUtil.cs:117
bool ShowBounty(Chara c)
Definition: GuildFighter.cs:39
bool HasBounty(Chara c)
Definition: GuildFighter.cs:44
Definition: Guild.cs:2
static GuildFighter Fighter
Definition: Guild.cs:56

References ColorProfile.colorBlood, ColorProfile.colorFriend, ColorProfile.colorHostile, EClass.Colors, Guild.Fighter, CraftUtil.GetBloodText(), ConBaseTransmuteMimic.GetHoverText(), Lang.GetList(), ConBaseTransmuteMimic.GetName(), ColorProfile.gradientLVComparison, GuildFighter.HasBounty(), Card.HasElement(), HasHigherGround(), IsMoving, ConBaseTransmuteMimic.IsThing, Card.LV, EClass.pc, and GuildFighter.ShowBounty().

Referenced by WidgetMouseover.Refresh().

◆ GetHoverText2()

override string Chara.GetHoverText2 ( )
inlinevirtual

Reimplemented from Card.

Definition at line 7011 of file Chara.cs.

7012 {
7013 if (mimicry != null && mimicry.IsThing)
7014 {
7015 return mimicry.GetHoverText2();
7016 }
7017 string text = "";
7018 if (knowFav)
7019 {
7020 text += Environment.NewLine;
7021 text = text + "<size=14>" + "favgift".lang(GetFavCat().GetName().ToLower(), GetFavFood().GetName()) + "</size>";
7022 }
7023 string text2 = "";
7025 {
7026 text2 += Environment.NewLine;
7027 text2 = text2 + "Lv:" + base.LV + " HP:" + base.hp + "/" + MaxHP + " MP:" + mana.value + "/" + mana.max + " DV:" + DV + " PV:" + PV + " Hunger:" + hunger.value;
7028 text2 += Environment.NewLine;
7029 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");
7030 text2 += Environment.NewLine;
7031 text2 = text2 + base.uid + IsMinion + "/" + base.c_uidMaster + "/" + master;
7032 text2 = text2 + " dir:" + base.dir + " skin:" + base.idSkin + " scaled:" + base.isScaled;
7033 }
7035 {
7036 text2 += Environment.NewLine;
7037 text2 += "<size=14>";
7038 foreach (Hobby item in ListWorks())
7039 {
7040 text2 = text2 + item.Name + ", ";
7041 }
7042 foreach (Hobby item2 in ListHobbies())
7043 {
7044 text2 = text2 + item2.Name + ", ";
7045 }
7046 text2 = text2.TrimEnd(", ".ToCharArray()) + "</size>";
7047 }
7048 string text3 = "";
7049 IEnumerable<BaseStats> enumerable = conditions.Concat((!IsPCFaction) ? new BaseStats[0] : new BaseStats[2] { hunger, stamina });
7050 if (enumerable.Count() > 0)
7051 {
7052 text3 += Environment.NewLine;
7053 text3 += "<size=14>";
7054 int num = 0;
7055 foreach (BaseStats item3 in enumerable)
7056 {
7057 if (item3 is ConBaseTransmuteMimic)
7058 {
7059 continue;
7060 }
7061 string text4 = item3.GetPhaseStr();
7062 if (text4.IsEmpty() || text4 == "#")
7063 {
7064 continue;
7065 }
7066 Color c = Color.white;
7067 switch (item3.source.group)
7068 {
7069 case "Bad":
7070 case "Debuff":
7071 case "Disease":
7073 break;
7074 case "Buff":
7076 break;
7077 }
7079 {
7080 text4 = text4 + "(" + item3.GetValue() + ")";
7081 if (resistCon != null && resistCon.ContainsKey(item3.id))
7082 {
7083 text4 = text4 + "{" + resistCon[item3.id] + "}";
7084 }
7085 }
7086 num++;
7087 text3 = text3 + text4.TagColor(c) + ", ";
7088 }
7089 if (num == 0)
7090 {
7091 text3 = "";
7092 }
7093 else
7094 {
7095 text = "";
7096 text3 = text3.TrimEnd(", ".ToCharArray()) + "</size>";
7097 }
7098 }
7100 {
7101 text3 += Environment.NewLine;
7102 foreach (ActList.Item item4 in ability.list.items)
7103 {
7104 text3 = text3 + item4.act.Name + ", ";
7105 }
7106 text3 = text3.TrimEnd(", ".ToCharArray());
7107 }
7108 return text + text2 + text3;
7109 }
override string ToString()
Definition: AIAct.cs:124
virtual string GetPhaseStr()
Definition: BaseStats.cs:47
virtual int GetValue()
Definition: BaseStats.cs:52
bool isScaled
Definition: Card.cs:915
SourceCategory.Row GetFavCat()
Definition: Chara.cs:8256
bool knowFav
Definition: Chara.cs:415
override string GetName(NameStyle style, int num=-1)
Definition: Chara.cs:1383
override int DV
Definition: Chara.cs:743
List< Hobby > ListHobbies(bool useMemberType=true)
Definition: Chara.cs:9195
override int PV
Definition: Chara.cs:772
SourceThing.Row GetFavFood()
Definition: Chara.cs:8236
List< Hobby > ListWorks(bool useMemberType=true)
Definition: Chara.cs:9168
Color colorDebuff
virtual string GetHoverText2()
bool showExtra
Definition: CoreDebug.cs:168
Definition: Hobby.cs:5
SourceTactics tactics

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

Referenced by WidgetMouseover.Refresh().

◆ GetIdPortrait()

string Chara.GetIdPortrait ( )
inline

Definition at line 8362 of file Chara.cs.

8363 {
8364 if (id == "olderyoungersister")
8365 {
8366 if (base.idSkin != 2)
8367 {
8368 return "UN_olderyoungersister";
8369 }
8370 return "UN_olderyoungersister_alt";
8371 }
8372 if (Portrait.allIds.Contains("UN_" + id + ".png"))
8373 {
8374 return "UN_" + id;
8375 }
8376 return base.c_idPortrait;
8377 }
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 8348 of file Chara.cs.

8349 {
8350 string text = race.id;
8351 if ((text == "mifu" || text == "nefu") && EClass.rnd(2) == 0)
8352 {
8353 return "foxfolk";
8354 }
8355 if (trait is TraitGuard)
8356 {
8357 return "guard";
8358 }
8359 return "";
8360 }

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

7207 {
7208 return GetSprite();
7209 }
override Sprite GetSprite(int dir=0)
Definition: Chara.cs:6843

◆ GetName()

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

Reimplemented from Card.

Definition at line 1383 of file Chara.cs.

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

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

Referenced by TraitStoryBookHome.OnRead().

◆ GetNearbyCatToSniff()

Chara Chara.GetNearbyCatToSniff ( )
inline

Definition at line 8300 of file Chara.cs.

8301 {
8302 using (List<Chara>.Enumerator enumerator = pos.ListCharasInRadius(this, 3, (Chara c) => c != this && c.race.id == "cat").GetEnumerator())
8303 {
8304 if (enumerator.MoveNext())
8305 {
8306 return enumerator.Current;
8307 }
8308 }
8309 return null;
8310 }
List< Chara > ListCharasInRadius(Chara cc, int dist, Func< Chara, bool > func, bool onlyVisible=true)
Definition: Point.cs:1220

References race.

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

◆ GetPietyValue()

int Chara.GetPietyValue ( )
inline

Definition at line 10418 of file Chara.cs.

10419 {
10420 if (base._IsPC)
10421 {
10422 return 10 + (int)(Mathf.Sqrt(base.c_daysWithGod) * 2f + (float)Evalue(85)) / 2;
10423 }
10424 return 10 + (int)(Mathf.Sqrt(base.LV) * 5f + (float)Evalue(306)) / 2;
10425 }

◆ GetRevived()

void Chara.GetRevived ( )
inline

Definition at line 5227 of file Chara.cs.

5228 {
5229 Revive(EClass.pc.pos.GetNearestPoint(allowBlock: false, allowChara: false), msg: true);
5230 if (!IsPCFaction)
5231 {
5232 return;
5233 }
5235 {
5236 if (homeZone != null && EClass._zone != homeZone)
5237 {
5238 Msg.Say("returnHome", this, homeZone.Name);
5240 }
5241 }
5242 else if (!EClass._zone.IsPCFaction || homeBranch != EClass.Branch || base.c_wasInPcParty)
5243 {
5244 EClass.pc.party.AddMemeber(this, showMsg: true);
5245 }
5246 }
static FactionBranch Branch
Definition: EClass.cs:23
void AddMemeber(Chara c, bool showMsg=false)
Definition: Party.cs:57
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false, int minRadius=0)
Definition: Point.cs:619
virtual bool CanJoinParty
Definition: TraitChara.cs:47
virtual bool CanJoinPartyResident
Definition: TraitChara.cs:50

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

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

◆ GetRoomWork()

BaseArea Chara.GetRoomWork ( )
inline

Definition at line 9146 of file Chara.cs.

9147 {
9148 BaseArea result = null;
9149 foreach (Hobby item in ListWorks())
9150 {
9151 AIWork aI = item.GetAI(this);
9152 if (aI.SetDestination())
9153 {
9154 if (aI.destArea != null)
9155 {
9156 result = aI.destArea;
9157 }
9158 else if (aI.destThing != null)
9159 {
9160 result = aI.destThing.pos.cell.room;
9161 }
9162 break;
9163 }
9164 }
9165 return result;
9166 }
Definition: AIWork.cs:6
Thing destThing
Definition: AIWork.cs:17
bool SetDestination()
Definition: AIWork.cs:56
BaseArea destArea
Definition: AIWork.cs:13

References Point.cell, AIWork.destArea, AIWork.destThing, item, Card.pos, Cell.room, and AIWork.SetDestination().

Referenced by BaseListPeople.AddSubButtonWork(), and ListPeopleBed.OnInstantiate().

◆ GetSprite()

override Sprite Chara.GetSprite ( int  dir = 0)
inlinevirtual

Reimplemented from Card.

Definition at line 6843 of file Chara.cs.

6844 {
6845 if (IsPCC)
6846 {
6847 PCC pCC = PCC.Get(pccData);
6848 pCC.Build();
6849 return pCC.variation.idle[0, 0];
6850 }
6851 bool snow = EClass.core.IsGameStarted && EClass._zone.IsSnowCovered;
6852 int skin = 0;
6853 if (spriteReplacer?.data != null)
6854 {
6855 Sprite sprite = spriteReplacer.GetSprite(dir, skin, snow);
6856 if ((bool)sprite)
6857 {
6858 return sprite;
6859 }
6860 }
6861 if (sourceCard.tiles.Length > 1)
6862 {
6863 skin = ((base.idSkin == 0 && !source.staticSkin) ? (base.uid % sourceCard.tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)) : base.idSkin);
6864 }
6865 return sourceCard.GetSprite(dir, skin, snow);
6866 }
int dir
Definition: Card.cs:147
SpriteReplacer spriteReplacer
Definition: Chara.cs:156
override CardRow sourceCard
Definition: Chara.cs:452
int[] tiles
Definition: RenderRow.cs:10
Sprite GetSprite(int dir=0, int skin=0, bool snow=false)
Definition: RenderRow.cs:271
virtual bool IsSnowCovered
Definition: Spatial.cs:545
Sprite GetSprite(string suffix="")

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

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

◆ GetSubPassData()

override SubPassData Chara.GetSubPassData ( )
inlinevirtual

Reimplemented from Card.

Definition at line 6877 of file Chara.cs.

6878 {
6879 if (IsPCC)
6880 {
6882 {
6884 }
6885 }
6886 else if (conSleep != null && host == null && pos.Equals(EClass.pc.pos) && IsHuman && (GetBool(123) || affinity.CanSleepBeside()))
6887 {
6888 return EClass.setting.pass.subDead;
6889 }
6890 return SubPassData.Default;
6891 }
bool GetBool(int id)
Definition: BaseCard.cs:15
ConSleep conSleep
Definition: Chara.cs:102
override bool IsDeadOrSleeping
Definition: Chara.cs:575
PassSetting pass
Definition: GameSetting.cs:303
bool altHeldPos
Definition: Player.cs:1223
static SubPassData Default
Definition: SubPassData.cs:7

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

◆ GetTextHappiness()

string Chara.GetTextHappiness ( )
inline

Definition at line 7448 of file Chara.cs.

7449 {
7450 return GetHappiness().ToString() ?? "";
7451 }
int GetHappiness()
Definition: Chara.cs:7438

◆ GetTextHobby()

string Chara.GetTextHobby ( bool  simple = false)
inline

Definition at line 9284 of file Chara.cs.

9285 {
9286 string text = (simple ? "" : ("hobby".lang() + ":"));
9287 foreach (Hobby item in ListHobbies())
9288 {
9289 text = text + " " + item.Name.TagColor((item.GetEfficiency(this) > 0) ? FontColor.Good : FontColor.Warning) + ",";
9290 }
9291 return text.TrimEnd(',');
9292 }

References item.

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

◆ GetTextWork()

string Chara.GetTextWork ( bool  simple = false)
inline

Definition at line 9294 of file Chara.cs.

9295 {
9296 string text = (simple ? "" : ("work".lang() + ":"));
9297 foreach (Hobby item in ListWorks())
9298 {
9299 text = text + " " + item.Name.TagColor((item.GetEfficiency(this) > 0) ? FontColor.Good : FontColor.Warning) + ",";
9300 }
9301 return text.TrimEnd(',');
9302 }

References item.

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

◆ GetTopicText()

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

Definition at line 7111 of file Chara.cs.

7112 {
7113 ConTransmuteHuman condition = GetCondition<ConTransmuteHuman>();
7114 string key = ((condition == null) ? source : condition.chara.source).idText.IsEmpty((condition == null) ? id : condition.chara.id);
7115 if (id == "littleOne" && EClass._zone is Zone_LittleGarden)
7116 {
7117 key = "littleOne2";
7118 }
7119 SourceCharaText.Row row = EClass.sources.charaText.map.TryGetValue(key);
7120 if (row == null)
7121 {
7122 return null;
7123 }
7124 string text = row.GetText(topic, returnNull: true);
7125 if (text.IsEmpty())
7126 {
7127 return null;
7128 }
7129 if (text.StartsWith("@"))
7130 {
7131 row = EClass.sources.charaText.map.TryGetValue(text.Replace("@", ""));
7132 if (row == null)
7133 {
7134 return null;
7135 }
7136 text = row.GetText(topic, returnNull: true);
7137 if (text.IsEmpty())
7138 {
7139 return null;
7140 }
7141 }
7142 return text.Split(Environment.NewLine.ToCharArray()).RandomItem();
7143 }
SourceCharaText charaText

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

◆ GetTotalFeat()

int Chara.GetTotalFeat ( )
inline

Definition at line 8322 of file Chara.cs.

8323 {
8324 int num = 0;
8325 if (base.c_upgrades != null)
8326 {
8327 num += base.c_upgrades.spent;
8328 }
8329 if (base.c_genes != null)
8330 {
8331 num += base.c_genes.GetTotalCost();
8332 }
8333 return num + base.feat;
8334 }

◆ GetWork()

Hobby Chara.GetWork ( string  id)
inline

Definition at line 9215 of file Chara.cs.

9216 {
9217 foreach (Hobby item in ListWorks())
9218 {
9219 if (item.source.alias == id)
9220 {
9221 return item;
9222 }
9223 }
9224 foreach (Hobby item2 in ListHobbies())
9225 {
9226 if (item2.source.alias == id)
9227 {
9228 return item2;
9229 }
9230 }
9231 return null;
9232 }
SourceHobby.Row source
Definition: Hobby.cs:8

References item, and Hobby.source.

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

◆ GetWorkSummary()

WorkSummary Chara.GetWorkSummary ( )
inline

Definition at line 9367 of file Chara.cs.

9368 {
9369 if (_workSummary == null)
9370 {
9371 _workSummary = new WorkSummary();
9372 }
9373 return _workSummary;
9374 }
WorkSummary _workSummary
Definition: Chara.cs:55

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

◆ GiveGift()

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

Definition at line 8461 of file Chara.cs.

8462 {
8463 if (c.IsHostile() || c.IsDeadOrSleeping)
8464 {
8465 Msg.Say("affinityNone", c, this);
8466 return;
8467 }
8468 if (!t.isCopy && t.IsCursed && t.IsEquipmentOrRanged && !t.IsAmmo && c.HasElement(1414))
8469 {
8470 bool num = t.blessedState == BlessedState.Doomed;
8471 int num2 = 200 + t.LV * 3;
8472 if (t.rarity == Rarity.Legendary)
8473 {
8474 num2 *= 3;
8475 }
8476 if (t.rarity >= Rarity.Mythical)
8477 {
8478 num2 *= 5;
8479 }
8480 if (num)
8481 {
8482 num2 *= 2;
8483 }
8484 EClass.pc.PlayEffect("identify");
8485 EClass.pc.PlaySound("identify");
8486 c.PlayEffect("mutation");
8487 c.Say("draw_curse", c, t);
8488 t.Destroy();
8489 List<Element> list = new List<Element>();
8490 foreach (Element value in EClass.pc.elements.dict.Values)
8491 {
8492 if (value is Spell)
8493 {
8494 list.Add(value);
8495 }
8496 }
8497 if (list.Count == 0)
8498 {
8500 return;
8501 }
8502 Element element = list.RandomItem();
8503 EClass.pc.ModExp(element.id, num2);
8504 EClass.pc.Say("draw_curse2", EClass.pc, element.Name);
8505 c.AddExp(Mathf.Min(num2 / 3, c.ExpToNext));
8506 return;
8507 }
8508 if ((t.id == "lovepotion" || t.id == "dreambug") && !Application.isEditor)
8509 {
8510 GiveLovePotion(c, t);
8511 return;
8512 }
8513 if (t.trait is TraitErohon && c.id == t.c_idRefName)
8514 {
8515 c.OnGiveErohon(t);
8516 return;
8517 }
8518 if (t.trait is TraitTicketMassage)
8519 {
8520 t.ModNum(-1);
8521 c.Talk("ticket");
8522 switch (t.id)
8523 {
8524 case "ticket_massage":
8525 c.ModAffinity(EClass.pc, 10);
8527 {
8528 target = c
8529 });
8530 break;
8531 case "ticket_armpillow":
8532 c.ModAffinity(EClass.pc, 20);
8533 EClass.pc.AddCondition<ConSleep>(300, force: true);
8534 c.SetAI(new AI_ArmPillow
8535 {
8536 target = EClass.pc
8537 });
8538 break;
8539 case "ticket_champagne":
8540 c.ModAffinity(EClass.pc, 10);
8542 break;
8543 }
8544 return;
8545 }
8546 if (t.id == "flyer")
8547 {
8548 stamina.Mod(-1);
8549 if (c.things.Find((Thing a) => a.id == "flyer") != null)
8550 {
8551 c.Talk("flyer_miss");
8552 DoHostileAction(c);
8553 return;
8554 }
8555 if (EClass.rnd(20) != 0 && c.CHA > EClass.rnd(base.CHA + Evalue(291) * 3 + 10))
8556 {
8557 Msg.Say("affinityNone", c, this);
8558 t.Destroy();
8559 elements.ModExp(291, 10f);
8560 return;
8561 }
8562 elements.ModExp(291, 50f);
8563 }
8564 if (t.id == "statue_weird")
8565 {
8566 EClass.pc.Say("statue_sell");
8567 }
8568 t.isGifted = true;
8569 c.nextUse = c.affinity.OnGift(t);
8570 if (!t.isDestroyed)
8571 {
8572 EClass.game.quests.list.ForeachReverse(delegate(Quest q)
8573 {
8574 q.OnGiveItem(c, t);
8575 });
8576 if (c.TryEquip(t))
8577 {
8578 c.nextUse = null;
8579 }
8580 }
8581 }
Thing OnGift(Thing t)
Definition: Affinity.cs:136
int ExpToNext
Definition: Card.cs:2046
bool isCopy
Definition: Card.cs:879
bool IsCursed
Definition: Card.cs:2295
int CHA
Definition: Card.cs:2387
bool IsEquipmentOrRanged
Definition: Card.cs:2258
void SayNothingHappans()
Definition: Card.cs:7099
string c_idRefName
Definition: Card.cs:1667
void AddExp(int a, bool applyMod=true)
Definition: Card.cs:3023
void GiveLovePotion(Chara c, Thing t)
Definition: Chara.cs:8594
bool TryEquip(Thing t, bool useFav=false)
Definition: Chara.cs:7927
void OnGiveErohon(Thing t)
Definition: Chara.cs:8583
QuestManager quests
Definition: Game.cs:183
List< Quest > list
Definition: QuestManager.cs:11
Definition: Quest.cs:7
virtual void OnGiveItem(Chara c, Thing t)
Definition: Quest.cs:536

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

8595 {
8596 c.Say("give_love", c, t);
8597 c.PlaySound(t.material.GetSoundDead());
8598 c.ShowEmo(Emo.angry);
8599 c.ModAffinity(EClass.pc, -20, show: false);
8600 c.Talk("pervert");
8601 t.Destroy();
8602 }

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

6473 {
6474 if (enemy == null && !IsPC)
6475 {
6476 if (GetInt(106) == 0)
6477 {
6478 TalkTopic("aggro");
6479 }
6480 if (OriginalHostility != Hostility.Enemy)
6481 {
6482 ShowEmo(Emo.angry);
6483 }
6484 SetEnemy(_tg.Chara);
6485 }
6487 {
6488 if (hostility >= Hostility.Neutral)
6489 {
6490 Say("angry", this);
6491 }
6492 hostility = Hostility.Enemy;
6493 }
6494 }
int GetInt(int id, int? defaultInt=null)
Definition: BaseCard.cs:25
virtual bool IsPCFactionMinion
Definition: Card.cs:2195

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

Referenced by CallHelp(), and DoHostileAction().

◆ HasAccess() [1/2]

bool Chara.HasAccess ( Card  c)
inline

Definition at line 1306 of file Chara.cs.

1307 {
1308 return HasAccess(c.pos);
1309 }
bool HasAccess(Card c)
Definition: Chara.cs:1306

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

1312 {
1313 if (!EClass._zone.IsPCFaction || p.cell.room == null || IsPC)
1314 {
1315 return true;
1316 }
1317 return p.cell.room.data.accessType switch
1318 {
1319 BaseArea.AccessType.Resident => memberType == FactionMemberType.Default,
1320 BaseArea.AccessType.Private => false,
1321 _ => true,
1322 };
1323 }

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

◆ HasCondition()

bool Chara.HasCondition ( string  alias)
inline

Definition at line 9635 of file Chara.cs.

9636 {
9637 for (int i = 0; i < conditions.Count; i++)
9638 {
9639 if (conditions[i].source.alias == alias)
9640 {
9641 return true;
9642 }
9643 }
9644 return false;
9645 }

Referenced by _Move(), AM_Adv._OnUpdateInput(), TraitGodStatue._OnUse(), ActPlan._Update(), Element._WriteNote(), ActMelee.Attack(), GoalCombat.BuildAbilityList(), AttackProcess.CalcHit(), Point.CallGuard(), ListPeopleParty.CanJoinParty(), ActNTR.CanPerform(), ActRanged.CanPerform(), ActRush.CanPerform(), ActEffect.DamageEle(), EvalueRiding(), ZonePreEnterEncounter.Execute(), TraitItemProc.GetHealAction(), AttackProcess.GetRawDamage(), AM_Adv.IsEntangled(), Point.ListWitnesses(), ModAffinity(), FactionBranch.OnAfterSimulate(), TraitDrink.OnDrink(), Zone_Field.OnGenerateMap(), TraitScrollStatic.OnRead(), ConSleep.OnRemoved(), TraitAmmo.OnUse(), Zone_Yowyn.OnVisitNewMapOrRegenerate(), ActRanged.Perform(), ActWater.Perform(), AttackProcess.Perform(), AttackProcess.Prepare(), FoodEffect.Proc(), AttackProcess.ProcAbility(), ActEffect.ProcAt(), Religion.Punish(), Religion.PunishTakeOver(), Zone.RefreshDeathSentense(), RequestProtection(), ActRide.Ride(), AI_ArmPillow.Run(), AI_Fuck.Run(), AI_Idle.Run(), GoalCombat.Run(), Card.Teleport(), BaseSong.Tick(), Tick(), ConDeathSentense.Tick(), ConMiasma.Tick(), ConSleep.Tick(), UI.ToggleFeedback(), ConStrife.TryApplyParty(), GoalCombat.TryMove(), ActPray.TryPray(), TraitBaseSpellbook.TryProgress(), Zone.TrySpawnFollower(), GoalCombat.TryUseAbility(), and ActSlime.ValidatePerform().

◆ HasCondition< T >()

override bool Chara.HasCondition< T > ( )
inlinevirtual

Reimplemented from Card.

Definition at line 9623 of file Chara.cs.

9624 {
9625 for (int i = 0; i < conditions.Count; i++)
9626 {
9627 if (conditions[i] is T)
9628 {
9629 return true;
9630 }
9631 }
9632 return false;
9633 }

◆ HasCooldown()

bool Chara.HasCooldown ( int  idEle)
inline

Definition at line 8936 of file Chara.cs.

8937 {
8938 return GetCooldown(idEle) != 0;
8939 }
int GetCooldown(int idEle)
Definition: Chara.cs:8941

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

◆ HasHigherGround()

bool Chara.HasHigherGround ( Card  c)
inline

Definition at line 1216 of file Chara.cs.

1217 {
1218 if (c == null)
1219 {
1220 return false;
1221 }
1222 float num = renderer.position.y - pos.Position(0).y + (_isLevitating ? 0.4f : 0f);
1223 float num2 = c.renderer.position.y - c.pos.Position(0).y + ((c.isChara && c.Chara._isLevitating) ? 0.4f : 0f);
1224 return num > num2 + 0.1f;
1225 }
bool _isLevitating
Definition: Chara.cs:136
ref Vector3 Position(int height)
Definition: Point.cs:548

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

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

◆ HasHobbyOrWork()

bool Chara.HasHobbyOrWork ( string  alias)
inline

Definition at line 9065 of file Chara.cs.

9066 {
9067 int num = EClass.sources.hobbies.alias.TryGetValue(alias)?.id ?? 0;
9068 listHobby.Clear();
9069 if (_works == null || _hobbies == null)
9070 {
9071 RerollHobby();
9072 }
9073 foreach (int work in _works)
9074 {
9075 if (work == num)
9076 {
9077 return true;
9078 }
9079 }
9080 foreach (int hobby in _hobbies)
9081 {
9082 if (hobby == num)
9083 {
9084 return true;
9085 }
9086 }
9087 return false;
9088 }
static List< Hobby > listHobby
Definition: Chara.cs:13
void RerollHobby(bool extraSlotChance=true)
Definition: Chara.cs:9328
SourceHobby hobbies

References SourceManager.hobbies, and EClass.sources.

Referenced by AI_Idle.Run().

◆ HasMinion()

bool Chara.HasMinion ( string  id)
inline

Definition at line 2446 of file Chara.cs.

2447 {
2448 foreach (Chara chara in EClass._map.charas)
2449 {
2450 if (chara.c_uidMaster == base.uid)
2451 {
2452 return true;
2453 }
2454 }
2455 return false;
2456 }

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

Referenced by ActEffect.ProcAt().

◆ HealAll()

void Chara.HealAll ( )
inline

Definition at line 1750 of file Chara.cs.

1751 {
1752 Cure(CureType.HealComplete);
1753 base.hp = MaxHP;
1754 mana.value = mana.max;
1755 stamina.value = stamina.max;
1756 Refresh();
1757 }
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 4550 of file Chara.cs.

4551 {
4552 if (held == t || t.isDestroyed || t.Num <= 0)
4553 {
4554 return;
4555 }
4556 if (IsPC && t.isNPCProperty)
4557 {
4558 t.isNPCProperty = false;
4559 if (!t.GetBool(128))
4560 {
4562 pos.TryWitnessCrime(this);
4563 }
4564 }
4565 PickHeld();
4566 if (t.isChara)
4567 {
4569 {
4570 t.ShowEmo(Emo.love);
4571 }
4572 EClass.player.altHeldPos = t.renderer.data.ForceAltHeldPosition || EClass.rnd(2) == 0;
4573 }
4574 else
4575 {
4576 if (num == -1 || num > t.Num)
4577 {
4578 num = t.Num;
4579 }
4580 if (num < t.Num)
4581 {
4582 t = t.Split(num);
4583 }
4584 }
4585 if (t.GetRootCard() != this)
4586 {
4587 t = Pick(t.Thing, msg: false, tryStack: false);
4588 if (t.GetRootCard() != this)
4589 {
4590 return;
4591 }
4592 }
4593 held = t;
4595 if (held.GetLightRadius() > 0)
4596 {
4598 }
4599 if (IsPC)
4600 {
4602 WidgetHotbar.dirtyCurrentItem = true;
4603 }
4604 }
Thing Split(int a)
Definition: Card.cs:3566
bool isNPCProperty
Definition: Card.cs:555
virtual CardRenderer _CreateRenderer()
Definition: Card.cs:6226
void RecalculateFOV()
Definition: Card.cs:6642
virtual bool IsAliveInCurrentZone
Definition: Card.cs:2165
int GetLightRadius()
Definition: Card.cs:6689
void PickHeld(bool msg=false)
Definition: Chara.cs:4606
bool TryWitnessCrime(Chara criminal, Chara target=null, int radius=4, Func< Chara, bool > funcWitness=null)
Definition: Point.cs:873

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

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

◆ InitStats()

void Chara.InitStats ( bool  onDeserialize = false)
inline

Definition at line 9451 of file Chara.cs.

9452 {
9453 if (!onDeserialize)
9454 {
9455 _cints[10] = 20;
9456 _cints[11] = 70;
9457 _cints[13] = 70;
9458 _cints[14] = 70;
9459 _cints[15] = 70;
9460 _cints[17] = 0;
9461 _cints[18] = 0;
9462 }
9463 foreach (Condition condition in conditions)
9464 {
9465 condition.SetOwner(this, onDeserialize);
9466 }
9467 }
int[] _cints
Definition: Chara.cs:82

References BaseCondition.SetOwner().

Referenced by OnCreate(), and OnDeserialized().

◆ InstantEat()

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

Definition at line 7769 of file Chara.cs.

7770 {
7771 if (t == null)
7772 {
7773 t = FindBestFoodToEat();
7774 }
7775 if (t == null)
7776 {
7777 t = things.Find((Thing a) => CanEat(a, shouldEat: true) && !a.c_isImportant);
7778 }
7779 if (t == null)
7780 {
7781 t = things.Find((Thing a) => CanEat(a) && !a.c_isImportant);
7782 }
7783 if (t != null)
7784 {
7785 Say("eat_start", this, t.Duplicate(1));
7786 if (sound)
7787 {
7788 PlaySound("eat");
7789 }
7790 FoodEffect.Proc(this, t);
7791 }
7792 }
Thing FindBestFoodToEat()
Definition: Chara.cs:7748
static void Proc(Chara c, Thing food, bool consume=true)
Definition: FoodEffect.cs:12

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

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

◆ IsBranchMember()

bool Chara.IsBranchMember ( )
inline

Definition at line 6734 of file Chara.cs.

6735 {
6736 if (faction == EClass.Home)
6737 {
6738 return homeZone == EClass.game.activeZone;
6739 }
6740 return false;
6741 }
Faction faction
Definition: Chara.cs:429
Zone activeZone
Definition: Game.cs:252

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

◆ IsCriticallyWounded()

bool Chara.IsCriticallyWounded ( bool  includeRide = false)
inline

Definition at line 1203 of file Chara.cs.

1204 {
1205 if (host == null || includeRide)
1206 {
1207 if (Evalue(1421) <= 0)
1208 {
1209 return base.hp < MaxHP / 5;
1210 }
1211 return base.hp + mana.value < (MaxHP + mana.max) / 5;
1212 }
1213 return false;
1214 }

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

2574 {
2575 if (!currentZone.IsRegion && p.IsValid)
2576 {
2577 CellDetail detail = p.detail;
2578 if (detail != null && detail.charas.Count > 0)
2579 {
2580 foreach (Chara chara in p.detail.charas)
2581 {
2582 if (chara.mimicry == null && (chara.IsHostile(this) || chara.IsHostile() || !chara.trait.CanBePushed))
2583 {
2584 if (cancelAI && EClass.pc.ai is GoalManualMove)
2585 {
2586 EClass.pc.ai.Cancel();
2587 }
2588 return true;
2589 }
2590 }
2591 }
2592 }
2593 return false;
2594 }
List< Chara > charas
Definition: CellDetail.cs:13
CellDetail detail
Definition: Point.cs:71

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

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

◆ IsEscorted()

bool Chara.IsEscorted ( )
inline

Definition at line 2473 of file Chara.cs.

2474 {
2475 if (!IsPCPartyMinion)
2476 {
2477 return false;
2478 }
2479 foreach (Quest item in EClass.game.quests.list)
2480 {
2481 if (item is QuestEscort questEscort && questEscort.uidChara == base.uid)
2482 {
2483 return true;
2484 }
2485 }
2486 return false;
2487 }
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 6778 of file Chara.cs.

6779 {
6780 if (base.IsPCFactionOrMinion || IsFriendOrAbove())
6781 {
6783 {
6784 return true;
6785 }
6786 }
6787 else if (IsHostile() && c.IsHostile())
6788 {
6789 return true;
6790 }
6791 return false;
6792 }

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

◆ IsGuest()

◆ IsHomeMember()

◆ IsHostile() [1/2]

◆ IsHostile() [2/2]

bool Chara.IsHostile ( Chara  c)
inline

Definition at line 6682 of file Chara.cs.

6683 {
6684 if (c == null)
6685 {
6686 return false;
6687 }
6688 if (base.IsPCFactionOrMinion)
6689 {
6690 if ((c == EClass.pc.enemy && !c.IsPCFactionOrMinion) || c.hostility <= Hostility.Enemy)
6691 {
6692 return true;
6693 }
6694 }
6695 else
6696 {
6698 {
6699 return true;
6700 }
6701 if (OriginalHostility >= Hostility.Friend)
6702 {
6703 if (hostility <= Hostility.Enemy && c.IsPCFactionOrMinion)
6704 {
6705 return true;
6706 }
6707 if (c.hostility <= Hostility.Enemy && c.OriginalHostility == Hostility.Enemy)
6708 {
6709 return true;
6710 }
6711 }
6712 else if (OriginalHostility <= Hostility.Enemy && (c.IsPCFactionOrMinion || (c.OriginalHostility != Hostility.Enemy && c.hostility >= Hostility.Friend)))
6713 {
6714 return true;
6715 }
6716 }
6717 if (id == "unicorn" && (Evalue(418) < 0 || (c.HasElement(1216) && c.Evalue(418) < 1)))
6718 {
6719 return true;
6720 }
6721 return false;
6722 }
bool IsCriminal
Definition: Player.cs:1409

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

◆ IsInHomeZone()

bool Chara.IsInHomeZone ( )
inline

Definition at line 6748 of file Chara.cs.

6749 {
6750 return EClass.game.activeZone == currentZone;
6751 }

Referenced by BaseListPeople.IsDisabled().

◆ IsInSpot< T >()

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

Definition at line 6753 of file Chara.cs.

6753 : TraitSpot
6754 {
6755 foreach (T item in EClass._map.props.installed.traits.List<T>())
6756 {
6757 foreach (Point item2 in item.ListPoints())
6758 {
6759 if (pos.Equals(item2))
6760 {
6761 return true;
6762 }
6763 }
6764 }
6765 return false;
6766 }
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 6724 of file Chara.cs.

6725 {
6726 return hostility == Hostility.Neutral;
6727 }

Referenced by ActPlan._Update().

◆ IsNeutralOrAbove()

bool Chara.IsNeutralOrAbove ( )
inline

◆ IsValidGiftWeight()

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

Definition at line 8405 of file Chara.cs.

8406 {
8407 int num2 = ((!HasElement(1411)) ? 1 : 3);
8408 if (GetBurden(t, num) >= num2)
8409 {
8410 return false;
8411 }
8412 return true;
8413 }
int GetBurden(Card t=null, int num=-1)
Definition: Chara.cs:1847

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

◆ Kiss()

void Chara.Kiss ( Chara  c)
inline

Definition at line 6403 of file Chara.cs.

6404 {
6405 EClass.player.forceTalk = true;
6406 Talk("kiss", null, null, IsPC);
6407 PlaySound("kiss");
6408 renderer.PlayAnime(AnimeID.Kiss, c);
6409 int num = 2 + EClass.rnd(4) + ((!c.IsPC && c.affinity.CurrentStage < Affinity.Stage.Fond) ? (-EClass.rnd(10)) : 0);
6410 c.ShowEmo((num > 0) ? Emo.love : Emo.sad);
6411 if (num > 0 && EClass.rnd(IsPC ? 100 : 5000) == 0)
6412 {
6413 c.MakeEgg();
6414 }
6415 if (IsPC && this != c)
6416 {
6417 if (c.interest > 0)
6418 {
6419 c.ModAffinity(EClass.pc, num);
6420 c.interest -= 20 + EClass.rnd(10);
6421 }
6422 else
6423 {
6424 c.Say("affinityNone", c, EClass.pc);
6425 }
6426 }
6427 Effect.Get("love")._Play(pos, isSynced ? renderer.position : pos.Position(), 0f, c.pos);
6428 }
Effect _Play(Point from, Vector3 fromV, float fixY=0f, Point to=null, Sprite sprite=null)
Definition: Effect.cs:117

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

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

◆ ListAvailabeFeats()

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

Definition at line 10098 of file Chara.cs.

10099 {
10100 List<Element> list = new List<Element>();
10101 foreach (SourceElement.Row item in EClass.sources.elements.rows.Where((SourceElement.Row a) => a.group == "FEAT" && a.cost[0] != -1 && !a.categorySub.IsEmpty()))
10102 {
10104 int num = ((feat.ValueWithoutLink <= 0) ? 1 : (feat.ValueWithoutLink + 1));
10105 if (num <= feat.source.max && !feat.HasTag("class") && !feat.HasTag("hidden") && !feat.HasTag("innate") && (!pet || !feat.HasTag("noPet")) && (showAll || feat.IsPurchaseFeatReqMet(elements)))
10106 {
10107 list.Add(Element.Create(feat.id, num) as Feat);
10108 }
10109 }
10110 return list;
10111 }
int feat
Definition: Card.cs:375
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1115
Definition: FEAT.cs:324

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

9196 {
9197 listHobby.Clear();
9198 if (!useMemberType || memberType != FactionMemberType.Livestock)
9199 {
9200 if (_hobbies == null)
9201 {
9202 RerollHobby();
9203 }
9204 foreach (int hobby in _hobbies)
9205 {
9206 listHobby.Add(new Hobby
9207 {
9208 id = hobby
9209 });
9210 }
9211 }
9212 return listHobby;
9213 }

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

9169 {
9170 listHobby.Clear();
9171 if (useMemberType && memberType == FactionMemberType.Livestock)
9172 {
9173 listHobby.Add(new Hobby
9174 {
9175 id = 45
9176 });
9177 }
9178 else
9179 {
9180 if (_works == null)
9181 {
9182 RerollHobby();
9183 }
9184 foreach (int work in _works)
9185 {
9186 listHobby.Add(new Hobby
9187 {
9188 id = work
9189 });
9190 }
9191 }
9192 return listHobby;
9193 }

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

3608 {
3609 angle = Util.GetAngle(p.x - pos.x, p.z - pos.z);
3610 if (EClass._zone.IsRegion)
3611 {
3612 if (angle > 100f && angle < 170f)
3613 {
3614 base.dir = 2;
3615 }
3616 else if (angle > 170f && angle < 190f)
3617 {
3618 base.dir = 0;
3619 }
3620 else if (angle > 190f || (angle < -10f && angle > -100f))
3621 {
3622 base.dir = 3;
3623 }
3624 else
3625 {
3626 base.dir = 1;
3627 }
3628 angle -= 45f;
3629 }
3630 else if (angle > 170f && angle < 235f)
3631 {
3632 base.dir = 0;
3633 }
3634 else if (angle > 80f && angle < 145f)
3635 {
3636 base.dir = 1;
3637 }
3638 else if (angle > -100f && angle < -35f)
3639 {
3640 base.dir = 3;
3641 }
3642 else if (angle > -10f && angle < 55f)
3643 {
3644 base.dir = 2;
3645 }
3647 }

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

◆ MakeAlly()

void Chara.MakeAlly ( bool  msg = true)
inline

Definition at line 2339 of file Chara.cs.

2340 {
2341 if (IsLocalChara && !base.IsUnique)
2342 {
2343 Debug.Log("Creating Replacement NPC for:" + this);
2345 }
2346 _MakeAlly();
2347 if (msg)
2348 {
2349 EClass.pc.Say("hire", this);
2350 EClass.Sound.Play("good");
2351 }
2352 EClass.pc.party.AddMemeber(this);
2353 if (EClass._zone.IsTown)
2354 {
2356 }
2357 }
Chara CreateReplacement()
Definition: Chara.cs:8215
void _MakeAlly()
Definition: Chara.cs:2359
virtual bool IsTown
Definition: Zone.cs:225
void RefreshListCitizen()
Definition: Zone.cs:3647

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

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

◆ MakeBraineCell()

Thing Chara.MakeBraineCell ( )
inline

Definition at line 8384 of file Chara.cs.

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

References DNA.GenerateGene().

◆ MakeGene()

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

Definition at line 8379 of file Chara.cs.

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

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

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

◆ MakeGrave()

void Chara.MakeGrave ( string  lastword)
inline

Definition at line 5334 of file Chara.cs.

5335 {
5336 if (!EClass._zone.IsRegion)
5337 {
5338 List<string> list = new List<string> { "930", "931", "947", "948", "949", "950", "951", "952" };
5339 if (IsPC && EClass.rnd(2) == 0 && EClass.pc.things.Find("letter_will") != null)
5340 {
5341 list = new List<string> { "944", "946", "backerGrave", "backerGrave2" };
5342 }
5343 Thing thing = ThingGen.Create(list.RandomItem());
5344 thing.MakeRefFrom(this);
5345 if (!lastword.IsEmpty())
5346 {
5347 thing.c_note = lastword;
5348 }
5349 thing.isModified = true;
5350 EClass._zone.AddCard(thing, pos).Install();
5351 }
5352 }
Card MakeRefFrom(string id)
Definition: Card.cs:5852

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

◆ MakeMinion()

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

Definition at line 2402 of file Chara.cs.

2403 {
2404 UnmakeMinion();
2405 Hostility hostility2 = (base.c_originalHostility = (_master.IsPCFaction ? Hostility.Ally : _master.hostility));
2406 this.hostility = hostility2;
2407 base.c_uidMaster = _master.uid;
2408 base.c_minionType = type;
2409 master = _master;
2410 Refresh();
2411 }
int uid
Definition: Card.cs:123

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

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

◆ MakePartyMemeber()

void Chara.MakePartyMemeber ( )
inline

Definition at line 2333 of file Chara.cs.

2334 {
2335 _MakeAlly();
2336 EClass.pc.party.AddMemeber(this);
2337 }

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

◆ Marry()

void Chara.Marry ( Chara  c)
inline

Definition at line 8276 of file Chara.cs.

8277 {
8278 if (base.c_love == null)
8279 {
8280 base.c_love = new LoveData();
8281 }
8282 base.c_love.dateMarriage = EClass.world.date.GetRaw();
8283 base.c_love.uidZoneMarriage = EClass._zone.uid;
8284 base.c_love.nameZoneMarriage = EClass._zone.Name;
8285 SetFeat(1275, 1, msg: true);
8287 }
int GetRaw(int offsetHours=0)
Definition: Date.cs:328
int married
Definition: Player.cs:132
int uid
Definition: Spatial.cs:70

References EClass._zone, World.date, Date.GetRaw(), Player.Stats.married, Spatial.Name, EClass.player, Player.stats, Spatial.uid, and EClass.world.

Referenced by DramaOutcome.marry().

◆ ModAffinity()

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

Definition at line 8137 of file Chara.cs.

8138 {
8139 if (c == this)
8140 {
8141 return;
8142 }
8143 if (IsPC)
8144 {
8145 c.ModAffinity(EClass.pc, a, show);
8146 }
8147 else
8148 {
8150 {
8151 return;
8152 }
8153 int num = StatsHygiene.GetAffinityMod(EClass.pc.hygiene.GetPhase()) + (HasElement(417) ? 30 : 0) + (EClass.pc.HasCondition<ConSmoking>() ? (-30) : 0);
8154 if (IsPCFaction && homeBranch != null)
8155 {
8156 num += (int)Mathf.Sqrt(homeBranch.Evalue(2117)) * 5;
8157 }
8158 bool flag = a > 0;
8159 if (flag)
8160 {
8161 a = a * num / 100;
8162 if (affinity.GetLunchChance() > EClass.rnd(100) && GetInt(71) >= 0 && GetInt(71) < EClass.world.date.GetRaw())
8163 {
8164 SetInt(71, -1);
8165 }
8166 }
8167 if (show)
8168 {
8169 if (a == 0)
8170 {
8171 if (!showOnlyEmo)
8172 {
8173 Say("affinityNone", this, c);
8174 }
8175 }
8176 else
8177 {
8178 ShowEmo((!flag) ? Emo.angry : Emo.love);
8179 c.ShowEmo(flag ? Emo.love : Emo.sad);
8180 if (!showOnlyEmo)
8181 {
8182 Say(flag ? "affinityPlus" : "affinityMinus", this, c);
8183 }
8184 }
8185 }
8186 if (c.IsPC)
8187 {
8188 a = affinity.Mod(a);
8189 }
8190 }
8191 }
int Mod(int a)
Definition: Affinity.cs:199
int GetLunchChance()
Definition: Affinity.cs:93
Stats hygiene
Definition: Chara.cs:1178
int Evalue(int ele)
static int GetAffinityMod(int phase)
Definition: StatsHygiene.cs:19
virtual bool CanChangeAffinity
Definition: Trait.cs:571

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

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

◆ ModCorruption()

void Chara.ModCorruption ( int  a)
inline

Definition at line 10055 of file Chara.cs.

10056 {
10057 if (a > 0)
10058 {
10059 if (Evalue(962) >= 25 || (ResistLv(962) > 0 && EClass.rnd(ResistLv(962) + 1) != 0))
10060 {
10061 return;
10062 }
10063 int num = Evalue(412);
10064 if (num != 0)
10065 {
10066 float num2 = (float)a * 100f / (float)Mathf.Max(100 + num * 2, 10);
10067 a = (int)num2 + ((EClass.rndf(1f) < num2 % 1f) ? 1 : 0);
10068 }
10069 }
10070 if (a == 0)
10071 {
10072 return;
10073 }
10074 int num3 = (corruption + a) / 100 - corruption / 100;
10075 for (int i = 0; i < Mathf.Abs(num3); i++)
10076 {
10077 if (!MutateRandom((num3 > 0) ? 1 : (-1), 100, ether: true))
10078 {
10079 break;
10080 }
10081 }
10082 corruption += a;
10083 int num4 = 0;
10084 foreach (Element value in elements.dict.Values)
10085 {
10086 if (value.source.category == "ether")
10087 {
10088 num4 += value.Value;
10089 }
10090 }
10091 if (num4 > 0 && IsPC)
10092 {
10093 Tutorial.Reserve("ether");
10094 }
10095 corruption = num4 * 100 + corruption % 100;
10096 }
bool MutateRandom(int vec=0, int tries=100, bool ether=false, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:10214
static float rndf(float a)
Definition: EClass.cs:102

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

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

◆ ModHeight()

void Chara.ModHeight ( int  a)
inline

Definition at line 10004 of file Chara.cs.

10005 {
10006 if (!HasElement(450))
10007 {
10008 long num = bio.height;
10009 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
10010 if (num < 1)
10011 {
10012 num = 1L;
10013 }
10014 if (num > 999999999)
10015 {
10016 num = 999999999L;
10017 }
10018 if (num != bio.height)
10019 {
10020 bio.height = (int)num;
10021 Say((a > 0) ? "height_gain" : "height_lose", this);
10022 }
10023 }
10024 }
int height
Definition: Biography.cs:53

◆ ModTempElement()

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

Definition at line 10470 of file Chara.cs.

10471 {
10472 if (a < 0 && !naturalDecay && HasElement(EClass.sources.elements.alias["sustain_" + EClass.sources.elements.map[ele].alias]?.id ?? 0))
10473 {
10474 return;
10475 }
10476 bool flag = HasElement(1215);
10477 if (tempElements == null)
10478 {
10480 tempElements.SetParent(this);
10481 }
10482 if (a > 0 && flag)
10483 {
10484 a = a * 150 / 100;
10485 }
10486 int num = elements.ValueWithoutLink(ele);
10487 int num2 = Mathf.Abs(num) + 100;
10488 int num3 = num2 / (flag ? 2 : 4);
10489 int num4 = -num - 100;
10490 int num5 = tempElements.Base(ele);
10491 int num6 = num5 + a;
10492 if (onlyRenew)
10493 {
10494 num3 = Mathf.Min(a, num3);
10495 num4 = Mathf.Max(a, -num2 / 3);
10496 }
10497 if (a > 0 && num6 > num3)
10498 {
10499 a = ((num3 > num5) ? (num3 - num5) : 0);
10500 }
10501 if (a < 0 && num6 < num4)
10502 {
10503 a = ((num4 < num5) ? (num4 - num5) : 0);
10504 }
10505 Element element = tempElements.ModBase(ele, a);
10506 if (element.vBase == 0)
10507 {
10508 tempElements.Remove(element.id);
10509 if (tempElements.dict.Count == 0)
10510 {
10511 tempElements = null;
10512 }
10513 }
10514 }
int ValueWithoutLink(int ele)
void Remove(int id)

References ElementContainer.Base(), ElementContainer.dict, SourceManager.elements, Element.id, ElementContainer.ModBase(), ElementContainer.Remove(), ElementContainer.SetParent(), EClass.sources, and Element.vBase.

◆ ModWeight()

void Chara.ModWeight ( int  a,
bool  ignoreLimit = false 
)
inline

Definition at line 10026 of file Chara.cs.

10027 {
10028 if (HasElement(450) || a == 0)
10029 {
10030 return;
10031 }
10032 long num = bio.weight;
10033 long num2 = bio.height;
10034 long num3 = num2 * num2 * 18 / 25000;
10035 long num4 = num2 * num2 * 24 / 10000;
10036 if (ignoreLimit || (num > num3 && num < num4))
10037 {
10038 num = num * (100 + a) / 100 + ((a > 0) ? 1 : (-1));
10039 if (num < 1)
10040 {
10041 num = 1L;
10042 }
10043 if (num > 999999999)
10044 {
10045 num = 999999999L;
10046 }
10047 if (num != bio.weight)
10048 {
10049 bio.weight = (int)num;
10050 Say((a > 0) ? "weight_gain" : "weight_lose", this);
10051 }
10052 }
10053 }
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 2687 of file Chara.cs.

2688 {
2689 if (!newPoint.sourceBlock.tileType.IsBlockPass && (!checkWall || (Dist(newPoint) <= 1 && CanMoveTo(newPoint, allowDestroyPath: false))) && _Move(newPoint, MoveType.Force) == MoveResult.Success && ai.Current.CancelWhenMoved)
2690 {
2691 ai.Current.TryCancel(c);
2692 }
2693 }
bool TryCancel(Card c)
Definition: AIAct.cs:280
virtual bool CancelWhenMoved
Definition: AIAct.cs:96
override MoveResult _Move(Point newPoint, MoveType type=MoveType.Walk)
Definition: Chara.cs:2781

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

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

◆ MoveHome() [1/2]

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

◆ MoveHome() [2/2]

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

Definition at line 3523 of file Chara.cs.

3524 {
3525 if (isDead)
3526 {
3527 Revive();
3528 }
3529 else
3530 {
3531 Cure(CureType.Death);
3532 }
3533 CureCondition<ConSuspend>();
3534 if (IsPCParty)
3535 {
3537 }
3538 FactionBranch factionBranch = homeBranch;
3539 if (x == -1)
3540 {
3541 x = 50;
3542 }
3543 if (z == -1)
3544 {
3545 z = 50;
3546 }
3547 Point point = new Point(x, z);
3548 if (zone.IsActiveZone)
3549 {
3550 point = point.GetNearestPoint(allowBlock: false, allowChara: false);
3551 }
3552 zone.AddCard(this, point);
3553 SetHomeZone(zone);
3554 global.transition = new ZoneTransition
3555 {
3556 state = ZoneTransition.EnterState.Dead,
3557 x = point.x,
3558 z = point.z
3559 };
3560 orgPos = new Point(x, z);
3561 if (factionBranch != null)
3562 {
3564 factionBranch.policies.Validate();
3565 }
3566 }
void RefreshWorkElements(ElementContainer parent=null)
Definition: Chara.cs:9234
Chara SetHomeZone(Zone zone)
Definition: Chara.cs:1461
PolicyManager policies
bool IsActiveZone
Definition: Zone.cs:497

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

2670 {
2671 List<Point> list = new List<Point>();
2672 pos.ForeachNeighbor(delegate(Point p)
2673 {
2674 list.Add(p.Copy());
2675 });
2676 list.Shuffle();
2677 foreach (Point item in list)
2678 {
2679 if (!item.Equals(pos) && !item.HasChara && TryMove(item) == MoveResult.Success)
2680 {
2681 return true;
2682 }
2683 }
2684 return false;
2685 }
override MoveResult TryMove(Point newPoint, bool allowDestroyPath=true)
Definition: Chara.cs:2757
void ForeachNeighbor(Action< Point > action, bool diagonal=true)
Definition: Point.cs:1397

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

Referenced by AI_Idle.Run().

◆ MoveRandom()

bool Chara.MoveRandom ( )
inline

Definition at line 2655 of file Chara.cs.

2656 {
2657 Point randomNeighbor = pos.GetRandomNeighbor();
2658 if (!randomNeighbor.Equals(pos) && !randomNeighbor.HasChara && HasAccess(randomNeighbor))
2659 {
2660 if ((race.tag.Contains("water") || source.tag.Contains("water")) && pos.cell.IsTopWaterAndNoSnow && !randomNeighbor.IsDeepWater)
2661 {
2662 return false;
2663 }
2664 return TryMove(randomNeighbor) == MoveResult.Success;
2665 }
2666 return false;
2667 }
bool IsTopWaterAndNoSnow
Definition: Cell.cs:712
bool IsDeepWater
Definition: Point.cs:276

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

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

◆ MoveZone() [1/3]

◆ MoveZone() [2/3]

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

Definition at line 3396 of file Chara.cs.

3397 {
3398 if (z == currentZone)
3399 {
3400 return;
3401 }
3402 if (HasCondition<ConInvulnerable>())
3403 {
3404 RemoveCondition<ConInvulnerable>();
3405 }
3406 if (IsPC)
3407 {
3408 EClass.player.nextZone = z;
3410 {
3413 {
3414 if (EClass.player.returnInfo != null)
3415 {
3416 EClass.player.returnInfo.turns += 5;
3417 }
3419 {
3420 EClass.game.Save(isAutoSave: true);
3421 }
3422 }
3423 EClass.player.deathZoneMove = false;
3424 }
3426 if (currentZone.instance != null)
3427 {
3429 z = EClass.game.spatials.Find(instance.uidZone) ?? EClass.pc.homeZone;
3430 transition = new ZoneTransition
3431 {
3432 state = instance.ReturnState,
3433 x = instance.x,
3434 z = instance.z
3435 };
3436 instance.OnLeaveZone();
3437 Debug.Log(z);
3438 }
3439 EInput.Consume(consumeAxis: true);
3440 EClass.player.uidLastZone = currentZone.uid;
3442 {
3444 {
3445 Msg.Say("enterZone", z.Name);
3446 }
3447 else
3448 {
3449 if (z.IsRegion)
3450 {
3451 Msg.Say("leaveZone", currentZone.Name);
3452 }
3453 else if (z.id != currentZone.id)
3454 {
3455 Msg.Say("enterZone", z.Name);
3456 }
3457 EClass.player.lastZonePos = pos.Copy();
3458 }
3459 EClass.player.lastTransition = transition;
3460 }
3461 foreach (Chara item in EClass._map.charas.Where((Chara c) => c.IsPCPartyMinion && c.master != EClass.pc).ToList())
3462 {
3464 }
3465 EClass.player.listCarryoverMap = EClass._map.charas.Where((Chara c) => c.c_uidMaster != 0 && c.FindMaster() == EClass.pc && c.c_minionType == MinionType.Default).ToList();
3466 if (!z.IsRegion && (z is Zone_Tent || currentZone is Zone_Tent))
3467 {
3468 foreach (Chara chara in EClass._map.charas)
3469 {
3470 if (chara.c_uidMaster == 0 && !chara.IsGlobal && !chara.isNPCProperty && (chara.id == "reaper" || chara.id == "messenger_death") && ((chara.enemy != null && chara.enemy.IsPCFactionOrMinion) || chara.Dist(EClass.pc) < 5))
3471 {
3472 EClass.player.listCarryoverMap.Add(chara);
3473 }
3474 }
3475 }
3476 foreach (Chara item2 in EClass.player.listCarryoverMap)
3477 {
3478 EClass._zone.RemoveCard(item2);
3479 }
3480 }
3481 if (party != null && party.leader == this)
3482 {
3483 foreach (Chara member in party.members)
3484 {
3485 if (member != this && !member.isDead && member.parent is Zone)
3486 {
3487 member.MoveZone(z);
3488 }
3489 }
3490 }
3491 if (global == null)
3492 {
3493 Debug.Log(base.Name);
3494 return;
3495 }
3496 transition.uidLastZone = currentZone?.uid ?? 0;
3497 global.transition = transition;
3498 if (z.IsActiveZone)
3499 {
3500 Point spawnPos = z.GetSpawnPos(this);
3501 global.transition = null;
3502 if (IsPC)
3503 {
3504 EClass.player.lastTransition = null;
3505 }
3506 z.AddCard(this, spawnPos);
3507 if (IsBranchMember())
3508 {
3510 }
3511 }
3512 else
3513 {
3514 z.AddCard(this);
3515 }
3516 }
MinionType c_minionType
Definition: Card.cs:1001
bool IsBranchMember()
Definition: Chara.cs:6734
GlobalData global
Definition: Chara.cs:76
Chara FindMaster()
Definition: Chara.cs:2464
bool ignoreAutoSave
Definition: CoreDebug.cs:126
bool Save(bool isAutoSave=false, bool silent=false)
Definition: Game.cs:1040
RoomManager rooms
Definition: Map.cs:31
Chara leader
Definition: Party.cs:31
bool deathZoneMove
Definition: Player.cs:1239
List< Chara > listCarryoverMap
Definition: Player.cs:1293
ReturnInfo returnInfo
Definition: Player.cs:933
bool simulatingZone
Definition: Player.cs:1249
void AssignCharas()
Definition: RoomManager.cs:39
string id
Definition: Spatial.cs:13
virtual ZoneTransition.EnterState ReturnState
Definition: ZoneInstance.cs:26
virtual void OnLeaveZone()
Definition: ZoneInstance.cs:36
virtual bool WillAutoSave
Definition: Zone.cs:265
Point GetSpawnPos(Chara c, ZoneTransition.EnterState destState=ZoneTransition.EnterState.Auto)
Definition: Zone.cs:1372

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

◆ MoveZone() [3/3]

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

Definition at line 3388 of file Chara.cs.

3389 {
3391 {
3392 state = state
3393 });
3394 }

◆ MutateRandom()

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

Definition at line 10214 of file Chara.cs.

10215 {
10216 if (!ether && vec >= 0 && HasElement(406) && EClass.rnd(5) != 0)
10217 {
10218 Say("resistMutation", this);
10219 return false;
10220 }
10221 IEnumerable<SourceElement.Row> ie = EClass.sources.elements.rows.Where((SourceElement.Row a) => a.category == (ether ? "ether" : "mutation") && !a.tag.Contains("noRandomMutation"));
10222 for (int i = 0; i < tries; i++)
10223 {
10224 SourceElement.Row row = ie.RandomItem();
10225 if (i == 0 && vec < 0 && ether && base.c_corruptionHistory != null && base.c_corruptionHistory.Count > 0)
10226 {
10227 if (EClass.sources.elements.map.ContainsKey(base.c_corruptionHistory.LastItem()))
10228 {
10229 row = EClass.sources.elements.map[base.c_corruptionHistory.LastItem()];
10230 }
10231 base.c_corruptionHistory.RemoveAt(base.c_corruptionHistory.Count - 1);
10232 if (base.c_corruptionHistory.Count == 0)
10233 {
10234 base.c_corruptionHistory = null;
10235 }
10236 }
10237 Element element = elements.GetElement(row.id);
10238 int num = 1;
10239 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))
10240 {
10241 continue;
10242 }
10243 if (element == null && !row.aliasParent.IsEmpty() && elements.Has(row.aliasParent))
10244 {
10245 row = EClass.sources.elements.alias[row.aliasParent];
10246 element = elements.GetElement(row.id);
10247 }
10248 bool flag = row.tag.Contains("neg");
10249 if (vec > 0)
10250 {
10251 if ((state >= BlessedState.Blessed && flag) || (state <= BlessedState.Cursed && !flag))
10252 {
10253 continue;
10254 }
10255 }
10256 else if (vec < 0 && ((state >= BlessedState.Blessed && !flag) || (state <= BlessedState.Cursed && flag)))
10257 {
10258 continue;
10259 }
10260 bool flag2 = true;
10261 if (element != null)
10262 {
10263 num = element.Value + ((vec != 0) ? vec : ((EClass.rnd(2) == 0) ? 1 : (-1)));
10264 if (num > element.source.max)
10265 {
10266 num = element.source.max - 1;
10267 }
10268 flag = (flag && num > element.Value) || (!flag && num < element.Value);
10269 flag2 = num > element.Value;
10270 if (vec > 0 && !flag2)
10271 {
10272 continue;
10273 }
10274 }
10275 Say(flag2 ? "mutation_gain" : "mutation_loose", this);
10276 SetFeat(row.id, num);
10277 if (flag2 && ether)
10278 {
10279 if (base.c_corruptionHistory == null)
10280 {
10281 base.c_corruptionHistory = new List<int>();
10282 }
10283 base.c_corruptionHistory.Add(row.id);
10284 if (IsPCFaction)
10285 {
10286 Element element2 = elements.GetElement(row.id);
10287 WidgetPopText.Say("popEther".lang(element2.Name, base.Name));
10288 }
10290 {
10291 EClass.player.flags.gotEtherDisease = true;
10292 Thing thing = ThingGen.Create("parchment");
10293 thing.SetStr(53, "letter_ether");
10294 Thing thing2 = ThingGen.Create("1165");
10295 thing2.SetBlessedState(BlessedState.Normal);
10296 Thing p = ThingGen.CreateParcel(null, thing2, thing);
10298 }
10299 }
10300 if (EClass.core.IsGameStarted && pos != null)
10301 {
10302 PlaySound(ether ? "mutation_ether" : "mutation");
10303 PlayEffect("mutation");
10305 Say(row.GetText(flag ? "textDec" : "textInc", returnNull: true) ?? row.alias, this);
10306 }
10307 return true;
10308 }
10309 Say("nothingHappens");
10310 return false;
10311 }
void SetStr(int id, string value=null)
Definition: BaseCard.cs:63
virtual void SetBlessedState(BlessedState s)
Definition: Card.cs:3977
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:496
static Thing CreateParcel(string idLang=null, params Thing[] things)
Definition: ThingGen.cs:42
void SendPackage(Thing p)
Definition: World.cs:68

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

◆ OnAdvanceDay()

void Chara.OnAdvanceDay ( )
inline

Definition at line 10363 of file Chara.cs.

10364 {
10365 if (_historyFood != null)
10366 {
10367 while (_historyFood.Count > 5)
10368 {
10369 _historyFood.RemoveAt(_historyFood.Count - 1);
10370 }
10371 if (_historyFood[0].Count > 0)
10372 {
10373 _historyFood.Insert(0, new List<string>());
10374 }
10375 }
10376 }

Referenced by GameDate.AdvanceDay().

◆ OnBanish()

void Chara.OnBanish ( )
inline

Definition at line 1475 of file Chara.cs.

1476 {
1477 if (!IsGlobal)
1478 {
1479 return;
1480 }
1481 memberType = FactionMemberType.Default;
1482 foreach (Thing item in things.List((Thing a) => a.HasTag(CTAG.godArtifact)).ToList())
1483 {
1485 }
1486 UniqueData uniqueData = base.c_uniqueData;
1487 if (uniqueData != null)
1488 {
1489 Debug.Log(uniqueData.uidZone + "/" + EClass.game.spatials.map.ContainsKey(uniqueData.uidZone) + "/" + uniqueData.x + "/" + uniqueData.y);
1490 }
1491 if (uniqueData != null && EClass.game.spatials.map.ContainsKey(uniqueData.uidZone))
1492 {
1493 MoveHome(EClass.game.spatials.map[uniqueData.uidZone] as Zone, uniqueData.x, uniqueData.y);
1494 return;
1495 }
1496 Zone z = EClass.game.spatials.Find("somewhere");
1497 if (trait is TraitAdventurer)
1498 {
1499 z = EClass.world.region.ListTowns().RandomItem();
1500 SetHomeZone(z);
1501 }
1502 MoveZone(z, ZoneTransition.EnterState.RandomVisit);
1503 }
void PickOrDrop(Point p, string idThing, int idMat=-1, int num=1, bool msg=true)
Definition: Chara.cs:4366
List< Zone > ListTowns()
Definition: Region.cs:271
GlobalSpatialList map
int uidZone
Definition: UniqueData.cs:12

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

Referenced by FactionBranch.BanishMember().

◆ OnBeforeCreate()

override void Chara.OnBeforeCreate ( )
inlinevirtual

Reimplemented from Card.

Definition at line 1542 of file Chara.cs.

1543 {
1544 if (source.job == "*r")
1545 {
1546 base.c_idJob = EClass.sources.jobs.rows.Where((SourceJob.Row j) => j.playable < 4).RandomItem().id;
1547 }
1548 if (bp.idJob != null)
1549 {
1550 base.c_idJob = bp.idJob;
1551 }
1552 if (bp.idRace != null)
1553 {
1554 base.c_idRace = bp.idRace;
1555 }
1556 }
CardBlueprint bp
Definition: Card.cs:78
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 1558 of file Chara.cs.

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

◆ OnDeserialized()

override void Chara.OnDeserialized ( )
inlineprotectedvirtual

Reimplemented from Card.

Definition at line 1353 of file Chara.cs.

1354 {
1355 isCreated = true;
1356 _cbits1.Bits = (uint)_cints[0];
1357 InitStats(onDeserialize: true);
1358 body.SetOwner(this, deserialized: true);
1359 elements.ApplyElementMap(base.uid, SourceValueType.Chara, job.elementMap, base.DefaultLV);
1360 elements.ApplyElementMap(base.uid, SourceValueType.Chara, race.elementMap, base.DefaultLV);
1361 if (global != null && global.goal != null)
1362 {
1363 global.goal.SetOwner(this);
1364 }
1365 if (IsPCC)
1366 {
1367 pccData.state = (base.isCensored ? PCCState.Naked : PCCState.Normal);
1368 }
1369 if (tempElements != null)
1370 {
1371 tempElements.SetParent(this);
1372 }
1373 UpdateAngle();
1375 Refresh();
1376 if (source.tag.Contains("boss"))
1377 {
1378 bossText = true;
1379 }
1380 sharedCheckTurn = EClass.rnd(200);
1381 }
int sharedCheckTurn
Definition: Chara.cs:120
void UpdateAngle()
Definition: Chara.cs:3649
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 8583 of file Chara.cs.

8584 {
8585 Say("give_erohon", this);
8586 AddCondition<ConParalyze>(50, force: true);
8587 AddCondition<ConConfuse>(50, force: true);
8588 AddCondition<ConFear>(1000, force: true);
8589 ModAffinity(EClass.pc, 100);
8590 t.Destroy();
8591 Talk("pervert");
8592 }

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

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

◆ OnInsulted()

void Chara.OnInsulted ( )
inline

Definition at line 8389 of file Chara.cs.

8390 {
8391 if (!isDead)
8392 {
8393 if (HasElement(1231))
8394 {
8395 Talk("insulted");
8396 AddCondition<ConEuphoric>(100 * Evalue(1231));
8397 }
8398 else if (EClass.rnd(20) == 0)
8399 {
8400 SetFeat(1231, 1, msg: true);
8401 }
8402 }
8403 }

References EClass.rnd().

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

◆ OnSerializing()

override void Chara.OnSerializing ( )
inlineprotectedvirtual

Reimplemented from Card.

Definition at line 1338 of file Chara.cs.

1339 {
1340 if (enemy != null)
1341 {
1342 SetInt(55, enemy.uid);
1343 }
1344 _cints[0] = (int)_cbits1.Bits;
1345 List<BodySlot> slots = body.slots;
1346 rawSlots = new int[slots.Count];
1347 for (int i = 0; i < slots.Count; i++)
1348 {
1349 rawSlots[i] = slots[i].elementId;
1350 }
1351 }
List< BodySlot > slots
Definition: CharaBody.cs:8
int[] rawSlots
Definition: Chara.cs:73
BitArray32 _cbits1
Definition: Chara.cs:84
uint Bits
Definition: BitArray32.cs:6

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

◆ OnSleep() [1/2]

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

Definition at line 9966 of file Chara.cs.

9967 {
9968 if (days < 1)
9969 {
9970 days = 1;
9971 }
9972 int num = power * days;
9973 if (stamina.value < 0)
9974 {
9975 stamina.Set(1);
9976 }
9977 if (isWeakToSunlight && isSunLit)
9978 {
9979 base.hp = 0;
9980 if (mana.value > 0)
9981 {
9982 mana.Set(0);
9983 }
9984 AddCondition<ConBurning>(1000, force: true);
9985 }
9986 else
9987 {
9988 HealHP(num);
9989 stamina.Mod(10 + 25 * num / 100 * (100 + elements.GetFeatRef(1642)) / 100);
9990 mana.Mod(num);
9991 }
9992 if (IsPCFaction)
9993 {
9994 hunger.Mod(20);
9995 }
9996 sleepiness.Set(0);
9997 if (!IsMinion)
9998 {
9999 interest = 100;
10000 }
10001 Cure(CureType.Sleep, power);
10002 }
virtual void HealHP(int a, HealSource origin=HealSource.None)
Definition: Card.cs:4089
bool isWeakToSunlight
Definition: Chara.cs:154
int GetFeatRef(int ele, int idx=0)

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

◆ OnSleep() [2/2]

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

Definition at line 9946 of file Chara.cs.

9947 {
9948 bool isSunLit = pos.IsSunLit;
9949 TraitPillow traitPillow = pos.FindThing<TraitPillow>();
9950 int num = bed?.Power ?? 20;
9951 if (traitPillow != null)
9952 {
9953 num += traitPillow.owner.Power / 2;
9954 }
9955 if (bed != null)
9956 {
9957 num += bed.Evalue(750) * 5;
9958 if (bed.trait is TraitBedCoffin)
9959 {
9960 isSunLit = false;
9961 }
9962 }
9963 OnSleep(num, days, isSunLit);
9964 }
void OnSleep(Thing bed=null, int days=1)
Definition: Chara.cs:9946
Thing FindThing(Func< Thing, bool > func)
Definition: Point.cs:1140

References bed.

Referenced by LayerSleep.Advance().

◆ ParseBodySlot()

int Chara.ParseBodySlot ( string  s)
inlineprivate

Definition at line 2226 of file Chara.cs.

2227 {
2228 return s switch
2229 {
2230 "é ­" => 30,
2231 "首" => 31,
2232 "体" => 32,
2233 "背" => 33,
2234 "手" => 35,
2235 "指" => 36,
2236 "è…•" => 34,
2237 "è…°" => 37,
2238 "è¶³" => 39,
2239 _ => -1,
2240 };
2241 }

Referenced by ApplyRace(), and ResetBody().

◆ PerformWork()

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

Definition at line 9409 of file Chara.cs.

9410 {
9411 Hobby hobby = new Hobby();
9412 hobby.id = session.id;
9413 WorkSummary workSummary = _workSummary;
9414 hobby.GetAI(this).OnPerformWork(IsRealTime);
9415 if (!isHobby)
9416 {
9417 workSummary.progress += EClass.rnd(5) + 5;
9418 }
9419 int num = PerformWork(hobby, 0, isHobby);
9420 int num2 = PerformWork(hobby, 1, isHobby);
9421 int num3 = PerformWork(hobby, 2, isHobby);
9422 int num4 = PerformWork(hobby, 3, isHobby);
9423 workSummary.money += num;
9424 workSummary.food += num2;
9425 workSummary.knowledge += num3;
9426 workSummary.material += num4;
9427 int PerformWork(Hobby work, int idx, bool isHobby)
9428 {
9429 if (idx >= work.source.resources.Length)
9430 {
9431 return 0;
9432 }
9433 int num5 = work.source.resources[idx];
9434 int num6 = num5;
9435 num5 = Rand.Range(num5 * (100 - work.source.resources[idx]) / 100, num5);
9436 num5 = num5 * (isHobby ? 50 : 100) * session.efficiency / 10000;
9437 if (num6 > 0 && num5 <= 0)
9438 {
9439 num5 = 1;
9440 }
9441 return num5;
9442 }
9443 }
virtual void OnPerformWork(bool realtime)
Definition: AIWork.cs:150
void PerformWork(WorkSession session, bool isHobby=false, bool IsRealTime=false)
Definition: Chara.cs:9409
AIWork GetAI(Chara c)
Definition: Hobby.cs:12
static int Range(int min, int max)
Definition: Rand.cs:49
int efficiency
Definition: WorkSession.cs:28

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

◆ Pick()

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

Definition at line 4386 of file Chara.cs.

4387 {
4388 if (t.trait is TraitCard && t.isNew && EClass.game.config.autoCollectCard && !t.c_idRefCard.IsEmpty())
4389 {
4391 return t;
4392 }
4393 if (t.parent == this)
4394 {
4395 return t;
4396 }
4397 t = TryPoisonPotion(t);
4398 ThingContainer.DestData dest = things.GetDest(t, tryStack);
4399 if (!dest.IsValid)
4400 {
4401 if (t.parent != EClass._zone)
4402 {
4403 if (IsPC)
4404 {
4405 Say("backpack_full_drop", t);
4406 SE.Drop();
4407 }
4408 return EClass._zone.AddCard(t, pos).Thing;
4409 }
4410 if (IsPC)
4411 {
4412 Say("backpack_full", t);
4413 }
4414 return t;
4415 }
4416 if (dest.stack != null)
4417 {
4418 if (msg)
4419 {
4420 PlaySound("pick_thing");
4421 Say("pick_thing", this, t);
4422 }
4423 t.TryStackTo(dest.stack);
4424 return dest.stack;
4425 }
4426 TryAbsorbRod(t);
4427 if (msg)
4428 {
4429 PlaySound("pick_thing");
4430 Say("pick_thing", this, t);
4431 }
4433 return dest.container.AddThing(t, tryStack);
4434 }
bool isNew
Definition: Card.cs:483
bool TryStackTo(Thing to)
Definition: Card.cs:3479
string c_idRefCard
Definition: Card.cs:1763
void TryReservePickupTutorial(Thing t)
Definition: Chara.cs:4480
Thing TryPoisonPotion(Thing t)
Definition: Chara.cs:4436
void TryAbsorbRod(Thing t)
Definition: Chara.cs:4450
static void Collect(Thing t)
bool autoCollectCard
Definition: Game.cs:52
DestData GetDest(Thing t, bool tryStack=true)

References EClass._zone, Zone.AddCard(), Card.AddThing(), Game.Config.autoCollectCard, Card.c_idRefCard, ContentCodex.Collect(), Game.config, ThingContainer.DestData.container, EClass.game, Card.isNew, ThingContainer.DestData.IsValid, Card.parent, ThingContainer.DestData.stack, Card.Thing, Card.trait, and Card.TryStackTo().

Referenced by InvOwnerRecycle._OnProcess(), TraitGodStatue._OnUse(), ActPlan._Update(), TraitDrink.BlendLove(), TraitDrink.BlendPoison(), TraitCrafter.Craft(), QuestDeliver.Deliver(), FactionBranch.GetDailyIncome(), FortuneRollData.GetPrize(), TraitDrink.OnBlend(), InvOwner.OnClick(), ContentCodex.OnClickGetCard(), AI_UseCrafter.OnEnd(), AI_Fish.ProgressFish.OnProgressComplete(), ConSleep.OnRemoved(), AM_Blueprint.OnSave(), InvOwner.OnShiftClick(), QuestDebt.OnStart(), QuestDeliver.OnStart(), TraitGiftJure.OnUse(), TraitGiftNewYear.OnUse(), TraitGiftPack.OnUse(), TraitParcel.OnUse(), TraitPlamoBox.OnUse(), TraitPotionEmpty.OnUse(), InvOwnerDeliver.PayBill(), ActDreamBug.Perform(), ActPick.Perform(), ActEffect.Proc(), InvOwner.Transaction.Process(), Map.PutAway(), InvOwner.PutBack(), CoreDebug.Reset_LoytelDebt(), AI_Equip.Run(), AI_Idle.Run(), AI_OpenGambleChest.Run(), AI_Shear.Run(), AI_Steal.Run(), AI_UseCrafter.Run(), TaskCullLife.Run(), ActThrow.Throw(), Recipe.TryGetFirstTimeBonus(), ActRanged.TryReload(), Map.TryShatter(), UIDragGridIngredients.Update(), and CoreDebug.UpdateInput().

◆ PickHeld()

void Chara.PickHeld ( bool  msg = false)
inline

Definition at line 4606 of file Chara.cs.

4607 {
4608 if (held == null)
4609 {
4610 return;
4611 }
4612 Card card = held;
4613 if (IsPC && held.invY == 1)
4614 {
4615 WidgetHotbar.dirtyCurrentItem = true;
4617 held = null;
4618 return;
4619 }
4620 if (held.isChara)
4621 {
4622 DropHeld();
4623 return;
4624 }
4626 {
4627 Say("canOnlyCarry", held);
4628 DropHeld();
4629 return;
4630 }
4631 bool flag = held != things.TryStack(held.Thing);
4632 if (!flag && things.IsOverflowing())
4633 {
4634 if (IsPC)
4635 {
4636 Say("backpack_full_drop", held);
4637 SE.Drop();
4638 }
4639 DropHeld();
4640 return;
4641 }
4642 if (msg)
4643 {
4644 PlaySound("pick_thing");
4645 Say("pick_held", this, card);
4646 if (IsPC && card.id == "statue_weird")
4647 {
4648 Say("statue_pick");
4649 }
4650 }
4651 if (IsPC)
4652 {
4653 WidgetHotbar.dirtyCurrentItem = true;
4654 if (!flag)
4655 {
4657 if (held.GetRootCard() != EClass.pc)
4658 {
4659 Pick(held.Thing, msg: false);
4660 }
4661 }
4662 }
4663 held = null;
4664 }
int invY
Definition: Card.cs:1993
bool IsHotItem
Definition: Card.cs:120
Card DropHeld(Point dropPos=null)
Definition: Chara.cs:4683
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 4366 of file Chara.cs.

4367 {
4368 if (num != 0)
4369 {
4370 PickOrDrop(p, ThingGen.Create(idThing, idMat).SetNum(num), msg);
4371 }
4372 }

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

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

◆ PickOrDrop() [2/2]

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

Definition at line 4374 of file Chara.cs.

4375 {
4376 if (things.GetDest(t).IsValid)
4377 {
4378 Pick(t, msg);
4379 }
4380 else
4381 {
4382 EClass._zone.AddCard(t, p);
4383 }
4384 }

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

◆ Refresh()

void Chara.Refresh ( bool  calledRecursive = false)
inline

Definition at line 1759 of file Chara.cs.

1760 {
1761 if (source == null)
1762 {
1763 Debug.LogError("source is null");
1764 SetSource();
1765 }
1766 if (ride != null && ride.source != null)
1767 {
1768 ride.Refresh(calledRecursive: true);
1769 }
1770 hasTelepathy = false;
1771 isWet = false;
1772 _isLevitating = HasElement(401) || (ride != null && ride._isLevitating);
1774 isWeakToSunlight = HasElement(1251) && !HasElement(431);
1775 base.isHidden = HasElement(415);
1776 foreach (Condition condition in conditions)
1777 {
1778 condition.OnRefresh();
1779 }
1780 if (isWet)
1781 {
1782 base.isHidden = false;
1783 }
1785 SetDirtySpeed();
1786 if (host != null && !calledRecursive && host.source != null)
1787 {
1788 host.Refresh(calledRecursive: true);
1789 }
1790 }
virtual void OnRefresh()
void Refresh(bool calledRecursive=false)
Definition: Chara.cs:1759
bool isWet
Definition: Chara.cs:144
override void SetSource()
Definition: Chara.cs:2115
bool IsUndead
Definition: Chara.cs:905
bool IsHorror
Definition: Chara.cs:929
bool IsMachine
Definition: Chara.cs:917

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

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

◆ RefreshFaithElement()

void Chara.RefreshFaithElement ( )
inline

Definition at line 10427 of file Chara.cs.

10428 {
10429 if (faithElements != null)
10430 {
10432 }
10434 if (idFaith == "eyth" && !HasElement(1228))
10435 {
10436 return;
10437 }
10438 SourceReligion.Row row = EClass.sources.religions.map.TryGetValue(idFaith);
10439 if (row == null)
10440 {
10441 return;
10442 }
10444 if (!HasCondition<ConExcommunication>())
10445 {
10446 SourceElement.Row row2 = EClass.sources.elements.alias.TryGetValue("featGod_" + row.id + "1");
10447 if (row2 != null)
10448 {
10449 faithElements.SetBase(row2.id, 1);
10450 }
10451 int[] array = row.elements;
10452 int num = GetPietyValue() * (120 + Evalue(1407) * 15 + Evalue(1228) * 20) / 100;
10453 for (int i = 0; i < array.Length; i += 2)
10454 {
10455 int num2 = array[i + 1] * num / 50;
10456 if (array[i] == 79)
10457 {
10458 num2 = EClass.curve(num2, array[i + 1] * 2, 10, 50);
10459 }
10460 if (num2 >= 20 && array[i] >= 950 && array[i] < 970)
10461 {
10462 num2 = 20;
10463 }
10464 faithElements.SetBase(array[i], Mathf.Max(num2, 1));
10465 }
10466 }
10468 }
string idFaith
Definition: Chara.cs:233
ElementContainer faithElements
Definition: Chara.cs:38
int GetPietyValue()
Definition: Chara.cs:10418
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 1907 of file Chara.cs.

1908 {
1909 if (currentZone != EClass._zone)
1910 {
1911 dirtySpeed = true;
1912 return;
1913 }
1914 if (ride != null && !ride.IsDeadOrSleeping)
1915 {
1917 _Speed = ride._Speed;
1918 info?.AddText("rideSpeed".lang(_Speed.ToString() ?? ""));
1919 }
1920 else if (host != null)
1921 {
1922 if (host.ride == this)
1923 {
1924 _Speed = Evalue(79);
1925 int a = Evalue(1423);
1926 int value = 100 + (int)_Speed * ((!race.tag.Contains("noRide")) ? 1 : 5) * Mathf.Max(a, 1) - base.STR - host.EvalueRiding() * 2 - (race.tag.Contains("ride") ? 50 : 0);
1927 _Speed = _Speed * 100 / Mathf.Clamp(value, 100, 1000);
1928 }
1929 else
1930 {
1931 _Speed = (Evalue(79) + host.Evalue(79)) / 2;
1932 }
1933 }
1934 else
1935 {
1936 _Speed = Evalue(79) + Evalue(407) / 2;
1937 }
1938 if (body.GetSlot(37, onlyEmpty: false)?.thing != null && HasElement(1209) && !HasElement(419))
1939 {
1940 _Speed -= 25L;
1941 info?.AddText(-25L, EClass.sources.elements.map[1209].GetName());
1942 }
1943 if (parasite != null)
1944 {
1945 long speed = _Speed;
1946 _Speed = _Speed * 100 / Mathf.Clamp(120 + parasite.LV * 2 - base.STR - Evalue(227) * 2, 100, 1000);
1947 info?.AddText(_Speed - speed, "parasiteSpeed".lang());
1948 }
1949 if (_Speed < elements.ValueWithoutLink(79) / 3)
1950 {
1952 info?.AddText("minSpeed".lang((elements.ValueWithoutLink(79) / 3).ToString() ?? ""));
1953 }
1954 int num = 100;
1955 if (EClass._zone.map != null && (EClass._zone.IsUnderwater || (base.Cell.IsTopWaterAndNoSnow && !base.Cell.isFloating)))
1956 {
1957 int num2 = Evalue(200);
1958 int num3 = Evalue(1252);
1959 num = 50 + Mathf.Clamp((int)Mathf.Sqrt(num2) * 5 - EClass._zone.DangerLv / 50, (num3 > 0) ? 50 : ((base.IsPowerful || IsMultisize) ? 40 : 0), 50) + Mathf.Clamp((int)Mathf.Sqrt(num2), 0, 25);
1960 if (info != null && num != 100)
1961 {
1962 info.AddFix(num - 100, EClass.sources.elements.map[200].GetName().ToTitleCase());
1963 }
1964 if (num3 > 0)
1965 {
1966 num += num3 * 20;
1967 info?.AddFix(num3 * 20, EClass.sources.elements.map[1252].GetName().ToTitleCase());
1968 }
1969 }
1970 if (IsPCFaction)
1971 {
1972 switch (burden.GetPhase())
1973 {
1974 case 1:
1975 num -= 10;
1976 info?.AddFix(-10, burden.GetPhaseStr());
1977 break;
1978 case 2:
1979 num -= 20;
1980 info?.AddFix(-20, burden.GetPhaseStr());
1981 break;
1982 case 3:
1983 num -= 30;
1984 info?.AddFix(-30, burden.GetPhaseStr());
1985 break;
1986 case 4:
1987 num -= (IsPC ? 50 : 100);
1988 info?.AddFix(IsPC ? (-50) : (-100), burden.GetPhaseStr());
1989 break;
1990 }
1991 if (IsPC)
1992 {
1993 switch (stamina.GetPhase())
1994 {
1995 case 1:
1996 num -= 10;
1997 info?.AddFix(-10, stamina.GetPhaseStr());
1998 break;
1999 case 0:
2000 num -= 20;
2001 info?.AddFix(-20, stamina.GetPhaseStr());
2002 break;
2003 }
2004 switch (sleepiness.GetPhase())
2005 {
2006 case 2:
2007 num -= 10;
2008 info?.AddFix(-10, sleepiness.GetPhaseStr());
2009 break;
2010 case 3:
2011 num -= 20;
2012 info?.AddFix(-20, sleepiness.GetPhaseStr());
2013 break;
2014 }
2015 switch (hunger.GetPhase())
2016 {
2017 case 3:
2018 case 4:
2019 num -= 10;
2020 info?.AddFix(-10, hunger.GetPhaseStr());
2021 break;
2022 case 5:
2023 num -= 30;
2024 info?.AddFix(-30, hunger.GetPhaseStr());
2025 break;
2026 }
2027 num += EClass.player.lastEmptyAlly * Evalue(1646);
2028 info?.AddFix(EClass.player.lastEmptyAlly * Evalue(1646), EClass.sources.elements.map[1646].GetName());
2029 }
2031 {
2032 num += EClass.player.lastEmptyAlly * 10 - 10;
2033 info?.AddFix(EClass.player.lastEmptyAlly * 10 - 10, "exceedParty".lang());
2034 }
2035 }
2036 else if (base.LV >= 1000 && !EClass.game.principal.disableVoidBlessing && !base.IsPCFactionOrMinion)
2037 {
2038 num += EClass.curve((base.LV - 900) / 100 * 10, 500, 100);
2039 info?.AddFix(EClass.curve((base.LV - 900) / 100 * 10, 500, 100), "enemySpeedBuff".lang());
2040 }
2041 if (HasCondition<ConGravity>())
2042 {
2043 num -= 30;
2044 info?.AddFix(-30, GetCondition<ConGravity>().Name);
2045 }
2046 if (_Speed < 10)
2047 {
2048 _Speed = 10L;
2049 }
2050 _Speed = _Speed * num / 100;
2051 if (_Speed < 10)
2052 {
2053 _Speed = 10L;
2054 info?.AddText("minSpeed".lang(10.ToString() ?? ""));
2055 }
2056 dirtySpeed = false;
2057 }
Thing thing
Definition: BodySlot.cs:8
override string ToString()
Definition: Chara.cs:1198
bool dirtySpeed
Definition: Chara.cs:172
long _Speed
Definition: Chara.cs:174
void AddText(string text, FontColor col=FontColor.Warning)
Definition: ELEMENT.cs:111
void AddFix(int v, string text)
Definition: ELEMENT.cs:132
bool disableVoidBlessing
int lastEmptyAlly
Definition: Player.cs:1263

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

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

◆ RefreshWorkElements()

void Chara.RefreshWorkElements ( ElementContainer  parent = null)
inline

Definition at line 9234 of file Chara.cs.

9235 {
9236 if (workElements != null)
9237 {
9239 }
9240 workElements = null;
9241 if (IsPCParty || homeBranch == null || homeBranch.owner == null)
9242 {
9243 return;
9244 }
9245 foreach (Hobby item in ListHobbies())
9246 {
9247 TryAdd(item);
9248 }
9249 foreach (Hobby item2 in ListWorks())
9250 {
9251 TryAdd(item2);
9252 }
9253 if (workElements != null)
9254 {
9256 }
9257 void TryAdd(Hobby h)
9258 {
9259 if (!h.source.elements.IsEmpty())
9260 {
9261 if (workElements == null)
9262 {
9264 }
9265 for (int i = 0; i < h.source.elements.Length; i += 2)
9266 {
9267 int num = h.source.elements[i];
9268 int num2 = h.source.elements[i + 1];
9269 int num3 = 100;
9270 if (num != 2115 && num != 2207)
9271 {
9272 num3 = h.GetEfficiency(this) * homeBranch.efficiency / 100;
9273 if (num3 <= 0)
9274 {
9275 continue;
9276 }
9277 }
9278 workElements.ModBase(num, (num2 < 0) ? (num2 / 10) : Mathf.Max(1, h.source.elements[i + 1] * num3 / 1000));
9279 }
9280 }
9281 }
9282 }
ElementContainer workElements
Definition: Chara.cs:40
int GetEfficiency(Chara c)
Definition: Hobby.cs:31

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

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

◆ RemoveAllStances()

void Chara.RemoveAllStances ( )
inline

Definition at line 9851 of file Chara.cs.

9852 {
9853 for (int num = conditions.Count - 1; num >= 0; num--)
9854 {
9855 Condition condition = conditions[num];
9856 if (condition.Type == ConditionType.Stance)
9857 {
9858 condition.Kill();
9859 }
9860 }
9861 }

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

Referenced by CharaGenes.Remove().

◆ RemoveCondition< T >()

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

Definition at line 9702 of file Chara.cs.

9702 : Condition
9703 {
9704 for (int num = conditions.Count - 1; num >= 0; num--)
9705 {
9706 if (conditions[num] is T)
9707 {
9708 conditions[num].Kill();
9709 break;
9710 }
9711 }
9712 }

References Condition.Kill().

◆ RemoveGlobal()

void Chara.RemoveGlobal ( )
inline

◆ RemoveLastBodyPart()

void Chara.RemoveLastBodyPart ( bool  msg = false)
inline

Definition at line 2254 of file Chara.cs.

2255 {
2256 if (body.slots.Count != 0)
2257 {
2258 BodySlot bodySlot = body.slots.LastItem();
2259 body.RemoveBodyPartAt(body.slots.Count - 1);
2260 if (msg)
2261 {
2262 Say("lose_bodyparts", this, Element.Get(bodySlot.elementId).GetName().ToLower());
2263 PlaySound("offering");
2264 }
2265 }
2266 }
int elementId
Definition: BodySlot.cs:6
void RemoveBodyPartAt(int idx)
Definition: CharaBody.cs:344

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

Referenced by TraitFoodEggFertilized.Incubate().

◆ RequestProtection()

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

Definition at line 8604 of file Chara.cs.

8605 {
8606 if (HasCondition<StanceTaunt>() || base.isRestrained || attacker == this)
8607 {
8608 return false;
8609 }
8610 if (host != null && host.isRestrained)
8611 {
8612 return false;
8613 }
8614 if (base.IsPCFactionOrMinion && attacker.IsPCFactionOrMinion)
8615 {
8616 return false;
8617 }
8618 bool flag = false;
8619 foreach (Chara chara in EClass._map.charas)
8620 {
8621 if (chara == attacker || chara.enemy == this || chara == this || chara.host != null || chara.IsDisabled || !chara.IsFriendOrAbove(this) || chara.conSuspend != null || (chara.IsPCParty && !IsPCParty) || (IsPCFaction && !chara.IsPCFaction) || (attacker.IsPCFactionOrMinion && chara.IsPCFactionOrMinion))
8622 {
8623 continue;
8624 }
8625 bool flag2 = chara.HasElement(1225) && !chara.GetBool(126);
8626 if ((!flag2 && (flag || EClass.rnd(2) == 0 || !chara.HasCondition<StanceTaunt>())) || chara.HasCooldown(1225))
8627 {
8628 continue;
8629 }
8630 int num = Mathf.Max(chara.Evalue(1649), (!chara.IsPC) ? ((!flag2) ? 1 : 3) : 0);
8631 int num2 = Dist(chara);
8632 if (num2 > 25)
8633 {
8634 continue;
8635 }
8636 if (num2 > num || !chara.CanSeeLos(pos, num2))
8637 {
8638 if (!flag2)
8639 {
8640 continue;
8641 }
8642 Point nearestPoint = pos.GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: true, ignoreCenter: true);
8643 if (!nearestPoint.IsValid)
8644 {
8645 continue;
8646 }
8647 chara.Teleport(nearestPoint);
8648 chara.AddCooldown(1225, 10);
8649 num2 = Dist(chara);
8650 Say("intercept_loyal", chara, this);
8651 chara.SetEnemy(attacker);
8652 attacker.SetEnemy(chara);
8653 if (num2 > num || !chara.CanSeeLos(pos, num2))
8654 {
8655 continue;
8656 }
8657 }
8658 if (!flag && !HasElement(1225))
8659 {
8660 Say("intercept", chara, this);
8661 if (EClass.rnd(10) == 0)
8662 {
8663 chara.Talk("intercept", base.NameSimple);
8664 }
8665 if (attacker.enemy == this)
8666 {
8667 attacker.SetEnemy(chara);
8668 }
8669 action(chara);
8670 flag = true;
8671 }
8672 }
8673 return flag;
8674 }
void Teleport(Point point, bool silent=false, bool force=false)
Definition: Card.cs:6009
ConSuspend conSuspend
Definition: Chara.cs:104
void AddCooldown(int idEle, int turns=0)
Definition: Chara.cs:8885
bool HasCooldown(int idEle)
Definition: Chara.cs:8936

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

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

◆ RerollHobby()

void Chara.RerollHobby ( bool  extraSlotChance = true)
inline

Definition at line 9328 of file Chara.cs.

9329 {
9330 if (_hobbies != null && _works != null)
9331 {
9332 _hobbies.Clear();
9333 _works.Clear();
9334 }
9335 else
9336 {
9337 _hobbies = new List<int>();
9338 _works = new List<int>();
9339 }
9340 if (source.hobbies.IsEmpty())
9341 {
9342 AddHobby(EClass.sources.hobbies.listHobbies.RandomItem().id);
9343 }
9344 else
9345 {
9346 string[] hobbies = source.hobbies;
9347 foreach (string key in hobbies)
9348 {
9349 AddHobby(EClass.sources.hobbies.alias[key].id);
9350 }
9351 }
9352 if (source.works.IsEmpty())
9353 {
9354 AddWork(EClass.sources.hobbies.listWorks.RandomItem().id);
9355 }
9356 else
9357 {
9358 string[] hobbies = source.works;
9359 foreach (string key2 in hobbies)
9360 {
9361 AddWork(EClass.sources.hobbies.alias[key2].id);
9362 }
9363 }
9365 }
WorkSummary GetWorkSummary()
Definition: Chara.cs:9367
void AddWork(int id)
Definition: Chara.cs:9316
void AddHobby(int id)
Definition: Chara.cs:9304
List< Row > listWorks
Definition: SourceHobby.cs:64
List< Row > listHobbies
Definition: SourceHobby.cs:61
void Reset()
Definition: WorkSummary.cs:78

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

Referenced by OnCreate().

◆ ResetBody()

void Chara.ResetBody ( )
inline

Definition at line 2268 of file Chara.cs.

2269 {
2270 for (int num = body.slots.Count - 1; num >= 0; num--)
2271 {
2272 BodySlot bodySlot = body.slots[num];
2273 if (bodySlot.elementId == 45 || bodySlot.elementId == 40)
2274 {
2275 return;
2276 }
2277 body.RemoveBodyPart(num);
2278 }
2279 string[] array = race.figure.Split('|');
2280 foreach (string s in array)
2281 {
2282 int num2 = ParseBodySlot(s);
2283 if (num2 != -1)
2284 {
2285 body.AddBodyPart(num2);
2286 }
2287 }
2289 }

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

◆ ResetUpgrade()

void Chara.ResetUpgrade ( )
inline

Definition at line 8770 of file Chara.cs.

8771 {
8772 _ = base.c_upgrades;
8773 }

Referenced by CoreDebug.ResetPetUpgrades().

◆ ResistCon()

void Chara.ResistCon ( Condition  con)
inline

Definition at line 9908 of file Chara.cs.

9909 {
9910 if (con.power > 0 && resistCon != null)
9911 {
9912 int a = ClassExtension.TryGetValue<int, int>((IDictionary<int, int>)resistCon, con.id, 0);
9913 if (1000 < EClass.rnd(a))
9914 {
9915 con.power = 0;
9916 }
9917 else if (500 < EClass.rnd(a))
9918 {
9919 con.power /= 5;
9920 }
9921 else if (200 < EClass.rnd(a))
9922 {
9923 con.power /= 3;
9924 }
9925 else if (100 < EClass.rnd(a))
9926 {
9927 con.power /= 2;
9928 }
9929 }
9930 }

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

◆ RestockEquip()

void Chara.RestockEquip ( bool  onCreate)
inline

Definition at line 4775 of file Chara.cs.

4776 {
4777 string equip = source.equip;
4778 if (equip.IsEmpty())
4779 {
4780 equip = job.equip;
4781 }
4782 if (equip == "none")
4783 {
4784 return;
4785 }
4786 bool flag = true;
4787 switch (id)
4788 {
4789 case "kettle":
4790 case "quru":
4791 case "loytel":
4792 case "shojo":
4793 EQ_ID("staff_long", 1);
4794 EQ_CAT("head");
4795 EQ_CAT("torso");
4796 EQ_CAT("arm");
4797 return;
4798 case "adv_yukiimo":
4799 if (onCreate)
4800 {
4801 EQ_ID("tail_snowleopard");
4802 }
4803 break;
4804 case "adv_kiria":
4805 if (onCreate)
4806 {
4807 EQ_ID("sword_zephir");
4808 }
4809 break;
4810 case "adv_mesherada":
4811 if (onCreate)
4812 {
4813 EQ_ID("dagger_hathaway");
4814 }
4815 break;
4816 case "adv_verna":
4817 if (onCreate)
4818 {
4819 EQ_ID("staff_long", -1, Rarity.Legendary);
4820 }
4821 if (onCreate)
4822 {
4823 EQ_ID("cloak_wing", -1, Rarity.Mythical);
4824 }
4825 break;
4826 case "big_sister":
4827 if (onCreate)
4828 {
4829 EQ_ID("sword_muramasa");
4830 }
4831 break;
4832 case "adv_gaki":
4833 if (onCreate)
4834 {
4835 EQ_ID("dagger_gaki");
4836 }
4837 if (onCreate)
4838 {
4839 EQ_ID("dagger_ninto");
4840 }
4841 break;
4842 case "adv_ivory":
4843 EQ_ID("dagger", -1, Rarity.Legendary);
4844 AddThing("60");
4845 break;
4846 case "adv_wini":
4847 if (onCreate)
4848 {
4849 EQ_ID("staff_Cat", -1, Rarity.Mythical);
4850 }
4852 if (onCreate)
4853 {
4854 AddThing("1071");
4855 }
4856 break;
4857 case "namamani":
4858 if (onCreate)
4859 {
4860 AddThing("gun_gravity2");
4861 }
4862 break;
4863 case "lomias":
4864 if (onCreate)
4865 {
4866 AddThing("bow_vindale");
4867 }
4868 break;
4869 case "larnneire":
4870 if (onCreate)
4871 {
4872 EQ_ID("EtherDagger2");
4873 }
4874 break;
4875 case "keeper_garden":
4876 if (!body.HasWeapon())
4877 {
4878 EQ_ID("sword_ragnarok");
4879 }
4880 break;
4881 case "ungaga_pap":
4882 if (onCreate)
4883 {
4884 EQ_ID("axe_destruction");
4885 }
4886 break;
4887 case "lurie_boss":
4888 if (onCreate)
4889 {
4890 EQ_ID("ribbon_duponne");
4891 }
4892 break;
4893 case "seeker":
4894 if (onCreate)
4895 {
4896 EQ_ID("helm_seeker");
4897 }
4898 EQ_ID("robe_pope");
4899 EQ_ID("sword_katana");
4900 EQ_ID("staff");
4901 EQ_ID("sword_katana");
4902 if (onCreate)
4903 {
4904 EQ_ID("boots_seven");
4905 }
4906 if (onCreate)
4907 {
4908 for (int i = 0; i < 20; i++)
4909 {
4911 }
4912 EQ_Item("panty");
4913 AddThing("plat").SetNum(6);
4914 }
4915 break;
4916 case "ephrond":
4917 if (onCreate)
4918 {
4919 AddThing("guitar_efrond");
4920 }
4921 break;
4922 case "ashland":
4923 if (onCreate)
4924 {
4925 AddThing("guitar_ash");
4926 }
4927 break;
4928 case "swordkeeper":
4929 if (onCreate)
4930 {
4931 EQ_ID("EtherDagger");
4932 }
4933 break;
4934 case "mech_angel":
4935 if (onCreate)
4936 {
4937 Thing thing = ThingGen.Create("pole_holy");
4938 thing.SetReplica(on: true);
4939 thing.rarity = Rarity.Normal;
4940 thing.elements.SetTo(60, -15);
4941 thing.elements.SetTo(418, -100);
4942 thing.elements.SetTo(93, 50);
4943 AddThing(thing);
4944 body.Equip(thing);
4945 flag = false;
4946 }
4947 break;
4948 case "azzrasizzle":
4949 if (onCreate)
4950 {
4951 EQ_ID("staff_magius");
4952 }
4953 break;
4954 case "sorin":
4955 if (onCreate)
4956 {
4957 EQ_ID("staff_insanity");
4958 }
4959 break;
4960 case "robot":
4961 if (onCreate)
4962 {
4963 EQ_ID("sword_katana");
4964 }
4965 break;
4966 case "mimu":
4967 if (onCreate)
4968 {
4969 EQ_ID("staff_leek");
4970 }
4971 break;
4972 case "kumatan":
4973 if (onCreate)
4974 {
4975 EQ_ID("dagger_hocho");
4976 }
4977 break;
4978 case "mad_rich":
4979 if (onCreate)
4980 {
4981 int a = (EClass._zone.IsUserZone ? 200 : EClass.rndHalf(100 + (EClass.debug.enable ? 10 : EClass._zone.influence) * 50 + (int)Mathf.Sqrt(EClass._zone.DangerLv) * 100 + (int)Mathf.Sqrt(EClass.pc.FameLv) * 100 + EClass._zone.development * 10));
4982 ModCurrency(a);
4983 }
4984 break;
4985 }
4986 if (!TryEquipRanged())
4987 {
4988 switch (id)
4989 {
4990 case "tyche":
4991 case "trooper":
4992 case "mech_scarab":
4993 AddThing("gun_laser");
4994 break;
4995 case "rocketman":
4996 {
4997 Thing thing2 = AddThing("panzerfaust");
4998 thing2.ChangeMaterial("iron");
4999 thing2.c_ammo = 0;
5000 break;
5001 }
5002 default:
5003 switch (equip)
5004 {
5005 case "archer":
5006 EQ_CAT((EClass.rnd(4) == 0) ? "crossbow" : "bow");
5007 break;
5008 case "inquisitor":
5009 case "gunner":
5010 EQ_CAT("gun");
5011 break;
5012 }
5013 break;
5014 }
5015 }
5016 int num = ((base.rarity >= Rarity.Mythical) ? (base.LV * 3) : ((base.rarity >= Rarity.Legendary) ? (base.LV * 2) : base.LV));
5017 if (trait is TraitAdventurer)
5018 {
5019 num *= 3;
5020 }
5021 if (race.id == "asura")
5022 {
5023 for (int j = 0; j < 4; j++)
5024 {
5025 EQ_CAT(job.weapon.RandomItem());
5026 }
5027 }
5028 for (int k = 0; k < ((!(race.id == "mutant")) ? 1 : (2 + base.LV / 30)); k++)
5029 {
5030 if (flag)
5031 {
5032 if (source.ContainsTag("boxer"))
5033 {
5034 EQ_CAT("martial");
5035 }
5036 else if (!job.weapon.IsEmpty())
5037 {
5038 if (race.id == "mutant" || (body.slotMainHand != null && body.slotMainHand.thing == null))
5039 {
5040 EQ_CAT(job.weapon.RandomItem());
5041 }
5042 if (race.id == "mutant" || (Evalue(131) > 0 && EClass.rnd(2) == 0))
5043 {
5044 EQ_CAT(job.weapon.RandomItem());
5045 }
5046 }
5047 }
5048 EQ_CAT("torso");
5049 if (EClass.rnd(num) > 5)
5050 {
5051 EQ_CAT("arm");
5052 }
5053 if (EClass.rnd(num) > 10)
5054 {
5055 EQ_CAT("head");
5056 }
5057 if (EClass.rnd(num) > 15)
5058 {
5059 EQ_CAT("back");
5060 }
5061 if (EClass.rnd(num) > 20)
5062 {
5063 EQ_CAT("ring");
5064 }
5065 if (EClass.rnd(num) > 25)
5066 {
5067 EQ_CAT("amulet");
5068 }
5069 if (EClass.rnd(num) > 30)
5070 {
5071 EQ_CAT("foot");
5072 }
5073 if (EClass.rnd(num) > 35)
5074 {
5075 EQ_CAT("waist");
5076 }
5077 if (EClass.rnd(num) > 40)
5078 {
5079 EQ_CAT("ring");
5080 }
5081 }
5082 if (trait is TraitBard)
5083 {
5084 AddThing(ThingGen.Create("lute"));
5085 if (EClass.debug.enable || EClass.rnd(100) == 0)
5086 {
5087 EQ_ID("shield_lute");
5088 }
5089 }
5090 if (HasTag(CTAG.shield))
5091 {
5092 EQ_CAT("shield");
5093 }
5094 }
int FameLv
Definition: Card.cs:2338
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
Definition: Card.cs:3117
Card AddCard(Card c)
Definition: Card.cs:3166
void SetReplica(bool on)
Definition: Card.cs:3151
bool HasWeapon()
Definition: CharaBody.cs:400
BodySlot slotMainHand
Definition: CharaBody.cs:10
void EQ_Item(string s, int num=1)
Definition: Chara.cs:5204
Thing EQ_ID(string s, int mat=-1, Rarity r=Rarity.Random)
Definition: Chara.cs:5168
bool TryEquipRanged()
Definition: Chara.cs:8047
void EQ_CAT(string s)
Definition: Chara.cs:5188
void SetTo(int id, int v)
int development
Definition: Spatial.cs:238
int influence
Definition: Spatial.cs:214
static Thing CreateSpellbook(string alias, int num=1)
Definition: ThingGen.cs:151

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

Referenced by CoreDebug.QuickStart().

◆ RestockInventory()

void Chara.RestockInventory ( bool  onCreate)
inline

Definition at line 5096 of file Chara.cs.

5097 {
5098 switch (id)
5099 {
5100 case "lomias":
5101 if (ShouldRestock("_meat"))
5102 {
5103 AddCard(ThingGen.Create("_meat").MakeRefFrom("begger"));
5104 }
5105 break;
5106 case "fiama":
5107 Restock("book_story", 1);
5108 break;
5109 case "rock_thrower":
5110 Restock("stone", 10 + EClass.rnd(10));
5111 break;
5112 case "giant":
5113 Restock("rock", 2 + EClass.rnd(10));
5114 break;
5115 case "farris":
5116 Restock("lute", 1);
5117 Restock("book_story_home", 1);
5118 break;
5119 case "begger":
5120 break;
5121 }
5122 void Restock(string id, int num)
5123 {
5124 if (ShouldRestock(id))
5125 {
5126 AddCard(ThingGen.Create(id).SetNum(num));
5127 }
5128 }
5129 bool ShouldRestock(string id)
5130 {
5131 return things.Find(id) == null;
5132 }
5133 }

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

◆ Revive()

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

Definition at line 5248 of file Chara.cs.

5249 {
5250 if (!isDead)
5251 {
5252 return;
5253 }
5254 isDead = false;
5255 base.hp = MaxHP / 3;
5256 mana.value = 0;
5257 stamina.value = 0;
5258 if (hunger.value > 30)
5259 {
5260 hunger.value = 30;
5261 }
5262 sleepiness.value = 0;
5264 RemoveCondition<StanceTaunt>();
5265 if (id == "keeper_garden")
5266 {
5267 SaiyanRevive();
5268 }
5269 if (IsPC)
5270 {
5272 {
5273 Msg.Say("noDeathPenalty2", this);
5274 }
5276 {
5277 Msg.Say("noDeathPenalty", this);
5278 }
5279 else
5280 {
5282 }
5283 List<Thing> dropList = new List<Thing>();
5284 EClass.pc.things.Foreach(delegate(Thing t)
5285 {
5287 {
5288 t.ignoreAutoPick = true;
5289 dropList.Add(t);
5290 }
5291 }, onlyAccessible: false);
5292 foreach (Thing item in dropList)
5293 {
5295 Msg.Say("backpack_full_drop", item);
5296 }
5297 EClass.player.preventDeathPenalty = false;
5298 }
5299 if (IsPCFaction && homeBranch != null)
5300 {
5301 homeBranch.Log("bRevive", this);
5302 }
5303 if (p != null)
5304 {
5305 if (!p.IsInBounds)
5306 {
5308 }
5309 EClass._zone.AddCard(this, p);
5310 if (msg)
5311 {
5312 SE.Play("revive");
5313 Msg.Say("revive", this);
5314 PlayEffect("revive");
5315 }
5316 SetCensored(enable: false);
5317 }
5318 }
void SetCensored(bool enable)
Definition: Card.cs:8028
Card parentCard
Definition: Card.cs:104
void SaiyanRevive()
Definition: Chara.cs:5320
void ApplyDeathPenalty()
Definition: Chara.cs:5354
bool disableDeathPenaltyProtection
Point GetCenterPos()
Definition: MapBounds.cs:52
int days
Definition: Player.cs:75
bool preventDeathPenalty
Definition: Player.cs:1237
void Foreach(Action< Thing > action, bool onlyAccessible=true)
override int SelfWeight
Definition: Thing.cs:64

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

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

◆ Rotate()

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

Reimplemented from Card.

Definition at line 3588 of file Chara.cs.

3589 {
3590 if (renderer.hasActor)
3591 {
3592 base.dir = (base.dir + ((!reverse) ? 1 : (-1))).Clamp(0, 3, loop: true);
3593 }
3594 else
3595 {
3596 base.dir = ((base.dir == 0) ? 1 : 0);
3597 }
3598 UpdateAngle();
3600 }

Referenced by AI_Dance.Run().

◆ SaiyanRevive()

void Chara.SaiyanRevive ( )
inline

Definition at line 5320 of file Chara.cs.

5321 {
5322 ModCorruption(-100000);
5323 if (base.LV < 10000000)
5324 {
5325 SetLv(base.LV * 10 + 9);
5326 }
5327 Refresh();
5328 base.hp = MaxHP;
5329 mana.value = mana.max;
5330 stamina.value = stamina.max;
5331 bossText = true;
5332 }
void ModCorruption(int a)
Definition: Chara.cs:10055

References Stats.max, and Refresh().

◆ ScaleByPrincipal()

Chara Chara.ScaleByPrincipal ( )
inline

◆ SetAI()

AIAct Chara.SetAI ( AIAct  g)
inline

Definition at line 9104 of file Chara.cs.

9105 {
9106 if (IsPC)
9107 {
9109 }
9110 if (ai.IsRunning)
9111 {
9112 if (ai == g && ai.IsNoGoal)
9113 {
9114 return g;
9115 }
9116 ai.Cancel();
9117 if (ai == g)
9118 {
9119 Debug.Log("goal is g:" + ai?.ToString() + "/" + this);
9120 return g;
9121 }
9122 }
9123 if (HasCondition<ConWait>())
9124 {
9125 RemoveCondition<ConWait>();
9126 }
9127 ai = g;
9128 ai.SetOwner(this);
9129 if (IsPC)
9130 {
9132 }
9133 return g;
9134 }
virtual bool IsNoGoal
Definition: AIAct.cs:74
void SetOwner(Chara c)
Definition: AIAct.cs:189
QueueManager queues
Definition: Player.cs:1281
void OnSetGoal(AIAct newGoal)
Definition: QueueManager.cs:23

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

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

◆ SetAIAggro()

void Chara.SetAIAggro ( )
inline

Definition at line 9094 of file Chara.cs.

9095 {
9096 SetAI(new GoalCombat());
9097 }

Referenced by ZoneEventQuest.AggroEnemy().

◆ SetAIIdle()

void Chara.SetAIIdle ( )
inline

Definition at line 9090 of file Chara.cs.

9091 {
9092 }

◆ SetAIImmediate()

void Chara.SetAIImmediate ( AIAct  g)
inline

◆ SetCooldown()

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

Definition at line 8903 of file Chara.cs.

8904 {
8905 if (_cooldowns == null)
8906 {
8907 _cooldowns = new List<int>();
8908 }
8909 bool flag = false;
8910 for (int i = 0; i < _cooldowns.Count; i++)
8911 {
8912 if (_cooldowns[i] / 1000 == idEle)
8913 {
8914 if (turns == 0)
8915 {
8916 _cooldowns.RemoveAt(i);
8917 }
8918 else
8919 {
8920 _cooldowns[i] = idEle * 1000 + turns;
8921 }
8922 flag = true;
8923 break;
8924 }
8925 }
8926 if (!flag && turns > 0)
8927 {
8928 AddCooldown(idEle, turns);
8929 }
8930 if (_cooldowns.Count == 0)
8931 {
8932 _cooldowns = null;
8933 }
8934 }

Referenced by ConTransmuteBat.OnRemoved().

◆ SetDir()

override void Chara.SetDir ( int  d)
inlinevirtual

Reimplemented from Card.

Definition at line 3581 of file Chara.cs.

3582 {
3583 base.dir = d;
3584 UpdateAngle();
3586 }

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

◆ SetDirtySpeed()

void Chara.SetDirtySpeed ( )
inline

Definition at line 1898 of file Chara.cs.

1899 {
1900 dirtySpeed = true;
1901 if (host != null)
1902 {
1904 }
1905 }

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

6448 {
6449 enemy = c;
6450 if (c == null)
6451 {
6452 if (ai is GoalCombat)
6453 {
6454 ai.Cancel();
6455 }
6456 }
6457 else
6458 {
6459 calmCheckTurn = 10 + EClass.rnd(30);
6460 }
6461 return c;
6462 }

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

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

◆ SetEQQuality()

void Chara.SetEQQuality ( )
inlineprivate

Definition at line 5135 of file Chara.cs.

5136 {
5138 Rarity rarity = Rarity.Normal;
5139 int num = ((base.LV >= 1000) ? 7 : ((base.LV >= 500) ? 5 : ((base.LV >= 250) ? 3 : ((base.LV >= 100) ? 2 : ((base.LV >= 50) ? 1 : 0)))));
5140 Rarity rarity2 = base.rarity;
5141 if (id == "big_sister")
5142 {
5143 num = (isOnCreate ? 8 : 4);
5144 }
5145 if (!isOnCreate && EClass.rnd(10) != 0)
5146 {
5147 num /= 2;
5148 }
5149 if (rarity2 == Rarity.Superior && EClass.rnd(10) <= num)
5150 {
5151 rarity = Rarity.Superior;
5152 }
5153 else if (rarity2 == Rarity.Legendary)
5154 {
5155 rarity = ((EClass.rnd(10) <= num) ? Rarity.Legendary : ((EClass.rnd(5) <= num) ? Rarity.Superior : Rarity.Normal));
5156 }
5157 else if (rarity2 >= Rarity.Mythical)
5158 {
5159 rarity = ((EClass.rnd(30) <= num) ? Rarity.Mythical : ((EClass.rnd(10) > num) ? Rarity.Superior : Rarity.Legendary));
5160 }
5161 if (rarity == Rarity.Normal && EClass.rnd(1000) == 0)
5162 {
5163 rarity = Rarity.Legendary;
5164 }
5165 CardBlueprint.current.rarity = rarity;
5166 }
static void Set(CardBlueprint _bp=null)
static CardBlueprint CharaGenEQ
static bool isOnCreate
Definition: Chara.cs:186

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

◆ SetFaction()

Chara Chara.SetFaction ( Faction  f)
inline

Definition at line 1453 of file Chara.cs.

1454 {
1455 _faction = null;
1456 faction = f;
1458 return this;
1459 }
Faction _faction
Definition: Chara.cs:158
Hostility GetHostility()
Definition: FACTION.cs:255

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

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

◆ SetFaith() [1/2]

void Chara.SetFaith ( Religion  r)
inline

Definition at line 1744 of file Chara.cs.

1745 {
1746 faith = r;
1748 }

References faith, and RefreshFaithElement().

◆ SetFaith() [2/2]

void Chara.SetFaith ( string  id)
inline

Definition at line 1739 of file Chara.cs.

1740 {
1742 }
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 10113 of file Chara.cs.

10114 {
10115 Feat feat = elements.GetElement(id) as Feat;
10116 int num = 0;
10117 if (feat != null && feat.Value > 0)
10118 {
10119 if (value == feat.Value)
10120 {
10121 return;
10122 }
10123 num = feat.Value;
10124 feat.Apply(-feat.Value, elements);
10125 }
10126 feat = elements.SetBase(id, value - (feat?.vSource ?? 0)) as Feat;
10127 if (feat.Value != 0)
10128 {
10129 feat.Apply(feat.Value, elements);
10130 }
10132 {
10133 Refresh();
10135 }
10136 if (!msg)
10137 {
10138 return;
10139 }
10140 if (feat.source.textInc.IsEmpty())
10141 {
10142 PlaySound("ding_skill");
10144 Say("gainFeat", this, feat.FullName);
10145 }
10146 else
10147 {
10148 bool flag = value < num;
10149 if (feat.source.tag.Contains("neg"))
10150 {
10151 flag = !flag;
10152 }
10153 switch (id)
10154 {
10155 case 1270:
10156 if (!flag)
10157 {
10158 PlaySound("chime_angel");
10159 }
10160 break;
10161 case 1271:
10162 if (!flag)
10163 {
10164 PlaySound("chime_devil");
10165 }
10166 break;
10167 default:
10168 PlaySound("mutation");
10169 break;
10170 }
10172 Say((value > num) ? feat.source.GetText("textInc") : feat.source.GetText("textDec"), this, feat.FullName);
10173 }
10175 }
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 Card._OnDeserialized(), LayerWorldSetting.Apply(), DNA.Apply(), ApplyEditorTags(), ApplyRace(), AI_Fuck.Finish(), Card.LevelUp(), TraitFoodEggFertilized.MakeBaby(), Zone_Casino.OnActivate(), OnCreate(), TraitDrinkMilkMother.OnDrink(), ConSleep.OnRemoved(), FoodEffect.Proc(), CoreDebug.SetElement(), DramaOutcome.upgrade_miscreation(), and DramaOutcome.wedding_setup().

◆ SetGlobal() [1/2]

Chara Chara.SetGlobal ( )
inline

Definition at line 1520 of file Chara.cs.

1521 {
1522 if (!IsGlobal)
1523 {
1525 global = new GlobalData();
1526 base.isSubsetCard = false;
1527 enemy = null;
1528 base.c_uidMaster = 0;
1529 }
1530 return this;
1531 }

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

1506 {
1507 SetGlobal();
1508 homeZone = _home;
1509 _home.AddCard(this, x, z);
1510 global.transition = new ZoneTransition
1511 {
1512 state = ZoneTransition.EnterState.Exact,
1513 x = x,
1514 z = z
1515 };
1516 orgPos = new Point(x, z);
1517 return this;
1518 }

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

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

◆ SetHomeZone()

Chara Chara.SetHomeZone ( Zone  zone)
inline

Definition at line 1461 of file Chara.cs.

1462 {
1463 homeZone = zone;
1464 SetGlobal();
1465 return this;
1466 }

References homeZone, and SetGlobal().

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

◆ SetHostility()

Chara Chara.SetHostility ( Hostility  h)
inline

Definition at line 1468 of file Chara.cs.

1469 {
1470 Hostility hostility2 = (base.c_originalHostility = h);
1471 this.hostility = hostility2;
1472 return this;
1473 }

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

◆ SetMainElement() [1/2]

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

Definition at line 2136 of file Chara.cs.

2137 {
2138 if (base.c_idMainElement != 0)
2139 {
2140 SetElements(base.c_idMainElement, remove: true);
2141 base.c_idMainElement = 0;
2142 }
2143 if (id != 0)
2144 {
2145 _ = EClass.sources.elements.map[id];
2146 SetElements(id, remove: false);
2147 base.c_idMainElement = id;
2148 if (elemental)
2149 {
2150 base.isElemental = true;
2151 _colorInt = 0;
2152 Color colorSprite = EClass.setting.elements[MainElement.source.alias].colorSprite;
2153 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);
2154 }
2155 _ability = null;
2156 }
2157 void SetElements(int idEle, bool remove)
2158 {
2159 elements.SetBase(idEle, (!remove) ? ((v == 0) ? 10 : v) : 0);
2160 elements.ModBase(EClass.sources.elements.alias[EClass.sources.elements.map[idEle].aliasRef].id, remove ? (-20) : 20);
2161 switch (idEle)
2162 {
2163 case 910:
2164 elements.ModBase(951, remove ? 10 : (-10));
2165 break;
2166 case 911:
2167 elements.ModBase(950, remove ? 10 : (-10));
2168 break;
2169 case 912:
2170 elements.ModBase(953, remove ? 10 : (-10));
2171 break;
2172 case 913:
2173 elements.ModBase(952, remove ? 10 : (-10));
2174 break;
2175 case 916:
2176 elements.ModBase(960, remove ? 10 : (-10));
2177 break;
2178 case 919:
2179 elements.ModBase(956, remove ? 10 : (-10));
2180 break;
2181 case 925:
2182 elements.ModBase(962, remove ? 10 : (-10));
2183 break;
2184 case 922:
2185 elements.ModBase(965, remove ? 10 : (-10));
2186 break;
2187 case 921:
2188 elements.ModBase(971, remove ? 10 : (-10));
2189 break;
2190 case 926:
2191 elements.ModBase(961, remove ? 10 : (-10));
2192 break;
2193 case 914:
2194 case 915:
2195 case 917:
2196 case 918:
2197 case 920:
2198 case 923:
2199 case 924:
2200 break;
2201 }
2202 }
2203 }
int _colorInt
Definition: Card.cs:68
CharaAbility _ability
Definition: Chara.cs:96
UD_String_ElementRef elements
Definition: GameSetting.cs:315

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

◆ SetMainElement() [2/2]

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

Definition at line 2127 of file Chara.cs.

2128 {
2129 if (!id.StartsWith("ele"))
2130 {
2131 id = "ele" + id;
2132 }
2133 SetMainElement(EClass.sources.elements.alias[id].id, v, elemental);
2134 }

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

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

◆ SetMutation()

void Chara.SetMutation ( int  idEle,
int  a = 0 
)
inline

Definition at line 10177 of file Chara.cs.

10178 {
10179 SourceElement.Row row = EClass.sources.elements.map[idEle];
10181 Element element = elements.GetElement(idEle);
10182 Element element2 = elements.GetElement(row2.id);
10183 int num = element?.Value ?? 0;
10184 if (a < 0)
10185 {
10186 a = 0;
10187 }
10188 if (a > row.max)
10189 {
10190 a = row.max;
10191 }
10192 bool flag = (row.tag.Contains("neg") ? (a > num) : (a < num));
10193 if (a == 0 && (element == null || element.Value == 0))
10194 {
10196 return;
10197 }
10198 if (element != null && element.Value == a)
10199 {
10201 return;
10202 }
10203 if (element2 != null && element2.Value > 0)
10204 {
10205 SetFeat(element2.id, 0);
10206 }
10207 SetFeat(idEle, a);
10208 PlaySound("mutation");
10209 PlayEffect("mutation");
10211 Say(row.GetText(flag ? "textDec" : "textInc", returnNull: true) ?? row.alias, this);
10212 }

References SourceElement.Row.alias, SourceElement.Row.aliasParent, Msg.colors, SourceManager.elements, Element.id, SourceElement.Row.id, SourceElement.Row.max, MsgColors.MutateBad, MsgColors.MutateGood, Msg.SetColor(), EClass.sources, SourceElement.Row.tag, and Element.Value.

◆ SetNoGoal()

AIAct Chara.SetNoGoal ( )
inline

Definition at line 9099 of file Chara.cs.

9100 {
9101 return SetAI(_NoGoalPC);
9102 }
static NoGoal _NoGoalPC
Definition: Chara.cs:198

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

◆ SetPCCState()

void Chara.SetPCCState ( PCCState  state)
inline

Definition at line 6835 of file Chara.cs.

6836 {
6837 if (IsPCC)
6838 {
6839 PCC.Get(pccData).Build(state);
6840 }
6841 }

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

6894 {
6895 p.mat = base.material;
6896 p.matColor = base.colorInt;
6897 if (!renderer.usePass)
6898 {
6899 return;
6900 }
6901 if (renderer.replacer != null)
6902 {
6903 p.tile = renderer.replacer.tile * ((!flipX) ? 1 : (-1));
6904 if (renderer.replacer.mat != -1)
6905 {
6906 p.mat = EClass.sources.materials.rows.TryGet(renderer.replacer.mat, 0);
6907 p.matColor = BaseTileMap.GetColorInt(ref p.mat.matColor, 100);
6908 p.color -= 1048576f;
6909 }
6910 }
6911 else if (source._tiles_snow.Length != 0 && EClass._zone.IsSnowCovered)
6912 {
6913 if (source._tiles_snow.Length > 1)
6914 {
6915 int num = ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % source._tiles_snow.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6916 p.tile = source._tiles_snow[(num < source._tiles_snow.Length) ? num : 0] * ((!flipX) ? 1 : (-1));
6917 }
6918 else
6919 {
6920 p.tile = source._tiles_snow[0] * ((!flipX) ? 1 : (-1));
6921 }
6922 }
6923 else if (sourceCard._tiles.Length > 1)
6924 {
6925 int num2 = ((base.idSkin != 0 || source.staticSkin) ? base.idSkin : (base.uid % sourceCard._tiles.Length / 2 * 2 + ((!base.IsMale) ? 1 : 0)));
6926 p.tile = sourceCard._tiles[(num2 >= 0 && num2 < sourceCard._tiles.Length) ? num2 : 0] * ((!flipX) ? 1 : (-1));
6927 }
6928 else
6929 {
6930 p.tile = sourceCard._tiles[0] * ((!flipX) ? 1 : (-1));
6931 }
6932 p.dir = base.dir;
6933 }
static int GetColorInt(ref Color matColor, int p)
override bool flipX
Definition: Chara.cs:549
SourceMaterial.Row mat
Definition: RenderParam.cs:17
int[] _tiles
Definition: RenderRow.cs:12
SourceMaterial materials

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

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

◆ SetSortVal()

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

Reimplemented from Card.

Definition at line 7473 of file Chara.cs.

7474 {
7475 switch (m)
7476 {
7477 case UIList.SortMode.ByJob:
7478 sortVal = job._index * 10000 + sourceCard._index;
7479 break;
7480 case UIList.SortMode.ByRace:
7481 sortVal = race._index * 10000 * ((!IsHuman) ? 1 : (-1)) + sourceCard._index;
7482 break;
7483 case UIList.SortMode.ByFeat:
7484 sortVal = -GetTotalFeat();
7485 break;
7486 case UIList.SortMode.ByPartyOrder:
7487 sortVal = EClass.pc.party.members.IndexOf(this);
7488 return;
7489 default:
7490 sortVal = sourceCard._index * ((!IsHuman) ? 1 : (-1));
7491 break;
7492 case UIList.SortMode.ByWorkk:
7493 break;
7494 }
7495 if (base.isFav)
7496 {
7497 sortVal -= 100000000;
7498 }
7499 }
int sortVal
Definition: Card.cs:102
int GetTotalFeat()
Definition: Chara.cs:8322
Definition: UIList.cs:9
SortMode
Definition: UIList.cs:27

References SourceData< T, T2 >.BaseRow._index, Party.members, party, and EClass.pc.

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

◆ SetSource()

override void Chara.SetSource ( )
inlinevirtual

Reimplemented from Card.

Definition at line 2115 of file Chara.cs.

2116 {
2117 source = EClass.sources.charas.map.TryGetValue(id);
2118 if (source == null)
2119 {
2120 Debug.LogWarning("Chara " + id + " not found");
2121 id = "chicken";
2122 source = EClass.sources.charas.map[id];
2123 }
2124 path.walker = this;
2125 }

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

Referenced by Refresh().

◆ SetSummon()

void Chara.SetSummon ( int  duration)
inline

Definition at line 2458 of file Chara.cs.

2459 {
2460 base.c_summonDuration = duration;
2461 base.isSummon = true;
2462 }

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

7816 {
7817 if (t.IsRangedWeapon && t.category.slot == 0)
7818 {
7819 if (!CanEquipRanged(t))
7820 {
7821 return false;
7822 }
7823 int num = 0;
7824 foreach (Thing thing in things)
7825 {
7826 if (thing.IsRangedWeapon)
7827 {
7828 if (thing.category.slot != 0 && thing.isEquipped)
7829 {
7830 return false;
7831 }
7832 if (CanEquipRanged(thing) && thing.GetEquipValue() > num)
7833 {
7834 num = thing.GetEquipValue();
7835 }
7836 }
7837 }
7838 if (t.GetEquipValue() > num)
7839 {
7840 return true;
7841 }
7842 return false;
7843 }
7844 BodySlot bodySlot = body.GetSlot(t);
7845 if (bodySlot == null)
7846 {
7847 return false;
7848 }
7849 if (useFav)
7850 {
7851 switch (GetFavAttackStyle())
7852 {
7853 case AttackStyle.Default:
7854 case AttackStyle.TwoHand:
7855 if (t.IsMeleeWeapon)
7856 {
7857 bodySlot = body.slotMainHand;
7858 }
7859 else if (bodySlot.elementId == 35)
7860 {
7861 return false;
7862 }
7863 break;
7864 case AttackStyle.Shield:
7865 if (t.IsMeleeWeapon)
7866 {
7867 bodySlot = body.slotMainHand;
7868 }
7869 else if (bodySlot.elementId == 35 && t.IsMeleeWeapon)
7870 {
7871 return false;
7872 }
7873 break;
7874 case AttackStyle.TwoWield:
7875 if (bodySlot.elementId == 35 && !t.IsMeleeWeapon)
7876 {
7877 return false;
7878 }
7879 break;
7880 }
7881 }
7882 if (!body.IsEquippable(t, bodySlot, text: false))
7883 {
7884 return false;
7885 }
7886 if (bodySlot.thing != null && (bodySlot.thing.blessedState <= BlessedState.Cursed || bodySlot.thing.GetEquipValue() >= t.GetEquipValue()))
7887 {
7888 return false;
7889 }
7890 if (!base.IsPCFactionOrMinion)
7891 {
7892 int num2 = 0;
7893 foreach (Element value in t.elements.dict.Values)
7894 {
7895 if (value.Value <= 0)
7896 {
7897 int num3 = 100;
7898 switch (value.id)
7899 {
7900 case 418:
7901 num3 = 10;
7902 break;
7903 case 60:
7904 case 61:
7905 case 62:
7906 num3 = 200;
7907 break;
7908 case 962:
7909 num3 = 10000;
7910 break;
7911 }
7912 num2 += value.Value * num3 / 100;
7913 }
7914 }
7915 if (num2 < -40)
7916 {
7917 return false;
7918 }
7919 }
7920 if (t.HasTag(CTAG.gift) && t.c_uidAttune != base.uid)
7921 {
7922 return false;
7923 }
7924 return true;
7925 }
bool IsMeleeWeapon
Definition: Card.cs:2281
BlessedState blessedState
Definition: Card.cs:279
int c_uidAttune
Definition: Card.cs:1198
bool IsEquippable(Thing thing, BodySlot slot, bool text=true)
Definition: CharaBody.cs:110
AttackStyle GetFavAttackStyle()
Definition: Chara.cs:4731

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

◆ ShouldThrowAway()

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

Definition at line 8676 of file Chara.cs.

8677 {
8678 if (IsPCFaction)
8679 {
8680 if (t.IsFood && t.category.id != "fish" && !t.IsDecayed)
8681 {
8682 return false;
8683 }
8684 if (t.trait.GetHealAction(this) != null)
8685 {
8686 return false;
8687 }
8688 if (t.IsThrownWeapon || t.IsRangedWeapon || t.IsAmmo)
8689 {
8690 return false;
8691 }
8692 if (t.trait is TraitBlanket || t.trait is TraitItemProc || t.trait is TraitBookSkill)
8693 {
8694 return false;
8695 }
8696 }
8697 if (t.isEquipped || t.rarity >= Rarity.Legendary || !t.trait.CanBeDestroyed || t.c_isImportant)
8698 {
8699 return false;
8700 }
8701 if (t.trait is TraitCurrency || t.trait is TraitTool)
8702 {
8703 return false;
8704 }
8705 switch (type)
8706 {
8707 case ClearInventoryType.SellAtTown:
8708 if (!t.isGifted && !t.isNPCProperty)
8709 {
8710 return false;
8711 }
8712 break;
8713 case ClearInventoryType.Purge:
8714 switch (t.category.id)
8715 {
8716 case "fish":
8717 if (EClass.rnd(3) == 0)
8718 {
8719 return true;
8720 }
8721 break;
8722 case "junk":
8723 case "garbage":
8724 if (EClass.rnd(3) != 0)
8725 {
8726 return true;
8727 }
8728 break;
8729 }
8730 if (t.id == "flyer")
8731 {
8732 return true;
8733 }
8734 if (!t.IsDecayed && EClass.rnd(3) == 0)
8735 {
8736 return false;
8737 }
8738 if (!things.IsFull() && t.IsRangedWeapon)
8739 {
8740 return false;
8741 }
8742 break;
8743 }
8744 return true;
8745 }
bool IsThrownWeapon
Definition: Card.cs:2285
bool IsFood
Definition: Card.cs:2215
bool isGifted
Definition: Card.cs:783
virtual Action GetHealAction(Chara c)
Definition: Trait.cs:625

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

◆ ShowDialog() [1/2]

void Chara.ShowDialog ( )
inline

Definition at line 7216 of file Chara.cs.

7217 {
7218 Zone_Nymelle zone_Nymelle = EClass._zone as Zone_Nymelle;
7219 if (conSuspend != null && IsPCParty)
7220 {
7221 RemoveCondition<ConSuspend>();
7222 }
7223 if (LayerDrama.forceJump == null)
7224 {
7225 if (IsDeadOrSleeping)
7226 {
7227 ShowDialog("_chara", "sleep");
7228 return;
7229 }
7230 if (EClass.pc.isHidden && !CanSee(EClass.pc))
7231 {
7232 ShowDialog("_chara", "invisible");
7233 return;
7234 }
7236 {
7238 ShowDialog("_chara", "give_card");
7239 Thing thing = ThingGen.Create("figure");
7240 thing.MakeFigureFrom(id);
7241 EClass.player.DropReward(thing);
7242 thing = ThingGen.Create("figure3");
7243 thing.MakeFigureFrom(id);
7244 EClass.player.DropReward(thing);
7245 return;
7246 }
7247 if (GetInt(71) == -2)
7248 {
7249 ShowDialog("_chara", "give_lunch");
7250 Thing t = CraftUtil.MakeLoveLunch(this);
7252 SetInt(71, EClass.world.date.GetRaw() + 43200);
7253 return;
7254 }
7255 if (base.isRestrained)
7256 {
7257 ShowDialog("_chara", "strain");
7258 return;
7259 }
7260 if (IsEscorted())
7261 {
7262 ShowDialog("_chara", "escort");
7263 return;
7264 }
7266 {
7267 string step = ((!(EClass._zone is Zone_Wedding)) ? "party" : (IsPCParty ? "wedding_love" : ((IsMarried || affinity.IsWeddingHater) ? "wedding_hater" : "wedding")));
7268 if (EClass._zone is Zone_Wedding && IsPCParty && base.c_love != null && !base.c_love.gaveCutter)
7269 {
7270 step = "wedding_cutter";
7271 EClass.player.DropReward(ThingGen.Create("dagger_cakecutter"));
7272 base.c_love.gaveCutter = true;
7273 }
7274 ShowDialog("_chara", step);
7275 return;
7276 }
7277 if (EClass.game.quests.OnShowDialog(this))
7278 {
7279 return;
7280 }
7281 if (id == "nino")
7282 {
7284 }
7285 switch (id)
7286 {
7287 case "loytel":
7288 {
7290 {
7291 EClass.game.quests.Get("pre_debt_runaway").Complete();
7292 EClass.player.flags.loytelEscaped = false;
7293 EClass.game.quests.Add("debt", "loytel");
7294 ShowDialog("loytel", "loytelEscaped");
7295 return;
7296 }
7297 QuestDebt questDebt = EClass.game.quests.Get<QuestDebt>();
7298 if (questDebt != null && questDebt.paid)
7299 {
7300 questDebt.stage++;
7301 if (questDebt.stage > 7)
7302 {
7303 questDebt.stage = 7;
7304 }
7305 ShowDialog("loytel", "debt" + questDebt.stage);
7306 return;
7307 }
7308 break;
7309 }
7310 case "farris":
7311 if (EClass._zone.id == "startVillage" || EClass._zone.id == "startVillage3" || EClass.game.IsSurvival)
7312 {
7313 ShowDialog("farris");
7314 return;
7315 }
7317 {
7318 case -1:
7319 ShowDialog("farris", "nymelle_noQuest");
7320 break;
7321 case 0:
7322 ShowDialog("farris", "nymelle_first");
7323 break;
7324 case 1:
7325 ShowDialog("farris", "home_first");
7326 break;
7327 default:
7328 ShowDialog("farris");
7329 break;
7330 }
7331 return;
7332 case "ashland":
7333 ShowDialog("ashland");
7334 return;
7335 case "fiama":
7336 if (zone_Nymelle != null && zone_Nymelle.IsCrystalLv && EClass.game.quests.GetPhase<QuestExploration>() == 3)
7337 {
7338 SoundManager.ForceBGM();
7339 LayerDrama.ActivateMain("mono", "nymelle_crystal");
7340 }
7342 {
7344 {
7345 EClass.player.flags.fiamaFirstDream = true;
7346 ShowDialog("fiama", "firstDream");
7347 }
7349 {
7350 ShowDialog("fiama", "giveStoryBook").SetOnKill(delegate
7351 {
7352 EClass.player.flags.fiamaStoryBookGiven = true;
7353 EClass.player.DropReward(ThingGen.Create("book_story"));
7354 });
7355 }
7356 else
7357 {
7358 ShowDialog("fiama");
7359 }
7360 }
7361 else
7362 {
7363 ShowDialog("fiama");
7364 }
7365 return;
7366 case "big_sister":
7368 {
7369 ShowDialog("big_sister", "little_saved");
7370 EClass.player.flags.little_saved = false;
7371 return;
7372 }
7374 {
7375 ShowDialog("big_sister", "little_dead");
7376 EClass.player.flags.little_killed = false;
7377 return;
7378 }
7379 break;
7380 }
7381 if (trait is TraitGuildDoorman)
7382 {
7383 string tag = ((trait is TraitDoorman_Fighter) ? "fighter" : ((trait is TraitDoorman_Mage) ? "mage" : "thief"));
7384 ShowDialog("guild_doorman", "main", tag);
7385 return;
7386 }
7387 if (trait is TraitGuildClerk)
7388 {
7389 string tag2 = ((trait is TraitClerk_Fighter) ? "fighter" : ((trait is TraitClerk_Mage) ? "mage" : "thief"));
7390 ShowDialog("guild_clerk", "main", tag2);
7391 return;
7392 }
7393 }
7394 bool flag = true;
7395 if (id == "parttimer_jure" && (!EClass._zone.IsFestival || !(EClass._zone is Zone_Noyel) || EClass.pc.faith == EClass.game.religions.Healing))
7396 {
7397 flag = false;
7398 }
7399 if (flag && File.Exists(PackageIterator.GetFiles("Dialog/Drama/" + id + ".xlsx").LastOrDefault()?.FullName ?? (CorePath.DramaData + id + ".xlsx")))
7400 {
7401 ShowDialog(id);
7402 }
7403 else
7404 {
7405 ShowDialog("_chara");
7406 }
7407 }
bool CanGiveCard()
Definition: Affinity.cs:70
bool IsWeddingHater
Definition: Affinity.cs:36
void MakeFigureFrom(string id)
Definition: Card.cs:5847
void ShowDialog()
Definition: Chara.cs:7216
bool IsMarried
Definition: Chara.cs:611
bool DroppedCard(string id)
Definition: CodexManager.cs:46
void MarkCardDrop(string id)
Definition: CodexManager.cs:41
static string DramaData
Definition: CorePath.cs:174
static Thing MakeLoveLunch(Chara c)
Definition: CraftUtil.cs:220
bool IsSurvival
Definition: Game.cs:276
static string forceJump
Definition: LayerDrama.cs:18
static LayerDrama ActivateMain(string idSheet, string idStep=null, Chara target=null, Card ref1=null, string tag="")
Definition: LayerDrama.cs:61
bool loytelEscaped
Definition: Player.cs:508
int storyFiama
Definition: Player.cs:652
bool little_saved
Definition: Player.cs:472
bool fiamaStoryBookGiven
Definition: Player.cs:328
bool fiamaFirstDream
Definition: Player.cs:340
bool little_killed
Definition: Player.cs:484
CodexManager codex
Definition: Player.cs:1182
bool EnableDreamStory
Definition: Player.cs:1340
Thing DropReward(Thing t, bool silent=false)
Definition: Player.cs:2642
bool paid
Definition: QuestDebt.cs:10
int stage
Definition: QuestDebt.cs:13
bool OnShowDialog(Chara c)
Quest Add(string id, string idGlobalChara=null)
Definition: QuestManager.cs:29
int GetPhase(string id)
Quest Get(string id)
void Complete()
Definition: Quest.cs:473
ReligionHealing Healing
bool IsCrystalLv
Definition: Zone_Nymelle.cs:25
virtual bool IsFestival
Definition: Zone.cs:211

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

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

◆ ShowDialog() [2/2]

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

Definition at line 7409 of file Chara.cs.

7410 {
7411 return _ShowDialog(book, null, step, tag);
7412 }
LayerDrama _ShowDialog(string book, string sheet, string step="main", string tag="")
Definition: Chara.cs:7414

References book.

◆ Slap()

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

Definition at line 6430 of file Chara.cs.

6431 {
6432 if (id == "olderyoungersister")
6433 {
6435 }
6436 PlaySound("whip");
6437 Say("slap", this, c);
6438 c.PlayAnime(AnimeID.Shiver);
6439 c.DamageHP(slapToDeath ? (c.MaxHP * 2) : (5 + EClass.rndHalf(EClass.pc.MaxHP / 3)), 919, 100, AttackSource.Condition);
6440 c.OnInsulted();
6441 if (slapToDeath && c.IsAliveInCurrentZone)
6442 {
6443 c.Die();
6444 }
6445 }
void PlayAnime(AnimeID id, bool force=false)
Definition: Card.cs:6445
void OnInsulted()
Definition: Chara.cs:8389
override void Die(Element e=null, Card origin=null, AttackSource attackSource=AttackSource.None, Chara originalTarget=null)
Definition: Chara.cs:5417

References Card.DamageHP(), Die(), Steam.GetAchievement(), IsAliveInCurrentZone, MaxHP, OnInsulted(), EClass.pc, Card.PlayAnime(), and EClass.rndHalf().

Referenced by DramaOutcome.wedding_fail().

◆ Sleep()

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

Definition at line 9932 of file Chara.cs.

9933 {
9934 RemoveCondition<ConAwakening>();
9935 AddCondition(Condition.Create(100, delegate(ConSleep con)
9936 {
9937 con.pcSleep = 15;
9938 con.pcBed = bed;
9939 con.pcPillow = pillow;
9940 con.pickup = pickup;
9941 con.posBed = posBed;
9942 con.posPillow = posPillow;
9943 }), force: true);
9944 }

References bed, and Condition.Create().

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

◆ Sniff()

void Chara.Sniff ( Chara  c)
inline

Definition at line 8312 of file Chara.cs.

8313 {
8314 Say("abCatSniff", this, c);
8315 AddCondition<ConHOT>(EClass.curve(50 + c.CHA * 5, 400, 100));
8316 c.ShowEmo(Emo.angry);
8317 ShowEmo(Emo.love);
8318 Talk("sniff");
8319 c.Talk(new string[4] { "labor", "disgust", "scold", "callGuards" }.RandomItem());
8320 }

References Card.CHA, EClass.curve(), Card.ShowEmo(), and Card.Talk().

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

◆ SplitHeld()

Card Chara.SplitHeld ( int  a)
inline

Definition at line 4666 of file Chara.cs.

4667 {
4668 return held.Split(a);
4669 }

References Card.Split().

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

◆ Stumble()

void Chara.Stumble ( int  mtp = 100)
inline

Definition at line 1881 of file Chara.cs.

1882 {
1883 bool flag = EClass._map.FindThing((Thing t) => t.IsInstalled && t.pos.Equals(EClass.pc.pos) && t.trait is TraitStairsUp) != null;
1884 Say(flag ? "dmgBurdenStairs" : "dmgBurdenFallDown", this);
1885 int num = MaxHP;
1886 if (Evalue(1421) > 0)
1887 {
1888 num = mana.max;
1889 }
1890 int num2 = (num * (base.ChildrenWeight * 100 / WeightLimit) / (flag ? 100 : 200) + 1) * mtp / 100;
1891 if (base.hp <= 0)
1892 {
1893 num2 *= 2;
1894 }
1895 DamageHP(num2, flag ? AttackSource.BurdenStairs : AttackSource.BurdenFallDown);
1896 }
Thing FindThing(Func< Thing, bool > func)
Definition: Map.cs:2592

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

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

◆ SyncRide() [1/2]

void Chara.SyncRide ( )
inline

Definition at line 4006 of file Chara.cs.

4007 {
4008 if (host != null)
4009 {
4010 host.SyncRide();
4011 }
4012 if (ride != null)
4013 {
4014 SyncRide(ride);
4015 }
4016 if (parasite != null)
4017 {
4019 }
4020 }

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

4023 {
4024 if (!c.pos.Equals(pos))
4025 {
4026 if (!pos.IsValid)
4027 {
4028 Debug.LogError("exception: pos is not valid:" + pos?.ToString() + "/" + this);
4029 pos = new Point();
4030 }
4031 EClass._map.MoveCard(pos, c);
4032 }
4033 }

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

◆ TalkTopic()

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

Definition at line 7145 of file Chara.cs.

7146 {
7147 if (host == null && !IsInActiveZone)
7148 {
7149 return null;
7150 }
7151 if (!isSynced && (host == null || !host.isSynced) && topic != "dead")
7152 {
7153 return null;
7154 }
7155 if (IsPCParty)
7156 {
7157 int num = EClass.pc.party.members.Count - 1;
7158 switch (topic)
7159 {
7160 case "calm":
7161 if (EClass.rnd(num * 5) != 0)
7162 {
7163 return null;
7164 }
7165 break;
7166 case "aggro":
7167 if (EClass.rnd(num * 10) != 0)
7168 {
7169 return null;
7170 }
7171 break;
7172 case "kill":
7173 if (EClass.rnd(num * 3) != 0)
7174 {
7175 return null;
7176 }
7177 break;
7178 case "fov":
7179 return null;
7180 }
7181 }
7182 string topicText = GetTopicText(topic);
7183 if (topicText.IsEmpty())
7184 {
7185 return null;
7186 }
7187 string text = "_bracketTalk".lang();
7188 bool flag = topicText.StartsWith("*");
7189 bool flag2 = topicText.StartsWith("(");
7190 bool flag3 = topicText.StartsWith(text) || (topicText.Length > 0 && topicText[0] == text[0]) || topicText[0] == '“';
7191 topicText = ApplyTone(topicText);
7192 topicText = topicText.Replace("~", "*");
7193 Msg.SetColor(flag2 ? Msg.colors.Thinking : (flag3 ? Msg.colors.Talk : Msg.colors.Ono));
7194 Msg.Say(StripTalkSpeiclaCharacters(topicText.Replace("&", "")));
7195 if (topic == "dead")
7196 {
7197 EClass.ui.popGame.PopText(ApplyNewLine(topicText.StripBrackets()), null, "PopTextDead", default(Color), pos.Position() + EClass.setting.render.tc.textPosDead);
7198 }
7199 else if (flag || flag3 || flag2)
7200 {
7201 (host ?? this).renderer.Say(ApplyNewLine(topicText.StripBrackets()), default(Color), IsPCParty ? 0.6f : 0f);
7202 }
7203 return topicText;
7204 }
void Say(string text, Color c=default(Color), float duration=0f)
string ApplyNewLine(string text)
Definition: Card.cs:7071
string StripTalkSpeiclaCharacters(string text)
Definition: Card.cs:7052
string ApplyTone(string text, bool stripPun=false)
Definition: Card.cs:7151
string GetTopicText(string topic="calm")
Definition: Chara.cs:7111
static UI ui
Definition: EClass.cs:17
Color Thinking
Definition: MsgColors.cs:17
Color Talk
Definition: MsgColors.cs:7

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

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

◆ Tick()

override void Chara.Tick ( )
inlinevirtual

Reimplemented from Card.

Definition at line 4035 of file Chara.cs.

4036 {
4037 SyncRide();
4038 combatCount--;
4039 ignoreSPAbsorb = false;
4040 if (IsPC)
4041 {
4042 if (hasMovedThisTurn)
4043 {
4044 pos.Things.ForeachReverse(delegate(Thing t)
4045 {
4047 {
4048 AI_Goto aI_Goto = ai.Current as AI_Goto;
4049 if ((aI_Goto == null && !(ai is GoalManualMove)) || (aI_Goto != null && !aI_Goto.dest.Equals(pos)))
4050 {
4051 return;
4052 }
4053 }
4054 t.trait.OnStepped(this);
4055 });
4056 if (isDead)
4057 {
4058 return;
4059 }
4060 hasMovedThisTurn = false;
4062 {
4063 EClass.player.haltMove = false;
4064 ActionMode.Adv.TryCancelInteraction(sound: false);
4065 EInput.Consume(1);
4066 return;
4067 }
4068 if (EClass._zone.IsRegion)
4069 {
4071 {
4072 foreach (Chara member in EClass.pc.party.members)
4073 {
4074 if (member.hunger.value > 65)
4075 {
4076 member.InstantEat(null, sound: false);
4077 }
4078 }
4079 }
4080 Chara chara = null;
4082 if (cell2 != null && (cell2.zone == null || (cell2.zone is Zone_Field && !cell2.zone.IsPCFaction)))
4083 {
4084 foreach (Chara chara2 in EClass._map.charas)
4085 {
4086 if (!chara2.IsPCFactionOrMinion && !chara2.IsGlobal && chara2.pos.Equals(EClass.pc.pos))
4087 {
4088 chara = chara2;
4089 break;
4090 }
4091 }
4092 }
4093 if (chara != null)
4094 {
4096 {
4097 EClass.player.safeTravel = 5 + EClass.rnd(5);
4098 }
4099 EClass._zone.RemoveCard(chara);
4100 Msg.Say("encounter");
4101 EClass.player.EnterLocalZone(encounter: true, chara);
4102 }
4103 else if (EClass.player.safeTravel <= 0)
4104 {
4105 if (cell2 != null && cell2.zone == null && !EClass.debug.ignoreEncounter)
4106 {
4108 if (!tileInfo.shore)
4109 {
4110 bool num = EClass.pc.HasCondition<ConWardMonster>();
4111 bool flag = EClass.pc.HasCondition<ConDrawMonster>();
4112 bool flag2 = EClass.game.quests.Get<QuestEscort>() != null;
4113 int num2 = (tileInfo.isRoad ? 22 : 12);
4114 if (flag2)
4115 {
4116 num2 = (tileInfo.isRoad ? 16 : 10);
4117 }
4118 if (num)
4119 {
4120 num2 *= (flag2 ? 2 : 20);
4121 }
4122 if (flag)
4123 {
4124 num2 /= 2;
4125 }
4126 if (EClass.rnd(num2) == 0)
4127 {
4128 Msg.Say("encounter");
4129 if (!flag)
4130 {
4131 EClass.player.safeTravel = 5 + EClass.rnd(5);
4132 }
4133 EClass.player.EnterLocalZone(encounter: true);
4134 }
4135 }
4136 }
4137 }
4138 else
4139 {
4141 }
4142 }
4143 }
4144 EClass.player.pickupDelay = 0f;
4145 if (EClass.player.returnInfo != null)
4146 {
4148 if (EClass.player.returnInfo.turns <= 0)
4149 {
4151 {
4152 EClass.player.returnInfo = null;
4154 }
4155 else
4156 {
4158 {
4159 int uidDest = EClass.player.returnInfo.uidDest;
4160 Zone zone = null;
4161 if (uidDest != 0)
4162 {
4163 zone = EClass.game.spatials.map.TryGetValue(uidDest) as Zone;
4164 }
4165 if (zone == null || zone.destryoed)
4166 {
4167 zone = EClass.world.region;
4168 }
4170 {
4171 Msg.Say("returnFail");
4172 }
4173 else
4174 {
4175 Msg.Say("returnComplete");
4176 EClass.player.uidLastTravelZone = 0;
4178 EClass.player.lastZonePos = null;
4179 }
4180 EClass.player.returnInfo = null;
4181 return;
4182 }
4183 EClass.player.returnInfo = null;
4184 Msg.Say("returnOverweight");
4185 }
4186 }
4187 }
4188 if ((HasNoGoal || !ai.IsRunning) && !WillConsumeTurn())
4189 {
4191 return;
4192 }
4195 {
4196 RecipeUpdater.dirty = true;
4197 }
4199 }
4200 else
4201 {
4202 actTime = EClass.player.baseActTime * Mathf.Max(0.1f, (float)EClass.pc.Speed / (float)Speed);
4203 hasMovedThisTurn = false;
4204 }
4207 {
4208 return;
4209 }
4211 if (host != null && !consumeTurn)
4212 {
4213 if (host.ride == this && ((host.hasMovedThisTurn && IsInCombat) || (enemy != null && turn % 3 != 0)))
4214 {
4215 consumeTurn = true;
4216 }
4217 if (host.parasite == this && enemy != null && EClass.rnd(10) > EClass.rnd(host.Evalue(227) + 10))
4218 {
4219 if (Dist(enemy) < 3 && EClass.rnd(2) == 0)
4220 {
4221 Say("parasite_fail", this, host);
4222 if (EClass.rnd(2) == 0 && GetInt(106) == 0)
4223 {
4224 Talk("parasite_fail");
4225 }
4226 }
4227 consumeTurn = true;
4228 }
4229 }
4230 if (consumeTurn)
4231 {
4232 if (IsPC)
4233 {
4235 }
4236 }
4237 else
4238 {
4239 if (base.isRestrained)
4240 {
4241 TryUnrestrain();
4242 }
4243 if (enemy != null)
4244 {
4246 {
4247 enemy = null;
4248 }
4249 else if (!IsPC && (ai.CancelOnAggro || !ai.IsRunning))
4250 {
4251 SetAIAggro();
4252 }
4253 }
4254 if (HasNoGoal || !ai.IsRunning)
4255 {
4256 ChooseNewGoal();
4257 }
4258 ai.Tick();
4259 }
4260 Cell cell = base.Cell;
4262 {
4263 AddCondition<ConWet>(50);
4264 if (pos.IsHotSpring)
4265 {
4266 hygiene.Mod(2);
4267 }
4268 }
4269 if (IsPC && !EClass._zone.IsRegion && cell.CanSuffocate() && !EClass.debug.godMode && !HasElement(1252))
4270 {
4271 AddCondition<ConSuffocation>(800 / (100 + EvalueMax(200, -5) * 10), force: true);
4272 }
4273 CellEffect e;
4274 if (cell.effect != null)
4275 {
4276 e = cell.effect;
4277 switch (e.id)
4278 {
4279 case 1:
4280 case 2:
4281 case 4:
4282 if (IsLevitating)
4283 {
4284 Say("levitating");
4285 break;
4286 }
4287 AddCondition<ConWet>(50);
4288 ProcEffect();
4289 break;
4290 case 3:
4291 PlaySound("fire_step");
4292 AddCondition<ConBurning>(30);
4293 break;
4294 case 5:
4295 if (!isWet)
4296 {
4297 PlaySound("bubble");
4298 AddCondition<ConWet>(30);
4299 ProcEffect();
4300 }
4301 break;
4302 case 6:
4303 if (hasMovedThisTurn)
4304 {
4305 Say("abMistOfDarkness_step", this);
4306 }
4307 AddCondition<ConDark>(e.power);
4308 break;
4309 }
4310 }
4311 if (IsPC)
4312 {
4313 if (EClass.player.currentHotItem.Thing != null)
4314 {
4316 }
4318 }
4319 void ClearEffect()
4320 {
4321 EClass._map.SetLiquid(cell.x, cell.z, 0, 0);
4322 }
4323 void ProcEffect()
4324 {
4325 if (e.idEffect != 0)
4326 {
4327 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
4328 {
4329 aliasEle = EClass.sources.elements.map[e.idEle].alias,
4330 n1 = e.n1,
4331 refVal = e.refVal
4332 });
4333 ClearEffect();
4334 }
4335 }
4336 }
virtual bool CancelOnAggro
Definition: AIAct.cs:80
bool TryCancelInteraction(bool sound=true)
Definition: AM_Adv.cs:1115
void SetTurbo(int mtp=-1)
Definition: AM_Adv.cs:1086
static AM_Adv Adv
Definition: ActionMode.cs:15
virtual void OnEndPlayerTurn()
int turn
Definition: Card.cs:66
void TryUnrestrain(bool force=false, Chara c=null)
Definition: Card.cs:7385
bool isHostileAct
Definition: CellEffect.cs:74
EffectId idEffect
Definition: CellEffect.cs:38
bool isCursed
Definition: CellEffect.cs:98
bool isBlessed
Definition: CellEffect.cs:86
CellEffect effect
Definition: Cell.cs:94
byte z
Definition: Cell.cs:58
byte x
Definition: Cell.cs:56
void InstantEat(Thing t=null, bool sound=true)
Definition: Chara.cs:7769
int Speed
Definition: Chara.cs:1109
static bool consumeTurn
Definition: Chara.cs:182
void SetAIAggro()
Definition: Chara.cs:9094
bool ignoreSPAbsorb
Definition: Chara.cs:148
void ChooseNewGoal()
Definition: Chara.cs:8975
bool WillConsumeTurn()
Definition: Chara.cs:3726
bool ignoreEncounter
Definition: CoreDebug.cs:201
bool shore
Definition: EloMap.cs:50
TileInfo GetTileInfo(int gx, int gy)
Definition: EloMap.cs:286
ConfigPreference preference
Definition: Game.cs:97
virtual Thing Thing
Definition: HotItem.cs:38
void SetLiquid(int x, int z, CellEffect effect=null)
Definition: Map.cs:1477
static string SayNothingHappen()
Definition: Msg.cs:96
int turns
Definition: Player.cs:84
bool haltMove
Definition: Player.cs:1241
float baseActTime
Definition: Player.cs:1269
void EnterLocalZone(bool encounter=false, Chara mob=null)
Definition: Player.cs:2018
HotItem currentHotItem
Definition: Player.cs:1167
int safeTravel
Definition: Player.cs:987
int eloY
Definition: Point.cs:81
int eloX
Definition: Point.cs:79
bool IsHotSpring
Definition: Point.cs:375
bool destryoed
Definition: Spatial.cs:45
virtual void OnTickHeld()
Definition: Trait.cs:1076
virtual bool IgnoreOnSteppedWhenMoving
Definition: Trait.cs:383
Definition: ActRef.cs:2

References EClass._map, EClass._zone, Game.activeZone, ActionMode.Adv, CoreConfig.GameConfig.alwaysUpdateRecipe, ConfigPreference.autoEat, Player.baseActTime, burden, Map.charas, Core.config, Game.config, EInput.Consume(), EClass.core, EClass.debug, Spatial.destryoed, Scene.elomap, Point.eloX, Point.eloY, Player.EnterLocalZone(), Point.Equals(), CoreConfig.game, EClass.game, QuestManager.Get(), EloMap.GetCell(), Stats.GetPhase(), EloMap.GetTileInfo(), Zone.GetTopZone(), Player.haltMove, HasCondition(), hunger, CoreDebug.ignoreEncounter, Trait.IgnoreOnSteppedWhenMoving, CoreDebug.ignoreWeight, InstantEat(), IsGlobal, Zone.IsPCFaction, Card.IsPCFactionOrMinion, Spatial.IsRegion, AIAct.IsRunning, Game.IsSurvival, SpatialManager.map, Party.members, MoveZone(), Trait.OnStepped(), party, EClass.pc, EClass.player, Card.pos, Game.Config.preference, Game.quests, World.region, Zone.RemoveCard(), Player.returnInfo, EClass.rnd(), Player.safeTravel, Msg.Say(), Msg.SayNothingHappen(), EClass.scene, EloMap.TileInfo.shore, Game.spatials, Player.stats, Card.trait, AM_Adv.TryCancelInteraction(), Player.ReturnInfo.turns, Player.Stats.turns, Player.ReturnInfo.uidDest, Stats.value, EClass.world, and EloMap.Cell.zone.

◆ TickConditions()

void Chara.TickConditions ( )
inline

Definition at line 3738 of file Chara.cs.

3739 {
3740 if (_cooldowns != null)
3741 {
3742 TickCooldown();
3743 }
3744 turn++;
3745 consumeTurn = false;
3746 preventRegen = false;
3747 emoIcon = Emo2.none;
3748 if (base.isSummon)
3749 {
3750 base.c_summonDuration--;
3751 if (base.c_summonDuration <= 0)
3752 {
3753 Die();
3754 return;
3755 }
3756 }
3758 {
3759 AddCondition<ConWet>(20);
3760 }
3761 switch (turn % 50)
3762 {
3763 case 0:
3764 happiness = (hunger.value + stamina.value + depression.value + bladder.value + hygiene.value) / 5;
3765 break;
3766 case 1:
3767 if (!IsPC || !EClass.debug.godMode)
3768 {
3769 if (EClass.rnd(2) == 0 && !HasCondition<ConAwakening>())
3770 {
3771 sleepiness.Mod(1);
3772 }
3773 if (EClass.rnd(3) == 0)
3774 {
3775 hunger.Mod(1);
3776 }
3777 if (IsPC && (sleepiness.GetPhase() != 0 || stamina.GetPhase() <= 1))
3778 {
3779 Tutorial.Play("sleep");
3780 }
3781 }
3782 break;
3783 case 2:
3784 if (parasite != null)
3785 {
3786 ModExp(227, (int)((EClass._zone.IsRegion ? 5 : 40) + parasite.affinity.CurrentStage));
3787 }
3788 if (ride != null)
3789 {
3790 ModExp(226, (int)((EClass._zone.IsRegion ? 5 : 40) + ride.affinity.CurrentStage));
3791 }
3792 break;
3793 case 3:
3794 {
3795 int phase = hygiene.GetPhase();
3796 int num = 0;
3797 num = ((!IsPC) ? ((phase > 3) ? 50 : 0) : ((phase > 3) ? 50 : 0));
3798 if (num > EClass.rnd(100))
3799 {
3800 hygiene.Mod(-1);
3801 }
3802 break;
3803 }
3804 case 4:
3805 if (IsPC)
3806 {
3808 }
3809 break;
3810 case 5:
3811 case 30:
3813 {
3814 AddCondition<ConBurning>(1000, force: true);
3815 }
3816 break;
3817 case 10:
3818 if (HasElement(1250))
3819 {
3820 if (!HasCondition<ConVampire>())
3821 {
3822 AddCondition<ConVampire>();
3823 }
3824 if (!IsPC && !HasCooldown(8793))
3825 {
3826 bool flag = false;
3827 flag = ((!HasCondition<ConTransmuteBat>()) ? (!HasElement(431) && pos.IsSunLit) : (body.HasElement(431) || (EClass.world.date.IsNight && !pos.IsSunLit)));
3828 if (flag && base.IsPCFactionOrMinion && !EClass._zone.IsPCFactionOrTent && EClass._zone.HasLaw && pos.ListWitnesses(this).Count > 0 && !HasCondition<ConBurning>())
3829 {
3830 flag = false;
3831 }
3832 if (flag)
3833 {
3834 UseAbility("SpTransmuteBat", this);
3835 }
3836 }
3837 }
3838 if (HasElement(1423) && !HasCondition<ConPeaky>())
3839 {
3840 AddCondition<ConPeaky>();
3841 }
3842 break;
3843 }
3844 if (turn % 200 == 0)
3845 {
3847 }
3848 if (IsPCParty)
3849 {
3850 if (dirtyWeight)
3851 {
3852 CalcBurden();
3853 }
3854 int phase2 = burden.GetPhase();
3855 int phase3 = hunger.GetPhase();
3856 if (phase3 >= 4)
3857 {
3858 preventRegen = true;
3859 }
3860 if (EClass.rnd(EClass._zone.IsRegion ? 100 : 30) == 0 && phase2 >= 3)
3861 {
3862 Say("dmgBurden", this);
3863 DamageHP(MaxHP * (base.ChildrenWeight * 100 / WeightLimit) / 1000 + 1, AttackSource.Burden);
3864 if (isDead)
3865 {
3866 return;
3867 }
3868 }
3869 if (EClass.rnd(12) == 0)
3870 {
3871 if (IsPC)
3872 {
3873 if (phase2 > 0)
3874 {
3875 ModExp(207, 1 + phase2 * phase2);
3876 }
3877 }
3878 else
3879 {
3880 ModExp(207, 4);
3881 }
3882 }
3883 if (IsPC)
3884 {
3885 if (phase3 >= 5)
3886 {
3887 if (!(ai is AI_Eat) && EClass.rnd(5) == 0)
3888 {
3889 DamageHP(1 + EClass.rnd(2) + MaxHP / 50, AttackSource.Hunger);
3890 }
3891 if (!isDead && EClass.rnd(3) == 0)
3892 {
3893 stamina.Mod(-1);
3894 }
3895 }
3896 if (isDead)
3897 {
3898 return;
3899 }
3900 phase3 = stamina.GetPhase();
3901 if (phase3 <= 0)
3902 {
3903 preventRegen = true;
3904 }
3906 {
3907 if (EClass.rnd(100) == 0 && !isConfused)
3908 {
3909 Msg.Say("rain_confuse");
3910 AddCondition<ConConfuse>(500);
3911 }
3912 if (EClass.rnd(300) == 0 && !isBlind)
3913 {
3914 Msg.Say("rain_confuse");
3915 AddCondition<ConBlind>(200);
3916 }
3917 }
3918 if (turn % (200000 / Mathf.Max(100 + Evalue(409) * 10, 50)) == 0)
3919 {
3920 ModCorruption(1);
3921 }
3922 }
3923 }
3924 if (!IsPC)
3925 {
3926 int num2 = Evalue(409);
3927 if (num2 > 0 && turn % (200000 / Mathf.Max(100 + num2 * 10, 50)) == 0)
3928 {
3929 ModCorruption(1);
3930 }
3931 }
3932 for (int num3 = conditions.Count - 1; num3 >= 0; num3--)
3933 {
3934 if (num3 < conditions.Count)
3935 {
3936 Condition condition = conditions[num3];
3937 if (!condition.TimeBased)
3938 {
3939 condition.Tick();
3940 }
3941 if (!condition.IsKilled)
3942 {
3943 if (condition.ConsumeTurn)
3944 {
3945 consumeTurn = true;
3946 }
3947 if (condition.PreventRegen)
3948 {
3949 preventRegen = true;
3950 }
3951 if (condition.EmoIcon != 0 && condition.EmoIcon > emoIcon)
3952 {
3953 emoIcon = condition.EmoIcon;
3954 }
3955 }
3956 if (isDead)
3957 {
3958 return;
3959 }
3960 }
3961 }
3962 string text = id;
3963 if (!(text == "cocoon"))
3964 {
3965 if (text == "tsunami")
3966 {
3967 if (elements.Base(79) < 30)
3968 {
3969 Die();
3970 return;
3971 }
3972 if (IsInCombat)
3973 {
3974 elements.SetTo(79, elements.Base(79) * 3 / 4);
3975 }
3976 }
3977 }
3978 else
3979 {
3980 if (!EClass._zone.IsRegion && !IsDisabled && 1.0001f - (float)base.hp / (float)MaxHP > EClass.rndf(1f) && !pos.IsSunLit)
3981 {
3982 HatchEgg();
3983 return;
3984 }
3985 consumeTurn = true;
3986 }
3987 if (!preventRegen)
3988 {
3989 if (EClass.rnd(25) == 0 && base.hp < MaxHP)
3990 {
3991 HealHP(EClass.rnd(Evalue(300) / 3 + 1) + 1);
3992 elements.ModExp(300, 8f);
3993 }
3994 if (EClass.rnd(8) == 0 && mana.value < mana.max)
3995 {
3996 mana.Mod(EClass.rnd(Evalue(301) / 2 + 1) + 1);
3997 elements.ModExp(301, 8f);
3998 }
3999 if (EClass.rnd(20) == 0 && !IsPC && stamina.value < stamina.max)
4000 {
4001 stamina.Mod(EClass.rnd(5) + 1);
4002 }
4003 }
4004 }
Emo2
Definition: Emo2.cs:2
Definition: AI_Eat.cs:5
Stage CurrentStage
Definition: Affinity.cs:32
virtual bool PreventRegen
virtual bool TimeBased
virtual Emo2 EmoIcon
Definition: BaseStats.cs:17
void HatchEgg()
Definition: Card.cs:5943
bool dirtyWeight
Definition: Card.cs:86
bool HasElement(int idEle)
Definition: CharaBody.cs:412
void TickCooldown()
Definition: Chara.cs:8956
void DiminishTempElements(int a=1)
Definition: Chara.cs:10547
Emo2 emoIcon
Definition: Chara.cs:108
bool UseAbility(int idAct, Card tc=null, Point pos=null, bool pt=false)
Definition: Chara.cs:5909
bool isBlind
Definition: Chara.cs:132
static bool preventRegen
Definition: Chara.cs:184
void CalcBurden()
Definition: Chara.cs:1866
virtual bool IsKilled
Definition: Condition.cs:7
override void Tick()
Definition: Condition.cs:70
void UpdateNyan()
Definition: Player.cs:2482
List< Chara > ListWitnesses(Chara criminal, int radius=4, WitnessType type=WitnessType.crime, Chara target=null)
Definition: Point.cs:830
static void Play(string idStep)
Definition: Tutorial.cs:7
bool IsRaining
Definition: Weather.cs:117
bool IsPCFactionOrTent
Definition: Zone.cs:478

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

Referenced by _Move().

◆ TickCooldown()

void Chara.TickCooldown ( )
inline

Definition at line 8956 of file Chara.cs.

8957 {
8958 for (int num = _cooldowns.Count - 1; num >= 0; num--)
8959 {
8960 if (_cooldowns[num] % 1000 == 1)
8961 {
8962 _cooldowns.RemoveAt(num);
8963 }
8964 else
8965 {
8966 _cooldowns[num]--;
8967 }
8968 }
8969 if (_cooldowns.Count == 0)
8970 {
8971 _cooldowns = null;
8972 }
8973 }

◆ TickWork()

void Chara.TickWork ( VirtualDate  date)
inline

Definition at line 9376 of file Chara.cs.

9377 {
9379 if (span != TimeTable.Span.Work && span != 0)
9380 {
9381 return;
9382 }
9383 WorkSummary workSummary = GetWorkSummary();
9384 if (span == TimeTable.Span.Work)
9385 {
9386 if (workSummary.work != null)
9387 {
9388 PerformWork(workSummary.work, isHobby: false, date.IsRealTime);
9389 }
9390 }
9391 else if (workSummary.hobbies.Count > 0)
9392 {
9393 PerformWork(workSummary.hobbies.RandomItem(), isHobby: true, date.IsRealTime);
9394 }
9395 }
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 1198 of file Chara.cs.

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

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

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

◆ TryAbsorbRod()

void Chara.TryAbsorbRod ( Thing  t)
inline

Definition at line 4450 of file Chara.cs.

4451 {
4452 if (!IsPC || !(t.trait is TraitRod) || t.c_charges <= 0 || !HasElement(1564))
4453 {
4454 return;
4455 }
4456 Say("absorbRod", this, t);
4457 TraitRod rod = t.trait as TraitRod;
4458 bool flag = false;
4459 if (rod.source != null)
4460 {
4461 using IEnumerator<SourceElement.Row> enumerator = EClass.sources.elements.rows.Where((SourceElement.Row a) => a.id == rod.source.id).GetEnumerator();
4462 if (enumerator.MoveNext())
4463 {
4464 SourceElement.Row current = enumerator.Current;
4465 if (IsPC)
4466 {
4467 GainAbility(current.id, t.c_charges * 100, t);
4468 flag = true;
4469 }
4470 }
4471 }
4472 if (!flag)
4473 {
4474 mana.Mod(-50 * t.c_charges);
4475 }
4476 t.c_charges = 0;
4478 }
int c_charges
Definition: Card.cs:1295
void GainAbility(int ele, int mtp=100, Thing origin=null)
Definition: Chara.cs:10313

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

7529 {
7530 if (!IsPCFaction && !IsGuest())
7531 {
7532 return null;
7533 }
7534 foreach (Card item in EClass._map.props.installed.all)
7535 {
7536 if (item.trait is TraitBed traitBed && traitBed.CanAssign(this))
7537 {
7538 traitBed.AddHolder(this);
7539 Msg.Say("claimBed", this);
7540 return traitBed;
7541 }
7542 }
7543 return null;
7544 }
bool CanAssign(Chara c)
Definition: TraitBed.cs:165

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

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

◆ TryDropBossLoot()

void Chara.TryDropBossLoot ( )
inline

Definition at line 5743 of file Chara.cs.

5744 {
5746 {
5747 return;
5748 }
5749 int num = 0;
5750 bool flag = false;
5751 bool flag2 = false;
5752 Point point = pos.GetNearestPoint(allowBlock: true, allowChara: false, allowInstalled: false, ignoreCenter: true) ?? pos;
5753 TreasureType type = TreasureType.BossQuest;
5754 if (EClass._zone.Boss == this)
5755 {
5756 type = TreasureType.BossNefia;
5757 num = 2 + EClass.rnd(2);
5758 flag = (flag2 = true);
5759 EClass._zone.Boss = null;
5760 Msg.Say("boss_win", EClass._zone.Name);
5762 {
5763 Msg.Say("boss_win_void", EClass._zone.Name);
5764 EClass.player.flags.KilledBossInVoid = true;
5765 }
5766 if (EClass._zone.IsNefia)
5767 {
5770 SE.Play("Jingle/fanfare2");
5771 EClass._zone.SetBGM(114, refresh: true, 3f);
5772 }
5775 }
5776 switch (id)
5777 {
5778 case "azzrasizzle":
5779 num = 5;
5780 flag = (flag2 = true);
5781 EClass.Sound.StopBGM(3f);
5782 EClass._zone.SetBGM(1, refresh: false);
5784 {
5785 EClass.game.quests.Get<QuestIntoDarkness>().UpdateOnTalk();
5786 }
5787 break;
5788 case "vernis_boss":
5789 num = 5;
5790 flag = (flag2 = true);
5791 EClass.Sound.StopBGM(3f);
5792 EClass._zone.SetBGM(1, refresh: false);
5794 {
5795 EClass.game.quests.Get<QuestVernis>().UpdateOnTalk();
5796 }
5797 break;
5798 case "lurie_boss":
5799 if (!(EClass._zone is Zone_Exile))
5800 {
5801 num = 5;
5802 flag = (flag2 = true);
5803 EClass._zone.SetBGM(120, refresh: true, 3f);
5805 {
5806 EClass.game.quests.Get<QuestNegotiationDarkness>().ChangePhase(4);
5807 EClass.player.flags.killedDuponne = true;
5808 }
5809 }
5810 break;
5811 case "ungaga_pap":
5812 num = 5;
5813 flag = (flag2 = true);
5815 {
5816 EClass._zone.SetBGM(46, refresh: true, 3f);
5817 }
5818 break;
5819 case "melilith_boss":
5820 num = 5;
5821 flag = (flag2 = true);
5822 EClass.Sound.StopBGM(3f);
5823 EClass._zone.SetBGM(1, refresh: false);
5824 break;
5825 case "doga":
5826 {
5827 QuestCurry questCurry = EClass.game.quests.Get<QuestCurry>();
5828 if (questCurry != null)
5829 {
5830 num = 5;
5831 flag = (flag2 = true);
5832 EClass.Sound.StopBGM(3f);
5833 EClass._zone.SetBGM(1, refresh: false);
5834 questCurry.NextPhase();
5835 }
5836 break;
5837 }
5838 case "fairy_raina":
5839 case "fairy_poina":
5840 {
5841 bool num2 = EClass._map.FindChara((id == "fairy_raina") ? "fairy_poina" : "fairy_raina") == null;
5842 QuestNasu questNasu = EClass.game.quests.Get<QuestNasu>();
5843 if (num2 && questNasu != null && questNasu.phase <= 1)
5844 {
5845 if (questNasu.phase == 0)
5846 {
5847 questNasu.NextPhase();
5848 }
5849 num = 5;
5850 flag = (flag2 = true);
5851 EClass.Sound.StopBGM(3f);
5852 EClass._zone.SetBGM(1, refresh: false);
5853 EClass.player.DropReward(ThingGen.Create("backpack_holding"));
5854 questNasu.NextPhase();
5855 }
5856 break;
5857 }
5858 case "isygarad":
5859 {
5860 num = 5;
5861 flag = (flag2 = true);
5862 QuestExploration questExploration = EClass.game.quests.Get<QuestExploration>();
5863 if (questExploration != null)
5864 {
5865 SE.Play("kill_boss");
5866 questExploration.ChangePhase(3);
5867 EClass.Sound.StopBGM(3f);
5868 EClass._zone.SetBGM(1, refresh: false);
5869 }
5870 break;
5871 }
5872 case "swordkeeper":
5873 num = 10;
5874 flag = true;
5875 SE.Play("kill_boss");
5876 SoundManager.ForceBGM();
5877 LayerDrama.Activate("_event", "event", "swordkeeper_defeat");
5878 break;
5879 }
5880 if (flag)
5881 {
5882 SE.Play("kill_boss");
5883 }
5884 if (num != 0)
5885 {
5887 {
5888 EClass.player.stats.deepest = EClass._zone.DangerLv;
5889 Msg.Say("update_deepest", EClass.player.stats.deepest.ToString() ?? "");
5890 }
5892 {
5893 EClass.player.stats.deepestVoid = -EClass._zone.lv;
5894 Msg.Say("update_deepest_void", EClass.player.stats.deepestVoid.ToString() ?? "");
5895 }
5896 EClass.player.willAutoSave = true;
5897 Thing thing = ThingGen.CreateTreasure("chest_boss", base.LV, type);
5898 point.SetBlock();
5899 point.SetObj();
5900 EClass._zone.AddCard(thing, point).Install();
5901 ThingGen.TryLickChest(thing);
5902 }
5903 if (flag2)
5904 {
5906 }
5907 }
TreasureType
Definition: TreasureType.cs:2
bool KilledBossInVoid
Definition: Player.cs:448
int deepest
Definition: Player.cs:114
long nefiaBeaten
Definition: Player.cs:153
int deepestVoid
Definition: Player.cs:117
void ModFame(int a)
Definition: Player.cs:2166
void SetObj(int id=0, int value=1, int dir=0)
Definition: Point.cs:928
void SetBlock(int idMat=0, int idBlock=0)
Definition: Point.cs:918
int phase
Definition: Quest.cs:40
void NextPhase()
Definition: Quest.cs:572
void ChangePhase(int a)
Definition: Quest.cs:577
bool isConquered
Definition: Spatial.cs:382
static void TryLickChest(Thing chest)
Definition: ThingGen.cs:409
static Thing CreateTreasure(string id, int lv, TreasureType type=TreasureType.Map)
Definition: ThingGen.cs:256
static Thing CreateScroll(int ele, int num=1)
Definition: ThingGen.cs:182
virtual bool IsNefia
Definition: Zone.cs:287
void SetBGM(List< int > ids, bool refresh=true, float fadeDuration=0f)
Definition: Zone.cs:3034
Chara Boss
Definition: Zone.cs:86

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

Referenced by ActEffect.Proc().

◆ TryDropCarryOnly()

void Chara.TryDropCarryOnly ( )
inline

Definition at line 4671 of file Chara.cs.

4672 {
4673 if (held != null && held.trait.CanOnlyCarry)
4674 {
4675 DropHeld();
4676 }
4677 foreach (Thing item in things.List((Thing t) => t.trait.CanOnlyCarry))
4678 {
4679 DropThing(item);
4680 }
4681 }
void DropThing(Thing t, int num=-1)
Definition: Chara.cs:4703

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

◆ TryEquip()

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

Definition at line 7927 of file Chara.cs.

7928 {
7929 if (!ShouldEquip(t, useFav))
7930 {
7931 return false;
7932 }
7933 if (t.category.slot == 0)
7934 {
7935 return false;
7936 }
7937 if (useFav)
7938 {
7939 BodySlot slot = body.GetSlot(t);
7940 switch (GetFavAttackStyle())
7941 {
7942 case AttackStyle.Default:
7943 case AttackStyle.TwoHand:
7944 if (t.IsMeleeWeapon)
7945 {
7946 slot = body.slotMainHand;
7947 }
7948 break;
7949 case AttackStyle.Shield:
7950 if (t.IsMeleeWeapon)
7951 {
7952 slot = body.slotMainHand;
7953 }
7954 break;
7955 }
7956 body.Equip(t, slot);
7957 }
7958 else
7959 {
7960 body.Equip(t);
7961 }
7962 Say("equip", this, t);
7963 return true;
7964 }
bool ShouldEquip(Thing t, bool useFav=false)
Definition: Chara.cs:7815

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

8048 {
8049 if (IsPC)
8050 {
8052 if (thing?.trait is TraitToolRange && CanEquipRanged(thing))
8053 {
8054 ranged = thing;
8055 return true;
8056 }
8057 return false;
8058 }
8059 if (ranged != null && ranged.parent == this)
8060 {
8061 return true;
8062 }
8064 return ranged != null;
8065 }
Thing GetBestRangedWeapon()
Definition: Chara.cs:8032

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

7972 {
7973 Thing dest = null;
7974 if (IsPC)
7975 {
7977 {
7978 return FindThrowable(hotbar: true);
7979 }
7980 return null;
7981 }
7982 things.Foreach(delegate(Thing t)
7983 {
7984 if (t.HasTag(CTAG.throwWeapon) || (!base.IsPCFactionOrMinion && t.HasTag(CTAG.throwWeaponEnemy)))
7985 {
7986 dest = t;
7987 }
7988 });
7989 return dest;
7990 Thing FindThrowable(bool hotbar)
7991 {
7992 things.Foreach(delegate(Thing t)
7993 {
7994 if (dest == null)
7995 {
7996 if (t.IsHotItem)
7997 {
7998 if (!hotbar)
7999 {
8000 return;
8001 }
8002 }
8003 else if (hotbar)
8004 {
8005 return;
8006 }
8007 if (t.HasTag(CTAG.throwWeapon))
8008 {
8009 dest = t;
8010 }
8011 }
8012 });
8013 return dest;
8014 }
8015 }

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

4529 {
4530 if (held == t)
4531 {
4532 return true;
4533 }
4534 if (t.isDestroyed || t.Num <= 0)
4535 {
4536 return false;
4537 }
4538 if (!CanPick(t))
4539 {
4540 if (t.parent == null)
4541 {
4542 EClass._zone.AddCard(t, pos);
4543 }
4544 return false;
4545 }
4546 HoldCard(t, num);
4547 return true;
4548 }
bool CanPick(Card c)
Definition: Chara.cs:4348
void HoldCard(Card t, int num=-1)
Definition: Chara.cs:4550

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

8194 {
8195 int num = Evalue(289);
8196 if (num == 0)
8197 {
8198 return false;
8199 }
8200 int lV = t.LV;
8201 if (EClass.rnd(num * num + 5) > EClass.rnd(lV * lV) * 20)
8202 {
8203 t.Identify(show, (num >= 20) ? IDTSource.SkillHigh : IDTSource.Skill);
8204 int num2 = 50;
8205 if (lV > num)
8206 {
8207 num2 += (lV - num) * 10;
8208 }
8209 elements.ModExp(289, Mathf.Min(num2, 1000));
8210 return true;
8211 }
8212 return false;
8213 }
IDTSource
Definition: IDTSource.cs:2
Thing Identify(bool show=true, IDTSource idtSource=IDTSource.Identify)
Definition: Thing.cs:2099

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

Referenced by Player.OnAdvanceHour().

◆ TryMove()

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

Reimplemented from Card.

Definition at line 2757 of file Chara.cs.

2758 {
2759 foreach (Condition condition in conditions)
2760 {
2761 if (!condition.TryMove(newPoint))
2762 {
2763 return MoveResult.Fail;
2764 }
2765 }
2766 if (base.isRestrained)
2767 {
2768 if (!IsPC)
2769 {
2770 return MoveResult.Fail;
2771 }
2772 base.isRestrained = false;
2773 }
2774 if (!CanMoveTo(newPoint, allowDestroyPath))
2775 {
2776 return MoveResult.Fail;
2777 }
2778 return _Move(newPoint);
2779 }
virtual bool TryMove(Point p)

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

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

◆ TryMoveTowards()

MoveResult Chara.TryMoveTowards ( Point  p)
inline

Definition at line 2695 of file Chara.cs.

2696 {
2697 if (p.Equals(pos))
2698 {
2699 return MoveResult.Success;
2700 }
2702 {
2703 return MoveResult.Fail;
2704 }
2705 bool flag = true;
2706 Point point = null;
2707 _sharedPos.Set(p);
2708 if (CanDestroyPath())
2709 {
2711 {
2712 return MoveResult.Success;
2713 }
2714 Debug.Log(CanMoveTo(pos));
2716 }
2717 int num = pos.Distance(p);
2718 PathProgress pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Default, num + 4, 1);
2719 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 4)
2720 {
2721 PathFinderNode pathFinderNode = pathProgress.nodes[pathProgress.nodes.Count - 1];
2722 if (TryMove(new Point(pathFinderNode.X, pathFinderNode.Z)) == MoveResult.Success)
2723 {
2724 return MoveResult.Success;
2725 }
2726 }
2727 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Combat, num + 4, 1);
2728 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 4)
2729 {
2730 PathFinderNode pathFinderNode2 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2731 if (TryMove(new Point(pathFinderNode2.X, pathFinderNode2.Z)) == MoveResult.Success)
2732 {
2733 return MoveResult.Success;
2734 }
2735 }
2736 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Default, num + 25, 2);
2737 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 25)
2738 {
2739 PathFinderNode pathFinderNode3 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2740 if (TryMove(new Point(pathFinderNode3.X, pathFinderNode3.Z)) == MoveResult.Success)
2741 {
2742 return MoveResult.Success;
2743 }
2744 }
2745 pathProgress = PathManager.Instance.RequestPathImmediate(pos, p, this, PathManager.MoveType.Combat, num + 25, 2);
2746 if (pathProgress.HasPath && pathProgress.nodes.Count < num + 25)
2747 {
2748 PathFinderNode pathFinderNode4 = pathProgress.nodes[pathProgress.nodes.Count - 1];
2749 if (TryMove(new Point(pathFinderNode4.X, pathFinderNode4.Z)) == MoveResult.Success)
2750 {
2751 return MoveResult.Success;
2752 }
2753 }
2754 return MoveResult.Fail;
2755 }
static Point _sharedPos
Definition: Chara.cs:176
void RequestPathImmediate(PathProgress progress)
Definition: PathManager.cs:41
List< PathFinderNode > nodes
Definition: PathProgress.cs:16
bool TooHeavyToMove()
Definition: Player.cs:2653
Point GetPointTowards(Point dest)
Definition: Point.cs:801

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

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

◆ TryNeckHunt()

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

Definition at line 9863 of file Chara.cs.

9864 {
9865 if (TC == null || TC.HasCondition<ConInvulnerable>() || TC.Evalue(1421) > 0 || !TC.ExistsOnMap)
9866 {
9867 return false;
9868 }
9869 if (TC.hp > (long)TC.MaxHP * (long)(Mathf.Min(5 + (int)Mathf.Sqrt(power), harvest ? 35 : 25) + Evalue(1426) * 5) / (TC.IsPowerful ? 200 : 100))
9870 {
9871 return false;
9872 }
9873 if (TC.HasElement(427))
9874 {
9875 return false;
9876 }
9877 if (TC.IsPC && EClass.player.invlunerable)
9878 {
9879 return false;
9880 }
9881 PlaySound("hit_finish");
9882 Say("finish");
9883 Say("finish2", this, TC);
9884 TC.DamageHP(TC.MaxHP, AttackSource.Finish, this);
9885 return false;
9886 }
@ harvest
bool invlunerable
Definition: Player.cs:1243
Definition: TC.cs:4

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

Referenced by ActEffect.Proc().

◆ TryNullifyCurse()

bool Chara.TryNullifyCurse ( )
inline

Definition at line 10337 of file Chara.cs.

10338 {
10339 if (IsPCParty)
10340 {
10341 foreach (Chara member in EClass.pc.party.members)
10342 {
10343 if (member.HasElement(1641) && EClass.rnd(3) != 0)
10344 {
10345 Msg.Say("curse_nullify", member);
10346 return true;
10347 }
10348 }
10349 }
10350 else if (HasElement(1641) && EClass.rnd(3) != 0)
10351 {
10352 Say("curse_nullify", this);
10353 return true;
10354 }
10355 if (GetCondition<ConHolyVeil>() != null && EClass.rnd(5) != 0)
10356 {
10357 Say("curse_nullify", this);
10358 return true;
10359 }
10360 return false;
10361 }

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

◆ TryPickGroundItem()

void Chara.TryPickGroundItem ( Func< Card, bool >  func = null)
inline

Definition at line 4504 of file Chara.cs.

4505 {
4506 foreach (Card item in pos.ListCards())
4507 {
4508 if ((IsPC || !(EClass.pc.ai is AI_UseCrafter aI_UseCrafter) || !aI_UseCrafter.ings.Contains(item)) && item.isThing && item.placeState == PlaceState.roaming && CanPick(item) && (func == null || func(item)))
4509 {
4510 Thing thing = Pick(item.Thing);
4511 if (thing != null && !IsPC)
4512 {
4513 thing.isNPCProperty = true;
4514 }
4515 break;
4516 }
4517 }
4518 }

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

Referenced by AI_Fish.Run().

◆ TryPoisonPotion()

Thing Chara.TryPoisonPotion ( Thing  t)
inline

Definition at line 4436 of file Chara.cs.

4437 {
4438 if (t.trait is TraitPotion && t.id != "1165" && !t.source.tag.Contains("neg") && EClass.rnd(2) == 0 && HasElement(1565))
4439 {
4440 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)
4441 .id;
4442 Say("poisonDrip", this);
4443 int num = t.Num;
4444 t.Destroy();
4445 t = ThingGen.Create(text).SetNum(num);
4446 }
4447 return t;
4448 }
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 3280 of file Chara.cs.

3281 {
3282 List<Chara> list = point.ListCharas();
3283 if (list.Count == 0)
3284 {
3285 return;
3286 }
3287 list.Copy().ForeachReverse(delegate(Chara c)
3288 {
3289 if (!c.ai.IsMoveAI && !c.IsPC && c.trait.CanBePushed && c != this && !c.noMove && (!EClass._zone.IsRegion || c.IsPCFactionOrMinion))
3290 {
3291 List<Point> list2 = new List<Point>();
3292 for (int i = point.x - 1; i <= point.x + 1; i++)
3293 {
3294 for (int j = point.z - 1; j <= point.z + 1; j++)
3295 {
3296 if (i != point.x || j != point.z)
3297 {
3298 Point point2 = new Point(i, j);
3299 if (point2.IsValid && !point2.HasChara && !point2.IsBlocked && !point2.cell.hasDoor && !point2.IsBlockByHeight(point))
3300 {
3301 list2.Add(point2);
3302 }
3303 }
3304 }
3305 }
3306 if (list2.Count > 0)
3307 {
3308 if (list2.Count > 1)
3309 {
3310 list2.ForeachReverse(delegate(Point p)
3311 {
3312 if (p.Equals(new Point(point.x + point.x - pos.x, point.z + point.z - pos.z)))
3313 {
3314 list2.Remove(p);
3315 }
3316 });
3317 }
3318 Point newPoint = list2.RandomItem();
3319 if (IsPC)
3320 {
3321 Say("displace", this, c);
3322 PlaySound("push");
3323 }
3324 else if (c.isSynced)
3325 {
3326 c.PlayEffect("push");
3327 }
3328 c.MoveByForce(newPoint, this, checkWall: true);
3329 if (!c.IsPC && c.trait is TraitRogue && EClass.rnd(3) == 0 && GetCurrency() > 20 && !HasElement(426))
3330 {
3331 int num = EClass.rndHalf(10 + Mathf.Min(GetCurrency() / 100, 1000));
3332 c.Talk("pushed");
3333 Say("pushed_money", this, c);
3334 ModCurrency(-num);
3335 c.ModCurrency(num);
3336 c.PlaySound("steal_money");
3337 }
3338 else if (IsPC && !c.IsPCParty && !c.IsUnique && c.IsHumanSpeak && EClass.rnd(5) == 0)
3339 {
3340 c.Talk("pushed");
3341 }
3342 }
3343 }
3344 });
3345 }
bool IsMoveAI
Definition: AIAct.cs:55
bool IsHumanSpeak
Definition: Chara.cs:1029

References EClass._zone, ai, TraitChara.CanBePushed, if(), IsHumanSpeak, AIAct.IsMoveAI, IsPC, Card.IsPCFactionOrMinion, IsPCParty, Spatial.IsRegion, isSynced, Card.IsUnique, Point.ListCharas(), Card.ModCurrency(), MoveByForce(), Card.noMove, Card.PlayEffect(), Card.PlaySound(), EClass.rnd(), EClass.rndHalf(), Card.Talk(), and trait.

Referenced by _Move().

◆ TryPutShared()

void Chara.TryPutShared ( Thing  t,
List< Thing containers = null,
bool  dropIfFail = true 
)
inline

Definition at line 4520 of file Chara.cs.

4521 {
4522 if (!EClass._zone.TryAddThingInSharedContainer(t, containers) && dropIfFail)
4523 {
4524 EClass._zone.AddCard(t, pos);
4525 }
4526 }
bool TryAddThingInSharedContainer(Thing t, List< Thing > containers=null, bool add=true, bool msg=false, Chara chara=null, bool sharedOnly=true)
Definition: Zone.cs:2160

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

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

7547 {
7548 if (GetInt(113) != 0)
7549 {
7550 return;
7551 }
7552 _ListItems.Clear();
7553 Thing bestRangedWeapon = GetBestRangedWeapon();
7554 foreach (Thing thing in things)
7555 {
7556 if (!thing.IsAmmo && !thing.c_isImportant)
7557 {
7558 if (thing.category.slot != 0 && !thing.isEquipped && !thing.HasTag(CTAG.gift))
7559 {
7560 _ListItems.Add(thing);
7561 }
7562 else if (thing.IsRangedWeapon && thing.category.slot == 0 && bestRangedWeapon != thing)
7563 {
7564 _ListItems.Add(thing);
7565 }
7566 }
7567 }
7568 if (_ListItems.Count == 0)
7569 {
7570 return;
7571 }
7572 List<Thing> containers2 = containers.ToList();
7573 foreach (Thing listItem in _ListItems)
7574 {
7575 EClass._zone.TryAddThingInSharedContainer(listItem, containers2, add: true, msg: true, this);
7576 }
7577 }
void Add(Act a, string s="")
Definition: ActPlan.cs:11
static List< Thing > _ListItems
Definition: Chara.cs:192

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

Referenced by AI_Idle.Run().

◆ TryReservePickupTutorial()

void Chara.TryReservePickupTutorial ( Thing  t)
inline

Definition at line 4480 of file Chara.cs.

4481 {
4482 if (t.id == "axe")
4483 {
4484 Tutorial.Reserve("tool");
4485 }
4486 if (t.category.id == "mushroom")
4487 {
4488 Tutorial.Reserve("food");
4489 }
4490 if (t.category.id == "herb")
4491 {
4492 Tutorial.Reserve("herb");
4493 }
4494 if (t.id == "pasture")
4495 {
4496 Tutorial.Reserve("pasture");
4497 }
4498 if (t.id == "log")
4499 {
4500 Tutorial.Reserve("process");
4501 }
4502 }

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

◆ TryRestock()

void Chara.TryRestock ( bool  onCreate)
inline

Definition at line 4765 of file Chara.cs.

4766 {
4767 isOnCreate = onCreate;
4768 if (onCreate || (!IsPCFaction && (base.IsUnique || trait is TraitAdventurer || trait is TraitGuard)))
4769 {
4770 RestockEquip((!EClass.core.IsGameStarted || !(EClass._zone is Zone_Music)) && onCreate);
4771 }
4772 RestockInventory(onCreate);
4773 }
void RestockInventory(bool onCreate)
Definition: Chara.cs:5096
void RestockEquip(bool onCreate)
Definition: Chara.cs:4775

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

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

◆ TrySetEnemy()

void Chara.TrySetEnemy ( Chara  c)
inline

Definition at line 6464 of file Chara.cs.

6465 {
6466 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))
6467 {
6468 SetEnemy(c);
6469 }
6470 }

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

Referenced by GoalCombat.Run().

◆ TryTakeSharedItems() [1/2]

void Chara.TryTakeSharedItems ( bool  msg = true)
inline

Definition at line 7584 of file Chara.cs.

7585 {
7587 }
void TryTakeSharedItems(bool msg=true)
Definition: Chara.cs:7584

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

7590 {
7591 if (base.isSummon || (memberType == FactionMemberType.Livestock && homeBranch != null && !homeBranch.policies.IsActive(2715)))
7592 {
7593 return;
7594 }
7595 int num = 2;
7596 int num2 = 1;
7597 int num3 = 2;
7598 bool flag = GetInt(113) == 0;
7599 int num4 = 2;
7600 int num5 = 2;
7601 int num6 = 2;
7603 {
7604 num5 = 0;
7605 num6 = 0;
7606 }
7607 foreach (Thing thing3 in things)
7608 {
7609 if (CanEat(thing3, shouldEat))
7610 {
7611 if (thing3.HasElement(757))
7612 {
7613 num2 -= thing3.Num;
7614 num -= thing3.Num;
7615 }
7616 else
7617 {
7618 num -= thing3.Num;
7619 }
7620 }
7621 if (thing3.trait.GetHealAction(this) != null)
7622 {
7623 num3 -= thing3.Num;
7624 }
7625 if (thing3.id == "polish_powder")
7626 {
7627 num4 -= thing3.Num;
7628 }
7629 if (thing3.trait is TraitBlanketColdproof)
7630 {
7631 num5 -= thing3.Num;
7632 }
7633 if (thing3.trait is TraitBlanketFireproof)
7634 {
7635 num6 -= thing3.Num;
7636 }
7637 }
7638 _ListItems.Clear();
7639 foreach (Thing container in containers)
7640 {
7641 if (!container.IsSharedContainer)
7642 {
7643 continue;
7644 }
7645 foreach (Thing thing4 in container.things)
7646 {
7647 if (!thing4.c_isImportant && thing4.IsIdentified && thing4 != EClass.pc.held)
7648 {
7649 if (num4 > 0 && thing4.id == "polish_powder")
7650 {
7651 _ListItems.Add(thing4);
7652 num4 -= thing4.Num;
7653 }
7654 else if (num5 > 0 && !HasElement(1236) && thing4.trait is TraitBlanketColdproof)
7655 {
7656 _ListItems.Add(thing4);
7657 num5 -= thing4.Num;
7658 }
7659 else if (num6 > 0 && thing4.trait is TraitBlanketFireproof)
7660 {
7661 _ListItems.Add(thing4);
7662 num6 -= thing4.Num;
7663 }
7664 else if (num2 > 0 && CanEat(thing4, shouldEat) && !thing4.c_isImportant && thing4.HasElement(757))
7665 {
7666 _ListItems.Add(thing4);
7667 num2 -= thing4.Num;
7668 }
7669 else if (num > 0 && CanEat(thing4, shouldEat) && !thing4.c_isImportant)
7670 {
7671 _ListItems.Add(thing4);
7672 num -= thing4.Num;
7673 }
7674 else if (num3 > 0 && thing4.trait.GetHealAction(this) != null)
7675 {
7676 _ListItems.Add(thing4);
7677 num3 -= thing4.Num;
7678 }
7679 else if (flag && thing4.IsEquipmentOrRanged && !thing4.HasTag(CTAG.gift) && ShouldEquip(thing4, useFav: true))
7680 {
7681 _ListItems.Add(thing4);
7682 }
7683 }
7684 }
7685 }
7686 if (_ListItems.Count == 0)
7687 {
7688 return;
7689 }
7690 _ListItems.ForeachReverse(delegate(Thing t)
7691 {
7692 if (t.IsEquipmentOrRanged)
7693 {
7694 bool flag3 = false;
7695 int slot = t.category.slot;
7696 int equipValue = t.GetEquipValue();
7697 foreach (Thing listItem in _ListItems)
7698 {
7699 if (listItem.category.slot == slot && listItem.GetEquipValue() > equipValue)
7700 {
7701 flag3 = true;
7702 break;
7703 }
7704 }
7705 if (flag3)
7706 {
7707 _ListItems.Remove(t);
7708 }
7709 }
7710 });
7711 bool flag2 = false;
7712 foreach (Thing listItem2 in _ListItems)
7713 {
7714 Thing thing = listItem2;
7715 if (things.IsFull(thing))
7716 {
7717 break;
7718 }
7719 Thing thing2 = listItem2.parent as Thing;
7720 if (thing.HasElement(757))
7721 {
7722 if (thing.Num > 1)
7723 {
7724 thing = thing.Split(1);
7725 }
7726 }
7727 else if (thing.Num > 2)
7728 {
7729 thing = thing.Split(2);
7730 }
7731 if (msg)
7732 {
7733 Say("takeSharedItem", this, thing, thing2.GetName(NameStyle.Full));
7734 }
7735 AddCard(thing);
7736 if (ShouldEquip(thing, useFav: true) && thing.category.slot != 0)
7737 {
7738 TryEquip(thing, useFav: true);
7739 flag2 = true;
7740 }
7741 }
7742 if (flag2 && flag)
7743 {
7744 TryPutSharedItems(containers);
7745 }
7746 }
bool IsIdentified
Definition: Card.cs:2417
bool HasItemProtection
bool IsActive(int id, int days=-1)
override string GetName(NameStyle style, int _num=-1)
Definition: Thing.cs:532
bool IsSharedContainer
Definition: Thing.cs:110

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

◆ TryUpgrade()

void Chara.TryUpgrade ( bool  msg = true)
inline

Definition at line 8775 of file Chara.cs.

8776 {
8777 if (!EClass.debug.enable || IsPC || !IsGlobal || !IsPCFaction)
8778 {
8779 return;
8780 }
8781 for (int i = 0; i < 100; i++)
8782 {
8783 if (base.feat == 0)
8784 {
8785 break;
8786 }
8787 if (base.c_upgrades == null)
8788 {
8789 base.c_upgrades = new CharaUpgrade();
8790 }
8791 if (base.c_upgrades.halt)
8792 {
8793 break;
8794 }
8795 Rand.SetSeed(base.uid + base.c_upgrades.count);
8796 int num = EClass.rnd(100);
8797 int num2 = 0;
8798 int num3 = 1;
8799 int num4 = 0;
8800 bool flag = false;
8801 IEnumerable<SourceElement.Row> ie = EClass.sources.elements.rows.Where((SourceElement.Row a) => !elements.Has(a) && a.category == "skill" && !a.tag.Contains("noPet"));
8802 List<Element> list = ListAvailabeFeats(pet: true);
8803 if (num >= 90 && list.Count > 0)
8804 {
8805 Element element = list.RandomItem();
8806 num2 = element.id;
8807 num4 = element.CostLearn;
8808 }
8809 else if (num >= 60 && ie.Any())
8810 {
8811 num2 = ie.RandomItem().id;
8812 num4 = 3;
8813 }
8814 else
8815 {
8816 num2 = Element.List_MainAttributesMajor.RandomItem();
8817 num4 = 1;
8818 num3 = 2;
8819 flag = true;
8820 }
8821 Rand.SetSeed();
8822 if (num4 > base.feat)
8823 {
8824 break;
8825 }
8826 base.feat -= num4;
8827 base.c_upgrades.count++;
8828 base.c_upgrades.spent += num4;
8829 bool flag2 = false;
8830 if (flag)
8831 {
8832 foreach (CharaUpgrade.Item item in base.c_upgrades.items)
8833 {
8834 if (item.idEle == num2)
8835 {
8836 item.value += num3;
8837 item.cost += num4;
8838 flag2 = true;
8839 break;
8840 }
8841 }
8842 }
8843 if (!flag2)
8844 {
8845 base.c_upgrades.items.Add(new CharaUpgrade.Item
8846 {
8847 idEle = num2,
8848 value = num3,
8849 cost = num4
8850 });
8851 }
8852 SourceElement.Row row = EClass.sources.elements.map[num2];
8853 if (row.category == "feat")
8854 {
8855 SetFeat(num2, elements.ValueWithoutLink(num2) + 1, msg: true);
8856 }
8857 else if (elements.ValueWithoutLink(row.id) == 0)
8858 {
8859 elements.Learn(row.id);
8860 }
8861 else
8862 {
8863 elements.ModBase(num2, num3);
8864 }
8865 }
8866 }
List< Element > ListAvailabeFeats(bool pet=false, bool showAll=false)
Definition: Chara.cs:10098
void Learn(int ele, int v=1)
virtual int CostLearn
Definition: ELEMENT.cs:319
static int[] List_MainAttributesMajor
Definition: ELEMENT.cs:247
static void SetSeed(int a=-1)
Definition: Rand.cs:44

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

Referenced by WindowCharaMini.Refresh().

◆ TryUse()

bool Chara.TryUse ( Thing  t)
inline

Definition at line 8076 of file Chara.cs.

8077 {
8078 if (t.id == "338" && t.blessedState >= BlessedState.Normal)
8079 {
8080 Thing thing = things.Find((Thing a) => a.IsEquipmentOrRanged && !a.isAcidproof);
8081 if (thing != null)
8082 {
8083 Say("dip", this, thing, t.GetName(NameStyle.Full, 1));
8084 SE.Change();
8085 t.trait.OnBlend(thing, this);
8086 return true;
8087 }
8088 return false;
8089 }
8090 if (t.IsNegativeGift || t.source.HasTag(CTAG.ignoreUse))
8091 {
8092 return false;
8093 }
8094 if (t.id == "cigar")
8095 {
8096 (t.trait as TraitItemProc).OnUse(this);
8097 return true;
8098 }
8099 if (t.trait.CanEat(this) && hunger.GetPhase() > ((IsPCFaction || IsPCFactionMinion) ? 2 : 0))
8100 {
8102 {
8103 target = t
8104 });
8105 return true;
8106 }
8107 if (t.trait.CanDrink(this))
8108 {
8109 Drink(t);
8110 return true;
8111 }
8112 if (t.trait.CanRead(this))
8113 {
8115 {
8116 target = t
8117 });
8118 return true;
8119 }
8120 if (base.hp < MaxHP * 90 / 100)
8121 {
8122 Action healAction = t.trait.GetHealAction(this);
8123 if (healAction != null)
8124 {
8125 healAction();
8126 return true;
8127 }
8128 }
8129 return false;
8130 }
bool isAcidproof
Definition: Card.cs:687
void SetAIImmediate(AIAct g)
Definition: Chara.cs:9136
virtual bool CanRead(Chara c)
Definition: Trait.cs:995
virtual bool CanDrink(Chara c)
Definition: Trait.cs:1013
virtual void OnBlend(Thing t, Chara c)
Definition: Trait.cs:635

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

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

◆ TryWorkOutside()

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

Definition at line 9397 of file Chara.cs.

9398 {
9399 if (EClass.world.date.IsExpired(GetInt(51)))
9400 {
9401 Expedition expedition = Expedition.Create(this, sourceWork.expedition.ToEnum<ExpeditionType>());
9402 SetInt(51, EClass.world.date.GetRaw() + 60 * (expedition.hours + 24));
9403 homeBranch.expeditions.Add(expedition);
9404 return true;
9405 }
9406 return false;
9407 }
ExpeditionType
void Add(Expedition ex)
static Expedition Create(Chara c, ExpeditionType type)
Definition: Expedition.cs:112
int hours
Definition: Expedition.cs:6
ExpeditionManager expeditions
string expedition
Definition: SourceHobby.cs:29

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

◆ UnmakeMinion()

void Chara.UnmakeMinion ( )
inline

Definition at line 2413 of file Chara.cs.

2414 {
2415 base.c_uidMaster = 0;
2416 master = null;
2417 enemy = null;
2418 foreach (Chara chara in EClass._map.charas)
2419 {
2420 if (chara.enemy == this)
2421 {
2422 chara.SetEnemy();
2423 chara.ai.Cancel();
2424 }
2425 }
2426 ai.Cancel();
2427 Refresh();
2428 }

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

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

◆ UpdateAngle()

void Chara.UpdateAngle ( )
inline

Definition at line 3649 of file Chara.cs.

3650 {
3651 if (IsPCC)
3652 {
3653 if (base.dir == 0)
3654 {
3655 angle = 225f;
3656 }
3657 else if (base.dir == 1)
3658 {
3659 angle = 135f;
3660 }
3661 else if (base.dir == 2)
3662 {
3663 angle = 45f;
3664 }
3665 else if (base.dir == 3)
3666 {
3667 angle = -45f;
3668 }
3669 }
3670 else if (base.dir == 0)
3671 {
3672 angle = 165f;
3673 }
3674 else if (base.dir == 1)
3675 {
3676 angle = 300f;
3677 }
3678 else if (base.dir == 2)
3679 {
3680 angle = 0f;
3681 }
3682 else if (base.dir == 3)
3683 {
3684 angle = 120f;
3685 }
3686 }

Referenced by OnDeserialized().

◆ UpdateSight()

void Chara.UpdateSight ( )
inline

Definition at line 3710 of file Chara.cs.

3711 {
3712 int num = 4;
3713 for (int i = -num; i < num + 1; i++)
3714 {
3715 for (int j = -num; j < num + 1; j++)
3716 {
3717 shared.Set(pos.x + i, pos.z + j);
3718 if (shared.IsValid && !shared.cell.isSeen && i >= -1 && i <= 1 && j >= -1)
3719 {
3720 _ = 1;
3721 }
3722 }
3723 }
3724 }
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/3]

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

Definition at line 5919 of file Chara.cs.

5920 {
5921 if (HasCooldown(a.id))
5922 {
5923 return false;
5924 }
5925 if (!a.ValidatePerform(this, tc, pos))
5926 {
5927 return false;
5928 }
5929 if (a.source.proc.TryGet(0) == "Heal" && HasElement(1422) && !IsPC)
5930 {
5931 List<int> list = new List<int> { 8400, 8401, 8402, 8403, 8404, 8405 };
5932 int num = list.IndexOf(a.id);
5933 if (num != -1)
5934 {
5935 int num2 = list.TryGet(num + Evalue(1422));
5936 a = elements.GetElement(num2)?.act ?? ACT.Create(num2);
5937 }
5938 }
5939 int num3 = 1;
5940 Act.Cost cost = a.GetCost(this);
5941 a.GetPower(this);
5942 int i = 1;
5943 int num4 = 0;
5944 bool flag = a.IsTargetHostileParty();
5945 bool flag2 = ability.Has(a.id);
5946 if (IsPC && HasCondition<StanceManaCost>())
5947 {
5948 num4 = Evalue(1657);
5949 }
5950 _pts.Clear();
5951 if (a.TargetType.ForceParty)
5952 {
5953 pt = true;
5954 }
5955 if (pt)
5956 {
5957 i = 0;
5958 if (flag)
5959 {
5960 ForeachEnemy(delegate
5961 {
5962 i++;
5963 });
5964 }
5965 else
5966 {
5967 ForeachParty(delegate
5968 {
5969 i++;
5970 });
5971 }
5972 }
5973 if (a is Spell && IsPC && a.vPotential < i && !flag2)
5974 {
5975 i = 1;
5976 _pts.Clear();
5977 _pts.Add(this);
5978 pt = false;
5979 }
5980 int num5 = 100;
5981 if (!a.TargetType.ForceParty && i > 1)
5982 {
5983 num5 = (IsPC ? (i * 100) : (50 + i * 50));
5984 }
5985 int num6 = cost.cost * num5 / 100;
5986 if (cost.type == Act.CostType.MP && Evalue(483) > 0)
5987 {
5988 num6 = num6 * 100 / (100 + (int)Mathf.Sqrt(Evalue(483) * 10) * 3);
5989 }
5990 if (i == 0)
5991 {
5992 if (IsPC)
5993 {
5995 }
5996 return false;
5997 }
5998 if (!IsPC && cost.type == Act.CostType.MP && mana.value < 0 && (EClass.rnd(4) != 0 || IsPCFaction || (base.IsPowerful && mana.value < -20)))
5999 {
6000 return false;
6001 }
6002 if (IsPC)
6003 {
6004 if (!Dialog.warned && cost.type == Act.CostType.MP && cost.cost > 0 && mana.value < num6 && !EClass.debug.godMode)
6005 {
6006 Card cardBk = EClass.scene.mouseTarget.card;
6007 ActPlan.warning = true;
6008 Dialog.TryWarnMana(delegate
6009 {
6010 EClass.scene.mouseTarget.card = cardBk;
6011 if (UseAbility(a, tc, pos, pt))
6012 {
6014 }
6015 });
6016 return false;
6017 }
6018 EClass.ui.CloseLayers();
6019 }
6020 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))
6021 {
6022 Say("shakeHead", this);
6023 return true;
6024 }
6025 if (tc != null && tc != this)
6026 {
6027 LookAt(tc.pos);
6028 }
6029 if (pos != null && !base.pos.Equals(pos))
6030 {
6031 LookAt(pos);
6032 }
6033 if (a.CanRapidFire && HasElement(1648))
6034 {
6035 num3 = 1 + Evalue(1648);
6036 }
6037 if (IsPC && cost.cost > 0 && a.Value == 0 && !flag2)
6038 {
6040 return false;
6041 }
6042 if (a is Spell)
6043 {
6044 string s = (isConfused ? "_cast_confuse" : (HasCondition<ConDim>() ? "_cast_dim" : ""));
6045 if (!a.source.tag.Contains("useHand"))
6046 {
6047 Say(race.castStyle.IsEmpty("cast"), this, a.source.GetName().ToLower(), s.lang());
6048 }
6049 if (IsPC)
6050 {
6051 _ = (i + 1) / 2;
6052 if (a.vPotential < i && !flag2)
6053 {
6054 Msg.Say("noSpellStock");
6055 EInput.Consume();
6056 return false;
6057 }
6058 if (num4 > 0 && (a.vPotential >= i * 2 || flag2))
6059 {
6060 if (!flag2)
6061 {
6062 a.vPotential -= i * 2;
6063 }
6064 num6 = num6 * (100 - num4 * 20) / 100;
6065 }
6066 else if (!flag2)
6067 {
6068 a.vPotential -= i;
6069 }
6071 }
6072 }
6073 else
6074 {
6075 if (IsPC && HasElement(1274) && a.vPotential < 0 && !flag2 && !a.HasTag("dontForget"))
6076 {
6077 Msg.Say("noSpellStock");
6078 EInput.Consume();
6079 return false;
6080 }
6081 if (a.source.langAct.Length != 0 && tc != null)
6082 {
6083 string text = a.source.langAct[0];
6084 string text2 = ((a.source.langAct.Length >= 2) ? a.source.langAct[1] : "");
6085 if (text == "spell_hand")
6086 {
6087 string[] list2 = Lang.GetList("attack" + race.meleeStyle.IsEmpty("Touch"));
6088 string @ref = text2.lang(list2[4]);
6089 Say(tc.IsPCParty ? "cast_hand_ally" : "cast_hand", this, tc, @ref, tc.IsPCParty ? list2[1] : list2[2]);
6090 }
6091 else
6092 {
6093 Say(text, this, tc, text2.IsEmpty() ? "" : text2.lang());
6094 }
6095 if (a.source.id == 6630)
6096 {
6097 Talk("insult_" + (base.IsMale ? "m" : "f"));
6098 }
6099 }
6100 }
6101 switch (cost.type)
6102 {
6103 case Act.CostType.MP:
6104 if (Evalue(1421) >= 2 && base.hp <= MaxHP / Mathf.Max(1, 9 - Evalue(1421) * 2))
6105 {
6106 num6 /= 2;
6107 }
6108 if (isSynced)
6109 {
6110 PlayEffect("cast");
6111 }
6112 mana.Mod(-num6);
6113 if (isDead)
6114 {
6115 return true;
6116 }
6117 elements.ModExp(304, Mathf.Clamp(num6 * 2, 1, 200));
6118 break;
6119 case Act.CostType.SP:
6120 stamina.Mod(-num6);
6121 ignoreSPAbsorb = true;
6122 break;
6123 }
6124 if (a is Spell && GetCondition<ConSilence>() != null)
6125 {
6126 Say("cast_silence", this);
6127 return true;
6128 }
6129 if (isDead)
6130 {
6131 return true;
6132 }
6133 int spellExp = elements.GetSpellExp(this, a, num5);
6134 if (EClass.rnd(100) >= CalcCastingChance(a, i) && !EClass.debug.godMode)
6135 {
6136 Say("fizzle", this);
6137 PlayEffect("fizzle");
6138 PlaySound("fizzle");
6139 if (cost.cost > 0 && a.source.lvFactor > 0)
6140 {
6141 ModExp(a.id, spellExp / 5);
6142 }
6143 RemoveCondition<ConInvisibility>();
6144 return true;
6145 }
6146 bool flag3 = true;
6147 if (a.source.cooldown > 0 && (!IsPC || !a.source.tag.Contains("CD_npc")))
6148 {
6149 AddCooldown(a.id, a.source.cooldown);
6150 }
6151 if (HasTalk("phrase_" + a.source.alias))
6152 {
6153 EClass.player.forceTalk = true;
6154 Talk("phrase_" + a.source.alias);
6155 }
6156 if (pt)
6157 {
6158 Act.forcePt = true;
6159 if (flag)
6160 {
6161 ForeachEnemy(delegate(Chara c)
6162 {
6163 a.Perform(this, c, c.pos);
6164 });
6165 }
6166 else
6167 {
6168 ForeachParty(delegate(Chara c)
6169 {
6170 a.Perform(this, c, c.pos);
6171 });
6172 }
6173 Act.forcePt = false;
6174 }
6175 else
6176 {
6177 for (int j = 0; j < num3; j++)
6178 {
6179 if (a.TargetType != TargetType.SelfParty && tc != null && !tc.IsAliveInCurrentZone)
6180 {
6181 break;
6182 }
6183 ActEffect.RapidCount = j;
6184 ActEffect.RapidDelay = a.RapidDelay;
6185 flag3 = a.Perform(this, tc, pos);
6186 }
6187 }
6188 if (flag3 && !isDead)
6189 {
6190 if (IsPC && flag2 && elements.Base(a.id) == 0 && a.PotentialAsStock)
6191 {
6192 elements.ModBase(a.id, 1);
6193 }
6194 if (cost.cost > 0 && a.source.lvFactor > 0)
6195 {
6196 ModExp(a.id, spellExp);
6197 }
6198 }
6199 ActEffect.RapidCount = 0;
6200 if (flag3 && !a.source.tag.Contains("keepInvisi") && EClass.rnd(2) == 0)
6201 {
6202 RemoveCondition<ConInvisibility>();
6203 RemoveCondition<ConDark>();
6204 }
6205 if (!base.IsPCFactionOrMinion && a.HasTag("specialAbility"))
6206 {
6207 string name = a.Name;
6208 renderer.Say("| " + name + " ");
6209 }
6210 return flag3;
6211 void ForeachEnemy(Action<Chara> action)
6212 {
6213 if (_pts.Count == 0)
6214 {
6215 for (int num10 = EClass._map.charas.Count - 1; num10 >= 0; num10--)
6216 {
6217 Chara chara3 = EClass._map.charas[num10];
6218 if (chara3 != this && CanSeeLos(chara3) && chara3.IsHostile(this))
6219 {
6220 _pts.Add(chara3);
6221 }
6222 }
6223 }
6224 for (int num11 = _pts.Count - 1; num11 >= 0; num11--)
6225 {
6226 action(_pts[num11]);
6227 }
6228 }
6229 void ForeachParty(Action<Chara> action)
6230 {
6231 if (_pts.Count == 0)
6232 {
6233 if (IsPCParty)
6234 {
6235 for (int num7 = EClass.pc.party.members.Count - 1; num7 >= 0; num7--)
6236 {
6237 Chara chara = EClass.pc.party.members[num7];
6238 if (chara == this || chara.host != null || CanSeeLos(chara))
6239 {
6240 _pts.Add(chara);
6241 }
6242 }
6243 }
6244 else
6245 {
6246 for (int num8 = EClass._map.charas.Count - 1; num8 >= 0; num8--)
6247 {
6248 Chara chara2 = EClass._map.charas[num8];
6249 if ((chara2 == this || (chara2.IsFriendOrAbove(this) && CanSeeLos(chara2))) && (chara2 == tc || _pts.Count < 3 || EClass.rnd(_pts.Count * _pts.Count) > 6))
6250 {
6251 _pts.Add(chara2);
6252 }
6253 }
6254 }
6255 }
6256 for (int num9 = _pts.Count - 1; num9 >= 0; num9--)
6257 {
6258 action(_pts[num9]);
6259 }
6260 }
6261 }
Definition: ACT.cs:6
static Act Create(int id)
Definition: ACT.cs:36
Definition: ACT.cs:62
CostType
Definition: ACT.cs:64
virtual bool Perform()
Definition: ACT.cs:266
virtual TargetType TargetType
Definition: ACT.cs:144
virtual float RapidDelay
Definition: ACT.cs:177
virtual bool ValidatePerform(Chara _cc, Card _tc, Point _tp)
Definition: ACT.cs:316
bool IsTargetHostileParty()
Definition: ACT.cs:241
virtual bool CanRapidFire
Definition: ACT.cs:175
bool HasTalk(string idTopic)
Definition: Card.cs:6981
bool Has(int id)
static List< Chara > _pts
Definition: Chara.cs:188
int CalcCastingChance(Element e, int num=1)
Definition: Chara.cs:6272
Definition: Dialog.cs:7
static bool warned
Definition: Dialog.cs:50
static void TryWarnMana(Action action)
Definition: Dialog.cs:399
int GetSpellExp(Chara c, Element e, int costMod=100)
int vPotential
Definition: ELEMENT.cs:261
virtual int GetPower(Card c)
Definition: ELEMENT.cs:1086
virtual Act.Cost GetCost(Chara c)
Definition: ELEMENT.cs:1045
virtual bool PotentialAsStock
Definition: ELEMENT.cs:341
Act act
Definition: ELEMENT.cs:399
PointTarget mouseTarget
Definition: Scene.cs:135
static TargetTypeSelfParty SelfParty
Definition: TargetType.cs:9
virtual bool ForceParty
Definition: TargetType.cs:41
Definition: ACT.cs:71
CostType type
Definition: ACT.cs:74
int cost
Definition: ACT.cs:72

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

◆ UseAbility() [2/3]

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

◆ UseAbility() [3/3]

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

Definition at line 5914 of file Chara.cs.

5915 {
5916 return UseAbility(elements.GetElement(idAct)?.act ?? ACT.Create(idAct), tc, pos, pt);
5917 }

References ACT.Create().

◆ ValidateWorks()

void Chara.ValidateWorks ( )
inline

Definition at line 9445 of file Chara.cs.

9446 {
9447 _goalWork.FindWork(this, setAI: false);
9449 }
static GoalHobby _goalHobby
Definition: Chara.cs:210
static GoalWork _goalWork
Definition: Chara.cs:208
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 5381 of file Chara.cs.

5382 {
5383 base.c_vomit++;
5384 Say("vomit", this);
5385 PlaySound("vomit");
5386 if (!EClass._zone.IsRegion)
5387 {
5388 Thing thing = ThingGen.Create("731");
5390 {
5391 thing.MakeRefFrom(this);
5392 }
5393 EClass._zone.AddCard(thing, pos);
5394 }
5395 if (HasCondition<ConAnorexia>())
5396 {
5397 ModExp(70, -50);
5398 ModExp(71, -75);
5399 ModExp(77, -100);
5400 }
5401 else if (base.c_vomit > 10)
5402 {
5403 AddCondition<ConAnorexia>();
5404 }
5405 AddCondition<ConDim>();
5406 if (HasCondition<ConAnorexia>())
5407 {
5408 ModWeight(-1 * (1 + EClass.rnd(5)));
5409 }
5410 if (hunger.GetPhase() >= 4)
5411 {
5412 DamageHP(9999L, AttackSource.Hunger);
5413 }
5414 hunger.Mod(30);
5415 }
void ModWeight(int a, bool ignoreLimit=false)
Definition: Chara.cs:10026

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

3727 {
3728 for (int num = conditions.Count - 1; num >= 0; num--)
3729 {
3730 if (conditions[num].ConsumeTurn)
3731 {
3732 return true;
3733 }
3734 }
3735 return false;
3736 }

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

7464 {
7465 n.Clear();
7466 UIItem uIItem = n.AddHeaderCard(base.Name.ToTitleCase());
7467 SetImage(uIItem.image2);
7468 uIItem.text2.SetText(race.GetText().ToTitleCase(wholeText: true) + " " + job.GetText().ToTitleCase(wholeText: true));
7469 n.AddText("");
7470 n.Build();
7471 }
void SetImage(Image image, int dir, int idSkin=0)
Definition: Card.cs:6367
Definition: UIItem.cs:5
Image image2
Definition: UIItem.cs:16
UIText text2
Definition: UIItem.cs:8
UIItem AddHeaderCard(string text, Sprite sprite=null)
Definition: UINote.cs:84
void Clear()
Definition: UINote.cs:35
UIItem AddText(string text, FontColor color=FontColor.DontChange)
Definition: UINote.cs:113
void Build()
Definition: UINote.cs:49
void SetText(string s)
Definition: UIText.cs:163

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

Member Data Documentation

◆ _ability

CharaAbility Chara._ability

Definition at line 96 of file Chara.cs.

Referenced by SetMainElement().

◆ _baseWorkElements

ElementContainer Chara._baseWorkElements

Definition at line 206 of file Chara.cs.

◆ _cbits1

BitArray32 Chara._cbits1

Definition at line 84 of file Chara.cs.

Referenced by OnSerializing().

◆ _cints

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

Definition at line 82 of file Chara.cs.

Referenced by OnDeserialized(), and OnSerializing().

◆ _cooldowns

List<int> Chara._cooldowns

◆ _faction

Faction Chara._faction
private

Definition at line 158 of file Chara.cs.

Referenced by SetFaction().

◆ _goalHobby

GoalHobby Chara._goalHobby = new GoalHobby()
staticprivate

Definition at line 210 of file Chara.cs.

◆ _goalWork

GoalWork Chara._goalWork = new GoalWork()
staticprivate

Definition at line 208 of file Chara.cs.

◆ _historyFood

List<List<string> > Chara._historyFood

Definition at line 64 of file Chara.cs.

◆ _hobbies

List<int> Chara._hobbies

Definition at line 49 of file Chara.cs.

◆ _isLevitating

bool Chara._isLevitating

Definition at line 136 of file Chara.cs.

Referenced by HasHigherGround(), and Refresh().

◆ _job

SourceJob.Row Chara._job

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

◆ _listFavFood

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

Definition at line 194 of file Chara.cs.

◆ _ListItems

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

Definition at line 192 of file Chara.cs.

◆ _NoGoalPC

NoGoal Chara._NoGoalPC = new NoGoal()
static

Definition at line 198 of file Chara.cs.

◆ _NoGoalRepeat

NoGoal Chara._NoGoalRepeat = new NoGoal()
static

Definition at line 200 of file Chara.cs.

Referenced by ActPlan.Item.Perform().

◆ _pts

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

Definition at line 188 of file Chara.cs.

◆ _race

SourceRace.Row Chara._race

Definition at line 162 of file Chara.cs.

Referenced by ChangeRace(), and OnCreate().

◆ _sharedPos

Point Chara._sharedPos = new Point()
staticprivate

Definition at line 176 of file Chara.cs.

Referenced by TryMoveTowards().

◆ _Speed

long Chara._Speed
private

Definition at line 174 of file Chara.cs.

Referenced by RefreshSpeed().

◆ _strs

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

Definition at line 79 of file Chara.cs.

◆ _tactics

Tactics Chara._tactics

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

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

◆ ai

◆ body

◆ bossText

bool Chara.bossText

Definition at line 146 of file Chara.cs.

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

◆ calmCheckTurn

int Chara.calmCheckTurn

Definition at line 118 of file Chara.cs.

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

◆ canSeeInvisible

bool Chara.canSeeInvisible

Definition at line 140 of file Chara.cs.

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

◆ combatCount

int Chara.combatCount

Definition at line 116 of file Chara.cs.

◆ conditions

◆ conSleep

◆ consumeTurn

bool Chara.consumeTurn
static

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

Referenced by RefreshSpeed(), and SetDirtySpeed().

◆ emoIcon

Emo2 Chara.emoIcon

Definition at line 108 of file Chara.cs.

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

◆ enemy

◆ faithElements

◆ global

◆ goalList

GoalList Chara.goalList = new GoalList()

Definition at line 202 of file Chara.cs.

◆ happiness

int Chara.happiness

Definition at line 110 of file Chara.cs.

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

◆ hasMovedThisTurn

bool Chara.hasMovedThisTurn
private

Definition at line 178 of file Chara.cs.

Referenced by _Move().

◆ hasTelepathy

bool Chara.hasTelepathy

◆ held

◆ host

◆ idleActTimer

int Chara.idleActTimer

Definition at line 114 of file Chara.cs.

Referenced by AI_Idle.Run().

◆ idleTimer

float Chara.idleTimer

Definition at line 122 of file Chara.cs.

Referenced by CharaRenderer.UpdatePosition().

◆ IDTimeTable

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

Definition at line 15 of file Chara.cs.

◆ ignoreSPAbsorb

bool Chara.ignoreSPAbsorb

Definition at line 148 of file Chara.cs.

◆ isBerserk

bool Chara.isBerserk

◆ isBlind

◆ isConfused

◆ isCreated

bool Chara.isCreated

Definition at line 138 of file Chara.cs.

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

◆ isDrunk

bool Chara.isDrunk

Definition at line 126 of file Chara.cs.

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

◆ isFainted

bool Chara.isFainted

Definition at line 130 of file Chara.cs.

◆ isOnCreate

bool Chara.isOnCreate
static

Definition at line 186 of file Chara.cs.

◆ isParalyzed

bool Chara.isParalyzed

Definition at line 134 of file Chara.cs.

Referenced by Point.ListWitnesses().

◆ isWeakToSunlight

bool Chara.isWeakToSunlight

Definition at line 154 of file Chara.cs.

Referenced by Refresh().

◆ isWet

bool Chara.isWet

◆ lastPos

Point Chara.lastPos = new Point()

Definition at line 90 of file Chara.cs.

Referenced by _Move().

◆ ListAdvJob

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

Definition at line 170 of file Chara.cs.

Referenced by OnCreate().

◆ ListAdvRace

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

Definition at line 168 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

◆ memberType

◆ mimicry

◆ nextUse

Thing Chara.nextUse

Definition at line 100 of file Chara.cs.

Referenced by AI_Idle.Run().

◆ orgPos

◆ parasite

◆ party

Party Chara.party

Definition at line 43 of file Chara.cs.

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

◆ path

PathProgress Chara.path = new PathProgress()

Definition at line 92 of file Chara.cs.

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

◆ pccData

◆ preventRegen

bool Chara.preventRegen
static

Definition at line 184 of file Chara.cs.

◆ quest

◆ ranged

◆ rawSlots

int [] Chara.rawSlots

Definition at line 73 of file Chara.cs.

Referenced by OnSerializing().

◆ resistCon

Dictionary<int, int> Chara.resistCon

Definition at line 216 of file Chara.cs.

◆ ride

◆ shared

Point Chara.shared = new Point()
staticprivate

Definition at line 11 of file Chara.cs.

◆ sharedCheckTurn

int Chara.sharedCheckTurn

Definition at line 120 of file Chara.cs.

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

◆ source

◆ spriteReplacer

SpriteReplacer Chara.spriteReplacer

Definition at line 156 of file Chara.cs.

Referenced by LayerEditSkin.RefreshImage().

◆ stealthSeen

int Chara.stealthSeen

Definition at line 190 of file Chara.cs.

◆ tempElements

◆ turnLastSeen

int Chara.turnLastSeen = -100

Definition at line 112 of file Chara.cs.

Referenced by AI_Idle.Run().

◆ visibleWithTelepathy

bool Chara.visibleWithTelepathy

◆ wasInWater

bool Chara.wasInWater

Definition at line 150 of file Chara.cs.

Referenced by _Move().

◆ workElements

ElementContainer Chara.workElements

Definition at line 40 of file Chara.cs.

Property Documentation

◆ _affinity

int Chara._affinity
getset

Definition at line 304 of file Chara.cs.

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

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

◆ _alias

string Chara._alias
getset

Definition at line 220 of file Chara.cs.

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

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

◆ _idTimeTable

int Chara._idTimeTable
getset

Definition at line 342 of file Chara.cs.

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

Referenced by OnCreate().

◆ _maxStamina

int Chara._maxStamina
getset

Definition at line 366 of file Chara.cs.

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

Referenced by CalculateMaxStamina().

◆ ability

◆ actorPrefab

override string Chara.actorPrefab
get

Definition at line 520 of file Chara.cs.

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

◆ affinity

◆ Aka

◆ AliasMaterialOnCreate

override string Chara.AliasMaterialOnCreate
get

Definition at line 560 of file Chara.cs.

◆ baseWorkElements

ElementContainer Chara.baseWorkElements
get

Definition at line 1136 of file Chara.cs.

1137 {
1138 get
1139 {
1140 if (_baseWorkElements == null)
1141 {
1143 foreach (Hobby item in ListHobbies())
1144 {
1145 Build(item);
1146 }
1147 foreach (Hobby item2 in ListWorks())
1148 {
1149 Build(item2);
1150 }
1151 }
1152 return _baseWorkElements;
1153 void Build(Hobby h)
1154 {
1155 if (!h.source.elements.IsEmpty())
1156 {
1157 for (int i = 0; i < h.source.elements.Length; i += 2)
1158 {
1159 int ele = h.source.elements[i];
1160 int v = h.source.elements[i + 1];
1161 _baseWorkElements.ModBase(ele, v);
1162 }
1163 }
1164 }
1165 }
1166 }
ElementContainer _baseWorkElements
Definition: Chara.cs:206

◆ bladder

Stats Chara.bladder
get

Definition at line 1176 of file Chara.cs.

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

◆ burden

◆ CanGainConResist

bool Chara.CanGainConResist
get

Definition at line 1186 of file Chara.cs.

1187 {
1188 get
1189 {
1190 if (base.rarity >= Rarity.Legendary)
1191 {
1192 return !IsPCFaction;
1193 }
1194 return false;
1195 }
1196 }

◆ CanOpenDoor

bool Chara.CanOpenDoor
get

Definition at line 832 of file Chara.cs.

833 {
834 get
835 {
836 if (base.INT < 5)
837 {
838 if (IsPCFaction)
839 {
840 return memberType == FactionMemberType.Default;
841 }
842 return false;
843 }
844 return true;
845 }
846 }

◆ CanWitness

bool Chara.CanWitness
get

Definition at line 1016 of file Chara.cs.

1017 {
1018 get
1019 {
1020 if (!IsHuman && !IsFairy && !IsGod)
1021 {
1022 return race.id == "mutant";
1023 }
1024 return true;
1025 }
1026 }
bool IsFairy
Definition: Chara.cs:953
bool IsGod
Definition: Chara.cs:965

Referenced by Point.ListWitnesses().

◆ corruption

int Chara.corruption
getset

Definition at line 378 of file Chara.cs.

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

Referenced by CanDuplicate().

◆ CurrentGeneSlot

int Chara.CurrentGeneSlot
get

Definition at line 1096 of file Chara.cs.

1097 {
1098 get
1099 {
1100 if (base.c_genes != null)
1101 {
1102 return base.c_genes.GetGeneSlot(this);
1103 }
1104 return 0;
1105 }
1106 }

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

◆ CurrentSpan

TimeTable.Span Chara.CurrentSpan
get

Definition at line 850 of file Chara.cs.

Referenced by ConSleep.Tick().

◆ currentZone

Zone Chara.currentZone
getset

Definition at line 256 of file Chara.cs.

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

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

◆ daysStarved

int Chara.daysStarved
getset

Definition at line 330 of file Chara.cs.

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

◆ depression

Stats Chara.depression
get

Definition at line 1174 of file Chara.cs.

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

◆ DestDist

int Chara.DestDist
get

Definition at line 1012 of file Chara.cs.

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

◆ DV

override int Chara.DV
get

Definition at line 742 of file Chara.cs.

743 {
744 get
745 {
746 if (IsPCFaction)
747 {
748 return WeaknessMod(elements.Value(64));
749 }
750 int num = base.LV;
751 if (num > 50)
752 {
753 num = 50 + (num - 50) / 10;
754 }
755 return WeaknessMod(num + elements.Value(64) * (100 + num + race.DV * 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().

◆ faction

Faction Chara.faction
getset

Definition at line 428 of file Chara.cs.

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

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

◆ faith

◆ flipX

override bool Chara.flipX
get

Definition at line 548 of file Chara.cs.

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

Referenced by CharaActor.RefreshSprite().

◆ GeneCostMTP

int Chara.GeneCostMTP
get

Definition at line 1084 of file Chara.cs.

1085 {
1086 get
1087 {
1088 if (!IsPC)
1089 {
1090 return 100;
1091 }
1092 return 5;
1093 }
1094 }

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

◆ goalListType

GoalListType Chara.goalListType
getset

Definition at line 280 of file Chara.cs.

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

◆ HasHost

override bool Chara.HasHost
get

Definition at line 702 of file Chara.cs.

Referenced by ActEffect.Proc().

◆ HasNoGoal

◆ homeBranch

◆ homeZone

◆ hostility

◆ hunger

◆ hygiene

Stats Chara.hygiene
get

Definition at line 1178 of file Chara.cs.

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

◆ idFaction

string Chara.idFaction
getset

Definition at line 244 of file Chara.cs.

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

◆ idFaith

string Chara.idFaith
getset

Definition at line 232 of file Chara.cs.

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

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

◆ IDPCCBodySet

string Chara.IDPCCBodySet
get

Definition at line 492 of file Chara.cs.

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

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

◆ idTimeTable

string Chara.idTimeTable
get

Definition at line 470 of file Chara.cs.

Referenced by LayerQuestBoard.RefreshHire().

◆ interest

int Chara.interest
getset

Definition at line 318 of file Chara.cs.

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

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

◆ IsAdventurer

bool Chara.IsAdventurer
get

Definition at line 1054 of file Chara.cs.

1055 {
1056 get
1057 {
1058 if (global != null && faction != EClass.pc.faction)
1059 {
1060 return IsPCC;
1061 }
1062 return false;
1063 }
1064 }

◆ isAlawysVisible

bool Chara.isAlawysVisible
getset

Definition at line 402 of file Chara.cs.

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

◆ IsAliveInCurrentZone

◆ IsAnimal

bool Chara.IsAnimal
get

Definition at line 880 of file Chara.cs.

881 {
882 get
883 {
884 if (!race.IsAnimal)
885 {
886 return HasTag(CTAG.animal);
887 }
888 return true;
889 }
890 }

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

◆ IsCat

bool Chara.IsCat
get

Definition at line 1000 of file Chara.cs.

1001 {
1002 get
1003 {
1004 if (!(race.id == "cat") && !(race.id == "catsister"))
1005 {
1006 return race.id == "catgod";
1007 }
1008 return true;
1009 }
1010 }

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

◆ isChara

override bool Chara.isChara
get

Definition at line 700 of file Chara.cs.

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

◆ isDead

◆ IsDeadOrSleeping

override bool Chara.IsDeadOrSleeping
get

◆ IsDisabled

override bool Chara.IsDisabled
get

◆ IsDragon

bool Chara.IsDragon
get

Definition at line 976 of file Chara.cs.

977 {
978 get
979 {
980 if (!race.IsDragon)
981 {
982 return HasTag(CTAG.dragon);
983 }
984 return true;
985 }
986 }

◆ IsEyth

bool Chara.IsEyth
get

Definition at line 1066 of file Chara.cs.

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

◆ IsFairy

bool Chara.IsFairy
get

Definition at line 952 of file Chara.cs.

953 {
954 get
955 {
956 if (!race.IsFairy)
957 {
958 return HasTag(CTAG.fairy);
959 }
960 return true;
961 }
962 }

Referenced by Faction.IsWearingPanty().

◆ IsFish

bool Chara.IsFish
get

Definition at line 940 of file Chara.cs.

941 {
942 get
943 {
944 if (!race.IsFish)
945 {
946 return HasTag(CTAG.fish);
947 }
948 return true;
949 }
950 }

◆ IsGlobal

◆ IsGod

bool Chara.IsGod
get

Definition at line 964 of file Chara.cs.

965 {
966 get
967 {
968 if (!race.IsGod)
969 {
970 return HasTag(CTAG.god);
971 }
972 return true;
973 }
974 }

◆ IsHorror

bool Chara.IsHorror
get

Definition at line 928 of file Chara.cs.

929 {
930 get
931 {
932 if (!race.IsHorror)
933 {
934 return HasTag(CTAG.horror);
935 }
936 return true;
937 }
938 }

Referenced by Refresh().

◆ IsHuman

bool Chara.IsHuman
get

Definition at line 892 of file Chara.cs.

893 {
894 get
895 {
896 if (!race.IsHuman)
897 {
898 return HasTag(CTAG.human);
899 }
900 return true;
901 }
902 }

Referenced by CharaRenderer.DrawHat(), AI_Fuck.Finish(), Biography.Generate(), Faction.IsWearingPanty(), Card.MakeFoodFrom(), FoodEffect.Proc(), AI_Fuck.Run(), and AI_Idle.Run().

◆ IsHumanSpeak

bool Chara.IsHumanSpeak
get

Definition at line 1028 of file Chara.cs.

1029 {
1030 get
1031 {
1032 if (!IsHuman && !race.tag.Contains("humanSpeak"))
1033 {
1034 return HasTag(CTAG.humanSpeak);
1035 }
1036 return true;
1037 }
1038 }

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

◆ IsIdle

bool Chara.IsIdle
get

Definition at line 866 of file Chara.cs.

867 {
868 get
869 {
870 if (!IsDeadOrSleeping)
871 {
872 return ai.Current.IsIdle;
873 }
874 return false;
875 }
876 }
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 598 of file Chara.cs.

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

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

◆ IsLocalChara

bool Chara.IsLocalChara
get

Definition at line 854 of file Chara.cs.

855 {
856 get
857 {
858 if (!IsGlobal && !base.isSubsetCard)
859 {
860 return homeZone == EClass._zone;
861 }
862 return false;
863 }
864 }

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

◆ IsMachine

bool Chara.IsMachine
get

Definition at line 916 of file Chara.cs.

917 {
918 get
919 {
920 if (!race.IsMachine)
921 {
922 return HasTag(CTAG.machine);
923 }
924 return true;
925 }
926 }

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

◆ IsMaid

bool Chara.IsMaid
get

Definition at line 1040 of file Chara.cs.

1041 {
1042 get
1043 {
1044 if (EClass.Branch != null)
1045 {
1046 return EClass.Branch.uidMaid == base.uid;
1047 }
1048 return false;
1049 }
1050 }

Referenced by FactionBranch.GetMaid().

◆ IsMarried

bool Chara.IsMarried
get

Definition at line 610 of file Chara.cs.

611 {
612 get
613 {
614 if (base.c_love != null)
615 {
616 return base.c_love.dateMarriage != 0;
617 }
618 return false;
619 }
620 }

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

◆ IsMinion

override bool Chara.IsMinion
get

Definition at line 640 of file Chara.cs.

641 {
642 get
643 {
644 if (master == null)
645 {
646 return base.c_uidMaster != 0;
647 }
648 return true;
649 }
650 }

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

◆ IsMofuable

bool Chara.IsMofuable
get

Definition at line 1124 of file Chara.cs.

1125 {
1126 get
1127 {
1128 if (!race.tag.Contains("mofu"))
1129 {
1130 return HasElement(419);
1131 }
1132 return true;
1133 }
1134 }

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

◆ IsMoving

override bool Chara.IsMoving
get

Definition at line 622 of file Chara.cs.

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

◆ IsMultisize

◆ IsPC

override bool Chara.IsPC
get

Definition at line 626 of file Chara.cs.

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

◆ IsPCC

◆ IsPCFaction

override bool Chara.IsPCFaction
get

Definition at line 684 of file Chara.cs.

685 {
686 get
687 {
688 if (EClass.pc != null)
689 {
690 return faction == EClass.pc.faction;
691 }
692 return false;
693 }
694 }

Referenced by _Move(), ActPlan._Update(), Element._WriteNote(), GameDate.AdvanceDay(), GameDate.AdvanceHour(), LayerShippingResult.Awake(), DramaCustomSequence.Build(), CallHelp(), TraitTrolley.CanActivate(), Thing.CanAutoFire(), CanBeTempAlly(), TraitSalesTag.CanTagSale(), ElementContainerFaction.CheckDirty(), Map.CountHostile(), Map.CountNonHostile(), Map.CountWildAnimal(), AI_Torture.CreateProgress(), ActionMode.DoFunc(), DoHostileAction(), AI_Fuck.Finish(), Element.IsFactionElement(), Quest.IsVisibleOnQuestBoard(), ElementContainer.ListElements(), Point.ListWitnesses(), ActEffect.LoveMiracle(), AI_Fish.Makefish(), StatsMana.Mod(), Zone.OnActivate(), Zone_LittleGarden.OnActivate(), TraitHitchingPost.OnActivateTrap(), GlobalGoalAdv.OnAdvanceHour(), QuestNasu.OnComplete(), ElementContainerFaction.OnEquip(), Zone_SubTown.OnGenerateRooms(), BaseListPeople.OnInstantiate(), ElementContainerFaction.OnJoinFaith(), QuestTaskHunt.OnKillChara(), ElementContainerFaction.OnLeaveFaith(), ElementContainerCard.OnLevelDown(), ElementContainerCard.OnLevelUp(), ListPeopleBed.OnList(), ListPeopleParty.OnList(), Game.OnLoad(), ElementContainerFaction.OnUnequip(), Zone.OnVisit(), ZoneEventWedding.OnVisit(), AttackProcess.Perform(), FoodEffect.Proc(), ActEffect.Proc(), TraitBaseSpellbook.ReadFailEffect(), TraitGeneratorWheel.Refresh(), WindowChara.RefreshProfile(), LayerQuestBoard.RefreshRanking(), RefreshSpeed(), RequestProtection(), Zone.ResetHostility(), CoreDebug.ResetPetUpgrades(), ActRide.Ride(), AI_Fish.Run(), AI_Fuck.Run(), AI_Idle.Run(), AI_PlayMusic.Run(), AI_Steal.Run(), GoalCombat.Run(), TraitGeneratorWheel.ShouldWork(), Zone.Simulate(), ConMiasma.Tick(), ConSleep.Tick(), 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 668 of file Chara.cs.

669 {
670 get
671 {
672 if (master != null)
673 {
674 if (!master.IsPCFaction)
675 {
677 }
678 return true;
679 }
680 return false;
681 }
682 }

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

◆ IsPCParty

override bool Chara.IsPCParty
get

Definition at line 628 of file Chara.cs.

629 {
630 get
631 {
632 if (party != null)
633 {
634 return party.leader == EClass.pc;
635 }
636 return false;
637 }
638 }

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

◆ IsPCPartyMinion

override bool Chara.IsPCPartyMinion
get

Definition at line 652 of file Chara.cs.

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

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

◆ IsPlant

bool Chara.IsPlant
get

Definition at line 988 of file Chara.cs.

989 {
990 get
991 {
992 if (!race.IsPlant)
993 {
994 return HasTag(CTAG.plant);
995 }
996 return true;
997 }
998 }

Referenced by GoalCombat.Run().

◆ IsPrisoner

bool Chara.IsPrisoner
get

Definition at line 1052 of file Chara.cs.

◆ isSynced

override bool Chara.isSynced
get

◆ isThing

override bool Chara.isThing
get

Definition at line 698 of file Chara.cs.

◆ IsUndead

bool Chara.IsUndead
get

Definition at line 904 of file Chara.cs.

905 {
906 get
907 {
908 if (!race.IsUndead)
909 {
910 return HasTag(CTAG.undead);
911 }
912 return true;
913 }
914 }

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

◆ IsWealthy

bool Chara.IsWealthy
get

Definition at line 1068 of file Chara.cs.

1069 {
1070 get
1071 {
1072 if (!source.works.Contains("Rich"))
1073 {
1074 return source.hobbies.Contains("Rich");
1075 }
1076 return true;
1077 }
1078 }

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

◆ job

◆ knowFav

bool Chara.knowFav
getset

Definition at line 414 of file Chara.cs.

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

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

◆ MainElement

Element Chara.MainElement
get

Definition at line 730 of file Chara.cs.

731 {
732 get
733 {
734 if (base.c_idMainElement == 0)
735 {
736 return Element.Void;
737 }
738 return elements.GetElement(base.c_idMainElement);
739 }
740 }

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

◆ mana

◆ MaxGeneSlot

int Chara.MaxGeneSlot
get

◆ MaxHP

◆ MaxSummon

int Chara.MaxSummon
get

◆ NameBraced

◆ NameTitled

string Chara.NameTitled
get

Definition at line 518 of file Chara.cs.

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

◆ OriginalHostility

Hostility Chara.OriginalHostility
get

Definition at line 472 of file Chara.cs.

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

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

◆ Pref

override SourcePref Chara.Pref
get

Definition at line 800 of file Chara.cs.

801 {
802 get
803 {
804 if (spriteReplacer == null)
805 {
806 if (base.idSkin > 0)
807 {
808 switch (sourceCard.tiles.TryGet(base.idSkin))
809 {
810 case 2319:
811 case 2619:
812 case 2621:
813 case 2623:
814 case 2625:
816 case 2320:
817 case 2611:
818 case 2620:
819 case 2622:
820 case 2624:
821 case 2626:
822 case 2828:
824 }
825 }
827 }
829 }
830 }
SourcePref snowputit2
Definition: CoreRef.cs:326
SourcePref sonwputit1
Definition: CoreRef.cs:324
SourcePref replacer1
Definition: CoreRef.cs:330
PrefData prefs
Definition: CoreRef.cs:417
CoreRef refs
Definition: Core.cs:51
SpriteReplacer replacer
Definition: RenderRow.cs:89
SourcePref pref
Definition: RenderRow.cs:68
SourcePref pref
Definition: SpriteData.cs:30
SpriteData data

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

◆ PrefIndex

override int Chara.PrefIndex
get

Definition at line 532 of file Chara.cs.

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

◆ PV

override int Chara.PV
get

Definition at line 771 of file Chara.cs.

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

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

◆ race

◆ SAN

◆ SelfWeight

override int Chara.SelfWeight
get

Definition at line 726 of file Chara.cs.

◆ sleepiness

Stats Chara.sleepiness
get

◆ sourceCard

override CardRow Chara.sourceCard
get

◆ sourceRenderCard

override CardRow Chara.sourceRenderCard
get

Definition at line 454 of file Chara.cs.

455 {
456 get
457 {
458 if (pccData != null && !(source.renderData is RenderDataPcc))
459 {
461 }
462 return source;
463 }
464 }
static Row rowDefaultPCC
Definition: SourceChara.cs:154

◆ Speed

int Chara.Speed
get

Definition at line 1108 of file Chara.cs.

1109 {
1110 get
1111 {
1112 if (dirtySpeed)
1113 {
1114 RefreshSpeed();
1115 }
1116 if (_Speed > 100000000)
1117 {
1118 return 100000000;
1119 }
1120 return (int)_Speed;
1121 }
1122 }

Referenced by GameUpdater.ConditionUpdater.FixedUpdate().

◆ stamina

◆ tactics

Tactics Chara.tactics
get

Definition at line 848 of file Chara.cs.

◆ trait

◆ uidEditor

int Chara.uidEditor
getset

Definition at line 354 of file Chara.cs.

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

Referenced by SerializedCards.Add().

◆ WeightLimit

override int Chara.WeightLimit
get

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