TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ ApplyDifficultyAndPlayerScaling()

virtual void Terraria.ModLoader.ModNPC.ApplyDifficultyAndPlayerScaling ( int numPlayers,
float balance,
float bossAdjustment )
inlinevirtual

Allows you to customize this NPC's stats when the difficulty is expert or higher.
This runs after F:Terraria.NPC.value, F:Terraria.NPC.lifeMax, F:Terraria.NPC.damage, F:Terraria.NPC.knockBackResist have been adjusted for the current difficulty, (expert/master/FTW)
It is common to multiply lifeMax by the balance factor, and sometimes adjust knockbackResist.

Eg:

lifeMax = (int)(lifeMax * balance * bossAdjustment)

Parameters
numPlayersThe number of active players
balanceScaling factor that increases by a fraction for each player
bossAdjustmentAn extra reduction factor to be applied to boss life in high difficulty modes

Definition at line 182 of file ModNPC.cs.

183 {
184 }