terraria-cpp2il v1.4.4.9
Terraria mobile dump, with CallAnalysis (see source code). Dump with reconstucted method: https://infinitynichto.github.io/terraria-cpp2il-methodrecon
Loading...
Searching...
No Matches
Terraria.NPC Class Reference
+ Inheritance diagram for Terraria.NPC:
+ Collaboration diagram for Terraria.NPC:

Public Member Functions

NPCAimedTarget GetTargetData (bool ignorePlayerTankPets=true)
 
int GetAttackDamage_ScaledByStrength (float normalDamage)
 
float GetAttackDamage_LerpBetweenFinalValuesFloat (float normalDamage, float expertDamage)
 
int GetAttackDamage_LerpBetweenFinalValues (float normalDamage, float expertDamage)
 
int GetAttackDamage_ForProjectiles (float normalDamage, float expertDamage)
 
int GetAttackDamage_ForProjectiles_MultiLerp (float normalDamage, float expertDamage, float masterDamage)
 
void SpawnWithHigherTime (int timeMult)
 
void EncourageDespawn (int despawnTime)
 
void DiscourageDespawn (int despawnTime)
 
NetworkText GetTypeNetName ()
 
void GetLifeStats (out int statLife, out int statLifeMax)
 
float GetLifePercent ()
 
NetworkText GetFullNetName ()
 
NetworkText GetGivenOrTypeNetName ()
 
NetworkText GetGivenNetName ()
 
int GetBossHeadTextureIndex ()
 
float GetBossHeadRotation ()
 
SpriteEffects GetBossHeadSpriteEffects ()
 
int BannerID ()
 
void SetDefaultsKeepPlayerInteraction (int Type)
 
void SetDefaults_ForNetId (int Type, float scaleOverride)
 
void SetDefaults_ForNetId (int Type, NPCSpawnParams spawnparams, float scaleOverride)
 
void SetNetShimmerEffect ()
 
void SetDefaults (int Type, NPCSpawnParams spawnparams=default(NPCSpawnParams))
 
NPCSpawnParams GetMatchingSpawnParams ()
 
void ScaleStats (int? activePlayersCount, GameModeData gameModeData, float? strengthOverride)
 
void ScaleStats_UseStrengthMultiplier (float strength)
 
float GetMyBalance ()
 
void PopAllAttachedProjectilesAndTakeDamageForThem ()
 
bool AI_AttemptToFindTeleportSpot (ref Vector2 chosenTile, int targetTileX, int targetTileY, int rangeFromTargetTile=20, int telefragPreventionDistanceInTiles=5, int solidTileCheckFluff=1, bool solidTileCheckCentered=false, bool teleportInAir=false)
 
void AI ()
 
void AI_122_PirateGhost ()
 
void AI_000_TransformBoundNPC (int playerID, int npcType)
 
bool AI_120_HallowBoss_IsInPhase2 ()
 
bool AI_120_HallowBoss_IsGenuinelyEnraged ()
 
bool Boss_CanShootExtraAt (int playerIndex, int rotationIndexToAttack, int rotationSize, float attackScanDistance, bool alwaysSkipMainTarget=true)
 
NPC AI_113_WindyBalloon_GetSlaveNPC ()
 
void CopyInteractions (NPC npc)
 
Vector2 GetMechQueenCenter ()
 
void UpdateHomeTileState (bool homeless, int x, int y)
 
Color GetMagicAuraColor ()
 
bool NPCCanStickToWalls ()
 
void AI_001_SetRainbowSlimeColor ()
 
void ReflectProjectiles (Rectangle myRect)
 
bool CanReflectProjectile (Projectile proj)
 
void BloodNautilus_GetMouthPositionAndRotation (out Vector2 mouthPosition, out Vector2 mouthDirection)
 
void ReflectProjectile (Projectile proj)
 
int GetShootingFrame (float circleY)
 
Tuple< Vector2, float > GetSwingStats (int swingMax, int swingCurrent, int aimDir, int itemWidth, int itemHeight)
 
void TweakSwingStats (int swingMax, int swingCurrent, int aimDir, ref Rectangle itemRectangle)
 
bool UsesPartyHat ()
 
PartyHatColor GetPartyHatColor ()
 
void SetFrameSize ()
 
void FindFrame ()
 
void SimpleFlyMovement (Vector2 desiredVelocity, float moveSpeed)
 
void HealEffect (int healAmount, bool broadcast=true)
 
int FindClosestPlayer ()
 
int FindClosestPlayer (out float distanceToPlayer)
 
void BigMimicSpawnSmoke ()
 
