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

◆ ScaleStats_UseStrengthMultiplier()

void Terraria.NPC.ScaleStats_UseStrengthMultiplier ( float strength)
inline

Definition at line 13134 of file NPC.cs.

13135 {
13136 if (strength == 1f)
13137 {
13138 return;
13139 }
13140 int num;
13141 if (type >= 0)
13142 {
13143 num = (NPCID.Sets.ProjectileNPC[type] ? 1 : 0);
13144 if (num != 0)
13145 {
13146 goto IL_003c;
13147 }
13148 }
13149 else
13150 {
13151 num = 0;
13152 }
13153 lifeMax = (int)((float)lifeMax * strength);
13154 goto IL_003c;
13155 IL_003c:
13156 damage = (int)((float)damage * strength);
13157 float num2 = 1f;
13158 float num3 = 2f;
13159 float num4 = 3f;
13160 if (Main.getGoodWorld)
13161 {
13162 num2 += 1f;
13163 num3 += 1f;
13164 num4 += 1f;
13165 }
13166 if (num == 0)
13167 {
13168 float num5 = GameModeData.NormalMode.EnemyMoneyDropMultiplier;
13169 float num6 = GameModeData.ExpertMode.EnemyMoneyDropMultiplier;
13170 if (Main.getGoodWorld)
13171 {
13172 num5 += 1f;
13173 num6 += 1f;
13174 }
13175 float num7 = Utils.Remap(strength, num2, num3, num5, num6);
13176 value = (int)(value * num7);
13177 }
13178 float knockbackToEnemiesMultiplier = GameModeData.NormalMode.KnockbackToEnemiesMultiplier;
13179 float knockbackToEnemiesMultiplier2 = GameModeData.MasterMode.KnockbackToEnemiesMultiplier;
13182 }
static bool[] ProjectileNPC
If true for a given NPC type (F:Terraria.NPC.type), then that NPC is treated specially for difficulty...
Definition NPCID.cs:365
int damage
The amount of contact damage this NPC deals. Changing this WILL NOT change the amount of damage done...
Definition NPC.cs:1027
int lifeMax
The maximum life of this NPC.
Definition NPC.cs:1077
float knockBackResist
How much of the knockback it receives will actually apply. 1f: full knockback; 0f: no knockback....
Definition NPC.cs:1110
float value
How many copper coins the NPC will drop when killed (100 copper coins = 1 silver coin etc....
Definition NPC.cs:1156
int type
The NPC ID of this NPC. The NPC ID is a unique number assigned to each NPC loaded into the game....
Definition NPC.cs:990
static readonly GameModeData NormalMode
static readonly GameModeData MasterMode
static readonly GameModeData ExpertMode

References Terraria.NPC.damage, Terraria.DataStructures.GameModeData.ExpertMode, Terraria.Main.getGoodWorld, Terraria.NPC.knockBackResist, Terraria.NPC.lifeMax, Terraria.DataStructures.GameModeData.MasterMode, Terraria.DataStructures.GameModeData.NormalMode, Terraria.ID.NPCID.Sets.ProjectileNPC, Terraria.Utils.Remap(), Terraria.NPC.type, and Terraria.NPC.value.

Referenced by Terraria.NPC.ScaleStats().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: