1 - All the changelog stuff on main.
2 - Certain ores can no longer be bombed because they had old bomb resist code that makes no sense anymore. 3 - Bumbledoge mount nerf. 4 - Terra Arrows have had their aistyle removed so they no longer behave like normal arrows.
This commit is contained in:
1 parent
2b97fb9ba9
commit
bdbfa05877
48 files changed
+1430
-888
No files matched your search
+250
-166
@@ -67,6 +67,15 @@ using Terraria.ModLoader.IO;
|
||||
|
||||
namespace CalamityMod.CalPlayer
|
||||
{
|
||||
public enum ClassType
|
||||
{
|
||||
Melee = 0,
|
||||
Ranged = 1,
|
||||
Magic = 2,
|
||||
Summon = 3,
|
||||
Rogue = 4
|
||||
}
|
||||
|
||||
public enum GaelSwitchPhase
|
||||
{
|
||||
LoseRage = 0,
|
||||
@@ -244,10 +253,13 @@ namespace CalamityMod.CalPlayer
|
||||
public bool playRogueStealthSound = false;
|
||||
public bool playFullRageSound = true;
|
||||
public bool playFullAdrenalineSound = true;
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Proficiency
|
||||
public int meleeLevel = 0;
|
||||
#region Proficiency
|
||||
private const int levelTier1 = 1500;
|
||||
private const int levelTier2 = 5500;
|
||||
private const int levelTier3 = 12500;
|
||||
public int meleeLevel = 0;
|
||||
public int rangedLevel = 0;
|
||||
public int magicLevel = 0;
|
||||
public int rogueLevel = 0;
|
||||
@@ -5429,22 +5441,24 @@ namespace CalamityMod.CalPlayer
|
||||
gainLevelCooldown = 120;
|
||||
if (item.melee && meleeLevel <= 12500)
|
||||
{
|
||||
if (!Main.hardMode && meleeLevel >= 1500)
|
||||
{
|
||||
gainLevelCooldown = 1200; //20 seconds
|
||||
}
|
||||
if (!NPC.downedMoonlord && meleeLevel >= 5500)
|
||||
{
|
||||
gainLevelCooldown = 2400; //40 seconds
|
||||
}
|
||||
if (!ReduceCooldown((int)ClassType.Melee))
|
||||
{
|
||||
if (!Main.hardMode && meleeLevel >= 1500)
|
||||
gainLevelCooldown = 1200; //20 seconds
|
||||
if (!NPC.downedMoonlord && meleeLevel >= 5500)
|
||||
gainLevelCooldown = 2400; //40 seconds
|
||||
}
|
||||
else
|
||||
gainLevelCooldown /= 2;
|
||||
|
||||
if (fasterMeleeLevel)
|
||||
gainLevelCooldown /= 2;
|
||||
|
||||
meleeLevel++;
|
||||
if (fasterMeleeLevel && meleeLevel % 100 != 0 && Main.rand.NextBool(10)) //add only to non-multiples of 100
|
||||
meleeLevel++;
|
||||
shootFireworksLevelUpMelee = true;
|
||||
|
||||
if (Main.netMode == NetmodeID.MultiplayerClient)
|
||||
{
|
||||
LevelPacket(false, 0);
|
||||
}
|
||||
LevelPacket(false, (int)ClassType.Melee);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5910,98 +5924,108 @@ namespace CalamityMod.CalPlayer
|
||||
gainLevelCooldown = 120; //2 seconds
|
||||
if (proj.melee && meleeLevel <= 12500)
|
||||
{
|
||||
if (!Main.hardMode && meleeLevel >= 1500)
|
||||
{
|
||||
gainLevelCooldown = 1200; //20 seconds
|
||||
}
|
||||
if (!NPC.downedMoonlord && meleeLevel >= 5500)
|
||||
{
|
||||
gainLevelCooldown = 2400; //40 seconds
|
||||
}
|
||||
meleeLevel++;
|
||||
if (fasterMeleeLevel && meleeLevel % 100 != 0 && Main.rand.NextBool(10)) //add only to non-multiples of 100
|
||||
meleeLevel++;
|
||||
if (!ReduceCooldown((int)ClassType.Melee))
|
||||
{
|
||||
if (!Main.hardMode && meleeLevel >= 1500)
|
||||
gainLevelCooldown = 1200; //20 seconds
|
||||
if (!NPC.downedMoonlord && meleeLevel >= 5500)
|
||||
gainLevelCooldown = 2400; //40 seconds
|
||||
}
|
||||
else
|
||||
gainLevelCooldown /= 2;
|
||||
|
||||
if (fasterMeleeLevel)
|
||||
gainLevelCooldown /= 2;
|
||||
|
||||
meleeLevel++;
|
||||
shootFireworksLevelUpMelee = true;
|
||||
|
||||
if (Main.netMode == NetmodeID.MultiplayerClient)
|
||||
{
|
||||
LevelPacket(false, 0);
|
||||
}
|
||||
LevelPacket(false, (int)ClassType.Melee);
|
||||
}
|
||||
else if (proj.ranged && rangedLevel <= 12500)
|
||||
{
|
||||
if (!Main.hardMode && rangedLevel >= 1500)
|
||||
{
|
||||
gainLevelCooldown = 1200; //20 seconds
|
||||
}
|
||||
if (!NPC.downedMoonlord && rangedLevel >= 5500)
|
||||
{
|
||||
gainLevelCooldown = 2400; //40 seconds
|
||||
}
|
||||
rangedLevel++;
|
||||
if (fasterRangedLevel && rangedLevel % 100 != 0 && Main.rand.NextBool(10)) //add only to non-multiples of 100
|
||||
rangedLevel++;
|
||||
if (!ReduceCooldown((int)ClassType.Ranged))
|
||||
{
|
||||
if (!Main.hardMode && rangedLevel >= 1500)
|
||||
gainLevelCooldown = 1200; //20 seconds
|
||||
if (!NPC.downedMoonlord && rangedLevel >= 5500)
|
||||
gainLevelCooldown = 2400; //40 seconds
|
||||
}
|
||||
else
|
||||
gainLevelCooldown /= 2;
|
||||
|
||||
if (fasterRangedLevel)
|
||||
gainLevelCooldown /= 2;
|
||||
|
||||
rangedLevel++;
|
||||
shootFireworksLevelUpRanged = true;
|
||||
|
||||
if (Main.netMode == NetmodeID.MultiplayerClient)
|
||||
{
|
||||
LevelPacket(false, 1);
|
||||
}
|
||||
LevelPacket(false, (int)ClassType.Ranged);
|
||||
}
|
||||
else if (proj.magic && magicLevel <= 12500)
|
||||
{
|
||||
if (!Main.hardMode && magicLevel >= 1500)
|
||||
{
|
||||
gainLevelCooldown = 1200; //20 seconds
|
||||
}
|
||||
if (!NPC.downedMoonlord && magicLevel >= 5500)
|
||||
{
|
||||
gainLevelCooldown = 2400; //40 seconds
|
||||
}
|
||||
magicLevel++;
|
||||
if (fasterMagicLevel && magicLevel % 100 != 0 && Main.rand.NextBool(10)) //add only to non-multiples of 100
|
||||
magicLevel++;
|
||||
if (!ReduceCooldown((int)ClassType.Magic))
|
||||
{
|
||||
if (!Main.hardMode && magicLevel >= 1500)
|
||||
gainLevelCooldown = 1200; //20 seconds
|
||||
if (!NPC.downedMoonlord && magicLevel >= 5500)
|
||||
gainLevelCooldown = 2400; //40 seconds
|
||||
}
|
||||
else
|
||||
gainLevelCooldown /= 2;
|
||||
|
||||
if (fasterMagicLevel)
|
||||
gainLevelCooldown /= 2;
|
||||
|
||||
magicLevel++;
|
||||
shootFireworksLevelUpMagic = true;
|
||||
|
||||
if (Main.netMode == NetmodeID.MultiplayerClient)
|
||||
{
|
||||
LevelPacket(false, 2);
|
||||
}
|
||||
LevelPacket(false, (int)ClassType.Magic);
|
||||
}
|
||||
else if (isSummon && summonLevel <= 12500)
|
||||
{
|
||||
if (!Main.hardMode && summonLevel >= 1500)
|
||||
{
|
||||
gainLevelCooldown = 1200; //20 seconds
|
||||
}
|
||||
if (!NPC.downedMoonlord && summonLevel >= 5500)
|
||||
{
|
||||
gainLevelCooldown = 2400; //40 seconds
|
||||
}
|
||||
summonLevel++;
|
||||
if (fasterSummonLevel && summonLevel % 100 != 0 && Main.rand.NextBool(10)) //add only to non-multiples of 100
|
||||
summonLevel++;
|
||||
if (!ReduceCooldown((int)ClassType.Summon))
|
||||
{
|
||||
if (!Main.hardMode && summonLevel >= 1500)
|
||||
gainLevelCooldown = 1200; //20 seconds
|
||||
if (!NPC.downedMoonlord && summonLevel >= 5500)
|
||||
gainLevelCooldown = 2400; //40 seconds
|
||||
}
|
||||
else
|
||||
gainLevelCooldown /= 2;
|
||||
|
||||
if (fasterSummonLevel)
|
||||
gainLevelCooldown /= 2;
|
||||
|
||||
summonLevel++;
|
||||
shootFireworksLevelUpSummon = true;
|
||||
|
||||
if (Main.netMode == NetmodeID.MultiplayerClient)
|
||||
{
|
||||
LevelPacket(false, 3);
|
||||
}
|
||||
LevelPacket(false, (int)ClassType.Summon);
|
||||
}
|
||||
else if (proj.Calamity().rogue && rogueLevel <= 12500)
|
||||
{
|
||||
if (!Main.hardMode && rogueLevel >= 1500)
|
||||
{
|
||||
gainLevelCooldown = 1200; //20 seconds
|
||||
}
|
||||
if (!NPC.downedMoonlord && rogueLevel >= 5500)
|
||||
{
|
||||
gainLevelCooldown = 2400; //40 seconds
|
||||
}
|
||||
rogueLevel++;
|
||||
if (fasterRogueLevel && rogueLevel % 100 != 0 && Main.rand.NextBool(10)) //add only to non-multiples of 100
|
||||
rogueLevel++;
|
||||
if (!ReduceCooldown((int)ClassType.Rogue))
|
||||
{
|
||||
if (!Main.hardMode && rogueLevel >= 1500)
|
||||
gainLevelCooldown = 1200; //20 seconds
|
||||
if (!NPC.downedMoonlord && rogueLevel >= 5500)
|
||||
gainLevelCooldown = 2400; //40 seconds
|
||||
}
|
||||
else
|
||||
gainLevelCooldown /= 2;
|
||||
|
||||
if (fasterRogueLevel)
|
||||
gainLevelCooldown /= 2;
|
||||
|
||||
rogueLevel++;
|
||||
shootFireworksLevelUpRogue = true;
|
||||
|
||||
if (Main.netMode == NetmodeID.MultiplayerClient)
|
||||
{
|
||||
LevelPacket(false, 4);
|
||||
}
|
||||
LevelPacket(false, (int)ClassType.Rogue);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6206,8 +6230,7 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (CalamityWorld.ironHeart)
|
||||
{
|
||||
int damageMin = 60 + (player.statLifeMax2 / 10);
|
||||
int damageWithDR = (int)(damage * (1f - player.endurance));
|
||||
int damageMin = 40 + (player.statLifeMax2 / 10);
|
||||
if (damage < damageMin)
|
||||
{
|
||||
player.endurance = 0f;
|
||||
@@ -6491,8 +6514,7 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (CalamityWorld.ironHeart)
|
||||
{
|
||||
int damageMin = 60 + (player.statLifeMax2 / 10);
|
||||
int damageWithDR = (int)(damage * (1f - player.endurance));
|
||||
int damageMin = (Main.expertMode ? 10 : 20) + (player.statLifeMax2 / (Main.expertMode ? 40 : 20));
|
||||
if (damage < damageMin)
|
||||
{
|
||||
player.endurance = 0f;
|
||||
@@ -7589,7 +7611,7 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
if (CalamityWorld.ironHeart)
|
||||
{
|
||||
int damageMin = 60 + (player.statLifeMax2 / 10);
|
||||
int damageMin = 80 + (player.statLifeMax2 / 10);
|
||||
playSound = false;
|
||||
hurtSoundTimer = 20;
|
||||
if (damage <= damageMin)
|
||||
@@ -10069,6 +10091,68 @@ namespace CalamityMod.CalPlayer
|
||||
#endregion
|
||||
|
||||
#region Proficiency Stuff
|
||||
private bool ReduceCooldown(int classType)
|
||||
{
|
||||
switch (classType)
|
||||
{
|
||||
case (int)ClassType.Melee:
|
||||
|
||||
if (meleeLevel < levelTier3 && (rangedLevel >= levelTier3 || magicLevel >= levelTier3 || summonLevel >= levelTier3 || rogueLevel >= levelTier3))
|
||||
return true;
|
||||
if (meleeLevel < levelTier2 && (rangedLevel >= levelTier2 || magicLevel >= levelTier2 || summonLevel >= levelTier2 || rogueLevel >= levelTier2))
|
||||
return true;
|
||||
if (meleeLevel < levelTier1 && (rangedLevel >= levelTier1 || magicLevel >= levelTier1 || summonLevel >= levelTier1 || rogueLevel >= levelTier1))
|
||||
return true;
|
||||
|
||||
break;
|
||||
|
||||
case (int)ClassType.Ranged:
|
||||
|
||||
if (rangedLevel < levelTier3 && (meleeLevel >= levelTier3 || magicLevel >= levelTier3 || summonLevel >= levelTier3 || rogueLevel >= levelTier3))
|
||||
return true;
|
||||
if (rangedLevel < levelTier2 && (meleeLevel >= levelTier2 || magicLevel >= levelTier2 || summonLevel >= levelTier2 || rogueLevel >= levelTier2))
|
||||
return true;
|
||||
if (rangedLevel < levelTier1 && (meleeLevel >= levelTier1 || magicLevel >= levelTier1 || summonLevel >= levelTier1 || rogueLevel >= levelTier1))
|
||||
return true;
|
||||
|
||||
break;
|
||||
|
||||
case (int)ClassType.Magic:
|
||||
|
||||
if (magicLevel < levelTier3 && (rangedLevel >= levelTier3 || meleeLevel >= levelTier3 || summonLevel >= levelTier3 || rogueLevel >= levelTier3))
|
||||
return true;
|
||||
if (magicLevel < levelTier2 && (rangedLevel >= levelTier2 || meleeLevel >= levelTier2 || summonLevel >= levelTier2 || rogueLevel >= levelTier2))
|
||||
return true;
|
||||
if (magicLevel < levelTier1 && (rangedLevel >= levelTier1 || meleeLevel >= levelTier1 || summonLevel >= levelTier1 || rogueLevel >= levelTier1))
|
||||
return true;
|
||||
|
||||
break;
|
||||
|
||||
case (int)ClassType.Summon:
|
||||
|
||||
if (summonLevel < levelTier3 && (rangedLevel >= levelTier3 || magicLevel >= levelTier3 || meleeLevel >= levelTier3 || rogueLevel >= levelTier3))
|
||||
return true;
|
||||
if (summonLevel < levelTier2 && (rangedLevel >= levelTier2 || magicLevel >= levelTier2 || meleeLevel >= levelTier2 || rogueLevel >= levelTier2))
|
||||
return true;
|
||||
if (summonLevel < levelTier1 && (rangedLevel >= levelTier1 || magicLevel >= levelTier1 || meleeLevel >= levelTier1 || rogueLevel >= levelTier1))
|
||||
return true;
|
||||
|
||||
break;
|
||||
|
||||
case (int)ClassType.Rogue:
|
||||
|
||||
if (rogueLevel < levelTier3 && (rangedLevel >= levelTier3 || magicLevel >= levelTier3 || summonLevel >= levelTier3 || meleeLevel >= levelTier3))
|
||||
return true;
|
||||
if (rogueLevel < levelTier2 && (rangedLevel >= levelTier2 || magicLevel >= levelTier2 || summonLevel >= levelTier2 || meleeLevel >= levelTier2))
|
||||
return true;
|
||||
if (rogueLevel < levelTier1 && (rangedLevel >= levelTier1 || magicLevel >= levelTier1 || summonLevel >= levelTier1 || meleeLevel >= levelTier1))
|
||||
return true;
|
||||
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void GetExactLevelUp()
|
||||
{
|
||||
if (gainLevelCooldown > 0)
|
||||
@@ -10078,49 +10162,49 @@ namespace CalamityMod.CalPlayer
|
||||
switch (meleeLevel)
|
||||
{
|
||||
case 100:
|
||||
this.ExactLevelUp(0, 1, false);
|
||||
ExactLevelUp(0, 1, false);
|
||||
break;
|
||||
case 300:
|
||||
this.ExactLevelUp(0, 2, false);
|
||||
ExactLevelUp(0, 2, false);
|
||||
break;
|
||||
case 600:
|
||||
this.ExactLevelUp(0, 3, false);
|
||||
ExactLevelUp(0, 3, false);
|
||||
break;
|
||||
case 1000:
|
||||
this.ExactLevelUp(0, 4, false);
|
||||
ExactLevelUp(0, 4, false);
|
||||
break;
|
||||
case 1500:
|
||||
this.ExactLevelUp(0, 5, false);
|
||||
ExactLevelUp(0, 5, false);
|
||||
break;
|
||||
case 2100:
|
||||
this.ExactLevelUp(0, 6, false);
|
||||
ExactLevelUp(0, 6, false);
|
||||
break;
|
||||
case 2800:
|
||||
this.ExactLevelUp(0, 7, false);
|
||||
ExactLevelUp(0, 7, false);
|
||||
break;
|
||||
case 3600:
|
||||
this.ExactLevelUp(0, 8, false);
|
||||
ExactLevelUp(0, 8, false);
|
||||
break;
|
||||
case 4500:
|
||||
this.ExactLevelUp(0, 9, false);
|
||||
ExactLevelUp(0, 9, false);
|
||||
break;
|
||||
case 5500:
|
||||
this.ExactLevelUp(0, 10, false);
|
||||
ExactLevelUp(0, 10, false);
|
||||
break;
|
||||
case 6600:
|
||||
this.ExactLevelUp(0, 11, false);
|
||||
ExactLevelUp(0, 11, false);
|
||||
break;
|
||||
case 7800:
|
||||
this.ExactLevelUp(0, 12, false);
|
||||
ExactLevelUp(0, 12, false);
|
||||
break;
|
||||
case 9100:
|
||||
this.ExactLevelUp(0, 13, false);
|
||||
ExactLevelUp(0, 13, false);
|
||||
break;
|
||||
case 10500:
|
||||
this.ExactLevelUp(0, 14, false);
|
||||
ExactLevelUp(0, 14, false);
|
||||
break;
|
||||
case 12500: //celebration or some shit for final level, yay
|
||||
this.ExactLevelUp(0, 15, true);
|
||||
ExactLevelUp(0, 15, true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -10131,49 +10215,49 @@ namespace CalamityMod.CalPlayer
|
||||
switch (rangedLevel)
|
||||
{
|
||||
case 100:
|
||||
this.ExactLevelUp(1, 1, false);
|
||||
ExactLevelUp(1, 1, false);
|
||||
break;
|
||||
case 300:
|
||||
this.ExactLevelUp(1, 2, false);
|
||||
ExactLevelUp(1, 2, false);
|
||||
break;
|
||||
case 600:
|
||||
this.ExactLevelUp(1, 3, false);
|
||||
ExactLevelUp(1, 3, false);
|
||||
break;
|
||||
case 1000:
|
||||
this.ExactLevelUp(1, 4, false);
|
||||
ExactLevelUp(1, 4, false);
|
||||
break;
|
||||
case 1500:
|
||||
this.ExactLevelUp(1, 5, false);
|
||||
ExactLevelUp(1, 5, false);
|
||||
break;
|
||||
case 2100:
|
||||
this.ExactLevelUp(1, 6, false);
|
||||
ExactLevelUp(1, 6, false);
|
||||
break;
|
||||
case 2800:
|
||||
this.ExactLevelUp(1, 7, false);
|
||||
ExactLevelUp(1, 7, false);
|
||||
break;
|
||||
case 3600:
|
||||
this.ExactLevelUp(1, 8, false);
|
||||
ExactLevelUp(1, 8, false);
|
||||
break;
|
||||
case 4500:
|
||||
this.ExactLevelUp(1, 9, false);
|
||||
ExactLevelUp(1, 9, false);
|
||||
break;
|
||||
case 5500:
|
||||
this.ExactLevelUp(1, 10, false);
|
||||
ExactLevelUp(1, 10, false);
|
||||
break;
|
||||
case 6600:
|
||||
this.ExactLevelUp(1, 11, false);
|
||||
ExactLevelUp(1, 11, false);
|
||||
break;
|
||||
case 7800:
|
||||
this.ExactLevelUp(1, 12, false);
|
||||
ExactLevelUp(1, 12, false);
|
||||
break;
|
||||
case 9100:
|
||||
this.ExactLevelUp(1, 13, false);
|
||||
ExactLevelUp(1, 13, false);
|
||||
break;
|
||||
case 10500:
|
||||
this.ExactLevelUp(1, 14, false);
|
||||
ExactLevelUp(1, 14, false);
|
||||
break;
|
||||
case 12500: //celebration or some shit for final level, yay
|
||||
this.ExactLevelUp(1, 15, true);
|
||||
ExactLevelUp(1, 15, true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -10184,49 +10268,49 @@ namespace CalamityMod.CalPlayer
|
||||
switch (magicLevel)
|
||||
{
|
||||
case 100:
|
||||
this.ExactLevelUp(2, 1, false);
|
||||
ExactLevelUp(2, 1, false);
|
||||
break;
|
||||
case 300:
|
||||
this.ExactLevelUp(2, 2, false);
|
||||
ExactLevelUp(2, 2, false);
|
||||
break;
|
||||
case 600:
|
||||
this.ExactLevelUp(2, 3, false);
|
||||
ExactLevelUp(2, 3, false);
|
||||
break;
|
||||
case 1000:
|
||||
this.ExactLevelUp(2, 4, false);
|
||||
ExactLevelUp(2, 4, false);
|
||||
break;
|
||||
case 1500:
|
||||
this.ExactLevelUp(2, 5, false);
|
||||
ExactLevelUp(2, 5, false);
|
||||
break;
|
||||
case 2100:
|
||||
this.ExactLevelUp(2, 6, false);
|
||||
ExactLevelUp(2, 6, false);
|
||||
break;
|
||||
case 2800:
|
||||
this.ExactLevelUp(2, 7, false);
|
||||
ExactLevelUp(2, 7, false);
|
||||
break;
|
||||
case 3600:
|
||||
this.ExactLevelUp(2, 8, false);
|
||||
ExactLevelUp(2, 8, false);
|
||||
break;
|
||||
case 4500:
|
||||
this.ExactLevelUp(2, 9, false);
|
||||
ExactLevelUp(2, 9, false);
|
||||
break;
|
||||
case 5500:
|
||||
this.ExactLevelUp(2, 10, false);
|
||||
ExactLevelUp(2, 10, false);
|
||||
break;
|
||||
case 6600:
|
||||
this.ExactLevelUp(2, 11, false);
|
||||
ExactLevelUp(2, 11, false);
|
||||
break;
|
||||
case 7800:
|
||||
this.ExactLevelUp(2, 12, false);
|
||||
ExactLevelUp(2, 12, false);
|
||||
break;
|
||||
case 9100:
|
||||
this.ExactLevelUp(2, 13, false);
|
||||
ExactLevelUp(2, 13, false);
|
||||
break;
|
||||
case 10500:
|
||||
this.ExactLevelUp(2, 14, false);
|
||||
ExactLevelUp(2, 14, false);
|
||||
break;
|
||||
case 12500: //celebration or some shit for final level, yay
|
||||
this.ExactLevelUp(2, 15, true);
|
||||
ExactLevelUp(2, 15, true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -10237,49 +10321,49 @@ namespace CalamityMod.CalPlayer
|
||||
switch (summonLevel)
|
||||
{
|
||||
case 100:
|
||||
this.ExactLevelUp(3, 1, false);
|
||||
ExactLevelUp(3, 1, false);
|
||||
break;
|
||||
case 300:
|
||||
this.ExactLevelUp(3, 2, false);
|
||||
ExactLevelUp(3, 2, false);
|
||||
break;
|
||||
case 600:
|
||||
this.ExactLevelUp(3, 3, false);
|
||||
ExactLevelUp(3, 3, false);
|
||||
break;
|
||||
case 1000:
|
||||
this.ExactLevelUp(3, 4, false);
|
||||
ExactLevelUp(3, 4, false);
|
||||
break;
|
||||
case 1500:
|
||||
this.ExactLevelUp(3, 5, false);
|
||||
ExactLevelUp(3, 5, false);
|
||||
break;
|
||||
case 2100:
|
||||
this.ExactLevelUp(3, 6, false);
|
||||
ExactLevelUp(3, 6, false);
|
||||
break;
|
||||
case 2800:
|
||||
this.ExactLevelUp(3, 7, false);
|
||||
ExactLevelUp(3, 7, false);
|
||||
break;
|
||||
case 3600:
|
||||
this.ExactLevelUp(3, 8, false);
|
||||
ExactLevelUp(3, 8, false);
|
||||
break;
|
||||
case 4500:
|
||||
this.ExactLevelUp(3, 9, false);
|
||||
ExactLevelUp(3, 9, false);
|
||||
break;
|
||||
case 5500:
|
||||
this.ExactLevelUp(3, 10, false);
|
||||
ExactLevelUp(3, 10, false);
|
||||
break;
|
||||
case 6600:
|
||||
this.ExactLevelUp(3, 11, false);
|
||||
ExactLevelUp(3, 11, false);
|
||||
break;
|
||||
case 7800:
|
||||
this.ExactLevelUp(3, 12, false);
|
||||
ExactLevelUp(3, 12, false);
|
||||
break;
|
||||
case 9100:
|
||||
this.ExactLevelUp(3, 13, false);
|
||||
ExactLevelUp(3, 13, false);
|
||||
break;
|
||||
case 10500:
|
||||
this.ExactLevelUp(3, 14, false);
|
||||
ExactLevelUp(3, 14, false);
|
||||
break;
|
||||
case 12500: //celebration or some shit for final level, yay
|
||||
this.ExactLevelUp(3, 15, true);
|
||||
ExactLevelUp(3, 15, true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -10290,49 +10374,49 @@ namespace CalamityMod.CalPlayer
|
||||
switch (rogueLevel)
|
||||
{
|
||||
case 100:
|
||||
this.ExactLevelUp(4, 1, false);
|
||||
ExactLevelUp(4, 1, false);
|
||||
break;
|
||||
case 300:
|
||||
this.ExactLevelUp(4, 2, false);
|
||||
ExactLevelUp(4, 2, false);
|
||||
break;
|
||||
case 600:
|
||||
this.ExactLevelUp(4, 3, false);
|
||||
ExactLevelUp(4, 3, false);
|
||||
break;
|
||||
case 1000:
|
||||
this.ExactLevelUp(4, 4, false);
|
||||
ExactLevelUp(4, 4, false);
|
||||
break;
|
||||
case 1500:
|
||||
this.ExactLevelUp(4, 5, false);
|
||||
ExactLevelUp(4, 5, false);
|
||||
break;
|
||||
case 2100:
|
||||
this.ExactLevelUp(4, 6, false);
|
||||
ExactLevelUp(4, 6, false);
|
||||
break;
|
||||
case 2800:
|
||||
this.ExactLevelUp(4, 7, false);
|
||||
ExactLevelUp(4, 7, false);
|
||||
break;
|
||||
case 3600:
|
||||
this.ExactLevelUp(4, 8, false);
|
||||
ExactLevelUp(4, 8, false);
|
||||
break;
|
||||
case 4500:
|
||||
this.ExactLevelUp(4, 9, false);
|
||||
ExactLevelUp(4, 9, false);
|
||||
break;
|
||||
case 5500:
|
||||
this.ExactLevelUp(4, 10, false);
|
||||
ExactLevelUp(4, 10, false);
|
||||
break;
|
||||
case 6600:
|
||||
this.ExactLevelUp(4, 11, false);
|
||||
ExactLevelUp(4, 11, false);
|
||||
break;
|
||||
case 7800:
|
||||
this.ExactLevelUp(4, 12, false);
|
||||
ExactLevelUp(4, 12, false);
|
||||
break;
|
||||
case 9100:
|
||||
this.ExactLevelUp(4, 13, false);
|
||||
ExactLevelUp(4, 13, false);
|
||||
break;
|
||||
case 10500:
|
||||
this.ExactLevelUp(4, 14, false);
|
||||
ExactLevelUp(4, 14, false);
|
||||
break;
|
||||
case 12500: //celebration or some shit for final level, yay
|
||||
this.ExactLevelUp(4, 15, true);
|
||||
ExactLevelUp(4, 15, true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -526,60 +526,6 @@ namespace CalamityMod.CalPlayer
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
// Calculate underground darkness here. The effect is applied in CalamityMod.ModifyLightingBrightness.
|
||||
Point point = player.Center.ToTileCoordinates();
|
||||
if (point.Y > Main.worldSurface && !modPlayer.ZoneAbyss && !player.ZoneUnderworldHeight && !CalamityPlayer.areThereAnyDamnBosses)
|
||||
{
|
||||
// Darkness strength scales smoothly with how deep you are.
|
||||
double totalUndergroundDepth = Main.maxTilesY - 200D - Main.worldSurface;
|
||||
double playerUndergroundDepth = point.Y - Main.worldSurface;
|
||||
double depthRatio = playerUndergroundDepth / totalUndergroundDepth;
|
||||
int lightStrength = modPlayer.GetTotalLightStrength();
|
||||
|
||||
// In the last 50 blocks before hell, the darkness smoothly fades away.
|
||||
float FadeAwayStart = (float)(1D - 50D / totalUndergroundDepth);
|
||||
float darknessStrength = (float)(depthRatio / FadeAwayStart);
|
||||
if (depthRatio > FadeAwayStart)
|
||||
{
|
||||
// Varies from 1.0 to 0.0 as depthRatio varies from FadeAwayStart to 1.0.
|
||||
darknessStrength = MathHelper.Lerp(0f, 1f, (1f - (float)depthRatio) / (1f - FadeAwayStart));
|
||||
}
|
||||
|
||||
// Reduce the power of cave darkness based on your light level. 5+ is enough to totally eliminate it.
|
||||
switch (lightStrength)
|
||||
{
|
||||
case 0:
|
||||
darknessStrength *= 0.75f;
|
||||
break;
|
||||
case 1:
|
||||
darknessStrength *= 0.5f;
|
||||
break;
|
||||
case 2:
|
||||
darknessStrength *= 0.25f;
|
||||
break;
|
||||
case 3:
|
||||
darknessStrength *= 0.15f;
|
||||
break;
|
||||
case 4:
|
||||
darknessStrength *= 0.05f;
|
||||
break;
|
||||
default:
|
||||
darknessStrength = 0f;
|
||||
break;
|
||||
}
|
||||
modPlayer.caveDarkness = darknessStrength;
|
||||
}
|
||||
|
||||
// Immunity bools
|
||||
bool hasMoltenSet = player.head == ArmorIDs.Head.MoltenHelmet && player.body == ArmorIDs.Body.MoltenBreastplate && player.legs == ArmorIDs.Legs.MoltenGreaves;
|
||||
|
||||
bool immunityToHotAndCold = hasMoltenSet || player.magmaStone || player.frostArmor || modPlayer.fBulwark || modPlayer.fBarrier ||
|
||||
modPlayer.frostFlare || modPlayer.rampartOfDeities || modPlayer.cryogenSoul || modPlayer.snowman || modPlayer.blazingCore || modPlayer.permafrostsConcoction || modPlayer.profanedCrystalBuffs || modPlayer.coldDivinity || modPlayer.eGauntlet;
|
||||
|
||||
bool immunityToCold = player.HasBuff(BuffID.Campfire) || Main.campfire || player.resistCold || modPlayer.eskimoSet || player.buffImmune[BuffID.Frozen] || modPlayer.aAmpoule || player.HasBuff(BuffID.Inferno) || immunityToHotAndCold || modPlayer.externalColdImmunity;
|
||||
|
||||
bool immunityToHot = player.lavaImmune || player.lavaRose || player.lavaMax > 0 || immunityToHotAndCold || modPlayer.externalHeatImmunity;
|
||||
|
||||
// Thorn and spike effects
|
||||
// 10 = crimson/corruption thorns, 17 = jungle thorns, 40 = dungeon spikes, 60 = temple spikes
|
||||
Vector2 tileType;
|
||||
@@ -606,27 +552,6 @@ namespace CalamityMod.CalPlayer
|
||||
break;
|
||||
}
|
||||
|
||||
// Astral effects
|
||||
if (modPlayer.ZoneAstral)
|
||||
{
|
||||
player.gravity *= 0.75f;
|
||||
}
|
||||
|
||||
// Space effects
|
||||
if (player.InSpace())
|
||||
{
|
||||
if (Main.dayTime)
|
||||
{
|
||||
if (!immunityToHot)
|
||||
player.AddBuff(BuffID.Burning, 2, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!immunityToCold)
|
||||
player.AddBuff(BuffID.Frostburn, 2, false);
|
||||
}
|
||||
}
|
||||
|
||||
// Leech bleed
|
||||
if (player.ZoneJungle && player.wet && !player.lavaWet && !player.honeyWet)
|
||||
{
|
||||
@@ -634,52 +559,153 @@ namespace CalamityMod.CalPlayer
|
||||
player.AddBuff(BuffID.Bleeding, 300, false);
|
||||
}
|
||||
|
||||
// Ice shards, lightning and sharknadoes
|
||||
bool nearPillar = player.PillarZone();
|
||||
if (player.ZoneOverworldHeight && !BossRushEvent.BossRushActive && !CalamityPlayer.areThereAnyDamnBosses && !CalamityPlayer.areThereAnyDamnEvents && NPC.MoonLordCountdown == 0 && !player.InSpace())
|
||||
if (!BossRushEvent.BossRushActive && !CalamityPlayer.areThereAnyDamnBosses && !CalamityPlayer.areThereAnyDamnEvents)
|
||||
{
|
||||
Vector2 sharknadoSpawnPoint = new Vector2(player.Center.X - Main.rand.Next(300, 701), player.Center.Y - Main.rand.Next(700, 801));
|
||||
if (point.X > Main.maxTilesX / 2)
|
||||
sharknadoSpawnPoint.X = player.Center.X + Main.rand.Next(300, 701);
|
||||
// Astral effects
|
||||
if (modPlayer.ZoneAstral)
|
||||
player.gravity *= 0.75f;
|
||||
|
||||
if (Main.raining)
|
||||
// Calculate underground darkness here. The effect is applied in CalamityMod.ModifyLightingBrightness.
|
||||
Point point = player.Center.ToTileCoordinates();
|
||||
if (point.Y > Main.worldSurface && !modPlayer.ZoneAbyss && !player.ZoneUnderworldHeight)
|
||||
{
|
||||
float frequencyMult = (1f - Main.cloudAlpha) * CalamityConfig.Instance.DeathWeatherMultiplier; // 3 to 0.055
|
||||
// Darkness strength scales smoothly with how deep you are.
|
||||
double totalUndergroundDepth = Main.maxTilesY - 200D - Main.worldSurface;
|
||||
double playerUndergroundDepth = point.Y - Main.worldSurface;
|
||||
double depthRatio = playerUndergroundDepth / totalUndergroundDepth;
|
||||
int lightStrength = modPlayer.GetTotalLightStrength();
|
||||
|
||||
Vector2 spawnPoint = new Vector2(player.Center.X + Main.rand.Next(-1000, 1001), player.Center.Y - Main.rand.Next(700, 801));
|
||||
Tile tileSafely = Framing.GetTileSafely((int)(spawnPoint.X / 16f), (int)(spawnPoint.Y / 16f));
|
||||
|
||||
if (player.ZoneSnow)
|
||||
// In the last 50 blocks before hell, the darkness smoothly fades away.
|
||||
float FadeAwayStart = (float)(1D - 50D / totalUndergroundDepth);
|
||||
float darknessStrength = (float)(depthRatio / FadeAwayStart);
|
||||
if (depthRatio > FadeAwayStart)
|
||||
{
|
||||
if (!tileSafely.active())
|
||||
{
|
||||
int divisor = (int)((Main.hardMode ? 50f : 60f) * frequencyMult);
|
||||
float windVelocity = (float)Math.Sqrt(Math.Abs(Main.windSpeed)) * Math.Sign(Main.windSpeed) * (Main.cloudAlpha + 0.5f) * 25f + Main.rand.NextFloat() * 0.2f - 0.1f;
|
||||
Vector2 velocity = new Vector2(windVelocity * 0.2f, 3f * Main.rand.NextFloat());
|
||||
// Varies from 1.0 to 0.0 as depthRatio varies from FadeAwayStart to 1.0.
|
||||
darknessStrength = MathHelper.Lerp(0f, 1f, (1f - (float)depthRatio) / (1f - FadeAwayStart));
|
||||
}
|
||||
|
||||
if (player.miscCounter % divisor == 0 && Main.rand.NextBool(3))
|
||||
Projectile.NewProjectile(spawnPoint, velocity, ModContent.ProjectileType<IceRain>(), 20, 0f, player.whoAmI, 2f, 0f);
|
||||
// Reduce the power of cave darkness based on your light level. 5+ is enough to totally eliminate it.
|
||||
switch (lightStrength)
|
||||
{
|
||||
case 0:
|
||||
darknessStrength *= 0.75f;
|
||||
break;
|
||||
case 1:
|
||||
darknessStrength *= 0.5f;
|
||||
break;
|
||||
case 2:
|
||||
darknessStrength *= 0.25f;
|
||||
break;
|
||||
case 3:
|
||||
darknessStrength *= 0.15f;
|
||||
break;
|
||||
case 4:
|
||||
darknessStrength *= 0.05f;
|
||||
break;
|
||||
default:
|
||||
darknessStrength = 0f;
|
||||
break;
|
||||
}
|
||||
modPlayer.caveDarkness = darknessStrength;
|
||||
}
|
||||
|
||||
// Ice shards, lightning and sharknadoes
|
||||
bool nearPillar = player.PillarZone();
|
||||
if (player.ZoneOverworldHeight && NPC.MoonLordCountdown == 0 && !player.InSpace())
|
||||
{
|
||||
Vector2 sharknadoSpawnPoint = new Vector2(player.Center.X - Main.rand.Next(300, 701), player.Center.Y - Main.rand.Next(700, 801));
|
||||
if (point.X > Main.maxTilesX / 2)
|
||||
sharknadoSpawnPoint.X = player.Center.X + Main.rand.Next(300, 701);
|
||||
|
||||
if (Main.raining)
|
||||
{
|
||||
float frequencyMult = (1f - Main.cloudAlpha) * CalamityConfig.Instance.DeathWeatherMultiplier; // 3 to 0.055
|
||||
|
||||
Vector2 spawnPoint = new Vector2(player.Center.X + Main.rand.Next(-1000, 1001), player.Center.Y - Main.rand.Next(700, 801));
|
||||
Tile tileSafely = Framing.GetTileSafely((int)(spawnPoint.X / 16f), (int)(spawnPoint.Y / 16f));
|
||||
|
||||
if (player.ZoneSnow)
|
||||
{
|
||||
if (!tileSafely.active())
|
||||
{
|
||||
int divisor = (int)((Main.hardMode ? 50f : 60f) * frequencyMult);
|
||||
float windVelocity = (float)Math.Sqrt(Math.Abs(Main.windSpeed)) * Math.Sign(Main.windSpeed) * (Main.cloudAlpha + 0.5f) * 25f + Main.rand.NextFloat() * 0.2f - 0.1f;
|
||||
Vector2 velocity = new Vector2(windVelocity * 0.2f, 3f * Main.rand.NextFloat());
|
||||
|
||||
if (player.miscCounter % divisor == 0 && Main.rand.NextBool(3))
|
||||
Projectile.NewProjectile(spawnPoint, velocity, ModContent.ProjectileType<IceRain>(), 20, 0f, player.whoAmI, 2f, 0f);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (player.ZoneBeach && !modPlayer.ZoneSulphur)
|
||||
{
|
||||
int randomFrequency = (int)(50f * frequencyMult);
|
||||
if (player.miscCounter == 280 && Main.rand.NextBool(randomFrequency) && player.ownedProjectileCounts[ProjectileID.Cthulunado] < 1)
|
||||
{
|
||||
Main.PlaySound(SoundID.NPCDeath19, (int)sharknadoSpawnPoint.X, (int)sharknadoSpawnPoint.Y);
|
||||
int y = (int)(sharknadoSpawnPoint.Y / 16f);
|
||||
int x = (int)(sharknadoSpawnPoint.X / 16f);
|
||||
int yAdjust = 100;
|
||||
if (x < 10)
|
||||
x = 10;
|
||||
if (x > Main.maxTilesX - 10)
|
||||
x = Main.maxTilesX - 10;
|
||||
if (y < 10)
|
||||
y = 10;
|
||||
if (y > Main.maxTilesY - yAdjust - 10)
|
||||
y = Main.maxTilesY - yAdjust - 10;
|
||||
|
||||
int spawnAreaY = Main.maxTilesY - y;
|
||||
for (int j = y; j < y + spawnAreaY; j++)
|
||||
{
|
||||
Tile tile = Main.tile[x, j];
|
||||
if ((tile.active() && Main.tileSolid[tile.type]) || tile.liquid >= 200)
|
||||
{
|
||||
y = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int tornado = Projectile.NewProjectile(x * 16 + 8, y * 16 - 24, 0f, 0f, ProjectileID.Cthulunado, 50, 4f, player.whoAmI, 16f, 24f);
|
||||
Main.projectile[tornado].netUpdate = true;
|
||||
}
|
||||
}
|
||||
|
||||
int randomFrequency2 = (int)(20f * frequencyMult);
|
||||
if (CalamityWorld.rainingAcid && player.Calamity().ZoneSulphur)
|
||||
randomFrequency2 = (int)(randomFrequency2 * 3.75);
|
||||
if (player.miscCounter % (Main.hardMode ? 90 : 120) == 0 && Main.rand.NextBool(randomFrequency2))
|
||||
{
|
||||
if (!tileSafely.active())
|
||||
{
|
||||
float randomVelocity = Main.rand.NextFloat() - 0.5f;
|
||||
Vector2 fireTo = new Vector2(spawnPoint.X + 100f * randomVelocity, spawnPoint.Y + 900f);
|
||||
Vector2 direction = fireTo - spawnPoint;
|
||||
Vector2 velocity = Vector2.Normalize(direction) * 12f;
|
||||
Projectile.NewProjectile(spawnPoint.X, spawnPoint.Y, 0f, velocity.Y, ModContent.ProjectileType<LightningMark>(), 0, 0f, player.whoAmI, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (player.ZoneBeach && !modPlayer.ZoneSulphur)
|
||||
{
|
||||
int randomFrequency = (int)(50f * frequencyMult);
|
||||
if (player.miscCounter == 280 && Main.rand.NextBool(randomFrequency) && player.ownedProjectileCounts[ProjectileID.Cthulunado] < 1)
|
||||
if (player.miscCounter == 280 && Main.rand.NextBool(10) && player.ownedProjectileCounts[ProjectileID.Sharknado] < 1)
|
||||
{
|
||||
Main.PlaySound(SoundID.NPCDeath19, (int)sharknadoSpawnPoint.X, (int)sharknadoSpawnPoint.Y);
|
||||
Main.PlaySound(SoundID.NPCDeath19, sharknadoSpawnPoint);
|
||||
int y = (int)(sharknadoSpawnPoint.Y / 16f);
|
||||
int x = (int)(sharknadoSpawnPoint.X / 16f);
|
||||
int yAdjust = 100;
|
||||
int num333 = 100;
|
||||
if (x < 10)
|
||||
x = 10;
|
||||
if (x > Main.maxTilesX - 10)
|
||||
x = Main.maxTilesX - 10;
|
||||
if (y < 10)
|
||||
y = 10;
|
||||
if (y > Main.maxTilesY - yAdjust - 10)
|
||||
y = Main.maxTilesY - yAdjust - 10;
|
||||
if (y > Main.maxTilesY - num333 - 10)
|
||||
y = Main.maxTilesY - num333 - 10;
|
||||
|
||||
int spawnAreaY = Main.maxTilesY - y;
|
||||
for (int j = y; j < y + spawnAreaY; j++)
|
||||
@@ -692,139 +718,114 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
}
|
||||
|
||||
int tornado = Projectile.NewProjectile(x * 16 + 8, y * 16 - 24, 0f, 0f, ProjectileID.Cthulunado, 50, 4f, player.whoAmI, 16f, 24f);
|
||||
int tornado = Projectile.NewProjectile(x * 16 + 8, y * 16 - 24, 0.01f, 0f, ProjectileID.Sharknado, 25, 4f, player.whoAmI, 16f, 15f);
|
||||
Main.projectile[tornado].netUpdate = true;
|
||||
}
|
||||
}
|
||||
|
||||
int randomFrequency2 = (int)(20f * frequencyMult);
|
||||
if (CalamityWorld.rainingAcid && player.Calamity().ZoneSulphur)
|
||||
randomFrequency2 = (int)(randomFrequency2 * 3.75);
|
||||
if (player.miscCounter % (Main.hardMode ? 90 : 120) == 0 && Main.rand.NextBool(randomFrequency2))
|
||||
{
|
||||
if (!tileSafely.active())
|
||||
{
|
||||
float randomVelocity = Main.rand.NextFloat() - 0.5f;
|
||||
Vector2 fireTo = new Vector2(spawnPoint.X + 100f * randomVelocity, spawnPoint.Y + 900f);
|
||||
Vector2 direction = fireTo - spawnPoint;
|
||||
Vector2 velocity = Vector2.Normalize(direction) * 12f;
|
||||
Projectile.NewProjectile(spawnPoint.X, spawnPoint.Y, 0f, velocity.Y, ModContent.ProjectileType<LightningMark>(), 0, 0f, player.whoAmI, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
// Immunity bools
|
||||
bool hasMoltenSet = player.head == ArmorIDs.Head.MoltenHelmet && player.body == ArmorIDs.Body.MoltenBreastplate && player.legs == ArmorIDs.Legs.MoltenGreaves;
|
||||
|
||||
bool immunityToHotAndCold = hasMoltenSet || player.magmaStone || player.frostArmor || modPlayer.fBulwark || modPlayer.fBarrier ||
|
||||
modPlayer.frostFlare || modPlayer.rampartOfDeities || modPlayer.cryogenSoul || modPlayer.snowman || modPlayer.blazingCore || modPlayer.permafrostsConcoction || modPlayer.profanedCrystalBuffs || modPlayer.coldDivinity || modPlayer.eGauntlet;
|
||||
|
||||
bool immunityToCold = player.HasBuff(BuffID.Campfire) || Main.campfire || player.resistCold || modPlayer.eskimoSet || player.buffImmune[BuffID.Frozen] || modPlayer.aAmpoule || player.HasBuff(BuffID.Inferno) || immunityToHotAndCold || modPlayer.externalColdImmunity;
|
||||
|
||||
bool immunityToHot = player.lavaImmune || player.lavaRose || player.lavaMax > 0 || immunityToHotAndCold || modPlayer.externalHeatImmunity;
|
||||
|
||||
// Space effects
|
||||
if (player.InSpace())
|
||||
{
|
||||
if (player.ZoneBeach && !modPlayer.ZoneSulphur)
|
||||
if (Main.dayTime)
|
||||
{
|
||||
if (player.miscCounter == 280 && Main.rand.NextBool(10) && player.ownedProjectileCounts[ProjectileID.Sharknado] < 1)
|
||||
{
|
||||
Main.PlaySound(SoundID.NPCDeath19, sharknadoSpawnPoint);
|
||||
int y = (int)(sharknadoSpawnPoint.Y / 16f);
|
||||
int x = (int)(sharknadoSpawnPoint.X / 16f);
|
||||
int num333 = 100;
|
||||
if (x < 10)
|
||||
x = 10;
|
||||
if (x > Main.maxTilesX - 10)
|
||||
x = Main.maxTilesX - 10;
|
||||
if (y < 10)
|
||||
y = 10;
|
||||
if (y > Main.maxTilesY - num333 - 10)
|
||||
y = Main.maxTilesY - num333 - 10;
|
||||
|
||||
int spawnAreaY = Main.maxTilesY - y;
|
||||
for (int j = y; j < y + spawnAreaY; j++)
|
||||
{
|
||||
Tile tile = Main.tile[x, j];
|
||||
if ((tile.active() && Main.tileSolid[tile.type]) || tile.liquid >= 200)
|
||||
{
|
||||
y = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int tornado = Projectile.NewProjectile(x * 16 + 8, y * 16 - 24, 0.01f, 0f, ProjectileID.Sharknado, 25, 4f, player.whoAmI, 16f, 15f);
|
||||
Main.projectile[tornado].netUpdate = true;
|
||||
}
|
||||
if (!immunityToHot)
|
||||
player.AddBuff(BuffID.Burning, 2, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!immunityToCold)
|
||||
player.AddBuff(BuffID.Frostburn, 2, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Cold timer
|
||||
if (!player.behindBackWall && Main.raining && player.ZoneSnow && !immunityToCold && player.ZoneOverworldHeight)
|
||||
{
|
||||
bool affectedByColdWater = player.wet && !player.lavaWet && !player.honeyWet && !player.arcticDivingGear;
|
||||
// Cold timer
|
||||
if (!player.behindBackWall && Main.raining && player.ZoneSnow && !immunityToCold && player.ZoneOverworldHeight)
|
||||
{
|
||||
bool affectedByColdWater = player.wet && !player.lavaWet && !player.honeyWet && !player.arcticDivingGear;
|
||||
|
||||
player.AddBuff(ModContent.BuffType<DeathModeCold>(), 2, false);
|
||||
player.AddBuff(ModContent.BuffType<DeathModeCold>(), 2, false);
|
||||
|
||||
modPlayer.deathModeBlizzardTime++;
|
||||
if (affectedByColdWater)
|
||||
modPlayer.deathModeBlizzardTime++;
|
||||
|
||||
if (modPlayer.deathModeUnderworldTime > 0)
|
||||
{
|
||||
modPlayer.deathModeUnderworldTime--;
|
||||
if (affectedByColdWater)
|
||||
modPlayer.deathModeBlizzardTime++;
|
||||
|
||||
if (modPlayer.deathModeUnderworldTime > 0)
|
||||
{
|
||||
modPlayer.deathModeUnderworldTime--;
|
||||
if (modPlayer.deathModeUnderworldTime < 0)
|
||||
modPlayer.deathModeUnderworldTime = 0;
|
||||
if (affectedByColdWater)
|
||||
modPlayer.deathModeUnderworldTime--;
|
||||
if (modPlayer.deathModeUnderworldTime < 0)
|
||||
modPlayer.deathModeUnderworldTime = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (modPlayer.deathModeBlizzardTime > 0)
|
||||
{
|
||||
modPlayer.deathModeBlizzardTime--;
|
||||
if (immunityToCold)
|
||||
modPlayer.deathModeBlizzardTime--;
|
||||
if (modPlayer.deathModeBlizzardTime < 0)
|
||||
modPlayer.deathModeBlizzardTime = 0;
|
||||
}
|
||||
|
||||
// Hot timer
|
||||
if (player.ZoneUnderworldHeight && !immunityToHot)
|
||||
{
|
||||
bool affectedByHotLava = player.lavaWet;
|
||||
|
||||
player.AddBuff(ModContent.BuffType<DeathModeHot>(), 2, false);
|
||||
|
||||
modPlayer.deathModeUnderworldTime++;
|
||||
if (affectedByHotLava)
|
||||
modPlayer.deathModeUnderworldTime++;
|
||||
|
||||
if (modPlayer.deathModeBlizzardTime > 0)
|
||||
else if (modPlayer.deathModeBlizzardTime > 0)
|
||||
{
|
||||
modPlayer.deathModeBlizzardTime--;
|
||||
if (affectedByHotLava)
|
||||
if (immunityToCold)
|
||||
modPlayer.deathModeBlizzardTime--;
|
||||
if (modPlayer.deathModeBlizzardTime < 0)
|
||||
modPlayer.deathModeBlizzardTime = 0;
|
||||
}
|
||||
}
|
||||
else if (modPlayer.deathModeUnderworldTime > 0)
|
||||
{
|
||||
modPlayer.deathModeUnderworldTime--;
|
||||
if (immunityToHot)
|
||||
|
||||
// Hot timer
|
||||
if (player.ZoneUnderworldHeight && !immunityToHot)
|
||||
{
|
||||
bool affectedByHotLava = player.lavaWet;
|
||||
|
||||
player.AddBuff(ModContent.BuffType<DeathModeHot>(), 2, false);
|
||||
|
||||
modPlayer.deathModeUnderworldTime++;
|
||||
if (affectedByHotLava)
|
||||
modPlayer.deathModeUnderworldTime++;
|
||||
|
||||
if (modPlayer.deathModeBlizzardTime > 0)
|
||||
{
|
||||
modPlayer.deathModeBlizzardTime--;
|
||||
if (affectedByHotLava)
|
||||
modPlayer.deathModeBlizzardTime--;
|
||||
if (modPlayer.deathModeBlizzardTime < 0)
|
||||
modPlayer.deathModeBlizzardTime = 0;
|
||||
}
|
||||
}
|
||||
else if (modPlayer.deathModeUnderworldTime > 0)
|
||||
{
|
||||
modPlayer.deathModeUnderworldTime--;
|
||||
if (modPlayer.deathModeUnderworldTime < 0)
|
||||
modPlayer.deathModeUnderworldTime = 0;
|
||||
if (immunityToHot)
|
||||
modPlayer.deathModeUnderworldTime--;
|
||||
if (modPlayer.deathModeUnderworldTime < 0)
|
||||
modPlayer.deathModeUnderworldTime = 0;
|
||||
}
|
||||
|
||||
// Cold effects
|
||||
if (modPlayer.deathModeBlizzardTime > 1800)
|
||||
player.AddBuff(BuffID.Frozen, 2, false);
|
||||
if (modPlayer.deathModeBlizzardTime > 1980)
|
||||
modPlayer.KillPlayer();
|
||||
|
||||
// Hot effects
|
||||
if (modPlayer.deathModeUnderworldTime > 360)
|
||||
player.AddBuff(BuffID.Weak, 2, false);
|
||||
if (modPlayer.deathModeUnderworldTime > 720)
|
||||
player.AddBuff(BuffID.Slow, 2, false);
|
||||
if (modPlayer.deathModeUnderworldTime > 1080)
|
||||
player.AddBuff(BuffID.OnFire, 2, false);
|
||||
if (modPlayer.deathModeUnderworldTime > 1440)
|
||||
player.AddBuff(BuffID.Confused, 2, false);
|
||||
if (modPlayer.deathModeUnderworldTime > 1800)
|
||||
player.AddBuff(BuffID.Burning, 2, false);
|
||||
}
|
||||
|
||||
// Cold effects
|
||||
if (modPlayer.deathModeBlizzardTime > 1800)
|
||||
player.AddBuff(BuffID.Frozen, 2, false);
|
||||
if (modPlayer.deathModeBlizzardTime > 1980)
|
||||
modPlayer.KillPlayer();
|
||||
|
||||
// Hot effects
|
||||
if (modPlayer.deathModeUnderworldTime > 360)
|
||||
player.AddBuff(BuffID.Weak, 2, false);
|
||||
if (modPlayer.deathModeUnderworldTime > 720)
|
||||
player.AddBuff(BuffID.Slow, 2, false);
|
||||
if (modPlayer.deathModeUnderworldTime > 1080)
|
||||
player.AddBuff(BuffID.OnFire, 2, false);
|
||||
if (modPlayer.deathModeUnderworldTime > 1440)
|
||||
player.AddBuff(BuffID.Confused, 2, false);
|
||||
if (modPlayer.deathModeUnderworldTime > 1800)
|
||||
player.AddBuff(BuffID.Burning, 2, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace CalamityMod.Items.Mounts
|
||||
mountData.flightTimeMax = 600;
|
||||
mountData.fatigueMax = 0;
|
||||
mountData.fallDamage = 0f;
|
||||
mountData.runSpeed = 12f;
|
||||
mountData.runSpeed = 10f;
|
||||
mountData.heightBoost = 44;
|
||||
mountData.acceleration = 0.2f;
|
||||
mountData.jumpHeight = 10;
|
||||
|
||||
@@ -12,8 +12,7 @@ namespace CalamityMod.Items.SummonItems
|
||||
{
|
||||
DisplayName.SetDefault("Abombination");
|
||||
Tooltip.SetDefault("Calls in the airborne jungle abomination\n" +
|
||||
"Summons the Plaguebringer Goliath\n" +
|
||||
"The boss enrages in the open air of the surface");
|
||||
"Summons the Plaguebringer Goliath");
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
|
||||
@@ -28,14 +28,11 @@ namespace CalamityMod.NPCs.AstrumAureus
|
||||
npc.width = 90;
|
||||
npc.height = 60;
|
||||
npc.alpha = 255;
|
||||
npc.defense = 0;
|
||||
CalamityGlobalNPC global = npc.Calamity();
|
||||
global.DR = 0.999999f;
|
||||
global.unbreakableDR = true;
|
||||
npc.lifeMax = 1008;
|
||||
npc.defense = 10;
|
||||
npc.lifeMax = 3000;
|
||||
if (BossRushEvent.BossRushActive)
|
||||
{
|
||||
npc.lifeMax = 1002;
|
||||
npc.lifeMax = 30000;
|
||||
}
|
||||
npc.knockBackResist = 0f;
|
||||
for (int k = 0; k < npc.buffImmune.Length; k++)
|
||||
@@ -49,22 +46,26 @@ namespace CalamityMod.NPCs.AstrumAureus
|
||||
npc.DeathSound = SoundID.NPCDeath1;
|
||||
}
|
||||
|
||||
public override void SendExtraAI(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(npc.dontTakeDamage);
|
||||
}
|
||||
public override void SendExtraAI(BinaryWriter writer)
|
||||
{
|
||||
writer.Write(npc.dontTakeDamage);
|
||||
}
|
||||
|
||||
public override void ReceiveExtraAI(BinaryReader reader)
|
||||
{
|
||||
npc.dontTakeDamage = reader.ReadBoolean();
|
||||
}
|
||||
public override void ReceiveExtraAI(BinaryReader reader)
|
||||
{
|
||||
npc.dontTakeDamage = reader.ReadBoolean();
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
public override void AI()
|
||||
{
|
||||
npc.damage = 0;
|
||||
|
||||
Lighting.AddLight((int)((npc.position.X + (float)(npc.width / 2)) / 16f), (int)((npc.position.Y + (float)(npc.height / 2)) / 16f), 0.6f, 0.25f, 0f);
|
||||
|
||||
npc.rotation = Math.Abs(npc.velocity.X) * (float)npc.direction * 0.04f;
|
||||
|
||||
npc.spriteDirection = npc.direction;
|
||||
|
||||
if (npc.alpha > 0)
|
||||
{
|
||||
npc.alpha -= 5;
|
||||
@@ -77,17 +78,28 @@ namespace CalamityMod.NPCs.AstrumAureus
|
||||
num = num245;
|
||||
}
|
||||
}
|
||||
|
||||
npc.TargetClosest(true);
|
||||
if (npc.life <= 1000 || Main.dayTime)
|
||||
|
||||
// Percent life remaining
|
||||
float lifeRatio = npc.life / (float)npc.lifeMax;
|
||||
|
||||
if (lifeRatio <= 0.5f || Main.dayTime)
|
||||
{
|
||||
npc.dontTakeDamage = true;
|
||||
npc.ai[1] += 1f;
|
||||
npc.dontTakeDamage = true;
|
||||
Vector2 vector = Main.player[npc.target].Center - npc.Center;
|
||||
Point point15 = npc.Center.ToTileCoordinates();
|
||||
Tile tileSafely = Framing.GetTileSafely(point15);
|
||||
bool flag121 = tileSafely.nactive() && Main.tileSolid[tileSafely.type] && !Main.tileSolidTop[tileSafely.type] && !TileID.Sets.Platforms[tileSafely.type];
|
||||
if (vector.Length() < 60f || flag121)
|
||||
if (npc.ai[1] > 300f)
|
||||
{
|
||||
npc.Calamity().newAI[0] += 1f;
|
||||
npc.scale = MathHelper.Lerp(1f, 2f, npc.Calamity().newAI[0] / 45f);
|
||||
}
|
||||
if (vector.Length() < 60f || flag121 || npc.Calamity().newAI[0] >= 45f)
|
||||
{
|
||||
npc.dontTakeDamage = false;
|
||||
npc.dontTakeDamage = false;
|
||||
CheckDead();
|
||||
npc.life = 0;
|
||||
return;
|
||||
@@ -104,17 +116,18 @@ namespace CalamityMod.NPCs.AstrumAureus
|
||||
npc.velocity.Y = (npc.velocity.Y * 50f + num1374) / 51f;
|
||||
return;
|
||||
}
|
||||
|
||||
float num1446 = BossRushEvent.BossRushActive ? 10f : 7f;
|
||||
int num1447 = 480;
|
||||
float num244;
|
||||
if (npc.localAI[1] == 1f)
|
||||
{
|
||||
npc.localAI[1] = 0f;
|
||||
if (Main.rand.NextBool(4))
|
||||
{
|
||||
npc.ai[0] = (float)num1447;
|
||||
npc.ai[0] = num1447;
|
||||
}
|
||||
}
|
||||
|
||||
Vector2 value53 = npc.Center + new Vector2((float)(npc.direction * 20), 6f);
|
||||
Vector2 vector251 = Main.player[npc.target].Center - value53;
|
||||
bool flag104 = Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1);
|
||||
@@ -133,6 +146,7 @@ namespace CalamityMod.NPCs.AstrumAureus
|
||||
{
|
||||
npc.velocity *= 0.98f;
|
||||
}
|
||||
|
||||
if (npc.ai[2] != 0f && npc.ai[3] != 0f)
|
||||
{
|
||||
Main.PlaySound(SoundID.Item8, npc.Center);
|
||||
@@ -161,11 +175,9 @@ namespace CalamityMod.NPCs.AstrumAureus
|
||||
num = num1451;
|
||||
}
|
||||
}
|
||||
float[] var_9_48E3C_cp_0 = npc.ai;
|
||||
int var_9_48E3C_cp_1 = 0;
|
||||
num244 = var_9_48E3C_cp_0[var_9_48E3C_cp_1];
|
||||
var_9_48E3C_cp_0[var_9_48E3C_cp_1] = num244 + 1f;
|
||||
if (npc.ai[0] >= (float)num1447 && Main.netMode != NetmodeID.MultiplayerClient)
|
||||
|
||||
npc.ai[0] += 1f;
|
||||
if (npc.ai[0] >= num1447 && Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
npc.ai[0] = 0f;
|
||||
Point point12 = npc.Center.ToTileCoordinates();
|
||||
@@ -301,10 +313,10 @@ namespace CalamityMod.NPCs.AstrumAureus
|
||||
npc.position.X = npc.position.X + (float)(npc.width / 2);
|
||||
npc.position.Y = npc.position.Y + (float)(npc.height / 2);
|
||||
npc.damage = npc.defDamage;
|
||||
npc.width = npc.height = 216;
|
||||
npc.width = npc.height = 432;
|
||||
npc.position.X = npc.position.X - (float)(npc.width / 2);
|
||||
npc.position.Y = npc.position.Y - (float)(npc.height / 2);
|
||||
for (int num621 = 0; num621 < 15; num621++)
|
||||
for (int num621 = 0; num621 < 30; num621++)
|
||||
{
|
||||
int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, ModContent.DustType<AstralOrange>(), 0f, 0f, 100, default, 1f);
|
||||
Main.dust[num622].velocity *= 3f;
|
||||
@@ -315,7 +327,7 @@ namespace CalamityMod.NPCs.AstrumAureus
|
||||
}
|
||||
Main.dust[num622].noGravity = true;
|
||||
}
|
||||
for (int num623 = 0; num623 < 30; num623++)
|
||||
for (int num623 = 0; num623 < 60; num623++)
|
||||
{
|
||||
int num624 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, 173, 0f, 0f, 100, default, 2f);
|
||||
Main.dust[num624].noGravity = true;
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental
|
||||
npc.height = 60;
|
||||
npc.defense = 0;
|
||||
npc.DR_NERD(normalDR);
|
||||
npc.lifeMax = 4000;
|
||||
npc.lifeMax = 2000;
|
||||
npc.knockBackResist = 0f;
|
||||
for (int k = 0; k < npc.buffImmune.Length; k++)
|
||||
{
|
||||
@@ -133,7 +133,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental
|
||||
Vector2 vector251 = Main.player[npc.target].Center - value53;
|
||||
bool flag104 = Collision.CanHit(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1);
|
||||
npc.localAI[0] += 1f;
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= 300f && Main.npc[CalamityGlobalNPC.brimstoneElemental].ai[0] != 4f)
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= 360f && Main.npc[CalamityGlobalNPC.brimstoneElemental].ai[0] != 4f)
|
||||
{
|
||||
npc.localAI[0] = 0f;
|
||||
if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height))
|
||||
|
||||
+163
-49
@@ -72,6 +72,17 @@ namespace CalamityMod.NPCs
|
||||
|
||||
Player player = Main.player[npc.target];
|
||||
|
||||
bool notOcean = player.position.Y < 400f ||
|
||||
player.position.Y > Main.worldSurface * 16.0 ||
|
||||
(player.position.X > 7680f && player.position.X < (Main.maxTilesX * 16 - 7680));
|
||||
|
||||
float enrageScale = 0f;
|
||||
if (!player.Calamity().ZoneSulphur && notOcean)
|
||||
enrageScale += 2f;
|
||||
|
||||
if (BossRushEvent.BossRushActive)
|
||||
enrageScale = 0f;
|
||||
|
||||
Vector2 vectorCenter = npc.Center;
|
||||
|
||||
// Circular movement
|
||||
@@ -137,7 +148,7 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
npc.TargetClosest(true);
|
||||
calamityGlobalNPC.newAI[3] = 0f;
|
||||
float chargeVelocity = BossRushEvent.BossRushActive ? 24f : death ? 16f : 12f;
|
||||
float chargeVelocity = (BossRushEvent.BossRushActive ? 24f : death ? 16f : 12f) + 3f * enrageScale;
|
||||
npc.velocity = Vector2.Normalize(player.Center - npc.Center) * chargeVelocity;
|
||||
}
|
||||
}
|
||||
@@ -317,12 +328,7 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
}
|
||||
|
||||
// Despawn
|
||||
bool notOcean = player.position.Y < 400f ||
|
||||
player.position.Y > Main.worldSurface * 16.0 ||
|
||||
(player.position.X > 7680f && player.position.X < (Main.maxTilesX * 16 - 7680));
|
||||
|
||||
if (player.dead || (notOcean && !BossRushEvent.BossRushActive && !player.Calamity().ZoneSulphur))
|
||||
if (player.dead)
|
||||
{
|
||||
calamityGlobalNPC.newAI[1] = 1f;
|
||||
npc.TargetClosest(false);
|
||||
@@ -384,23 +390,20 @@ namespace CalamityMod.NPCs
|
||||
|
||||
if (calamityGlobalNPC.newAI[0] == 1f)
|
||||
{
|
||||
num188 = revenge ? 13f : 11f;
|
||||
num189 = revenge ? 0.14f : 0.12f;
|
||||
num188 = revenge ? 9f : 7f;
|
||||
num189 = revenge ? 0.12f : 0.1f;
|
||||
if (expertMode)
|
||||
{
|
||||
num188 += 4f * (1f - lifeRatio);
|
||||
num189 += 0.04f * (1f - lifeRatio);
|
||||
}
|
||||
if (notOcean)
|
||||
{
|
||||
num188 += 2f;
|
||||
num189 += 0.02f;
|
||||
num188 += 8f * (1f - lifeRatio);
|
||||
num189 += 0.06f * (1f - lifeRatio);
|
||||
}
|
||||
if (player.gravDir == -1f && expertMode)
|
||||
{
|
||||
num188 = 21f;
|
||||
num189 = 0.21f;
|
||||
}
|
||||
num188 += 3f * enrageScale;
|
||||
num189 += 0.06f * enrageScale;
|
||||
if (BossRushEvent.BossRushActive)
|
||||
{
|
||||
num188 = 25f;
|
||||
@@ -619,10 +622,18 @@ namespace CalamityMod.NPCs
|
||||
bool expertMode = Main.expertMode || BossRushEvent.BossRushActive;
|
||||
bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive;
|
||||
bool death = CalamityWorld.death || BossRushEvent.BossRushActive;
|
||||
bool calamity = modPlayer.ZoneCalamity;
|
||||
bool phase2 = lifeRatio < 0.5f && revenge;
|
||||
bool phase3 = lifeRatio < 0.33f;
|
||||
|
||||
float enrageScale = 0f;
|
||||
if (!player.ZoneUnderworldHeight)
|
||||
enrageScale += 1f;
|
||||
if (!modPlayer.ZoneCalamity)
|
||||
enrageScale += 1f;
|
||||
|
||||
if (BossRushEvent.BossRushActive)
|
||||
enrageScale = 0f;
|
||||
|
||||
// Emit dust
|
||||
int dustAmt = (npc.ai[0] == 2f) ? 2 : 1;
|
||||
int size = (npc.ai[0] == 2f) ? 50 : 35;
|
||||
@@ -641,9 +652,10 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
|
||||
// Speed while moving in phase 1
|
||||
float speed = BossRushEvent.BossRushActive ? 12f : !calamity ? 8f : death ? 6f : revenge ? 5.5f : expertMode ? 5f : 4.5f;
|
||||
float speed = BossRushEvent.BossRushActive ? 12f : death ? 6f : revenge ? 5.5f : expertMode ? 5f : 4.5f;
|
||||
if (expertMode)
|
||||
speed += death ? 3f * (1f - lifeRatio) : 2f * (1f - lifeRatio);
|
||||
speed += 3f * enrageScale;
|
||||
|
||||
// Variables for target location relative to npc location
|
||||
float xDistance = player.Center.X - vectorCenter.X;
|
||||
@@ -794,7 +806,8 @@ namespace CalamityMod.NPCs
|
||||
npc.spriteDirection = npc.direction;
|
||||
|
||||
npc.ai[1] += 1f;
|
||||
float divisor = expertMode ? (death ? 30f : revenge ? 35f : 40f) - (float)Math.Ceiling(10f * (1f - lifeRatio)) : 45f;
|
||||
float divisor = expertMode ? (death ? 40f : revenge ? 45f : 50f) - (float)Math.Ceiling(10f * (1f - lifeRatio)) : 50f;
|
||||
divisor -= 5f * enrageScale;
|
||||
float divisor2 = divisor * 2f;
|
||||
|
||||
if (npc.ai[1] % divisor == divisor - 1f)
|
||||
@@ -802,6 +815,7 @@ namespace CalamityMod.NPCs
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
float num742 = BossRushEvent.BossRushActive ? 8f : death ? 5f : 4f;
|
||||
num742 += 2f * enrageScale;
|
||||
float num743 = player.position.X + player.width * 0.5f - vectorCenter.X;
|
||||
float num744 = player.position.Y + player.height * 0.5f - vectorCenter.Y;
|
||||
float num745 = (float)Math.Sqrt(num743 * num743 + num744 * num744);
|
||||
@@ -822,7 +836,7 @@ namespace CalamityMod.NPCs
|
||||
double deltaAngle = rotation / numProj;
|
||||
double offsetAngle;
|
||||
|
||||
if (npc.ai[1] % divisor2 == divisor2 - 1f || !calamity)
|
||||
if (npc.ai[1] % divisor2 == divisor2 - 1f)
|
||||
{
|
||||
for (int i = 0; i < numProj; i++)
|
||||
{
|
||||
@@ -836,8 +850,7 @@ namespace CalamityMod.NPCs
|
||||
projectileSpeed += 4f;
|
||||
if (revenge)
|
||||
projectileSpeed += 1f;
|
||||
if (!calamity)
|
||||
projectileSpeed += 2f;
|
||||
projectileSpeed += 2f * enrageScale;
|
||||
|
||||
if (expertMode)
|
||||
projectileSpeed += 3f * (1f - lifeRatio);
|
||||
@@ -860,6 +873,8 @@ namespace CalamityMod.NPCs
|
||||
|
||||
float maxVelocityY = death ? 2.5f : 3f;
|
||||
float maxVelocityX = death ? 7f : 8f;
|
||||
maxVelocityY -= 0.5f * enrageScale;
|
||||
maxVelocityX -= 1.5f * enrageScale;
|
||||
|
||||
if (npc.position.Y > player.position.Y - 150f)
|
||||
{
|
||||
@@ -923,18 +938,17 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
npc.localAI[0] += 1f;
|
||||
if (expertMode)
|
||||
npc.localAI[0] += death ? 1.5f * (1f - lifeRatio) : 1f - lifeRatio;
|
||||
|
||||
npc.localAI[0] += 1f - lifeRatio;
|
||||
if (calamityGlobalNPC.enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && BossRushEvent.BossRushActive))
|
||||
npc.localAI[0] += 2f;
|
||||
if (!calamity)
|
||||
npc.localAI[0] += 2f;
|
||||
npc.localAI[0] += 1f * enrageScale;
|
||||
|
||||
if (npc.localAI[0] >= 120f)
|
||||
{
|
||||
npc.localAI[0] = 0f;
|
||||
|
||||
float projectileSpeed = BossRushEvent.BossRushActive ? 12f : death ? 9f : revenge ? 8f : 6f;
|
||||
projectileSpeed += 3f * enrageScale;
|
||||
|
||||
vectorCenter = player.Center - vectorCenter;
|
||||
|
||||
@@ -1134,7 +1148,6 @@ namespace CalamityMod.NPCs
|
||||
bool death = CalamityWorld.death || BossRushEvent.BossRushActive;
|
||||
bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive;
|
||||
bool expertMode = Main.expertMode || BossRushEvent.BossRushActive;
|
||||
bool dayTime = Main.dayTime && !BossRushEvent.BossRushActive;
|
||||
bool provy = CalamityWorld.downedProvidence && !BossRushEvent.BossRushActive;
|
||||
|
||||
// Variable for live brothers
|
||||
@@ -1239,6 +1252,13 @@ namespace CalamityMod.NPCs
|
||||
// Target variable
|
||||
Player player = Main.player[npc.target];
|
||||
|
||||
float enrageScale = 0f;
|
||||
if (Main.dayTime)
|
||||
enrageScale += 2f;
|
||||
|
||||
if (BossRushEvent.BossRushActive)
|
||||
enrageScale = 0f;
|
||||
|
||||
// Rotation
|
||||
float num801 = npc.position.X + (npc.width / 2) - player.position.X - (player.width / 2);
|
||||
float num802 = npc.position.Y + npc.height - 59f - player.position.Y - (player.height / 2);
|
||||
@@ -1274,11 +1294,11 @@ namespace CalamityMod.NPCs
|
||||
npc.rotation = num803;
|
||||
|
||||
// Despawn
|
||||
if (!player.active || player.dead || (dayTime && !Main.eclipse))
|
||||
if (!player.active || player.dead)
|
||||
{
|
||||
npc.TargetClosest(false);
|
||||
player = Main.player[npc.target];
|
||||
if (!player.active || player.dead || (dayTime && !Main.eclipse))
|
||||
if (!player.active || player.dead)
|
||||
{
|
||||
if (npc.velocity.Y > 3f)
|
||||
npc.velocity.Y = 3f;
|
||||
@@ -1306,11 +1326,15 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
float num823 = expertMode ? 9.5f : 8f;
|
||||
float num824 = expertMode ? 0.175f : 0.15f;
|
||||
num823 += 2f * enrageScale;
|
||||
num824 += 0.05f * enrageScale;
|
||||
|
||||
if (phase2)
|
||||
{
|
||||
num823 = expertMode ? 10f : 8.5f;
|
||||
num824 = expertMode ? 0.18f : 0.155f;
|
||||
}
|
||||
|
||||
if (death)
|
||||
{
|
||||
num823 += 2f * (1f - lifeRatio);
|
||||
@@ -1329,6 +1353,7 @@ namespace CalamityMod.NPCs
|
||||
num823 *= 1.25f;
|
||||
num824 *= 1.25f;
|
||||
}
|
||||
|
||||
if (BossRushEvent.BossRushActive)
|
||||
{
|
||||
num823 *= 1.5f;
|
||||
@@ -1398,6 +1423,7 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
npc.localAI[1] = 0f;
|
||||
float num828 = BossRushEvent.BossRushActive ? 18f : expertMode ? 14f : 12.5f;
|
||||
num828 += 3f * enrageScale;
|
||||
if (calamityGlobalNPC.enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && BossRushEvent.BossRushActive))
|
||||
num828 += 5f;
|
||||
|
||||
@@ -1427,6 +1453,7 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
npc.localAI[1] = 0f;
|
||||
float num828 = BossRushEvent.BossRushActive ? 16f : expertMode ? 12f : 10.5f;
|
||||
num828 += 2.5f * enrageScale;
|
||||
int type = ModContent.ProjectileType<BrimstoneLaser>();
|
||||
int damage = npc.GetProjectileDamage(type);
|
||||
num827 = (float)Math.Sqrt(num825 * num825 + num826 * num826);
|
||||
@@ -1450,11 +1477,15 @@ namespace CalamityMod.NPCs
|
||||
|
||||
float num832 = expertMode ? 9.5f : 8f;
|
||||
float num833 = expertMode ? 0.25f : 0.2f;
|
||||
num832 += 2f * enrageScale;
|
||||
num833 += 0.05f * enrageScale;
|
||||
|
||||
if (phase2)
|
||||
{
|
||||
num832 = expertMode ? 10f : 8.5f;
|
||||
num833 = expertMode ? 0.255f : 0.205f;
|
||||
}
|
||||
|
||||
if (death)
|
||||
{
|
||||
num832 += 2f * (1f - lifeRatio);
|
||||
@@ -1473,6 +1504,7 @@ namespace CalamityMod.NPCs
|
||||
num832 *= 1.25f;
|
||||
num833 *= 1.25f;
|
||||
}
|
||||
|
||||
if (BossRushEvent.BossRushActive)
|
||||
{
|
||||
num832 *= 1.5f;
|
||||
@@ -1534,6 +1566,7 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
npc.localAI[1] = 0f;
|
||||
float num837 = BossRushEvent.BossRushActive ? 16f : expertMode ? 12.5f : 11f;
|
||||
num837 += 2.5f * enrageScale;
|
||||
int type = brotherAlive ? ModContent.ProjectileType<BrimstoneHellfireball>() : ModContent.ProjectileType<BrimstoneLaser>();
|
||||
int damage = npc.GetProjectileDamage(type);
|
||||
num836 = (float)Math.Sqrt(num834 * num834 + num835 * num835);
|
||||
@@ -1562,6 +1595,7 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
npc.localAI[1] = 0f;
|
||||
float num837 = BossRushEvent.BossRushActive ? 16f : expertMode ? 12f : 10.5f;
|
||||
num837 += 2.5f * enrageScale;
|
||||
int type = ModContent.ProjectileType<BrimstoneLaser>();
|
||||
int damage = (int)Math.Round(npc.GetProjectileDamage(type) * 0.75);
|
||||
num836 = (float)Math.Sqrt(num834 * num834 + num835 * num835);
|
||||
@@ -1590,6 +1624,7 @@ namespace CalamityMod.NPCs
|
||||
npc.rotation = num803;
|
||||
|
||||
float chargeVelocity = BossRushEvent.BossRushActive ? 40f : (25f + (death ? 4f * (1f - lifeRatio) : 0f));
|
||||
chargeVelocity += 5f * enrageScale;
|
||||
|
||||
if (provy)
|
||||
chargeVelocity *= 1.25f;
|
||||
@@ -1718,7 +1753,6 @@ namespace CalamityMod.NPCs
|
||||
bool death = CalamityWorld.death || BossRushEvent.BossRushActive;
|
||||
bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive;
|
||||
bool expertMode = Main.expertMode || BossRushEvent.BossRushActive;
|
||||
bool dayTime = Main.dayTime && !BossRushEvent.BossRushActive;
|
||||
bool provy = CalamityWorld.downedProvidence && !BossRushEvent.BossRushActive;
|
||||
|
||||
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active)
|
||||
@@ -1726,6 +1760,13 @@ namespace CalamityMod.NPCs
|
||||
|
||||
Player player = Main.player[npc.target];
|
||||
|
||||
float enrageScale = 0f;
|
||||
if (Main.dayTime)
|
||||
enrageScale += 2f;
|
||||
|
||||
if (BossRushEvent.BossRushActive)
|
||||
enrageScale = 0f;
|
||||
|
||||
float num840 = npc.position.X + (npc.width / 2) - player.position.X - (player.width / 2);
|
||||
float num841 = npc.position.Y + npc.height - 59f - player.position.Y - (player.height / 2);
|
||||
float num842 = (float)Math.Atan2(num841, num840) + MathHelper.PiOver2;
|
||||
@@ -1759,11 +1800,11 @@ namespace CalamityMod.NPCs
|
||||
if (npc.rotation > num842 - num843 && npc.rotation < num842 + num843)
|
||||
npc.rotation = num842;
|
||||
|
||||
if (!player.active || player.dead || (dayTime && !Main.eclipse))
|
||||
if (!player.active || player.dead)
|
||||
{
|
||||
npc.TargetClosest(false);
|
||||
player = Main.player[npc.target];
|
||||
if (!player.active || player.dead || (dayTime && !Main.eclipse))
|
||||
if (!player.active || player.dead)
|
||||
{
|
||||
if (npc.velocity.Y > 3f)
|
||||
npc.velocity.Y = 3f;
|
||||
@@ -1793,11 +1834,15 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
float num861 = 5f;
|
||||
float num862 = 0.1f;
|
||||
num861 += enrageScale;
|
||||
num862 += 0.03f * enrageScale;
|
||||
|
||||
if (provy)
|
||||
{
|
||||
num861 *= 1.25f;
|
||||
num862 *= 1.25f;
|
||||
}
|
||||
|
||||
if (BossRushEvent.BossRushActive)
|
||||
{
|
||||
num861 *= 1.5f;
|
||||
@@ -1887,7 +1932,8 @@ namespace CalamityMod.NPCs
|
||||
if (npc.localAI[1] > 12f)
|
||||
{
|
||||
npc.localAI[1] = 0f;
|
||||
float num867 = BossRushEvent.BossRushActive ? 9f : 6f;
|
||||
float num867 = BossRushEvent.BossRushActive ? 9f : NPC.AnyNPCs(ModContent.NPCType<CalamitasRun2>()) ? 4f : 6f;
|
||||
num867 += enrageScale;
|
||||
int type = ModContent.ProjectileType<BrimstoneFire>();
|
||||
int damage = npc.GetProjectileDamage(type);
|
||||
vector86 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
@@ -1914,6 +1960,7 @@ namespace CalamityMod.NPCs
|
||||
npc.rotation = num842;
|
||||
|
||||
float num870 = 14f + (death ? 4f * (1f - lifeRatio) : 0f);
|
||||
num870 += 3f * enrageScale;
|
||||
if (expertMode)
|
||||
num870 += 2f;
|
||||
if (revenge)
|
||||
@@ -1992,7 +2039,6 @@ namespace CalamityMod.NPCs
|
||||
bool death = CalamityWorld.death || BossRushEvent.BossRushActive;
|
||||
bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive;
|
||||
bool expertMode = Main.expertMode || BossRushEvent.BossRushActive;
|
||||
bool dayTime = Main.dayTime && !BossRushEvent.BossRushActive;
|
||||
bool provy = CalamityWorld.downedProvidence && !BossRushEvent.BossRushActive;
|
||||
|
||||
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active)
|
||||
@@ -2000,6 +2046,13 @@ namespace CalamityMod.NPCs
|
||||
|
||||
Player player = Main.player[npc.target];
|
||||
|
||||
float enrageScale = 0f;
|
||||
if (Main.dayTime)
|
||||
enrageScale += 2f;
|
||||
|
||||
if (BossRushEvent.BossRushActive)
|
||||
enrageScale = 0f;
|
||||
|
||||
float num840 = npc.position.X + (npc.width / 2) - player.position.X - (player.width / 2);
|
||||
float num841 = npc.position.Y + npc.height - 59f - player.position.Y - (player.height / 2);
|
||||
float num842 = (float)Math.Atan2(num841, num840) + MathHelper.PiOver2;
|
||||
@@ -2033,11 +2086,11 @@ namespace CalamityMod.NPCs
|
||||
if (npc.rotation > num842 - num843 && npc.rotation < num842 + num843)
|
||||
npc.rotation = num842;
|
||||
|
||||
if (!player.active || player.dead || (dayTime && !Main.eclipse))
|
||||
if (!player.active || player.dead)
|
||||
{
|
||||
npc.TargetClosest(false);
|
||||
player = Main.player[npc.target];
|
||||
if (!player.active || player.dead || (dayTime && !Main.eclipse))
|
||||
if (!player.active || player.dead)
|
||||
{
|
||||
if (npc.velocity.Y > 3f)
|
||||
npc.velocity.Y = 3f;
|
||||
@@ -2067,11 +2120,15 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
float num861 = 4.5f;
|
||||
float num862 = 0.2f;
|
||||
num861 += enrageScale;
|
||||
num862 += 0.05f * enrageScale;
|
||||
|
||||
if (provy)
|
||||
{
|
||||
num861 *= 1.25f;
|
||||
num862 *= 1.25f;
|
||||
}
|
||||
|
||||
if (BossRushEvent.BossRushActive)
|
||||
{
|
||||
num861 *= 1.5f;
|
||||
@@ -2162,6 +2219,7 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
npc.localAI[1] = 0f;
|
||||
float num867 = BossRushEvent.BossRushActive ? 22f : death ? 14f : 12f;
|
||||
num867 += 3f * enrageScale;
|
||||
int type = ModContent.ProjectileType<BrimstoneBall>();
|
||||
int damage = npc.GetProjectileDamage(type);
|
||||
vector86 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
@@ -2187,7 +2245,8 @@ namespace CalamityMod.NPCs
|
||||
Main.PlaySound(15, (int)npc.position.X, (int)npc.position.Y, 0);
|
||||
npc.rotation = num842;
|
||||
|
||||
float num870 = 16f + (death ? 4f * (1f - lifeRatio) : 0f);
|
||||
float num870 = (NPC.AnyNPCs(ModContent.NPCType<CalamitasRun>()) ? 12f : 16f) + (death ? 4f * (1f - lifeRatio) : 0f);
|
||||
num870 += 4f * enrageScale;
|
||||
if (expertMode)
|
||||
num870 += 2f;
|
||||
if (revenge)
|
||||
@@ -2273,7 +2332,12 @@ namespace CalamityMod.NPCs
|
||||
if (expertMode)
|
||||
shootTimer += death ? (float)Math.Round(3f * (1f - lifeRatio)) : (float)Math.Round(2f * (1f - lifeRatio));
|
||||
|
||||
bool dayTime = Main.dayTime;
|
||||
float enrageScale = 0f;
|
||||
if (Main.dayTime)
|
||||
enrageScale += 2f;
|
||||
|
||||
if (BossRushEvent.BossRushActive)
|
||||
enrageScale = 0f;
|
||||
|
||||
// Get a target
|
||||
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active)
|
||||
@@ -2289,11 +2353,11 @@ namespace CalamityMod.NPCs
|
||||
bool phase3 = lifeRatio < 0.5f;
|
||||
|
||||
// Despawn
|
||||
if (!player.active || player.dead || dayTime || Vector2.Distance(player.Center, npc.Center) > 5600f)
|
||||
if (!player.active || player.dead || Vector2.Distance(player.Center, npc.Center) > 5600f)
|
||||
{
|
||||
npc.TargetClosest(false);
|
||||
player = Main.player[npc.target];
|
||||
if (!player.active || player.dead || dayTime || Vector2.Distance(player.Center, npc.Center) > 5600f)
|
||||
if (!player.active || player.dead || Vector2.Distance(player.Center, npc.Center) > 5600f)
|
||||
{
|
||||
npc.noTileCollide = true;
|
||||
|
||||
@@ -2325,11 +2389,11 @@ namespace CalamityMod.NPCs
|
||||
Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 1.3f, 0.5f, 0f);
|
||||
|
||||
// Fire projectiles while walking, teleporting, or falling
|
||||
if (npc.ai[0] == 2f || npc.ai[0] >= 5f || (npc.ai[0] == 4f && npc.velocity.Y > 0f) || calamityGlobalNPC.enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && BossRushEvent.BossRushActive))
|
||||
if (npc.ai[0] == 2f || npc.ai[0] >= 5f || calamityGlobalNPC.enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && BossRushEvent.BossRushActive))
|
||||
{
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
npc.localAI[0] += (npc.ai[0] == 2f || (npc.ai[0] == 4f && npc.velocity.Y > 0f && expertMode)) ? 4f : shootTimer;
|
||||
npc.localAI[0] += npc.ai[0] == 2f ? 4f : shootTimer;
|
||||
if (npc.localAI[0] >= 180f)
|
||||
{
|
||||
npc.localAI[0] = 0f;
|
||||
@@ -2353,8 +2417,8 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
}
|
||||
|
||||
// Fire astral lasers while falling or walking
|
||||
else if ((npc.ai[0] == 4f && npc.velocity.Y > 0f && expertMode) || npc.ai[0] == 2f)
|
||||
// Fire astral lasers while walking
|
||||
else if (npc.ai[0] == 2f)
|
||||
{
|
||||
float num179 = BossRushEvent.BossRushActive ? 24f : death ? 20f : 18.5f;
|
||||
int maxProjectiles = death ? 6 : 4;
|
||||
@@ -2441,6 +2505,7 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
// Set walking speed
|
||||
float num823 = BossRushEvent.BossRushActive ? 12f : 6f;
|
||||
num823 += 2f * enrageScale;
|
||||
if (expertMode)
|
||||
num823 += death ? 3f * (1f - lifeRatio) : 2f * (1f - lifeRatio);
|
||||
if (revenge)
|
||||
@@ -2536,6 +2601,7 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
// Set jump velocity, reset and set AI to next phase (Stomp)
|
||||
float velocityX = BossRushEvent.BossRushActive ? 12f : 9f;
|
||||
velocityX += 3f * enrageScale;
|
||||
if (expertMode)
|
||||
velocityX += death ? 4.5f * (1f - lifeRatio) : 3f * (1f - lifeRatio);
|
||||
|
||||
@@ -2548,8 +2614,8 @@ namespace CalamityMod.NPCs
|
||||
if (distanceBelowTarget > 0f)
|
||||
calamityGlobalNPC.newAI[0] = 1f + distanceBelowTarget * 0.001f;
|
||||
|
||||
if (calamityGlobalNPC.newAI[0] > 2f)
|
||||
calamityGlobalNPC.newAI[0] = 2f;
|
||||
if (calamityGlobalNPC.newAI[0] > 1.5f)
|
||||
calamityGlobalNPC.newAI[0] = 1.5f;
|
||||
}
|
||||
|
||||
if (expertMode)
|
||||
@@ -2606,6 +2672,41 @@ namespace CalamityMod.NPCs
|
||||
Main.dust[num624].velocity *= 0.2f;
|
||||
}
|
||||
}
|
||||
|
||||
// Fire lasers on stomp
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
float num179 = BossRushEvent.BossRushActive ? 24f : death ? 20f : 18.5f;
|
||||
int maxProjectiles = death ? 6 : 4;
|
||||
int spread = death ? 60 : 45;
|
||||
Vector2 value9 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
float num180 = player.position.X + player.width * 0.5f - value9.X;
|
||||
float num181 = Math.Abs(num180) * 0.1f;
|
||||
float num182 = player.position.Y + player.height * 0.5f - value9.Y - num181;
|
||||
float num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182);
|
||||
npc.netUpdate = true;
|
||||
num183 = num179 / num183;
|
||||
num180 *= num183;
|
||||
num182 *= num183;
|
||||
int type = ModContent.ProjectileType<AstralLaser>();
|
||||
int damage = npc.GetProjectileDamage(type);
|
||||
if (NPC.downedMoonlord && revenge && !BossRushEvent.BossRushActive)
|
||||
damage *= 3;
|
||||
value9.X += num180;
|
||||
value9.Y += num182;
|
||||
for (int i = 0; i < maxProjectiles; i++)
|
||||
{
|
||||
num180 = player.position.X + player.width * 0.5f - value9.X;
|
||||
num182 = player.position.Y + player.height * 0.5f - value9.Y;
|
||||
num183 = (float)Math.Sqrt(num180 * num180 + num182 * num182);
|
||||
num183 = num179 / num183;
|
||||
num180 += Main.rand.Next(-spread, spread + 1);
|
||||
num182 += Main.rand.Next(-spread, spread + 1);
|
||||
num180 *= num183;
|
||||
num182 *= num183;
|
||||
Projectile.NewProjectile(value9.X, value9.Y, num180, num182, type, damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2626,6 +2727,7 @@ namespace CalamityMod.NPCs
|
||||
if (npc.Bottom.Y < player.position.Y)
|
||||
{
|
||||
float fallSpeed = 1.2f;
|
||||
fallSpeed += 0.4f * enrageScale;
|
||||
if (expertMode)
|
||||
fallSpeed += death ? 0.6f * (1f - lifeRatio) : 0.4f * (1f - lifeRatio);
|
||||
|
||||
@@ -2637,7 +2739,8 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
else
|
||||
{
|
||||
float velocityXChange = 0.02f + Math.Abs(npc.Center.X - player.Center.X) * 0.0005f;
|
||||
float velocityXChange = 0.2f + Math.Abs(npc.Center.X - player.Center.X) * 0.0001f;
|
||||
velocityXChange += 0.05f * enrageScale;
|
||||
|
||||
if (npc.direction < 0)
|
||||
npc.velocity.X -= velocityXChange;
|
||||
@@ -2645,6 +2748,7 @@ namespace CalamityMod.NPCs
|
||||
npc.velocity.X += velocityXChange;
|
||||
|
||||
float num626 = BossRushEvent.BossRushActive ? 18f : 12f;
|
||||
num626 += 4f * enrageScale;
|
||||
if (expertMode)
|
||||
num626 += death ? 4.5f * (1f - lifeRatio) : 3f * (1f - lifeRatio);
|
||||
|
||||
@@ -2832,6 +2936,13 @@ namespace CalamityMod.NPCs
|
||||
bool death = CalamityWorld.death || BossRushEvent.BossRushActive;
|
||||
bool enraged = calamityGlobalNPC.enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && BossRushEvent.BossRushActive);
|
||||
|
||||
float enrageScale = 0f;
|
||||
if (Main.dayTime)
|
||||
enrageScale += 2f;
|
||||
|
||||
if (BossRushEvent.BossRushActive)
|
||||
enrageScale = 0f;
|
||||
|
||||
// Deus cannot hit for 3 seconds
|
||||
if (calamityGlobalNPC.newAI[1] < 180f || npc.dontTakeDamage)
|
||||
npc.damage = 0;
|
||||
@@ -3177,7 +3288,7 @@ namespace CalamityMod.NPCs
|
||||
|
||||
// Despawn
|
||||
float fallSpeed = death ? 17.5f : 16f;
|
||||
if (player.dead || Main.dayTime)
|
||||
if (player.dead || Vector2.Distance(player.Center, npc.Center) > 8000f)
|
||||
{
|
||||
flag2 = false;
|
||||
float velocity = 2f;
|
||||
@@ -3188,7 +3299,7 @@ namespace CalamityMod.NPCs
|
||||
npc.velocity.Y -= velocity;
|
||||
}
|
||||
|
||||
if ((double)npc.position.Y < Main.topWorld + 16f)
|
||||
if ((double)npc.position.Y < Main.topWorld + 16f || Vector2.Distance(player.Center, npc.Center) > 8000f)
|
||||
{
|
||||
for (int num957 = 0; num957 < Main.maxNPCs; num957++)
|
||||
{
|
||||
@@ -3200,12 +3311,15 @@ namespace CalamityMod.NPCs
|
||||
|
||||
float fallSpeedBoost = 5f * (1f - lifeRatio);
|
||||
fallSpeed += fallSpeedBoost;
|
||||
fallSpeed += 4f * enrageScale;
|
||||
|
||||
// Speed and movement
|
||||
float speedBoost = death ? ((targetFloatingUp ? 0.2f : 0.1f) * (1f - lifeRatio)) : ((targetFloatingUp ? 0.26f : 0.13f) * (1f - lifeRatio));
|
||||
float turnSpeedBoost = death ? ((targetFloatingUp ? 0.36f : 0.18f) * (1f - lifeRatio)) : ((targetFloatingUp ? 0.4f : 0.2f) * (1f - lifeRatio));
|
||||
float speed = (death ? 0.18f : 0.13f) + speedBoost;
|
||||
float turnSpeed = (death ? 0.25f : 0.2f) + turnSpeedBoost;
|
||||
speed += 0.05f * enrageScale;
|
||||
turnSpeed += 0.08f * enrageScale;
|
||||
|
||||
if (flyAtTarget)
|
||||
{
|
||||
|
||||
+294
-175
File diff suppressed because it is too large.
Load diff
+37
-13
@@ -314,6 +314,19 @@ namespace CalamityMod.NPCs
|
||||
NPCID.EaterofWorldsTail
|
||||
};
|
||||
|
||||
public static List<int> DeathModeSplittingWormIDs = new List<int>
|
||||
{
|
||||
NPCID.DuneSplicerHead,
|
||||
NPCID.DuneSplicerBody,
|
||||
NPCID.DuneSplicerTail,
|
||||
NPCID.DiggerHead,
|
||||
NPCID.DiggerBody,
|
||||
NPCID.DiggerTail,
|
||||
NPCID.SeekerHead,
|
||||
NPCID.SeekerBody,
|
||||
NPCID.SeekerTail
|
||||
};
|
||||
|
||||
public static List<int> DestroyerIDs = new List<int>
|
||||
{
|
||||
NPCID.TheDestroyer,
|
||||
@@ -912,7 +925,7 @@ namespace CalamityMod.NPCs
|
||||
break;
|
||||
|
||||
case NPCID.SkeletronPrime:
|
||||
npc.lifeMax = (int)(npc.lifeMax * 1.9);
|
||||
npc.lifeMax = (int)(npc.lifeMax * 1.45);
|
||||
npc.npcSlots = 12f;
|
||||
break;
|
||||
|
||||
@@ -937,6 +950,11 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
npc.value = (int)(npc.value * 1.5);
|
||||
|
||||
if (DeathModeSplittingWormIDs.Contains(npc.type))
|
||||
{
|
||||
if (CalamityWorld.death)
|
||||
npc.lifeMax = (int)(npc.lifeMax * 0.5);
|
||||
}
|
||||
if (npc.type == NPCID.Mothron)
|
||||
{
|
||||
npc.scale = 1.25f;
|
||||
@@ -965,7 +983,7 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
else if (npc.type == NPCID.Golem)
|
||||
{
|
||||
npc.lifeMax = (int)(npc.lifeMax * 4.0);
|
||||
npc.lifeMax = (int)(npc.lifeMax * 3.5);
|
||||
npc.npcSlots = 64f;
|
||||
}
|
||||
else if (npc.type == NPCID.GolemHead)
|
||||
@@ -974,7 +992,7 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
else if (npc.type == NPCID.GolemHeadFree)
|
||||
{
|
||||
npc.lifeMax = (int)(npc.lifeMax * 1.25);
|
||||
npc.lifeMax = (int)(npc.lifeMax * 1.7);
|
||||
npc.dontTakeDamage = false;
|
||||
}
|
||||
else if (npc.type == NPCID.Plantera)
|
||||
@@ -995,7 +1013,7 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
npc.lifeMax = (int)(npc.lifeMax * 1.05);
|
||||
}
|
||||
else if (npc.type == NPCID.SkeletronHead) // 8800 in expert, 6600 in rev, 4400 in death
|
||||
else if (npc.type == NPCID.SkeletronHead)
|
||||
{
|
||||
if (CalamityWorld.death)
|
||||
npc.lifeMax = (int)(npc.lifeMax * 0.5);
|
||||
@@ -1004,10 +1022,10 @@ namespace CalamityMod.NPCs
|
||||
|
||||
npc.npcSlots = 12f;
|
||||
}
|
||||
else if (npc.type == NPCID.SkeletronHand) // 3120 in expert, 11232 in rev, 18720 in death
|
||||
else if (npc.type == NPCID.SkeletronHand)
|
||||
{
|
||||
if (CalamityWorld.death)
|
||||
npc.lifeMax = (int)(npc.lifeMax * 0.75);
|
||||
npc.lifeMax = (int)(npc.lifeMax * 0.65);
|
||||
else
|
||||
npc.lifeMax = (int)(npc.lifeMax * 0.9);
|
||||
}
|
||||
@@ -1065,7 +1083,7 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
else if (npc.type == NPCID.SkeletronPrime)
|
||||
{
|
||||
npc.lifeMax = (int)(npc.lifeMax * 1.45);
|
||||
npc.lifeMax = (int)(npc.lifeMax * 1.2);
|
||||
npc.npcSlots = 12f;
|
||||
}
|
||||
else if (npc.type <= NPCID.PrimeLaser && npc.type >= NPCID.PrimeCannon)
|
||||
@@ -2288,7 +2306,7 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
case NPCID.FungiSpore:
|
||||
case NPCID.Spore:
|
||||
return CalamityGlobalAI.BuffedSporeAI(npc, mod, true);
|
||||
return CalamityGlobalAI.BuffedSporeAI(npc, mod);
|
||||
}
|
||||
break;
|
||||
case 73:
|
||||
@@ -2341,7 +2359,7 @@ namespace CalamityMod.NPCs
|
||||
else if (Main.expertMode)
|
||||
{
|
||||
if (npc.type == NPCID.FungiSpore || npc.type == NPCID.Spore)
|
||||
return CalamityGlobalAI.BuffedSporeAI(npc, mod, false);
|
||||
return CalamityGlobalAI.BuffedSporeAI(npc, mod);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -3680,7 +3698,16 @@ namespace CalamityMod.NPCs
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (spawnInfo.playerSafe)
|
||||
return;
|
||||
|
||||
if (!Main.hardMode && spawnInfo.player.ZoneUnderworldHeight)
|
||||
{
|
||||
if (!NPC.AnyNPCs(NPCID.VoodooDemon))
|
||||
pool[NPCID.VoodooDemon] = SpawnCondition.Underworld.Chance * 1.5f;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Drawing
|
||||
@@ -4320,9 +4347,6 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
switch (npc.type)
|
||||
{
|
||||
case NPCID.DevourerHead:
|
||||
case NPCID.DevourerBody:
|
||||
case NPCID.DevourerTail:
|
||||
case NPCID.DiggerHead:
|
||||
case NPCID.DiggerBody:
|
||||
case NPCID.DiggerTail:
|
||||
|
||||
@@ -59,22 +59,18 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
switch (npc.type)
|
||||
{
|
||||
case NPCID.DevourerHead:
|
||||
case NPCID.DevourerBody:
|
||||
case NPCID.DevourerTail:
|
||||
return SplittingWormLoot(npc, mod, 0);
|
||||
case NPCID.DiggerHead:
|
||||
case NPCID.DiggerBody:
|
||||
case NPCID.DiggerTail:
|
||||
return SplittingWormLoot(npc, mod, 1);
|
||||
return SplittingWormLoot(npc, mod, 0);
|
||||
case NPCID.SeekerHead:
|
||||
case NPCID.SeekerBody:
|
||||
case NPCID.SeekerTail:
|
||||
return SplittingWormLoot(npc, mod, 2);
|
||||
return SplittingWormLoot(npc, mod, 1);
|
||||
case NPCID.DuneSplicerHead:
|
||||
case NPCID.DuneSplicerBody:
|
||||
case NPCID.DuneSplicerTail:
|
||||
return SplittingWormLoot(npc, mod, 3);
|
||||
return SplittingWormLoot(npc, mod, 2);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -525,10 +521,9 @@ namespace CalamityMod.NPCs
|
||||
{
|
||||
switch (wormType)
|
||||
{
|
||||
case 0: return CheckSegments(NPCID.DevourerHead, NPCID.DevourerBody, NPCID.DevourerTail);
|
||||
case 1: return CheckSegments(NPCID.DiggerHead, NPCID.DiggerBody, NPCID.DiggerTail);
|
||||
case 2: return CheckSegments(NPCID.SeekerHead, NPCID.SeekerBody, NPCID.SeekerTail);
|
||||
case 3: return CheckSegments(NPCID.DuneSplicerHead, NPCID.DuneSplicerBody, NPCID.DuneSplicerTail);
|
||||
case 0: return CheckSegments(NPCID.DiggerHead, NPCID.DiggerBody, NPCID.DiggerTail);
|
||||
case 1: return CheckSegments(NPCID.SeekerHead, NPCID.SeekerBody, NPCID.SeekerTail);
|
||||
case 2: return CheckSegments(NPCID.DuneSplicerHead, NPCID.DuneSplicerBody, NPCID.DuneSplicerTail);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive;
|
||||
bool expertMode = Main.expertMode || BossRushEvent.BossRushActive;
|
||||
|
||||
npc.spriteDirection = npc.direction;
|
||||
npc.spriteDirection = npc.direction;
|
||||
|
||||
// Percent life remaining
|
||||
float lifeRatio = npc.life / (float)npc.lifeMax;
|
||||
@@ -128,6 +128,15 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
else if (npc.timeLeft < 1800)
|
||||
npc.timeLeft = 1800;
|
||||
|
||||
float enrageScale = 0f;
|
||||
if ((npc.position.Y / 16f) < Main.worldSurface)
|
||||
enrageScale += 1f;
|
||||
if (!player.ZoneGlowshroom)
|
||||
enrageScale += 1f;
|
||||
|
||||
if (BossRushEvent.BossRushActive)
|
||||
enrageScale = 0f;
|
||||
|
||||
if (npc.ai[0] != 0f && npc.ai[0] < 3f)
|
||||
{
|
||||
Vector2 vector34 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f);
|
||||
@@ -233,23 +242,23 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
}
|
||||
else if (npc.ai[0] == 2f)
|
||||
{
|
||||
float num823 = 1.25f;
|
||||
bool flag51 = false;
|
||||
float num823 = 1f;
|
||||
if (phase2)
|
||||
num823 = 1.5f;
|
||||
num823 = 1.25f;
|
||||
if (phase3)
|
||||
num823 = 2f;
|
||||
num823 = 1.75f;
|
||||
if (death)
|
||||
num823 += 2f * (1f - lifeRatio);
|
||||
if (BossRushEvent.BossRushActive)
|
||||
num823 = 12f;
|
||||
if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && BossRushEvent.BossRushActive))
|
||||
num823 = 16f;
|
||||
num823 += 2f * enrageScale;
|
||||
|
||||
if (Math.Abs(npc.Center.X - player.Center.X) < 50f)
|
||||
{
|
||||
bool flag51 = false;
|
||||
if (Math.Abs(npc.Center.X - player.Center.X) < 50f)
|
||||
flag51 = true;
|
||||
}
|
||||
|
||||
if (flag51)
|
||||
{
|
||||
npc.velocity.X *= 0.9f;
|
||||
@@ -509,6 +518,7 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
(expertMode ? 0.02f : 0f) +
|
||||
(revenge ? 0.02f : 0f) +
|
||||
(death ? 0.02f : 0f);
|
||||
velocityX += 0.05f * enrageScale;
|
||||
|
||||
if (npc.direction < 0)
|
||||
npc.velocity.X -= velocityX;
|
||||
@@ -516,6 +526,7 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
npc.velocity.X += velocityX;
|
||||
|
||||
float num626 = BossRushEvent.BossRushActive ? 5f : 2.5f;
|
||||
num626 += enrageScale;
|
||||
if (revenge)
|
||||
{
|
||||
num626 += 1f;
|
||||
@@ -556,7 +567,7 @@ namespace CalamityMod.NPCs.Crabulon
|
||||
if ((npc.life + num660) < npc.localAI[0])
|
||||
{
|
||||
npc.localAI[0] = npc.life;
|
||||
int num661 = death ? 3 : expertMode ? Main.rand.Next(2, 4) : Main.rand.Next(1, 3);
|
||||
int num661 = death ? 3 : expertMode ? Main.rand.Next(2, 4) : 2;
|
||||
for (int num662 = 0; num662 < num661; num662++)
|
||||
{
|
||||
int x = (int)(npc.position.X + Main.rand.Next(npc.width - 32));
|
||||
|
||||
+34
-34
@@ -124,23 +124,29 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
|
||||
Player player = Main.player[npc.target];
|
||||
|
||||
bool isChill = player.ZoneSnow;
|
||||
bool expertMode = Main.expertMode || BossRushEvent.BossRushActive;
|
||||
bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive;
|
||||
bool death = CalamityWorld.death || BossRushEvent.BossRushActive;
|
||||
|
||||
float enrageScale = 0f;
|
||||
if (!player.ZoneSnow)
|
||||
enrageScale += 2f;
|
||||
|
||||
if (BossRushEvent.BossRushActive)
|
||||
enrageScale = 0f;
|
||||
|
||||
// Percent life remaining
|
||||
float lifeRatio = npc.life / (float)npc.lifeMax;
|
||||
|
||||
// Phases
|
||||
bool phase2 = lifeRatio < (death ? 0.95 : revenge ? 0.89 : 0.83);
|
||||
bool phase3 = lifeRatio < (death ? 0.8 : revenge ? 0.73 : 0.66);
|
||||
bool phase4 = lifeRatio < (death ? 0.7 : revenge ? 0.6 : 0.49);
|
||||
bool phase5 = lifeRatio < (death ? 0.55 : revenge ? 0.43 : 0.32);
|
||||
bool phase6 = lifeRatio < (death ? 0.4 : revenge ? 0.27 : 0.15);
|
||||
bool phase7 = lifeRatio < (death ? 0.25 : 0.15) && revenge;
|
||||
bool phase8 = lifeRatio < (revenge ? 0.225 : 0.1);
|
||||
bool phase9 = lifeRatio < (revenge ? 0.2 : 0.05) || death;
|
||||
bool phase2 = lifeRatio < 0.85f;
|
||||
bool phase3 = lifeRatio < 0.7f;
|
||||
bool phase4 = lifeRatio < 0.55f;
|
||||
bool phase5 = lifeRatio < 0.4f;
|
||||
bool phase6 = lifeRatio < (death ? 0.3f : revenge ? 0.25f : expertMode ? 0.2f : 0.15f);
|
||||
bool phase7 = lifeRatio < (death ? 0.15f : 0.1f) && revenge;
|
||||
bool phase8 = lifeRatio < (revenge ? 0.075f : 0.05f);
|
||||
bool phase9 = lifeRatio < (revenge ? 0.05f : 0.025f) || death;
|
||||
|
||||
if ((int)npc.ai[0] + 1 > currentPhase && currentPhase < 6)
|
||||
{
|
||||
@@ -260,11 +266,8 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
float num1243 = player.Center.X - vector142.X;
|
||||
float num1244 = player.Center.Y - vector142.Y;
|
||||
float num1245 = (float)Math.Sqrt(num1243 * num1243 + num1244 * num1244);
|
||||
float num1246 = isChill ? 4f : 8f;
|
||||
if (death)
|
||||
{
|
||||
num1246 = isChill ? 5f : 10f;
|
||||
}
|
||||
float num1246 = death ? 5f : 4f;
|
||||
num1246 += 2f * enrageScale;
|
||||
if (BossRushEvent.BossRushActive)
|
||||
{
|
||||
num1246 = 14f;
|
||||
@@ -307,10 +310,10 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
}
|
||||
}
|
||||
|
||||
float velocity = isChill ? 7.5f : 4f;
|
||||
float acceleration = isChill ? 0.1f : 0.15f;
|
||||
if (death)
|
||||
velocity = isChill ? 7f : 3.5f;
|
||||
float velocity = death ? 3.5f : 4f;
|
||||
float acceleration = 0.15f;
|
||||
velocity -= enrageScale;
|
||||
acceleration += 0.07f * enrageScale;
|
||||
if (BossRushEvent.BossRushActive)
|
||||
{
|
||||
velocity = 3f;
|
||||
@@ -430,12 +433,9 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
float num1243 = player.Center.X - vector142.X;
|
||||
float num1244 = player.Center.Y - vector142.Y;
|
||||
float num1245 = (float)Math.Sqrt(num1243 * num1243 + num1244 * num1244);
|
||||
float num1246 = isChill ? 6f : 12f;
|
||||
if (death)
|
||||
{
|
||||
num1246 = isChill ? 7f : 14f;
|
||||
}
|
||||
if (BossRushEvent.BossRushActive)
|
||||
float num1246 = death ? 7f : 6f;
|
||||
num1246 += 2f * enrageScale;
|
||||
if (BossRushEvent.BossRushActive)
|
||||
{
|
||||
num1246 = 20f;
|
||||
}
|
||||
@@ -495,10 +495,10 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
}
|
||||
}
|
||||
|
||||
float velocity = isChill ? 7.5f : 4f;
|
||||
float acceleration = isChill ? 0.1f : 0.15f;
|
||||
if (death)
|
||||
velocity = isChill ? 7f : 3.5f;
|
||||
float velocity = death ? 3.5f : 4f;
|
||||
float acceleration = 0.15f;
|
||||
velocity -= enrageScale;
|
||||
acceleration += 0.07f * enrageScale;
|
||||
if (BossRushEvent.BossRushActive)
|
||||
{
|
||||
velocity = 3f;
|
||||
@@ -741,7 +741,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
if (phase7)
|
||||
{
|
||||
if (npc.ai[1] == 60f)
|
||||
npc.velocity = Vector2.Normalize(player.Center - npc.Center) * (BossRushEvent.BossRushActive ? 30f : (isChill ? 18f : 24f));
|
||||
npc.velocity = Vector2.Normalize(player.Center - npc.Center) * (BossRushEvent.BossRushActive ? 30f : 18f + enrageScale * 2f);
|
||||
|
||||
npc.ai[1] -= 1f;
|
||||
if (npc.ai[1] <= 0f)
|
||||
@@ -773,7 +773,7 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
return;
|
||||
}
|
||||
|
||||
float num1372 = isChill ? 16f : 24f;
|
||||
float num1372 = 16f + enrageScale * 2f;
|
||||
if (BossRushEvent.BossRushActive)
|
||||
{
|
||||
num1372 = 32f;
|
||||
@@ -868,10 +868,10 @@ namespace CalamityMod.NPCs.Cryogen
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
|
||||
float velocity = isChill ? 6f : 3f;
|
||||
float acceleration = isChill ? 0.2f : 0.3f;
|
||||
if (death)
|
||||
velocity = isChill ? 5f : 2.5f;
|
||||
float velocity = death ? 5f : 6f;
|
||||
float acceleration = 0.2f;
|
||||
velocity -= enrageScale;
|
||||
acceleration += 0.07f * enrageScale;
|
||||
if (BossRushEvent.BossRushActive)
|
||||
{
|
||||
velocity = 2f;
|
||||
|
||||
@@ -91,6 +91,18 @@ namespace CalamityMod.NPCs.DesertScourge
|
||||
bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive;
|
||||
bool death = CalamityWorld.death || BossRushEvent.BossRushActive;
|
||||
|
||||
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active)
|
||||
npc.TargetClosest(true);
|
||||
|
||||
Player player = Main.player[npc.target];
|
||||
|
||||
float enrageScale = 0f;
|
||||
if (!player.ZoneDesert)
|
||||
enrageScale += 2f;
|
||||
|
||||
if (BossRushEvent.BossRushActive)
|
||||
enrageScale = 0f;
|
||||
|
||||
// Percent life remaining
|
||||
float lifeRatio = npc.life / (float)npc.lifeMax;
|
||||
|
||||
@@ -108,8 +120,10 @@ namespace CalamityMod.NPCs.DesertScourge
|
||||
|
||||
if (expertMode)
|
||||
{
|
||||
speed += death ? 9f * (1f - lifeRatio) : 6f * (1f - lifeRatio);
|
||||
turnSpeed += death ? 0.09f * (1f - lifeRatio) : 0.06f * (1f - lifeRatio);
|
||||
float velocityScale = (death ? 9f : 6f) * enrageScale;
|
||||
speed += velocityScale * (1f - lifeRatio);
|
||||
float accelerationScale = (death ? 0.09f : 0.06f) * enrageScale;
|
||||
turnSpeed += accelerationScale * (1f - lifeRatio);
|
||||
}
|
||||
|
||||
if (lungeUpward)
|
||||
@@ -133,11 +147,6 @@ namespace CalamityMod.NPCs.DesertScourge
|
||||
if (npc.ai[3] > 0f)
|
||||
npc.realLife = (int)npc.ai[3];
|
||||
|
||||
if (npc.target < 0 || npc.target == 255 || Main.player[npc.target].dead || !Main.player[npc.target].active)
|
||||
npc.TargetClosest(true);
|
||||
|
||||
Player player = Main.player[npc.target];
|
||||
|
||||
npc.dontTakeDamage = !player.ZoneDesert && !BossRushEvent.BossRushActive;
|
||||
|
||||
npc.alpha -= 42;
|
||||
@@ -211,6 +220,8 @@ namespace CalamityMod.NPCs.DesertScourge
|
||||
{
|
||||
Rectangle rectangle12 = new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height);
|
||||
int num954 = (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && BossRushEvent.BossRushActive)) ? 500 : 1000;
|
||||
if (enrageScale > 0f)
|
||||
num954 = 200;
|
||||
if (BossRushEvent.BossRushActive)
|
||||
num954 /= 2;
|
||||
|
||||
|
||||
@@ -107,12 +107,22 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
|
||||
npc.noGravity = false;
|
||||
npc.noTileCollide = false;
|
||||
|
||||
bool expertMode = Main.expertMode || BossRushEvent.BossRushActive;
|
||||
bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive;
|
||||
bool death = CalamityWorld.death || BossRushEvent.BossRushActive;
|
||||
CalamityGlobalNPC.hiveMind = npc.whoAmI;
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
float enrageScale = 0f;
|
||||
if ((npc.position.Y / 16f) < Main.worldSurface)
|
||||
enrageScale += 1f;
|
||||
if (!player.ZoneCorrupt)
|
||||
enrageScale += 1f;
|
||||
|
||||
if (BossRushEvent.BossRushActive)
|
||||
enrageScale = 0f;
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
if (npc.localAI[0] == 0f)
|
||||
{
|
||||
@@ -182,7 +192,7 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
burrowTimer--;
|
||||
if (burrowTimer < -120)
|
||||
{
|
||||
burrowTimer = death ? 180 : revenge ? 300 : expertMode ? 360 : 420;
|
||||
burrowTimer = (death ? 180 : revenge ? 300 : expertMode ? 360 : 420) - (int)enrageScale * 60;
|
||||
npc.scale = 1f;
|
||||
npc.alpha = 0;
|
||||
npc.dontTakeDamage = false;
|
||||
|
||||
+31
-33
@@ -40,12 +40,12 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
int minimumDriftTime = 300;
|
||||
int teleportRadius = 300;
|
||||
int decelerationTime = 30;
|
||||
int reelbackFade = 3; //divide 255 by this for duration of reelback in ticks
|
||||
int reelbackFade = 2; //divide 255 by this for duration of reelback in ticks
|
||||
float arcTime = 45f; //ticks needed to complete movement for spawn and rain attacks (DEATH ONLY)
|
||||
float driftSpeed = 2f; //default speed when slowly floating at player
|
||||
float driftSpeed = 1f; //default speed when slowly floating at player
|
||||
float driftBoost = 1f; //max speed added as health decreases
|
||||
int lungeDelay = 90; //# of ticks long hive mind spends sliding to a stop before lunging
|
||||
int lungeTime = 30;
|
||||
int lungeTime = 33;
|
||||
int lungeFade = 15; //divide 255 by this for duration of hive mind spin before slowing for lunge
|
||||
double lungeRots = 0.2; //number of revolutions made while spinning/fading in for lunge
|
||||
bool dashStarted = false;
|
||||
@@ -99,24 +99,24 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
if (Main.expertMode)
|
||||
{
|
||||
minimumDriftTime = 120;
|
||||
reelbackFade = 5;
|
||||
reelbackFade = 4;
|
||||
}
|
||||
if (CalamityWorld.revenge)
|
||||
{
|
||||
lungeRots = 0.3;
|
||||
minimumDriftTime = 90;
|
||||
reelbackFade = 6;
|
||||
lungeTime = 25;
|
||||
driftSpeed = 3f;
|
||||
reelbackFade = 5;
|
||||
lungeTime = 28;
|
||||
driftSpeed = 2f;
|
||||
driftBoost = 2f;
|
||||
}
|
||||
if (CalamityWorld.death)
|
||||
{
|
||||
lungeRots = 0.4;
|
||||
minimumDriftTime = 60;
|
||||
reelbackFade = 7;
|
||||
lungeTime = 20;
|
||||
driftSpeed = 4f;
|
||||
reelbackFade = 6;
|
||||
lungeTime = 23;
|
||||
driftSpeed = 3f;
|
||||
driftBoost = 1f;
|
||||
}
|
||||
if (BossRushEvent.BossRushActive)
|
||||
@@ -143,7 +143,6 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
writer.Write(reelCount);
|
||||
writer.Write(counter);
|
||||
writer.Write(initialised);
|
||||
writer.Write(npc.dontTakeDamage);
|
||||
}
|
||||
|
||||
public override void ReceiveExtraAI(BinaryReader reader)
|
||||
@@ -158,7 +157,6 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
reelCount = reader.ReadInt32();
|
||||
counter = reader.ReadInt32();
|
||||
initialised = reader.ReadBoolean();
|
||||
npc.dontTakeDamage = reader.ReadBoolean();
|
||||
}
|
||||
|
||||
public override void FindFrame(int frameHeight)
|
||||
@@ -252,19 +250,15 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
switch (choice)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
type = NPCID.EaterofSouls;
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
type = NPCID.DevourerHead;
|
||||
break;
|
||||
case 2:
|
||||
type = ModContent.NPCType<DankCreeper>();
|
||||
break;
|
||||
case 3:
|
||||
type = ModContent.NPCType<HiveBlob>();
|
||||
break;
|
||||
case 4:
|
||||
type = ModContent.NPCType<HiveBlob2>();
|
||||
type = ModContent.NPCType<DankCreeper>();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -312,21 +306,25 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
|
||||
Player player = Main.player[npc.target];
|
||||
|
||||
npc.dontTakeDamage = (player.ZoneCorrupt || BossRushEvent.BossRushActive) ? false : true;
|
||||
|
||||
CalamityGlobalNPC.hiveMind = npc.whoAmI;
|
||||
|
||||
if (npc.alpha != 0)
|
||||
float enrageScale = 0f;
|
||||
if ((npc.position.Y / 16f) < Main.worldSurface)
|
||||
enrageScale += 1f;
|
||||
if (!player.ZoneCorrupt)
|
||||
enrageScale += 1f;
|
||||
|
||||
if (BossRushEvent.BossRushActive)
|
||||
enrageScale = 0f;
|
||||
|
||||
if (npc.alpha != 0)
|
||||
{
|
||||
if (npc.damage != 0)
|
||||
{
|
||||
npc.damage = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.damage = npc.defDamage;
|
||||
}
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case 0: //slowdrift
|
||||
@@ -424,7 +422,7 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
phase2timer--;
|
||||
if (phase2timer <= -180) //no stalling drift mode forever
|
||||
{
|
||||
npc.velocity *= 2f / 255f * reelbackFade;
|
||||
npc.velocity *= 2f / 255f * (reelbackFade + 2 * (int)enrageScale);
|
||||
ReelBack();
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
@@ -433,16 +431,16 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
npc.velocity.Normalize();
|
||||
if (Main.expertMode || BossRushEvent.BossRushActive) //variable velocity in expert and up
|
||||
{
|
||||
npc.velocity *= driftSpeed + driftBoost * (npc.lifeMax - npc.life) / npc.lifeMax;
|
||||
npc.velocity *= driftSpeed + enrageScale + (driftBoost + enrageScale) * (npc.lifeMax - npc.life) / npc.lifeMax;
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.velocity *= driftSpeed;
|
||||
npc.velocity *= driftSpeed + enrageScale;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1: //reelback and teleport
|
||||
npc.alpha += reelbackFade;
|
||||
npc.alpha += reelbackFade + 2 * (int)enrageScale;
|
||||
npc.velocity -= deceleration;
|
||||
if (npc.alpha >= 255)
|
||||
{
|
||||
@@ -474,7 +472,7 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
}
|
||||
break;
|
||||
case 2: //reelback for lunge + death legacy
|
||||
npc.alpha += reelbackFade;
|
||||
npc.alpha += reelbackFade + 2 * (int)enrageScale;
|
||||
npc.velocity -= deceleration;
|
||||
if (npc.alpha >= 255)
|
||||
{
|
||||
@@ -518,10 +516,10 @@ namespace CalamityMod.NPCs.HiveMind
|
||||
{
|
||||
if (phase2timer <= 0)
|
||||
{
|
||||
phase2timer = lungeTime;
|
||||
phase2timer = lungeTime - 4 * (int)enrageScale;
|
||||
npc.velocity = player.Center - npc.Center;
|
||||
npc.velocity.Normalize();
|
||||
npc.velocity *= teleportRadius / lungeTime;
|
||||
npc.velocity *= teleportRadius / (lungeTime - 4 * (int)enrageScale);
|
||||
dashStarted = true;
|
||||
Main.PlaySound(SoundID.Roar, (int)npc.Center.X, (int)npc.Center.Y, 0);
|
||||
}
|
||||
|
||||
@@ -173,8 +173,16 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
|
||||
Player player = Main.player[npc.target];
|
||||
|
||||
bool flag6 = player.position.Y < 800f || player.position.Y > Main.worldSurface * 16.0 || (player.position.X > 6400f && player.position.X < (Main.maxTilesX * 16 - 6400));
|
||||
npc.dontTakeDamage = (flag6 && !BossRushEvent.BossRushActive) || spawnAnimation;
|
||||
bool notOcean = player.position.Y < 800f || player.position.Y > Main.worldSurface * 16.0 || (player.position.X > 6400f && player.position.X < (Main.maxTilesX * 16 - 6400));
|
||||
|
||||
float enrageScale = 0f;
|
||||
if (notOcean)
|
||||
enrageScale += 2f;
|
||||
|
||||
if (BossRushEvent.BossRushActive)
|
||||
enrageScale = 0f;
|
||||
|
||||
npc.dontTakeDamage = spawnAnimation;
|
||||
|
||||
if (!player.active || player.dead || Vector2.Distance(player.Center, vector) > 5600f)
|
||||
{
|
||||
@@ -236,13 +244,18 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
if (npc.ai[0] == 0f)
|
||||
{
|
||||
npc.TargetClosest(true);
|
||||
|
||||
float num412 = (sirenAlive && !phase4) ? 3.5f : 7f;
|
||||
float num413 = (sirenAlive && !phase4) ? 0.1f : 0.2f;
|
||||
num412 += 2f * enrageScale;
|
||||
num413 += 0.05f * enrageScale;
|
||||
|
||||
if (expertMode && (!sirenAlive || phase4))
|
||||
{
|
||||
num412 += death ? 6f * (1f - lifeRatio) : 3.5f * (1f - lifeRatio);
|
||||
num413 += death ? 0.15f * (1f - lifeRatio) : 0.1f * (1f - lifeRatio);
|
||||
}
|
||||
|
||||
if (BossRushEvent.BossRushActive)
|
||||
{
|
||||
num412 *= 1.5f;
|
||||
@@ -332,6 +345,8 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
if (expertMode)
|
||||
speed = (sirenAlive && !phase4 && !death) ? 14f : 17f;
|
||||
|
||||
speed += 4f * enrageScale;
|
||||
|
||||
if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && BossRushEvent.BossRushActive))
|
||||
speed = 22f;
|
||||
|
||||
@@ -388,7 +403,7 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
flag103 = true;
|
||||
}
|
||||
|
||||
int spawnLimit = (sirenAlive && !phase4) ? 2 : 4;
|
||||
int spawnLimit = (sirenAlive && !phase4) ? 1 : 3;
|
||||
bool spawnParasea = NPC.CountNPCS(ModContent.NPCType<Parasea>()) < spawnLimit;
|
||||
bool spawnAberration = (!sirenAlive || phase4) && !NPC.AnyNPCs(ModContent.NPCType<AquaticAberration>());
|
||||
|
||||
@@ -406,11 +421,15 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
{
|
||||
float num1063 = (sirenAlive && !phase4) ? 7f : 8f;
|
||||
float num1064 = (sirenAlive && !phase4) ? 0.05f : 0.065f;
|
||||
num1063 += 2f * enrageScale;
|
||||
num1064 += 0.02f * enrageScale;
|
||||
|
||||
if (expertMode && (!sirenAlive || phase4))
|
||||
{
|
||||
num1063 += death ? 7f * (1f - lifeRatio) : 4f * (1f - lifeRatio);
|
||||
num1064 += death ? 0.05f * (1f - lifeRatio) : 0.03f * (1f - lifeRatio);
|
||||
}
|
||||
|
||||
if (BossRushEvent.BossRushActive)
|
||||
{
|
||||
num1063 *= 1.5f;
|
||||
@@ -475,6 +494,7 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
}
|
||||
|
||||
float chargeDistance = (sirenAlive && !phase4) ? 1100f : 900f;
|
||||
chargeDistance -= 100f * enrageScale;
|
||||
if (!sirenAlive || phase4)
|
||||
chargeDistance -= 250f * (1f - lifeRatio);
|
||||
|
||||
@@ -500,6 +520,7 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
npc.ai[2] = 0f;
|
||||
|
||||
float num1044 = revenge ? 20f : 18f;
|
||||
num1044 += 4f * enrageScale;
|
||||
|
||||
if (revenge && (!sirenAlive || phase4))
|
||||
num1044 += death ? 9f * (1f - lifeRatio) : 6f * (1f - lifeRatio);
|
||||
@@ -524,6 +545,9 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
|
||||
float num1048 = revenge ? 7.5f : 6.5f;
|
||||
float num1049 = revenge ? 0.12f : 0.11f;
|
||||
num1048 += 2f * enrageScale;
|
||||
num1049 += 0.03f * enrageScale;
|
||||
|
||||
if (revenge && (!sirenAlive || phase4))
|
||||
{
|
||||
num1048 += death ? 9f * (1f - lifeRatio) : 6f * (1f - lifeRatio);
|
||||
@@ -535,6 +559,7 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
num1048 += 3f;
|
||||
num1049 += 0.2f;
|
||||
}
|
||||
|
||||
if (BossRushEvent.BossRushActive)
|
||||
{
|
||||
num1048 *= 1.25f;
|
||||
@@ -589,6 +614,8 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
|
||||
npc.velocity *= 0.9f;
|
||||
float num1052 = revenge ? 0.11f : 0.1f;
|
||||
num1052 += 0.03f * enrageScale;
|
||||
|
||||
if (revenge && (!sirenAlive || phase4))
|
||||
{
|
||||
npc.velocity *= death ? MathHelper.Lerp(0.75f, 1f, lifeRatio) : MathHelper.Lerp(0.81f, 1f, lifeRatio);
|
||||
|
||||
+36
-19
@@ -129,9 +129,18 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
bool death = CalamityWorld.death || BossRushEvent.BossRushActive;
|
||||
bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive;
|
||||
bool expertMode = Main.expertMode || BossRushEvent.BossRushActive;
|
||||
bool isNotOcean = player.position.Y < 800f || player.position.Y > Main.worldSurface * 16.0 || (player.position.X > 6400f && player.position.X < (Main.maxTilesX * 16 - 6400));
|
||||
bool notOcean = player.position.Y < 800f || player.position.Y > Main.worldSurface * 16.0 || (player.position.X > 6400f && player.position.X < (Main.maxTilesX * 16 - 6400));
|
||||
|
||||
float enrageScale = 0f;
|
||||
if (notOcean)
|
||||
enrageScale += 2f;
|
||||
|
||||
if (BossRushEvent.BossRushActive)
|
||||
enrageScale = 0f;
|
||||
|
||||
float lifeRatio = npc.life / (float)npc.lifeMax;
|
||||
float bubbleVelocity = BossRushEvent.BossRushActive ? 16f : death ? 9f : revenge ? 7f : expertMode ? 6f : 5f;
|
||||
bubbleVelocity += 2f * enrageScale;
|
||||
if (!leviAlive)
|
||||
bubbleVelocity += 2f * (1f - lifeRatio);
|
||||
|
||||
@@ -184,7 +193,7 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
npc.dontTakeDamage = true;
|
||||
else
|
||||
{
|
||||
npc.dontTakeDamage = isNotOcean && !BossRushEvent.BossRushActive;
|
||||
npc.dontTakeDamage = false;
|
||||
npc.ai[3] = 0f;
|
||||
|
||||
if (npc.localAI[1] == -1f)
|
||||
@@ -207,7 +216,7 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.dontTakeDamage = isNotOcean && !BossRushEvent.BossRushActive;
|
||||
npc.dontTakeDamage = false;
|
||||
|
||||
int num7 = (int)npc.ai[3] - 1;
|
||||
if (num7 != -1 && Main.npc[num7].active && Main.npc[num7].type == ModContent.NPCType<SirenIce>())
|
||||
@@ -259,18 +268,9 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
// Alpha
|
||||
if (npc.damage != 0)
|
||||
{
|
||||
if (isNotOcean)
|
||||
{
|
||||
npc.alpha += 3;
|
||||
if (npc.alpha >= 150)
|
||||
npc.alpha = 150;
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.alpha -= 5;
|
||||
if (npc.alpha <= 0)
|
||||
npc.alpha = 0;
|
||||
}
|
||||
npc.alpha -= 5;
|
||||
if (npc.alpha <= 0)
|
||||
npc.alpha = 0;
|
||||
}
|
||||
|
||||
// Play sound
|
||||
@@ -375,7 +375,10 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
|
||||
float maxVelocityY = death ? 3f : 4f;
|
||||
float maxVelocityX = death ? 7f : 8f;
|
||||
if (npc.position.Y > player.position.Y - 350f)
|
||||
maxVelocityY -= enrageScale;
|
||||
maxVelocityX -= 2f * enrageScale;
|
||||
|
||||
if (npc.position.Y > player.position.Y - 350f)
|
||||
{
|
||||
if (npc.velocity.Y > 0f)
|
||||
npc.velocity.Y *= 0.98f;
|
||||
@@ -391,6 +394,7 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
if (npc.velocity.Y < -maxVelocityY)
|
||||
npc.velocity.Y = -maxVelocityY;
|
||||
}
|
||||
|
||||
if (npc.position.X + (npc.width / 2) > player.position.X + (player.width / 2) + 100f)
|
||||
{
|
||||
if (npc.velocity.X > 0f)
|
||||
@@ -399,6 +403,7 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
if (npc.velocity.X > maxVelocityX)
|
||||
npc.velocity.X = maxVelocityX;
|
||||
}
|
||||
|
||||
if (npc.position.X + (npc.width / 2) < player.position.X + (player.width / 2) - 100f)
|
||||
{
|
||||
if (npc.velocity.X < 0f)
|
||||
@@ -461,6 +466,9 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
{
|
||||
float maxVelocityY = death ? 3f : 4f;
|
||||
float maxVelocityX = death ? 7f : 8f;
|
||||
maxVelocityY -= enrageScale;
|
||||
maxVelocityX -= 2f * enrageScale;
|
||||
|
||||
if (npc.position.Y > player.position.Y - 350f)
|
||||
{
|
||||
if (npc.velocity.Y > 0f)
|
||||
@@ -477,6 +485,7 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
if (npc.velocity.Y < -maxVelocityY)
|
||||
npc.velocity.Y = -maxVelocityY;
|
||||
}
|
||||
|
||||
if (npc.position.X + (npc.width / 2) > player.position.X + (player.width / 2) + 100f)
|
||||
{
|
||||
if (npc.velocity.X > 0f)
|
||||
@@ -485,6 +494,7 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
if (npc.velocity.X > maxVelocityX)
|
||||
npc.velocity.X = maxVelocityX;
|
||||
}
|
||||
|
||||
if (npc.position.X + (npc.width / 2) < player.position.X + (player.width / 2) - 100f)
|
||||
{
|
||||
if (npc.velocity.X < 0f)
|
||||
@@ -515,8 +525,11 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
npc.rotation = npc.velocity.X * 0.02f;
|
||||
|
||||
Vector2 targetVector = player.Center + new Vector2(0f, -350f);
|
||||
Vector2 vector3 = Vector2.Normalize(targetVector - vector - npc.velocity) * (BossRushEvent.BossRushActive ? 18f : death ? 13.5f : 12f);
|
||||
float velocity = BossRushEvent.BossRushActive ? 18f : death ? 13.5f : 12f;
|
||||
velocity += 3f * enrageScale;
|
||||
Vector2 vector3 = Vector2.Normalize(targetVector - vector - npc.velocity) * velocity;
|
||||
float acceleration = BossRushEvent.BossRushActive ? 0.5f : death ? 0.28f : 0.25f;
|
||||
acceleration += 0.1f * enrageScale;
|
||||
|
||||
if (Math.Abs(npc.Center.Y - targetVector.Y) > 50f || Math.Abs(npc.Center.X - player.Center.X) > 350f)
|
||||
npc.SimpleFlyMovement(vector3, acceleration);
|
||||
@@ -524,6 +537,7 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
npc.ai[1] += 1f;
|
||||
|
||||
float divisor = 140f;
|
||||
divisor -= (int)(20f * enrageScale);
|
||||
if (!leviAlive || phase4)
|
||||
divisor -= (float)Math.Ceiling(50f * (1f - lifeRatio));
|
||||
|
||||
@@ -531,6 +545,7 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient && shootProjectiles)
|
||||
{
|
||||
float projectileVelocity = expertMode ? 3f : 2f;
|
||||
projectileVelocity += enrageScale;
|
||||
if (!leviAlive || phase4)
|
||||
projectileVelocity += death ? 3f * (1f - lifeRatio) : 2f * (1f - lifeRatio);
|
||||
|
||||
@@ -567,8 +582,8 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
for (int i = 0; i < totalProjectiles; i++)
|
||||
{
|
||||
Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -projectileVelocity).RotatedBy(radians * i)) * projectileDistance;
|
||||
Vector2 velocity = Vector2.Normalize(player.Center - spawnVector) * projectileVelocity;
|
||||
Projectile.NewProjectile(spawnVector, velocity, type, damage, 0f, Main.myPlayer);
|
||||
Vector2 projVelocity = Vector2.Normalize(player.Center - spawnVector) * projectileVelocity;
|
||||
Projectile.NewProjectile(spawnVector, projVelocity, type, damage, 0f, Main.myPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -580,6 +595,7 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
}
|
||||
|
||||
float phaseTimer = 300f;
|
||||
phaseTimer -= 30f * enrageScale;
|
||||
if (!leviAlive || phase4)
|
||||
phaseTimer -= 150f * (1f - lifeRatio);
|
||||
|
||||
@@ -608,6 +624,7 @@ namespace CalamityMod.NPCs.Leviathan
|
||||
|
||||
// Velocity and rotation
|
||||
float chargeVelocity = BossRushEvent.BossRushActive ? 31f : (leviAlive && !phase4) ? 21f : 26f;
|
||||
chargeVelocity += 7f * enrageScale;
|
||||
|
||||
if (revenge)
|
||||
chargeVelocity += 2f + (death ? 6f * (1f - lifeRatio) : 4f * (1f - lifeRatio));
|
||||
|
||||
@@ -59,9 +59,9 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
if (npc.position.Y > Main.player[npc.target].position.Y - 350f)
|
||||
{
|
||||
if (npc.velocity.Y > 0f)
|
||||
npc.velocity.Y = npc.velocity.Y * 0.98f;
|
||||
npc.velocity.Y *= 0.98f;
|
||||
|
||||
npc.velocity.Y = npc.velocity.Y - acceleration;
|
||||
npc.velocity.Y -= acceleration;
|
||||
|
||||
if (npc.velocity.Y > velocity)
|
||||
npc.velocity.Y = velocity;
|
||||
@@ -69,30 +69,30 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
else if (npc.position.Y < Main.player[npc.target].position.Y - 400f)
|
||||
{
|
||||
if (npc.velocity.Y < 0f)
|
||||
npc.velocity.Y = npc.velocity.Y * 0.98f;
|
||||
npc.velocity.Y *= 0.98f;
|
||||
|
||||
npc.velocity.Y = npc.velocity.Y + acceleration;
|
||||
npc.velocity.Y += acceleration;
|
||||
|
||||
if (npc.velocity.Y < -velocity)
|
||||
npc.velocity.Y = -velocity;
|
||||
}
|
||||
|
||||
if (npc.position.X + (float)(npc.width / 2) > Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) + 100f)
|
||||
if (npc.Center.X > Main.player[npc.target].Center.X + 100f)
|
||||
{
|
||||
if (npc.velocity.X > 0f)
|
||||
npc.velocity.X = npc.velocity.X * 0.98f;
|
||||
npc.velocity.X *= 0.98f;
|
||||
|
||||
npc.velocity.X = npc.velocity.X - acceleration;
|
||||
npc.velocity.X -= acceleration;
|
||||
|
||||
if (npc.velocity.X > 8f)
|
||||
npc.velocity.X = 8f;
|
||||
}
|
||||
if (npc.position.X + (float)(npc.width / 2) < Main.player[npc.target].position.X + (float)(Main.player[npc.target].width / 2) - 100f)
|
||||
if (npc.Center.X < Main.player[npc.target].Center.X - 100f)
|
||||
{
|
||||
if (npc.velocity.X < 0f)
|
||||
npc.velocity.X = npc.velocity.X * 0.98f;
|
||||
npc.velocity.X *= 0.98f;
|
||||
|
||||
npc.velocity.X = npc.velocity.X + acceleration;
|
||||
npc.velocity.X += acceleration;
|
||||
|
||||
if (npc.velocity.X < -8f)
|
||||
npc.velocity.X = -8f;
|
||||
@@ -132,12 +132,24 @@ namespace CalamityMod.NPCs.NormalNPCs
|
||||
if (Main.rand.NextBool(2))
|
||||
{
|
||||
Main.dust[ruby].scale = 0.5f;
|
||||
Main.dust[ruby].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f;
|
||||
Main.dust[ruby].fadeIn = 1f + Main.rand.Next(10) * 0.1f;
|
||||
}
|
||||
}
|
||||
|
||||
Main.PlaySound(SoundID.Item8, npc.position);
|
||||
Projectile.NewProjectile(npcPos, projVector, type, npc.GetProjectileDamage(type), 0f, Main.myPlayer, 0f, 0f);
|
||||
int damage = npc.GetProjectileDamage(type);
|
||||
if (CalamityWorld.death || BossRushEvent.BossRushActive)
|
||||
{
|
||||
int numProj = 2;
|
||||
float rotation = MathHelper.ToRadians(9);
|
||||
for (int i = 0; i < numProj + 1; i++)
|
||||
{
|
||||
Vector2 perturbedSpeed = projVector.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (numProj - 1)));
|
||||
Projectile.NewProjectile(npcPos, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
else
|
||||
Projectile.NewProjectile(npcPos, projVector, type, damage, 0f, Main.myPlayer, 0f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +58,15 @@ namespace CalamityMod.NPCs.Perforator
|
||||
bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive;
|
||||
bool death = CalamityWorld.death || BossRushEvent.BossRushActive;
|
||||
|
||||
float enrageScale = 0f;
|
||||
if ((npc.position.Y / 16f) < Main.worldSurface)
|
||||
enrageScale += 1f;
|
||||
if (!Main.player[npc.target].ZoneCrimson)
|
||||
enrageScale += 1f;
|
||||
|
||||
if (BossRushEvent.BossRushActive)
|
||||
enrageScale = 0f;
|
||||
|
||||
// Percent life remaining
|
||||
float lifeRatio = npc.life / (float)npc.lifeMax;
|
||||
|
||||
@@ -70,13 +79,15 @@ namespace CalamityMod.NPCs.Perforator
|
||||
bool lungeUpward = burrow && npc.Calamity().newAI[1] == 1f;
|
||||
bool quickFall = npc.Calamity().newAI[1] == 2f;
|
||||
|
||||
float speed = 14f;
|
||||
float turnSpeed = 0.12f;
|
||||
float speed = 8f;
|
||||
float turnSpeed = 0.06f;
|
||||
|
||||
if (expertMode)
|
||||
{
|
||||
speed += death ? 6f * (1f - lifeRatio) : 4f * (1f - lifeRatio);
|
||||
turnSpeed += death ? 0.06f * (1f - lifeRatio) : 0.04f * (1f - lifeRatio);
|
||||
float velocityScale = (death ? 12f : 10f) * enrageScale;
|
||||
speed += velocityScale * (1f - lifeRatio);
|
||||
float accelerationScale = (death ? 0.12f : 0.1f) * enrageScale;
|
||||
turnSpeed += accelerationScale * (1f - lifeRatio);
|
||||
}
|
||||
|
||||
if (lungeUpward)
|
||||
|
||||
@@ -57,16 +57,27 @@ namespace CalamityMod.NPCs.Perforator
|
||||
bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive;
|
||||
bool death = CalamityWorld.death || BossRushEvent.BossRushActive;
|
||||
|
||||
float enrageScale = 0f;
|
||||
if ((npc.position.Y / 16f) < Main.worldSurface)
|
||||
enrageScale += 1f;
|
||||
if (!Main.player[npc.target].ZoneCrimson)
|
||||
enrageScale += 1f;
|
||||
|
||||
if (BossRushEvent.BossRushActive)
|
||||
enrageScale = 0f;
|
||||
|
||||
// Percent life remaining
|
||||
float lifeRatio = npc.life / (float)npc.lifeMax;
|
||||
|
||||
float speed = 16f;
|
||||
float turnSpeed = 0.14f;
|
||||
float speed = 8f;
|
||||
float turnSpeed = 0.06f;
|
||||
|
||||
if (expertMode)
|
||||
{
|
||||
speed += death ? 2f * (1f - lifeRatio) : 1f - lifeRatio;
|
||||
turnSpeed += death ? 0.02f * (1f - lifeRatio) : 0.01f * (1f - lifeRatio);
|
||||
float velocityScale = (death ? 8f : 7f) * enrageScale;
|
||||
speed += velocityScale * (1f - lifeRatio);
|
||||
float accelerationScale = (death ? 0.08f : 0.07f) * enrageScale;
|
||||
turnSpeed += accelerationScale * (1f - lifeRatio);
|
||||
}
|
||||
|
||||
if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && BossRushEvent.BossRushActive))
|
||||
@@ -229,7 +240,7 @@ namespace CalamityMod.NPCs.Perforator
|
||||
npc.Calamity().newAI[1] += 1f;
|
||||
|
||||
// Set velocity for when a new head spawns
|
||||
npc.velocity = Vector2.Normalize(player.Center - npc.Center) * (num37 * (BossRushEvent.BossRushActive ? 0.8f : death ? 0.5f : 0.4f));
|
||||
npc.velocity = Vector2.Normalize(player.Center - npc.Center) * (num37 * (BossRushEvent.BossRushActive ? 0.6f : death ? 0.3f : 0.2f));
|
||||
}
|
||||
|
||||
if (!flag2)
|
||||
|
||||
@@ -57,16 +57,27 @@ namespace CalamityMod.NPCs.Perforator
|
||||
bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive;
|
||||
bool death = CalamityWorld.death || BossRushEvent.BossRushActive;
|
||||
|
||||
float enrageScale = 0f;
|
||||
if ((npc.position.Y / 16f) < Main.worldSurface)
|
||||
enrageScale += 1f;
|
||||
if (!Main.player[npc.target].ZoneCrimson)
|
||||
enrageScale += 1f;
|
||||
|
||||
if (BossRushEvent.BossRushActive)
|
||||
enrageScale = 0f;
|
||||
|
||||
// Percent life remaining
|
||||
float lifeRatio = npc.life / (float)npc.lifeMax;
|
||||
|
||||
float speed = 18f;
|
||||
float turnSpeed = 0.16f;
|
||||
float speed = 12f;
|
||||
float turnSpeed = 0.1f;
|
||||
|
||||
if (expertMode)
|
||||
{
|
||||
speed += death ? 6f * (1f - lifeRatio) : 4f * (1f - lifeRatio);
|
||||
turnSpeed += death ? 0.06f * (1f - lifeRatio) : 0.04f * (1f - lifeRatio);
|
||||
float velocityScale = (death ? 12f : 10f) * enrageScale;
|
||||
speed += velocityScale * (1f - lifeRatio);
|
||||
float accelerationScale = (death ? 0.12f : 0.1f) * enrageScale;
|
||||
turnSpeed += accelerationScale * (1f - lifeRatio);
|
||||
}
|
||||
|
||||
if (npc.Calamity().enraged > 0 || (CalamityConfig.Instance.BossRushXerocCurse && BossRushEvent.BossRushActive))
|
||||
|
||||
@@ -81,11 +81,19 @@ namespace CalamityMod.NPCs.Perforator
|
||||
npc.TargetClosest(true);
|
||||
Player player = Main.player[npc.target];
|
||||
|
||||
bool isCrimson = player.ZoneCrimson || BossRushEvent.BossRushActive;
|
||||
bool expertMode = Main.expertMode || BossRushEvent.BossRushActive;
|
||||
bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive;
|
||||
bool death = CalamityWorld.death || BossRushEvent.BossRushActive;
|
||||
|
||||
float enrageScale = 0f;
|
||||
if ((npc.position.Y / 16f) < Main.worldSurface)
|
||||
enrageScale += 1f;
|
||||
if (!Main.player[npc.target].ZoneCrimson)
|
||||
enrageScale += 1f;
|
||||
|
||||
if (BossRushEvent.BossRushActive)
|
||||
enrageScale = 0f;
|
||||
|
||||
if (!player.active || player.dead || Vector2.Distance(player.Center, npc.Center) > 5600f)
|
||||
{
|
||||
npc.TargetClosest(false);
|
||||
@@ -120,14 +128,7 @@ namespace CalamityMod.NPCs.Perforator
|
||||
if (NPC.AnyNPCs(ModContent.NPCType<PerforatorHeadSmall>()))
|
||||
wormsAlive++;
|
||||
|
||||
if (largeWormAlive && expertMode)
|
||||
{
|
||||
npc.dontTakeDamage = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.dontTakeDamage = isCrimson ? false : true;
|
||||
}
|
||||
npc.dontTakeDamage = largeWormAlive && expertMode;
|
||||
|
||||
float playerLocation = npc.Center.X - player.Center.X;
|
||||
npc.direction = playerLocation < 0 ? 1 : -1;
|
||||
@@ -135,7 +136,7 @@ namespace CalamityMod.NPCs.Perforator
|
||||
|
||||
if (Main.netMode != NetmodeID.MultiplayerClient)
|
||||
{
|
||||
int shoot = revenge ? 6 : 4;
|
||||
int shoot = (revenge ? 6 : 4) - wormsAlive;
|
||||
npc.localAI[0] += Main.rand.Next(shoot);
|
||||
if (npc.localAI[0] >= Main.rand.Next(300, 901) && npc.position.Y + npc.height < player.position.Y && Vector2.Distance(player.Center, npc.Center) > 80f)
|
||||
{
|
||||
@@ -168,7 +169,7 @@ namespace CalamityMod.NPCs.Perforator
|
||||
float maxVelocity = 8f;
|
||||
float velocityAdjustment = maxVelocity * 1.5f / totalProjectiles;
|
||||
Vector2 start = new Vector2(npc.Center.X, npc.Center.Y + 30f);
|
||||
Vector2 destination = new Vector2(Vector2.Normalize(player.Center - start).X, 0f) * maxVelocity * 0.4f;
|
||||
Vector2 destination = wormsAlive > 0 ? new Vector2(Vector2.Normalize(player.Center - start).X, 0f) * maxVelocity * 0.4f : Vector2.Zero;
|
||||
Vector2 velocity = destination + Vector2.UnitY * -maxVelocity;
|
||||
for (int i = 0; i < totalProjectiles + 1; i++)
|
||||
{
|
||||
@@ -193,24 +194,24 @@ namespace CalamityMod.NPCs.Perforator
|
||||
{
|
||||
if (large || death)
|
||||
{
|
||||
Movement(player, 5f, 1.5f, BossRushEvent.BossRushActive ? 0.195f : death ? 0.15f : 0.13f, 360f, 10f, 50f, true);
|
||||
Movement(player, 3.5f + 1.5f * enrageScale, 1f + 0.5f * enrageScale, BossRushEvent.BossRushActive ? 0.195f : death ? 0.15f : 0.13f, 360f, 10f, 50f, true);
|
||||
}
|
||||
else if (medium)
|
||||
{
|
||||
Movement(player, 6f, 2f, BossRushEvent.BossRushActive ? 0.18f : death ? 0.14f : 0.12f, 340f, 15f, 50f, true);
|
||||
Movement(player, 4.5f + 1.5f * enrageScale, 1.5f + 0.5f * enrageScale, BossRushEvent.BossRushActive ? 0.18f : death ? 0.14f : 0.12f, 340f, 15f, 50f, true);
|
||||
}
|
||||
else if (small)
|
||||
{
|
||||
Movement(player, 7f, 2.5f, BossRushEvent.BossRushActive ? 0.165f : death ? 0.13f : 0.11f, 320f, 20f, 50f, true);
|
||||
Movement(player, 5.5f + 1.5f * enrageScale, 2f + 0.5f * enrageScale, BossRushEvent.BossRushActive ? 0.165f : death ? 0.13f : 0.11f, 320f, 20f, 50f, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
Movement(player, 8f, 3f, BossRushEvent.BossRushActive ? 0.15f : death ? 0.12f : 0.1f, 300f, 25f, 50f, true);
|
||||
Movement(player, 6.5f + 1.5f * enrageScale, 2.5f + 0.5f * enrageScale, BossRushEvent.BossRushActive ? 0.15f : death ? 0.12f : 0.1f, 300f, 25f, 50f, true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.velocity.X += (npc.Center.X <= player.Center.X ? -0.1f : 0.1f);
|
||||
npc.velocity.X += npc.Center.X <= player.Center.X ? -0.1f : 0.1f;
|
||||
if (npc.Center.X > player.Center.X + 320f || npc.Center.X < player.Center.X - 320f)
|
||||
{
|
||||
npc.ai[0] = 1f;
|
||||
@@ -220,7 +221,7 @@ namespace CalamityMod.NPCs.Perforator
|
||||
}
|
||||
else
|
||||
{
|
||||
Movement(player, 4f, 1f, 0.1f, 160f, 300f, 400f, false);
|
||||
Movement(player, 2.5f + 1.5f * enrageScale, 0.5f + 0.5f * enrageScale, 0.1f, 160f, 300f, 400f, false);
|
||||
}
|
||||
|
||||
if (npc.ai[3] == 0f && npc.life > 0)
|
||||
|
||||
@@ -182,10 +182,8 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
|
||||
// Enrage
|
||||
float enrageScale = death ? 0.25f : 0f;
|
||||
if ((npc.position.Y / 16f) < Main.worldSurface || (npc.position.Y / 16f) > (Main.maxTilesY - 200))
|
||||
enrageScale += 0.5f;
|
||||
if (!player.ZoneJungle)
|
||||
enrageScale += 0.5f;
|
||||
enrageScale += 1f;
|
||||
|
||||
if (enrageScale > 1f)
|
||||
enrageScale = 1f;
|
||||
@@ -245,21 +243,27 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
do num596 = MissileCountdown == 1 ? 4 : Main.rand.Next(4);
|
||||
while (num596 == npc.ai[1] || num596 == 1);
|
||||
|
||||
if (num596 == 0 && diagonalDash && distFromPlayer.Length() < 1800f)
|
||||
{
|
||||
switch (Main.rand.Next(3))
|
||||
{
|
||||
case 0:
|
||||
chargeDistance = 0;
|
||||
break;
|
||||
case 1:
|
||||
chargeDistance = 400;
|
||||
break;
|
||||
case 2:
|
||||
chargeDistance = -400;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (num596 == 0 && diagonalDash && distFromPlayer.Length() < 1800f)
|
||||
{
|
||||
do
|
||||
{
|
||||
switch (Main.rand.Next(3))
|
||||
{
|
||||
case 0:
|
||||
chargeDistance = 0;
|
||||
break;
|
||||
case 1:
|
||||
chargeDistance = 400;
|
||||
break;
|
||||
case 2:
|
||||
chargeDistance = -400;
|
||||
break;
|
||||
}
|
||||
}
|
||||
while (chargeDistance == npc.ai[3]);
|
||||
|
||||
npc.ai[3] = -chargeDistance;
|
||||
}
|
||||
npc.ai[0] = num596;
|
||||
npc.ai[1] = 0f;
|
||||
npc.ai[2] = 0f;
|
||||
@@ -424,11 +428,10 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
num1051 = -1;
|
||||
|
||||
if (npc.direction == num1051 && (Math.Abs(vectorCenter.X - player.Center.X) > num1050 || Math.Abs(vectorCenter.Y - player.Center.Y) > num1050))
|
||||
{
|
||||
npc.ai[2] = 1f;
|
||||
}
|
||||
|
||||
if (enrageScale > 0 && npc.ai[2] == 1f)
|
||||
npc.velocity *= 0.75f;
|
||||
npc.velocity *= 0.95f;
|
||||
|
||||
if (npc.ai[2] != 1f)
|
||||
{
|
||||
@@ -471,7 +474,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
num1052 += 0.05f;
|
||||
}
|
||||
if (enrageScale > 0)
|
||||
npc.velocity *= 0.85f;
|
||||
npc.velocity *= 0.95f;
|
||||
|
||||
if (Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y) < num1052)
|
||||
{
|
||||
@@ -700,21 +703,30 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
num1071 *= num1073;
|
||||
num1072 *= num1073;
|
||||
|
||||
int type = Main.rand.NextBool(2) ? ModContent.ProjectileType<PlagueStingerGoliath>() : ModContent.ProjectileType<PlagueStingerGoliathV2>();
|
||||
if (expertMode)
|
||||
{
|
||||
if (Main.rand.NextBool(6))
|
||||
type = ModContent.ProjectileType<HiveBombGoliath>();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Main.rand.NextBool(9))
|
||||
type = ModContent.ProjectileType<HiveBombGoliath>();
|
||||
}
|
||||
int type = ModContent.ProjectileType<PlagueStingerGoliathV2>();
|
||||
switch ((int)npc.ai[2])
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
if (expertMode)
|
||||
type = ModContent.ProjectileType<PlagueStingerGoliath>();
|
||||
break;
|
||||
case 4:
|
||||
type = ModContent.ProjectileType<HiveBombGoliath>();
|
||||
break;
|
||||
}
|
||||
|
||||
int damage = npc.GetProjectileDamage(type);
|
||||
Projectile.NewProjectile(vector121.X, vector121.Y, num1071, num1072, type, damage, 0f, Main.myPlayer, 0f, player.position.Y);
|
||||
}
|
||||
}
|
||||
|
||||
npc.ai[2] += 1f;
|
||||
if (npc.ai[2] > 4f)
|
||||
npc.ai[2] = 0f;
|
||||
}
|
||||
|
||||
Movement(100f, 400f, 500f, player, enrageScale);
|
||||
|
||||
@@ -726,7 +738,8 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
{
|
||||
npc.ai[0] = -1f;
|
||||
npc.ai[1] = 3f;
|
||||
npc.netUpdate = true;
|
||||
npc.ai[2] = 0f;
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -872,7 +885,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
if (npc.direction == num1051 && Math.Abs(vectorCenter.X - player.Center.X) > num1050)
|
||||
npc.ai[2] = 1f;
|
||||
if (enrageScale > 0 && npc.ai[2] == 1f)
|
||||
npc.velocity *= 0.75f;
|
||||
npc.velocity *= 0.95f;
|
||||
|
||||
if (npc.ai[2] != 1f)
|
||||
{
|
||||
@@ -914,7 +927,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
num1052 += 0.05f;
|
||||
}
|
||||
if (enrageScale > 0)
|
||||
npc.velocity *= 0.85f;
|
||||
npc.velocity *= 0.95f;
|
||||
|
||||
if (Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y) < num1052)
|
||||
{
|
||||
@@ -995,8 +1008,8 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath
|
||||
Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("PlaguebringerGoliathGore" + i), 2f);
|
||||
npc.position.X = npc.position.X + (npc.width / 2);
|
||||
npc.position.Y = npc.position.Y + (npc.height / 2);
|
||||
npc.width = 100;
|
||||
npc.height = 100;
|
||||
npc.width = 200;
|
||||
npc.height = 200;
|
||||
npc.position.X = npc.position.X - (npc.width / 2);
|
||||
npc.position.Y = npc.position.Y - (npc.height / 2);
|
||||
for (int num621 = 0; num621 < 40; num621++)
|
||||
|
||||
@@ -145,9 +145,9 @@ namespace CalamityMod.NPCs.Ravager
|
||||
}
|
||||
|
||||
Vector2 vector82 = npc.Center;
|
||||
float distance = npc.ai[0] % 2f == 0f ? 360f : -360f;
|
||||
float distance = npc.ai[0] % 2f == 0f ? 420f : -420f;
|
||||
float num825 = player.Center.X + (fireProjectiles ? distance : 0f) - vector82.X;
|
||||
float num826 = player.Center.Y + (fireProjectiles ? -180f : 360f) - vector82.Y;
|
||||
float num826 = player.Center.Y + (fireProjectiles ? -210f : 420f) - vector82.Y;
|
||||
float num827 = (float)Math.Sqrt(num825 * num825 + num826 * num826);
|
||||
num827 = num823 / num827;
|
||||
num825 *= num827;
|
||||
|
||||
@@ -128,6 +128,11 @@ namespace CalamityMod.NPCs.Ravager
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<ArmorCrunch>(), 180, true);
|
||||
Main.PlaySound(SoundID.Item14, npc.position);
|
||||
npc.ai[0] = 0f;
|
||||
npc.life = 0;
|
||||
HitEffect(npc.direction, 9999);
|
||||
npc.netUpdate = true;
|
||||
}
|
||||
|
||||
public override void HitEffect(int hitDirection, double damage)
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace CalamityMod.NPCs.SlimeGod
|
||||
npc.height = 92;
|
||||
npc.scale = 1.1f;
|
||||
npc.defense = 10;
|
||||
npc.LifeMaxNERB(4000, 5500, 2200000);
|
||||
npc.LifeMaxNERB(4650, 6400, 2200000);
|
||||
double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01;
|
||||
npc.lifeMax += (int)(npc.lifeMax * HPBoost);
|
||||
npc.aiStyle = -1;
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace CalamityMod.NPCs.SlimeGod
|
||||
npc.width = 44;
|
||||
npc.height = 44;
|
||||
npc.defense = 6;
|
||||
npc.LifeMaxNERB(4000, 5000, 2500000);
|
||||
npc.LifeMaxNERB(2000, 2500, 2500000);
|
||||
double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01;
|
||||
npc.lifeMax += (int)(npc.lifeMax * HPBoost);
|
||||
NPCID.Sets.TrailCacheLength[npc.type] = 8;
|
||||
@@ -503,7 +503,7 @@ namespace CalamityMod.NPCs.SlimeGod
|
||||
float num1372 = death ? 14f : revenge ? 11f : expertMode ? 8.5f : 6f;
|
||||
if (phase2)
|
||||
{
|
||||
num1372 = revenge ? 14f : expertMode ? 12.5f : 11f;
|
||||
num1372 = revenge ? 18f : expertMode ? 16f : 14f;
|
||||
}
|
||||
if (BossRushEvent.BossRushActive || player.gravDir == -1f)
|
||||
{
|
||||
@@ -712,7 +712,7 @@ namespace CalamityMod.NPCs.SlimeGod
|
||||
|
||||
public override void OnHitPlayer(Player player, int damage, bool crit)
|
||||
{
|
||||
player.AddBuff(BuffID.VortexDebuff, 180, true);
|
||||
player.AddBuff(BuffID.VortexDebuff, 150, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,7 @@ namespace CalamityMod.NPCs.SlimeGod
|
||||
npc.height = 92;
|
||||
npc.scale = 1.1f;
|
||||
npc.defense = 12;
|
||||
npc.LifeMaxNERB(3500, 4820, 1600000);
|
||||
npc.LifeMaxNERB(4150, 5700, 1600000);
|
||||
double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01;
|
||||
npc.lifeMax += (int)(npc.lifeMax * HPBoost);
|
||||
npc.knockBackResist = 0f;
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.SlimeGod
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
npc.LifeMaxNERB(1000, 1375, 1100000);
|
||||
npc.LifeMaxNERB(1350, 1800, 1100000);
|
||||
double HPBoost = CalamityConfig.Instance.BossHealthBoost * 0.01;
|
||||
npc.lifeMax += (int)(npc.lifeMax * HPBoost);
|
||||
npc.GetNPCDamage();
|
||||
|
||||
@@ -205,7 +205,9 @@ namespace CalamityMod.NPCs.StormWeaver
|
||||
|
||||
if (Main.player[npc.target].dead && npc.life > 0)
|
||||
{
|
||||
npc.TargetClosest(false);
|
||||
npc.localAI[1] = 0f;
|
||||
calamityGlobalNPC.newAI[0] = 0f;
|
||||
npc.TargetClosest(false);
|
||||
npc.velocity.Y = npc.velocity.Y - 10f;
|
||||
if ((double)npc.position.Y < Main.topWorld + 16f)
|
||||
{
|
||||
|
||||
@@ -80,10 +80,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
projectile.velocity *= scaleFactor2;
|
||||
}
|
||||
else if (Math.Abs(projectile.velocity.X) + Math.Abs(projectile.velocity.Y) < 18f)
|
||||
{
|
||||
projectile.velocity.X *= 1.01f;
|
||||
projectile.velocity.Y *= 1.01f;
|
||||
}
|
||||
projectile.velocity *= 1.01f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -103,7 +103,31 @@ namespace CalamityMod.Projectiles.Boss
|
||||
float amount = 0.5f; //0.5f
|
||||
projectile.localAI[1] = MathHelper.Lerp(projectile.localAI[1], num807, amount); //length of laser, linear interpolation
|
||||
Vector2 vector79 = projectile.Center + projectile.velocity * (projectile.localAI[1] - 14f);
|
||||
for (int num809 = 0; num809 < 2; num809++)
|
||||
|
||||
// Fire brimstone darts along the laser
|
||||
if (Main.npc[(int)projectile.ai[1]].ai[1] == 210f && projectile.owner == Main.myPlayer)
|
||||
{
|
||||
Vector2 velocity = projectile.velocity;
|
||||
velocity.Normalize();
|
||||
float distanceBetweenProjectiles = 96f;
|
||||
Vector2 fireFrom = new Vector2(Main.npc[(int)projectile.ai[1]].Center.X + (Main.npc[(int)projectile.ai[1]].spriteDirection > 0 ? 34f : -34f), Main.npc[(int)projectile.ai[1]].Center.Y - 74f) + velocity * distanceBetweenProjectiles;
|
||||
int projectileAmt = (int)(projectile.localAI[1] / distanceBetweenProjectiles);
|
||||
int type = ModContent.ProjectileType<BrimstoneBarrage>();
|
||||
int damage = projectile.GetProjectileDamage(ModContent.NPCType<BrimstoneElemental>());
|
||||
for (int i = 0; i < projectileAmt; i++)
|
||||
{
|
||||
int totalProjectiles = 2;
|
||||
float radians = MathHelper.TwoPi / totalProjectiles;
|
||||
for (int j = 0; j < totalProjectiles; j++)
|
||||
{
|
||||
Vector2 projVelocity = projectile.velocity.RotatedBy(radians * j + MathHelper.PiOver2);
|
||||
Projectile.NewProjectile(fireFrom, projVelocity, type, damage, 0f, Main.myPlayer, 1f, 0f);
|
||||
}
|
||||
fireFrom += velocity * distanceBetweenProjectiles;
|
||||
}
|
||||
}
|
||||
|
||||
for (int num809 = 0; num809 < 2; num809++)
|
||||
{
|
||||
float num810 = projectile.velocity.ToRotation() + ((Main.rand.Next(2) == 1) ? -1f : 1f) * MathHelper.PiOver2;
|
||||
float num811 = (float)Main.rand.NextDouble() * 2f + 2f;
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
Main.PlaySound(SoundID.Item33, (int)projectile.position.X, (int)projectile.position.Y);
|
||||
projectile.localAI[1] = 1f;
|
||||
}
|
||||
if (projectile.velocity.Length() < 18f)
|
||||
if (projectile.velocity.Length() < 14f)
|
||||
{
|
||||
projectile.velocity *= 1.0025f;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
Main.PlaySound(SoundID.Item33, (int)projectile.position.X, (int)projectile.position.Y);
|
||||
projectile.localAI[1] = 1f;
|
||||
}
|
||||
if (projectile.velocity.Length() < 18f)
|
||||
if (projectile.velocity.Length() < 14f)
|
||||
{
|
||||
projectile.velocity *= 1.0025f;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.NPCs;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
@@ -12,6 +13,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
public class HolySpear : ModProjectile
|
||||
{
|
||||
Vector2 velocity = Vector2.Zero;
|
||||
Vector2 providenceCenter = Vector2.Zero;
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
@@ -37,6 +39,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
writer.Write(projectile.localAI[0]);
|
||||
writer.Write(projectile.localAI[1]);
|
||||
writer.WriteVector2(velocity);
|
||||
writer.WriteVector2(providenceCenter);
|
||||
}
|
||||
|
||||
public override void ReceiveExtraAI(BinaryReader reader)
|
||||
@@ -44,6 +47,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
projectile.localAI[0] = reader.ReadSingle();
|
||||
projectile.localAI[1] = reader.ReadSingle();
|
||||
velocity = reader.ReadVector2();
|
||||
providenceCenter = reader.ReadVector2();
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
@@ -52,10 +56,21 @@ namespace CalamityMod.Projectiles.Boss
|
||||
{
|
||||
projectile.localAI[0] = 1f;
|
||||
|
||||
providenceCenter = Main.npc[CalamityGlobalNPC.holyBoss].Center;
|
||||
|
||||
if (projectile.ai[0] == 1f)
|
||||
velocity = projectile.velocity;
|
||||
}
|
||||
|
||||
float timeGateValue = 510f;
|
||||
float timeGateValue2 = 540f;
|
||||
int playerIndex = Player.FindClosest(projectile.Center, 1, 1);
|
||||
bool farFromProvidence = Vector2.Distance(Main.player[playerIndex].Center, providenceCenter) > 1920f;
|
||||
Vector2 velocity2 = Main.player[playerIndex].Center - projectile.Center;
|
||||
float scaleFactor = projectile.velocity.Length();
|
||||
velocity2.Normalize();
|
||||
velocity2 *= scaleFactor;
|
||||
|
||||
if (projectile.ai[0] == 0f)
|
||||
{
|
||||
projectile.ai[1] += 1f;
|
||||
@@ -64,14 +79,20 @@ namespace CalamityMod.Projectiles.Boss
|
||||
float fastGateValue = 30f;
|
||||
float minVelocity = 3f;
|
||||
float maxVelocity = 12f;
|
||||
float extremeVelocity = 16f;
|
||||
float extremeVelocity = 24f;
|
||||
float deceleration = 0.95f;
|
||||
float acceleration = 1.2f;
|
||||
|
||||
if (projectile.localAI[1] > 480f)
|
||||
if (projectile.localAI[1] > timeGateValue)
|
||||
{
|
||||
if (projectile.velocity.Length() < extremeVelocity)
|
||||
projectile.velocity *= acceleration;
|
||||
else
|
||||
{
|
||||
projectile.velocity = (projectile.velocity * 10f + velocity2) / 11f;
|
||||
projectile.velocity.Normalize();
|
||||
projectile.velocity *= scaleFactor;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -91,17 +112,26 @@ namespace CalamityMod.Projectiles.Boss
|
||||
}
|
||||
else
|
||||
{
|
||||
float frequency = 0.1f;
|
||||
float amplitude = 2f;
|
||||
if (projectile.localAI[1] > timeGateValue)
|
||||
{
|
||||
projectile.velocity = (projectile.velocity * 10f + velocity2) / 11f;
|
||||
projectile.velocity.Normalize();
|
||||
projectile.velocity *= scaleFactor;
|
||||
}
|
||||
else
|
||||
{
|
||||
float frequency = 0.1f;
|
||||
float amplitude = 2f;
|
||||
|
||||
projectile.ai[1] += frequency;
|
||||
projectile.ai[1] += frequency;
|
||||
|
||||
float wavyVelocity = (float)Math.Sin(projectile.ai[1]);
|
||||
float wavyVelocity = (float)Math.Sin(projectile.ai[1]);
|
||||
|
||||
projectile.velocity = velocity + new Vector2(wavyVelocity, wavyVelocity).RotatedBy(MathHelper.ToRadians(velocity.ToRotation())) * amplitude;
|
||||
projectile.velocity = velocity + new Vector2(wavyVelocity, wavyVelocity).RotatedBy(MathHelper.ToRadians(velocity.ToRotation())) * amplitude;
|
||||
}
|
||||
}
|
||||
|
||||
if (projectile.localAI[1] < 540f)
|
||||
if (projectile.localAI[1] < timeGateValue2)
|
||||
{
|
||||
projectile.localAI[1] += 1f;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
|
||||
int num123 = Player.FindClosest(projectile.Center, 1, 1);
|
||||
projectile.ai[0] += 1f;
|
||||
if (projectile.ai[0] < 110f && projectile.ai[0] > 30f)
|
||||
if (projectile.ai[0] < 90f && projectile.ai[0] > 30f)
|
||||
{
|
||||
float scaleFactor2 = projectile.velocity.Length();
|
||||
Vector2 vector17 = Main.player[num123].Center - projectile.Center;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using CalamityMod.Events;
|
||||
using CalamityMod.World;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -23,7 +21,7 @@ namespace CalamityMod.Projectiles.Boss
|
||||
projectile.penetrate = -1;
|
||||
projectile.tileCollide = false;
|
||||
projectile.ignoreWater = true;
|
||||
projectile.timeLeft = (CalamityWorld.death || BossRushEvent.BossRushActive) ? 2100 : 1800;
|
||||
projectile.timeLeft = 1800;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
|
||||
@@ -212,7 +212,7 @@ namespace CalamityMod.Projectiles
|
||||
projectile.localAI[1] = 1f;
|
||||
}
|
||||
|
||||
if (projectile.velocity.Length() < 18f)
|
||||
if (projectile.velocity.Length() < 14f)
|
||||
projectile.velocity *= 1.0025f;
|
||||
|
||||
return false;
|
||||
@@ -786,6 +786,12 @@ namespace CalamityMod.Projectiles
|
||||
Player player = Main.player[projectile.owner];
|
||||
CalamityPlayer modPlayer = player.Calamity();
|
||||
|
||||
if (projectile.type == ProjectileID.RocketSkeleton && projectile.ai[1] == 1f)
|
||||
{
|
||||
if (projectile.velocity.Length() < 20f)
|
||||
projectile.velocity *= 1.01f;
|
||||
}
|
||||
|
||||
if (defDamage == 0)
|
||||
defDamage = projectile.damage;
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ namespace CalamityMod.Projectiles.Ranged
|
||||
projectile.arrow = true;
|
||||
projectile.penetrate = 1;
|
||||
projectile.timeLeft = 600;
|
||||
projectile.aiStyle = 1;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
|
||||
@@ -26,11 +26,6 @@ namespace CalamityMod.Tiles.Ores
|
||||
Main.tileSpelunker[Type] = true;
|
||||
}
|
||||
|
||||
public override bool CanExplode(int i, int j)
|
||||
{
|
||||
return NPC.downedBoss2;
|
||||
}
|
||||
|
||||
public override void NumDust(int i, int j, bool fail, ref int num)
|
||||
{
|
||||
num = fail ? 1 : 3;
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace CalamityMod.Tiles.Ores
|
||||
|
||||
public override bool CanExplode(int i, int j)
|
||||
{
|
||||
return CalamityWorld.downedStarGod;
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void NumDust(int i, int j, bool fail, ref int num)
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace CalamityMod.Tiles.Ores
|
||||
|
||||
public override bool CanExplode(int i, int j)
|
||||
{
|
||||
return CalamityWorld.downedYharon;
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void NumDust(int i, int j, bool fail, ref int num)
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace CalamityMod.Tiles.Ores
|
||||
|
||||
public override bool CanExplode(int i, int j)
|
||||
{
|
||||
return NPC.downedGolemBoss;
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void NumDust(int i, int j, bool fail, ref int num)
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace CalamityMod.Tiles.Ores
|
||||
|
||||
public override bool CanExplode(int i, int j)
|
||||
{
|
||||
return CalamityWorld.downedBrimstoneElemental;
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void NumDust(int i, int j, bool fail, ref int num)
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace CalamityMod.Tiles.Ores
|
||||
|
||||
public override bool CanExplode(int i, int j)
|
||||
{
|
||||
return CalamityWorld.downedCryogen;
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void NumDust(int i, int j, bool fail, ref int num)
|
||||
|
||||
@@ -28,7 +28,12 @@ namespace CalamityMod.Tiles.Ores
|
||||
base.SetDefaults();
|
||||
}
|
||||
|
||||
public override void NumDust(int i, int j, bool fail, ref int num)
|
||||
public override bool CanExplode(int i, int j)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void NumDust(int i, int j, bool fail, ref int num)
|
||||
{
|
||||
num = fail ? 2 : 4;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace CalamityMod.Tiles.Ores
|
||||
|
||||
public override bool CanExplode(int i, int j)
|
||||
{
|
||||
return NPC.downedPlantBoss;
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void NumDust(int i, int j, bool fail, ref int num)
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace CalamityMod.Tiles.Ores
|
||||
|
||||
public override bool CanExplode(int i, int j)
|
||||
{
|
||||
return NPC.downedMoonlord;
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void NumDust(int i, int j, bool fail, ref int num)
|
||||
|
||||
Reference in new issue
Block a user