bool ShouldFaceTarget (ref NPCUtils.TargetSearchResults searchResults, NPCUtils.TargetType? overrideTargetType=null)
 
void FaceTarget ()
 
void TargetClosestUpgraded (bool faceTarget=true, Vector2? checkPosition=null)
 
void TargetClosest (bool faceTarget=true)
 
void TargetClosest_WOF (bool faceTarget=true)
 
bool DoesntDespawnToInactivityAndCountsNPCSlots ()
 
bool DoesntDespawnToInactivity ()
 
void CheckActive ()
 
void checkDead ()
 
void DropTombstoneTownNPC (NetworkText deathText)
 
bool AnyInteractions ()
 
bool IsDamageDodgeable ()
 
void NPCLoot ()
 
bool IsNPCValidForBestiaryKillCredit ()
 
bool ExcludedFromDeathTally ()
 
bool GetWereThereAnyInteractions ()
 
void DropItemInstanced (Vector2 Position, Vector2 HitboxSize, int itemType, int itemStack=1, bool interactionRequired=true)
 
void PlayerInteraction (int player)
 
void ApplyInteraction (int player)
 
bool RerollVariation ()
 
void TransformVisuals (int oldType, int newType)
 
void Teleport (Vector2 newPos, int Style=0, int extraInfo=0)
 
void Transform (int newType)
 
int checkArmorPenetration (int armorPenetration, float armorPenetrationPercent)
 
double StrikeNPCNoInteraction (int Damage, float knockBack, int hitDirection, bool crit=false, bool noEffect=false, bool fromNet=false)
 
double StrikeNPC (int Damage, float knockBack, int hitDirection, bool crit=false, bool noEffect=false, bool fromNet=false)
 
void HitEffect (int hitDirection=0, double dmg=10.0)
 
int FindBuffIndex (int type)
 
void AddBuff (int type, int time, bool quiet=false)
 
void RequestBuffRemoval (int buffTypeToRemove)
 
void DelBuff (int buffIndex)
 
Rectangle getRect ()
 
bool CanBeChasedBy (object attacker=null, bool ignoreDontTakeDamage=false)
 
bool HittableForOnHitRewards ()
 
void moneyPing (Vector2 pos)
 
void IdleSounds ()
 
void UpdateAltTexture ()
 
void UpdateNPC (int i)
 
IEntitySource GetItemSource_Misc (int itemSourceId)
 
IEntitySource GetSpawnSource_NPCHurt ()
 
IEntitySource GetSpawnSource_ForProjectile ()
 
IEntitySource GetSpawnSourceForProjectileNPC ()
 
IEntitySource GetSpawnSourceForNPCFromNPCAI ()
 
IEntitySource GetItemSource_Loot ()
 
bool CanApplyHunterPotionEffects ()
 
Color GetNPCColorTintedByBuffs (Color npcColor)
 
void AttemptToConvertNPCToEvil (bool crimson)
 
void UpdateNPC_BuffSetFlags (bool lowerBuffTime=true)
 
void GetImmuneTime (int fromWho, int time)
 
void GetTileCollisionParameters (out Vector2 cPosition, out int cWidth, out int cHeight)
 
Color GetBestiaryEntryColor ()
 
Color GetAlpha (Color newColor)
 
Color GetShimmerColor (Color newColor)
 
Color GetColor (Color newColor)
 
bool ShouldBestiaryGirlBeLycantrope ()
 
string GetChat ()
 
object Clone ()
 
bool HasLuckTextForWizard (out string specialEventText)
 
bool HasSpecialEventText (string specialTextCategoryKey, out string specialEventText)
 
bool GetSpecialEventTextIfNotEmpty (string specialTextKey, object substitutes, ref string specialEventText)
 
void CheckDrowning ()
 
void TryPortalJumping ()
 
string GetBestiaryCreditId ()
 
override string ToString ()
 
 NPC ()
 
float AngleTo (Vector2 Destination)
 
float AngleFrom (Vector2 Source)
 
float Distance (Vector2 Other)
 
float DistanceSQ (Vector2 Other)
 
Vector2 DirectionTo (Vector2 Destination)
 
Vector2 DirectionFrom (Vector2 Source)
 
bool WithinRange (Vector2 Target, float MaxRange)
 

Static Public Member Functions

static int[,,,] InitializeMoonLordAttacks ()
 
static int[,] InitializeMoonLordAttacks2 ()
 
static string GetFullnameByID (int npcID)
 
static bool BusyWithAnyInvasionOfSorts ()
 
static bool SpawnAllowed_Demolitionist ()
 
static bool SpawnAllowed_ArmsDealer ()
 
static bool SpawnAllowed_DyeTrader ()
 
static bool SpawnAllowed_Nurse ()
 
static bool SpawnAllowed_Merchant ()
 
static void ClearFoundActiveNPCs ()
 
static void UpdateFoundActiveNPCs ()
 
static void ClearFoundNPCTypesForBestiary ()
 
static bool WouldBeEncouragedToDespawn (int aistyle, int type)
 
static string getNewNPCName (int npcType)
 
static void setNPCName (string newName, int npcType, bool resetExtras=false)
 
static string firstNPCName (int npcType)
 
static string GetFirstNPCNameOrNull (int npcType)
 
static bool MechSpawn (float x, float y, int type)
 
static int TypeToDefaultHeadIndex (int type)
 
static void SetWorldSpecificMonstersByWorldID ()
 
static float GetBalance ()
 
static void GetStatScalingFactors (int numPlayers, out float balance, out float boost)
 
static bool GetNPCLocation (int i, bool seekHead, bool averageDirection, out int index, out Vector2 pos)
 
static void TransformElderSlime (int npcIndex)
 
static void TransformCopperSlime (int npcIndex)
 
static void HaveDryadDoStardewAnimation ()
 
static bool SpawnMechQueen (int onWhichPlayer)
 
static bool IsDeerclopsHostile ()
 
static bool IsADeerclopsNearScreen ()
 
static Color AI_121_QueenSlime_GetDustColor ()
 
static bool ShouldEmpressBeEnraged ()
 
static void FairyEffects (Vector2 Position, int type)
 
static int GetEaterOfWorldsSegmentsCount ()
 
static int GetEaterOfWorldsSegmentsCountByGamemode (int gamemode)
 
static int GetBrainOfCthuluCreepersCount ()
 
static int GetDestroyerSegmentsCount ()
 
static bool DespawnEncouragement_AIStyle2_FloatingEye_IsDiscouraged (int npcID, Vector2 npcPosition, int target=255)
 
static bool DespawnEncouragement_AIStyle3_Fighters_NotDiscouraged (int npcID, Vector2 position, NPC npcInstance)
 
static bool DespawnEncouragement_AIStyle3_Fighters_CanBeBusyWithAction (int npcID)
 
static void HealEffect (Rectangle r, int healAmount, bool broadcast=true)
 
static bool BigMimicSummonCheck (int x, int y, Player user)
 
static int GetNPCInvasionGroup (int npcID)
 
static void ResetKillCount ()
 
static void SetEventFlagCleared (ref bool eventFlag, int gameEventId)
 
static void OnGameEventClearedForTheFirstTime (int gameEventId)
 
static void ResetBadgerHatTime ()
 
static int GetStackForSlimeItemDrop (int item)
 
static void CatchNPC (int i, int who=-1)
 
static bool CanReleaseNPCs (int who)
 
static int ReleaseNPC (int x, int y, int Type, int Style, int who)
 
static void SlimeRainSpawns (int plr)
 
static bool Spawning_SandstoneCheck (int x, int y)
 
static bool Spawning_FlyingAntlionCheck (int x, int y)
 
static void ResetRemixHax ()
 
static void SetRemixHax ()
 
static bool SpawnTileOrAboveHasAnyWallInSet (int x, int y, bool[] wallTypes)
 
static void SpawnNPC ()
 
static void SpawnNPC_SpawnFrog (int spawnTileX, int spawnTileY, int plr)
 
static int SpawnNPC_GetGemBunnyToSpawn ()
 
static int SpawnNPC_GetGemSquirrelToSpawn ()
 
static bool IsValidSpawningGroundTile (int x, int y)
 
static bool FindCattailTop (int landX, int landY, out int cattailX, out int cattailY)
 
static bool FindTreeBranch (int landX, int landY, out int treeBranchX, out int treeBranchY)
 
static bool AnyDanger (bool quickBossNPCCheck=false, bool ignorePillarsAndMoonlordCountdown=false)
 
static bool AnyoneNearCultists ()
 
static void SpawnWOF (Vector2 pos)
 
static void SpawnSkeletron (int onWho)
 
static void SpawnFaelings (int plr)
 
static void SpawnOnPlayer (int plr, int Type)
 
static int GetAvailableAmountOfNPCsToSpawnUpToSlot (int amountWeWant, int highestNPCSlotIndexWeWillPick=100)
 
static IEntitySource GetBossSpawnSource (int targetPlayerIndex)
 
static void SpawnBoss (int spawnPositionX, int spawnPositionY, int Type, int targetPlayerIndex)
 
static int NewNPC (IEntitySource source, int X, int Y, int Type, int Start=0, float ai0=0f, float ai1=0f, float ai2=0f, float ai3=0f, int Target=255)
 
