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

◆ ScaleStats_ApplyExpertTweaks()

void Terraria.NPC.ScaleStats_ApplyExpertTweaks ( )
inlineprivate

Definition at line 12289 of file NPC.cs.

12290 {
12291 bool flag = type >= 0 && NPCID.Sets.ProjectileNPC[type];
12293 if (Main.getGoodWorld)
12294 {
12295 if ((type == 24 || type == 25) && AnyNPCs(113))
12296 {
12297 flag2 = false;
12298 }
12299 if ((type == 32 || type == 33) && AnyNPCs(35))
12300 {
12301 flag2 = false;
12302 }
12303 if (type == 6 && AnyNPCs(13))
12304 {
12305 flag2 = false;
12306 }
12307 }
12308 if (flag2 && Main.hardMode && !boss && lifeMax < 1000)
12309 {
12310 int num = damage + defense + lifeMax / 4;
12311 if (num == 0)
12312 {
12313 num = 1;
12314 }
12315 int num2 = 80;
12316 if (downedPlantBoss)
12317 {
12318 num2 += 20;
12319 }
12320 if (num < num2)
12321 {
12322 float num3 = num2 / num;
12323 damage = (int)((double)((float)damage * num3) * 0.9);
12324 if (!flag)
12325 {
12326 defense = (int)((float)defense * num3);
12327 lifeMax = (int)((double)((float)lifeMax * num3) * 1.1);
12328 value = (int)((double)(value * num3) * 0.8);
12329 }
12330 }
12331 }
12332 if (type == 210 || type == 211)
12333 {
12334 damage = (int)((float)damage * 0.6f);
12335 lifeMax = (int)((float)lifeMax * 0.8f);
12336 defense = (int)((float)defense * 0.8f);
12337 }
12338 }
static bool[] ProjectileNPC
Definition NPCID.cs:4186
static bool[] DontDoHardmodeScaling
Definition NPCID.cs:4095
bool boss
Definition NPC.cs:515
int defense
Definition NPC.cs:463
int damage
Definition NPC.cs:461
int lifeMax
Definition NPC.cs:479
float value
Definition NPC.cs:523
static bool AnyNPCs(int Type)
Definition NPC.cs:86689
int type
Definition NPC.cs:445
static bool downedPlantBoss
Definition NPC.cs:363

References Terraria.NPC.AnyNPCs(), Terraria.NPC.boss, Terraria.NPC.damage, Terraria.NPC.defense, Terraria.ID.NPCID.Sets.DontDoHardmodeScaling, Terraria.NPC.downedPlantBoss, Terraria.Main.getGoodWorld, Terraria.Main.hardMode, Terraria.NPC.lifeMax, Terraria.ID.NPCID.Sets.ProjectileNPC, Terraria.NPC.type, and Terraria.NPC.value.

Referenced by Terraria.NPC.ScaleStats().