static void UnlockOrExchangePet (ref bool petBoughtFlag, int npcType, string textKeyForLicense, int netMessageData)
 
static bool RerollVariationForNPCType (int npcType)
 
static void LadyBugKilled (Vector2 Position, bool GoldLadyBug=false)
 
static int CountNPCS (int Type)
 
static bool AnyHelpfulFairies ()
 
static bool AnyNPCs (int Type)
 
static int FindFirstNPC (int Type)
 
static bool NearSpikeBall (int x, int y)
 
static void ResetNetOffsets ()
 
static IEntitySource GetSpawnSource_NPCRelease (int whoReleasedIt)
 
static IEntitySource GetSpawnSource_NPCCatch (int whoCatchedIt)
 
static IEntitySource GetSpawnSourceForNaturalSpawn ()
 
static IEntitySource GetSpawnSourceForTownSpawn ()
 
static Color buffColor (Color newColor, float R, float G, float B, float A)
 
static void setFireFlyChance ()
 
static void GetMeleeCollisionData (Rectangle victimHitbox, int enemyIndex, ref int specialHitSetter, ref float damageMultiplier, ref Rectangle npcRect)
 

Public Attributes

bool IsABestiaryIconDummy
 
bool ForcePartyHatOn
 
float waterMovementSpeed
 
float lavaMovementSpeed
 
float honeyMovementSpeed
 
float shimmerMovementSpeed
 
int teleportStyle
 
float teleportTime
 
int netSpam
 
float nameOver
 
bool SpawnedFromStatue
 
bool CanBeReplacedByOtherNPCs
 
bool dripping
 
bool drippingSlime
 
bool drippingSparkleSlime
 
int altTexture
 
int townNpcVariationIndex
 
Vector2 netOffset
 
short catchItem
 
short releaseOwner
 
int rarity
 
bool[] playerInteraction
 
int lastInteraction
 
float takenDamageMultiplier
 
float gfxOffY
 
float stepSpeed
 
bool teleporting
 
bool stairFall
 
Vector2[] oldPos
 
float[] oldRot
 
bool setFrameSize
 
int netSkip
 
bool netAlways
 
int realLife
 
float npcSlots
 
float shimmerTransparency
 
bool dontCountMe
 
int[] buffType
 
int[] buffTime
 
bool[] buffImmune
 
bool canDisplayBuffs
 
bool midas
 
bool ichor
 
bool onFire
 
bool onFire2
 
bool onFire3
 
bool onFrostBurn
 
bool onFrostBurn2
 
bool poisoned
 
bool markedByScytheWhip
 
bool venom
 
bool shadowFlame
 
bool soulDrain
 
bool shimmering
 
int lifeRegen
 
int lifeRegenCount
 
int lifeRegenExpectedLossPerSecond
 
bool confused
 
bool loveStruck
 
bool stinky
 
bool dryadWard
 
bool immortal
 
bool chaseable
 
bool canGhostHeal
 
bool javelined
 
bool tentacleSpiked
 
bool bloodButchered
 
bool celled
 
bool dryadBane
 
bool daybreak
 
bool dontTakeDamageFromHostiles
 
bool betsysCurse
 
bool oiled
 
int soundDelay
 
int[] immune
 
int directionY
 
int type
 
float[] ai
 
float[] localAI
 
int aiAction
 
int aiStyle
 
bool justHit
 
int timeLeft
 
int target
 
int damage
 
int defense
 
int defDamage
 
int defDefense
 
bool coldDamage
 
bool trapImmune
 
LegacySoundStyle HitSound
 
LegacySoundStyle DeathSound
 
int life
 
int lifeMax
 
Rectangle targetRect
 
double frameCounter
 
Rectangle frame
 
Color color
 
int alpha
 
bool hide
 
float scale
 
float knockBackResist
 
int oldDirectionY
 
int oldTarget
 
float rotation
 
bool noGravity
 
bool noTileCollide
 
bool netUpdate
 
bool netUpdate2
 
bool collideX
 
bool collideY
 
bool boss
 
int spriteDirection
 
bool behindTiles
 
bool lavaImmune
 
float value
 
int extraValue
 
bool dontTakeDamage
 
int netID
 
int statsAreScaledForThisManyPlayers
 
float strengthMultiplier
 
bool townNPC
 
bool homeless
 
int homeTileX
 
int homeTileY
 
int housingCategory
 
bool oldHomeless
 
int oldHomeTileX
 
int oldHomeTileY
 
bool friendly
 
bool closeDoor
 
int doorX
 
int doorY
 
int friendlyRegen
 
int breath
 
int breathCounter
 
bool reflectsProjectiles
 
int lastPortalColorIndex
 
bool despawnEncouraged
 
int whoAmI
 
bool active
 
Vector2 position
 
Vector2 velocity
 
Vector2 oldPosition
 
Vector2 oldVelocity
 
int oldDirection
 
int direction
 
int width
 
int height
 
bool wet
 
bool shimmerWet
 
bool honeyWet
 
byte wetCount
 
bool lavaWet
 

Static Public Attributes

static int MoonLordCountdown
 
static int immuneTime
 
static int maxAI
 
static int[] killCount
 
static float waveKills
 
static int waveNumber
 
static bool taxCollector
 
static bool freeCake
 
static int fireFlyFriendly
 
static int fireFlyChance
 
static int fireFlyMultiple
 
static int butterflyChance
 
static int golemBoss
 
static int plantBoss
 
static int crimsonBoss
 
static int deerclopsBoss
 
static int sWidth
 
static int sHeight
 
static int safeRangeX
 
static int safeRangeY
 
static bool savedTaxCollector
 
static bool savedGoblin
 
static bool savedWizard
 
static bool savedMech
 
static bool savedAngler
 
static bool savedStylist
 
static bool savedBartender
 
static bool savedGolfer
 
static bool boughtCat
 
static bool boughtDog
 
static bool boughtBunny
 
static bool combatBookWasUsed
 
static bool combatBookVolumeTwoWasUsed
 
static bool peddlersSatchelWasUsed
 
static bool downedBoss1
 
static bool downedBoss2
 
static bool downedBoss3
 
static bool downedQueenBee
 
static bool downedSlimeKing
 
static bool downedGoblins
 
static bool downedFrost
 
static bool downedPirates
 
static bool downedClown
 
static bool downedPlantBoss
 
static bool downedGolemBoss
 
static bool downedMartians
 
static bool downedFishron
 
static bool downedHalloweenTree
 
static bool downedHalloweenKing
 
static bool downedChristmasIceQueen
 
static bool downedChristmasTree
 
static bool downedChristmasSantank
 
static bool downedAncientCultist
 
static bool downedMoonlord
 
static bool downedTowerSolar
 
static bool downedTowerVortex
 
static bool downedTowerNebula
 
static bool downedTowerStardust
 
static bool downedEmpressOfLight
 
static bool downedQueenSlime
 
static bool downedDeerclops
 
static int ShieldStrengthTowerSolar
 
static int ShieldStrengthTowerVortex
 
static int ShieldStrengthTowerNebula
 
static int ShieldStrengthTowerStardust
 
static int LunarShieldPowerNormal
 
static int LunarShieldPowerExpert
 
static bool TowerActiveSolar
 
static bool TowerActiveVortex
 
static bool TowerActiveNebula
 
static bool TowerActiveStardust
 
static bool LunarApocalypseIsUp
 
static bool downedMechBossAny
 
static bool downedMechBoss1
 
static bool downedMechBoss2
 
static bool downedMechBoss3
 
static bool[] npcsFoundForCheckActive
 
static int[] lazyNPCOwnedProjectileSearchArray
 
static CoinLossRevengeSystem RevengeManager
 
static bool travelNPC
 
static int[,] cavernMonsterType
 
static bool fairyLog
 
static int ladyBugGoodLuckTime
 
static int ladyBugBadLuckTime
 
static int offSetDelayTime
 
static readonly int[,,,] MoonLordAttacksArray
 
static readonly int[,] MoonLordAttacksArray2
 
static int MoonLordFightingDistance
 
static int MaxMoonLordCountdown
 
const int NaturalMoonlordCountdownTime = 3600
 
const int ItemMoonlordCountdownTime = 720
 
const int goldCritterChance = 400
 
static float totalInvasionPoints
 
const float nameOverIncrement = 0.025f
 
const float nameOverDistance = 350f
 
static readonly int AFKTimeNeededForNoWorms
 
static bool[] ShimmeredTownNPCs
 
static int stinkBugChance
 
static readonly int maxBuffs
 
static bool unlockedSlimeBlueSpawn
 
static bool unlockedSlimeGreenSpawn
 
static bool unlockedSlimeOldSpawn
 
static bool unlockedSlimePurpleSpawn
 
static bool unlockedSlimeRainbowSpawn
 
static bool unlockedSlimeRedSpawn
 
static bool unlockedSlimeYellowSpawn
 
static bool unlockedSlimeCopperSpawn
 
static bool unlockedMerchantSpawn
 
static bool unlockedDemolitionistSpawn
 
static bool unlockedPartyGirlSpawn
 
static bool unlockedDyeTraderSpawn
 
static bool unlockedTruffleSpawn
 
static bool unlockedArmsDealerSpawn
 
static bool unlockedNurseSpawn
 
static bool unlockedPrincessSpawn
 
static int LunarShieldPowerMax
 
const int breathMax = 200
 
static int mechQueen
 
static int brainOfGravity
 
static bool empressRageMode
 
static int[] MoonEventRequiredPointsPerWaveLookup
 
static bool PreventJojaColaDialog
 
static int RerollDryadText
 

Package Attributes

long entityId
 

Properties

bool CanTalk [get, set]
 
bool CanBeTalkedTo [get, set]
 
bool HasValidTarget [get, set]
 
Player TargetPlayer [get, set]
 
bool HasPlayerTarget [get, set]
 
bool HasNPCTarget [get, set]
 
bool SupportsNPCTargets [get, set]
 
int TranslatedTargetIndex [get, set]
 
int WhoAmIToTargettingIndex [get, set]
 
bool IsShimmerVariant [get, set]
 
string TypeName [get, set]
 
string FullName [get, set]
 
bool HasGivenName [get, set]
 
string GivenOrTypeName [get, set]
 
string GivenName [get, set]
 
static bool downedTowers [get, set]
 
static int ShieldStrengthTowerMax [get, set]
 
static bool TowersDefeated [get, set]
 
float Opacity [get, set]
 
bool isLikeATownNPC [get, set]
 
static bool IsMechQueenUp [get, set]
 
static bool TooWindyForButterflies [get, set]
 
bool CountsAsACritter [get, set]
 
virtual Vector2 VisualPosition [get, set]
 
Vector2 Center [get, set]
 
Vector2 Left [get, set]
 
Vector2 Right [get, set]
 
Vector2 Top [get, set]
 
Vector2 TopLeft [get, set]
 
Vector2 TopRight [get, set]
 
Vector2 Bottom [get, set]
 
Vector2 BottomLeft [get, set]
 
Vector2 BottomRight [get, set]
 
Vector2 Size [get, set]
 
Rectangle Hitbox [get, set]
 

Private Member Functions

void SetDefaultsFromNetId (int id, NPCSpawnParams spawnparams=default(NPCSpawnParams))
 
void getTenthAnniversaryAdjustments ()
 
void getZenithSeedAdjustmentsBeforeEverything ()
 
void getGoodAdjustments ()
 
void LazySetLiquidMovementDD2 ()
 
void ScaleStats_ApplyExpertTweaks ()
 
void ScaleStats_ApplyGameMode (GameModeData gameModeData)
 
void ScaleStats_ApplyMultiplayerStats (int numPlayers, float balance, float boost, float bossAdjustment)
 
void AI_047_GolemFist ()
 
void AI_045_Golem ()
 
void AI_124_ElderSlimeChest ()
 
void AI_125_ClumsySlimeBalloon ()
 
void SpawnStardustMark_StardustTower ()
 
void SpawnStardustMark_StardustWorm ()
 
void AI_123_Deerclops ()
 
bool ShouldRunAway (ref NPCAimedTarget targetData, bool isChasing)
 
void SpawnPassiveShadowHands (float lifePercent, int shadowHandDamage)
 
void AI_123_Deerclops_ShootRubbleUp (ref NPCAimedTarget targetData, ref Point sourceTileCoords, int howMany, int distancedByThisManyTiles, float upBiasPerSpike, int whichOne)
 
void AI_123_Deerclops_MakeSpikesForward (int AISLOT_PhaseCounter, NPCAimedTarget targetData)
 
void AI_123_Deerclops_MakeSpikesBothSides (int AISLOT_PhaseCounter, NPCAimedTarget targetData)
 
void AI_123_Deerclops_FindSpotToSpawnSpike (int howMany, int whichOne, ref int x, ref int y)
 
void AI_123_Deerclops_TryMakingSpike (ref Point sourceTileCoords, int dir, int howMany, int whichOne, int xOffset)
 
int AI_123_Deerclops_TryMakingSpike_FindBestY (ref Point sourceTileCoords, int x)
 
void AI_123_Deerclops_Movement (bool haltMovement, bool goHome)
 
void AI_124_DeerclopsLeg ()
 
void AI_87_BigMimic_FireStuffCannonBurst ()
 
void AI_87_BigMimic_ShootItem (int itemID)
 
void AI_065_Butterflies ()
 
void AI_121_QueenSlime_FlyMovement ()
 
void AI_121_QueenSlime ()
 
void AI_120_HallowBoss_DoMagicEffect (Vector2 spot, int effectType, float progress)
 
void AI_120_HallowBoss ()
 
void AI_120_HallowBoss_DashTo (Vector2 targetPosition)
 
void AI_119_Dandelion ()
 
void AI_118_Seahorses ()
 
void AI_117_BloodNautilus ()
 
void BloodNautilus_CallForHelp ()
 
void AI_116_WaterStriders ()
 
void AI_115_LadyBugs ()
 
void AI_114_Dragonflies ()
 
void AI_113_WindyBalloon ()
 
void AI_112_FairyCritter ()
 
void GetBirdFlightRecommendation (int downScanRange, int upRange, Point tCoords, out bool goDownwards, out bool goUpwards)
 
Vector2 GetFairyCircleOffset (float elapsedTime, float circleRotation, float circleHeight)
 
bool GetFairyTreasureCoords (out Point treasureCoords)
 
void AI_069_DukeFishron ()
 
void AI_037_Destroyer ()
 
void AI_005_EaterOfSouls ()
 
void AI_006_Worms ()
 
void AI_002_FloatingEye ()
 
void StingerExplosion ()
 
bool AI_007_TownEntities_IsInAGoodRestingSpot (int tileX, int tileY, int idealRestX, int idealRestY)
 
void AI_007_FindGoodRestingSpot (int myTileX, int myTileY, out int floorX, out int floorY)
 
void AI_007_TryForcingSitting (int homeFloorX, int homeFloorY)
 
void AI_007_TownEntities ()
 
void AI_007_TownEntities_Shimmer_TeleportToLandingSpot ()
 
Vector2AI_007_TownEntities_Shimmer_ScanForBestSpotToLandOn ()
 
void AI_007_TownEntities_TeleportToHome (int homeFloorX, int homeFloorY)
 
void AI_007_TownEntities_GetWalkPrediction (int myTileX, int homeFloorX, bool canBreathUnderWater, bool currentlyDrowning, int tileX, int tileY, out bool keepwalking, out bool avoidFalling)
 
bool AI_007_TownEntities_CheckIfWillDrown (bool currentlyDrowning)
 
void AI_007_AttemptToPlayIdleAnimationsForPets (int petIdleChance)
 
bool AI_003_Gnomes_ShouldTurnToStone ()
 
void AI_003_Fighters ()
 
void AI_001_Slimes ()
 
void AI_110_Betsy ()
 
void AI_026_Unicorns ()
 
void AI_107_ImprovedWalkers ()
 
void AI_084_LunaticCultist ()
 
void AI_108_DivingFlyer ()
 
void AI_109_DarkMage ()
 
void AI_111_DD2LightningBug ()
 
void TryTrackingTarget (ref float distance, ref float realDist, ref bool t, ref int tankTarget, int j)
 
void SetTargetTrackingValues (bool faceTarget, float realDist, int tankTarget)
 
void CheckActive_WormSegments ()
 
void AddIntoPlayersTownNPCSlots ()
 
void DropEoWLoot (bool fromCheckDead=true)
 
float GetMoonEventPointScalar ()
 
void CheckProgressFrostMoon ()
 
void CheckProgressPumpkinMoon ()
 
void DoDeathEvents_BeforeLoot (Player closestPlayer)
 
void NPCLoot_DropItems (Player closestPlayer)
 
void DoDeathEvents_DropBossPotionsAndHearts ()
 
void DoDeathEvents_CelebrateBossDeath ()
 
void CreateBrickBoxForWallOfFlesh ()
 
void DoDeathEvents_SummonDungeonSpirit (Player closestPlayer)
 
void DoDeathEvents_AdvanceSlimeRain (Player closestPlayer)
 
void NPCLoot_DropHeals (Player closestPlayer)
 
void DoDeathEvents (Player closestPlayer)
 
void ViolentlySpawnNerdySlime ()
 
void NPCLoot_DropCommonLifeAndMana (Player closestPlayer)
 
void NPCLoot_DropMoney (Player closestPlayer)
 
void CountKillForBannersAndDropThem ()
 
void CountKillForAchievements ()
 
bool TryTeleportingCaughtMysticFrog ()
 
void LadyBugLuck (int plr, bool GoldLadyBug=false)
 
void NPCLuck ()
 
void MakeTransitionEffectsForTextureChanges (int oldAltTexture, int currentAltTexture)
 
void SubAI_HandleTemporaryCatchableNPCPlayerInvulnerability ()
 
void TrySyncingUniqueTownNPCData (int npcIndex)
 
void UpdateNetworkCode (int i)
 
void UpdateNPC_UpdateTrails ()
 
void UpdateNPC_UpdateGravity (out float maxFallSpeed)
 
void UpdateNPC_SoulDrainDebuff ()
 
void UpdateNPC_BuffApplyVFX ()
 
void GetShimmered ()
 
void UpdateNPC_BuffApplyDOTs ()
 
void UpdateNPC_BuffClearExpiredBuffs ()
 
void UpdateNPC_BloodMoonTransformations ()
 
void UpdateNPC_BuffFlagsReset ()
 
void UpdateNPC_TeleportVisuals ()
 
void UpdateNPC_CritterSounds ()
 
void UpdateNPC_CastLights ()
 
void GetHurtByOtherNPCs (bool[] acceptableNPCIDs)
 
void BeHurtByOtherNPC (int npcIndex, NPC thatNPC)
 
void CheckLifeRegen ()
 
void UpdateCollision ()
 
void Collision_MoveWhileDry ()
 
void ApplyTileCollision (bool fall, Vector2 cPosition, int cWidth, int cHeight)
 
void Collision_MoveSlopesAndStairFall (bool fall)
 
void Collision_MoveSnailOnSlopes ()
 
void Collision_MoveNormal (bool fall, Vector2 cPosition, int cWidth, int cHeight)
 
void Collision_MoveSandshark (bool fall, Vector2 cPosition, int cWidth, int cHeight)
 
void Collision_MoveSolarSroller (bool fall, Vector2 cPosition, int cWidth, int cHeight)
 
void Collision_MoveStardustCell (bool fall, Vector2 cPosition, int cWidth, int cHeight)
 
void Collision_MoveBlazingWheel ()
 
void Collision_MoveWhileWet (Vector2 oldDryVelocity, float Slowdown=0.5f)
 
void FishTransformationDuringRain ()
 
bool Collision_DecideFallThroughPlatforms ()
 
bool Collision_WaterCollision (bool lava)
 
bool Collision_LavaCollision ()
 
void Collision_WalkDownSlopes ()
 

Static Private Member Functions

static string getNewNPCNameInner (int npcType)
 
static int GetActivePlayerCount ()
 
static ? float TryFindingFloor (Vector2 searchStartPositionInWorld, int searchRange, out int tilesTraveled)
 
static int AI_001_Slimes_GenerateItemInsideBody (bool isBallooned)
 
static int FindFrame_FromSequence (int sequenceFrame, int[] frames)
 
static int FindFrame_Deerclops_GetAttack1Frame (int sequenceFrame)
 
static int FindFrame_Deerclops_GetAttack2Frame (int sequenceFrame)
 
static int FindFrame_Deerclops_GetAttack3Frame (int sequenceFrame)
 
static int RollDragonflyType (int tileType=2)
 
static bool SpawnNPC_CheckToSpawnRockGolem (int spawnTileX, int spawnTileY, int plr, int tileType)
 
static bool SpawnNPC_CheckToSpawnUndergroundFairy (int spawnTileX, int spawnTileY, int plr)
 
static int SpawnNPC_SpawnLavaBaitCritters (int spawnTileX, int spawnTileY)
 
static int SpawnNPC_TryFindingProperGroundTileType (int spawnTileType, int x, int y)
 
static int GetAvailableNPCSlot (int Type, int startIndex)
 
static void GiveTownUniqueDataToNPCsThatNeedIt (int Type, int nextNPC)
 
static NPC ()
 

Private Attributes

int netStream
 
int[] streamPlayer
 
bool needsUniqueInfoUpdate
 
string _givenName
 
int catchableNPCTempImmunityCounter
 
long GoodRestingTileCacheTileState
 
bool GoodRestingTileCacheFound
 
Point GoodRestingTileCacheOrigin
 
Point GoodRestingTileCacheResult
 
bool netShimmer
 

Static Private Attributes

static float gravity
 
static int spawnRangeX
 
static int spawnRangeY
 
static int activeRangeX
 
static int activeRangeY
 
static int townRangeX
 
static int townRangeY
 
static bool noSpawnCycle
 
static int activeTime
 
static int defaultSpawnRate
 
static int defaultMaxSpawns
 
static int spawnRate
 
static int maxSpawns
 
static bool EoCKilledToday
 
static bool WoFKilledToday
 
static int ignorePlayerInteractions
 
static int ladyBugRainTime
 
static int maximumAmountOfTimesLadyBugRainCanStack
 
const int NPC_TARGETS_START = 300
 
static int spawnSpaceX
 
static int spawnSpaceY
 
static readonly int[] _deerclopsAttack1Frames
 
static readonly int[] _deerclopsAttack2Frames
 
static readonly int[] _deerclopsAttack3Frames
 
static bool dayTimeHax
 
static bool rainingHax
 
static float cloudAlphaHax
 

Detailed Description

Definition at line 44 of file NPC.cs.


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